diff --git a/DEPS b/DEPS
index 3330acfe..ec0cc429 100644
--- a/DEPS
+++ b/DEPS
@@ -145,7 +145,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling PDFium
   # and whatever else without interference from each other.
-  'pdfium_revision': 'b2bab1fee5345fef9c103cf9b20c381705485d4e',
+  'pdfium_revision': '13a5f9e46a5d24b65dc3593cd9972b508a9b75f7',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling openmax_dl
   # and whatever else without interference from each other.
@@ -181,7 +181,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': 'b9dbf6c17c965f7c49f017e59f9f7098d0ed1e8f',
+  'catapult_revision': '46e3f07075497c82c69b22e2261ef3d52075d489',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
@@ -229,11 +229,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'spv_tools_revision': '86d0d9be254a97cb532268bfcff1861bd562ceac',
+  'spv_tools_revision': '8915a7c8f120b5d75b915998f75a2fbbc4adf0b3',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'spv_headers_revision': 'f3abb280c2aacf677bc45293a1893b8493b63faf',
+  'spv_headers_revision': '8bea0a266ac9b718aa0818d9e3a47c0b77c2cb23',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -241,7 +241,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'shaderc_revision': '909f0d3d31e7e7c8f39b40ba0e1dd7f99b749776',
+  'shaderc_revision': 'ce7d92182b8cc9c72e99efb5fab1eae3c2084887',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -679,7 +679,7 @@
 
   # Build tools for Chrome OS. Note: This depends on third_party/pyelftools.
   'src/third_party/chromite': {
-      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'f580d49078627875f4564a12562bc4d01e1f7b26',
+      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'c4f1acd86f1d98d8869260938b3e9bb1b3999afa',
       'condition': 'checkout_linux',
   },
 
@@ -704,7 +704,7 @@
   },
 
   'src/third_party/depot_tools':
-    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '695e7cf352585cee87dd635e1c127339913c5717',
+    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '4d965ee2d8cc049726625170e54549f68a91e5e0',
 
   'src/third_party/devtools-node-modules':
     Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'),
@@ -1036,7 +1036,7 @@
   },
 
   'src/third_party/perfetto':
-    Var('android_git') + '/platform/external/perfetto.git' + '@' +  'ed17109c24b1213d359d8fa55d7104bf87180fdd',
+    Var('android_git') + '/platform/external/perfetto.git' + '@' +  '1fc4082ba1db4d19248f571881d9015a60f3b9af',
 
   'src/third_party/perl': {
       'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78',
@@ -1240,7 +1240,7 @@
     Var('chromium_git') + '/v8/v8.git' + '@' +  Var('v8_revision'),
 
   'src-internal': {
-    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@2d2052fde8d4cc5088a03f431433899955307445',
+    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@bb3f9060c4eaa5d47c9ec01c569d7485b5bf0397',
     'condition': 'checkout_src_internal',
   },
 
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 38a306d..7f2ec1b2 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -582,6 +582,15 @@
       False,
       (),
     ),
+    (
+      'GetAddressOf',
+      (
+        'Improper use of Microsoft::WRL::ComPtr<T>::GetAddressOf() has been ',
+        'implicated in a few leaks. Use operator& instead.'
+      ),
+      True,
+      (),
+    ),
 )
 
 
diff --git a/android_webview/browser/net_network_service/android_stream_reader_url_loader_unittest.cc b/android_webview/browser/net_network_service/android_stream_reader_url_loader_unittest.cc
index ced71a0..0ea9609 100644
--- a/android_webview/browser/net_network_service/android_stream_reader_url_loader_unittest.cc
+++ b/android_webview/browser/net_network_service/android_stream_reader_url_loader_unittest.cc
@@ -22,6 +22,16 @@
 
 const GURL kTestURL = GURL("https://www.example.com/");
 
+void VerifyHeaderNameAndValue(net::HttpResponseHeaders* headers,
+                              std::string header_name,
+                              std::string header_value) {
+  EXPECT_TRUE(headers->HasHeader(header_name));
+  std::string actual_header_value;
+  EXPECT_TRUE(
+      headers->EnumerateHeader(NULL, header_name, &actual_header_value));
+  EXPECT_EQ(header_value, actual_header_value);
+}
+
 }  // namespace
 
 // Always succeeds, depending on constructor uses the given string as contents
@@ -78,6 +88,14 @@
  public:
   TestResponseDelegate(std::unique_ptr<InputStream> input_stream)
       : input_stream_(std::move(input_stream)) {}
+  TestResponseDelegate(std::unique_ptr<InputStream> input_stream,
+                       const std::string& custom_status,
+                       const std::string& custom_header_name,
+                       const std::string& custom_header_value)
+      : input_stream_(std::move(input_stream)),
+        custom_status_(custom_status),
+        custom_header_name_(custom_header_name),
+        custom_header_value_(custom_header_value) {}
   ~TestResponseDelegate() override {}
 
   std::unique_ptr<android_webview::InputStream> OpenInputStream(
@@ -100,10 +118,24 @@
   }
 
   void AppendResponseHeaders(JNIEnv* env,
-                             net::HttpResponseHeaders* headers) override {}
+                             net::HttpResponseHeaders* headers) override {
+    if (custom_status_.empty() && custom_header_name_.empty() &&
+        custom_header_value_.empty()) {
+      // no-op
+      return;
+    }
+    headers->ReplaceStatusLine(custom_status_);
+    std::string header_line(custom_header_name_);
+    header_line.append(": ");
+    header_line.append(custom_header_value_);
+    headers->AddHeader(header_line);
+  }
 
  private:
   std::unique_ptr<InputStream> input_stream_;
+  const std::string custom_status_;
+  const std::string custom_header_name_;
+  const std::string custom_header_value_;
 };
 
 class AndroidStreamReaderURLLoaderTest : public ::testing::Test {
@@ -135,6 +167,23 @@
         std::make_unique<TestResponseDelegate>(std::move(input_stream)));
   }
 
+  // helper method for creating loaders given a stream and response header
+  // values
+  AndroidStreamReaderURLLoader* CreateLoaderWithCustomizedResponseHeader(
+      const network::ResourceRequest& request,
+      network::TestURLLoaderClient* client,
+      std::unique_ptr<InputStream> input_stream,
+      const std::string custom_status,
+      const std::string custom_header_name,
+      const std::string custom_header_value) {
+    return new AndroidStreamReaderURLLoader(
+        request, client->CreateInterfacePtr(),
+        net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS),
+        std::make_unique<TestResponseDelegate>(
+            std::move(input_stream), custom_status, custom_header_name,
+            custom_header_value));
+  }
+
   // Extracts the body data that is present in the consumer pipe
   // and returns it as a string.
   std::string ReadAvailableBody(network::TestURLLoaderClient* client) {
@@ -174,6 +223,8 @@
   EXPECT_EQ(net::OK, client->completion_status().error_code);
   EXPECT_EQ("HTTP/1.1 200 OK",
             client->response_head().headers->GetStatusLine());
+  VerifyHeaderNameAndValue(client->response_head().headers.get(), "Client-Via",
+                           "shouldInterceptRequest");
 }
 
 TEST_F(AndroidStreamReaderURLLoaderTest, ReadFailingStream) {
@@ -228,6 +279,8 @@
   EXPECT_EQ(net::OK, client->completion_status().error_code);
   EXPECT_EQ("HTTP/1.1 404 Not Found",
             client->response_head().headers->GetStatusLine());
+  VerifyHeaderNameAndValue(client->response_head().headers.get(), "Client-Via",
+                           "shouldInterceptRequest");
 }
 
 TEST_F(AndroidStreamReaderURLLoaderTest, ReadFakeStreamWithBody) {
@@ -243,6 +296,8 @@
   EXPECT_EQ(net::OK, client->completion_status().error_code);
   EXPECT_EQ("HTTP/1.1 200 OK",
             client->response_head().headers->GetStatusLine());
+  VerifyHeaderNameAndValue(client->response_head().headers.get(), "Client-Via",
+                           "shouldInterceptRequest");
   std::string body = ReadAvailableBody(client.get());
   EXPECT_EQ(expected_body, body);
 }
@@ -286,4 +341,29 @@
   EXPECT_EQ(net::ERR_ABORTED, client->completion_status().error_code);
 }
 
+TEST_F(AndroidStreamReaderURLLoaderTest, CustomResponseHeaderAndStatus) {
+  const std::string custom_status_line = "HTTP/1.1 401 Gone";
+  const std::string custom_header_name = "X-Test-Header";
+  const std::string custom_header_value = "TestHeaderValue";
+  network::ResourceRequest request = CreateRequest(kTestURL);
+
+  std::string expected_body("test");
+  std::unique_ptr<network::TestURLLoaderClient> client =
+      std::make_unique<network::TestURLLoaderClient>();
+  AndroidStreamReaderURLLoader* loader =
+      CreateLoaderWithCustomizedResponseHeader(
+          request, client.get(),
+          std::make_unique<FakeInputStream>(expected_body), custom_status_line,
+          custom_header_name, custom_header_value);
+  loader->Start();
+  client->RunUntilComplete();
+  EXPECT_EQ(net::OK, client->completion_status().error_code);
+  EXPECT_EQ(custom_status_line,
+            client->response_head().headers->GetStatusLine());
+  VerifyHeaderNameAndValue(client->response_head().headers.get(),
+                           custom_header_name, custom_header_value);
+  VerifyHeaderNameAndValue(client->response_head().headers.get(), "Client-Via",
+                           "shouldInterceptRequest");
+}
+
 }  // namespace android_webview
diff --git a/android_webview/docs/test-instructions.md b/android_webview/docs/test-instructions.md
index 628a5e77..169a2cca 100644
--- a/android_webview/docs/test-instructions.md
+++ b/android_webview/docs/test-instructions.md
@@ -3,7 +3,7 @@
 ## Android Instructions
 
 Please follow the instructions at
-[android_test_instructions.md](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_test_instructions.md).
+[android_test_instructions.md](/docs/android_test_instructions.md).
 This guide is an extension with WebView-specific content.
 
 *** note
@@ -28,6 +28,11 @@
 $ out/Default/bin/run_webview_instrumentation_test_apk -f AwContentsTest#*Succession # Any glob pattern matching 1 or more tests
 ```
 
+*** aside
+You can optionally use `ClassName.methodName` instead of `ClassName#methodName`;
+the chromium test runner understands either syntax.
+***
+
 ### Native unittests
 
 These are any `*_test.cc` or `*_unittest.cc` test under `//android_webview/`.
@@ -43,6 +48,27 @@
 $ out/Default/bin/run_android_webview_unittests -f AndroidStreamReaderURLRequestJobTest.* # Same glob patterns work here
 ```
 
+### Layout tests and page cycler tests
+
+WebView's layout tests and page cycler tests exercise the WebView installed on
+the system, instrumenting the WebView shell (`system_webview_shell_apk`,
+`org.chromium.webview_shell`). These test cases are defined in
+`//android_webview/tools/system_webview_shell/`.
+
+```sh
+# Build
+$ autoninja -C out/Default system_webview_shell_layout_test_apk
+
+# Install the desired WebView APK
+...
+
+# Run layout tests (installs WebView shell):
+$ out/Default/bin/run_system_webview_shell_layout_test_apk
+```
+
+To run page cycler tests instead, use the `system_webview_shell_page_cycler_apk`
+target and test runner in the steps above.
+
 ### Useful test runner options
 
 #### Debugging flaky tests
@@ -74,22 +100,25 @@
 All of these tests are end-to-end, so they exercise whatever WebView
 implementation you've installed and selected on your device. This also means you
 can enable Features and commandline flags the same way [as you would for
-production](https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/commandline-flags.md).
+production](./commandline-flags.md).
 ***
 
 ### CTS
 
 WebView has [CTS](https://source.android.com/compatibility/cts) tests, testing
-end-to-end behavior. These tests live in the Android source tree (under
-`//platform/cts/tests/tests/webkit/`).
+end-to-end behavior (using the WebView installed on the system). These tests
+live in the Android source tree (under `//platform/cts/tests/tests/webkit/`).
 
-Chromium developers can run these tests with:
+Chromium developers can download and run pre-built APKs for these test cases
+with:
 
 ```sh
+# Install the desired WebView APK
+...
+
+# Run pre-built WebView CTS tests:
 $ android_webview/tools/run_cts.py \
-    --arch=arm64 \ # Choose your device arch
-    --platform=M \ # CTS test suite version; must be <= device SDK level
-    --apk-dir="$HOME/run-cts-apk-dir" \ # Any folder, it's just a cache
+    --apk-dir="$HOME/run-cts-apk-dir" \ # Any folder, to use as an optional cache
     --verbose \ # Optional
     -f=android.webkit.cts.WebViewTest#* # Supports similar test filters
 ```
diff --git a/ash/app_list/views/app_list_view.cc b/ash/app_list/views/app_list_view.cc
index a1b7620..5a47afff 100644
--- a/ash/app_list/views/app_list_view.cc
+++ b/ash/app_list/views/app_list_view.cc
@@ -45,6 +45,7 @@
 #include "ui/gfx/skia_util.h"
 #include "ui/keyboard/keyboard_controller.h"
 #include "ui/strings/grit/ui_strings.h"
+#include "ui/views/accessibility/view_accessibility.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/textfield/textfield.h"
 #include "ui/views/layout/fill_layout.h"
@@ -478,11 +479,6 @@
   UpdateAppListBackgroundYPosition();
 }
 
-void AppListView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
-  node_data->SetName(state_announcement_);
-  node_data->role = ax::mojom::Role::kAlert;
-}
-
 ax::mojom::Role AppListView::GetAccessibleWindowRole() const {
   // Default role of root view is ax::mojom::Role::kWindow which traps ChromeVox
   // focus within the root view. Assign ax::mojom::Role::kGroup here to allow
@@ -549,6 +545,9 @@
   search_box_view_->Init();
 
   app_list_main_view_->Init(0, search_box_view_);
+
+  announcement_view_ = new views::View;
+  AddChildView(announcement_view_);
 }
 
 void AppListView::InitChildWidgets() {
@@ -887,17 +886,17 @@
       new_state != AppListViewState::FULLSCREEN_ALL_APPS)
     return;
 
-  DCHECK(state_announcement_ == base::string16());
+  base::string16 state_announcement;
 
   if (new_state == AppListViewState::PEEKING) {
-    state_announcement_ = l10n_util::GetStringUTF16(
+    state_announcement = l10n_util::GetStringUTF16(
         IDS_APP_LIST_SUGGESTED_APPS_ACCESSIBILITY_ANNOUNCEMENT);
   } else {
-    state_announcement_ = l10n_util::GetStringUTF16(
+    state_announcement = l10n_util::GetStringUTF16(
         IDS_APP_LIST_ALL_APPS_ACCESSIBILITY_ANNOUNCEMENT);
   }
-  NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
-  state_announcement_ = base::string16();
+  announcement_view_->GetViewAccessibility().OverrideName(state_announcement);
+  announcement_view_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
 }
 
 display::Display AppListView::GetDisplayNearestView() const {
diff --git a/ash/app_list/views/app_list_view.h b/ash/app_list/views/app_list_view.h
index 219b7358..1f470a98 100644
--- a/ash/app_list/views/app_list_view.h
+++ b/ash/app_list/views/app_list_view.h
@@ -131,7 +131,6 @@
   bool CanProcessEventsWithinSubtree() const override;
   bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
   void Layout() override;
-  void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
 
   // WidgetDelegate:
   ax::mojom::Role GetAccessibleWindowRole() const override;
@@ -404,9 +403,6 @@
   // True if the dragging started from PEEKING state.
   bool drag_started_from_peeking_ = false;
 
-  // Accessibility announcement dialogue.
-  base::string16 state_announcement_;
-
   // Metric reporter for state change animations.
   const std::unique_ptr<ui::AnimationMetricsReporter>
       state_animation_metrics_reporter_;
@@ -414,6 +410,9 @@
   // Whether the on-screen keyboard is shown.
   bool onscreen_keyboard_shown_ = false;
 
+  // View used to announce the state transition for peeking and fullscreen.
+  views::View* announcement_view_;  // Owned by AppListView.
+
   base::WeakPtrFactory<AppListView> weak_ptr_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(AppListView);
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc
index ef994a1..078846c 100644
--- a/ash/app_list/views/apps_grid_view.cc
+++ b/ash/app_list/views/apps_grid_view.cc
@@ -54,6 +54,7 @@
 #include "ui/views/border.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/textfield/textfield.h"
+#include "ui/views/paint_info.h"
 #include "ui/views/view_model_utils.h"
 #include "ui/views/widget/widget.h"
 
@@ -248,7 +249,18 @@
     gfx::Rect top_rect(0, 0, size.width(), kFadeoutZoneHeight);
     gfx::Rect bottom_rect(0, size.height() - kFadeoutZoneHeight, size.width(),
                           kFadeoutZoneHeight);
-    ui::PaintRecorder recorder(context, size);
+
+    views::PaintInfo paint_info =
+        views::PaintInfo::CreateRootPaintInfo(context, size);
+    const auto& prs = paint_info.paint_recording_size();
+
+    //  Pass the scale factor when constructing PaintRecorder so the MaskLayer
+    //  size is not incorrectly rounded (see https://crbug.com/921274).
+    ui::PaintRecorder recorder(context, paint_info.paint_recording_size(),
+                               static_cast<float>(prs.width()) / size.width(),
+                               static_cast<float>(prs.height()) / size.height(),
+                               nullptr);
+
     gfx::Canvas* canvas = recorder.canvas();
     // Clear the canvas.
     canvas->DrawColor(SK_ColorBLACK, SkBlendMode::kSrc);
@@ -816,7 +828,7 @@
 
 bool AppsGridView::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   // TODO(koz): Only accept a specific drag type for app shortcuts.
   *formats = OSExchangeData::FILE_NAME;
   return true;
diff --git a/ash/app_list/views/apps_grid_view.h b/ash/app_list/views/apps_grid_view.h
index 9beb31c..c772e39 100644
--- a/ash/app_list/views/apps_grid_view.h
+++ b/ash/app_list/views/apps_grid_view.h
@@ -178,9 +178,8 @@
   bool OnKeyPressed(const ui::KeyEvent& event) override;
   void ViewHierarchyChanged(
       const ViewHierarchyChangedDetails& details) override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool CanDrop(const OSExchangeData& data) override;
   int OnDragUpdated(const ui::DropTargetEvent& event) override;
   const char* GetClassName() const override;
diff --git a/ash/app_list/views/contents_view.cc b/ash/app_list/views/contents_view.cc
index 5a45484..b7ffdc5 100644
--- a/ash/app_list/views/contents_view.cc
+++ b/ash/app_list/views/contents_view.cc
@@ -30,6 +30,7 @@
 #include "ui/display/screen.h"
 #include "ui/events/event.h"
 #include "ui/keyboard/keyboard_controller.h"
+#include "ui/views/accessibility/view_accessibility.h"
 #include "ui/views/view_model.h"
 #include "ui/views/widget/widget.h"
 
@@ -353,15 +354,21 @@
 
 void ContentsView::UpdateExpandArrowFocusBehavior(
     ash::AppListState current_state) {
-  if (current_state == ash::AppListState::kStateStart) {
-    // The expand arrow is only focusable and has InkDropMode on in peeking
-    // state.
-    expand_arrow_view_->SetFocusBehavior(FocusBehavior::ALWAYS);
-    expand_arrow_view_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON);
-    return;
-  }
-  expand_arrow_view_->SetInkDropMode(views::InkDropHostView::InkDropMode::OFF);
-  expand_arrow_view_->SetFocusBehavior(FocusBehavior::NEVER);
+  bool state_start = current_state == ash::AppListState::kStateStart;
+
+  // The expand arrow is only focusable and has InkDropMode on in peeking
+  // state.
+  expand_arrow_view_->SetFocusBehavior(state_start ? FocusBehavior::ALWAYS
+                                                   : FocusBehavior::NEVER);
+  expand_arrow_view_->SetInkDropMode(
+      state_start ? views::InkDropHostView::InkDropMode::ON
+                  : views::InkDropHostView::InkDropMode::OFF);
+
+  // Allow ChromeVox to focus the expand arrow only when peeking launcher.
+  expand_arrow_view_->GetViewAccessibility().OverrideIsIgnored(
+      state_start ? false : true);
+  expand_arrow_view_->GetViewAccessibility().NotifyAccessibilityEvent(
+      ax::mojom::Event::kTreeChanged);
 }
 
 PaginationModel* ContentsView::GetAppsPaginationModel() {
diff --git a/ash/assistant/ui/assistant_view_delegate.h b/ash/assistant/ui/assistant_view_delegate.h
index fff9c3e..309410b 100644
--- a/ash/assistant/ui/assistant_view_delegate.h
+++ b/ash/assistant/ui/assistant_view_delegate.h
@@ -5,6 +5,10 @@
 #ifndef ASH_ASSISTANT_UI_ASSISTANT_VIEW_DELEGATE_H_
 #define ASH_ASSISTANT_UI_ASSISTANT_VIEW_DELEGATE_H_
 
+#include <map>
+#include <string>
+#include <vector>
+
 #include "ash/assistant/model/assistant_cache_model.h"
 #include "ash/assistant/model/assistant_cache_model_observer.h"
 #include "ash/assistant/model/assistant_interaction_model.h"
@@ -52,7 +56,7 @@
   // Gets the cache model associated with the view delegate.
   virtual const AssistantCacheModel* GetCacheModel() const = 0;
 
-  // Gets the interactoin model associated with the view delegate.
+  // Gets the interaction model associated with the view delegate.
   virtual const AssistantInteractionModel* GetInteractionModel() const = 0;
 
   // Gets the ui model associated with the view delegate.
diff --git a/ash/assistant/ui/caption_bar.cc b/ash/assistant/ui/caption_bar.cc
index b8145135..c7f7229 100644
--- a/ash/assistant/ui/caption_bar.cc
+++ b/ash/assistant/ui/caption_bar.cc
@@ -58,6 +58,14 @@
     case ui::VKEY_BROWSER_BACK:
       HandleButton(AssistantButtonId::kBack);
       break;
+    case ui::VKEY_W:
+      if (accelerator.IsCtrlDown())
+        HandleButton(AssistantButtonId::kClose);
+      else {
+        NOTREACHED();
+        return false;
+      }
+      break;
     default:
       NOTREACHED();
       return false;
@@ -119,6 +127,8 @@
                           AssistantButtonId::kClose, this);
   AddChildView(close_button);
 
+  // Add a keyboard accelerator Ctrl + W to close Assistant UI.
+  AddAccelerator(ui::Accelerator(ui::VKEY_W, ui::EF_CONTROL_DOWN));
   AddAccelerator(ui::Accelerator(ui::VKEY_BROWSER_BACK, ui::EF_NONE));
 }
 
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index e716d95..40e15f7 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -91,7 +91,7 @@
 
   bool GetDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override {
+      std::set<ui::ClipboardFormatType>* format_types) override {
     *formats = ui::OSExchangeData::STRING;
     return true;
   }
@@ -615,7 +615,7 @@
     ui::ScopedClipboardWriter scw(ui::CLIPBOARD_TYPE_COPY_PASTE);
     scw.WriteText(base::ASCIIToUTF16(clip_str));
   }
-  EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
+  EXPECT_TRUE(cb->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(),
                                     ui::CLIPBOARD_TYPE_COPY_PASTE));
 
   std::unique_ptr<views::Widget> widget = CreateTestWidget();
@@ -636,7 +636,7 @@
 
   // Verify the clipboard contents haven't changed
   std::string result;
-  EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
+  EXPECT_TRUE(cb->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(),
                                     ui::CLIPBOARD_TYPE_COPY_PASTE));
   cb->ReadAsciiText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
   EXPECT_EQ(clip_str, result);
diff --git a/ash/drag_drop/drag_drop_interactive_uitest.cc b/ash/drag_drop/drag_drop_interactive_uitest.cc
index 5b76232..6871093 100644
--- a/ash/drag_drop/drag_drop_interactive_uitest.cc
+++ b/ash/drag_drop/drag_drop_interactive_uitest.cc
@@ -44,7 +44,7 @@
   // views::View overrides:
   bool GetDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override {
+      std::set<ui::ClipboardFormatType>* format_types) override {
     *formats = ui::OSExchangeData::STRING;
     return true;
   }
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc b/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc
index 29acc10..a3171f0f 100644
--- a/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc
+++ b/ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc
@@ -174,8 +174,7 @@
   ASSERT_EQ(initial_close_button_bounds.x(),
             initial_size_button_bounds.right());
 
-  // Hidden size button should result in minimize button animating to the
-  // right. The size button should not be visible, but should not have moved.
+  // Button positions should be the same when entering tablet mode.
   Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
   container.UpdateCaptionButtonState(false /*=animate*/);
   test.EndAnimations();
@@ -183,20 +182,21 @@
   container.Layout();
 
   EXPECT_TRUE(test.minimize_button()->visible());
-  EXPECT_FALSE(test.size_button()->visible());
+  EXPECT_TRUE(test.size_button()->visible());
   EXPECT_TRUE(test.close_button()->visible());
   gfx::Rect extra_button_bounds = extra_button->bounds();
   gfx::Rect minimize_button_bounds = test.minimize_button()->bounds();
+  gfx::Rect size_button_bounds = test.size_button()->bounds();
   gfx::Rect close_button_bounds = test.close_button()->bounds();
   EXPECT_EQ(minimize_button_bounds.x(), extra_button_bounds.right());
-  EXPECT_EQ(close_button_bounds.x(), minimize_button_bounds.right());
+  EXPECT_EQ(size_button_bounds.x(), minimize_button_bounds.right());
+  EXPECT_EQ(close_button_bounds.x(), size_button_bounds.right());
   EXPECT_EQ(initial_size_button_bounds, test.size_button()->bounds());
   EXPECT_EQ(initial_close_button_bounds.size(), close_button_bounds.size());
-  EXPECT_LT(container.GetPreferredSize().width(),
+  EXPECT_EQ(container.GetPreferredSize().width(),
             initial_container_bounds.width());
 
-  // Revealing the size button should cause the minimize button to return to its
-  // original position.
+  // Button positions should be the same when leaving tablet mode.
   Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
   container.UpdateCaptionButtonState(false /*=animate*/);
   // Calling code needs to layout in response to size change.
diff --git a/ash/frame/non_client_frame_view_ash_unittest.cc b/ash/frame/non_client_frame_view_ash_unittest.cc
index cf4bc85d..9b386c2f 100644
--- a/ash/frame/non_client_frame_view_ash_unittest.cc
+++ b/ash/frame/non_client_frame_view_ash_unittest.cc
@@ -263,28 +263,6 @@
   EXPECT_FALSE(non_client_frame_view->GetAvatarIconViewForTest());
 }
 
-// The visibility of the size button is updated when tablet mode is toggled.
-// Verify that the layout of the HeaderView is updated for the size button's
-// new visibility.
-TEST_F(NonClientFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) {
-  TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate;
-  std::unique_ptr<views::Widget> widget = CreateTestWidget(
-      delegate, kShellWindowId_DefaultContainer, gfx::Rect(0, 0, 400, 500));
-
-  const gfx::Rect initial =
-      delegate->GetFrameCaptionButtonContainerViewBounds();
-  Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
-  delegate->EndFrameCaptionButtonContainerViewAnimations();
-  const gfx::Rect tablet_mode_bounds =
-      delegate->GetFrameCaptionButtonContainerViewBounds();
-  EXPECT_GT(initial.width(), tablet_mode_bounds.width());
-  Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
-  delegate->EndFrameCaptionButtonContainerViewAnimations();
-  const gfx::Rect after_restore =
-      delegate->GetFrameCaptionButtonContainerViewBounds();
-  EXPECT_EQ(initial, after_restore);
-}
-
 // Tests that a window is minimized, toggling tablet mode doesn't trigger
 // caption button update (https://crbug.com/822890).
 TEST_F(NonClientFrameViewAshTest, ToggleTabletModeOnMinimizedWindow) {
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index 601b19f6..976381d 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -4,6 +4,7 @@
 
 #include "ash/magnifier/magnification_controller.h"
 
+#include <algorithm>
 #include <memory>
 #include <utility>
 #include <vector>
@@ -490,14 +491,14 @@
     SwitchTargetRootWindow(current_root, true);
 }
 
-ui::EventRewriteStatus MagnificationController::RewriteEvent(
+ui::EventDispatchDetails MagnificationController::RewriteEvent(
     const ui::Event& event,
-    std::unique_ptr<ui::Event>* rewritten_event) {
+    const base::WeakPtr<Continuation> continuation) {
   if (!IsEnabled())
-    return ui::EVENT_REWRITE_CONTINUE;
+    return SendEvent(continuation, &event);
 
   if (!event.IsTouchEvent())
-    return ui::EVENT_REWRITE_CONTINUE;
+    return SendEvent(continuation, &event);
 
   const ui::TouchEvent* touch_event = event.AsTouchEvent();
 
@@ -516,7 +517,7 @@
         touch_event_copy.unique_event_id(), false /* event_consumed */,
         false /* is_source_touch_event_set_non_blocking */);
   } else {
-    return ui::EVENT_REWRITE_DISCARD;
+    return DiscardEvent(continuation);
   }
 
   // User can change zoom level with two fingers pinch and pan around with two
@@ -547,12 +548,13 @@
       // TouchExplorationController confused. Send cancelled event for recorded
       // touch events to the next event rewriter here instead of rewriting an
       // event in the stream.
-      SendEventToEventSource(root_window_->GetHost()->GetEventSource(),
-                             &touch_cancel_event);
+      ui::EventDispatchDetails details =
+          SendEvent(continuation, &touch_cancel_event);
+      if (details.dispatcher_destroyed || details.target_destroyed)
+        return details;
     }
     press_event_map_.clear();
   }
-
   bool discard = consume_touch_event_;
 
   // Reset state once no point is touched on the screen.
@@ -570,16 +572,9 @@
   }
 
   if (discard)
-    return ui::EVENT_REWRITE_DISCARD;
+    return DiscardEvent(continuation);
 
-  return ui::EVENT_REWRITE_CONTINUE;
-}
-
-ui::EventRewriteStatus MagnificationController::NextDispatchEvent(
-    const ui::Event& last_event,
-    std::unique_ptr<ui::Event>* new_event) {
-  NOTREACHED();
-  return ui::EVENT_REWRITE_CONTINUE;
+  return SendEvent(continuation, &event);
 }
 
 bool MagnificationController::Redraw(const gfx::PointF& position,
diff --git a/ash/magnifier/magnification_controller.h b/ash/magnifier/magnification_controller.h
index 119d396..8dc92a4f 100644
--- a/ash/magnifier/magnification_controller.h
+++ b/ash/magnifier/magnification_controller.h
@@ -164,12 +164,9 @@
   void OnTouchEvent(ui::TouchEvent* event) override;
 
   // ui::EventRewriter overrides:
-  ui::EventRewriteStatus RewriteEvent(
+  ui::EventDispatchDetails RewriteEvent(
       const ui::Event& event,
-      std::unique_ptr<ui::Event>* new_event) override;
-  ui::EventRewriteStatus NextDispatchEvent(
-      const ui::Event& last_event,
-      std::unique_ptr<ui::Event>* new_event) override;
+      const base::WeakPtr<Continuation> continuation) override;
 
   // Redraws the magnification window with the given origin position and the
   // given scale. Returns true if the window is changed; otherwise, false.
diff --git a/ash/public/cpp/ash_switches.h b/ash/public/cpp/ash_switches.h
index 76ae978..7b7d7f2e 100644
--- a/ash/public/cpp/ash_switches.h
+++ b/ash/public/cpp/ash_switches.h
@@ -54,7 +54,6 @@
 ASH_PUBLIC_EXPORT extern const char kSuppressMessageCenterPopups[];
 ASH_PUBLIC_EXPORT extern const char kTouchscreenUsableWhileScreenOff[];
 
-ASH_PUBLIC_EXPORT bool IsTrilinearFilteringEnabled();
 ASH_PUBLIC_EXPORT bool IsUsingViewsLock();
 
 }  // namespace switches
diff --git a/ash/public/cpp/caption_buttons/frame_caption_button_container_view.cc b/ash/public/cpp/caption_buttons/frame_caption_button_container_view.cc
index 0f46a43a..01c34c7 100644
--- a/ash/public/cpp/caption_buttons/frame_caption_button_container_view.cc
+++ b/ash/public/cpp/caption_buttons/frame_caption_button_container_view.cc
@@ -113,8 +113,7 @@
       case views::CAPTION_BUTTON_ICON_MINIMIZE:
         return frame_->widget_delegate()->CanMinimize();
       case views::CAPTION_BUTTON_ICON_MAXIMIZE_RESTORE:
-        return !TabletMode::IsEnabled() &&
-               frame_->widget_delegate()->CanMaximize();
+        return frame_->widget_delegate()->CanMaximize();
       // Resizable widget can be snapped.
       case views::CAPTION_BUTTON_ICON_LEFT_SNAPPED:
       case views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED:
diff --git a/ash/system/network/network_icon.cc b/ash/system/network/network_icon.cc
index ae0f6c6..0aa6e0e 100644
--- a/ash/system/network/network_icon.cc
+++ b/ash/system/network/network_icon.cc
@@ -14,7 +14,6 @@
 #include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/vector_icons/vector_icons.h"
-#include "chromeos/network/device_state.h"
 #include "chromeos/network/network_connection_handler.h"
 #include "chromeos/network/network_state.h"
 #include "chromeos/network/network_state_handler.h"
@@ -28,7 +27,6 @@
 #include "ui/gfx/skia_util.h"
 #include "ui/gfx/vector_icon_types.h"
 
-using chromeos::DeviceState;
 using chromeos::NetworkConnectionHandler;
 using chromeos::NetworkHandler;
 using chromeos::NetworkPortalDetector;
@@ -92,7 +90,7 @@
   Badge vpn_badge_ = {};
 
   // Cached roaming state of the network when the icon was last generated.
-  std::string roaming_state_;
+  bool is_roaming_;
 
   // Cached portal state of the network when the icon was last generated.
   bool behind_captive_portal_;
@@ -439,9 +437,9 @@
     technology_badge_ = technology_badge;
     dirty = true;
   }
-  std::string roaming_state = network->roaming();
-  if (roaming_state != roaming_state_) {
-    roaming_state_ = roaming_state;
+  bool is_roaming = network->IndicateRoaming();
+  if (is_roaming != is_roaming_) {
+    is_roaming_ = is_roaming;
     dirty = true;
   }
   return dirty;
@@ -492,18 +490,8 @@
     technology_badge_ = {&kNetworkBadgeTechnology4gIcon, icon_color};
   } else if (type == shill::kTypeCellular) {
     // technology_badge_ is set in UpdateCellularState.
-    if (network->IsConnectedState() &&
-        network->roaming() == shill::kRoamingStateRoaming) {
-      // For networks that are always in roaming don't show roaming badge.
-      const DeviceState* device =
-          NetworkHandler::Get()->network_state_handler()->GetDeviceState(
-              network->device_path());
-      LOG_IF(WARNING, !device)
-          << "Could not find device state for " << network->device_path();
-      if (!device || !device->provider_requires_roaming()) {
-        badges->bottom_right = {&kNetworkBadgeRoamingIcon, icon_color};
-      }
-    }
+    if (network->IsConnectedState() && network->IndicateRoaming())
+      badges->bottom_right = {&kNetworkBadgeRoamingIcon, icon_color};
   }
   // Only show technology, VPN, and captive portal badges when connected.
   if (network->IsConnectedState()) {
diff --git a/ash/system/network/tray_network_state_observer.cc b/ash/system/network/tray_network_state_observer.cc
index f002def..bd31136 100644
--- a/ash/system/network/tray_network_state_observer.cc
+++ b/ash/system/network/tray_network_state_observer.cc
@@ -86,11 +86,6 @@
   SignalUpdate(false /* notify_a11y */);
 }
 
-void TrayNetworkStateObserver::DevicePropertiesUpdated(
-    const chromeos::DeviceState* device) {
-  SignalUpdate(false /* notify_a11y */);
-}
-
 void TrayNetworkStateObserver::OnPortalDetectionCompleted(
     const chromeos::NetworkState* network,
     const chromeos::NetworkPortalDetector::CaptivePortalState& state) {
diff --git a/ash/system/network/tray_network_state_observer.h b/ash/system/network/tray_network_state_observer.h
index 7716cf8..2ec5e36 100644
--- a/ash/system/network/tray_network_state_observer.h
+++ b/ash/system/network/tray_network_state_observer.h
@@ -37,7 +37,6 @@
   void NetworkConnectionStateChanged(
       const chromeos::NetworkState* network) override;
   void NetworkPropertiesUpdated(const chromeos::NetworkState* network) override;
-  void DevicePropertiesUpdated(const chromeos::DeviceState* device) override;
 
   // NetworkPortalDetector::Observer
   void OnPortalDetectionCompleted(
diff --git a/ash/wm/tablet_mode/tablet_mode_controller.cc b/ash/wm/tablet_mode/tablet_mode_controller.cc
index 9fd176e..3edd72e 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller.cc
+++ b/ash/wm/tablet_mode/tablet_mode_controller.cc
@@ -11,6 +11,7 @@
 #include "ash/root_window_controller.h"
 #include "ash/shell.h"
 #include "ash/shell_delegate.h"
+#include "ash/wm/overview/overview_controller.h"
 #include "ash/wm/tablet_mode/internal_input_devices_event_blocker.h"
 #include "ash/wm/tablet_mode/tablet_mode_observer.h"
 #include "ash/wm/tablet_mode/tablet_mode_window_manager.h"
@@ -194,6 +195,17 @@
     for (auto& observer : tablet_mode_observers_)
       observer.OnTabletModeStarted();
 
+    // In some cases, TabletModeWindowManager::TabletModeWindowManager uses
+    // split view to represent windows that were snapped in desktop mode. If
+    // there is a window snapped on one side but no window snapped on the other
+    // side, then overview mode should be started (to be seen on the side with
+    // no snapped window).
+    const auto state = Shell::Get()->split_view_controller()->state();
+    if (state == SplitViewController::LEFT_SNAPPED ||
+        state == SplitViewController::RIGHT_SNAPPED) {
+      Shell::Get()->overview_controller()->ToggleOverview();
+    }
+
     if (client_)  // Null at startup and in tests.
       client_->OnTabletModeToggled(true);
     VLOG(1) << "Enter tablet mode.";
diff --git a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc b/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
index 64bac6a5..fdf6d6f5 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
+++ b/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
@@ -10,6 +10,7 @@
 
 #include "ash/accelerometer/accelerometer_reader.h"
 #include "ash/accelerometer/accelerometer_types.h"
+#include "ash/app_list/app_list_controller_impl.h"
 #include "ash/display/screen_orientation_controller.h"
 #include "ash/public/cpp/ash_switches.h"
 #include "ash/public/cpp/tablet_mode.h"
@@ -17,6 +18,7 @@
 #include "ash/test/ash_test_base.h"
 #include "ash/wm/overview/overview_controller.h"
 #include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h"
+#include "ash/wm/wm_event.h"
 #include "base/command_line.h"
 #include "base/run_loop.h"
 #include "base/test/metrics/histogram_tester.h"
@@ -33,6 +35,7 @@
 #include "ui/events/test/event_generator.h"
 #include "ui/gfx/geometry/vector3d_f.h"
 #include "ui/message_center/message_center.h"
+#include "ui/wm/core/window_util.h"
 
 namespace ash {
 
@@ -137,6 +140,22 @@
 
   base::UserActionTester* user_action_tester() { return &user_action_tester_; }
 
+  // Creates a test window snapped on the left in desktop mode.
+  std::unique_ptr<aura::Window> CreateDesktopWindowSnappedLeft() {
+    std::unique_ptr<aura::Window> window = CreateTestWindow();
+    wm::WMEvent snap_to_left(wm::WM_EVENT_CYCLE_SNAP_LEFT);
+    wm::GetWindowState(window.get())->OnWMEvent(&snap_to_left);
+    return window;
+  }
+
+  // Creates a test window snapped on the right in desktop mode.
+  std::unique_ptr<aura::Window> CreateDesktopWindowSnappedRight() {
+    std::unique_ptr<aura::Window> window = CreateTestWindow();
+    wm::WMEvent snap_to_right(wm::WM_EVENT_CYCLE_SNAP_RIGHT);
+    wm::GetWindowState(window.get())->OnWMEvent(&snap_to_right);
+    return window;
+  }
+
  private:
   std::unique_ptr<TabletModeControllerTestApi> test_api_;
 
@@ -1047,4 +1066,88 @@
   EXPECT_FALSE(AreEventsBlocked());
 }
 
+// Test that if the active window is not snapped before tablet mode, then split
+// view is not activated.
+TEST_F(TabletModeControllerTest, StartTabletActiveNoSnap) {
+  SplitViewController* split_view_controller =
+      Shell::Get()->split_view_controller();
+  std::unique_ptr<aura::Window> window = CreateTestWindow();
+  ::wm::ActivateWindow(window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  EXPECT_EQ(SplitViewController::NO_SNAP, split_view_controller->state());
+  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
+}
+
+// Test that if the active window is snapped on the left before tablet mode,
+// then split view is activated with the active window on the left.
+TEST_F(TabletModeControllerTest, StartTabletActiveLeftSnap) {
+  SplitViewController* split_view_controller =
+      Shell::Get()->split_view_controller();
+  std::unique_ptr<aura::Window> window = CreateDesktopWindowSnappedLeft();
+  ::wm::ActivateWindow(window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  EXPECT_EQ(SplitViewController::LEFT_SNAPPED, split_view_controller->state());
+  EXPECT_EQ(window.get(), split_view_controller->left_window());
+  EXPECT_TRUE(Shell::Get()->overview_controller()->IsSelecting());
+}
+
+// Test that if the active window is snapped on the right before tablet mode,
+// then split view is activated with the active window on the right.
+TEST_F(TabletModeControllerTest, StartTabletActiveRightSnap) {
+  SplitViewController* split_view_controller =
+      Shell::Get()->split_view_controller();
+  std::unique_ptr<aura::Window> window = CreateDesktopWindowSnappedRight();
+  ::wm::ActivateWindow(window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  EXPECT_EQ(SplitViewController::RIGHT_SNAPPED, split_view_controller->state());
+  EXPECT_EQ(window.get(), split_view_controller->right_window());
+  EXPECT_TRUE(Shell::Get()->overview_controller()->IsSelecting());
+}
+
+// Test that if before tablet mode, the active window is snapped on the left and
+// the previous window is snapped on the right, then split view is activated
+// with the active window on the left and the previous window on the right.
+TEST_F(TabletModeControllerTest, StartTabletActiveLeftSnapPreviousRightSnap) {
+  SplitViewController* split_view_controller =
+      Shell::Get()->split_view_controller();
+  std::unique_ptr<aura::Window> left_window = CreateDesktopWindowSnappedLeft();
+  std::unique_ptr<aura::Window> right_window =
+      CreateDesktopWindowSnappedRight();
+  ::wm::ActivateWindow(left_window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  EXPECT_EQ(SplitViewController::BOTH_SNAPPED, split_view_controller->state());
+  EXPECT_EQ(left_window.get(), split_view_controller->left_window());
+  EXPECT_EQ(right_window.get(), split_view_controller->right_window());
+  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
+}
+
+// Test that if before tablet mode, the active window is snapped on the right
+// and the previous window is snapped on the left, then split view is activated
+// with the active window on the right and the previous window on the left.
+TEST_F(TabletModeControllerTest, StartTabletActiveRightSnapPreviousLeftSnap) {
+  SplitViewController* split_view_controller =
+      Shell::Get()->split_view_controller();
+  std::unique_ptr<aura::Window> left_window = CreateDesktopWindowSnappedLeft();
+  std::unique_ptr<aura::Window> right_window =
+      CreateDesktopWindowSnappedRight();
+  ::wm::ActivateWindow(left_window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  EXPECT_EQ(SplitViewController::BOTH_SNAPPED, split_view_controller->state());
+  EXPECT_EQ(left_window.get(), split_view_controller->left_window());
+  EXPECT_EQ(right_window.get(), split_view_controller->right_window());
+  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
+}
+
+// Test that if overview is triggered on entering tablet mode, then the app list
+// can still be successfully shown and actually seen.
+TEST_F(TabletModeControllerTest, AppListWorksAfterEnteringTabletForOverview) {
+  AppListControllerImpl* app_list_controller =
+      Shell::Get()->app_list_controller();
+  std::unique_ptr<aura::Window> window = CreateDesktopWindowSnappedLeft();
+  ::wm::ActivateWindow(window.get());
+  tablet_mode_controller()->EnableTabletModeWindowManager(true);
+  app_list_controller->ShowAppList();
+  EXPECT_TRUE(app_list_controller->IsVisible());
+}
+
 }  // namespace ash
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager.cc b/ash/wm/tablet_mode/tablet_mode_window_manager.cc
index b3d84a2..52978d4e 100644
--- a/ash/wm/tablet_mode/tablet_mode_window_manager.cc
+++ b/ash/wm/tablet_mode/tablet_mode_window_manager.cc
@@ -345,9 +345,7 @@
   SplitViewController* split_view_controller =
       Shell::Get()->split_view_controller();
   split_view_controller->SnapWindow(windows[0], curr_win_snap_pos);
-  if (prev_win_snap_pos == SplitViewController::NONE)
-    Shell::Get()->overview_controller()->ToggleOverview();
-  else
+  if (prev_win_snap_pos != SplitViewController::NONE)
     split_view_controller->SnapWindow(windows[1], prev_win_snap_pos);
 
   for (auto* window : windows)
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc
index c602c1d..7486fd8 100644
--- a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc
+++ b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc
@@ -170,22 +170,6 @@
     return window;
   }
 
-  // Creates a test window snapped on the left in desktop mode.
-  std::unique_ptr<aura::Window> CreateDesktopWindowSnappedLeft() {
-    std::unique_ptr<aura::Window> window = CreateTestWindow();
-    wm::WMEvent snap_to_left(wm::WMEventType::WM_EVENT_CYCLE_SNAP_LEFT);
-    wm::GetWindowState(window.get())->OnWMEvent(&snap_to_left);
-    return window;
-  }
-
-  // Creates a test window snapped on the right in desktop mode.
-  std::unique_ptr<aura::Window> CreateDesktopWindowSnappedRight() {
-    std::unique_ptr<aura::Window> window = CreateTestWindow();
-    wm::WMEvent snap_to_right(wm::WMEventType::WM_EVENT_CYCLE_SNAP_RIGHT);
-    wm::GetWindowState(window.get())->OnWMEvent(&snap_to_right);
-    return window;
-  }
-
  private:
   DISALLOW_COPY_AND_ASSIGN(TabletModeWindowManagerTest);
 };
@@ -1830,76 +1814,4 @@
   EXPECT_EQ(rect.size(), child->bounds().size());
 }
 
-// Test that if the active window is not snapped before tablet mode, then
-// neither split view nor overview is activated.
-TEST_F(TabletModeWindowManagerTest, ActiveNoSnap) {
-  SplitViewController* split_view_controller =
-      Shell::Get()->split_view_controller();
-  std::unique_ptr<aura::Window> window = CreateTestWindow();
-  ::wm::ActivateWindow(window.get());
-  ASSERT_TRUE(CreateTabletModeWindowManager());
-  EXPECT_EQ(SplitViewController::NO_SNAP, split_view_controller->state());
-  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
-}
-
-// Test that if the active window is snapped on the left before tablet mode,
-// then split view is activated with the active window on the left.
-TEST_F(TabletModeWindowManagerTest, ActiveLeftSnap) {
-  SplitViewController* split_view_controller =
-      Shell::Get()->split_view_controller();
-  std::unique_ptr<aura::Window> window = CreateDesktopWindowSnappedLeft();
-  ::wm::ActivateWindow(window.get());
-  ASSERT_TRUE(CreateTabletModeWindowManager());
-  EXPECT_EQ(SplitViewController::LEFT_SNAPPED, split_view_controller->state());
-  EXPECT_EQ(window.get(), split_view_controller->left_window());
-  EXPECT_TRUE(Shell::Get()->overview_controller()->IsSelecting());
-}
-
-// Test that if the active window is snapped on the right before tablet mode,
-// then split view is activated with the active window on the right.
-TEST_F(TabletModeWindowManagerTest, ActiveRightSnap) {
-  SplitViewController* split_view_controller =
-      Shell::Get()->split_view_controller();
-  std::unique_ptr<aura::Window> window = CreateDesktopWindowSnappedRight();
-  ::wm::ActivateWindow(window.get());
-  ASSERT_TRUE(CreateTabletModeWindowManager());
-  EXPECT_EQ(SplitViewController::RIGHT_SNAPPED, split_view_controller->state());
-  EXPECT_EQ(window.get(), split_view_controller->right_window());
-  EXPECT_TRUE(Shell::Get()->overview_controller()->IsSelecting());
-}
-
-// Test that if before tablet mode, the active window is snapped on the left and
-// the previous window is snapped on the right, then split view is activated
-// with the active window on the left and the previous window on the right.
-TEST_F(TabletModeWindowManagerTest, ActiveLeftSnapPreviousRightSnap) {
-  SplitViewController* split_view_controller =
-      Shell::Get()->split_view_controller();
-  std::unique_ptr<aura::Window> left_window = CreateDesktopWindowSnappedLeft();
-  std::unique_ptr<aura::Window> right_window =
-      CreateDesktopWindowSnappedRight();
-  ::wm::ActivateWindow(left_window.get());
-  ASSERT_TRUE(CreateTabletModeWindowManager());
-  EXPECT_EQ(SplitViewController::BOTH_SNAPPED, split_view_controller->state());
-  EXPECT_EQ(left_window.get(), split_view_controller->left_window());
-  EXPECT_EQ(right_window.get(), split_view_controller->right_window());
-  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
-}
-
-// Test that if before tablet mode, the active window is snapped on the right
-// and the previous window is snapped on the left, then split view is activated
-// with the active window on the right and the previous window on the left.
-TEST_F(TabletModeWindowManagerTest, ActiveRightSnapPreviousLeftSnap) {
-  SplitViewController* split_view_controller =
-      Shell::Get()->split_view_controller();
-  std::unique_ptr<aura::Window> left_window = CreateDesktopWindowSnappedLeft();
-  std::unique_ptr<aura::Window> right_window =
-      CreateDesktopWindowSnappedRight();
-  ::wm::ActivateWindow(right_window.get());
-  ASSERT_TRUE(CreateTabletModeWindowManager());
-  EXPECT_EQ(SplitViewController::BOTH_SNAPPED, split_view_controller->state());
-  EXPECT_EQ(left_window.get(), split_view_controller->left_window());
-  EXPECT_EQ(right_window.get(), split_view_controller->right_window());
-  EXPECT_FALSE(Shell::Get()->overview_controller()->IsSelecting());
-}
-
 }  // namespace ash
diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc
index 2d04f214..7e7adc4 100644
--- a/ash/wm/toplevel_window_event_handler_unittest.cc
+++ b/ash/wm/toplevel_window_event_handler_unittest.cc
@@ -524,6 +524,33 @@
             window_state->GetRestoreBoundsInScreen().ToString());
 }
 
+// Verifies that window dragged by touch-gestures to the edge of display
+// will not lead to system crash (see https://crbug.com/917060).
+TEST_F(ToplevelWindowEventHandlerTest, GestureDragMultiDisplays) {
+  UpdateDisplay("800x600, 800x600");
+  std::unique_ptr<aura::Window> target(CreateTestWindowInShellWithDelegate(
+      new TestWindowDelegate(HTCAPTION), 0, gfx::Rect(0, 0, 100, 100)));
+  wm::WindowState* window_state = wm::GetWindowState(target.get());
+  ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+                                     target.get());
+  gfx::Rect old_bounds = target->bounds();
+  gfx::Point location(5, 5);
+  gfx::Point end = location;
+
+  // On real device, gesture event's location may not be accurate. For example,
+  // when window is dragged by touch-gestures to the edge of display, it may
+  // create gesture events with location out of the display bounds. Let |end| be
+  // out of the primary display's bounds to emulate this situation.
+  end.Offset(800, 0);
+  generator.GestureScrollSequence(location, end,
+                                  base::TimeDelta::FromMilliseconds(5), 10);
+
+  // Verify that the window has moved after the gesture.
+  EXPECT_NE(old_bounds.ToString(), target->bounds().ToString());
+  EXPECT_EQ(mojom::WindowStateType::RIGHT_SNAPPED,
+            window_state->GetStateType());
+}
+
 // Tests that a gesture cannot minimize an unminimizeable window.
 TEST_F(ToplevelWindowEventHandlerTest,
        GestureAttemptMinimizeUnminimizeableWindow) {
diff --git a/ash/wm/wm_toplevel_window_event_handler.cc b/ash/wm/wm_toplevel_window_event_handler.cc
index 7498131a..f6ad708 100644
--- a/ash/wm/wm_toplevel_window_event_handler.cc
+++ b/ash/wm/wm_toplevel_window_event_handler.cc
@@ -18,6 +18,7 @@
 #include "ui/aura/window_observer.h"
 #include "ui/base/hit_test.h"
 #include "ui/events/event.h"
+#include "ui/wm/core/coordinate_conversion.h"
 
 namespace ash {
 namespace wm {
@@ -312,10 +313,33 @@
     return;
 
   switch (event->type()) {
-    case ui::ET_GESTURE_SCROLL_UPDATE:
+    case ui::ET_GESTURE_SCROLL_UPDATE: {
+      gfx::Rect bounds_in_screen = target->GetRootWindow()->GetBoundsInScreen();
+      gfx::Point screen_location = event->location();
+      ::wm::ConvertPointToScreen(target, &screen_location);
+
+      // It is physically not possible to move a touch pointer from one display
+      // to another, so constrain the bounds to the display. This is important,
+      // as it is possible for touch points to extend outside the bounds of the
+      // display (as happens with gestures on the bezel), and dragging via touch
+      // should not trigger moving to a new display.(see
+      // https://crbug.com/917060)
+      if (!bounds_in_screen.Contains(screen_location)) {
+        int x = std::max(
+            std::min(screen_location.x(), bounds_in_screen.right() - 1),
+            bounds_in_screen.x());
+        int y = std::max(
+            std::min(screen_location.y(), bounds_in_screen.bottom() - 1),
+            bounds_in_screen.y());
+        gfx::Point updated_location(x, y);
+        ::wm::ConvertPointFromScreen(target, &updated_location);
+        event->set_location(updated_location);
+      }
+
       HandleDrag(target, event);
       event->StopPropagation();
       return;
+    }
     case ui::ET_GESTURE_SCROLL_END:
       // We must complete the drag here instead of as a result of ET_GESTURE_END
       // because otherwise the drag will be reverted when EndMoveLoop() is
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 1c26664..b7f7ad1 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -469,6 +469,8 @@
     "message_loop/pending_task_queue.h",
     "message_loop/sequenced_task_source.h",
     "message_loop/timer_slack.h",
+    "message_loop/work_id_provider.cc",
+    "message_loop/work_id_provider.h",
     "metrics/bucket_ranges.cc",
     "metrics/bucket_ranges.h",
     "metrics/dummy_histogram.cc",
@@ -857,6 +859,7 @@
     "threading/thread_id_name_manager.cc",
     "threading/thread_id_name_manager.h",
     "threading/thread_local.h",
+    "threading/thread_local_internal.h",
     "threading/thread_local_storage.cc",
     "threading/thread_local_storage.h",
     "threading/thread_local_storage_win.cc",
@@ -2392,6 +2395,7 @@
     "message_loop/message_pump_io_ios_unittest.cc",
     "message_loop/message_pump_mac_unittest.mm",
     "message_loop/message_pump_unittest.cc",
+    "message_loop/work_id_provider_unittest.cc",
     "metrics/bucket_ranges_unittest.cc",
     "metrics/field_trial_memory_mac_unittest.cc",
     "metrics/field_trial_params_unittest.cc",
diff --git a/base/debug/activity_tracker.cc b/base/debug/activity_tracker.cc
index 32ca0a4..ec510b2 100644
--- a/base/debug/activity_tracker.cc
+++ b/base/debug/activity_tracker.cc
@@ -1403,24 +1403,21 @@
 
   // Create a tracker with the acquired memory and set it as the tracker
   // for this particular thread in thread-local-storage.
-  ManagedActivityTracker* tracker =
-      new ManagedActivityTracker(mem_reference, mem_base, stack_memory_size_);
+  auto tracker = std::make_unique<ManagedActivityTracker>(
+      mem_reference, mem_base, stack_memory_size_);
   DCHECK(tracker->IsValid());
-  this_thread_tracker_.Set(tracker);
+  auto* tracker_raw = tracker.get();
+  this_thread_tracker_.Set(std::move(tracker));
   int old_count = thread_tracker_count_.fetch_add(1, std::memory_order_relaxed);
 
   UMA_HISTOGRAM_EXACT_LINEAR("ActivityTracker.ThreadTrackers.Count",
                              old_count + 1, static_cast<int>(kMaxThreadCount));
-  return tracker;
+  return tracker_raw;
 }
 
 void GlobalActivityTracker::ReleaseTrackerForCurrentThreadForTesting() {
-  ThreadActivityTracker* tracker =
-      reinterpret_cast<ThreadActivityTracker*>(this_thread_tracker_.Get());
-  if (tracker) {
+  if (this_thread_tracker_.Get())
     this_thread_tracker_.Set(nullptr);
-    delete tracker;
-  }
 }
 
 void GlobalActivityTracker::SetBackgroundTaskRunner(
@@ -1658,7 +1655,6 @@
     : allocator_(std::move(allocator)),
       stack_memory_size_(ThreadActivityTracker::SizeForStackDepth(stack_depth)),
       process_id_(process_id == 0 ? GetCurrentProcId() : process_id),
-      this_thread_tracker_(&OnTLSDestroy),
       thread_tracker_count_(0),
       thread_tracker_allocator_(allocator_.get(),
                                 kTypeIdActivityTracker,
@@ -1740,11 +1736,6 @@
                                    ActivityData::ForException(code));
 }
 
-// static
-void GlobalActivityTracker::OnTLSDestroy(void* value) {
-  delete reinterpret_cast<ManagedActivityTracker*>(value);
-}
-
 ScopedActivity::ScopedActivity(const void* program_counter,
                                uint8_t action,
                                uint32_t id,
diff --git a/base/debug/activity_tracker.h b/base/debug/activity_tracker.h
index 96e3126..ae00b300d 100644
--- a/base/debug/activity_tracker.h
+++ b/base/debug/activity_tracker.h
@@ -34,7 +34,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/task_runner.h"
 #include "base/threading/platform_thread.h"
-#include "base/threading/thread_local_storage.h"
+#include "base/threading/thread_local.h"
 
 namespace base {
 
@@ -953,7 +953,7 @@
     if (base::ThreadLocalStorage::HasBeenDestroyed())
       return nullptr;
 
-    return reinterpret_cast<ThreadActivityTracker*>(this_thread_tracker_.Get());
+    return this_thread_tracker_.Get();
   }
 
   // Gets the thread's activity-tracker or creates one if none exists. This
@@ -1200,7 +1200,7 @@
   const int64_t process_id_;
 
   // The activity tracker for the currently executing thread.
-  ThreadLocalStorage::Slot this_thread_tracker_;
+  ThreadLocalOwnedPointer<ThreadActivityTracker> this_thread_tracker_;
 
   // The number of thread trackers currently active.
   std::atomic<int> thread_tracker_count_;
diff --git a/base/mac/launch_services_util.h b/base/mac/launch_services_util.h
index 30d1eec..7979535c 100644
--- a/base/mac/launch_services_util.h
+++ b/base/mac/launch_services_util.h
@@ -10,7 +10,6 @@
 #include "base/base_export.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
-#include "base/process/process.h"
 
 namespace base {
 namespace mac {
@@ -19,11 +18,11 @@
 // |command_line| as command line arguments if the app isn't already running.
 // |launch_options| are passed directly to
 // -[NSWorkspace launchApplicationAtURL:options:configuration:error:].
-// Returns a valid process if the app was successfully launched.
-BASE_EXPORT Process
-OpenApplicationWithPath(const FilePath& bundle_path,
-                        const CommandLine& command_line,
-                        NSWorkspaceLaunchOptions launch_options);
+// Returns a non-nil NSRunningApplication if the app was successfully launched.
+BASE_EXPORT NSRunningApplication* OpenApplicationWithPath(
+    const FilePath& bundle_path,
+    const CommandLine& command_line,
+    NSWorkspaceLaunchOptions launch_options);
 
 }  // namespace mac
 }  // namespace base
diff --git a/base/mac/launch_services_util.mm b/base/mac/launch_services_util.mm
index fa6e8087..18b0d9d 100644
--- a/base/mac/launch_services_util.mm
+++ b/base/mac/launch_services_util.mm
@@ -10,14 +10,15 @@
 namespace base {
 namespace mac {
 
-Process OpenApplicationWithPath(const base::FilePath& bundle_path,
-                                const CommandLine& command_line,
-                                NSWorkspaceLaunchOptions launch_options) {
+NSRunningApplication* OpenApplicationWithPath(
+    const base::FilePath& bundle_path,
+    const CommandLine& command_line,
+    NSWorkspaceLaunchOptions launch_options) {
   NSString* bundle_url_spec = base::SysUTF8ToNSString(bundle_path.value());
   NSURL* bundle_url = [NSURL fileURLWithPath:bundle_url_spec isDirectory:YES];
   DCHECK(bundle_url);
   if (!bundle_url) {
-    return Process();
+    return nil;
   }
 
   // NSWorkspace automatically adds the binary path as the first argument and
@@ -42,10 +43,10 @@
                                                       error:&launch_error];
   if (launch_error) {
     LOG(ERROR) << base::SysNSStringToUTF8([launch_error localizedDescription]);
-    return Process();
+    return nil;
   }
   DCHECK(app);
-  return Process([app processIdentifier]);
+  return app;
 }
 
 }  // namespace mac
diff --git a/base/message_loop/message_loop_impl.cc b/base/message_loop/message_loop_impl.cc
index a08e3d6..a72f713 100644
--- a/base/message_loop/message_loop_impl.cc
+++ b/base/message_loop/message_loop_impl.cc
@@ -215,6 +215,7 @@
   message_loop_controller_->StartScheduling();
   SetThreadTaskRunnerHandle();
   thread_id_ = PlatformThread::CurrentId();
+  work_id_provider_ = WorkIdProvider::GetForCurrentThread();
 
   scoped_set_sequence_local_storage_map_for_current_thread_ = std::make_unique<
       internal::ScopedSetSequenceLocalStorageMapForCurrentThread>(
@@ -342,6 +343,8 @@
 void MessageLoopImpl::RunTask(PendingTask* pending_task) {
   DCHECK(task_execution_allowed_);
 
+  work_id_provider_->IncrementWorkId();
+
   // Execute the task and assume the worst: It is probably not reentrant.
   task_execution_allowed_ = false;
 
@@ -429,6 +432,10 @@
   return std::min(next_run_time, recent_time_ + TimeDelta::FromDays(1));
 }
 
+void MessageLoopImpl::BeforeDoInternalWork() {
+  work_id_provider_->IncrementWorkId();
+}
+
 bool MessageLoopImpl::DoWork() {
   if (!task_execution_allowed_)
     return false;
diff --git a/base/message_loop/message_loop_impl.h b/base/message_loop/message_loop_impl.h
index cefa94ff5..bfcdf0c 100644
--- a/base/message_loop/message_loop_impl.h
+++ b/base/message_loop/message_loop_impl.h
@@ -18,6 +18,7 @@
 #include "base/message_loop/message_pump.h"
 #include "base/message_loop/pending_task_queue.h"
 #include "base/message_loop/timer_slack.h"
+#include "base/message_loop/work_id_provider.h"
 #include "base/observer_list.h"
 #include "base/pending_task.h"
 #include "base/run_loop.h"
@@ -135,6 +136,7 @@
   TimeTicks CapAtOneDay(TimeTicks next_run_time);
 
   // MessagePump::Delegate methods:
+  void BeforeDoInternalWork() override;
   bool DoWork() override;
   bool DoDelayedWork(TimeTicks* next_delayed_work_time) override;
   bool DoIdleWork() override;
@@ -200,6 +202,11 @@
   std::unique_ptr<internal::ScopedSetSequenceLocalStorageMapForCurrentThread>
       scoped_set_sequence_local_storage_map_for_current_thread_;
 
+  // Non-null provider of id state for identifying distinct work items executed
+  // by the message loop (task, event, etc.). Cached on the class to avoid TLS
+  // lookups on task execution.
+  WorkIdProvider* work_id_provider_ = nullptr;
+
   ObserverList<DestructionObserver>::Unchecked destruction_observers_;
 
   // Verifies that calls are made on the thread on which BindToCurrentThread()
diff --git a/base/message_loop/message_pump.cc b/base/message_loop/message_pump.cc
index 9076176..23a0f94 100644
--- a/base/message_loop/message_pump.cc
+++ b/base/message_loop/message_pump.cc
@@ -6,6 +6,8 @@
 
 namespace base {
 
+void MessagePump::Delegate::BeforeDoInternalWork() {}
+
 MessagePump::MessagePump() = default;
 
 MessagePump::~MessagePump() = default;
diff --git a/base/message_loop/message_pump.h b/base/message_loop/message_pump.h
index db12216..1ff0a75 100644
--- a/base/message_loop/message_pump.h
+++ b/base/message_loop/message_pump.h
@@ -21,6 +21,9 @@
    public:
     virtual ~Delegate() = default;
 
+    // Called before work performed internal to the message pump is executed.
+    virtual void BeforeDoInternalWork();
+
     // Called from within Run in response to ScheduleWork or when the message
     // pump would otherwise call DoDelayedWork.  Returns true to indicate that
     // work was done.  DoDelayedWork will still be called if DoWork returns
diff --git a/base/message_loop/message_pump_win.cc b/base/message_loop/message_pump_win.cc
index 1d6748e0..5d91705 100644
--- a/base/message_loop/message_pump_win.cc
+++ b/base/message_loop/message_pump_win.cc
@@ -172,6 +172,7 @@
     // work, then it is a good time to consider sleeping (waiting) for more
     // work.
 
+    state_->delegate->BeforeDoInternalWork();
     bool more_work_is_plausible = ProcessNextWindowsMessage();
     if (state_->should_quit)
       break;
diff --git a/base/message_loop/work_id_provider.cc b/base/message_loop/work_id_provider.cc
new file mode 100644
index 0000000..f4c78c6
--- /dev/null
+++ b/base/message_loop/work_id_provider.cc
@@ -0,0 +1,54 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/message_loop/work_id_provider.h"
+
+#include <memory>
+
+#include "base/memory/ptr_util.h"
+#include "base/no_destructor.h"
+#include "base/threading/thread_local.h"
+
+namespace base {
+
+// static
+WorkIdProvider* WorkIdProvider::GetForCurrentThread() {
+  static NoDestructor<ThreadLocalOwnedPointer<WorkIdProvider>> instance;
+  if (!instance->Get())
+    instance->Set(WrapUnique(new WorkIdProvider));
+  return instance->Get();
+}
+
+// This function must support being invoked while other threads are suspended so
+// must not take any locks, including indirectly through use of heap allocation,
+// LOG, CHECK, or DCHECK.
+unsigned int WorkIdProvider::GetWorkId() {
+  return work_id_.load(std::memory_order_acquire);
+}
+
+WorkIdProvider::~WorkIdProvider() = default;
+
+void WorkIdProvider::SetCurrentWorkIdForTesting(unsigned int id) {
+  work_id_.store(id, std::memory_order_relaxed);
+}
+
+void WorkIdProvider::IncrementWorkIdForTesting() {
+  IncrementWorkId();
+}
+
+WorkIdProvider::WorkIdProvider() : work_id_(0) {}
+
+void WorkIdProvider::IncrementWorkId() {
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+
+  unsigned int next_id = work_id_.load(std::memory_order_relaxed) + 1;
+  // Reserve 0 to mean no work items have been executed.
+  if (next_id == 0)
+    ++next_id;
+  // Release order ensures this state is visible to other threads prior to the
+  // following task/event execution.
+  work_id_.store(next_id, std::memory_order_release);
+}
+
+}  // namespace base
diff --git a/base/message_loop/work_id_provider.h b/base/message_loop/work_id_provider.h
new file mode 100644
index 0000000..8f08f2d
--- /dev/null
+++ b/base/message_loop/work_id_provider.h
@@ -0,0 +1,71 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MESSAGE_LOOP_WORK_ID_PROVIDER_H_
+#define BASE_MESSAGE_LOOP_WORK_ID_PROVIDER_H_
+
+#include <atomic>
+
+#include "base/base_export.h"
+#include "base/threading/thread_checker.h"
+
+namespace base {
+class MessageLoopImpl;
+namespace sequence_manager {
+namespace internal {
+class SequenceManagerImpl;
+}
+}  // namespace sequence_manager
+
+// WorkIdProvider associates with the current thread (via TLS) an id state
+// reflecting the current work item being executed by the message loop. The item
+// is accessed lock-free from other threads to provide a snapshot of the
+// currently-executing work item.
+//
+// The expected user is the ThreadProfiler which samples the id along with the
+// thread's stack to identify cases where the same task spans multiple
+// samples. The state is stored in TLS rather than on the MessageLoop or the
+// ThreadProfiler because the lifetime relationship between the two classes
+// varies depending on which thread is being profiled, plus the fact that
+// MessageLoop doesn't have a well-defined creation point/owner on some threads.
+class BASE_EXPORT WorkIdProvider {
+ public:
+  // Returns the WorkIdProvider for the current thread. Allocates a
+  // WorkIdProvider in TLS if not already present.
+  static WorkIdProvider* GetForCurrentThread();
+
+  // Returns the work id for the thread to which this WorkIdProvider
+  // belongs. The work id is 0 before calls to IncrementWorkId() and always
+  // non-zero after that point. The implementation supports being invoked while
+  // other threads are suspended, and thus is guaranteed to take no locks,
+  // directly or indirectly. May be called from any thread, as long as the
+  // owning thread hasn't been destroyed.
+  unsigned int GetWorkId();
+
+  // Public to support unique_ptr<WorkIdProvider>.
+  ~WorkIdProvider();
+
+  void SetCurrentWorkIdForTesting(unsigned int id);
+  void IncrementWorkIdForTesting();
+
+  WorkIdProvider(const WorkIdProvider&) = delete;
+  WorkIdProvider& operator=(const WorkIdProvider&) = delete;
+
+ private:
+  // Friended to allow use of IncrementWorkId().
+  friend class MessageLoopImpl;
+  friend class sequence_manager::internal::SequenceManagerImpl;
+
+  WorkIdProvider();
+
+  void IncrementWorkId();
+
+  std::atomic_uint work_id_;
+
+  THREAD_CHECKER(thread_checker_);
+};
+
+}  // namespace base
+
+#endif  // BASE_MESSAGE_LOOP_WORK_ID_PROVIDER_H_
diff --git a/base/message_loop/work_id_provider_unittest.cc b/base/message_loop/work_id_provider_unittest.cc
new file mode 100644
index 0000000..5a6b93e
--- /dev/null
+++ b/base/message_loop/work_id_provider_unittest.cc
@@ -0,0 +1,71 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/message_loop/work_id_provider.h"
+
+#include <limits>
+#include <memory>
+#include <utility>
+
+#include "base/callback.h"
+#include "base/test/bind_test_util.h"
+#include "base/threading/simple_thread.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+
+namespace {
+
+class TestThread : public SimpleThread {
+ public:
+  TestThread(OnceCallback<void(WorkIdProvider*)> validate_func)
+      : SimpleThread("WorkIdProviderTestThread"),
+        validate_func_(std::move(validate_func)) {}
+
+  void Run() override {
+    std::move(validate_func_).Run(WorkIdProvider::GetForCurrentThread());
+  }
+
+ private:
+  OnceCallback<void(WorkIdProvider*)> validate_func_;
+};
+
+template <class Func>
+void RunTest(const Func& func) {
+  TestThread thread(BindLambdaForTesting(func));
+
+  thread.Start();
+  thread.Join();
+}
+
+}  // namespace
+
+TEST(WorkIdProviderTest, StartsAtZero) {
+  RunTest(
+      [](WorkIdProvider* provider) { EXPECT_EQ(0u, provider->GetWorkId()); });
+}
+
+TEST(WorkIdProviderTest, Increment) {
+  RunTest([](WorkIdProvider* provider) {
+    provider->IncrementWorkIdForTesting();
+    EXPECT_EQ(1u, provider->GetWorkId());
+
+    provider->IncrementWorkIdForTesting();
+    EXPECT_EQ(2u, provider->GetWorkId());
+
+    provider->IncrementWorkIdForTesting();
+    EXPECT_EQ(3u, provider->GetWorkId());
+  });
+}
+
+TEST(WorkIdProviderTest, SkipsZeroOnOverflow) {
+  RunTest([](WorkIdProvider* provider) {
+    provider->SetCurrentWorkIdForTesting(
+        std::numeric_limits<unsigned int>::max());
+    provider->IncrementWorkIdForTesting();
+    EXPECT_EQ(1u, provider->GetWorkId());
+  });
+}
+
+}  // namespace base
diff --git a/base/task/sequence_manager/sequence_manager_impl.cc b/base/task/sequence_manager/sequence_manager_impl.cc
index 08caa5a..0c5cda2 100644
--- a/base/task/sequence_manager/sequence_manager_impl.cc
+++ b/base/task/sequence_manager/sequence_manager_impl.cc
@@ -218,6 +218,7 @@
 
 void SequenceManagerImpl::CompleteInitializationOnBoundThread() {
   controller_->AddNestingObserver(this);
+  work_id_provider_ = WorkIdProvider::GetForCurrentThread();
   main_thread_only().nesting_observer_registered_ = true;
   if (GetMessagePump())
     MessageLoopCurrent::BindToCurrentThreadInternal(this);
@@ -438,6 +439,8 @@
                      executing_task.task_queue->GetName(), "task_type",
                      executing_task.task_type);
 
+  work_id_provider_->IncrementWorkId();
+
   return task;
 }
 
diff --git a/base/task/sequence_manager/sequence_manager_impl.h b/base/task/sequence_manager/sequence_manager_impl.h
index 8dafb175..e3838c1b 100644
--- a/base/task/sequence_manager/sequence_manager_impl.h
+++ b/base/task/sequence_manager/sequence_manager_impl.h
@@ -22,6 +22,7 @@
 #include "base/memory/scoped_refptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
+#include "base/message_loop/work_id_provider.h"
 #include "base/pending_task.h"
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
@@ -392,6 +393,11 @@
   // Whether to add the queue time to tasks.
   base::subtle::Atomic32 add_queue_time_to_tasks_ = 0;
 
+  // Non-null provider of id state for identifying distinct work items executed
+  // by the message loop (task, event, etc.). Cached on the class to avoid TLS
+  // lookups on task execution.
+  WorkIdProvider* work_id_provider_ = nullptr;
+
   // A check to bail out early during memory corruption.
   // https://crbug.com/757940
   bool Validate();
diff --git a/base/task/task_scheduler/scheduler_lock_impl.cc b/base/task/task_scheduler/scheduler_lock_impl.cc
index 48abf42..31e3d84c 100644
--- a/base/task/task_scheduler/scheduler_lock_impl.cc
+++ b/base/task/task_scheduler/scheduler_lock_impl.cc
@@ -13,7 +13,7 @@
 #include "base/synchronization/condition_variable.h"
 #include "base/task/task_scheduler/scheduler_lock.h"
 #include "base/threading/platform_thread.h"
-#include "base/threading/thread_local_storage.h"
+#include "base/threading/thread_local.h"
 
 namespace base {
 namespace internal {
@@ -22,7 +22,7 @@
 
 class SafeAcquisitionTracker {
  public:
-  SafeAcquisitionTracker() : tls_acquired_locks_(&OnTLSDestroy) {}
+  SafeAcquisitionTracker() = default;
 
   void RegisterLock(const SchedulerLockImpl* const lock,
                     const SchedulerLockImpl* const predecessor) {
@@ -107,13 +107,9 @@
 
   LockVector* GetAcquiredLocksOnCurrentThread() {
     if (!tls_acquired_locks_.Get())
-      tls_acquired_locks_.Set(new LockVector);
+      tls_acquired_locks_.Set(std::make_unique<LockVector>());
 
-    return reinterpret_cast<LockVector*>(tls_acquired_locks_.Get());
-  }
-
-  static void OnTLSDestroy(void* value) {
-    delete reinterpret_cast<LockVector*>(value);
+    return tls_acquired_locks_.Get();
   }
 
   // Synchronizes access to |allowed_predecessor_map_|.
@@ -124,7 +120,7 @@
 
   // A thread-local slot holding a vector of locks currently acquired on the
   // current thread.
-  ThreadLocalStorage::Slot tls_acquired_locks_;
+  ThreadLocalOwnedPointer<LockVector> tls_acquired_locks_;
 
   DISALLOW_COPY_AND_ASSIGN(SafeAcquisitionTracker);
 };
diff --git a/base/threading/thread_local.h b/base/threading/thread_local.h
index 815169a..9841325f 100644
--- a/base/threading/thread_local.h
+++ b/base/threading/thread_local.h
@@ -49,43 +49,84 @@
 #ifndef BASE_THREADING_THREAD_LOCAL_H_
 #define BASE_THREADING_THREAD_LOCAL_H_
 
+#include <memory>
+
+#include "base/logging.h"
 #include "base/macros.h"
+#include "base/threading/thread_local_internal.h"
 #include "base/threading/thread_local_storage.h"
 
 namespace base {
 
-template <typename Type>
+template <typename T>
 class ThreadLocalPointer {
  public:
   ThreadLocalPointer() = default;
   ~ThreadLocalPointer() = default;
 
-  Type* Get() {
-    return static_cast<Type*>(slot_.Get());
-  }
+  T* Get() const { return static_cast<T*>(slot_.Get()); }
 
-  void Set(Type* ptr) {
+  void Set(T* ptr) {
     slot_.Set(const_cast<void*>(static_cast<const void*>(ptr)));
   }
 
  private:
   ThreadLocalStorage::Slot slot_;
 
-  DISALLOW_COPY_AND_ASSIGN(ThreadLocalPointer<Type>);
+  DISALLOW_COPY_AND_ASSIGN(ThreadLocalPointer<T>);
 };
 
+// A ThreadLocalOwnedPointer<T> is like a ThreadLocalPointer<T> except that
+// pointers handed to it are owned and automatically deleted during their
+// associated thread's exit phase (or when replaced if Set() is invoked multiple
+// times on the same thread).
+// The ThreadLocalOwnedPointer instance itself can only be destroyed when no
+// threads, other than the one it is destroyed on, have remaining state set in
+// it. Typically this means that ThreadLocalOwnedPointer instances are held in
+// static storage or at the very least only recycled in the single-threaded
+// phase between tests in the same process.
+#if DCHECK_IS_ON()
+template <typename T>
+using ThreadLocalOwnedPointer = internal::CheckedThreadLocalOwnedPointer<T>;
+#else   // DCHECK_IS_ON()
+template <typename T>
+class ThreadLocalOwnedPointer {
+ public:
+  ThreadLocalOwnedPointer() = default;
+
+  ~ThreadLocalOwnedPointer() {
+    // Assume that this thread is the only one with potential state left. This
+    // is verified in ~CheckedThreadLocalOwnedPointer().
+    // TODO: Consider making ThreadLocalStorage::Slot::Set() be side-effect free
+    // if the slot isn't initialized and nullptr is passed.
+    if (Get())
+      Set(nullptr);
+  }
+
+  T* Get() const { return static_cast<T*>(slot_.Get()); }
+
+  void Set(std::unique_ptr<T> ptr) {
+    delete Get();
+    slot_.Set(const_cast<void*>(static_cast<const void*>(ptr.release())));
+  }
+
+ private:
+  static void DeleteTlsPtr(void* ptr) { delete static_cast<T*>(ptr); }
+
+  ThreadLocalStorage::Slot slot_{&DeleteTlsPtr};
+
+  DISALLOW_COPY_AND_ASSIGN(ThreadLocalOwnedPointer<T>);
+};
+#endif  // DCHECK_IS_ON()
+
 class ThreadLocalBoolean {
  public:
   ThreadLocalBoolean() = default;
   ~ThreadLocalBoolean() = default;
 
-  bool Get() {
-    return tlp_.Get() != nullptr;
-  }
+  bool Get() const { return tlp_.Get() != nullptr; }
 
-  void Set(bool val) {
-    tlp_.Set(val ? this : nullptr);
-  }
+  void Set(bool val) { tlp_.Set(val ? this : nullptr); }
 
  private:
   ThreadLocalPointer<void> tlp_;
diff --git a/base/threading/thread_local_internal.h b/base/threading/thread_local_internal.h
new file mode 100644
index 0000000..384cb6f6
--- /dev/null
+++ b/base/threading/thread_local_internal.h
@@ -0,0 +1,81 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_THREADING_THREAD_LOCAL_INTERNAL_H_
+#define BASE_THREADING_THREAD_LOCAL_INTERNAL_H_
+
+#if DCHECK_IS_ON()
+
+#include <atomic>
+#include <memory>
+
+#include "base/macros.h"
+#include "base/threading/thread_local_storage.h"
+
+namespace base {
+namespace internal {
+
+// A version of ThreadLocalOwnedPointer which verifies that it's only destroyed
+// when no threads, other than the one it is destroyed on, have remaining state
+// set in it. A ThreadLocalOwnedPointer instance being destroyed too early would
+// result in leaks per unregistering the TLS slot (and thus the DeleteTlsPtr
+// hook).
+template <typename T>
+class CheckedThreadLocalOwnedPointer {
+ public:
+  CheckedThreadLocalOwnedPointer() = default;
+
+  ~CheckedThreadLocalOwnedPointer() {
+    if (Get())
+      Set(nullptr);
+
+    DCHECK_EQ(num_assigned_threads_.load(std::memory_order_relaxed), 0)
+        << "Memory leak: Must join all threads or release all associated "
+           "thread-local slots before ~ThreadLocalOwnedPointer";
+  }
+
+  T* Get() const {
+    PtrTracker* const ptr_tracker = static_cast<PtrTracker*>(slot_.Get());
+    return ptr_tracker ? ptr_tracker->ptr_.get() : nullptr;
+  }
+
+  void Set(std::unique_ptr<T> ptr) {
+    delete static_cast<PtrTracker*>(slot_.Get());
+    if (ptr)
+      slot_.Set(new PtrTracker(this, std::move(ptr)));
+    else
+      slot_.Set(nullptr);
+  }
+
+ private:
+  struct PtrTracker {
+   public:
+    PtrTracker(CheckedThreadLocalOwnedPointer<T>* outer, std::unique_ptr<T> ptr)
+        : outer_(outer), ptr_(std::move(ptr)) {
+      outer_->num_assigned_threads_.fetch_add(1, std::memory_order_relaxed);
+    }
+
+    ~PtrTracker() {
+      outer_->num_assigned_threads_.fetch_sub(1, std::memory_order_relaxed);
+    }
+
+    CheckedThreadLocalOwnedPointer<T>* const outer_;
+    const std::unique_ptr<T> ptr_;
+  };
+
+  static void DeleteTlsPtr(void* ptr) { delete static_cast<PtrTracker*>(ptr); }
+
+  ThreadLocalStorage::Slot slot_{&DeleteTlsPtr};
+
+  std::atomic_int num_assigned_threads_{0};
+
+  DISALLOW_COPY_AND_ASSIGN(CheckedThreadLocalOwnedPointer<T>);
+};
+
+}  // namespace internal
+}  // namespace base
+
+#endif  // DCHECK_IS_ON()
+
+#endif  // BASE_THREADING_THREAD_LOCAL_INTERNAL_H_
diff --git a/base/threading/thread_local_unittest.cc b/base/threading/thread_local_unittest.cc
index 54f2ad2..47f4b54c 100644
--- a/base/threading/thread_local_unittest.cc
+++ b/base/threading/thread_local_unittest.cc
@@ -2,34 +2,37 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/logging.h"
-#include "base/threading/simple_thread.h"
 #include "base/threading/thread_local.h"
+#include "base/logging.h"
+#include "base/macros.h"
+#include "base/optional.h"
 #include "base/synchronization/waitable_event.h"
+#include "base/test/bind_test_util.h"
+#include "base/test/gtest_util.h"
+#include "base/threading/simple_thread.h"
+#include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
 
 namespace {
 
-class ThreadLocalTesterBase : public base::DelegateSimpleThreadPool::Delegate {
+class ThreadLocalTesterBase : public DelegateSimpleThreadPool::Delegate {
  public:
-  typedef base::ThreadLocalPointer<char> TLPType;
+  typedef ThreadLocalPointer<char> TLPType;
 
-  ThreadLocalTesterBase(TLPType* tlp, base::WaitableEvent* done)
-      : tlp_(tlp),
-        done_(done) {
-  }
+  ThreadLocalTesterBase(TLPType* tlp, WaitableEvent* done)
+      : tlp_(tlp), done_(done) {}
   ~ThreadLocalTesterBase() override = default;
 
  protected:
   TLPType* tlp_;
-  base::WaitableEvent* done_;
+  WaitableEvent* done_;
 };
 
 class SetThreadLocal : public ThreadLocalTesterBase {
  public:
-  SetThreadLocal(TLPType* tlp, base::WaitableEvent* done)
+  SetThreadLocal(TLPType* tlp, WaitableEvent* done)
       : ThreadLocalTesterBase(tlp, done), val_(nullptr) {}
   ~SetThreadLocal() override = default;
 
@@ -47,7 +50,7 @@
 
 class GetThreadLocal : public ThreadLocalTesterBase {
  public:
-  GetThreadLocal(TLPType* tlp, base::WaitableEvent* done)
+  GetThreadLocal(TLPType* tlp, WaitableEvent* done)
       : ThreadLocalTesterBase(tlp, done), ptr_(nullptr) {}
   ~GetThreadLocal() override = default;
 
@@ -68,18 +71,18 @@
 // In this test, we start 2 threads which will access a ThreadLocalPointer.  We
 // make sure the default is NULL, and the pointers are unique to the threads.
 TEST(ThreadLocalTest, Pointer) {
-  base::DelegateSimpleThreadPool tp1("ThreadLocalTest tp1", 1);
-  base::DelegateSimpleThreadPool tp2("ThreadLocalTest tp1", 1);
+  DelegateSimpleThreadPool tp1("ThreadLocalTest tp1", 1);
+  DelegateSimpleThreadPool tp2("ThreadLocalTest tp1", 1);
   tp1.Start();
   tp2.Start();
 
-  base::ThreadLocalPointer<char> tlp;
+  ThreadLocalPointer<char> tlp;
 
   static char* const kBogusPointer = reinterpret_cast<char*>(0x1234);
 
   char* tls_val;
-  base::WaitableEvent done(WaitableEvent::ResetPolicy::MANUAL,
-                           WaitableEvent::InitialState::NOT_SIGNALED);
+  WaitableEvent done(WaitableEvent::ResetPolicy::MANUAL,
+                     WaitableEvent::InitialState::NOT_SIGNALED);
 
   GetThreadLocal getter(&tlp, &done);
   getter.set_ptr(&tls_val);
@@ -142,9 +145,194 @@
   tp2.JoinAll();
 }
 
+namespace {
+
+// A simple helper which sets the given boolean to true on destruction.
+class SetTrueOnDestruction {
+ public:
+  SetTrueOnDestruction(bool* was_destroyed) : was_destroyed_(was_destroyed) {
+    CHECK(was_destroyed != nullptr);
+  }
+  ~SetTrueOnDestruction() {
+    EXPECT_FALSE(*was_destroyed_);
+    *was_destroyed_ = true;
+  }
+
+ private:
+  bool* const was_destroyed_;
+
+  DISALLOW_COPY_AND_ASSIGN(SetTrueOnDestruction);
+};
+
+}  // namespace
+
+TEST(ThreadLocalTest, ThreadLocalOwnedPointerBasic) {
+  ThreadLocalOwnedPointer<SetTrueOnDestruction> tls_owned_pointer;
+  EXPECT_FALSE(tls_owned_pointer.Get());
+
+  bool was_destroyed1 = false;
+  tls_owned_pointer.Set(
+      std::make_unique<SetTrueOnDestruction>(&was_destroyed1));
+  EXPECT_FALSE(was_destroyed1);
+  EXPECT_TRUE(tls_owned_pointer.Get());
+
+  bool was_destroyed2 = false;
+  tls_owned_pointer.Set(
+      std::make_unique<SetTrueOnDestruction>(&was_destroyed2));
+  EXPECT_TRUE(was_destroyed1);
+  EXPECT_FALSE(was_destroyed2);
+  EXPECT_TRUE(tls_owned_pointer.Get());
+
+  tls_owned_pointer.Set(nullptr);
+  EXPECT_TRUE(was_destroyed1);
+  EXPECT_TRUE(was_destroyed2);
+  EXPECT_FALSE(tls_owned_pointer.Get());
+}
+
+TEST(ThreadLocalTest, ThreadLocalOwnedPointerFreedOnThreadExit) {
+  bool tls_was_destroyed = false;
+  ThreadLocalOwnedPointer<SetTrueOnDestruction> tls_owned_pointer;
+
+  Thread thread("TestThread");
+  thread.Start();
+
+  WaitableEvent tls_set;
+
+  thread.task_runner()->PostTask(
+      FROM_HERE, BindLambdaForTesting([&]() {
+        tls_owned_pointer.Set(
+            std::make_unique<SetTrueOnDestruction>(&tls_was_destroyed));
+        tls_set.Signal();
+      }));
+
+  tls_set.Wait();
+  EXPECT_FALSE(tls_was_destroyed);
+
+  thread.Stop();
+  EXPECT_TRUE(tls_was_destroyed);
+}
+
+TEST(ThreadLocalTest, ThreadLocalOwnedPointerCleansUpMainThreadOnDestruction) {
+  base::Optional<ThreadLocalOwnedPointer<SetTrueOnDestruction>>
+      tls_owned_pointer(base::in_place);
+  bool tls_was_destroyed_other = false;
+
+  Thread thread("TestThread");
+  thread.Start();
+
+  WaitableEvent tls_set;
+
+  thread.task_runner()->PostTask(
+      FROM_HERE, BindLambdaForTesting([&]() {
+        tls_owned_pointer->Set(
+            std::make_unique<SetTrueOnDestruction>(&tls_was_destroyed_other));
+        tls_set.Signal();
+      }));
+
+  tls_set.Wait();
+
+  bool tls_was_destroyed_main = false;
+  tls_owned_pointer->Set(
+      std::make_unique<SetTrueOnDestruction>(&tls_was_destroyed_main));
+  EXPECT_FALSE(tls_was_destroyed_other);
+  EXPECT_FALSE(tls_was_destroyed_main);
+
+  // Stopping the thread relinquishes its TLS (as in
+  // ThreadLocalOwnedPointerFreedOnThreadExit).
+  thread.Stop();
+  EXPECT_TRUE(tls_was_destroyed_other);
+  EXPECT_FALSE(tls_was_destroyed_main);
+
+  // Deleting the ThreadLocalOwnedPointer instance on the main thread is allowed
+  // iff that's the only thread with remaining storage (ref. disallowed use case
+  // in ThreadLocalOwnedPointerDeathIfDestroyedWithActiveThread below). In that
+  // case, the storage on the main thread is freed before releasing the TLS
+  // slot.
+  tls_owned_pointer.reset();
+  EXPECT_TRUE(tls_was_destroyed_main);
+}
+
+TEST(ThreadLocalTest, ThreadLocalOwnedPointerDeathIfDestroyedWithActiveThread) {
+  testing::FLAGS_gtest_death_test_style = "threadsafe";
+
+  base::Optional<ThreadLocalOwnedPointer<int>> tls_owned_pointer(
+      base::in_place);
+
+  Thread thread("TestThread");
+  thread.Start();
+
+  WaitableEvent tls_set;
+
+  thread.task_runner()->PostTask(
+      FROM_HERE, BindLambdaForTesting([&]() {
+        tls_owned_pointer->Set(std::make_unique<int>(1));
+        tls_set.Signal();
+      }));
+
+  tls_set.Wait();
+
+  EXPECT_DCHECK_DEATH({ tls_owned_pointer.reset(); });
+}
+
+TEST(ThreadLocalTest, ThreadLocalOwnedPointerMultiThreadedAndStaticStorage) {
+  constexpr int kNumThreads = 16;
+
+  static ThreadLocalOwnedPointer<SetTrueOnDestruction> tls_owned_pointer;
+
+  std::array<bool, kNumThreads> were_destroyed{};
+
+  std::array<std::unique_ptr<Thread>, kNumThreads> threads;
+
+  for (auto& thread : threads) {
+    thread = std::make_unique<Thread>("TestThread");
+    thread->Start();
+  }
+
+  for (const auto& thread : threads) {
+    // Waiting is unnecessary but enhances the likelihood of data races in the
+    // next steps.
+    thread->WaitUntilThreadStarted();
+  }
+
+  for (const bool was_destroyed : were_destroyed) {
+    EXPECT_FALSE(was_destroyed);
+  }
+
+  for (int i = 0; i < kNumThreads; ++i) {
+    threads[i]->task_runner()->PostTask(
+        FROM_HERE,
+        BindOnce(
+            [](bool* was_destroyed) {
+              tls_owned_pointer.Set(
+                  std::make_unique<SetTrueOnDestruction>(was_destroyed));
+            },
+            &were_destroyed[i]));
+  }
+
+  static bool main_thread_was_destroyed = false;
+  // Even when the test is run multiple times in the same process: TLS should
+  // never be destroyed until static uninitialization.
+  EXPECT_FALSE(main_thread_was_destroyed);
+
+  tls_owned_pointer.Set(
+      std::make_unique<SetTrueOnDestruction>(&main_thread_was_destroyed));
+
+  for (const auto& thread : threads) {
+    thread->Stop();
+  }
+
+  for (const bool was_destroyed : were_destroyed) {
+    EXPECT_TRUE(was_destroyed);
+  }
+
+  // The main thread's TLS still wasn't destroyed (let the test unfold naturally
+  // through static uninitialization).
+  EXPECT_FALSE(main_thread_was_destroyed);
+}
+
 TEST(ThreadLocalTest, Boolean) {
   {
-    base::ThreadLocalBoolean tlb;
+    ThreadLocalBoolean tlb;
     EXPECT_FALSE(tlb.Get());
 
     tlb.Set(false);
@@ -156,7 +344,7 @@
 
   // Our slot should have been freed, we're all reset.
   {
-    base::ThreadLocalBoolean tlb;
+    ThreadLocalBoolean tlb;
     EXPECT_FALSE(tlb.Get());
   }
 }
diff --git a/build/android/OWNERS b/build/android/OWNERS
index ebc69bf..2feaebcf 100644
--- a/build/android/OWNERS
+++ b/build/android/OWNERS
@@ -4,4 +4,4 @@
 perezju@chromium.org
 wnwen@chromium.org
 
-# COMPONENT: Test>Android
+# COMPONENT: Build
diff --git a/build/android/pylib/base/test_instance.py b/build/android/pylib/base/test_instance.py
index f0ff830..7b1099cf 100644
--- a/build/android/pylib/base/test_instance.py
+++ b/build/android/pylib/base/test_instance.py
@@ -20,6 +20,12 @@
   def TestType(self):
     raise NotImplementedError
 
+  # pylint: disable=no-self-use
+  def GetPreferredAbis(self):
+    return None
+
+  # pylint: enable=no-self-use
+
   def SetUp(self):
     raise NotImplementedError
 
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py
index cdbd2690..d3bedee 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -447,6 +447,12 @@
     return 'gtest'
 
   #override
+  def GetPreferredAbis(self):
+    if not self._apk_helper:
+      return None
+    return self._apk_helper.GetAbis()
+
+  #override
   def SetUp(self):
     """Map data dependencies via isolate."""
     self._data_deps.extend(
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
index a9019707..841df1a4 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -828,6 +828,13 @@
     return 'instrumentation'
 
   #override
+  def GetPreferredAbis(self):
+    ret = self._test_apk.GetAbis()
+    if not ret and self._apk_under_test:
+      ret = self._apk_under_test.GetAbis()
+    return ret
+
+  #override
   def SetUp(self):
     self._data_deps.extend(
         self._data_deps_delegate(self._runtime_deps_path))
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py
index ba58686..4d7aa82 100644
--- a/build/android/pylib/local/device/local_device_environment.py
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -98,6 +98,7 @@
     self._logcat_output_dir = args.logcat_output_dir
     self._logcat_output_file = args.logcat_output_file
     self._max_tries = 1 + args.num_retries
+    self._preferred_abis = None
     self._recover_devices = args.recover_devices
     self._skip_clear_data = args.skip_clear_data
     self._tool_name = args.tool
@@ -127,15 +128,24 @@
     elif self.trace_output:
       self.EnableTracing()
 
+  # Must be called before accessing |devices|.
+  def SetPreferredAbis(self, abis):
+    assert self._devices is None
+    self._preferred_abis = abis
+
   def _InitDevices(self):
     device_arg = []
     if self._device_serials:
       device_arg = self._device_serials
 
     self._devices = device_utils.DeviceUtils.HealthyDevices(
-        self._blacklist, retries=5, enable_usb_resets=True,
+        self._blacklist,
+        retries=5,
+        enable_usb_resets=True,
         enable_device_files_cache=self._enable_device_cache,
-        default_retries=self._max_tries - 1, device_arg=device_arg)
+        default_retries=self._max_tries - 1,
+        device_arg=device_arg,
+        abis=self._preferred_abis)
 
     if self._logcat_output_file:
       self._logcat_output_dir = tempfile.mkdtemp()
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py
index 26d6d07a..62adfab 100644
--- a/build/android/pylib/local/device/local_device_test_run.py
+++ b/build/android/pylib/local/device/local_device_test_run.py
@@ -52,6 +52,7 @@
   def __init__(self, env, test_instance):
     super(LocalDeviceTestRun, self).__init__(env, test_instance)
     self._tools = {}
+    env.SetPreferredAbis(test_instance.GetPreferredAbis())
 
   #override
   def RunTests(self, results):
diff --git a/build/android/test_wrapper/logdog_wrapper.py b/build/android/test_wrapper/logdog_wrapper.py
index d1da84e6..fda9f14 100755
--- a/build/android/test_wrapper/logdog_wrapper.py
+++ b/build/android/test_wrapper/logdog_wrapper.py
@@ -34,8 +34,11 @@
 def CommandParser():
   # Parses the command line arguments being passed in
   parser = argparse.ArgumentParser()
-  parser.add_argument('--target', required=True,
-                      help='The test target to be run.')
+  parser.add_argument(
+      '--target',
+      help='The test target to be run. If not set, any extra '
+      'args passed to this script are assumed to be the '
+      'full test command to run.')
   parser.add_argument('--logdog-bin-cmd', required=True,
                       help='The logdog bin cmd.')
   return parser
@@ -67,9 +70,11 @@
   args, extra_cmd_args = parser.parse_known_args(sys.argv[1:])
 
   logging.basicConfig(level=logging.INFO)
-  test_cmd = [
-      os.path.join('bin', 'run_%s' % args.target),
-      '-v']
+  if args.target:
+    test_cmd = [os.path.join('bin', 'run_%s' % args.target), '-v']
+    test_cmd += extra_cmd_args
+  else:
+    test_cmd = extra_cmd_args
 
   test_env = dict(os.environ)
   logdog_cmd = []
@@ -102,8 +107,6 @@
           'LOGDOG_COORDINATOR_HOST': COORDINATOR_HOST,
       })
 
-    test_cmd += extra_cmd_args
-
     logdog_proc = None
     if logdog_cmd:
       logdog_proc = subprocess.Popen(logdog_cmd)
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 0f2324a..77842a95 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -2024,16 +2024,6 @@
     _deps = []
     if (defined(invoker.deps)) {
       _deps = invoker.deps
-      set_sources_assignment_filter([ "*manifest*" ])
-      sources = _deps
-      set_sources_assignment_filter([])
-      if (sources != _deps) {
-        _bad_deps = _deps - sources
-        assert(
-            false,
-            "Possible manifest-generating dep found in deps. Use android_manifest_dep for this instead. Found: $_bad_deps")
-      }
-      sources = []
     }
 
     _srcjar_deps = []
diff --git a/build/experimental/install-build-deps.py b/build/experimental/install-build-deps.py
deleted file mode 100755
index a744711..0000000
--- a/build/experimental/install-build-deps.py
+++ /dev/null
@@ -1,428 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import operator
-import os
-import platform
-import re
-import subprocess
-import sys
-
-
-SUPPORTED_UBUNTU_VERSIONS = (
-  {'number': '14.04', 'codename': 'trusty'},
-  {'number': '14.10', 'codename': 'utopic'},
-  {'number': '15.04', 'codename': 'vivid'},
-  {'number': '15.10', 'codename': 'wily'},
-)
-
-
-# Packages needed for chromeos only.
-_packages_chromeos_dev = (
-  'libbluetooth-dev',
-  'libxkbcommon-dev',
-  'realpath',
-)
-
-
-# Packages needed for development.
-_packages_dev = (
-  'bison',
-  'cdbs',
-  'curl',
-  'devscripts',
-  'dpkg-dev',
-  'elfutils',
-  'fakeroot',
-  'flex',
-  'fonts-ipafont',
-  'fonts-thai-tlwg',
-  'g++',
-  'git-core',
-  'git-svn',
-  'gperf',
-  'language-pack-da',
-  'language-pack-fr',
-  'language-pack-he',
-  'language-pack-zh-hant',
-  'libapache2-mod-php5',
-  'libasound2-dev',
-  'libav-tools',
-  'libbrlapi-dev',
-  'libbz2-dev',
-  'libcairo2-dev',
-  'libcap-dev',
-  'libcups2-dev',
-  'libcurl4-gnutls-dev',
-  'libdrm-dev',
-  'libelf-dev',
-  'libgconf2-dev',
-  'libglib2.0-dev',
-  'libglu1-mesa-dev',
-  'libgnome-keyring-dev',
-  'libkrb5-dev',
-  'libnspr4-dev',
-  'libnss3-dev',
-  'libpam0g-dev',
-  'libpci-dev',
-  'libpulse-dev',
-  'libsctp-dev',
-  'libspeechd-dev',
-  'libsqlite3-dev',
-  'libssl-dev',
-  'libudev-dev',
-  'libwww-perl',
-  'libxslt1-dev',
-  'libxss-dev',
-  'libxt-dev',
-  'libxtst-dev',
-  'openbox',
-  'patch',
-  'perl',
-  'php5-cgi',
-  'pkg-config',
-  'python',
-  'python-cherrypy3',
-  'python-crypto',
-  'python-dev',
-  'python-numpy',
-  'python-opencv',
-  'python-openssl',
-  'python-psutil',
-  'python-yaml',
-  'rpm',
-  'ruby',
-  'subversion',
-  'ttf-dejavu-core',
-  'ttf-indic-fonts',
-  'wdiff',
-  'zip',
-)
-
-
-# Run-time libraries required by chromeos only.
-_packages_chromeos_lib = (
-  'libbz2-1.0',
-  'libpulse0',
-)
-
-
-# Full list of required run-time libraries.
-_packages_lib = (
-  'libasound2',
-  'libatk1.0-0',
-  'libc6',
-  'libcairo2',
-  'libcap2',
-  'libcups2',
-  'libexpat1',
-  'libfontconfig1',
-  'libfreetype6',
-  'libglib2.0-0',
-  'libgnome-keyring0',
-  'libpam0g',
-  'libpango1.0-0',
-  'libpci3',
-  'libpcre3',
-  'libpixman-1-0',
-  'libpng12-0',
-  'libspeechd2',
-  'libsqlite3-0',
-  'libstdc++6',
-  'libx11-6',
-  'libx11-xcb1',
-  'libxau6',
-  'libxcb1',
-  'libxcomposite1',
-  'libxcursor1',
-  'libxdamage1',
-  'libxdmcp6',
-  'libxext6',
-  'libxfixes3',
-  'libxi6',
-  'libxinerama1',
-  'libxrandr2',
-  'libxrender1',
-  'libxtst6',
-  'zlib1g',
-)
-
-
-# Debugging symbols for all of the run-time libraries.
-_packages_dbg = (
-  'libatk1.0-dbg',
-  'libc6-dbg',
-  'libcairo2-dbg',
-  'libfontconfig1-dbg',
-  'libglib2.0-0-dbg',
-  'libpango1.0-0-dbg',
-  'libpcre3-dbg',
-  'libpixman-1-0-dbg',
-  'libsqlite3-0-dbg',
-  'libx11-6-dbg',
-  'libx11-xcb1-dbg',
-  'libxau6-dbg',
-  'libxcb1-dbg',
-  'libxcomposite1-dbg',
-  'libxcursor1-dbg',
-  'libxdamage1-dbg',
-  'libxdmcp6-dbg',
-  'libxext6-dbg',
-  'libxfixes3-dbg',
-  'libxi6-dbg',
-  'libxinerama1-dbg',
-  'libxrandr2-dbg',
-  'libxrender1-dbg',
-  'libxtst6-dbg',
-  'zlib1g-dbg',
-)
-
-
-# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf.
-_packages_lib32 = (
-  'linux-libc-dev:i386',
-)
-
-
-# arm cross toolchain packages needed to build chrome on armhf.
-_packages_arm = (
-  'g++-arm-linux-gnueabihf',
-  'libc6-dev-armhf-cross',
-  'linux-libc-dev-armhf-cross',
-)
-
-
-# Packages to build NaCl, its toolchains, and its ports.
-_packages_naclports = (
-  'ant',
-  'autoconf',
-  'bison',
-  'cmake',
-  'gawk',
-  'intltool',
-  'xsltproc',
-  'xutils-dev',
-)
-_packages_nacl = (
-  'g++-mingw-w64-i686',
-  'lib32ncurses5-dev',
-  'lib32z1-dev',
-  'libasound2:i386',
-  'libcap2:i386',
-  'libelf-dev:i386',
-  'libfontconfig1:i386',
-  'libgconf-2-4:i386',
-  'libglib2.0-0:i386',
-  'libgpm2:i386',
-  'libncurses5:i386',
-  'libnss3:i386',
-  'libpango1.0-0:i386',
-  'libssl1.0.0:i386',
-  'libtinfo-dev',
-  'libtinfo-dev:i386',
-  'libtool',
-  'libxcomposite1:i386',
-  'libxcursor1:i386',
-  'libxdamage1:i386',
-  'libxi6:i386',
-  'libxrandr2:i386',
-  'libxss1:i386',
-  'libxtst6:i386',
-  'texinfo',
-  'xvfb',
-)
-
-
-def is_userland_64_bit():
-  return platform.architecture()[0] == '64bit'
-
-
-def package_exists(pkg):
-  return pkg in subprocess.check_output(['apt-cache', 'pkgnames']).splitlines()
-
-
-def lsb_release_short_codename():
-  return subprocess.check_output(
-      ['lsb_release', '--codename', '--short']).strip()
-
-
-def write_error(message):
-  sys.stderr.write('ERROR: %s\n' % message)
-  sys.stderr.flush()
-
-
-def nonfatal_get_output(*popenargs, **kwargs):
-  process = subprocess.Popen(
-      stdout=subprocess.PIPE, stderr=subprocess.PIPE, *popenargs, **kwargs)
-  stdout, stderr = process.communicate()
-  retcode = process.poll()
-  return retcode, stdout, stderr
-
-
-def compute_dynamic_package_lists():
-  global _packages_arm
-  global _packages_dbg
-  global _packages_dev
-  global _packages_lib
-  global _packages_lib32
-  global _packages_nacl
-
-  if is_userland_64_bit():
-    # 64-bit systems need a minimum set of 32-bit compat packages
-    # for the pre-built NaCl binaries.
-    _packages_dev += (
-      'lib32gcc1',
-      'lib32stdc++6',
-      'libc6-i386',
-    )
-
-    # When cross building for arm/Android on 64-bit systems the host binaries
-    # that are part of v8 need to be compiled with -m32 which means
-    # that basic multilib support is needed.
-    # gcc-multilib conflicts with the arm cross compiler (at least in trusty)
-    # but g++-X.Y-multilib gives us the 32-bit support that we need. Find out
-    # the appropriate value of X and Y by seeing what version the current
-    # distribution's g++-multilib package depends on.
-    output = subprocess.check_output(['apt-cache', 'depends', 'g++-multilib'])
-    multilib_package = re.search(r'g\+\+-[0-9.]+-multilib', output).group()
-    _packages_lib32 += (multilib_package,)
-
-  lsb_codename = lsb_release_short_codename()
-
-  # Find the proper version of libstdc++6-4.x-dbg.
-  if lsb_codename == 'trusty':
-    _packages_dbg += ('libstdc++6-4.8-dbg',)
-  else:
-    _packages_dbg += ('libstdc++6-4.9-dbg',)
-
-  # Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056 .
-  if lsb_codename == 'trusty':
-    _packages_arm += (
-      'g++-4.8-multilib-arm-linux-gnueabihf',
-      'gcc-4.8-multilib-arm-linux-gnueabihf',
-    )
-
-  # Find the proper version of libgbm-dev. We can't just install libgbm-dev as
-  # it depends on mesa, and only one version of mesa can exists on the system.
-  # Hence we must match the same version or this entire script will fail.
-  mesa_variant = ''
-  for variant in ('-lts-trusty', '-lts-utopic'):
-    rc, stdout, stderr = nonfatal_get_output(
-        ['dpkg-query', '-Wf\'{Status}\'', 'libgl1-mesa-glx' + variant])
-    if 'ok installed' in output:
-      mesa_variant = variant
-  _packages_dev += (
-    'libgbm-dev' + mesa_variant,
-    'libgl1-mesa-dev' + mesa_variant,
-    'libgles2-mesa-dev' + mesa_variant,
-    'mesa-common-dev' + mesa_variant,
-  )
-
-  if package_exists('ttf-mscorefonts-installer'):
-    _packages_dev += ('ttf-mscorefonts-installer',)
-  else:
-    _packages_dev += ('msttcorefonts',)
-
-  if package_exists('libnspr4-dbg'):
-    _packages_dbg += ('libnspr4-dbg', 'libnss3-dbg')
-    _packages_lib += ('libnspr4', 'libnss3')
-  else:
-    _packages_dbg += ('libnspr4-0d-dbg', 'libnss3-1d-dbg')
-    _packages_lib += ('libnspr4-0d', 'libnss3-1d')
-
-  if package_exists('libjpeg-dev'):
-    _packages_dev += ('libjpeg-dev',)
-  else:
-    _packages_dev += ('libjpeg62-dev',)
-
-  if package_exists('libudev1'):
-    _packages_dev += ('libudev1',)
-    _packages_nacl += ('libudev1:i386',)
-  else:
-    _packages_dev += ('libudev0',)
-    _packages_nacl += ('libudev0:i386',)
-
-  if package_exists('libbrlapi0.6'):
-    _packages_dev += ('libbrlapi0.6',)
-  else:
-    _packages_dev += ('libbrlapi0.5',)
-
-  if package_exists('apache2-bin'):
-    _packages_dev += ('apache2-bin',)
-  else:
-    _packages_dev += ('apache2.2-bin',)
-
-  if package_exists('xfonts-mathml'):
-    _packages_dev += ('xfonts-mathml',)
-
-  # Some packages are only needed if the distribution actually supports
-  # installing them.
-  if package_exists('appmenu-gtk'):
-    _packages_lib += ('appmenu-gtk',)
-
-  _packages_dev += _packages_chromeos_dev
-  _packages_lib += _packages_chromeos_lib
-  _packages_nacl += _packages_naclports
-
-
-def quick_check(packages):
-  rc, stdout, stderr = nonfatal_get_output([
-      'dpkg-query', '-W', '-f', '${PackageSpec}:${Status}\n'] + list(packages))
-  if rc == 0 and not stderr:
-    return 0
-  print stderr
-  return 1
-
-
-def main(argv):
-  parser = argparse.ArgumentParser()
-  parser.add_argument('--quick-check', action='store_true',
-                      help='quickly try to determine if dependencies are '
-                           'installed (this avoids interactive prompts and '
-                           'sudo commands so might not be 100% accurate)')
-  parser.add_argument('--unsupported', action='store_true',
-                      help='attempt installation even on unsupported systems')
-  args = parser.parse_args(argv)
-
-  lsb_codename = lsb_release_short_codename()
-  if not args.unsupported and not args.quick_check:
-    if lsb_codename not in map(
-        operator.itemgetter('codename'), SUPPORTED_UBUNTU_VERSIONS):
-      supported_ubuntus = ['%(number)s (%(codename)s)' % v
-                           for v in SUPPORTED_UBUNTU_VERSIONS]
-      write_error('Only Ubuntu %s are currently supported.' %
-                  ', '.join(supported_ubuntus))
-      return 1
-
-    if platform.machine() not in ('i686', 'x86_64'):
-      write_error('Only x86 architectures are currently supported.')
-      return 1
-
-  if os.geteuid() != 0 and not args.quick_check:
-    print 'Running as non-root user.'
-    print 'You might have to enter your password one or more times'
-    print 'for \'sudo\'.'
-    print
-
-  compute_dynamic_package_lists()
-
-  packages = (_packages_dev + _packages_lib + _packages_dbg + _packages_lib32 +
-              _packages_arm + _packages_nacl)
-  def packages_key(pkg):
-    s = pkg.rsplit(':', 1)
-    if len(s) == 1:
-      return (s, '')
-    return s
-  packages = sorted(set(packages), key=packages_key)
-
-  if args.quick_check:
-    return quick_check(packages)
-
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
diff --git a/cc/paint/paint_op_buffer.h b/cc/paint/paint_op_buffer.h
index c5f8fb9..028a476 100644
--- a/cc/paint/paint_op_buffer.h
+++ b/cc/paint/paint_op_buffer.h
@@ -18,7 +18,6 @@
 #include "base/memory/aligned_memory.h"
 #include "base/optional.h"
 #include "cc/base/math_util.h"
-#include "cc/paint/image_provider.h"
 #include "cc/paint/paint_canvas.h"
 #include "cc/paint/paint_export.h"
 #include "cc/paint/paint_flags.h"
@@ -40,6 +39,7 @@
 // See: third_party/skia/src/core/SkLiteDL.h.
 namespace cc {
 class ClientPaintCache;
+class ImageProvider;
 class ServicePaintCache;
 class PaintWorkletImageProvider;
 
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index bca92dd..9ec78ee 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -522,7 +522,7 @@
             {{ self.chrome_activity_common() }}>
             {{ self.extra_web_rendering_activity_definitions() }}
         </activity>
-        <activity android:name="org.chromium.chrome.browser.NoTouchActivity"
+        <activity android:name="org.chromium.chrome.browser.touchless.NoTouchActivity"
             android:theme="@style/MainTheme"
             android:exported="false"
             android:launchMode="singleTask"
diff --git a/chrome/android/java/monochrome_public_apk.AndroidManifest.expected b/chrome/android/java/monochrome_public_apk.AndroidManifest.expected
index c39719b..5c3fb37 100644
--- a/chrome/android/java/monochrome_public_apk.AndroidManifest.expected
+++ b/chrome/android/java/monochrome_public_apk.AndroidManifest.expected
@@ -593,7 +593,7 @@
             android:windowSoftInputMode="adjustResize" >
         </activity>
         <activity
-            android:name="org.chromium.chrome.browser.NoTouchActivity"
+            android:name="org.chromium.chrome.browser.touchless.NoTouchActivity"
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode|density"
             android:exported="false"
             android:hardwareAccelerated="false"
diff --git a/chrome/android/java/res/layout/edit_url_suggestion_layout.xml b/chrome/android/java/res/layout/edit_url_suggestion_layout.xml
index f34571e..45d585b8 100644
--- a/chrome/android/java/res/layout/edit_url_suggestion_layout.xml
+++ b/chrome/android/java/res/layout/edit_url_suggestion_layout.xml
@@ -24,21 +24,21 @@
         <org.chromium.ui.widget.ChromeImageButton
             android:id="@+id/url_copy_icon"
             style="@style/OmniboxSuggestionIconButton"
-            android:src="@drawable/ic_content_copy_black"
+            app:srcCompat="@drawable/ic_content_copy_black"
             android:contentDescription="@string/copy_link"
             android:visibility="gone" />
 
         <org.chromium.ui.widget.ChromeImageButton
             android:id="@+id/url_share_icon"
             style="@style/OmniboxSuggestionIconButton"
-            android:src="@drawable/ic_share_white_24dp"
+            app:srcCompat="@drawable/ic_share_white_24dp"
             android:contentDescription="@string/menu_share_page"
             android:visibility="gone" />
 
         <org.chromium.ui.widget.ChromeImageButton
             android:id="@+id/url_edit_icon"
             style="@style/OmniboxSuggestionIconButton"
-            android:src="@drawable/bookmark_edit_active"
+            app:srcCompat="@drawable/bookmark_edit_active"
             android:contentDescription="@string/bookmark_item_edit" />
 
     </LinearLayout>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index a90d75e..60dbc975 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -112,6 +112,7 @@
 import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
 import org.chromium.chrome.browser.offlinepages.indicator.OfflineIndicatorController;
 import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
+import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuButtonState;
 import org.chromium.chrome.browser.page_info.PageInfoController;
 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
@@ -324,6 +325,8 @@
     /** Whether or not the activity is in started state. */
     private boolean mStarted;
 
+    private final Runnable mUpdateStateChangedListener = this::onUpdateStateChanged;
+
     /**
      * @param factory The {@link AppMenuHandlerFactory} for creating {@link #mAppMenuHandler}
      */
@@ -1139,8 +1142,7 @@
                 return currentTab.getUrl();
             });
 
-            UpdateMenuItemHelper.getInstance().checkForUpdateOnBackgroundThread(
-                    ChromeActivity.this);
+            UpdateMenuItemHelper.getInstance().registerObserver(mUpdateStateChangedListener);
         });
 
         final String simpleName = getClass().getSimpleName();
@@ -1361,6 +1363,8 @@
             if (selector != null) selector.destroy();
         }
 
+        UpdateMenuItemHelper.getInstance().unregisterObserver(mUpdateStateChangedListener);
+
         AccessibilityManager manager = (AccessibilityManager)
                 getBaseContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
         manager.removeAccessibilityStateChangeListener(this);
@@ -2086,10 +2090,14 @@
     }
 
     /**
-     * Callback after UpdateMenuItemHelper#checkForUpdateOnBackgroundThread is complete.
+     * Callback for when UpdateMenuItemHelper has a state change.
      */
-    public void onCheckForUpdate() {
-        if (UpdateMenuItemHelper.getInstance().shouldShowToolbarBadge(this)) {
+    public void onUpdateStateChanged() {
+        if (isActivityDestroyed()) return;
+
+        MenuButtonState buttonState = UpdateMenuItemHelper.getInstance().getUiState().buttonState;
+
+        if (buttonState != null) {
             mToolbarManager.showAppMenuUpdateBadge();
             mCompositorViewHolder.requestRender();
         } else {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
index 53411ea3..933622e3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
@@ -439,7 +439,7 @@
      * @param intent Target intent.
      * @return Whether the Intent was successfully handled.
      */
-    boolean onNewIntent(Intent intent) {
+    public boolean onNewIntent(Intent intent) {
         updateDeferredIntent(null);
 
         assert intentHasValidUrl(intent);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
index a0df2da..3c0cd76 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
@@ -44,6 +44,7 @@
 import org.chromium.chrome.browser.searchwidget.SearchActivity;
 import org.chromium.chrome.browser.tab.Tab;
 import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin;
+import org.chromium.chrome.browser.touchless.NoTouchActivity;
 import org.chromium.chrome.browser.upgrade.UpgradeActivity;
 import org.chromium.chrome.browser.util.FeatureUtilities;
 import org.chromium.chrome.browser.util.IntentUtils;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
index a56a642..cec95e6c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
@@ -134,5 +134,5 @@
     }
 
     @Override
-    public void onCheckForUpdate() {}
+    public void onUpdateStateChanged() {}
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java
index a0412cc4..8128c9e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java
@@ -8,6 +8,7 @@
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
+import android.content.res.Resources;
 import android.graphics.drawable.Drawable;
 import android.support.annotation.IntDef;
 import android.support.v7.content.res.AppCompatResources;
@@ -25,6 +26,7 @@
 import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
+import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuItemState;
 import org.chromium.chrome.browser.widget.ViewHighlighter;
 import org.chromium.ui.base.LocalizationUtils;
 import org.chromium.ui.interpolators.BakedBezierInterpolator;
@@ -199,10 +201,22 @@
                     holder = (CustomMenuItemViewHolder) convertView.getTag();
                 }
                 setupStandardMenuItemViewHolder(holder, convertView, item);
-                boolean updateItemEnabled =
-                        UpdateMenuItemHelper.getInstance().decorateMenuItemViews(
-                                mInflater.getContext(), holder.text, holder.image, holder.summary);
-                convertView.setEnabled(updateItemEnabled);
+                MenuItemState itemState = UpdateMenuItemHelper.getInstance().getUiState().itemState;
+                if (itemState != null) {
+                    Resources resources = convertView.getResources();
+
+                    holder.text.setText(itemState.title);
+                    holder.text.setContentDescription(resources.getString(itemState.title));
+                    holder.text.setTextColor(
+                            ApiCompatibilityUtils.getColor(resources, itemState.titleColor));
+
+                    if (!TextUtils.isEmpty(itemState.summary)) {
+                        holder.summary.setText(itemState.summary);
+                    }
+
+                    holder.image.setImageResource(itemState.icon);
+                    convertView.setEnabled(itemState.enabled);
+                }
                 break;
             }
             case MenuItemType.THREE_BUTTON:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
index 88aa088..a190cdd 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
@@ -151,8 +151,8 @@
                 }
             }
 
-            menu.findItem(R.id.update_menu_id).setVisible(
-                    UpdateMenuItemHelper.getInstance().shouldShowMenuItem(mActivity));
+            menu.findItem(R.id.update_menu_id)
+                    .setVisible(UpdateMenuItemHelper.getInstance().getUiState().itemState != null);
 
             boolean hasMoreThanOneTab = mActivity.getTabModelSelector().getTotalTabCount() > 1;
             menu.findItem(R.id.move_to_other_window_menu_id).setVisible(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
index 9fe9ef4..744a9b0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
@@ -349,6 +349,16 @@
         }
     }
 
+    /**
+     * Returns whether the panel has been activated -- asked to show.  It may not yet be physically
+     * showing due animation.  Use {@link #isShowing} instead to determine if the panel is
+     * physically visible.
+     * @return Whether the panel is showing or about to show.
+     */
+    public boolean isActive() {
+        return mPanelShown;
+    }
+
     // ============================================================================================
     // ActivityStateListener
     // ============================================================================================
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java
index 2883c05e38..e3f65db 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactView.java
@@ -92,7 +92,7 @@
         };
         mModel = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
                          .with(ModalDialogProperties.CONTROLLER, controller)
-                         .with(ModalDialogProperties.TITLE, mDisplayName.getText().toString())
+                         .with(ModalDialogProperties.TITLE, mContactDetails.getDisplayName())
                          .with(ModalDialogProperties.MESSAGE,
                                  mContactDetails.getContactDetailsAsString(true, null))
                          .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, mContext.getResources(),
@@ -142,6 +142,7 @@
 
         String displayName = contactDetails.getDisplayName();
         mDisplayName.setText(displayName);
+
         String details = contactDetails.getContactDetailsAsString(
                 /*longVersion=*/false, mContext.getResources());
         mDetailsView.setText(details);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsFetcherWorkerTask.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsFetcherWorkerTask.java
index d8412a9..5d693a44 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsFetcherWorkerTask.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/ContactsFetcherWorkerTask.java
@@ -14,6 +14,7 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -42,14 +43,22 @@
     // The callback to use to communicate the results.
     private ContactsRetrievedCallback mCallback;
 
+    // Whether to include emails in the data fetched.
+    private final boolean mIncludeEmails;
+
+    // Whether to include telephones in the data fetched.
+    private final boolean mIncludeTel;
+
     /**
      * A ContactsFetcherWorkerTask constructor.
      * @param callback The callback to use to communicate back the results.
      */
-    public ContactsFetcherWorkerTask(
-            ContentResolver contentResolver, ContactsRetrievedCallback callback) {
+    public ContactsFetcherWorkerTask(ContentResolver contentResolver,
+            ContactsRetrievedCallback callback, boolean includeEmails, boolean includeTel) {
         mContentResolver = contentResolver;
         mCallback = callback;
+        mIncludeEmails = includeEmails;
+        mIncludeTel = includeTel;
     }
 
     /**
@@ -110,19 +119,21 @@
      * @return The contact list as an array.
      */
     public ArrayList<ContactDetails> getAllContacts() {
-        Map<String, ArrayList<String>> emailMap =
-                getDetails(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
+        Map<String, ArrayList<String>> emailMap = mIncludeEmails
+                ? getDetails(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
                         ContactsContract.CommonDataKinds.Email.CONTACT_ID,
                         ContactsContract.CommonDataKinds.Email.DATA,
                         ContactsContract.CommonDataKinds.Email.CONTACT_ID + " ASC, "
-                                + ContactsContract.CommonDataKinds.Email.DATA + " ASC");
+                                + ContactsContract.CommonDataKinds.Email.DATA + " ASC")
+                : null;
 
-        Map<String, ArrayList<String>> phoneMap =
-                getDetails(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
+        Map<String, ArrayList<String>> phoneMap = mIncludeTel
+                ? getDetails(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                         ContactsContract.CommonDataKinds.Phone.CONTACT_ID,
                         ContactsContract.CommonDataKinds.Email.DATA,
                         ContactsContract.CommonDataKinds.Email.CONTACT_ID + " ASC, "
-                                + ContactsContract.CommonDataKinds.Phone.NUMBER + " ASC");
+                                + ContactsContract.CommonDataKinds.Phone.NUMBER + " ASC")
+                : null;
 
         // A cursor containing the raw contacts data.
         Cursor cursor = mContentResolver.query(ContactsContract.Contacts.CONTENT_URI, PROJECTION,
@@ -134,7 +145,10 @@
             String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
             String name = cursor.getString(
                     cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME_PRIMARY));
-            contacts.add(new ContactDetails(id, name, emailMap.get(id), phoneMap.get(id)));
+            List<String> email = mIncludeEmails ? emailMap.get(id) : null;
+            List<String> tel = mIncludeTel ? phoneMap.get(id) : null;
+            if (email != null || tel != null)
+                contacts.add(new ContactDetails(id, name, email, tel));
         } while (cursor.moveToNext());
 
         cursor.close();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java
index 9cb6ba3..85b84c27 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contacts_picker/PickerAdapter.java
@@ -91,7 +91,8 @@
         mContentResolver = contentResolver;
 
         if (getAllContacts() == null && sTestContacts == null) {
-            mWorkerTask = new ContactsFetcherWorkerTask(mContentResolver, this);
+            mWorkerTask = new ContactsFetcherWorkerTask(
+                    mContentResolver, this, mCategoryView.includeEmails, mCategoryView.includeTel);
             mWorkerTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
         } else {
             mContactDetails = sTestContacts;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index e52a302..b42fceb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -358,6 +358,11 @@
         return mSearchPanel != null && mSearchPanel.isShowing();
     }
 
+    /** @return Whether the {@code mSearchPanel} is not {@code null} and is currently active. */
+    boolean isSearchPanelActive() {
+        return mSearchPanel != null && mSearchPanel.isActive();
+    }
+
     /**
      * @return the {@link WebContents} of the {@code mSearchPanel} or {@code null} if
      *         {@code mSearchPanel} is null or the search panel doesn't currently hold one.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java
index 057750a..e19cb19 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java
@@ -5,7 +5,6 @@
 package org.chromium.chrome.browser.contextualsearch;
 
 import android.app.Activity;
-import android.os.Handler;
 import android.view.ContextMenu;
 
 import org.chromium.base.annotations.CalledByNative;
@@ -113,15 +112,10 @@
             if (activityTab != mTab) return;
 
             // Removes the hooks if the panel other than contextual search panel just got shown.
-            // Post the task on handler since |isSearchPanelShowing| is not reliable right after
-            // this event is invoked because it is based on the panel height which might be
-            // changing for animation effect.
-            new Handler().post(() -> {
-                if (!getContextualSearchManager(mTab).isSearchPanelShowing()) {
-                    mUnhookedTab = activityTab;
-                    updateContextualSearchHooks(mUnhookedTab.getWebContents());
-                }
-            });
+            if (!getContextualSearchManager(mTab).isSearchPanelActive()) {
+                mUnhookedTab = activityTab;
+                updateContextualSearchHooks(mUnhookedTab.getWebContents());
+            }
         }
 
         @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 4f1ae08..7f79b6c0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -907,7 +907,7 @@
     }
 
     @Override
-    public void onCheckForUpdate() {}
+    public void onUpdateStateChanged() {}
 
     /**
      * @return The {@link CustomTabIntentDataProvider} for this {@link CustomTabActivity}. For test
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
index 4cb79bd4..add9ec0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -1447,10 +1447,6 @@
             CustomTabsSessionToken session, String url, String origin, int referrerPolicy,
             @DetachedResourceRequestMotivation int motivation);
 
-    public ModuleLoader getModuleLoader(ComponentName componentName) {
-        return getModuleLoader(componentName, 0);
-    }
-
     public ModuleLoader getModuleLoader(ComponentName componentName, int resourceId) {
         if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_MODULE_DEX_LOADING)) {
             resourceId = 0;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleLoader.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleLoader.java
index ff5787da..a0f3dcb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleLoader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleLoader.java
@@ -233,7 +233,7 @@
     }
 
     public void destroyModule(@DestructionReason int reason) {
-        assert mModuleEntryPoint != null;
+        if (mModuleEntryPoint == null) return;
 
         ModuleMetrics.recordDestruction(reason);
         mModuleEntryPoint.onDestroy();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
new file mode 100644
index 0000000..e11ed21e
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
@@ -0,0 +1,112 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.omaha;
+
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+
+import org.chromium.base.CommandLine;
+import org.chromium.chrome.browser.ChromeSwitches;
+import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
+import org.chromium.components.variations.VariationsAssociatedData;
+
+/**
+ * Helper class for retrieving experiment configuration values and for manually testing update
+ * functionality.  Use the following switches to test locally:
+ * - {@link ChromeSwitches#FORCE_UPDATE_MENU_UPDATE_TYPE} (required)
+ * - {@link ChromeSwitches#FORCE_SHOW_UPDATE_MENU_BADGE} (optional)
+ * - {@link ChromeSwitches#MARKET_URL_FOR_TESTING} (optional)
+ */
+class UpdateConfigs {
+    // VariationsAssociatedData configs
+    private static final String FIELD_TRIAL_NAME = "UpdateMenuItem";
+    private static final String ENABLED_VALUE = "true";
+    private static final String CUSTOM_SUMMARY = "custom_summary";
+    private static final String MIN_REQUIRED_STORAGE_MB = "min_required_storage_for_update_mb";
+
+    // Update state switch values.
+    private static final String NONE_SWITCH_VALUE = "none";
+    private static final String UPDATE_AVAILABLE_SWITCH_VALUE = "update_available";
+    private static final String UNSUPPORTED_OS_VERSION_SWITCH_VALUE = "unsupported_os_version";
+
+    /**
+     * @return The minimum required storage to show the update prompt or {@code -1} if there is no
+     * minimum.
+     */
+    public static int getMinRequiredStorage() {
+        String value = CommandLine.getInstance().getSwitchValue(MIN_REQUIRED_STORAGE_MB);
+        if (TextUtils.isEmpty(value)) {
+            value = VariationsAssociatedData.getVariationParamValue(
+                    FIELD_TRIAL_NAME, MIN_REQUIRED_STORAGE_MB);
+        }
+        if (TextUtils.isEmpty(value)) return -1;
+
+        try {
+            return Integer.parseInt(value);
+        } catch (NumberFormatException e) {
+            return -1;
+        }
+    }
+
+    /**
+     * @return A custom update menu summary to show.  This should override the default summary for
+     * 'update available' menu items.
+     */
+    public static String getCustomSummary() {
+        return getStringParamValue(CUSTOM_SUMMARY);
+    }
+
+    /**
+     * @return Whether or not to always show the update badge on the menu depending on the update
+     * state.
+     */
+    public static boolean getAlwaysShowMenuBadge() {
+        if (CommandLine.getInstance().hasSwitch(ChromeSwitches.FORCE_SHOW_UPDATE_MENU_BADGE)) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /** @return A test {@link UpdateState} to use or {@code null} if no test state was specified. */
+    public static @UpdateState Integer getMockUpdateState() {
+        String forcedUpdateType = getStringParamValue(ChromeSwitches.FORCE_UPDATE_MENU_UPDATE_TYPE);
+        if (TextUtils.isEmpty(forcedUpdateType)) return null;
+
+        switch (forcedUpdateType) {
+            case NONE_SWITCH_VALUE:
+                return UpdateState.NONE;
+            case UPDATE_AVAILABLE_SWITCH_VALUE:
+                return UpdateState.UPDATE_AVAILABLE;
+            case UNSUPPORTED_OS_VERSION_SWITCH_VALUE:
+                return UpdateState.UNSUPPORTED_OS_VERSION;
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * @return A URL to use when an update is available if mocking out the update available menu
+     * item.
+     */
+    public static String getMockMarketUrl() {
+        return getStringParamValue(ChromeSwitches.MARKET_URL_FOR_TESTING);
+    }
+
+    /**
+     * Gets a String VariationsAssociatedData parameter. Also checks for a command-line switch with
+     * the same name, for easy local testing.
+     * @param paramName The name of the parameter (or command-line switch) to get a value for.
+     * @return The command-line flag value if present, or the param is value if present.
+     */
+    @Nullable
+    private static String getStringParamValue(String paramName) {
+        String value = CommandLine.getInstance().getSwitchValue(paramName);
+        if (TextUtils.isEmpty(value)) {
+            value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
+        }
+        return value;
+    }
+}
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
index b79a5c7..a2ae2dd3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
@@ -4,52 +4,29 @@
 
 package org.chromium.chrome.browser.omaha;
 
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-import android.annotation.TargetApi;
+import android.app.Activity;
 import android.content.ActivityNotFoundException;
-import android.content.Context;
 import android.content.Intent;
-import android.content.pm.PackageManager;
 import android.content.res.Resources;
-import android.graphics.Color;
-import android.graphics.drawable.Drawable;
 import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.os.StatFs;
-import android.support.annotation.IntDef;
+import android.os.Handler;
+import android.os.Looper;
+import android.support.annotation.ColorInt;
+import android.support.annotation.DrawableRes;
+import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.annotation.StringRes;
 import android.text.TextUtils;
-import android.view.View;
-import android.view.animation.LinearInterpolator;
-import android.widget.TextView;
 
-import com.google.android.gms.common.GooglePlayServicesUtil;
-
-import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.base.BuildInfo;
-import org.chromium.base.CommandLine;
+import org.chromium.base.ContextUtils;
 import org.chromium.base.Log;
-import org.chromium.base.ThreadUtils;
+import org.chromium.base.ObserverList;
 import org.chromium.base.metrics.RecordHistogram;
-import org.chromium.base.task.AsyncTask;
 import org.chromium.chrome.R;
-import org.chromium.chrome.browser.ChromeActivity;
-import org.chromium.chrome.browser.ChromeSwitches;
-import org.chromium.chrome.browser.appmenu.AppMenu;
-import org.chromium.chrome.browser.appmenu.AppMenuItemIcon;
-import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
+import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
+import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateStatus;
 import org.chromium.chrome.browser.preferences.PrefServiceBridge;
-import org.chromium.chrome.browser.util.ConversionUtils;
-import org.chromium.components.variations.VariationsAssociatedData;
-import org.chromium.ui.interpolators.BakedBezierInterpolator;
-
-import java.io.File;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
 
 /**
  * Contains logic related to displaying app menu badge and a special menu item for information
@@ -60,74 +37,99 @@
  *
  * It also has logic for logging usage of the update menu item to UMA.
  *
- * For manually testing this functionality, use the following switches:
- * - {@link ChromeSwitches#FORCE_UPDATE_MENU_UPDATE_TYPE} (required)
- * - {@link ChromeSwitches#FORCE_SHOW_UPDATE_MENU_BADGE} (optional)
- * - {@link ChromeSwitches#MARKET_URL_FOR_TESTING} (optional)
+ * For manually testing this functionality, see {@link UpdateConfigs}.
  */
 public class UpdateMenuItemHelper {
-    @IntDef({UpdateMenuItemHelper.UpdateType.UNKNOWN, UpdateMenuItemHelper.UpdateType.NONE,
-            UpdateMenuItemHelper.UpdateType.UPDATE_AVAILABLE,
-            UpdateMenuItemHelper.UpdateType.UNSUPPORTED_OS_VERSION})
-    @Retention(RetentionPolicy.SOURCE)
-    public @interface UpdateType {
-        int UNKNOWN = 0;
-        int NONE = 1;
-        int UPDATE_AVAILABLE = 2;
-        int UNSUPPORTED_OS_VERSION = 3;
-    }
-
-    private static final String NONE_SWITCH_VALUE = "none";
-    private static final String UPDATE_AVAILABLE_SWITCH_VALUE = "update_available";
-    private static final String UNSUPPORTED_OS_VERSION_SWITCH_VALUE = "unsupported_os_version";
-
     private static final String TAG = "UpdateMenuItemHelper";
-    // VariationsAssociatedData configs
-    private static final String FIELD_TRIAL_NAME = "UpdateMenuItem";
-    private static final String ENABLED_VALUE = "true";
-    private static final String CUSTOM_SUMMARY = "custom_summary";
 
-    private static final String MIN_REQUIRED_STORAGE_MB = "min_required_storage_for_update_mb";
     // UMA constants for logging whether the menu item was clicked.
     private static final int ITEM_NOT_CLICKED = 0;
     private static final int ITEM_CLICKED_INTENT_LAUNCHED = 1;
     private static final int ITEM_CLICKED_INTENT_FAILED = 2;
-
     private static final int ITEM_CLICKED_BOUNDARY = 3;
+
     // UMA constants for logging whether Chrome was updated after the menu item was clicked.
     private static final int UPDATED = 0;
     private static final int NOT_UPDATED = 1;
-
     private static final int UPDATED_BOUNDARY = 2;
+
+    /** The UI state required to properly display an update-related main menu item. */
+    public static class MenuItemState {
+        /** The title resource of the menu.  Always set if this object is not {@code null}. */
+        public @StringRes int title;
+
+        /** The color resource of the title.  Always set if this object is not {@code null}. */
+        public @ColorInt int titleColor;
+
+        /** The summary string for the menu.  Maybe {@code null} if no summary should be shown. */
+        public @Nullable String summary;
+
+        /** An icon resource for the menu item.  May be {@code 0} if no icon is specified. */
+        public @DrawableRes int icon;
+
+        /** Whether or not the menu item should be enabled (and clickable). */
+        public boolean enabled;
+    }
+
+    /** The UI state required to properly display a 'update decorated' main menu button. */
+    public static class MenuButtonState {
+        /**
+         * The new content description of the menu button.  Always set if this object is not
+         * {@code null}.
+         */
+        public @StringRes int menuContentDescription;
+
+        /**
+         * An icon resource for the dark badge for the menu button.  Always set (not {@code 0}) if
+         * this object is not {@code null}.
+         */
+        public @DrawableRes int darkBadgeIcon;
+
+        /**
+         * An icon resource for the light badge for the menu button.  Always set (not {@code 0}) if
+         * this object is not {@code null}.
+         */
+        public @DrawableRes int lightBadgeIcon;
+    }
+
+    /**
+     * The UI state required to properly decorate the main menu.  This may include the button
+     * decorations as well as the actual update item to show in the menu.
+     */
+    public static class MenuUiState {
+        /**
+         * The optional UI state for building the menu item.  If {@code null} no item should be
+         * shown.
+         */
+        public @Nullable MenuItemState itemState;
+
+        /**
+         * The optional UI state for decorating the menu button itself.  If {@code null} no
+         * decoration should be applied to the menu button.
+         */
+        public @Nullable MenuButtonState buttonState;
+    }
+
     private static UpdateMenuItemHelper sInstance;
 
     private static Object sGetInstanceLock = new Object();
 
-    // Whether OmahaClient has already been checked for an update.
-    private boolean mAlreadyCheckedForUpdates;
+    private final ObserverList<Runnable> mObservers = new ObserverList<>();
 
-    // The current state of whether an update is available or whether it ever will be
-    // (unsupported OS).
-    private @UpdateType int mUpdateType;
+    private final Handler mHandler = new Handler(Looper.getMainLooper());
 
-    // URL to direct the user to when Omaha detects a newer version available.
-    private String mUpdateUrl;
+    /**
+     * The current state of updates for Chrome.  This can change during runtime and may be {@code
+     * null} if the status hasn't been determined yet.
+     */
+    private @Nullable UpdateStatus mStatus;
+
+    private @NonNull MenuUiState mMenuUiState = new MenuUiState();
 
     // Whether the menu item was clicked. This is used to log the click-through rate.
     private boolean mMenuItemClicked;
 
-    // The latest Chrome version available if OmahaClient.isNewerVersionAvailable() returns true.
-    private String mLatestVersion;
-
-    // If the current OS version is unsupported, and we show the menu badge, and then the user
-    // clicks the badge and sees the unsupported message, we store the current version to a
-    // preference and cache it here. This preference is read on startup to ensure we only show
-    // the unsupported message once per version.
-    private String mLatestUnsupportedVersionPreference;
-
-    /**
-     * @return The {@link UpdateMenuItemHelper} instance.
-     */
+    /** @return The {@link UpdateMenuItemHelper} instance. */
     public static UpdateMenuItemHelper getInstance() {
         synchronized (UpdateMenuItemHelper.sGetInstanceLock) {
             if (sInstance == null) {
@@ -138,184 +140,35 @@
     }
 
     /**
-     * Decorates a menu item with the appropriate styling depending on the current update type.
-     *
-     * @param context The current context.
-     * @param title The title view.
-     * @param image The image view.
-     * @param summary The summary view.
-     * @return true if the menu item should be enabled. False otherwise.
+     * Registers {@code observer} to be triggered whenever the menu state changes.  This will always
+     * be triggered at least once after registration.
      */
-    public boolean decorateMenuItemViews(
-            Context context, TextView title, AppMenuItemIcon image, TextView summary) {
-        switch (getUpdateType()) {
-            case UpdateType.UPDATE_AVAILABLE:
-                title.setText(context.getString(R.string.menu_update));
-                // See crbug.com/899695 for why this line is necessary.
-                title.setContentDescription(context.getString(R.string.menu_update));
-                title.setTextColor(Color.RED);
+    public void registerObserver(Runnable observer) {
+        if (!mObservers.addObserver(observer)) return;
 
-                String customSummary = getStringParamValue(CUSTOM_SUMMARY);
-                if (TextUtils.isEmpty(customSummary)) {
-                    summary.setText(
-                            context.getResources().getString(R.string.menu_update_summary_default));
-                } else {
-                    summary.setText(customSummary);
-                }
-
-                image.setImageResource(R.drawable.badge_update_dark);
-                return true;
-            case UpdateType.UNSUPPORTED_OS_VERSION:
-                title.setText(R.string.menu_update_unsupported);
-                // See crbug.com/899695 for why this line is necessary.
-                title.setContentDescription(context.getString(R.string.menu_update_unsupported));
-                title.setTextColor(ApiCompatibilityUtils.getColor(
-                        context.getResources(), R.color.default_text_color));
-
-                summary.setText(R.string.menu_update_unsupported_summary_default);
-
-                image.setImageResource(R.drawable.ic_error_grey800_24dp_filled);
-                return false;
-            case UpdateType.NONE:
-            // Intentional fall through.
-            case UpdateType.UNKNOWN:
-            // Intentional fall through.
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * @param resources The resources to use for lookup.
-     * @return The dark drawable for the badge.
-     */
-    @Nullable
-    public Drawable getDarkBadgeDrawable(Resources resources) {
-        switch (getUpdateType()) {
-            case UpdateType.UPDATE_AVAILABLE:
-                return ApiCompatibilityUtils.getDrawable(resources, R.drawable.badge_update_dark);
-            case UpdateType.UNSUPPORTED_OS_VERSION:
-                return ApiCompatibilityUtils.getDrawable(
-                        resources, R.drawable.ic_error_grey800_24dp_filled);
-            case UpdateType.NONE:
-            // Intentional fall through.
-            case UpdateType.UNKNOWN:
-            // Intentional fall through.
-            default:
-                return null;
-        }
-    }
-
-    /**
-     * @param resources The resources to use for lookup.
-     * @return The light drawable for the badge.
-     */
-    @Nullable
-    public Drawable getLightBadgeDrawable(Resources resources) {
-        switch (getUpdateType()) {
-            case UpdateType.UPDATE_AVAILABLE:
-                return ApiCompatibilityUtils.getDrawable(resources, R.drawable.badge_update_light);
-            case UpdateType.UNSUPPORTED_OS_VERSION:
-                return ApiCompatibilityUtils.getDrawable(
-                        resources, R.drawable.ic_error_white_24dp_filled);
-            case UpdateType.NONE:
-            // Intentional fall through.
-            case UpdateType.UNKNOWN:
-            // Intentional fall through.
-            default:
-                return null;
-        }
-    }
-
-    /**
-     * Checks if the {@link OmahaClient} knows about an update.
-     * @param activity The current {@link ChromeActivity}.
-     */
-    public void checkForUpdateOnBackgroundThread(final ChromeActivity activity) {
-        ThreadUtils.assertOnUiThread();
-
-        if (mAlreadyCheckedForUpdates) {
-            if (activity.isActivityDestroyed()) return;
-            activity.onCheckForUpdate();
+        if (mStatus != null) {
+            mHandler.post(() -> {
+                if (mObservers.hasObserver(observer)) observer.run();
+            });
             return;
         }
 
-        mAlreadyCheckedForUpdates = true;
+        UpdateStatusProvider.getInstance().addObserver(status -> {
+            mStatus = status;
+            handleStateChanged();
+            pingObservers();
+            recordUpdateHistogram();
+        });
+    }
 
-        new AsyncTask<Void>() {
-            @Override
-            protected Void doInBackground() {
-                if (setForcedUpdateData()) return null;
+    /** Unregisters {@code observer} from menu state changes. */
+    public void unregisterObserver(Runnable observer) {
+        mObservers.removeObserver(observer);
+    }
 
-                if (VersionNumberGetter.isNewerVersionAvailable(activity)) {
-                    mUpdateUrl = MarketURLGetter.getMarketUrl(activity);
-                    mLatestVersion =
-                            VersionNumberGetter.getInstance().getLatestKnownVersion(activity);
-                    boolean hasSufficientStorage = checkForSufficientStorage();
-                    mUpdateType =
-                            hasSufficientStorage ? UpdateType.UPDATE_AVAILABLE : UpdateType.NONE;
-                    // If a new version is available, we should later possibly show the OS not
-                    // supported badge, so we need to clear the preference for now.
-                    ChromePreferenceManager.getInstance().removeKey(
-                            ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION);
-                    return null;
-                }
-
-                if (!VersionNumberGetter.isCurrentOsVersionSupported()) {
-                    mUpdateType = UpdateType.UNSUPPORTED_OS_VERSION;
-                    mLatestUnsupportedVersionPreference =
-                            ChromePreferenceManager.getInstance().readString(
-                                    ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, null);
-                    return null;
-                }
-
-                mUpdateType = UpdateType.NONE;
-                return null;
-            }
-
-            /**
-             * @return true if all the update related data should be forced to specific values.
-             */
-            private boolean setForcedUpdateData() {
-                String forcedUpdateType =
-                        getStringParamValue(ChromeSwitches.FORCE_UPDATE_MENU_UPDATE_TYPE);
-                if (TextUtils.isEmpty(forcedUpdateType)) return false;
-
-                switch (forcedUpdateType) {
-                    case NONE_SWITCH_VALUE:
-                        mUpdateType = UpdateType.NONE;
-                        break;
-                    case UPDATE_AVAILABLE_SWITCH_VALUE:
-                        mUpdateType = UpdateType.UPDATE_AVAILABLE;
-                        String testMarketUrl =
-                                getStringParamValue(ChromeSwitches.MARKET_URL_FOR_TESTING);
-                        if (!TextUtils.isEmpty(testMarketUrl)) mUpdateUrl = testMarketUrl;
-                        break;
-                    case UNSUPPORTED_OS_VERSION_SWITCH_VALUE:
-                        mUpdateType = UpdateType.UNSUPPORTED_OS_VERSION;
-                        // Even in the forced case, ensure that it is possible to read and write
-                        // the pref, since the FORCE_SHOW_UPDATE_MENU_BADGE might not be set.
-                        mLatestUnsupportedVersionPreference =
-                                ChromePreferenceManager.getInstance().readString(
-                                        ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, null);
-                        break;
-                    default:
-                        // If the forced parameter or variation is set, but invalid, we should still
-                        // early out of the calculation. This enables testing of the no-op state.
-                        mUpdateType = UpdateType.UNKNOWN;
-                        break;
-                }
-                return true;
-            }
-
-            @Override
-            protected void onPostExecute(Void result) {
-                if (activity.isActivityDestroyed()) return;
-                activity.onCheckForUpdate();
-                recordUpdateHistogram();
-            }
-        }
-                .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+    /** @return {@link MenuUiState} representing the current update state for the menu. */
+    public @NonNull MenuUiState getUiState() {
+        return mMenuUiState;
     }
 
     /**
@@ -323,100 +176,40 @@
      * Should be called from ChromeActivity#onStart().
      */
     public void onStart() {
-        if (mAlreadyCheckedForUpdates) {
-            recordUpdateHistogram();
-        }
-    }
-
-    /**
-     * @param context The current context.
-     * @return Whether the update menu item should be shown.
-     */
-    public boolean shouldShowMenuItem(Context context) {
-        switch (getUpdateType()) {
-            case UpdateType.UPDATE_AVAILABLE:
-                return isGooglePlayStoreAvailable(context);
-            case UpdateType.UNSUPPORTED_OS_VERSION:
-                return true;
-            case UpdateType.NONE:
-            // Intentional fall through.
-            case UpdateType.UNKNOWN:
-            // Intentional fall through.
-            default:
-                return false;
-        }
-    }
-
-    private static boolean isGooglePlayStoreAvailable(Context context) {
-        try {
-            context.getPackageManager().getPackageInfo(
-                    GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
-        } catch (PackageManager.NameNotFoundException e) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @param context The current context.
-     * @return Whether the update badge should be shown in the toolbar.
-     */
-    public boolean shouldShowToolbarBadge(Context context) {
-        if (getBooleanParam(ChromeSwitches.FORCE_SHOW_UPDATE_MENU_BADGE)) return true;
-
-        switch (getUpdateType()) {
-            case UpdateType.UPDATE_AVAILABLE:
-                if (!isGooglePlayStoreAvailable(context)) return false;
-                // The badge is hidden if the update menu item has been clicked until there is an
-                // even newer version of Chrome available.
-                String latestVersionWhenClicked =
-                        PrefServiceBridge.getInstance().getLatestVersionWhenClickedUpdateMenuItem();
-                return !TextUtils.equals(latestVersionWhenClicked, mLatestVersion);
-            case UpdateType.UNSUPPORTED_OS_VERSION:
-                // We should show the badge if the user has not opened the menu.
-                if (mLatestUnsupportedVersionPreference == null) return true;
-
-                // In case the user has been upgraded since last time they tapped the toolbar badge
-                // we should show the badge again.
-                String currentlyUsedVersion = BuildInfo.getInstance().versionName;
-                return !TextUtils.equals(mLatestUnsupportedVersionPreference, currentlyUsedVersion);
-            case UpdateType.NONE: // Intentional fall through.
-            case UpdateType.UNKNOWN: // Intentional fall through.
-            default:
-                return false;
-        }
+        if (mStatus != null) recordUpdateHistogram();
     }
 
     /**
      * Handles a click on the update menu item.
-     * @param activity The current {@link ChromeActivity}.
+     * @param activity The current {@code Activity}.
      */
-    public void onMenuItemClicked(ChromeActivity activity) {
-        if (mUpdateType != UpdateType.UPDATE_AVAILABLE) return;
-        if (mUpdateUrl == null) return;
+    public void onMenuItemClicked(Activity activity) {
+        if (mStatus == null) return;
+        if (mStatus.updateState != UpdateState.UPDATE_AVAILABLE) return;
+        if (TextUtils.isEmpty(mStatus.updateUrl)) return;
 
         // If the update menu item is showing because it was forced on through about://flags
         // then mLatestVersion may be null.
-        if (mLatestVersion != null) {
+        if (mStatus.latestVersion != null) {
             PrefServiceBridge.getInstance().setLatestVersionWhenClickedUpdateMenuItem(
-                    mLatestVersion);
+                    mStatus.latestVersion);
         }
 
         // Fire an intent to open the URL.
         try {
-            Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUpdateUrl));
+            Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(mStatus.updateUrl));
             activity.startActivity(launchIntent);
             recordItemClickedHistogram(ITEM_CLICKED_INTENT_LAUNCHED);
             PrefServiceBridge.getInstance().setClickedUpdateMenuItem(true);
         } catch (ActivityNotFoundException e) {
-            Log.e(TAG, "Failed to launch Activity for: %s", mUpdateUrl);
+            Log.e(TAG, "Failed to launch Activity for: %s", mStatus.updateUrl);
             recordItemClickedHistogram(ITEM_CLICKED_INTENT_FAILED);
         }
+
+        handleStateChanged();
     }
 
-    /**
-     * Should be called before the AppMenu is dismissed if the update menu item was clicked.
-     */
+    /** Should be called before the AppMenu is dismissed if the update menu item was clicked. */
     public void setMenuItemClicked() {
         mMenuItemClicked = true;
     }
@@ -426,9 +219,7 @@
      * item was not clicked. If it was clicked, logging is delayed until #onMenuItemClicked().
      */
     public void onMenuDismissed() {
-        if (!mMenuItemClicked) {
-            recordItemClickedHistogram(ITEM_NOT_CLICKED);
-        }
+        if (!mMenuItemClicked) recordItemClickedHistogram(ITEM_NOT_CLICKED);
         mMenuItemClicked = false;
     }
 
@@ -436,113 +227,83 @@
      * Called when the user clicks the app menu button while the unsupported OS badge is showing.
      */
     public void onMenuButtonClicked() {
-        if (mUpdateType != UpdateType.UNSUPPORTED_OS_VERSION) return;
+        if (mStatus == null) return;
+        if (mStatus.updateState != UpdateState.UNSUPPORTED_OS_VERSION) return;
 
-        // If we have already stored the current version to a preference, no need to store it again,
-        // unless their Chrome version has changed.
-        String currentlyUsedVersion = BuildInfo.getInstance().versionName;
-        if (mLatestUnsupportedVersionPreference != null
-                && mLatestUnsupportedVersionPreference.equals(currentlyUsedVersion)) {
-            return;
+        UpdateStatusProvider.getInstance().updateLatestUnsupportedVersion();
+    }
+
+    private void handleStateChanged() {
+        assert mStatus != null;
+
+        boolean showBadge = UpdateConfigs.getAlwaysShowMenuBadge();
+
+        // Note that is not safe for theming, but for string access it should be ok.
+        Resources resources = ContextUtils.getApplicationContext().getResources();
+
+        mMenuUiState = new MenuUiState();
+        switch (mStatus.updateState) {
+            case UpdateState.UPDATE_AVAILABLE:
+                // The badge is hidden if the update menu item has been clicked until there is an
+                // even newer version of Chrome available.
+                showBadge |= !TextUtils.equals(
+                        PrefServiceBridge.getInstance().getLatestVersionWhenClickedUpdateMenuItem(),
+                        mStatus.latestUnsupportedVersion);
+
+                if (showBadge) {
+                    mMenuUiState.buttonState = new MenuButtonState();
+                    mMenuUiState.buttonState.menuContentDescription =
+                            R.string.accessibility_toolbar_btn_menu_update;
+                    mMenuUiState.buttonState.darkBadgeIcon = R.drawable.badge_update_dark;
+                    mMenuUiState.buttonState.lightBadgeIcon = R.drawable.badge_update_light;
+                }
+
+                mMenuUiState.itemState = new MenuItemState();
+                mMenuUiState.itemState.title = R.string.menu_update;
+                mMenuUiState.itemState.titleColor = R.color.error_text_color;
+                mMenuUiState.itemState.icon = R.drawable.badge_update_dark;
+                mMenuUiState.itemState.enabled = true;
+                mMenuUiState.itemState.summary = UpdateConfigs.getCustomSummary();
+                if (TextUtils.isEmpty(mMenuUiState.itemState.summary)) {
+                    mMenuUiState.itemState.summary =
+                            resources.getString(R.string.menu_update_summary_default);
+                }
+                break;
+            case UpdateState.UNSUPPORTED_OS_VERSION:
+                // We should show the badge if the user has not opened the menu.
+                showBadge |= mStatus.latestUnsupportedVersion == null;
+
+                // In case the user has been upgraded since last time they tapped the toolbar badge
+                // we should show the badge again.
+                showBadge |= !TextUtils.equals(
+                        BuildInfo.getInstance().versionName, mStatus.latestUnsupportedVersion);
+
+                if (showBadge) {
+                    mMenuUiState.buttonState = new MenuButtonState();
+                    mMenuUiState.buttonState.menuContentDescription =
+                            R.string.accessibility_toolbar_btn_menu_os_version_unsupported;
+                    mMenuUiState.buttonState.darkBadgeIcon =
+                            R.drawable.ic_error_grey800_24dp_filled;
+                    mMenuUiState.buttonState.lightBadgeIcon = R.drawable.ic_error_white_24dp_filled;
+                }
+
+                mMenuUiState.itemState = new MenuItemState();
+                mMenuUiState.itemState.title = R.string.menu_update_unsupported;
+                mMenuUiState.itemState.titleColor = R.color.default_text_color;
+                mMenuUiState.itemState.summary =
+                        resources.getString(R.string.menu_update_unsupported_summary_default);
+                mMenuUiState.itemState.icon = R.drawable.ic_error_grey800_24dp_filled;
+                mMenuUiState.itemState.enabled = false;
+                break;
+            case UpdateState.NONE:
+            // Intentional fall through.
+            default:
+                break;
         }
-
-        ChromePreferenceManager.getInstance().writeString(
-                ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, currentlyUsedVersion);
-        mLatestUnsupportedVersionPreference = currentlyUsedVersion;
     }
 
-    /**
-     * Creates an {@link AnimatorSet} for showing the update badge that is displayed on top
-     * of the app menu button.
-     *
-     * @param menuButton The {@link View} containing the app menu button.
-     * @param menuBadge The {@link View} containing the update badge.
-     * @return An {@link AnimatorSet} to run when showing the update badge.
-     */
-    public static AnimatorSet createShowUpdateBadgeAnimation(final View menuButton,
-            final View menuBadge) {
-        // Create badge ObjectAnimators.
-        ObjectAnimator badgeFadeAnimator = ObjectAnimator.ofFloat(menuBadge, View.ALPHA, 1.f);
-        badgeFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE);
-
-        int pixelTranslation = menuBadge.getResources().getDimensionPixelSize(
-                R.dimen.menu_badge_translation_y_distance);
-        ObjectAnimator badgeTranslateYAnimator = ObjectAnimator.ofFloat(menuBadge,
-                View.TRANSLATION_Y, pixelTranslation, 0.f);
-        badgeTranslateYAnimator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE);
-
-        // Create menu button ObjectAnimator.
-        ObjectAnimator menuButtonFadeAnimator = ObjectAnimator.ofFloat(menuButton, View.ALPHA, 0.f);
-        menuButtonFadeAnimator.setInterpolator(new LinearInterpolator());
-
-        // Create AnimatorSet and listeners.
-        AnimatorSet set = new AnimatorSet();
-        set.playTogether(badgeFadeAnimator, badgeTranslateYAnimator, menuButtonFadeAnimator);
-        set.setDuration(350);
-        set.addListener(new AnimatorListenerAdapter() {
-            @Override
-            public void onAnimationEnd(Animator animation) {
-                // Make sure the menu button is visible again.
-                menuButton.setAlpha(1.f);
-            }
-
-            @Override
-            public void onAnimationCancel(Animator animation) {
-                // Jump to the end state if the animation is canceled.
-                menuBadge.setAlpha(1.f);
-                menuBadge.setTranslationY(0.f);
-                menuButton.setAlpha(1.f);
-            }
-        });
-
-        return set;
-    }
-
-    /**
-     * Creates an {@link AnimatorSet} for hiding the update badge that is displayed on top
-     * of the app menu button.
-     *
-     * @param menuButton The {@link View} containing the app menu button.
-     * @param menuBadge The {@link View} containing the update badge.
-     * @return An {@link AnimatorSet} to run when hiding the update badge.
-     */
-    public static AnimatorSet createHideUpdateBadgeAnimation(final View menuButton,
-            final View menuBadge) {
-        // Create badge ObjectAnimator.
-        ObjectAnimator badgeFadeAnimator = ObjectAnimator.ofFloat(menuBadge, View.ALPHA, 0.f);
-        badgeFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE);
-
-        // Create menu button ObjectAnimator.
-        ObjectAnimator menuButtonFadeAnimator = ObjectAnimator.ofFloat(menuButton, View.ALPHA, 1.f);
-        menuButtonFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE);
-
-        // Create AnimatorSet and listeners.
-        AnimatorSet set = new AnimatorSet();
-        set.playTogether(badgeFadeAnimator, menuButtonFadeAnimator);
-        set.setDuration(200);
-        set.addListener(new AnimatorListenerAdapter() {
-            @Override
-            public void onAnimationEnd(Animator animation) {
-                menuBadge.setVisibility(View.GONE);
-            }
-
-            @Override
-            public void onAnimationCancel(Animator animation) {
-                // Jump to the end state if the animation is canceled.
-                menuButton.setAlpha(1.f);
-                menuBadge.setVisibility(View.GONE);
-            }
-        });
-
-        return set;
-    }
-
-    /**
-     * @return The current {@link UpdateType}. Will be {@link UpdateType#UNKNOWN} until it has been
-     *         fetched on a background thread.
-     */
-    public @UpdateType int getUpdateType() {
-        return mUpdateType;
+    private void pingObservers() {
+        for (Runnable observer : mObservers) observer.run();
     }
 
     private void recordItemClickedHistogram(int action) {
@@ -551,97 +312,16 @@
     }
 
     private void recordUpdateHistogram() {
+        assert mStatus != null;
+
         if (PrefServiceBridge.getInstance().getClickedUpdateMenuItem()) {
             RecordHistogram.recordEnumeratedHistogram(
                     "GoogleUpdate.MenuItem.ActionTakenAfterItemClicked",
-                    mUpdateType == UpdateType.UPDATE_AVAILABLE ? NOT_UPDATED : UPDATED,
+                    mStatus.updateState == UpdateState.UPDATE_AVAILABLE ? NOT_UPDATED : UPDATED,
                     UPDATED_BOUNDARY);
             PrefServiceBridge.getInstance().setClickedUpdateMenuItem(false);
         }
     }
 
-    /**
-     * Gets a boolean VariationsAssociatedData parameter, assuming the <paramName>="true" format.
-     * Also checks for a command-line switch with the same name, for easy local testing.
-     * @param paramName The name of the parameter (or command-line switch) to get a value for.
-     * @return Whether the param is defined with a value "true", if there's a command-line
-     *         flag present with any value.
-     */
-    private static boolean getBooleanParam(String paramName) {
-        if (CommandLine.getInstance().hasSwitch(paramName)) {
-            return true;
-        }
-        return TextUtils.equals(ENABLED_VALUE,
-                VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
-    }
 
-    /**
-     * Gets a String VariationsAssociatedData parameter. Also checks for a command-line switch with
-     * the same name, for easy local testing.
-     * @param paramName The name of the parameter (or command-line switch) to get a value for.
-     * @return The command-line flag value if present, or the param is value if present.
-     */
-    @Nullable
-    private static String getStringParamValue(String paramName) {
-        String value = CommandLine.getInstance().getSwitchValue(paramName);
-        if (TextUtils.isEmpty(value)) {
-            value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
-        }
-        return value;
-    }
-
-    /**
-     * Returns an integer value for a Finch parameter, or the default value if no parameter exists
-     * in the current configuration.  Also checks for a command-line switch with the same name.
-     * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
-     * @param defaultValue The default value to return when there's no param or switch.
-     * @return An integer value -- either the param or the default.
-     */
-    private static int getIntParamValueOrDefault(String paramName, int defaultValue) {
-        String value = CommandLine.getInstance().getSwitchValue(paramName);
-        if (TextUtils.isEmpty(value)) {
-            value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName);
-        }
-        if (TextUtils.isEmpty(value)) return defaultValue;
-
-        try {
-            return Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            return defaultValue;
-        }
-    }
-
-    private boolean checkForSufficientStorage() {
-        assert !ThreadUtils.runningOnUiThread();
-
-        File path = Environment.getDataDirectory();
-        StatFs statFs = new StatFs(path.getAbsolutePath());
-        long size;
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
-            size = getSize(statFs);
-        } else {
-            size = getSizeUpdatedApi(statFs);
-        }
-        RecordHistogram.recordLinearCountHistogram(
-                "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", (int) size, 1, 200, 100);
-        RecordHistogram.recordLinearCountHistogram(
-                "GoogleUpdate.InfoBar.DeviceFreeSpace", (int) size, 1, 1000, 50);
-
-        int minRequiredStorage = getIntParamValueOrDefault(MIN_REQUIRED_STORAGE_MB, -1);
-        if (minRequiredStorage == -1) return true;
-
-        return size >= minRequiredStorage;
-    }
-
-    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
-    private static long getSizeUpdatedApi(StatFs statFs) {
-        return ConversionUtils.bytesToMegabytes(statFs.getAvailableBytes());
-    }
-
-    @SuppressWarnings("deprecation")
-    private static long getSize(StatFs statFs) {
-        int blockSize = statFs.getBlockSize();
-        int availableBlocks = statFs.getAvailableBlocks();
-        return ConversionUtils.bytesToMegabytes(blockSize * availableBlocks);
-    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
new file mode 100644
index 0000000..b6e9186
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
@@ -0,0 +1,276 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.omaha;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.StatFs;
+import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
+import android.text.TextUtils;
+
+import com.google.android.gms.common.GooglePlayServicesUtil;
+
+import org.chromium.base.BuildInfo;
+import org.chromium.base.Callback;
+import org.chromium.base.ContextUtils;
+import org.chromium.base.ObserverList;
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.base.task.AsyncTask;
+import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
+import org.chromium.chrome.browser.util.ConversionUtils;
+
+import java.io.File;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Provides the current update state for Chrome.  This update state is asynchronously determined and
+ * can change as Chrome runs.
+ *
+ * For manually testing this functionality, see {@link UpdateConfigs}.
+ */
+class UpdateStatusProvider {
+    /** Possible update states. */
+    @IntDef({UpdateState.NONE, UpdateState.UPDATE_AVAILABLE, UpdateState.UNSUPPORTED_OS_VERSION})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface UpdateState {
+        int NONE = 1;
+        int UPDATE_AVAILABLE = 2;
+        int UNSUPPORTED_OS_VERSION = 3;
+    }
+
+    /** A set of properties that represent the current update state for Chrome. */
+    public static final class UpdateStatus {
+        /**
+         * The current state of whether an update is available or whether it ever will be
+         * (unsupported OS).
+         */
+        public @UpdateState int updateState;
+
+        /** URL to direct the user to when Omaha detects a newer version available. */
+        public String updateUrl;
+
+        /**
+         * The latest Chrome version available if OmahaClient.isNewerVersionAvailable() returns
+         * true.
+         */
+        public String latestVersion;
+
+        /**
+         * If the current OS version is unsupported, and we show the menu badge, and then the user
+         * clicks the badge and sees the unsupported message, we store the current version to a
+         * preference and cache it here. This preference is read on startup to ensure we only show
+         * the unsupported message once per version.
+         */
+        public String latestUnsupportedVersion;
+    }
+
+    private final Handler mHandler = new Handler(Looper.getMainLooper());
+    private final ObserverList<Callback<UpdateStatus>> mObservers = new ObserverList<>();
+
+    private UpdateQuery mQuery;
+    private UpdateStatus mStatus;
+
+    /** @return Returns a singleton of {@link UpdateStatusProvider}. */
+    public static UpdateStatusProvider getInstance() {
+        return LazyHolder.INSTANCE;
+    }
+
+    /**
+     * Adds {@code observer} to notify about update state changes.  It is safe to call this multiple
+     * times with the same {@code observer}.  This method will always notify {@code observer} of the
+     * current status.  If that status has not been calculated yet this method call will trigger the
+     * async work to calculate it.
+     * @param observer The observer to notify about update state changes.
+     * @return {@code true} if {@code observer} is newly registered.  {@code false} if it was
+     *         already registered.
+     */
+    public boolean addObserver(Callback<UpdateStatus> observer) {
+        if (mObservers.hasObserver(observer)) return false;
+
+        mObservers.addObserver(observer);
+
+        if (mStatus != null) {
+            mHandler.post(() -> observer.onResult(mStatus));
+        } else if (mQuery == null) {
+            mQuery = new UpdateQuery(status -> {
+                mStatus = status;
+                pingObservers();
+            });
+
+            mQuery.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+        }
+
+        return true;
+    }
+
+    /**
+     * No longer notifies {@code observer} about update state changes.  It is safe to call this
+     * multiple times with the same {@code observer}.
+     * @param observer To no longer notify about update state changes.
+     */
+    public void removeObserver(Callback<UpdateStatus> observer) {
+        if (!mObservers.hasObserver(observer)) return;
+        mObservers.removeObserver(observer);
+    }
+
+    /**
+     * Notes that the user is aware that this version of Chrome is no longer supported and
+     * potentially updates the update state accordingly.
+     */
+    public void updateLatestUnsupportedVersion() {
+        if (mStatus == null) return;
+
+        // If we have already stored the current version to a preference, no need to store it again,
+        // unless their Chrome version has changed.
+        String currentlyUsedVersion = BuildInfo.getInstance().versionName;
+        if (mStatus.latestUnsupportedVersion != null
+                && mStatus.latestUnsupportedVersion.equals(currentlyUsedVersion)) {
+            return;
+        }
+
+        ChromePreferenceManager.getInstance().writeString(
+                ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, currentlyUsedVersion);
+        mStatus.latestUnsupportedVersion = currentlyUsedVersion;
+        pingObservers();
+    }
+
+    private UpdateStatusProvider() {}
+
+    private void pingObservers() {
+        for (Callback<UpdateStatus> observer : mObservers) observer.onResult(mStatus);
+    }
+
+    private static final class LazyHolder {
+        private static final UpdateStatusProvider INSTANCE = new UpdateStatusProvider();
+    }
+
+    private static final class UpdateQuery extends AsyncTask<UpdateStatus> {
+        private final Context mContext = ContextUtils.getApplicationContext();
+        private final Callback<UpdateStatus> mCallback;
+
+        public UpdateQuery(@NonNull Callback<UpdateStatus> resultReceiver) {
+            mCallback = resultReceiver;
+        }
+
+        @Override
+        protected UpdateStatus doInBackground() {
+            UpdateStatus testStatus = getTestStatus();
+            if (testStatus != null) return testStatus;
+            return getRealStatus(mContext);
+        }
+
+        @Override
+        protected void onPostExecute(UpdateStatus result) {
+            super.onPostExecute(result);
+
+            mCallback.onResult(result);
+        }
+
+        private UpdateStatus getTestStatus() {
+            @UpdateState
+            Integer forcedUpdateState = UpdateConfigs.getMockUpdateState();
+            if (forcedUpdateState == null) return null;
+
+            UpdateStatus status = new UpdateStatus();
+
+            switch (forcedUpdateState) {
+                case UpdateState.NONE:
+                    status.updateState = UpdateState.NONE;
+                    break;
+                case UpdateState.UPDATE_AVAILABLE:
+                    status.updateState = UpdateState.UPDATE_AVAILABLE;
+                    String updateUrl = UpdateConfigs.getMockMarketUrl();
+                    if (!TextUtils.isEmpty(updateUrl)) status.updateUrl = updateUrl;
+                    break;
+                case UpdateState.UNSUPPORTED_OS_VERSION:
+                    status.updateState = UpdateState.UNSUPPORTED_OS_VERSION;
+                    status.latestUnsupportedVersion =
+                            ChromePreferenceManager.getInstance().readString(
+                                    ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, null);
+                    break;
+            }
+
+            return status;
+        }
+
+        private UpdateStatus getRealStatus(Context context) {
+            UpdateStatus status = new UpdateStatus();
+
+            if (VersionNumberGetter.isNewerVersionAvailable(context)) {
+                status.updateUrl = MarketURLGetter.getMarketUrl(context);
+                status.latestVersion =
+                        VersionNumberGetter.getInstance().getLatestKnownVersion(context);
+
+                boolean allowedToUpdate =
+                        checkForSufficientStorage() && isGooglePlayStoreAvailable(context);
+                status.updateState =
+                        allowedToUpdate ? UpdateState.UPDATE_AVAILABLE : UpdateState.NONE;
+
+                ChromePreferenceManager.getInstance().removeKey(
+                        ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION);
+            } else if (!VersionNumberGetter.isCurrentOsVersionSupported()) {
+                status.updateState = UpdateState.UNSUPPORTED_OS_VERSION;
+                status.latestUnsupportedVersion = ChromePreferenceManager.getInstance().readString(
+                        ChromePreferenceManager.LATEST_UNSUPPORTED_VERSION, null);
+            } else {
+                status.updateState = UpdateState.NONE;
+            }
+
+            return status;
+        }
+
+        private boolean checkForSufficientStorage() {
+            assert !ThreadUtils.runningOnUiThread();
+
+            File path = Environment.getDataDirectory();
+            StatFs statFs = new StatFs(path.getAbsolutePath());
+            long size;
+            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
+                size = getSize(statFs);
+            } else {
+                size = getSizeUpdatedApi(statFs);
+            }
+            RecordHistogram.recordLinearCountHistogram(
+                    "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", (int) size, 1, 200, 100);
+            RecordHistogram.recordLinearCountHistogram(
+                    "GoogleUpdate.InfoBar.DeviceFreeSpace", (int) size, 1, 1000, 50);
+
+            int minRequiredStorage = UpdateConfigs.getMinRequiredStorage();
+            if (minRequiredStorage == -1) return true;
+
+            return size >= minRequiredStorage;
+        }
+
+        private boolean isGooglePlayStoreAvailable(Context context) {
+            try {
+                context.getPackageManager().getPackageInfo(
+                        GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
+            } catch (PackageManager.NameNotFoundException e) {
+                return false;
+            }
+            return true;
+        }
+
+        @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
+        private long getSizeUpdatedApi(StatFs statFs) {
+            return ConversionUtils.bytesToMegabytes(statFs.getAvailableBytes());
+        }
+
+        @SuppressWarnings("deprecation")
+        private long getSize(StatFs statFs) {
+            int blockSize = statFs.getBlockSize();
+            int availableBlocks = statFs.getAvailableBlocks();
+            return ConversionUtils.bytesToMegabytes(blockSize * availableBlocks);
+        }
+    }
+}
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
index 9cfedb5..3dd4409 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -407,8 +407,17 @@
             // be recalculated.
             if (didFocusUrlFromFakebox() && !inProgress && mUrlHasFocus
                     && AccessibilityUtil.isAccessibilityEnabled()) {
+                String existingText = mUrlCoordinator.getTextWithoutAutocomplete();
                 mUrlBar.clearFocus();
                 mUrlBar.requestFocus();
+                // Existing text (e.g. if the user pasted via the fakebox) from the fake box
+                // should be restored after toggling the focus.
+                if (!TextUtils.isEmpty(existingText)) {
+                    mUrlCoordinator.setUrlBarData(UrlBarData.forNonUrlText(existingText),
+                            UrlBar.ScrollType.NO_SCROLL,
+                            UrlBarCoordinator.SelectionState.SELECT_END);
+                    mAutocompleteCoordinator.onTextChangedForAutocomplete();
+                }
             }
 
             for (UrlFocusChangeListener listener : mUrlFocusChangeListeners) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java
index 29629da9..4fa3ac58 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java
@@ -77,6 +77,9 @@
     /** The name of the experiment variation that shows the copy icon. */
     private static final String COPY_ICON_VARIATION_NAME = "copy_icon";
 
+    /** The name of the experiment variation that shows both the copy and share icon. */
+    private static final String COPY_SHARE_ICON_VARIATION_NAME = "copy_share_icon";
+
     /** The delegate for accessing the location bar for observation and modification. */
     private final LocationBarDelegate mLocationBarDelegate;
 
@@ -161,6 +164,9 @@
         if (TextUtils.equals(COPY_ICON_VARIATION_NAME, variation)) {
             model.set(EditUrlSuggestionProperties.COPY_ICON_VISIBLE, true);
             model.set(EditUrlSuggestionProperties.SHARE_ICON_VISIBLE, false);
+        } else if (TextUtils.equals(COPY_SHARE_ICON_VARIATION_NAME, variation)) {
+            model.set(EditUrlSuggestionProperties.COPY_ICON_VISIBLE, true);
+            model.set(EditUrlSuggestionProperties.SHARE_ICON_VISIBLE, true);
         } else {
             model.set(EditUrlSuggestionProperties.COPY_ICON_VISIBLE, false);
             model.set(EditUrlSuggestionProperties.SHARE_ICON_VISIBLE, true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java
index 9e14b33..64fc5e7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java
@@ -6,7 +6,7 @@
 
 import android.content.Context;
 import android.content.res.ColorStateList;
-import android.graphics.drawable.Drawable;
+import android.support.annotation.DrawableRes;
 import android.util.AttributeSet;
 import android.view.View;
 import android.widget.FrameLayout;
@@ -18,6 +18,7 @@
 import org.chromium.chrome.browser.ThemeColorProvider;
 import org.chromium.chrome.browser.ThemeColorProvider.TintObserver;
 import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
+import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuButtonState;
 
 /**
  * The overflow menu button.
@@ -69,23 +70,13 @@
      * TODO(crbug.com/865801): Clean this up when MenuButton and UpdateMenuItemHelper is MVCed.
      */
     public void setUpdateBadgeVisibilityIfValidState(boolean visible) {
-        switch (UpdateMenuItemHelper.getInstance().getUpdateType()) {
-            case UpdateMenuItemHelper.UpdateType.UPDATE_AVAILABLE:
-            // Intentional fall through.
-            case UpdateMenuItemHelper.UpdateType.UNSUPPORTED_OS_VERSION:
-                mUpdateBadgeView.setVisibility(visible ? View.VISIBLE : View.GONE);
-                updateImageResources();
-                updateContentDescription(visible);
-                break;
-            case UpdateMenuItemHelper.UpdateType.NONE:
-            // Intentional fall through.
-            case UpdateMenuItemHelper.UpdateType.UNKNOWN:
-            // Intentional fall through.
-            default:
-                mUpdateBadgeView.setVisibility(View.GONE);
-                updateContentDescription(false);
-                break;
-        }
+        MenuButtonState buttonState = UpdateMenuItemHelper.getInstance().getUiState().buttonState;
+
+        visible &= buttonState != null;
+
+        mUpdateBadgeView.setVisibility(visible ? View.VISIBLE : View.GONE);
+        if (visible) updateImageResources();
+        updateContentDescription(visible);
     }
 
     /**
@@ -98,16 +89,12 @@
     }
 
     public void updateImageResources() {
-        Drawable drawable;
-        if (mUseLightDrawables) {
-            drawable = UpdateMenuItemHelper.getInstance().getLightBadgeDrawable(
-                    mUpdateBadgeView.getResources());
-        } else {
-            drawable = UpdateMenuItemHelper.getInstance().getDarkBadgeDrawable(
-                    mUpdateBadgeView.getResources());
-        }
-        if (drawable == null) return;
-        mUpdateBadgeView.setImageDrawable(drawable);
+        MenuButtonState buttonState = UpdateMenuItemHelper.getInstance().getUiState().buttonState;
+        if (buttonState == null) return;
+        @DrawableRes
+        int drawable = mUseLightDrawables ? buttonState.lightBadgeIcon : buttonState.darkBadgeIcon;
+        mUpdateBadgeView.setImageDrawable(
+                ApiCompatibilityUtils.getDrawable(getResources(), drawable));
     }
 
     /**
@@ -123,22 +110,11 @@
      */
     public void updateContentDescription(boolean isUpdateBadgeVisible) {
         if (isUpdateBadgeVisible) {
-            switch (UpdateMenuItemHelper.getInstance().getUpdateType()) {
-                case UpdateMenuItemHelper.UpdateType.UPDATE_AVAILABLE:
-                    mMenuImageButton.setContentDescription(getResources().getString(
-                            R.string.accessibility_toolbar_btn_menu_update));
-                    break;
-                case UpdateMenuItemHelper.UpdateType.UNSUPPORTED_OS_VERSION:
-                    mMenuImageButton.setContentDescription(getResources().getString(
-                            R.string.accessibility_toolbar_btn_menu_os_version_unsupported));
-                    break;
-                case UpdateMenuItemHelper.UpdateType.NONE:
-                // Intentional fall through.
-                case UpdateMenuItemHelper.UpdateType.UNKNOWN:
-                // Intentional fall through.
-                default:
-                    break;
-            }
+            MenuButtonState buttonState =
+                    UpdateMenuItemHelper.getInstance().getUiState().buttonState;
+            assert buttonState != null : "No button state when trying to show the badge.";
+            mMenuImageButton.setContentDescription(
+                    getResources().getString(buttonState.menuContentDescription));
         } else {
             mMenuImageButton.setContentDescription(
                     getResources().getString(R.string.accessibility_toolbar_btn_menu));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
index fc38291..b1fb2ce5c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
@@ -7,6 +7,7 @@
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.graphics.Canvas;
@@ -24,6 +25,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.animation.LinearInterpolator;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
 import android.widget.ImageView;
@@ -36,7 +38,6 @@
 import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost;
 import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate;
 import org.chromium.chrome.browser.ntp.NewTabPage;
-import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
 import org.chromium.chrome.browser.omnibox.LocationBar;
 import org.chromium.chrome.browser.omnibox.UrlBarData;
 import org.chromium.chrome.browser.profiles.Profile;
@@ -51,6 +52,7 @@
 import org.chromium.chrome.browser.widget.ToolbarProgressBar;
 import org.chromium.components.security_state.ConnectionSecurityLevel;
 import org.chromium.ui.UiUtils;
+import org.chromium.ui.interpolators.BakedBezierInterpolator;
 
 /**
  * Layout class that contains the base shared logic for manipulating the toolbar component. For
@@ -791,8 +793,7 @@
         // Set initial states.
         mMenuButton.setAlpha(0.f);
 
-        mMenuBadgeAnimatorSet =
-                UpdateMenuItemHelper.createHideUpdateBadgeAnimation(mMenuButton, mMenuBadge);
+        mMenuBadgeAnimatorSet = createHideUpdateBadgeAnimation(mMenuButton, mMenuBadge);
 
         mMenuBadgeAnimatorSet.addListener(new AnimatorListenerAdapter() {
             @Override
@@ -852,8 +853,7 @@
         mMenuBadge.setAlpha(0.f);
         mMenuBadge.setVisibility(View.VISIBLE);
 
-        mMenuBadgeAnimatorSet =
-                UpdateMenuItemHelper.createShowUpdateBadgeAnimation(mMenuButton, mMenuBadge);
+        mMenuBadgeAnimatorSet = createShowUpdateBadgeAnimation(mMenuButton, mMenuBadge);
 
         mMenuBadgeAnimatorSet.addListener(new AnimatorListenerAdapter() {
             @Override
@@ -928,4 +928,90 @@
      * it.
      */
     void setTabModelSelector(TabModelSelector selector) {}
+
+    /**
+     * Creates an {@link AnimatorSet} for showing the update badge that is displayed on top
+     * of the app menu button.
+     *
+     * @param menuButton The {@link View} containing the app menu button.
+     * @param menuBadge The {@link View} containing the update badge.
+     * @return An {@link AnimatorSet} to run when showing the update badge.
+     */
+    private static AnimatorSet createShowUpdateBadgeAnimation(
+            final View menuButton, final View menuBadge) {
+        // Create badge ObjectAnimators.
+        ObjectAnimator badgeFadeAnimator = ObjectAnimator.ofFloat(menuBadge, View.ALPHA, 1.f);
+        badgeFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE);
+
+        int pixelTranslation = menuBadge.getResources().getDimensionPixelSize(
+                R.dimen.menu_badge_translation_y_distance);
+        ObjectAnimator badgeTranslateYAnimator =
+                ObjectAnimator.ofFloat(menuBadge, View.TRANSLATION_Y, pixelTranslation, 0.f);
+        badgeTranslateYAnimator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE);
+
+        // Create menu button ObjectAnimator.
+        ObjectAnimator menuButtonFadeAnimator = ObjectAnimator.ofFloat(menuButton, View.ALPHA, 0.f);
+        menuButtonFadeAnimator.setInterpolator(new LinearInterpolator());
+
+        // Create AnimatorSet and listeners.
+        AnimatorSet set = new AnimatorSet();
+        set.playTogether(badgeFadeAnimator, badgeTranslateYAnimator, menuButtonFadeAnimator);
+        set.setDuration(350);
+        set.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                // Make sure the menu button is visible again.
+                menuButton.setAlpha(1.f);
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                // Jump to the end state if the animation is canceled.
+                menuBadge.setAlpha(1.f);
+                menuBadge.setTranslationY(0.f);
+                menuButton.setAlpha(1.f);
+            }
+        });
+
+        return set;
+    }
+
+    /**
+     * Creates an {@link AnimatorSet} for hiding the update badge that is displayed on top
+     * of the app menu button.
+     *
+     * @param menuButton The {@link View} containing the app menu button.
+     * @param menuBadge The {@link View} containing the update badge.
+     * @return An {@link AnimatorSet} to run when hiding the update badge.
+     */
+    private static AnimatorSet createHideUpdateBadgeAnimation(
+            final View menuButton, final View menuBadge) {
+        // Create badge ObjectAnimator.
+        ObjectAnimator badgeFadeAnimator = ObjectAnimator.ofFloat(menuBadge, View.ALPHA, 0.f);
+        badgeFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE);
+
+        // Create menu button ObjectAnimator.
+        ObjectAnimator menuButtonFadeAnimator = ObjectAnimator.ofFloat(menuButton, View.ALPHA, 1.f);
+        menuButtonFadeAnimator.setInterpolator(BakedBezierInterpolator.FADE_IN_CURVE);
+
+        // Create AnimatorSet and listeners.
+        AnimatorSet set = new AnimatorSet();
+        set.playTogether(badgeFadeAnimator, menuButtonFadeAnimator);
+        set.setDuration(200);
+        set.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                menuBadge.setVisibility(View.GONE);
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                // Jump to the end state if the animation is canceled.
+                menuButton.setAlpha(1.f);
+                menuBadge.setVisibility(View.GONE);
+            }
+        });
+
+        return set;
+    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
index c5f5425ee..b3b3521 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
@@ -58,6 +58,7 @@
 import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
 import org.chromium.chrome.browser.ntp.NewTabPage;
 import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
+import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuButtonState;
 import org.chromium.chrome.browser.omnibox.LocationBar;
 import org.chromium.chrome.browser.omnibox.LocationBarPhone;
 import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
@@ -2685,11 +2686,13 @@
     }
 
     private void setTabSwitcherAnimationMenuBadgeDrawable() {
+        MenuButtonState buttonState = UpdateMenuItemHelper.getInstance().getUiState().buttonState;
+        if (buttonState == null) return;
+
         Drawable darkDrawable =
-                UpdateMenuItemHelper.getInstance().getDarkBadgeDrawable(this.getResources());
+                ApiCompatibilityUtils.getDrawable(getResources(), buttonState.darkBadgeIcon);
         Drawable lightDrawable =
-                UpdateMenuItemHelper.getInstance().getLightBadgeDrawable(this.getResources());
-        if (darkDrawable == null || lightDrawable == null) return;
+                ApiCompatibilityUtils.getDrawable(getResources(), buttonState.lightBadgeIcon);
 
         mTabSwitcherAnimationMenuBadgeDarkDrawable = darkDrawable;
         mTabSwitcherAnimationMenuBadgeDarkDrawable.mutate();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/NoTouchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java
similarity index 97%
rename from chrome/android/java/src/org/chromium/chrome/browser/NoTouchActivity.java
rename to chrome/android/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java
index bf8471f..08f7eebc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/NoTouchActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.chromium.chrome.browser;
+package org.chromium.chrome.browser.touchless;
 
 import android.content.Intent;
 import android.os.Bundle;
@@ -10,8 +10,10 @@
 import android.view.ViewGroup;
 
 import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.chrome.browser.IntentHandler;
 import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
 import org.chromium.chrome.browser.IntentHandler.TabOpenType;
+import org.chromium.chrome.browser.SingleTabActivity;
 import org.chromium.chrome.browser.compositor.layouts.LayoutManager;
 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
 import org.chromium.chrome.browser.tab.Tab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
index 41dcfd0f..c026a136 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
@@ -17,14 +17,20 @@
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.compat.ApiHelperForN;
 import org.chromium.base.library_loader.LibraryLoader;
+import org.chromium.base.metrics.CachedMetrics;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.ChromeActivity;
 import org.chromium.ui.widget.Toast;
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
 /**
  * Fallback {@link VrDelegate} implementation if the VR module is not available.
  */
 /* package */ class VrDelegateFallback extends VrDelegate {
+    /* package */ static final CachedMetrics
+            .BooleanHistogramSample ENTER_VR_BROWSER_WITHOUT_FEATURE_MODULE_METRIC =
+            new CachedMetrics.BooleanHistogramSample("VR.EnterVrBrowserWithoutFeatureModule");
     private static final String TAG = "VrDelegateFallback";
     private static final boolean DEBUG_LOGS = false;
     private static final String DEFAULT_VR_MODE_PACKAGE = "com.google.vr.vrcore";
@@ -143,10 +149,17 @@
             return;
         }
 
-        VrModuleProvider.installModule(this::onVrModuleInstallFinished);
+        // Flag whether enter VR flow is handled already.
+        AtomicBoolean enterVrHandled = new AtomicBoolean(false);
+
+        VrModuleProvider.installModule((success) -> {
+            if (enterVrHandled.getAndSet(true)) return;
+            onVrModuleInstallFinished(success);
+        });
 
         ThreadUtils.postOnUiThreadDelayed(() -> {
-            if (VrModuleProvider.isModuleInstalled()) return;
+            if (enterVrHandled.getAndSet(true)) return;
+            assert !VrModuleProvider.isModuleInstalled();
             onVrModuleInstallFailure(activity);
         }, WAITING_FOR_MODULE_TIMEOUT_MS);
     }
@@ -185,6 +198,8 @@
         }
         assert VrModuleProvider.isModuleInstalled();
 
+        ENTER_VR_BROWSER_WITHOUT_FEATURE_MODULE_METRIC.record(true);
+
         // We need native to enter VR. Enter VR flow will automatically continue once native is
         // loaded.
         if (!LibraryLoader.getInstance().isInitialized()) return;
@@ -198,6 +213,8 @@
     }
 
     private void onVrModuleInstallFailure(Activity activity) {
+        ENTER_VR_BROWSER_WITHOUT_FEATURE_MODULE_METRIC.record(false);
+
         // For SVR close Chrome. For standalones launch into 2D-in-VR (if that fails, close Chrome).
         if (bootsToVr()) {
             if (!setVrMode(activity, false)) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrIntentDelegateFallback.java b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrIntentDelegateFallback.java
index 993b09a4..5bf86ed 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrIntentDelegateFallback.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrIntentDelegateFallback.java
@@ -13,6 +13,7 @@
 public class VrIntentDelegateFallback extends VrIntentDelegate {
     @Override
     public Intent setupVrFreIntent(Context context, Intent freIntent) {
+        VrDelegateFallback.ENTER_VR_BROWSER_WITHOUT_FEATURE_MODULE_METRIC.record(false);
         if (VrModuleProvider.getDelegate().bootsToVr()) return freIntent;
         // Don't bother handling FRE without VR module on smartphone VR. Just request module and
         // return to caller.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.java
index 032010e..9b50236 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.java
@@ -14,17 +14,14 @@
 import org.chromium.base.ContextUtils;
 import org.chromium.base.SecureRandomInitializer;
 import org.chromium.base.metrics.CachedMetrics.TimesHistogramSample;
-import org.chromium.base.task.AsyncTask;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.security.GeneralSecurityException;
+import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.FutureTask;
 import java.util.concurrent.TimeUnit;
 
 import javax.crypto.KeyGenerator;
@@ -48,7 +45,6 @@
     private static final int MAC_KEY_BYTE_COUNT = 32;
     private static final Object sLock = new Object();
 
-    private static FutureTask<SecretKey> sMacKeyGenerator;
     private static SecretKey sKey;
 
     private static final TimesHistogramSample sWebappValidationTimes = new TimesHistogramSample(
@@ -180,20 +176,12 @@
                     return sKey;
                 }
 
-                triggerMacKeyGeneration();
-                try {
-                    sKey = sMacKeyGenerator.get();
-                    sMacKeyGenerator = null;
-                    if (!writeKeyToFile(context, MAC_KEY_BASENAME, sKey)) {
-                        sKey = null;
-                        return null;
-                    }
-                    return sKey;
-                } catch (InterruptedException e) {
-                    throw new RuntimeException(e);
-                } catch (ExecutionException e) {
-                    throw new RuntimeException(e);
+                sKey = generateMacKey();
+                if (!writeKeyToFile(context, MAC_KEY_BASENAME, sKey)) {
+                    sKey = null;
+                    return null;
                 }
+                return sKey;
             }
             return sKey;
         }
@@ -201,27 +189,22 @@
 
     /**
      * Generates the authentication encryption key in a background thread (if necessary).
+     * SecureRandomInitializer addresses the bug in SecureRandom that "TrulyRandom" warns about, so
+     * this lint warning can safely be suppressed.
      */
-    private static void triggerMacKeyGeneration() {
-        synchronized (sLock) {
-            if (sKey != null || sMacKeyGenerator != null) {
-                return;
-            }
-
-            sMacKeyGenerator = new FutureTask<SecretKey>(new Callable<SecretKey>() {
-                // SecureRandomInitializer addresses the bug in SecureRandom that "TrulyRandom"
-                // warns about, so this lint warning can safely be suppressed.
-                @SuppressLint("TrulyRandom")
-                @Override
-                public SecretKey call() throws Exception {
-                    KeyGenerator generator = KeyGenerator.getInstance(MAC_ALGORITHM_NAME);
-                    SecureRandom random = new SecureRandom();
-                    SecureRandomInitializer.initialize(random);
-                    generator.init(MAC_KEY_BYTE_COUNT * 8, random);
-                    return generator.generateKey();
-                }
-            });
-            AsyncTask.THREAD_POOL_EXECUTOR.execute(sMacKeyGenerator);
+    @SuppressLint("TrulyRandom")
+    private static SecretKey generateMacKey() {
+        if (sKey != null) {
+            return sKey;
+        }
+        try {
+            KeyGenerator generator = KeyGenerator.getInstance(MAC_ALGORITHM_NAME);
+            SecureRandom random = new SecureRandom();
+            SecureRandomInitializer.initialize(random);
+            generator.init(MAC_KEY_BYTE_COUNT * 8, random);
+            return generator.generateKey();
+        } catch (NoSuchAlgorithmException | IOException e) {
+            throw new RuntimeException(e);
         }
     }
 
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index d98a9c4..f042cad 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -59,7 +59,6 @@
   "java/src/org/chromium/chrome/browser/NavigationBarColorController.java",
   "java/src/org/chromium/chrome/browser/NavigationPopup.java",
   "java/src/org/chromium/chrome/browser/NearOomMonitor.java",
-  "java/src/org/chromium/chrome/browser/NoTouchActivity.java",
   "java/src/org/chromium/chrome/browser/PowerBroadcastReceiver.java",
   "java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java",
   "java/src/org/chromium/chrome/browser/ReturnToChromeExperimentsUtil.java",
@@ -1130,7 +1129,9 @@
   "java/src/org/chromium/chrome/browser/omaha/RequestGenerator.java",
   "java/src/org/chromium/chrome/browser/omaha/ResponseParser.java",
   "java/src/org/chromium/chrome/browser/omaha/StringSanitizer.java",
+  "java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java",
   "java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java",
+  "java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java",
   "java/src/org/chromium/chrome/browser/omaha/VersionNumber.java",
   "java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java",
   "java/src/org/chromium/chrome/browser/omaha/XMLParser.java",
@@ -1651,6 +1652,7 @@
   "java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java",
   "java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator.java",
   "java/src/org/chromium/chrome/browser/toolbar/top/ViewShiftingActionBarDelegate.java",
+  "java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java",
   "java/src/org/chromium/chrome/browser/tracing/TracingController.java",
   "java/src/org/chromium/chrome/browser/tracing/TracingNotificationManager.java",
   "java/src/org/chromium/chrome/browser/tracing/TracingNotificationService.java",
@@ -1891,7 +1893,6 @@
   "javatests/src/org/chromium/chrome/browser/NavigateTest.java",
   "javatests/src/org/chromium/chrome/browser/NavigationBarColorControllerTest.java",
   "javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java",
-  "javatests/src/org/chromium/chrome/browser/NoTouchActivityTest.java",
   "javatests/src/org/chromium/chrome/browser/OSKOverscrollTest.java",
   "javatests/src/org/chromium/chrome/browser/PopularUrlsTest.java",
   "javatests/src/org/chromium/chrome/browser/PopupTest.java",
@@ -2333,6 +2334,7 @@
   "javatests/src/org/chromium/chrome/browser/toolbar/LocationBarModelTest.java",
   "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java",
   "javatests/src/org/chromium/chrome/browser/toolbar/top/BrandColorTest.java",
+  "javatests/src/org/chromium/chrome/browser/touchless/NoTouchActivityTest.java",
   "javatests/src/org/chromium/chrome/browser/translate/TranslateCompactInfoBarTest.java",
   "javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java",
   "javatests/src/org/chromium/chrome/browser/util/ChromeFileProviderTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java
index 3456a6b..269df43 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/LocationBarLayoutTest.java
@@ -237,6 +237,7 @@
 
     @Test
     @SmallTest
+    @DisableFeatures(ChromeFeatureList.SEARCH_READY_OMNIBOX)
     public void testEditingTextShownOnFocus() {
         final UrlBar urlBar = getUrlBar();
         final LocationBarLayout locationBar = getLocationBar();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/NoTouchActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/touchless/NoTouchActivityTest.java
similarity index 95%
rename from chrome/android/javatests/src/org/chromium/chrome/browser/NoTouchActivityTest.java
rename to chrome/android/javatests/src/org/chromium/chrome/browser/touchless/NoTouchActivityTest.java
index 5db9014d..e295704 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/NoTouchActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/touchless/NoTouchActivityTest.java
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.chromium.chrome.browser;
+package org.chromium.chrome.browser.touchless;
 
 import android.support.test.InstrumentationRegistry;
 import android.support.test.filters.MediumTest;
@@ -16,6 +16,8 @@
 
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.chrome.browser.ChromeSwitches;
+import org.chromium.chrome.browser.MockSafeBrowsingApiHandler;
 import org.chromium.chrome.browser.ntp.NewTabPage;
 import org.chromium.chrome.test.ChromeActivityTestRule;
 import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn
index 2eafad2..5b97c2e 100644
--- a/chrome/app/BUILD.gn
+++ b/chrome/app/BUILD.gn
@@ -543,6 +543,7 @@
     "//chrome/common:buildflags",
     "//chrome/common:mojo_bindings",
     "//chrome/services/file_util:manifest",
+    "//chrome/services/noop:manifest",
     "//components/services/patch:manifest",
     "//components/services/unzip:manifest",
     "//components/spellcheck/common:interfaces",
diff --git a/chrome/app/DEPS b/chrome/app/DEPS
index 0dc3c8e2..fa1ab9a 100644
--- a/chrome/app/DEPS
+++ b/chrome/app/DEPS
@@ -85,6 +85,7 @@
     "+chrome/services/file_util",
     "+chrome/services/isolated_xr_device",
     "+chrome/services/media_gallery_util",
+    "+chrome/services/noop",
     "+chrome/services/printing",
     "+chrome/services/removable_storage_writer",
     "+chrome/services/util_win",
diff --git a/chrome/app/chrome_content_browser_overlay_manifest.cc b/chrome/app/chrome_content_browser_overlay_manifest.cc
index b2f39522..c0074cfd 100644
--- a/chrome/app/chrome_content_browser_overlay_manifest.cc
+++ b/chrome/app/chrome_content_browser_overlay_manifest.cc
@@ -154,6 +154,7 @@
             .RequireCapability("multidevice_setup", "multidevice_setup")
             .RequireCapability("nacl_broker", "browser")
             .RequireCapability("nacl_loader", "browser")
+            .RequireCapability("noop", "noop")
             .RequireCapability("patch", "patch_file")
             .RequireCapability("pdf_compositor", "compositor")
             .RequireCapability("preferences", "pref_client")
diff --git a/chrome/app/chrome_packaged_service_manifests.cc b/chrome/app/chrome_packaged_service_manifests.cc
index 548f0134..1dc8183 100644
--- a/chrome/app/chrome_packaged_service_manifests.cc
+++ b/chrome/app/chrome_packaged_service_manifests.cc
@@ -9,6 +9,7 @@
 #include "chrome/common/buildflags.h"
 #include "chrome/common/constants.mojom.h"
 #include "chrome/services/file_util/manifest.h"
+#include "chrome/services/noop/manifest.h"
 #include "components/services/patch/manifest.h"
 #include "components/services/unzip/manifest.h"
 #include "components/spellcheck/common/spellcheck.mojom.h"
@@ -137,6 +138,7 @@
       file_util::GetManifest(),
       proxy_resolver::GetManifest(),
       local_state::GetManifest(),
+      noop::GetManifest(),
 #if BUILDFLAG(ENABLE_EXTENSIONS)
       removable_storage_writer::GetManifest(),
 #endif
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 23b370a1..3706703 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3277,6 +3277,9 @@
           Media File Checker
         </message>
       </if>
+      <message name="IDS_UTILITY_PROCESS_NOOP_SERVICE_NAME" desc="The name of the utility process which does nothing, used for experimentation.">
+        No-op Service
+      </message>
       <message name="IDS_UTILITY_PROCESS_PATCH_NAME" desc="The name of the utility process used for patching file operations.">
         Patch Service
       </message>
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm
index 7d4eb4c..bc20426c 100644
--- a/chrome/app_shim/chrome_main_app_mode_mac.mm
+++ b/chrome/app_shim/chrome_main_app_mode_mac.mm
@@ -277,9 +277,9 @@
                                     base::FilePath(info->profile_dir));
     }
 
-    base::Process app = base::mac::OpenApplicationWithPath(
+    NSRunningApplication* running_app = base::mac::OpenApplicationWithPath(
         base::mac::OuterBundlePath(), command_line, NSWorkspaceLaunchDefault);
-    if (!app.IsValid())
+    if (!running_app)
       return 1;
 
     base::Callback<void(bool)> on_ping_chrome_reply = base::Bind(
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 5d65f80..461dcbac 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -100,6 +100,8 @@
     "app_controller_mac.mm",
     "app_mode/app_mode_utils.cc",
     "app_mode/app_mode_utils.h",
+    "apps/user_type_filter.cc",
+    "apps/user_type_filter.h",
     "assist_ranker/assist_ranker_service_factory.cc",
     "assist_ranker/assist_ranker_service_factory.h",
     "autocomplete/autocomplete_classifier_factory.cc",
@@ -1222,8 +1224,6 @@
     "prerender/prerender_message_filter.h",
     "prerender/prerender_origin.cc",
     "prerender/prerender_origin.h",
-    "prerender/prerender_resource_throttle.cc",
-    "prerender/prerender_resource_throttle.h",
     "prerender/prerender_tab_helper.cc",
     "prerender/prerender_tab_helper.h",
     "prerender/prerender_util.cc",
@@ -1754,6 +1754,8 @@
     "//chrome/browser/ui/webui/bluetooth_internals",
     "//chrome/common/net",
     "//chrome/installer/util:with_no_strings",
+    "//chrome/services/noop/public/cpp",
+    "//chrome/services/noop/public/mojom",
     "//components/about_handler",
     "//components/app_modal",
     "//components/assist_ranker",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index a003b68..4ad669e4 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -12,6 +12,7 @@
   "+chrome/services/diagnosticsd/public",
   "+chrome/services/file_util/public",
   "+chrome/services/media_gallery_util/public",
+  "+chrome/services/noop/public",
   "+chrome/services/printing/public",
   "+chrome/services/removable_storage_writer/public",
   "+chrome/services/util_win/public",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index e4e6ebdd..67ced13 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -417,15 +417,6 @@
 
 #endif  // OS_ANDROID
 
-const FeatureEntry::Choice kNumRasterThreadsChoices[] = {
-    {flags_ui::kGenericExperimentChoiceDefault, "", ""},
-    {flag_descriptions::kNumRasterThreadsOne, switches::kNumRasterThreads, "1"},
-    {flag_descriptions::kNumRasterThreadsTwo, switches::kNumRasterThreads, "2"},
-    {flag_descriptions::kNumRasterThreadsThree, switches::kNumRasterThreads,
-     "3"},
-    {flag_descriptions::kNumRasterThreadsFour, switches::kNumRasterThreads,
-     "4"}};
-
 const FeatureEntry::Choice kMHTMLGeneratorOptionChoices[] = {
     {flags_ui::kGenericExperimentChoiceDefault, "", ""},
     {flag_descriptions::kMhtmlSkipNostoreMain, switches::kMHTMLGeneratorOption,
@@ -751,22 +742,6 @@
      base::size(kAutofillPreviewStyleBlackOnYellow050), nullptr}};
 
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-const FeatureEntry::FeatureParam kAutofillPrimaryInfoStyleMedium[] = {
-    {autofill::kAutofillForcedFontWeightParameterName,
-     autofill::kAutofillForcedFontWeightParameterMedium},
-};
-const FeatureEntry::FeatureParam kAutofillPrimaryInfoStyleBold[] = {
-    {autofill::kAutofillForcedFontWeightParameterName,
-     autofill::kAutofillForcedFontWeightParameterBold},
-};
-
-const FeatureEntry::FeatureVariation kAutofillPrimaryInfoStyleVariations[] = {
-    {"(medium)", kAutofillPrimaryInfoStyleMedium,
-     base::size(kAutofillPrimaryInfoStyleMedium), nullptr},
-    {"(bold)", kAutofillPrimaryInfoStyleBold,
-     base::size(kAutofillPrimaryInfoStyleBold), nullptr},
-};
-
 const FeatureEntry::FeatureParam kPedalSuggestionInSuggestion[] = {
     {OmniboxFieldTrial::kPedalSuggestionModeParam, "in_suggestion"}};
 const FeatureEntry::FeatureParam kPedalSuggestionDedicated[] = {
@@ -1931,9 +1906,6 @@
          feature_engagement::kIPHDemoMode,
          feature_engagement::kIPHDemoModeChoiceVariations,
          "IPH_DemoMode")},
-    {"num-raster-threads", flag_descriptions::kNumRasterThreadsName,
-     flag_descriptions::kNumRasterThreadsDescription, kOsAll,
-     MULTI_VALUE_TYPE(kNumRasterThreadsChoices)},
     {"disable-cast-streaming-hw-encoding",
      flag_descriptions::kCastStreamingHwEncodingName,
      flag_descriptions::kCastStreamingHwEncodingDescription, kOsAll,
@@ -3532,13 +3504,6 @@
                                     kSimplifyHttpsIndicatorVariations,
                                     "SimplifyHttpsIndicator")},
 
-#if defined(OS_CHROMEOS)
-    {"ash-enable-trilinear-filtering",
-     flag_descriptions::kAshEnableTrilinearFilteringName,
-     flag_descriptions::kAshEnableTrilinearFilteringDescription, kOsCrOS,
-     FEATURE_VALUE_TYPE(ash::features::kTrilinearFiltering)},
-#endif  // OS_CHROMEOS
-
 #if defined(OS_WIN)
     {"enable-gpu-appcontainer", flag_descriptions::kEnableGpuAppcontainerName,
      flag_descriptions::kEnableGpuAppcontainerDescription, kOsWin,
@@ -3702,17 +3667,6 @@
      flag_descriptions::kAutofillCacheQueryResponsesDescription, kOsAll,
      FEATURE_VALUE_TYPE(autofill::features::kAutofillCacheQueryResponses)},
 
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-    {"autofill-primary-info-style",
-     flag_descriptions::kAutofillPrimaryInfoStyleExperimentName,
-     flag_descriptions::kAutofillPrimaryInfoStyleExperimentDescription,
-     kOsDesktop,
-     FEATURE_WITH_PARAMS_VALUE_TYPE(
-         autofill::kAutofillPrimaryInfoStyleExperiment,
-         kAutofillPrimaryInfoStyleVariations,
-         "AutofillPrimaryInfoStyleExperiment")},
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
     {"autofill-enable-company-name",
      flag_descriptions::kAutofillEnableCompanyNameName,
      flag_descriptions::kAutofillEnableCompanyNameDescription, kOsAll,
diff --git a/chrome/browser/android/bookmarks/partner_bookmarks_reader.cc b/chrome/browser/android/bookmarks/partner_bookmarks_reader.cc
index ff68734..2f82bde 100644
--- a/chrome/browser/android/bookmarks/partner_bookmarks_reader.cc
+++ b/chrome/browser/android/bookmarks/partner_bookmarks_reader.cc
@@ -259,7 +259,7 @@
     bool from_server,
     int desired_favicon_size_px,
     FaviconFetchedCallback callback) {
-  GetLargeIconService()->GetLargeIconOrFallbackStyle(
+  GetLargeIconService()->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       page_url, kPartnerBookmarksMinimumFaviconSizePx, desired_favicon_size_px,
       base::Bind(&PartnerBookmarksReader::OnGetFaviconFromCacheFinished,
                  base::Unretained(this), page_url,
diff --git a/chrome/browser/android/large_icon_bridge.cc b/chrome/browser/android/large_icon_bridge.cc
index 0b9410b7..095fd20 100644
--- a/chrome/browser/android/large_icon_bridge.cc
+++ b/chrome/browser/android/large_icon_bridge.cc
@@ -22,12 +22,12 @@
 #include "ui/gfx/android/java_bitmap.h"
 #include "ui/gfx/codec/png_codec.h"
 
+using base::android::AttachCurrentThread;
+using base::android::ConvertJavaStringToUTF16;
 using base::android::JavaParamRef;
 using base::android::JavaRef;
 using base::android::ScopedJavaGlobalRef;
 using base::android::ScopedJavaLocalRef;
-using base::android::AttachCurrentThread;
-using base::android::ConvertJavaStringToUTF16;
 
 namespace {
 
@@ -40,8 +40,7 @@
   ScopedJavaLocalRef<jobject> j_bitmap;
   if (result.bitmap.is_valid()) {
     gfx::PNGCodec::Decode(result.bitmap.bitmap_data->front(),
-                          result.bitmap.bitmap_data->size(),
-                          &bitmap);
+                          result.bitmap.bitmap_data->size(), &bitmap);
     if (!bitmap.isNull())
       j_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
   }
@@ -62,11 +61,9 @@
   return reinterpret_cast<intptr_t>(new LargeIconBridge());
 }
 
-LargeIconBridge::LargeIconBridge() {
-}
+LargeIconBridge::LargeIconBridge() {}
 
-LargeIconBridge::~LargeIconBridge() {
-}
+LargeIconBridge::~LargeIconBridge() {}
 
 void LargeIconBridge::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) {
   delete this;
@@ -91,12 +88,11 @@
   favicon_base::LargeIconCallback callback_runner = base::Bind(
       &OnLargeIconAvailable, ScopedJavaGlobalRef<jobject>(env, j_callback));
 
-  large_icon_service->GetLargeIconOrFallbackStyle(
-      GURL(ConvertJavaStringToUTF16(env, j_page_url)),
-      min_source_size_px,
-      0,  // Do not resize.
-      callback_runner,
-      &cancelable_task_tracker_);
+  // Use desired_size = 0 for getting the icon from the cache (so that
+  // the icon is not poorly rescaled by LargeIconService).
+  large_icon_service->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
+      GURL(ConvertJavaStringToUTF16(env, j_page_url)), min_source_size_px,
+      /*desired_size_in_pixel=*/0, callback_runner, &cancelable_task_tracker_);
 
   return true;
 }
diff --git a/chrome/browser/apps/app_shim/app_shim_host_mac.cc b/chrome/browser/apps/app_shim/app_shim_host_mac.cc
index cf2c63a..45b8707 100644
--- a/chrome/browser/apps/app_shim/app_shim_host_mac.cc
+++ b/chrome/browser/apps/app_shim/app_shim_host_mac.cc
@@ -29,10 +29,11 @@
                          bool uses_remote_views)
     : host_binding_(this),
       app_shim_request_(mojo::MakeRequest(&app_shim_)),
+      launch_shim_has_been_called_(false),
       app_id_(app_id),
       profile_path_(profile_path),
       uses_remote_views_(uses_remote_views),
-      weak_factory_(this) {
+      launch_weak_factory_(this) {
   // Create the interfaces used to host windows, so that browser windows may be
   // created before the host process finishes launching.
   if (uses_remote_views_) {
@@ -85,28 +86,39 @@
 }
 
 void AppShimHost::LaunchShimInternal(bool recreate_shims) {
+  DCHECK(launch_shim_has_been_called_);
   DCHECK(!bootstrap_);
   apps::AppShimHandler* handler = GetAppShimHandler();
   if (!handler)
     return;
+  launch_weak_factory_.InvalidateWeakPtrs();
   handler->OnShimLaunchRequested(
       this, recreate_shims,
       base::BindOnce(&AppShimHost::OnShimProcessLaunched,
-                     weak_factory_.GetWeakPtr(), recreate_shims),
+                     launch_weak_factory_.GetWeakPtr(), recreate_shims),
       base::BindOnce(&AppShimHost::OnShimProcessTerminated,
-                     weak_factory_.GetWeakPtr()));
+                     launch_weak_factory_.GetWeakPtr(), recreate_shims));
 }
 
 void AppShimHost::OnShimProcessLaunched(bool recreate_shims_requested,
                                         base::Process shim_process) {
-  // If the shim process was created, assume that it will successfully create
-  // an AppShimHostBootstrap.
-  // TODO(https://crbug.com/913362): We should add a callback for when
-  // |shim_process| exits, and handle the case where that happens without the
-  // creation of an AppShimHostBootstrap.
+  // If a bootstrap connected, then it should have invalidated all weak
+  // pointers, preventing this from being called.
+  DCHECK(!bootstrap_);
+
+  // If the shim process was created, then await either an AppShimHostBootstrap
+  // connecting or the process exiting.
   if (shim_process.IsValid())
     return;
 
+  // Shim launch failing is treated the same as the shim launching but
+  // terminating before connecting.
+  OnShimProcessTerminated(recreate_shims_requested);
+}
+
+void AppShimHost::OnShimProcessTerminated(bool recreate_shims_requested) {
+  DCHECK(!bootstrap_);
+
   // If this was a launch without recreating shims, then the launch may have
   // failed because the shims were not present, or because they were out of
   // date. Try again, recreating the shims this time.
@@ -125,8 +137,6 @@
   OnAppClosed();
 }
 
-void AppShimHost::OnShimProcessTerminated() {}
-
 ////////////////////////////////////////////////////////////////////////////////
 // AppShimHost, chrome::mojom::AppShimHost
 
@@ -136,6 +146,10 @@
 
 void AppShimHost::OnBootstrapConnected(
     std::unique_ptr<AppShimHostBootstrap> bootstrap) {
+  // Prevent any callbacks from any pending launches (e.g, if an internal and
+  // external launch happen to race).
+  launch_weak_factory_.InvalidateWeakPtrs();
+
   DCHECK(!bootstrap_);
   bootstrap_ = std::move(bootstrap);
   bootstrap_->OnConnectedToHost(std::move(app_shim_request_));
@@ -147,6 +161,10 @@
 }
 
 void AppShimHost::LaunchShim() {
+  if (launch_shim_has_been_called_)
+    return;
+  launch_shim_has_been_called_ = true;
+
   apps::AppShimHandler* handler = GetAppShimHandler();
   if (!handler)
     return;
diff --git a/chrome/browser/apps/app_shim/app_shim_host_mac.h b/chrome/browser/apps/app_shim/app_shim_host_mac.h
index 9cae828..a712eb1 100644
--- a/chrome/browser/apps/app_shim/app_shim_host_mac.h
+++ b/chrome/browser/apps/app_shim/app_shim_host_mac.h
@@ -81,6 +81,11 @@
   // AppShimHost is owned by itself. It will delete itself in Close (called on
   // channel error and OnAppClosed).
   ~AppShimHost() override;
+
+  // Return the AppShimHandler for this app (virtual for tests).
+  virtual apps::AppShimHandler* GetAppShimHandler() const;
+
+ private:
   void ChannelError(uint32_t custom_reason, const std::string& description);
 
   // Closes the channel and destroys the AppShimHost.
@@ -95,10 +100,7 @@
 
   // Called when a shim process returned via OnShimLaunchCompleted has
   // terminated.
-  void OnShimProcessTerminated();
-
-  // Return the AppShimHandler for this app (virtual for tests).
-  virtual apps::AppShimHandler* GetAppShimHandler() const;
+  void OnShimProcessTerminated(bool recreate_shims_requested);
 
   // chrome::mojom::AppShimHost.
   void FocusApp(apps::AppShimFocusType focus_type,
@@ -110,6 +112,11 @@
   chrome::mojom::AppShimPtr app_shim_;
   chrome::mojom::AppShimRequest app_shim_request_;
 
+  // Only allow LaunchShim to have any effect on the first time it is called. If
+  // that launch fails, it will re-launch (requesting that the shim be
+  // re-created).
+  bool launch_shim_has_been_called_;
+
   std::unique_ptr<AppShimHostBootstrap> bootstrap_;
 
   std::unique_ptr<views::BridgeFactoryHost> views_bridge_factory_host_;
@@ -121,7 +128,9 @@
 
   // This class is only ever to be used on the UI thread.
   THREAD_CHECKER(thread_checker_);
-  base::WeakPtrFactory<AppShimHost> weak_factory_;
+
+  // This weak factory is used for launch callbacks only.
+  base::WeakPtrFactory<AppShimHost> launch_weak_factory_;
   DISALLOW_COPY_AND_ASSIGN(AppShimHost);
 };
 
diff --git a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
index b72bbbdb..83d13d1 100644
--- a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
+++ b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
@@ -368,9 +368,10 @@
     HostedAppBrowserListObserver listener(app->id());
     base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
     shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest);
-    base::Process shim_process = base::mac::OpenApplicationWithPath(
+    NSRunningApplication* shim_app = base::mac::OpenApplicationWithPath(
         shim_path_, shim_cmdline, NSWorkspaceLaunchDefault);
-    ASSERT_TRUE(shim_process.IsValid());
+    ASSERT_TRUE(shim_app);
+    base::Process shim_process([shim_app processIdentifier]);
     listener.WaitUntilAdded();
 
     ASSERT_TRUE(GetFirstHostedAppWindow());
@@ -438,9 +439,10 @@
     ExtensionTestMessageListener launched_listener("Launched", false);
     base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
     shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest);
-    base::Process shim_process = base::mac::OpenApplicationWithPath(
+    NSRunningApplication* shim_app = base::mac::OpenApplicationWithPath(
         shim_path_, shim_cmdline, NSWorkspaceLaunchDefault);
-    ASSERT_TRUE(shim_process.IsValid());
+    ASSERT_TRUE(shim_app);
+    base::Process shim_process([shim_app processIdentifier]);
     ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
 
     ASSERT_TRUE(GetFirstAppWindow());
@@ -657,9 +659,9 @@
   //     behave normally.
   ExtensionTestMessageListener launched_listener("Launched", false);
   base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
-  base::Process shim_process = base::mac::OpenApplicationWithPath(
+  NSRunningApplication* shim_app = base::mac::OpenApplicationWithPath(
       shim_path, shim_cmdline, NSWorkspaceLaunchDefault);
-  ASSERT_TRUE(shim_process.IsValid());
+  ASSERT_TRUE(shim_app);
 
   // Wait for the app to start (1). At this point there is no shim host.
   ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
diff --git a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
index 6ed1713d..27e12a1 100644
--- a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
+++ b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -124,7 +124,7 @@
 // - True if the caller is unsigned (there's nothing to verify).
 // - True if |pid| satisfies the caller's designated requirement.
 // - False otherwise (|pid| does not satisfy caller's designated requirement).
-bool IsAcceptablyCodeSigned(pid_t pid) {
+bool IsAcceptablyCodeSignedInternal(pid_t pid) {
   base::ScopedCFTypeRef<SecCodeRef> own_code;
   base::ScopedCFTypeRef<CFDictionaryRef> own_signing_info;
 
@@ -674,23 +674,6 @@
     return;
   }
 
-  // If the connecting shim process doesn't have an acceptable code signature,
-  // reject the connection and recreate the shim.
-  if (!IsAcceptablyCodeSigned(bootstrap->GetAppShimPid())) {
-    // TODO(https://crbug.com/923612): Should only be here for a day or two.
-    LOG(ERROR) << "The attaching app shim's code signature is invalid. This "
-                  "will fail in future builds of Chrome.";
-#if 0
-    if (bootstrap->GetLaunchType() == APP_SHIM_LAUNCH_NORMAL) {
-      constexpr bool recreate_shims = true;
-      delegate_->LaunchShim(profile, extension, recreate_shims,
-                            base::BindOnce([](base::Process) {}));
-    }
-    bootstrap->OnFailedToConnectToHost(APP_SHIM_LAUNCH_FAILED_VALIDATION);
-    return;
-#endif
-  }
-
   AppShimHost* host = delegate_->AllowShimToConnect(profile, extension)
                           ? FindOrCreateHost(profile, extension)
                           : nullptr;
@@ -706,7 +689,16 @@
       bootstrap->OnFailedToConnectToHost(APP_SHIM_LAUNCH_DUPLICATE_HOST);
       return;
     }
-    host->OnBootstrapConnected(std::move(bootstrap));
+    if (IsAcceptablyCodeSigned(bootstrap->GetAppShimPid())) {
+      host->OnBootstrapConnected(std::move(bootstrap));
+    } else {
+      // If the connecting shim process doesn't have an acceptable code
+      // signature, reject the connection and re-launch the shim. The internal
+      // re-launch will likely fail, whereupon the shim will be recreated.
+      LOG(ERROR) << "The attaching app shim's code signature is invalid.";
+      bootstrap->OnFailedToConnectToHost(APP_SHIM_LAUNCH_FAILED_VALIDATION);
+      host->LaunchShim();
+    }
   } else {
     // If it's an app that has a shim to launch it but shouldn't use a host
     // (e.g, a hosted app that opens in a tab), terminate the shim, but still
@@ -720,6 +712,10 @@
     delegate_->LaunchApp(profile, extension, files);
 }
 
+bool ExtensionAppShimHandler::IsAcceptablyCodeSigned(pid_t pid) const {
+  return IsAcceptablyCodeSignedInternal(pid);
+}
+
 void ExtensionAppShimHandler::OnShimClose(AppShimHost* host) {
   // This might be called when shutting down. Don't try to look up the profile
   // since profile_manager might not be around.
diff --git a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
index bb5ddcc8..f15dafcbb 100644
--- a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
+++ b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
@@ -174,6 +174,9 @@
   typedef std::set<Browser*> BrowserSet;
   typedef std::map<std::string, BrowserSet> AppBrowserMap;
 
+  // Virtual for tests.
+  virtual bool IsAcceptablyCodeSigned(pid_t pid) const;
+
   // Exposed for testing.
   void set_delegate(Delegate* delegate);
   HostMap& hosts() { return hosts_; }
diff --git a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac_unittest.cc b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
index 465da676..046b227 100644
--- a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
+++ b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
@@ -82,11 +82,16 @@
                   ShimTerminatedCallback terminated_callback) override {
     if (launch_shim_callback_capture_)
       *launch_shim_callback_capture_ = std::move(launched_callback);
+    if (terminated_shim_callback_capture_)
+      *terminated_shim_callback_capture_ = std::move(terminated_callback);
     DoLaunchShim(profile, extension, recreate_shim);
   }
   void SetCaptureShimLaunchedCallback(ShimLaunchedCallback* callback) {
     launch_shim_callback_capture_ = callback;
   }
+  void SetCaptureShimTerminatedCallback(ShimTerminatedCallback* callback) {
+    terminated_shim_callback_capture_ = callback;
+  }
 
   MOCK_METHOD0(LaunchUserManager, void());
 
@@ -125,6 +130,7 @@
 
  private:
   ShimLaunchedCallback* launch_shim_callback_capture_ = nullptr;
+  ShimTerminatedCallback* terminated_shim_callback_capture_ = nullptr;
   std::map<base::FilePath, base::OnceCallback<void(Profile*)>> callbacks_;
   AppShimHost* host_for_create_ = nullptr;
   bool allow_shim_to_connect_ = true;
@@ -153,9 +159,17 @@
     return it == hosts().end() ? NULL : it->second;
   }
 
+  void SetAcceptablyCodeSigned(bool is_acceptable_code_signed) {
+    is_acceptably_code_signed_ = is_acceptable_code_signed;
+  }
+  bool IsAcceptablyCodeSigned(pid_t pid) const override {
+    return is_acceptably_code_signed_;
+  }
+
   content::NotificationRegistrar& GetRegistrar() { return registrar(); }
 
  private:
+  bool is_acceptably_code_signed_ = true;
   DISALLOW_COPY_AND_ASSIGN(TestingExtensionAppShimHandler);
 };
 
@@ -215,7 +229,7 @@
            TestingExtensionAppShimHandler* handler)
       : AppShimHost(app_id, profile_path, false /* uses_remote_views */),
         handler_(handler),
-        weak_factory_(this) {}
+        test_weak_factory_(this) {}
 
   // Override the GetAppShimHandler for testing.
   apps::AppShimHandler* GetAppShimHandler() const override { return handler_; }
@@ -229,14 +243,16 @@
   }
   bool did_connect_to_host() const { return did_connect_to_host_; }
 
-  base::WeakPtr<TestHost> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
+  base::WeakPtr<TestHost> GetWeakPtr() {
+    return test_weak_factory_.GetWeakPtr();
+  }
 
  private:
   ~TestHost() override {}
   TestingExtensionAppShimHandler* handler_;
   bool did_connect_to_host_ = false;
 
-  base::WeakPtrFactory<TestHost> weak_factory_;
+  base::WeakPtrFactory<TestHost> test_weak_factory_;
   DISALLOW_COPY_AND_ASSIGN(TestHost);
 };
 
@@ -264,6 +280,11 @@
                                          &bootstrap_aa_duplicate_result_,
                                          handler_.get()))
             ->GetWeakPtr();
+    bootstrap_aa_thethird_ =
+        (new TestingAppShimHostBootstrap(profile_path_a_, kTestAppIdA,
+                                         &bootstrap_aa_thethird_result_,
+                                         handler_.get()))
+            ->GetWeakPtr();
 
     host_aa_ = (new TestHost(profile_path_a_, kTestAppIdA, handler_.get()))
                    ->GetWeakPtr();
@@ -329,6 +350,7 @@
     delete bootstrap_ab_.get();
     delete bootstrap_bb_.get();
     delete bootstrap_aa_duplicate_.get();
+    delete bootstrap_aa_thethird_.get();
   }
 
   void DoShimLaunch(base::WeakPtr<TestingAppShimHostBootstrap> bootstrap,
@@ -390,11 +412,13 @@
   base::WeakPtr<TestingAppShimHostBootstrap> bootstrap_ab_;
   base::WeakPtr<TestingAppShimHostBootstrap> bootstrap_bb_;
   base::WeakPtr<TestingAppShimHostBootstrap> bootstrap_aa_duplicate_;
+  base::WeakPtr<TestingAppShimHostBootstrap> bootstrap_aa_thethird_;
 
   base::Optional<apps::AppShimLaunchResult> bootstrap_aa_result_;
   base::Optional<apps::AppShimLaunchResult> bootstrap_ab_result_;
   base::Optional<apps::AppShimLaunchResult> bootstrap_bb_result_;
   base::Optional<apps::AppShimLaunchResult> bootstrap_aa_duplicate_result_;
+  base::Optional<apps::AppShimLaunchResult> bootstrap_aa_thethird_result_;
 
   base::WeakPtr<TestHost> host_aa_;
   base::WeakPtr<TestHost> host_ab_;
@@ -561,6 +585,80 @@
   EXPECT_EQ(nullptr, host_aa_.get());
 }
 
+TEST_F(ExtensionAppShimHandlerTest, FailToConnect) {
+  // When the app activates, it requests a launch.
+  ShimLaunchedCallback launched_callback;
+  delegate_->SetCaptureShimLaunchedCallback(&launched_callback);
+  ShimTerminatedCallback terminated_callback;
+  delegate_->SetCaptureShimTerminatedCallback(&terminated_callback);
+
+  delegate_->SetHostForCreate(host_aa_.get());
+  EXPECT_CALL(*delegate_, DoLaunchShim(&profile_a_, extension_a_.get(), false));
+  handler_->OnAppActivated(&profile_a_, kTestAppIdA);
+  EXPECT_EQ(host_aa_.get(), handler_->FindHost(&profile_a_, kTestAppIdA));
+  EXPECT_TRUE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+
+  // Run the launch callback claiming that the launch succeeded.
+  std::move(launched_callback).Run(base::Process(5));
+  EXPECT_FALSE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+
+  // Report that the process terminated. This should trigger a re-create and
+  // re-launch.
+  EXPECT_CALL(*delegate_, DoLaunchShim(&profile_a_, extension_a_.get(), true));
+  std::move(terminated_callback).Run();
+  EXPECT_TRUE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+
+  // Run the launch callback claiming that the launch succeeded.
+  std::move(launched_callback).Run(base::Process(7));
+  EXPECT_FALSE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+
+  // Report that the process terminated again. This should trigger deletion of
+  // the host.
+  EXPECT_NE(nullptr, host_aa_.get());
+  std::move(terminated_callback).Run();
+  EXPECT_EQ(nullptr, host_aa_.get());
+}
+
+TEST_F(ExtensionAppShimHandlerTest, FailCodeSignature) {
+  handler_->SetAcceptablyCodeSigned(false);
+  ShimLaunchedCallback launched_callback;
+  delegate_->SetCaptureShimLaunchedCallback(&launched_callback);
+  ShimTerminatedCallback terminated_callback;
+  delegate_->SetCaptureShimTerminatedCallback(&terminated_callback);
+
+  // Fail to code-sign. This should result in a host being created, and a launch
+  // having been requested.
+  EXPECT_CALL(*delegate_, DoLaunchShim(&profile_a_, extension_a_.get(), false));
+  NormalLaunch(bootstrap_aa_, host_aa_);
+  EXPECT_EQ(host_aa_.get(), handler_->FindHost(&profile_a_, kTestAppIdA));
+  EXPECT_TRUE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+  EXPECT_FALSE(host_aa_->HasBootstrapConnected());
+
+  // Run the launch callback claiming that the launch succeeded.
+  std::move(launched_callback).Run(base::Process(5));
+  EXPECT_FALSE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+  EXPECT_FALSE(host_aa_->HasBootstrapConnected());
+
+  // Simulate the register call that then fails due to signature failing.
+  RegisterOnlyLaunch(bootstrap_aa_duplicate_, host_aa_);
+  EXPECT_FALSE(host_aa_->HasBootstrapConnected());
+
+  // Simulate the termination after the register failed.
+  handler_->SetAcceptablyCodeSigned(true);
+  EXPECT_CALL(*delegate_, DoLaunchShim(&profile_a_, extension_a_.get(), true));
+  std::move(terminated_callback).Run();
+  EXPECT_TRUE(launched_callback);
+  EXPECT_TRUE(terminated_callback);
+  RegisterOnlyLaunch(bootstrap_aa_thethird_, host_aa_);
+  EXPECT_TRUE(host_aa_->HasBootstrapConnected());
+}
+
 TEST_F(ExtensionAppShimHandlerTest, MaybeTerminate) {
   // Launch shims, adding entries in the map.
   RegisterOnlyLaunch(bootstrap_aa_, host_aa_);
diff --git a/chrome/browser/apps/user_type_filter.cc b/chrome/browser/apps/user_type_filter.cc
new file mode 100644
index 0000000..fdc9c6b
--- /dev/null
+++ b/chrome/browser/apps/user_type_filter.cc
@@ -0,0 +1,89 @@
+// Copyright 2019 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/apps/user_type_filter.h"
+
+#include "base/values.h"
+#include "chrome/browser/policy/profile_policy_connector.h"
+#include "chrome/browser/policy/profile_policy_connector_factory.h"
+#include "chrome/browser/profiles/profile.h"
+
+namespace apps {
+
+namespace {
+
+std::string DetermineUserType(Profile* profile) {
+  DCHECK(!profile->IsOffTheRecord());
+  if (profile->IsGuestSession())
+    return kUserTypeGuest;
+  if (profile->IsChild())
+    return kUserTypeChild;
+  if (profile->IsLegacySupervised())
+    return kUserTypeSupervised;
+  if (policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile)
+          ->IsManaged()) {
+    return kUserTypeManaged;
+  }
+  return kUserTypeUnmanaged;
+}
+
+}  // namespace
+
+// kUserType is required key that specifies enumeration of user types for which
+// web app is visible. See kUserType* constants
+const char kKeyUserType[] = "user_type";
+
+const char kUserTypeChild[] = "child";
+const char kUserTypeGuest[] = "guest";
+const char kUserTypeManaged[] = "managed";
+const char kUserTypeSupervised[] = "supervised";
+const char kUserTypeUnmanaged[] = "unmanaged";
+
+bool ProfileMatchJsonUserType(Profile* profile,
+                              const std::string& app_id,
+                              const base::Value* json_root,
+                              const base::ListValue* default_user_types) {
+  DCHECK(profile);
+  DCHECK(json_root);
+
+  if (!json_root->is_dict()) {
+    LOG(ERROR) << "Non-dictionary Json is passed to user type filter for "
+               << app_id << ".";
+    return false;
+  }
+
+  const base::Value* value =
+      json_root->FindKeyOfType(kKeyUserType, base::Value::Type::LIST);
+  if (!value) {
+    if (!default_user_types) {
+      LOG(ERROR) << "Json has no user type filter for " << app_id << ".";
+      return false;
+    }
+    value = default_user_types;
+    LOG(WARNING) << "No user type filter specified for " << app_id
+                 << ". Using default user type filter, please update the app.";
+  }
+
+  bool user_type_match = false;
+  const std::string user_type = DetermineUserType(profile);
+  for (const auto& it : value->GetList()) {
+    if (!it.is_string()) {
+      LOG(ERROR) << "Invalid user type value for " << app_id << ".";
+      return false;
+    }
+    if (it.GetString() != user_type)
+      continue;
+    user_type_match = true;
+    break;
+  }
+  if (!user_type_match) {
+    VLOG(1) << "Skip " << app_id << ". It does not match user type "
+            << user_type << ".";
+    return false;
+  }
+
+  return true;
+}
+
+}  // namespace apps
diff --git a/chrome/browser/apps/user_type_filter.h b/chrome/browser/apps/user_type_filter.h
new file mode 100644
index 0000000..abcc95d
--- /dev/null
+++ b/chrome/browser/apps/user_type_filter.h
@@ -0,0 +1,42 @@
+// Copyright 2019 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_APPS_USER_TYPE_FILTER_H_
+#define CHROME_BROWSER_APPS_USER_TYPE_FILTER_H_
+
+#include <string>
+
+class Profile;
+
+namespace base {
+class Value;
+class ListValue;
+}  // namespace base
+
+namespace apps {
+
+extern const char kKeyUserType[];
+
+extern const char kUserTypeChild[];
+extern const char kUserTypeGuest[];
+extern const char kUserTypeManaged[];
+extern const char kUserTypeSupervised[];
+extern const char kUserTypeUnmanaged[];
+
+// This filter is used to verify that testing profile |profile| matches user
+// type filter defined in root Json element |json_root|. |json_root| should have
+// the list of acceptable user types. Following values are valid: child, guest,
+// managed, supervised, unmanaged. Primary use of this filter is to determine if
+// particular default webapp or extension has to be installed for current user.
+// Returns true if profile is accepted for this filter. |default_user_types| is
+// optional and used to support transition for the extension based default apps.
+// |app_id| is used for error logging purpose.
+bool ProfileMatchJsonUserType(Profile* profile,
+                              const std::string& app_id,
+                              const base::Value* json_root,
+                              const base::ListValue* default_user_types);
+
+}  // namespace apps
+
+#endif  // CHROME_BROWSER_APPS_USER_TYPE_FILTER_H_
diff --git a/chrome/browser/apps/user_type_filter_unittest.cc b/chrome/browser/apps/user_type_filter_unittest.cc
new file mode 100644
index 0000000..13f5429
--- /dev/null
+++ b/chrome/browser/apps/user_type_filter_unittest.cc
@@ -0,0 +1,145 @@
+// Copyright 2019 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/apps/user_type_filter.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/values.h"
+#include "chrome/browser/policy/profile_policy_connector.h"
+#include "chrome/browser/policy/profile_policy_connector_factory.h"
+#include "chrome/browser/supervised_user/supervised_user_constants.h"
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace apps {
+
+namespace {
+
+// Helper that simulates Json file with embedded user type filter.
+std::unique_ptr<base::DictionaryValue> CreateJsonWithFilter(
+    const std::vector<std::string>& user_types) {
+  auto root = std::make_unique<base::DictionaryValue>();
+  base::ListValue filter;
+  for (const auto& user_type : user_types)
+    filter.GetList().push_back(base::Value(user_type));
+  root->SetKey(kKeyUserType, std::move(filter));
+  return root;
+}
+
+}  // namespace
+
+class UserTypeFilterTest : public testing::Test {
+ public:
+  UserTypeFilterTest() = default;
+  ~UserTypeFilterTest() override = default;
+
+ protected:
+  // Helper that creates simple test profile.
+  std::unique_ptr<TestingProfile> CreateProfile() {
+    TestingProfile::Builder profile_builder;
+    return profile_builder.Build();
+  }
+
+  // Helper that creates simple test guest profile.
+  std::unique_ptr<TestingProfile> CreateGuestProfile() {
+    TestingProfile::Builder profile_builder;
+    profile_builder.SetGuestSession();
+    return profile_builder.Build();
+  }
+
+  bool Match(const std::unique_ptr<TestingProfile>& profile,
+             const std::unique_ptr<base::Value>& json_root) {
+    return ProfileMatchJsonUserType(profile.get(), std::string() /* app_id */,
+                                    json_root.get(),
+                                    nullptr /* default_user_types */);
+  }
+
+  bool MatchDefault(const std::unique_ptr<TestingProfile>& profile,
+                    const base::ListValue& default_user_types) {
+    base::DictionaryValue json_root;
+    return ProfileMatchJsonUserType(profile.get(), std::string() /* app_id */,
+                                    &json_root, &default_user_types);
+  }
+
+ private:
+  // To support context of browser threads.
+  content::TestBrowserThreadBundle thread_bundle_;
+
+  DISALLOW_COPY_AND_ASSIGN(UserTypeFilterTest);
+};
+
+TEST_F(UserTypeFilterTest, ChildUser) {
+  const auto profile = CreateProfile();
+  profile->SetSupervisedUserId(supervised_users::kChildAccountSUID);
+  EXPECT_FALSE(Match(profile, CreateJsonWithFilter({kUserTypeUnmanaged})));
+  EXPECT_TRUE(Match(profile, CreateJsonWithFilter({kUserTypeChild})));
+  EXPECT_TRUE(Match(
+      profile, CreateJsonWithFilter({kUserTypeUnmanaged, kUserTypeChild})));
+}
+
+TEST_F(UserTypeFilterTest, GuestUser) {
+  auto profile = CreateGuestProfile();
+  EXPECT_FALSE(Match(profile, CreateJsonWithFilter({kUserTypeUnmanaged})));
+  EXPECT_TRUE(Match(profile, CreateJsonWithFilter({kUserTypeGuest})));
+  EXPECT_TRUE(Match(
+      profile, CreateJsonWithFilter({kUserTypeUnmanaged, kUserTypeGuest})));
+}
+
+TEST_F(UserTypeFilterTest, ManagedUser) {
+  const auto profile = CreateProfile();
+  policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile.get())
+      ->OverrideIsManagedForTesting(true);
+  EXPECT_FALSE(Match(profile, CreateJsonWithFilter({kUserTypeUnmanaged})));
+  EXPECT_TRUE(Match(profile, CreateJsonWithFilter({kUserTypeManaged})));
+  EXPECT_TRUE(Match(
+      profile, CreateJsonWithFilter({kUserTypeUnmanaged, kUserTypeManaged})));
+}
+
+TEST_F(UserTypeFilterTest, SupervisedUser) {
+  const auto profile = CreateProfile();
+  profile->SetSupervisedUserId("asdf");
+  EXPECT_FALSE(Match(profile, CreateJsonWithFilter({kUserTypeUnmanaged})));
+  EXPECT_TRUE(Match(profile, CreateJsonWithFilter({kUserTypeSupervised})));
+  EXPECT_TRUE(Match(profile, CreateJsonWithFilter(
+                                 {kUserTypeUnmanaged, kUserTypeSupervised})));
+}
+
+TEST_F(UserTypeFilterTest, UnmanagedUser) {
+  EXPECT_TRUE(
+      Match(CreateProfile(), CreateJsonWithFilter({kUserTypeUnmanaged})));
+}
+
+TEST_F(UserTypeFilterTest, EmptyFilter) {
+  EXPECT_FALSE(Match(CreateProfile(), CreateJsonWithFilter({})));
+}
+
+TEST_F(UserTypeFilterTest, DefaultFilter) {
+  auto profile = CreateProfile();
+  base::ListValue default_filter;
+  default_filter.GetList().push_back(base::Value(kUserTypeUnmanaged));
+  default_filter.GetList().push_back(base::Value(kUserTypeGuest));
+
+  // Unmanaged user.
+  EXPECT_TRUE(MatchDefault(profile, default_filter));
+  // Guest user.
+  EXPECT_TRUE(MatchDefault(CreateGuestProfile(), default_filter));
+  // Child user.
+  profile->SetSupervisedUserId(supervised_users::kChildAccountSUID);
+  EXPECT_FALSE(MatchDefault(profile, default_filter));
+  // Supervised user.
+  profile->SetSupervisedUserId("asdf");
+  EXPECT_FALSE(MatchDefault(profile, default_filter));
+  // Managed user.
+  profile = CreateProfile();
+  policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile.get())
+      ->OverrideIsManagedForTesting(true);
+  EXPECT_FALSE(MatchDefault(profile, default_filter));
+}
+
+}  // namespace apps
diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper.cc b/chrome/browser/browsing_data/browsing_data_appcache_helper.cc
index 8dfafcab..fca4627 100644
--- a/chrome/browser/browsing_data/browsing_data_appcache_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_appcache_helper.cc
@@ -103,7 +103,7 @@
     return;  // Ignore non-websafe schemes.
 
   OriginAppCacheInfoMap& origin_map = info_collection_->infos_by_origin;
-  content::AppCacheInfoVector& appcache_infos =
+  std::vector<blink::mojom::AppCacheInfo>& appcache_infos =
       origin_map[url::Origin::Create(manifest_url)];
 
   for (const auto& appcache : appcache_infos) {
diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper.h b/chrome/browser/browsing_data/browsing_data_appcache_helper.h
index 9ec68cf..569e9d4 100644
--- a/chrome/browser/browsing_data/browsing_data_appcache_helper.h
+++ b/chrome/browser/browsing_data/browsing_data_appcache_helper.h
@@ -8,6 +8,7 @@
 #include <stddef.h>
 
 #include <map>
+#include <vector>
 
 #include "base/callback.h"
 #include "base/macros.h"
@@ -19,13 +20,19 @@
 class BrowserContext;
 }
 
+namespace blink {
+namespace mojom {
+class AppCacheInfo;
+}  // namespace mojom
+}  // namespace blink
+
 // This class fetches appcache information on behalf of a caller
 // on the UI thread.
 class BrowsingDataAppCacheHelper
     : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> {
  public:
   using OriginAppCacheInfoMap =
-      std::map<url::Origin, content::AppCacheInfoVector>;
+      std::map<url::Origin, std::vector<blink::mojom::AppCacheInfo>>;
 
   using FetchCallback =
       base::OnceCallback<void(scoped_refptr<content::AppCacheInfoCollection>)>;
diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
index 223e863..edde15a1 100644
--- a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
 
 #include <set>
+#include <vector>
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
@@ -15,6 +16,7 @@
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "content/public/test/test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 
 namespace {
 class TestCompletionCallback {
@@ -73,7 +75,7 @@
                                    base::Unretained(&callback)));
   ASSERT_TRUE(callback.have_result());
 
-  std::map<url::Origin, content::AppCacheInfoVector>& collection =
+  std::map<url::Origin, std::vector<blink::mojom::AppCacheInfo>>& collection =
       callback.info_collection()->infos_by_origin;
 
   ASSERT_EQ(2u, collection.size());
@@ -106,7 +108,7 @@
                                    base::Unretained(&callback)));
   ASSERT_TRUE(callback.have_result());
 
-  std::map<url::Origin, content::AppCacheInfoVector>& collection =
+  std::map<url::Origin, std::vector<blink::mojom::AppCacheInfo>>& collection =
       callback.info_collection()->infos_by_origin;
 
   ASSERT_EQ(1u, collection.size());
diff --git a/chrome/browser/browsing_data/local_data_container.cc b/chrome/browser/browsing_data/local_data_container.cc
index c4cd2c3..11bfade 100644
--- a/chrome/browser/browsing_data/local_data_container.cc
+++ b/chrome/browser/browsing_data/local_data_container.cc
@@ -149,7 +149,6 @@
 void LocalDataContainer::OnAppCacheModelInfoLoaded(
     scoped_refptr<content::AppCacheInfoCollection> appcache_info) {
   using content::AppCacheInfoCollection;
-  using content::AppCacheInfoVector;
 
   if (!appcache_info.get() || appcache_info->infos_by_origin.empty()) {
     // This batch has been canceled, so let the model know it won't be arriving.
diff --git a/chrome/browser/browsing_data/mock_browsing_data_appcache_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_appcache_helper.cc
index 2edc6ad..f3b6e2d 100644
--- a/chrome/browser/browsing_data/mock_browsing_data_appcache_helper.cc
+++ b/chrome/browser/browsing_data/mock_browsing_data_appcache_helper.cc
@@ -4,6 +4,8 @@
 
 #include "chrome/browser/browsing_data/mock_browsing_data_appcache_helper.h"
 
+#include <vector>
+
 #include "base/callback.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
@@ -40,7 +42,7 @@
   mock_manifest_2.size = 2;
   mock_manifest_3.manifest_url = kOriginURL.Resolve("manifest3");
   mock_manifest_3.size = 3;
-  content::AppCacheInfoVector info_vector;
+  std::vector<blink::mojom::AppCacheInfo> info_vector;
   info_vector.push_back(mock_manifest_1);
   info_vector.push_back(mock_manifest_2);
   info_vector.push_back(mock_manifest_3);
diff --git a/chrome/browser/browsing_data/site_data_size_collector.cc b/chrome/browser/browsing_data/site_data_size_collector.cc
index 701a1ee..c621912 100644
--- a/chrome/browser/browsing_data/site_data_size_collector.cc
+++ b/chrome/browser/browsing_data/site_data_size_collector.cc
@@ -11,6 +11,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_usage_info.h"
 #include "content/public/common/content_constants.h"
+#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 
 namespace {
 
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 7388633..536ff03 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -178,6 +178,8 @@
 #include "chrome/grit/browser_resources.h"
 #include "chrome/grit/generated_resources.h"
 #include "chrome/installer/util/google_update_settings.h"
+#include "chrome/services/noop/public/cpp/utils.h"
+#include "chrome/services/noop/public/mojom/noop.mojom.h"
 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
 #include "components/autofill/core/common/autofill_switches.h"
 #include "components/browsing_data/core/browsing_data_utils.h"
@@ -328,6 +330,8 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/base/ui_base_features.h"
+#include "ui/native_theme/caption_style.h"
+#include "ui/native_theme/native_theme.h"
 #include "ui/resources/grit/ui_resources.h"
 #include "url/gurl.h"
 #include "url/origin.h"
@@ -3323,6 +3327,14 @@
 #endif  // !defined(OS_ANDROID)
 
   web_prefs->translate_service_available = TranslateService::IsAvailable(prefs);
+
+  // Apply native CaptionStyle parameters.
+  // TODO(ellyjones): Support more native caption styling.
+  ui::CaptionStyle style =
+      ui::NativeTheme::GetInstanceForWeb()->GetSystemCaptionStyle();
+  web_prefs->text_track_background_color = style.background_color;
+  web_prefs->text_track_text_color = style.text_color;
+
   for (size_t i = 0; i < extra_parts_.size(); ++i)
     extra_parts_[i]->OverrideWebkitPrefs(rvh, web_prefs);
 }
@@ -3767,6 +3779,11 @@
 
 void ChromeContentBrowserClient::RegisterOutOfProcessServices(
     OutOfProcessServiceMap* services) {
+  if (chrome::IsNoopServiceEnabled()) {
+    (*services)[chrome::mojom::kNoopServiceName] = base::BindRepeating(
+        &l10n_util::GetStringUTF16, IDS_UTILITY_PROCESS_NOOP_SERVICE_NAME);
+  }
+
 #if BUILDFLAG(ENABLE_ISOLATED_XR_SERVICE)
   (*services)[device::mojom::kVrIsolatedServiceName] = base::BindRepeating(
       &l10n_util::GetStringUTF16, IDS_ISOLATED_XR_PROCESS_NAME);
@@ -4496,18 +4513,15 @@
   }
 #endif  // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
 
-  if (network_service_enabled) {
-    ChromeNavigationUIData* chrome_navigation_ui_data =
-        static_cast<ChromeNavigationUIData*>(navigation_ui_data);
-    if (chrome_navigation_ui_data &&
-        chrome_navigation_ui_data->prerender_mode() !=
-            prerender::NO_PRERENDER) {
-      result.push_back(std::make_unique<prerender::PrerenderURLLoaderThrottle>(
-          chrome_navigation_ui_data->prerender_mode(),
-          chrome_navigation_ui_data->prerender_histogram_prefix(),
-          base::BindOnce(GetPrerenderCanceller, wc_getter),
-          base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI})));
-    }
+  ChromeNavigationUIData* chrome_navigation_ui_data =
+      static_cast<ChromeNavigationUIData*>(navigation_ui_data);
+  if (chrome_navigation_ui_data &&
+      chrome_navigation_ui_data->prerender_mode() != prerender::NO_PRERENDER) {
+    result.push_back(std::make_unique<prerender::PrerenderURLLoaderThrottle>(
+        chrome_navigation_ui_data->prerender_mode(),
+        chrome_navigation_ui_data->prerender_histogram_prefix(),
+        base::BindOnce(GetPrerenderCanceller, wc_getter),
+        base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI})));
   }
 
   if (io_data) {
@@ -4794,6 +4808,8 @@
 
 void ChromeContentBrowserClient::OnNetworkServiceCreated(
     network::mojom::NetworkService* network_service) {
+  chrome::MaybeStartNoopService();
+
   if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
     return;
 
diff --git a/chrome/browser/chrome_navigation_browsertest.cc b/chrome/browser/chrome_navigation_browsertest.cc
index 333df817..70c714f 100644
--- a/chrome/browser/chrome_navigation_browsertest.cc
+++ b/chrome/browser/chrome_navigation_browsertest.cc
@@ -23,6 +23,7 @@
 #include "chrome/test/base/ui_test_utils.h"
 #include "components/network_session_configurator/common/network_switches.h"
 #include "components/prefs/pref_service.h"
+#include "components/ukm/test_ukm_recorder.h"
 #include "components/url_formatter/url_formatter.h"
 #include "content/public/browser/download_manager_delegate.h"
 #include "content/public/browser/navigation_entry.h"
@@ -45,6 +46,7 @@
 #include "extensions/test/test_extension_dir.h"
 #include "google_apis/gaia/gaia_switches.h"
 #include "net/dns/mock_host_resolver.h"
+#include "services/metrics/public/cpp/ukm_builders.h"
 #include "services/network/public/cpp/features.h"
 
 class ChromeNavigationBrowserTest : public InProcessBrowserTest {
@@ -52,6 +54,11 @@
   ChromeNavigationBrowserTest() {}
   ~ChromeNavigationBrowserTest() override {}
 
+  void SetUp() override {
+    scoped_feature_list_.InitAndEnableFeature(ukm::kUkmFeature);
+    InProcessBrowserTest::SetUp();
+  }
+
   void SetUpCommandLine(base::CommandLine* command_line) override {
     // Backgrounded renderer processes run at a lower priority, causing the
     // tests to take more time to complete. Disable backgrounding so that the
@@ -66,6 +73,11 @@
     host_resolver()->AddRule("*", "127.0.0.1");
   }
 
+  void PreRunTestOnMainThread() override {
+    InProcessBrowserTest::PreRunTestOnMainThread();
+    test_ukm_recorder_ = std::make_unique<ukm::TestAutoSetUkmRecorder>();
+  }
+
   void StartServerWithExpiredCert() {
     expired_https_server_.reset(
         new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS));
@@ -79,8 +91,11 @@
     return expired_https_server_.get();
   }
 
+  std::unique_ptr<ukm::TestAutoSetUkmRecorder> test_ukm_recorder_;
+
  private:
   std::unique_ptr<net::EmbeddedTestServer> expired_https_server_;
+  base::test::ScopedFeatureList scoped_feature_list_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromeNavigationBrowserTest);
 };
@@ -1078,6 +1093,61 @@
   EXPECT_TRUE(open_web_contents->GetRenderWidgetHostView()->HasFocus());
 }
 
+// Tests the ukm entry logged when the navigation entry is marked as skippable
+// on back/forward button on doing a renderer initiated navigation without ever
+// getting a user activation.
+IN_PROC_BROWSER_TEST_F(ChromeNavigationBrowserTest,
+                       NoUserActivationSetSkipOnBackForward) {
+  GURL skippable_url(embedded_test_server()->GetURL("/title1.html"));
+  ui_test_utils::NavigateToURL(browser(), skippable_url);
+
+  GURL redirected_url(embedded_test_server()->GetURL("/title2.html"));
+  {
+    // Navigate to a new document from the renderer without a user gesture.
+    content::WebContents* main_contents =
+        browser()->tab_strip_model()->GetActiveWebContents();
+    content::TestNavigationObserver observer(main_contents);
+    EXPECT_TRUE(ExecuteScriptWithoutUserGesture(
+        main_contents, "location = '" + redirected_url.spec() + "';"));
+    observer.Wait();
+    EXPECT_EQ(redirected_url, main_contents->GetLastCommittedURL());
+  }
+
+  // Verify UKM.
+  using Entry = ukm::builders::HistoryManipulationIntervention;
+  const auto& ukm_entries =
+      test_ukm_recorder_->GetEntriesByName(Entry::kEntryName);
+  EXPECT_EQ(1u, ukm_entries.size());
+  test_ukm_recorder_->ExpectEntrySourceHasUrl(ukm_entries[0], skippable_url);
+}
+
+// Same as above except the navigation is cross-site.
+IN_PROC_BROWSER_TEST_F(ChromeNavigationBrowserTest,
+                       NoUserActivationSetSkipOnBackForwardCrossSite) {
+  GURL skippable_url(embedded_test_server()->GetURL("/title1.html"));
+  ui_test_utils::NavigateToURL(browser(), skippable_url);
+
+  GURL redirected_url(
+      embedded_test_server()->GetURL("foo.com", "/title2.html"));
+  {
+    // Navigate to a new document from the renderer without a user gesture.
+    content::WebContents* main_contents =
+        browser()->tab_strip_model()->GetActiveWebContents();
+    content::TestNavigationObserver observer(main_contents);
+    EXPECT_TRUE(ExecuteScriptWithoutUserGesture(
+        main_contents, "location = '" + redirected_url.spec() + "';"));
+    observer.Wait();
+    EXPECT_EQ(redirected_url, main_contents->GetLastCommittedURL());
+  }
+
+  // Verify UKM.
+  using Entry = ukm::builders::HistoryManipulationIntervention;
+  const auto& ukm_entries =
+      test_ukm_recorder_->GetEntriesByName(Entry::kEntryName);
+  EXPECT_EQ(1u, ukm_entries.size());
+  test_ukm_recorder_->ExpectEntrySourceHasUrl(ukm_entries[0], skippable_url);
+}
+
 // TODO(csharrison): These tests should become tentative WPT, once the feature
 // is enabled by default.
 using NavigationConsumingTest = ChromeNavigationBrowserTest;
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index e079598..6f8c5df 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -350,6 +350,81 @@
   EXPECT_EQ("z", speech_monitor_.GetNextUtterance());
 }
 
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, LauncherStateTransition) {
+  EnableChromeVox();
+
+  EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF));
+
+  while (true) {
+    std::string utterance = speech_monitor_.GetNextUtterance();
+    if (base::MatchPattern(utterance, "Launcher"))
+      break;
+  }
+
+  EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ("Shelf", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ("Tool bar", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ(", window", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ("Press Search plus Space to activate.",
+            speech_monitor_.GetNextUtterance());
+
+  // Press space on the launcher button in shelf, this opens peeking launcher.
+  SendKeyPressWithSearch(ui::VKEY_SPACE);
+  EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ(", window", speech_monitor_.GetNextUtterance());
+
+  // Check that Launcher, partial view state is announced.
+  EXPECT_EQ("Launcher, partial view", speech_monitor_.GetNextUtterance());
+
+  // Move focus to expand all apps button;
+  SendKeyPressWithSearchAndShift(ui::VKEY_TAB);
+  EXPECT_EQ("Expand to all apps", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
+  EXPECT_EQ("Press Search plus Space to activate.",
+            speech_monitor_.GetNextUtterance());
+
+  // Press space on expand arrow to go to fullscreen launcher.
+  SendKeyPressWithSearch(ui::VKEY_SPACE);
+  EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance());
+
+  // Check that Launcher, all apps state is announced.
+  EXPECT_EQ("Launcher, all apps", speech_monitor_.GetNextUtterance());
+}
+
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, DisabledFullscreenExpandButton) {
+  EnableChromeVox();
+
+  EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF));
+
+  while (speech_monitor_.GetNextUtterance() !=
+         "Press Search plus Space to activate.") {
+  }
+
+  // Press space on the launcher button in shelf, this opens peeking launcher.
+  SendKeyPressWithSearch(ui::VKEY_SPACE);
+  while (speech_monitor_.GetNextUtterance() != "Launcher, partial view") {
+  }
+
+  // Move focus to expand all apps button.
+  SendKeyPressWithSearchAndShift(ui::VKEY_TAB);
+  while (speech_monitor_.GetNextUtterance() !=
+         "Press Search plus Space to activate.") {
+  }
+
+  // Press space on expand arrow to go to fullscreen launcher.
+  SendKeyPressWithSearch(ui::VKEY_SPACE);
+  while (speech_monitor_.GetNextUtterance() != "Launcher, all apps") {
+  }
+
+  // Make sure the first traversal left is not the expand arrow button.
+  SendKeyPressWithSearch(ui::VKEY_LEFT);
+  EXPECT_NE("Expand to all apps", speech_monitor_.GetNextUtterance());
+
+  // Make sure the second traversal left is not the expand arrow button.
+  SendKeyPressWithSearch(ui::VKEY_LEFT);
+  EXPECT_NE("Expand to all apps", speech_monitor_.GetNextUtterance());
+}
+
 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) {
   EnableChromeVox();
 
diff --git a/chrome/browser/chromeos/account_manager/account_manager_migrator.cc b/chrome/browser/chromeos/account_manager/account_manager_migrator.cc
index d5a3c8c..f311448 100644
--- a/chrome/browser/chromeos/account_manager/account_manager_migrator.cc
+++ b/chrome/browser/chromeos/account_manager/account_manager_migrator.cc
@@ -30,11 +30,13 @@
 #include "chrome/browser/signin/account_tracker_service_factory.h"
 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
 #include "chrome/browser/web_data_service_factory.h"
+#include "chrome/common/pref_names.h"
 #include "chromeos/account_manager/account_manager.h"
 #include "chromeos/account_manager/account_manager_factory.h"
 #include "chromeos/constants/chromeos_switches.h"
 #include "components/account_id/account_id.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/prefs/pref_service.h"
 #include "components/signin/core/browser/account_reconcilor.h"
 #include "components/signin/core/browser/account_tracker_service.h"
 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
@@ -49,9 +51,13 @@
 constexpr char kDeviceAccountMigration[] = "DeviceAccountMigration";
 constexpr char kContentAreaAccountsMigration[] = "ContentAreaAccountsMigration";
 constexpr char kArcAccountsMigration[] = "ArcAccountsMigration";
+constexpr char kSuccessStorage[] = "SuccessStorage";
 constexpr char kMigrationResultMetricName[] =
     "AccountManager.Migrations.Result";
 
+// Maximum number of times migrations should be run.
+constexpr int kMaxMigrationRuns = 1;
+
 AccountManager::AccountKey GetDeviceAccount(const Profile* profile) {
   const user_manager::User* user =
       ProfileHelper::Get()->GetUserByProfile(profile);
@@ -66,7 +72,6 @@
           account_id.GetGaiaId(),
           account_manager::AccountType::ACCOUNT_TYPE_GAIA};
     case AccountType::UNKNOWN:
-      NOTREACHED();
       return AccountManager::AccountKey{
           std::string(),
           account_manager::AccountType::ACCOUNT_TYPE_UNSPECIFIED};
@@ -417,6 +422,34 @@
   DISALLOW_COPY_AND_ASSIGN(ArcAccountsMigration);
 };
 
+// Stores a successful migration run in Prefs.
+// This MUST be the last |Step| of the migration run.
+// |AccountMigrationRunner::Step|s are run only if the previous
+// |AccountMigrationRunner::Step| was successful. The fact that this step is
+// being run implies that the "real" migration steps ran successfully.
+class SuccessStorage : public AccountMigrationRunner::Step {
+ public:
+  explicit SuccessStorage(PrefService* pref_service)
+      : AccountMigrationRunner::Step(kSuccessStorage),
+        pref_service_(pref_service) {}
+  ~SuccessStorage() override = default;
+
+  void Run() override {
+    const int num_times_ran_successfully = pref_service_->GetInteger(
+        prefs::kAccountManagerNumTimesMigrationRanSuccessfully);
+    pref_service_->SetInteger(
+        prefs::kAccountManagerNumTimesMigrationRanSuccessfully,
+        num_times_ran_successfully + 1);
+    FinishWithSuccess();
+  }
+
+ private:
+  // A non-owning pointer.
+  PrefService* const pref_service_;
+
+  DISALLOW_COPY_AND_ASSIGN(SuccessStorage);
+};
+
 }  // namespace
 
 AccountManagerMigrator::AccountManagerMigrator(Profile* profile)
@@ -447,15 +480,32 @@
 bool AccountManagerMigrator::ShouldRunMigrations() const {
   // Account migration does not make sense for ephemeral (Guest, Managed
   // Session, Kiosk, Demo etc.) sessions.
-  if (user_manager::UserManager::Get()->IsCurrentUserCryptohomeDataEphemeral())
+  if (user_manager::UserManager::Get()
+          ->IsCurrentUserCryptohomeDataEphemeral()) {
+    VLOG(1) << "Skipping migrations for ephemeral session";
     return false;
+  }
 
-  // TODO(https://crbug.com/923947): Check success state from Preferences.
+  if (profile_->GetPrefs()->GetInteger(
+          prefs::kAccountManagerNumTimesMigrationRanSuccessfully) >=
+      kMaxMigrationRuns) {
+    VLOG(1) << "Skipping migrations because of previous successful runs";
+    return false;
+  }
 
   return true;
 }
 
 void AccountManagerMigrator::AddMigrationSteps() {
+  const AccountManager::AccountKey device_account = GetDeviceAccount(profile_);
+  if (device_account.account_type ==
+      account_manager::AccountType::ACCOUNT_TYPE_UNSPECIFIED) {
+    // Unfortunately this is a valid case for tests. See
+    // https://crbug.com/915628. Early exit here because if the Device Account
+    // itself is invalid, we should not attempt any migration.
+    return;
+  }
+
   chromeos::AccountManagerFactory* factory =
       g_browser_process->platform_part()->GetAccountManagerFactory();
   chromeos::AccountManager* account_manager =
@@ -465,7 +515,7 @@
       AccountTrackerServiceFactory::GetForProfile(profile_);
 
   migration_runner_.AddStep(std::make_unique<DeviceAccountMigration>(
-      GetDeviceAccount(profile_), account_manager, account_tracker_service,
+      device_account, account_manager, account_tracker_service,
       WebDataServiceFactory::GetTokenWebDataForProfile(
           profile_, ServiceAccessType::EXPLICIT_ACCESS) /* token_web_data */));
   migration_runner_.AddStep(std::make_unique<ContentAreaAccountsMigration>(
@@ -486,7 +536,11 @@
                "provisioned yet";
   }
 
-  // TODO(https://crbug.com/923947): Store success state in Preferences.
+  // This MUST be the last step. Check the class level documentation of
+  // |SuccessStorage| for the reason.
+  migration_runner_.AddStep(
+      std::make_unique<SuccessStorage>(profile_->GetPrefs()));
+
   // TODO(sinhak): Verify Device Account LST state.
 }
 
diff --git a/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc b/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
index e97cca7..6b2adabf 100644
--- a/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
+++ b/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
@@ -450,7 +450,6 @@
           tracing::mojom::TraceDataType::ARRAY,
           base::kNullProcessId),
       bridge_(bridge) {
-  Connect(content::ServiceManagerConnection::GetForProcess()->GetConnector());
 }
 
 ArcTracingBridge::ArcTracingAgent::~ArcTracingAgent() = default;
diff --git a/chrome/browser/chromeos/child_accounts/screen_time_controller.cc b/chrome/browser/chromeos/child_accounts/screen_time_controller.cc
index df7a83d..86dd69d 100644
--- a/chrome/browser/chromeos/child_accounts/screen_time_controller.cc
+++ b/chrome/browser/chromeos/child_accounts/screen_time_controller.cc
@@ -82,9 +82,11 @@
 
 void ScreenTimeController::SetClocksForTesting(
     const base::Clock* clock,
-    const base::TickClock* tick_clock) {
+    const base::TickClock* tick_clock,
+    scoped_refptr<base::SequencedTaskRunner> task_runner) {
   clock_ = clock;
   next_state_timer_ = std::make_unique<base::OneShotTimer>(tick_clock);
+  next_state_timer_->SetTaskRunner(task_runner);
 }
 
 void ScreenTimeController::CheckTimeLimit(const std::string& source) {
diff --git a/chrome/browser/chromeos/child_accounts/screen_time_controller.h b/chrome/browser/chromeos/child_accounts/screen_time_controller.h
index 0689af1..b8a8005 100644
--- a/chrome/browser/chromeos/child_accounts/screen_time_controller.h
+++ b/chrome/browser/chromeos/child_accounts/screen_time_controller.h
@@ -7,6 +7,7 @@
 
 #include <memory>
 
+#include "base/memory/scoped_refptr.h"
 #include "base/time/time.h"
 #include "chrome/browser/chromeos/child_accounts/time_limit_notifier.h"
 #include "chrome/browser/chromeos/child_accounts/usage_time_limit_processor.h"
@@ -22,6 +23,7 @@
 class Clock;
 class TickClock;
 class OneShotTimer;
+class SequencedTaskRunner;
 }  // namespace base
 
 namespace content {
@@ -49,8 +51,11 @@
   // used the device today (since the last reset).
   base::TimeDelta GetScreenTimeDuration();
 
-  void SetClocksForTesting(const base::Clock* clock,
-                           const base::TickClock* tick_clock);
+  // Method intended for testing purposes only.
+  void SetClocksForTesting(
+      const base::Clock* clock,
+      const base::TickClock* tick_clock,
+      scoped_refptr<base::SequencedTaskRunner> task_runner);
 
  private:
   // Call time limit processor for new state.
diff --git a/chrome/browser/chromeos/child_accounts/screen_time_controller_browsertest.cc b/chrome/browser/chromeos/child_accounts/screen_time_controller_browsertest.cc
index 8ff41c1..c1a73b19 100644
--- a/chrome/browser/chromeos/child_accounts/screen_time_controller_browsertest.cc
+++ b/chrome/browser/chromeos/child_accounts/screen_time_controller_browsertest.cc
@@ -8,6 +8,7 @@
 
 #include "base/memory/scoped_refptr.h"
 #include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/test/test_mock_time_task_runner.h"
 #include "base/time/time.h"
 #include "base/values.h"
@@ -16,32 +17,24 @@
 #include "chrome/browser/chromeos/child_accounts/screen_time_controller.h"
 #include "chrome/browser/chromeos/child_accounts/screen_time_controller_factory.h"
 #include "chrome/browser/chromeos/child_accounts/time_limit_test_utils.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker_tester.h"
 #include "chrome/browser/chromeos/policy/user_policy_test_helper.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/common/pref_names.h"
 #include "components/policy/core/browser/browser_policy_connector.h"
+#include "components/prefs/pref_service.h"
 #include "components/session_manager/core/session_manager.h"
 #include "content/public/browser/notification_service.h"
 
 namespace chromeos {
-namespace {
-
-void WaitForScreenLock() {
-  content::WindowedNotificationObserver lock_state_observer(
-      chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
-      content::NotificationService::AllSources());
-  lock_state_observer.Wait();
-}
-
-}  // namespace
-
 namespace utils = time_limit_test_utils;
 
 class ScreenTimeControllerTest : public policy::LoginPolicyTestBase {
  public:
   ScreenTimeControllerTest() {
-    base::Time start_time;
-    EXPECT_TRUE(base::Time::FromUTCString("1 Jan 2018 10:00:00", &start_time));
+    base::Time start_time = utils::TimeFromString("1 Jan 2018 10:00:00 GMT");
     task_runner_ = base::MakeRefCounted<base::TestMockTimeTaskRunner>(
         start_time, base::TimeTicks::UnixEpoch());
   }
@@ -82,7 +75,19 @@
     // Mock time for ScreenTimeController.
     ScreenTimeControllerFactory::GetForBrowserContext(child_profile_)
         ->SetClocksForTesting(task_runner_->GetMockClock(),
-                              task_runner_->GetMockTickClock());
+                              task_runner_->GetMockTickClock(), task_runner_);
+  }
+
+  bool IsAuthEnabled() {
+    return ScreenLocker::default_screen_locker()->IsAuthEnabledForUser(
+        AccountId::FromUserEmail(kAccountId));
+  }
+
+  void MockChildScreenTime(base::TimeDelta used_time) {
+    Profile::FromBrowserContext(child_profile_)
+        ->GetPrefs()
+        ->SetInteger(prefs::kChildScreenTimeMilliseconds,
+                     used_time.InMilliseconds());
   }
 
   scoped_refptr<base::TestMockTimeTaskRunner> task_runner_;
@@ -98,13 +103,16 @@
   SkipToLoginScreen();
   LogIn(kAccountId, kAccountPassword, test::kChildAccountServiceFlags);
   MockClockForActiveUser();
+  std::unique_ptr<chromeos::ScreenLockerTester> tester =
+      chromeos::ScreenLockerTester::Create();
+  tester->Lock();
 
-  // Verify screen is unlocked.
-  EXPECT_FALSE(session_manager::SessionManager::Get()->IsScreenLocked());
+  // Verify user is able to log in.
+  EXPECT_TRUE(IsAuthEnabled());
 
   // Wait one hour.
   task_runner_->FastForwardBy(base::TimeDelta::FromHours(1));
-  EXPECT_FALSE(session_manager::SessionManager::Get()->IsScreenLocked());
+  EXPECT_TRUE(IsAuthEnabled());
 
   // Set new policy.
   std::unique_ptr<base::DictionaryValue> policy_content =
@@ -118,8 +126,144 @@
   user_policy_helper()->UpdatePolicy(*policy, base::DictionaryValue(),
                                      child_profile_);
 
-  WaitForScreenLock();
-  EXPECT_TRUE(session_manager::SessionManager::Get()->IsScreenLocked());
+  EXPECT_FALSE(IsAuthEnabled());
+}
+
+// Tests the default time window limit.
+IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, DefaultBedtime) {
+  SkipToLoginScreen();
+  LogIn(kAccountId, kAccountPassword, test::kChildAccountServiceFlags);
+  MockClockForActiveUser();
+  std::unique_ptr<chromeos::ScreenLockerTester> tester =
+      chromeos::ScreenLockerTester::Create();
+  tester->Lock();
+
+  system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
+      base::UTF8ToUTF16("GMT"));
+
+  // Set new policy.
+  base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
+  std::unique_ptr<base::DictionaryValue> policy_content =
+      utils::CreateTimeLimitPolicy(utils::CreateTime(6, 0));
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kMonday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kTuesday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kWednesday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kThursday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kFriday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kSaturday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+  utils::AddTimeWindowLimit(policy_content.get(), utils::kSunday,
+                            utils::CreateTime(21, 0), utils::CreateTime(7, 0),
+                            last_updated);
+
+  auto policy = std::make_unique<base::DictionaryValue>();
+  policy->SetKey("UsageTimeLimit",
+                 base::Value(utils::PolicyToString(policy_content.get())));
+
+  user_policy_helper()->UpdatePolicy(*policy, base::DictionaryValue(),
+                                     child_profile_);
+
+  // Iterate over a week checking that the device is locked properly everyday.
+  for (int i = 0; i < 7; i++) {
+    // Verify that auth is enabled at 10 AM.
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Verify that auth is enabled at 8 PM.
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(10));
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Verify that the auth was disabled at 9 PM (start of bedtime).
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(1));
+    EXPECT_FALSE(IsAuthEnabled());
+
+    // Forward to 7 AM and check that auth was re-enabled (end of bedtime).
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(10));
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Forward to 10 AM.
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(3));
+  }
+}
+
+// Tests the default time window limit.
+IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, DefaultDailyLimit) {
+  SkipToLoginScreen();
+  LogIn(kAccountId, kAccountPassword, test::kChildAccountServiceFlags);
+  MockClockForActiveUser();
+  std::unique_ptr<chromeos::ScreenLockerTester> tester =
+      chromeos::ScreenLockerTester::Create();
+  tester->Lock();
+
+  system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
+      base::UTF8ToUTF16("GMT"));
+
+  // Set new policy.
+  base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
+  std::unique_ptr<base::DictionaryValue> policy_content =
+      utils::CreateTimeLimitPolicy(utils::CreateTime(6, 0));
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kMonday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kTuesday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kWednesday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kThursday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kFriday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kSaturday,
+                           base::TimeDelta::FromHours(3), last_updated);
+  utils::AddTimeUsageLimit(policy_content.get(), utils::kSunday,
+                           base::TimeDelta::FromHours(3), last_updated);
+
+  auto policy = std::make_unique<base::DictionaryValue>();
+  policy->SetKey("UsageTimeLimit",
+                 base::Value(utils::PolicyToString(policy_content.get())));
+
+  user_policy_helper()->UpdatePolicy(*policy, base::DictionaryValue(),
+                                     child_profile_);
+
+  // Iterate over a week checking that the device is locked properly
+  // every day.
+  for (int i = 0; i < 7; i++) {
+    // Check that auth is enabled at 10 AM with 0 usage time.
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Check that auth is enabled after forwarding to 1 PM and using the device
+    // for 2 hours.
+    MockChildScreenTime(base::TimeDelta::FromHours(2));
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(3));
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Check that auth is enabled after forwarding to 2 PM with no extra usage.
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(1));
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Check that auth is disabled after forwarding to 3 PM and using the device
+    // for 3 hours.
+    MockChildScreenTime(base::TimeDelta::FromHours(3));
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(1));
+    EXPECT_FALSE(IsAuthEnabled());
+
+    // Forward to 6 AM, reset the usage time and check that auth was re-enabled.
+    MockChildScreenTime(base::TimeDelta::FromHours(0));
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(15));
+    EXPECT_TRUE(IsAuthEnabled());
+
+    // Forward to 10 AM.
+    task_runner_->FastForwardBy(base::TimeDelta::FromHours(4));
+  }
 }
 
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.cc b/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.cc
index 27a3a02..afe3006 100644
--- a/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.cc
+++ b/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.cc
@@ -228,16 +228,12 @@
     return;
   removal_in_progress_ = true;
 
-  // Report this metric only once per resources directory removal task.
-  // Concurrent removal requests should not be reported multiple times.
-  UMA_HISTOGRAM_ENUMERATION("DemoMode.ResourcesRemoval.Reason", reason);
-
   base::PostTaskWithTraitsAndReplyWithResult(
       FROM_HERE,
       {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
       base::BindOnce(&RemoveDirectory, DemoResources::GetPreInstalledPath()),
       base::BindOnce(&DemoModeResourcesRemover::OnRemovalDone,
-                     weak_ptr_factory_.GetWeakPtr()));
+                     weak_ptr_factory_.GetWeakPtr(), reason));
 }
 
 void DemoModeResourcesRemover::OverrideTimeForTesting(
@@ -292,7 +288,8 @@
   return true;
 }
 
-void DemoModeResourcesRemover::OnRemovalDone(RemovalResult result) {
+void DemoModeResourcesRemover::OnRemovalDone(RemovalReason reason,
+                                             RemovalResult result) {
   DCHECK(removal_in_progress_);
   removal_in_progress_ = false;
 
@@ -308,7 +305,14 @@
     usage_end_ = base::nullopt;
   }
 
-  UMA_HISTOGRAM_ENUMERATION("DemoMode.ResourcesRemoval.Result", result);
+  // Only report metrics when the resources were found; otherwise this is
+  // reported on almost every sign-in.
+  // Only report metrics once per resources directory removal task.
+  // Concurrent removal requests should not be reported multiple times.
+  if (result == RemovalResult::kSuccess || result == RemovalResult::kFailed) {
+    UMA_HISTOGRAM_ENUMERATION("DemoMode.ResourcesRemoval.Reason", reason);
+    UMA_HISTOGRAM_ENUMERATION("DemoMode.ResourcesRemoval.Result", result);
+  }
 
   std::vector<RemovalCallback> callbacks;
   callbacks.swap(removal_callbacks_);
diff --git a/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.h b/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.h
index 0808e82..b566a42 100644
--- a/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.h
+++ b/chrome/browser/chromeos/login/demo_mode/demo_mode_resources_remover.h
@@ -173,7 +173,7 @@
   bool AttemptRemovalIfUsageOverThreshold();
 
   // Passes as the callback to directory removal file operations.
-  void OnRemovalDone(RemovalResult result);
+  void OnRemovalDone(RemovalReason reason, RemovalResult result);
 
   PrefService* const local_state_;
 
diff --git a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
index 8bc8002..557e0e4 100644
--- a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
+++ b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
@@ -4,6 +4,8 @@
 
 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/location.h"
@@ -98,7 +100,7 @@
     bool fetch_additional_token) {
   DCHECK(oauth_status_ == OAUTH_NOT_STARTED);
   oauth_status_ = OAUTH_STARTED_WITH_AUTH_CODE;
-  oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance());
+  oauth_fetcher_ = policy::PolicyOAuth2TokenFetcher::CreateInstance();
   oauth_fetcher_->StartWithAuthCode(
       auth_code,
       g_browser_process->system_network_context_manager()
@@ -350,7 +352,7 @@
 
   additional_token_ = token;
   std::string refresh_token = oauth_fetcher_->OAuth2RefreshToken();
-  oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance());
+  oauth_fetcher_ = policy::PolicyOAuth2TokenFetcher::CreateInstance();
   oauth_fetcher_->StartWithRefreshToken(
       refresh_token,
       g_browser_process->system_network_context_manager()
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index d4bad11b..d03ff1dbe 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -620,6 +620,10 @@
     login::SaveSyncPasswordDataToProfile(user_context, profile);
 }
 
+bool ScreenLocker::IsAuthEnabledForUser(const AccountId& account_id) {
+  return !base::ContainsKey(users_with_disabled_auth_, account_id);
+}
+
 void ScreenLocker::SetAuthenticatorsForTesting(
     scoped_refptr<Authenticator> authenticator,
     scoped_refptr<ExtendedAuthenticator> extended_authenticator) {
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.h b/chrome/browser/chromeos/login/lock/screen_locker.h
index 9c7ff74..9bfc0d5 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.h
+++ b/chrome/browser/chromeos/login/lock/screen_locker.h
@@ -175,6 +175,10 @@
   // |user_context|.
   void SaveSyncPasswordHash(const UserContext& user_context);
 
+  // Ruturns true if authentication is enabled on the lock screen for the given
+  // user.
+  bool IsAuthEnabledForUser(const AccountId& account_id);
+
   // Change the authenticators; should only be used by tests.
   void SetAuthenticatorsForTesting(
       scoped_refptr<Authenticator> authenticator,
diff --git a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
index 17c67e5..88fcc25 100644
--- a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
+++ b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
@@ -26,7 +26,6 @@
 #include "chrome/browser/chromeos/login/wizard_controller.h"
 #include "chrome/browser/extensions/chrome_extension_test_notification_observer.h"
 #include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/signin/account_tracker_service_factory.h"
 #include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
 #include "chrome/browser/ui/browser.h"
@@ -97,8 +96,9 @@
 std::string PickAccountId(Profile* profile,
                           const std::string& gaia_id,
                           const std::string& email) {
-  return AccountTrackerService::PickAccountIdForAccount(profile->GetPrefs(),
-                                                        gaia_id, email);
+  return IdentityManagerFactory::GetInstance()
+      ->GetForProfile(profile)
+      ->LegacyPickAccountIdForAccount(gaia_id, email);
 }
 
 class OAuth2LoginManagerStateWaiter : public OAuth2LoginManager::Observer {
@@ -663,10 +663,12 @@
                       /*is_under_advanced_protection=*/true);
 
   // Verify that AccountInfo is properly updated.
-  AccountTrackerService* account_tracker =
-      AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile());
+  auto* identity_manager =
+      IdentityManagerFactory::GetInstance()->GetForProfile(profile());
   EXPECT_TRUE(
-      account_tracker->GetAccountInfo(kTestEmail).is_under_advanced_protection);
+      identity_manager
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(kTestEmail)
+          ->is_under_advanced_protection);
 }
 
 IN_PROC_BROWSER_TEST_F(OAuth2Test,
@@ -675,10 +677,12 @@
                       /*is_under_advanced_protection=*/false);
 
   // Verify that AccountInfo is properly updated.
-  AccountTrackerService* account_tracker =
-      AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile());
+  auto* identity_manager =
+      IdentityManagerFactory::GetInstance()->GetForProfile(profile());
   EXPECT_FALSE(
-      account_tracker->GetAccountInfo(kTestEmail).is_under_advanced_protection);
+      identity_manager
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(kTestEmail)
+          ->is_under_advanced_protection);
 }
 
 // Sets up a new user with stored refresh token.
diff --git a/chrome/browser/chromeos/ownership/fake_owner_settings_service.cc b/chrome/browser/chromeos/ownership/fake_owner_settings_service.cc
index 32c2aa26..30990ae6 100644
--- a/chrome/browser/chromeos/ownership/fake_owner_settings_service.cc
+++ b/chrome/browser/chromeos/ownership/fake_owner_settings_service.cc
@@ -5,27 +5,31 @@
 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h"
 
 #include "base/logging.h"
+#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h"
 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chromeos/tpm/install_attributes.h"
 #include "components/ownership/mock_owner_key_util.h"
 
 namespace chromeos {
 
-FakeOwnerSettingsService::FakeOwnerSettingsService(Profile* profile)
-    : OwnerSettingsServiceChromeOS(nullptr,
-                                   profile,
-                                   new ownership::MockOwnerKeyUtil()),
-      settings_provider_(nullptr) {
-}
+FakeOwnerSettingsService::FakeOwnerSettingsService(
+    StubCrosSettingsProvider* provider,
+    Profile* profile)
+    : OwnerSettingsServiceChromeOS(
+          /* device_settings_service= */ nullptr,
+          profile,
+          OwnerSettingsServiceChromeOSFactory::GetInstance()
+              ->GetOwnerKeyUtil()),
+      set_management_settings_result_(true),
+      settings_provider_(provider) {}
 
 FakeOwnerSettingsService::FakeOwnerSettingsService(
+    StubCrosSettingsProvider* provider,
     Profile* profile,
-    const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util,
-    StubCrosSettingsProvider* provider)
+    const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util)
     : OwnerSettingsServiceChromeOS(nullptr, profile, owner_key_util),
       set_management_settings_result_(true),
-      settings_provider_(provider) {
-}
+      settings_provider_(provider) {}
 
 FakeOwnerSettingsService::~FakeOwnerSettingsService() {
 }
diff --git a/chrome/browser/chromeos/ownership/fake_owner_settings_service.h b/chrome/browser/chromeos/ownership/fake_owner_settings_service.h
index 7f952b8..59ccc1e 100644
--- a/chrome/browser/chromeos/ownership/fake_owner_settings_service.h
+++ b/chrome/browser/chromeos/ownership/fake_owner_settings_service.h
@@ -21,11 +21,13 @@
 
 class FakeOwnerSettingsService : public OwnerSettingsServiceChromeOS {
  public:
-  explicit FakeOwnerSettingsService(Profile* profile);
+  FakeOwnerSettingsService(StubCrosSettingsProvider* provider,
+                           Profile* profile);
   FakeOwnerSettingsService(
+      StubCrosSettingsProvider* provider,
       Profile* profile,
-      const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util,
-      StubCrosSettingsProvider* provider);
+      const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util);
+
   ~FakeOwnerSettingsService() override;
 
   void set_set_management_settings_result(bool success) {
diff --git a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.cc b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.cc
index 0e51a3a1..aa1e343 100644
--- a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.cc
+++ b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.cc
@@ -101,8 +101,8 @@
   // This is done using the FakeOwnerSettingsService.
   if (g_stub_cros_settings_provider_for_testing_ != nullptr) {
     return new FakeOwnerSettingsService(
-        profile, GetInstance()->GetOwnerKeyUtil(),
-        g_stub_cros_settings_provider_for_testing_);
+        g_stub_cros_settings_provider_for_testing_, profile,
+        GetInstance()->GetOwnerKeyUtil());
   }
 
   return new OwnerSettingsServiceChromeOS(
diff --git a/chrome/browser/chromeos/policy/bluetooth_policy_handler_unittest.cc b/chrome/browser/chromeos/policy/bluetooth_policy_handler_unittest.cc
index 5355be2..0959080 100644
--- a/chrome/browser/chromeos/policy/bluetooth_policy_handler_unittest.cc
+++ b/chrome/browser/chromeos/policy/bluetooth_policy_handler_unittest.cc
@@ -5,7 +5,8 @@
 #include "chrome/browser/chromeos/policy/bluetooth_policy_handler.h"
 
 #include "base/test/scoped_task_environment.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "device/bluetooth/bluetooth_adapter_factory.h"
 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -34,41 +35,45 @@
   // testing::Test
   void SetUp() override {
     testing::Test::SetUp();
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
     device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_);
   }
 
   void TearDown() override {}
 
  protected:
+  void SetAllowBluetooth(bool allow_bluetooth) {
+    scoped_testing_cros_settings_.device_settings()->SetBoolean(
+        chromeos::kAllowBluetooth, allow_bluetooth);
+  }
+
   base::test::ScopedTaskEnvironment scoped_task_environment_;
   scoped_refptr<TestingBluetoothAdapter> adapter_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
 };
 
 TEST_F(BluetoothPolicyHandlerTest, TestZeroOnOffOn) {
   BluetoothPolicyHandler shutdown_policy_handler(chromeos::CrosSettings::Get());
   EXPECT_TRUE(adapter_->IsPresent());
 
-  settings_helper_.SetBoolean(chromeos::kAllowBluetooth, true);
+  SetAllowBluetooth(true);
   EXPECT_TRUE(adapter_->IsPresent());
 
-  settings_helper_.SetBoolean(chromeos::kAllowBluetooth, false);
+  SetAllowBluetooth(false);
   EXPECT_FALSE(adapter_->IsPresent());
 
   // Once the Bluetooth stack goes down, it needs a reboot to come back up.
-  settings_helper_.SetBoolean(chromeos::kAllowBluetooth, true);
+  SetAllowBluetooth(true);
   EXPECT_FALSE(adapter_->IsPresent());
 }
 
 TEST_F(BluetoothPolicyHandlerTest, OffDuringStartup) {
-  settings_helper_.SetBoolean(chromeos::kAllowBluetooth, false);
+  SetAllowBluetooth(false);
   BluetoothPolicyHandler shutdown_policy_handler(chromeos::CrosSettings::Get());
   EXPECT_FALSE(adapter_->IsPresent());
 }
 
 TEST_F(BluetoothPolicyHandlerTest, OnDuringStartup) {
-  settings_helper_.SetBoolean(chromeos::kAllowBluetooth, true);
+  SetAllowBluetooth(true);
   BluetoothPolicyHandler shutdown_policy_handler(chromeos::CrosSettings::Get());
   EXPECT_TRUE(adapter_->IsPresent());
 }
diff --git a/chrome/browser/chromeos/policy/device_auto_update_time_restrictions_utils_unittest.cc b/chrome/browser/chromeos/policy/device_auto_update_time_restrictions_utils_unittest.cc
index e1ab4aa..be9b9c98 100644
--- a/chrome/browser/chromeos/policy/device_auto_update_time_restrictions_utils_unittest.cc
+++ b/chrome/browser/chromeos/policy/device_auto_update_time_restrictions_utils_unittest.cc
@@ -12,9 +12,10 @@
 #include "base/test/simple_test_clock.h"
 #include "base/time/time.h"
 #include "base/values.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chromeos/policy/weekly_time/weekly_time.h"
 #include "chromeos/policy/weekly_time/weekly_time_interval.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
 #include "chromeos/settings/cros_settings_names.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/icu/source/i18n/unicode/timezone.h"
@@ -81,11 +82,6 @@
 
   void TearDown() override { icu::TimeZone::adoptDefault(timezone_.release()); }
 
-  void SetCrosSettings(const std::string& path, const Value& in_value) {
-    cros_settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-    cros_settings_helper_.Set(path, in_value);
-  }
-
   ListValue GetIntervalsAsList(const vector<WeeklyTimeInterval>& intervals) {
     ListValue list_val;
     for (const auto& interval : intervals) {
@@ -118,11 +114,11 @@
   }
 
   base::SimpleTestClock test_clock_;
+  // These initialize CrosSettings and then tear down when the test is done.
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
 
  private:
   std::unique_ptr<icu::TimeZone> timezone_;
-  // These initialize CrosSettings and then tear down when the test is done.
-  chromeos::ScopedCrosSettingsTestHelper cros_settings_helper_;
 };
 
 TEST_F(DeviceAutoUpdateTimeRestrictionsUtilTest,
@@ -135,8 +131,9 @@
           WeeklyTime(kWednesday, 10 * kMillisecondsInHour, kNewYorkOffset),
           WeeklyTime(kWednesday, 15 * kMillisecondsInHour, kNewYorkOffset))};
 
-  SetCrosSettings(chromeos::kDeviceAutoUpdateTimeRestrictions,
-                  GetIntervalsAsList(kExpected));
+  scoped_testing_cros_settings_.device_settings()->Set(
+      chromeos::kDeviceAutoUpdateTimeRestrictions,
+      GetIntervalsAsList(kExpected));
 
   vector<WeeklyTimeInterval> result;
   ASSERT_TRUE(GetDeviceAutoUpdateTimeRestrictionsIntervalsInLocalTimezone(
diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
index 51fe894..6f5294c 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector.cc
@@ -1485,6 +1485,14 @@
     }
   }
 
+  if (prop.has_battery_percent() && prop.battery_percent() >= 0) {
+    int percent = static_cast<int>(prop.battery_percent());
+    for (auto it = sample->battery_samples.begin();
+         it != sample->battery_samples.end(); it++) {
+      it->second.set_charge_rate(percent);
+    }
+  }
+
   base::PostTaskWithTraitsAndReplyWithResult(
       FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
       base::BindOnce(&InvokeCpuTempFetcher, cpu_temp_fetcher_),
diff --git a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
index 502b5c3..559ca71 100644
--- a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
@@ -34,7 +34,8 @@
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
 #include "chrome/browser/chromeos/policy/device_local_account.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chrome/browser/chromeos/settings/stub_install_attributes.h"
 #include "chrome/common/chrome_content_client.h"
 #include "chrome/common/chrome_features.h"
@@ -63,6 +64,7 @@
 #include "chromeos/settings/timezone_settings.h"
 #include "chromeos/system/fake_statistics_provider.h"
 #include "components/account_id/account_id.h"
+#include "components/ownership/mock_owner_key_util.h"
 #include "components/policy/proto/device_management_backend.pb.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/pref_service.h"
@@ -341,8 +343,8 @@
                                              kArcKioskAccountId),
         user_data_dir_override_(chrome::DIR_USER_DATA),
         update_engine_client_(new chromeos::FakeUpdateEngineClient) {
-    settings_helper_.InstallAttributes()->SetCloudManaged("managed.com",
-                                                          "device_id");
+    scoped_stub_install_attributes_.Get()->SetCloudManaged("managed.com",
+                                                           "device_id");
     EXPECT_CALL(*user_manager_, Shutdown()).Times(1);
 
     // Although this is really a unit test which runs in the browser_tests
@@ -386,10 +388,7 @@
     TestingDeviceStatusCollector::RegisterProfilePrefs(
         profile_pref_service_.registry());
 
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-    owner_settings_service_ =
-        settings_helper_.CreateOwnerSettingsService(nullptr);
-    owner_settings_service_->set_ignore_profile_creation_notification(true);
+    owner_settings_service_.set_ignore_profile_creation_notification(true);
 
     // Set up a fake local state for KioskAppManager.
     TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_);
@@ -429,12 +428,8 @@
                            base::BindRepeating(&GetEmptyTpmStatus));
 
     // Disable network interface reporting since it requires additional setup.
-    settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces,
-                                false);
-  }
-
-  void TearDown() override {
-    settings_helper_.RestoreRealDeviceSettingsProvider();
+    scoped_testing_cros_settings_.device_settings()->SetBoolean(
+        chromeos::kReportDeviceNetworkInterfaces, false);
   }
 
  protected:
@@ -582,7 +577,7 @@
     chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(
         user, testing_profile_.get());
 
-    SetDeviceLocalAccounts(owner_settings_service_.get(), accounts);
+    SetDeviceLocalAccounts(&owner_settings_service_, accounts);
   }
 
   void MockPlatformVersion(const std::string& platform_version) {
@@ -605,9 +600,9 @@
 
     std::vector<DeviceLocalAccount> accounts;
     accounts.push_back(auto_launch_app_account);
-    SetDeviceLocalAccounts(owner_settings_service_.get(), accounts);
+    SetDeviceLocalAccounts(&owner_settings_service_, accounts);
 
-    owner_settings_service_->SetString(
+    owner_settings_service_.SetString(
         chromeos::kAccountsPrefDeviceLocalAccountAutoLoginId,
         auto_launch_app_account.account_id);
 
@@ -627,9 +622,9 @@
 
     std::vector<DeviceLocalAccount> accounts;
     accounts.push_back(auto_launch_app_account);
-    SetDeviceLocalAccounts(owner_settings_service_.get(), accounts);
+    SetDeviceLocalAccounts(&owner_settings_service_, accounts);
 
-    owner_settings_service_->SetString(
+    owner_settings_service_.SetString(
         chromeos::kAccountsPrefDeviceLocalAccountAutoLoginId,
         auto_launch_app_account.account_id);
 
@@ -650,9 +645,10 @@
   ChromeContentBrowserClient browser_content_client_;
   chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_;
   DiskMountManager::MountPointMap mount_point_map_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
-  // Only set after MockRunningKioskApp or MockTODO was called.
-  std::unique_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_;
+  chromeos::ScopedStubInstallAttributes scoped_stub_install_attributes_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
+  chromeos::FakeOwnerSettingsService owner_settings_service_{
+      scoped_testing_cros_settings_.device_settings(), nullptr};
   // Only set after MockRunningKioskApp was called.
   std::unique_ptr<TestingProfile> testing_profile_;
   // Only set after MockAutoLaunchArcKioskApp was called.
@@ -686,7 +682,8 @@
     ui::IDLE_STATE_IDLE,
     ui::IDLE_STATE_IDLE
   };
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
 
   // Test reporting with no data.
   GetStatus();
@@ -713,7 +710,8 @@
     ui::IDLE_STATE_ACTIVE,
     ui::IDLE_STATE_ACTIVE
   };
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
 
   // Test a single active sample.
   status_collector_->Simulate(test_states, 1);
@@ -742,7 +740,9 @@
     ui::IDLE_STATE_IDLE,
     ui::IDLE_STATE_ACTIVE
   };
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+
   status_collector_->Simulate(test_states,
                               sizeof(test_states) / sizeof(ui::IdleState));
   GetStatus();
@@ -763,7 +763,8 @@
   chromeos::LoginState::Get()->SetLoggedInState(
       chromeos::LoginState::LOGGED_IN_ACTIVE,
       chromeos::LoginState::LOGGED_IN_USER_KIOSK_APP);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
   status_collector_->Simulate(test_states,
                               sizeof(test_states) / sizeof(ui::IdleState));
   GetStatus();
@@ -783,7 +784,8 @@
   chromeos::LoginState::Get()->SetLoggedInState(
       chromeos::LoginState::LOGGED_IN_ACTIVE,
       chromeos::LoginState::LOGGED_IN_USER_ARC_KIOSK_APP);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
   status_collector_->Simulate(test_states,
                               sizeof(test_states) / sizeof(ui::IdleState));
   GetStatus();
@@ -800,7 +802,8 @@
     ui::IDLE_STATE_IDLE,
     ui::IDLE_STATE_IDLE
   };
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
   status_collector_->Simulate(test_states,
                               sizeof(test_states) / sizeof(ui::IdleState));
 
@@ -846,7 +849,8 @@
   };
   const int kMaxDays = 10;
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
   status_collector_->set_max_stored_past_activity_interval(
       TimeDelta::FromDays(kMaxDays - 1));
   status_collector_->set_max_stored_future_activity_interval(
@@ -904,8 +908,8 @@
 
 TEST_F(DeviceStatusCollectorTest, ActivityTimesOff) {
   // Device activity times should not be reported if explicitly disabled.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, false);
-
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, false);
   ui::IdleState test_states[] = {
     ui::IDLE_STATE_ACTIVE,
     ui::IDLE_STATE_ACTIVE,
@@ -922,7 +926,8 @@
   ui::IdleState test_states[] = {
     ui::IDLE_STATE_ACTIVE
   };
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
 
   // Set the baseline time to 10 seconds after midnight.
   status_collector_->SetBaselineTime(
@@ -958,7 +963,8 @@
   // and the EXPECT_EQ test below fails.
   base::RunLoop().RunUntilIdle();
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
 
   status_collector_->Simulate(test_states, 2);
   GetStatus();
@@ -986,8 +992,10 @@
 TEST_F(DeviceStatusCollectorTest, ActivityNoUser) {
   ui::IdleState test_states[] = {ui::IDLE_STATE_ACTIVE, ui::IDLE_STATE_ACTIVE,
                                  ui::IDLE_STATE_ACTIVE};
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
 
   status_collector_->Simulate(test_states, 3);
   GetStatus();
@@ -998,8 +1006,10 @@
 TEST_F(DeviceStatusCollectorTest, ActivityWithPublicSessionUser) {
   ui::IdleState test_states[] = {ui::IDLE_STATE_ACTIVE, ui::IDLE_STATE_ACTIVE,
                                  ui::IDLE_STATE_ACTIVE};
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
   const AccountId public_account_id(
       AccountId::FromUserEmail("public@localhost"));
   user_manager_->CreatePublicAccountUser(public_account_id);
@@ -1013,8 +1023,10 @@
 TEST_F(DeviceStatusCollectorTest, ActivityWithAffiliatedUser) {
   ui::IdleState test_states[] = {ui::IDLE_STATE_ACTIVE, ui::IDLE_STATE_ACTIVE,
                                  ui::IDLE_STATE_ACTIVE};
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
   const AccountId account_id0(AccountId::FromUserEmail("user0@managed.com"));
   user_manager_->AddUserWithAffiliationAndType(account_id0, true,
                                                user_manager::USER_TYPE_REGULAR);
@@ -1026,7 +1038,8 @@
             device_status_.active_period(0).user_email());
   device_status_.clear_active_period();  // Clear the result protobuf.
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, false);
 
   status_collector_->Simulate(test_states, 3);
   GetStatus();
@@ -1037,8 +1050,10 @@
 TEST_F(DeviceStatusCollectorTest, ActivityWithNotAffiliatedUser) {
   ui::IdleState test_states[] = {ui::IDLE_STATE_ACTIVE, ui::IDLE_STATE_ACTIVE,
                                  ui::IDLE_STATE_ACTIVE};
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
   const AccountId account_id0(AccountId::FromUserEmail("user0@managed.com"));
   user_manager_->AddUserWithAffiliationAndType(account_id0, false,
                                                user_manager::USER_TYPE_REGULAR);
@@ -1049,7 +1064,8 @@
   EXPECT_TRUE(device_status_.active_period(0).user_email().empty());
   device_status_.clear_active_period();  // Clear the result protobuf.
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, false);
 
   status_collector_->Simulate(test_states, 3);
   GetStatus();
@@ -1066,14 +1082,16 @@
   EXPECT_EQ("Verified", device_status_.boot_mode());
 
   // Test that boot mode data is not reported if the pref turned off.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceBootMode, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceBootMode, false);
 
   GetStatus();
   EXPECT_FALSE(device_status_.has_boot_mode());
 
   // Turn the pref on, and check that the status is reported iff the
   // statistics provider returns valid data.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceBootMode, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceBootMode, true);
 
   fake_statistics_provider_.SetMachineStatistic(
       chromeos::system::kDevSwitchBootKey, "(error)");
@@ -1108,14 +1126,16 @@
 
   // Test that write protect switch is not reported if the hardware report pref
   // is off.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, false);
 
   GetStatus();
   EXPECT_FALSE(device_status_.has_write_protect_switch());
 
   // Turn the pref on, and check that the status is reported iff the
   // statistics provider returns valid data.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, true);
 
   fake_statistics_provider_.SetMachineStatistic(
       chromeos::system::kFirmwareWriteProtectBootKey, "(error)");
@@ -1151,7 +1171,8 @@
 
   // When the pref to collect this data is not enabled, expect that none of
   // the fields are present in the protobuf.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceVersionInfo, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceVersionInfo, false);
   GetStatus();
   EXPECT_FALSE(device_status_.has_browser_version());
   EXPECT_FALSE(device_status_.has_channel());
@@ -1159,7 +1180,8 @@
   EXPECT_FALSE(device_status_.has_firmware_version());
   EXPECT_FALSE(device_status_.has_tpm_version_info());
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceVersionInfo, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceVersionInfo, true);
   GetStatus();
   EXPECT_TRUE(device_status_.has_browser_version());
   EXPECT_TRUE(device_status_.has_channel());
@@ -1201,7 +1223,8 @@
   EXPECT_EQ(6, device_status_.user_size());
 
   // Verify that users are reported after enabling the setting.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
   GetStatus();
   EXPECT_EQ(6, device_status_.user_size());
   EXPECT_EQ(em::DeviceUser::USER_TYPE_MANAGED, device_status_.user(0).type());
@@ -1218,7 +1241,8 @@
   EXPECT_EQ(account_id5.GetUserEmail(), device_status_.user(5).email());
 
   // Verify that users are no longer reported if setting is disabled.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, false);
   GetStatus();
   EXPECT_EQ(0, device_status_.user_size());
 }
@@ -1272,7 +1296,8 @@
   }
 
   // Now turn off hardware status reporting - should have no data.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, false);
   GetStatus();
   EXPECT_EQ(0, device_status_.volume_info_size());
 }
@@ -1336,7 +1361,8 @@
     EXPECT_EQ(0, utilization);
 
   // Turning off hardware reporting should not report CPU utilization.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, false);
   GetStatus();
   EXPECT_EQ(0, device_status_.cpu_utilization_pct().size());
 }
@@ -1379,7 +1405,8 @@
   }
 
   // Now turn off hardware status reporting - should have no data.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, false);
   GetStatus();
   EXPECT_EQ(0, device_status_.cpu_temp_info_size());
 }
@@ -1594,14 +1621,16 @@
 TEST_F(DeviceStatusCollectorTest, NoSessionStatusIfNoSession) {
   // Should not report session status if we don't have an active kiosk app or an
   // active user session.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceSessionStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceSessionStatus, true);
   GetStatus();
   EXPECT_FALSE(got_session_status_);
 }
 
 TEST_F(DeviceStatusCollectorTest, NoSessionStatusIfSessionReportingDisabled) {
   // Should not report session status if session status reporting is disabled.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceSessionStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceSessionStatus, false);
   // ReportDeviceSessionStatus only controls Kiosk reporting, ARC reporting
   // has to be disabled serarately.
   status_collector_->set_kiosk_account(
@@ -1617,7 +1646,8 @@
 }
 
 TEST_F(DeviceStatusCollectorTest, ReportKioskSessionStatus) {
-  settings_helper_.SetBoolean(chromeos::kReportDeviceSessionStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceSessionStatus, true);
   status_collector_->set_kiosk_account(
       std::make_unique<policy::DeviceLocalAccount>(
           fake_kiosk_device_local_account_));
@@ -1640,7 +1670,8 @@
 }
 
 TEST_F(DeviceStatusCollectorTest, ReportArcKioskSessionStatus) {
-  settings_helper_.SetBoolean(chromeos::kReportDeviceSessionStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceSessionStatus, true);
   status_collector_->set_kiosk_account(
       std::make_unique<policy::DeviceLocalAccount>(
           fake_arc_kiosk_device_local_account_));
@@ -1673,7 +1704,8 @@
 
 TEST_F(DeviceStatusCollectorTest, ReportOsUpdateStatusUpToDate) {
   MockPlatformVersion("1234.0.0");
-  settings_helper_.SetBoolean(chromeos::kReportOsUpdateStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportOsUpdateStatus, true);
 
   const char* kRequiredPlatformVersions[] = {"1234", "1234.0", "1234.0.0"};
 
@@ -1695,7 +1727,8 @@
 
 TEST_F(DeviceStatusCollectorTest, ReportOsUpdateStatus) {
   MockPlatformVersion("1234.0.0");
-  settings_helper_.SetBoolean(chromeos::kReportOsUpdateStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportOsUpdateStatus, true);
   MockAutoLaunchKioskAppWithRequiredPlatformVersion(
       fake_kiosk_device_local_account_, "1235");
 
@@ -1753,7 +1786,8 @@
 }
 
 TEST_F(DeviceStatusCollectorTest, NoRunningKioskAppWhenNotInKioskSession) {
-  settings_helper_.SetBoolean(chromeos::kReportRunningKioskApp, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportRunningKioskApp, true);
   MockPlatformVersion("1234.0.0");
   MockAutoLaunchKioskAppWithRequiredPlatformVersion(
       fake_kiosk_device_local_account_, "1234.0.0");
@@ -1763,7 +1797,8 @@
 }
 
 TEST_F(DeviceStatusCollectorTest, ReportRunningKioskApp) {
-  settings_helper_.SetBoolean(chromeos::kReportRunningKioskApp, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportRunningKioskApp, true);
   MockPlatformVersion("1234.0.0");
   MockAutoLaunchKioskAppWithRequiredPlatformVersion(
       fake_kiosk_device_local_account_, "1235");
@@ -1782,7 +1817,8 @@
 }
 
 TEST_F(DeviceStatusCollectorTest, ReportRunningArcKioskApp) {
-  settings_helper_.SetBoolean(chromeos::kReportRunningKioskApp, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportRunningKioskApp, true);
   MockAutoLaunchArcKioskApp(fake_arc_kiosk_device_local_account_);
   MockRunningKioskApp(fake_arc_kiosk_device_local_account_,
                       true /* arc_kiosk */);
@@ -1808,13 +1844,15 @@
 
   // When the pref to collect this data is not enabled, expect that the field
   // isn't present in the protobuf.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, false);
   GetStatus();
   EXPECT_FALSE(device_status_.has_sound_volume());
 
   // Try setting a custom volume value and check that it matches.
   const int kCustomVolume = 42;
-  settings_helper_.SetBoolean(chromeos::kReportDeviceHardwareStatus, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceHardwareStatus, true);
   chromeos::CrasAudioHandler::Get()->SetOutputVolumePercent(kCustomVolume);
   GetStatus();
   EXPECT_EQ(kCustomVolume, device_status_.sound_volume());
@@ -1913,7 +1951,8 @@
 
   void SetUp() override {
     DeviceStatusCollectorTest::SetUp();
-    settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
+    scoped_testing_cros_settings_.device_settings()->SetBoolean(
+        chromeos::kReportDeviceActivityTimes, true);
   }
 
   // Restarts device status collector for activity reporting tests with given
@@ -2331,13 +2370,15 @@
   EXPECT_LT(0, device_status_.network_state_size());
 
   // No interfaces should be reported if the policy is off.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceNetworkInterfaces, false);
   GetStatus();
   EXPECT_EQ(0, device_status_.network_interface_size());
   EXPECT_EQ(0, device_status_.network_state_size());
 
   // Switch the policy on and verify the interface list is present.
-  settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceNetworkInterfaces, true);
   GetStatus();
 
   VerifyNetworkReporting();
@@ -2350,7 +2391,8 @@
   EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount())
       .WillRepeatedly(Return(true));
 
-  settings_helper_.SetBoolean(chromeos::kReportDeviceNetworkInterfaces, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceNetworkInterfaces, true);
   GetStatus();
   VerifyNetworkReporting();
 }
@@ -2564,8 +2606,10 @@
 
 TEST_F(ConsumerDeviceStatusCollectorTimeLimitDisabledTest,
        ActivityTimesFeatureDisable) {
-  settings_helper_.SetBoolean(chromeos::kReportDeviceActivityTimes, true);
-  settings_helper_.SetBoolean(chromeos::kReportDeviceUsers, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceActivityTimes, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kReportDeviceUsers, true);
   ui::IdleState test_states[] = {ui::IDLE_STATE_ACTIVE, ui::IDLE_STATE_ACTIVE,
                                  ui::IDLE_STATE_ACTIVE};
   status_collector_->Simulate(test_states, 3);
diff --git a/chrome/browser/chromeos/policy/extension_cache_unittest.cc b/chrome/browser/chromeos/policy/extension_cache_unittest.cc
index 1484491..9955ce2 100644
--- a/chrome/browser/chromeos/policy/extension_cache_unittest.cc
+++ b/chrome/browser/chromeos/policy/extension_cache_unittest.cc
@@ -11,7 +11,8 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/run_loop.h"
 #include "base/time/time.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h"
 #include "chrome/browser/extensions/updater/extension_cache_impl.h"
 #include "chrome/browser/extensions/updater/local_extension_cache.h"
@@ -58,12 +59,12 @@
 class ExtensionCacheTest : public testing::Test {
  protected:
   content::TestBrowserThreadBundle thread_bundle_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
 };
 
 TEST_F(ExtensionCacheTest, SizePolicy) {
-  settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-  settings_helper_.SetInteger(chromeos::kExtensionCacheSize, kMaxCacheSize);
+  scoped_testing_cros_settings_.device_settings()->SetInteger(
+      chromeos::kExtensionCacheSize, kMaxCacheSize);
 
   // Create and initialize local cache.
   const base::Time now = base::Time::Now();
diff --git a/chrome/browser/chromeos/policy/heartbeat_scheduler_unittest.cc b/chrome/browser/chromeos/policy/heartbeat_scheduler_unittest.cc
index b051034a..da957f5 100644
--- a/chrome/browser/chromeos/policy/heartbeat_scheduler_unittest.cc
+++ b/chrome/browser/chromeos/policy/heartbeat_scheduler_unittest.cc
@@ -11,7 +11,8 @@
 #include "base/macros.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/test/test_simple_task_runner.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chromeos/settings/cros_settings_names.h"
 #include "components/gcm_driver/common/gcm_messages.h"
 #include "components/gcm_driver/fake_gcm_driver.h"
@@ -130,10 +131,6 @@
                    kFakeDeviceId,
                    task_runner_) {}
 
-  void SetUp() override {
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-  }
-
   void TearDown() override { content::RunAllTasksUntilIdle(); }
 
   void CheckPendingTaskDelay(base::Time last_heartbeat,
@@ -166,7 +163,7 @@
 
   content::TestBrowserThreadBundle test_browser_thread_bundle_;
   MockGCMDriver gcm_driver_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
   testing::NiceMock<policy::MockCloudPolicyClient> cloud_policy_client_;
 
   // TaskRunner used to run individual tests.
@@ -179,14 +176,16 @@
 TEST_F(HeartbeatSchedulerTest, Basic) {
   // Just makes sure we can spin up and shutdown the scheduler with
   // heartbeats disabled.
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, false);
   ASSERT_FALSE(task_runner_->HasPendingTask());
 }
 
 TEST_F(HeartbeatSchedulerTest, PermanentlyFailedGCMRegistration) {
   // If heartbeats are enabled, we should register with GCMDriver.
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.CompleteRegistration(
       kHeartbeatGCMAppID, gcm::GCMClient::GCM_DISABLED);
 
@@ -198,7 +197,8 @@
   IgnoreUpstreamNotificationMsg();
 
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.CompleteRegistration(
       kHeartbeatGCMAppID, gcm::GCMClient::SERVER_ERROR);
   testing::Mock::VerifyAndClearExpectations(&gcm_driver_);
@@ -226,7 +226,8 @@
   IgnoreUpstreamNotificationMsg();
 
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   testing::Mock::VerifyAndClearExpectations(&gcm_driver_);
 
   gcm_driver_.ResetStore();
@@ -248,7 +249,8 @@
 
   // Start from a successful registration.
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   EXPECT_CALL(gcm_driver_, SendImpl(kHeartbeatGCMAppID, _, IsHeartbeatMsg()));
   gcm_driver_.CompleteRegistration(
       kHeartbeatGCMAppID, gcm::GCMClient::SUCCESS);
@@ -279,7 +281,8 @@
   IgnoreUpstreamNotificationMsg();
 
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.CompleteRegistration(
       kHeartbeatGCMAppID, gcm::GCMClient::SUCCESS);
 
@@ -293,7 +296,8 @@
 
   const int new_delay = 1234*1000;  // 1234 seconds.
   EXPECT_CALL(gcm_driver_, AddHeartbeatInterval(_, new_delay));
-  settings_helper_.SetInteger(chromeos::kHeartbeatFrequency, new_delay);
+  scoped_testing_cros_settings_.device_settings()->SetInteger(
+      chromeos::kHeartbeatFrequency, new_delay);
   // Now run pending heartbeat task, should send a heartbeat.
   gcm::OutgoingMessage message;
   EXPECT_CALL(gcm_driver_, SendImpl(kHeartbeatGCMAppID, _, IsHeartbeatMsg()))
@@ -315,7 +319,8 @@
 
   // Makes sure that we can disable heartbeats on the fly.
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm::OutgoingMessage message;
   EXPECT_CALL(gcm_driver_, SendImpl(kHeartbeatGCMAppID, _, IsHeartbeatMsg()))
       .WillOnce(SaveArg<2>(&message));
@@ -339,7 +344,8 @@
   gcm_driver_.IgnoreDefaultHeartbeatsInterval();
 
   // Now disable heartbeats. Should get no more heartbeats sent.
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, false);
   task_runner_->RunPendingTasks();
   EXPECT_FALSE(task_runner_->HasPendingTask());
 }
@@ -351,7 +357,8 @@
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
   EXPECT_CALL(gcm_driver_, SendImpl(kHeartbeatGCMAppID, _, IsHeartbeatMsg()))
       .WillOnce(SaveArg<2>(&message));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.CompleteRegistration(
       kHeartbeatGCMAppID, gcm::GCMClient::SUCCESS);
   task_runner_->RunPendingTasks();
@@ -380,7 +387,8 @@
   EXPECT_CALL(gcm_driver_, RegisterImpl(kHeartbeatGCMAppID, _));
   EXPECT_CALL(gcm_driver_, SendImpl(kHeartbeatGCMAppID, _, _))
       .Times(AtLeast(1));
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.CompleteRegistration(kHeartbeatGCMAppID, gcm::GCMClient::SUCCESS);
   task_runner_->RunPendingTasks();
 
@@ -399,7 +407,8 @@
   EXPECT_CALL(cloud_policy_client_, UpdateGcmId(kRegistrationId, _));
 
   // GCM connected event before the registration should be ignored.
-  settings_helper_.SetBoolean(chromeos::kHeartbeatEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kHeartbeatEnabled, true);
   gcm_driver_.NotifyConnected();
   task_runner_->RunPendingTasks();
   testing::Mock::VerifyAndClearExpectations(&gcm_driver_);
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
index 768c234..195fb2f 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
+++ b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
@@ -17,7 +17,9 @@
 #include "chrome/browser/chromeos/policy/device_network_configuration_updater.h"
 #include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
 #include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/device_settings_service.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chromeos/network/fake_network_device_handler.h"
 #include "chromeos/network/mock_managed_network_configuration_handler.h"
@@ -414,7 +416,9 @@
   StrictMock<chromeos::MockManagedNetworkConfigurationHandler>
       network_config_handler_;
   FakeNetworkDeviceHandler network_device_handler_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedStubInstallAttributes scoped_stub_install_attributes_;
+  chromeos::ScopedTestDeviceSettingsService scoped_device_settings_service_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
   chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_;
 
   // Ownership of client_certificate_importer_owned_ is passed to the
@@ -457,16 +461,18 @@
   // Ignore network config updates.
   EXPECT_CALL(network_config_handler_, SetPolicy(_, _, _, _)).Times(AtLeast(1));
 
-  settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-  settings_helper_.SetBoolean(chromeos::kSignedDataRoamingEnabled, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kSignedDataRoamingEnabled, false);
   EXPECT_FALSE(network_device_handler_.allow_roaming_);
 
   CreateNetworkConfigurationUpdaterForDevicePolicy();
   MarkPolicyProviderInitialized();
-  settings_helper_.SetBoolean(chromeos::kSignedDataRoamingEnabled, true);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kSignedDataRoamingEnabled, true);
   EXPECT_TRUE(network_device_handler_.allow_roaming_);
 
-  settings_helper_.SetBoolean(chromeos::kSignedDataRoamingEnabled, false);
+  scoped_testing_cros_settings_.device_settings()->SetBoolean(
+      chromeos::kSignedDataRoamingEnabled, false);
   EXPECT_FALSE(network_device_handler_.allow_roaming_);
 }
 
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
index a48e49f..db08a2e 100644
--- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
+++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
@@ -292,10 +292,11 @@
 }
 
 // static
-PolicyOAuth2TokenFetcher* PolicyOAuth2TokenFetcher::CreateInstance() {
+std::unique_ptr<PolicyOAuth2TokenFetcher>
+PolicyOAuth2TokenFetcher::CreateInstance() {
   if (use_fake_tokens_for_testing_)
-    return new PolicyOAuth2TokenFetcherFake();
-  return new PolicyOAuth2TokenFetcherImpl();
+    return std::make_unique<PolicyOAuth2TokenFetcherFake>();
+  return std::make_unique<PolicyOAuth2TokenFetcherImpl>();
 }
 
 PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher() {}
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
index ac8f539..639794fd6 100644
--- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
+++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
@@ -27,7 +27,7 @@
 class PolicyOAuth2TokenFetcher {
  public:
   // Allocates a PolicyOAuth2TokenFetcher instance.
-  static PolicyOAuth2TokenFetcher* CreateInstance();
+  static std::unique_ptr<PolicyOAuth2TokenFetcher> CreateInstance();
 
   // Makes CreateInstance() return a fake token fetcher that does not make
   // network calls so tests can avoid a dependency on GAIA.
diff --git a/chrome/browser/chromeos/policy/site_isolation_flag_handling_browsertest.cc b/chrome/browser/chromeos/policy/site_isolation_flag_handling_browsertest.cc
index 1166bc8..902ccba 100644
--- a/chrome/browser/chromeos/policy/site_isolation_flag_handling_browsertest.cc
+++ b/chrome/browser/chromeos/policy/site_isolation_flag_handling_browsertest.cc
@@ -20,7 +20,8 @@
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
 #include "chrome/browser/chromeos/policy/login_policy_test_base.h"
 #include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chrome/browser/chromeos/settings/stub_install_attributes.h"
 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
 #include "chrome/test/base/in_process_browser_test.h"
@@ -227,7 +228,7 @@
     : public policy::LoginPolicyTestBase,
       public ::testing::WithParamInterface<Params> {
  protected:
-  SiteIsolationFlagHandlingTest() : settings_helper_(false) {}
+  SiteIsolationFlagHandlingTest() = default;
 
   void SetUpCommandLine(base::CommandLine* command_line) override {
     policy::LoginPolicyTestBase::SetUpCommandLine(command_line);
@@ -289,9 +290,8 @@
     policy::LoginPolicyTestBase::SetUpOnMainThread();
 
     // Write ephemeral users status directly into CrosSettings.
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
-    settings_helper_.SetBoolean(kAccountsPrefEphemeralUsersEnabled,
-                                GetParam().ephemeral_users);
+    scoped_testing_cros_settings_.device_settings()->SetBoolean(
+        kAccountsPrefEphemeralUsersEnabled, GetParam().ephemeral_users);
 
     // This makes the user manager reload CrosSettings.
     GetChromeUserManager()->OwnershipStatusChanged();
@@ -315,10 +315,6 @@
                 base::Unretained(this)));
   }
 
-  void TearDownOnMainThread() override {
-    settings_helper_.RestoreRealDeviceSettingsProvider();
-  }
-
   ChromeUserManagerImpl* GetChromeUserManager() const {
     return static_cast<ChromeUserManagerImpl*>(
         user_manager::UserManager::Get());
@@ -362,7 +358,7 @@
   // Unowned pointer - owned by DBusThreadManager.
   FakeSessionManagerClient* fake_session_manager_client_;
   policy::MockConfigurationPolicyProvider provider_;
-  ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
   DISALLOW_COPY_AND_ASSIGN(SiteIsolationFlagHandlingTest);
 };
 
diff --git a/chrome/browser/chromeos/policy/status_uploader_unittest.cc b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
index 42a015f3..8afbe8c 100644
--- a/chrome/browser/chromeos/policy/status_uploader_unittest.cc
+++ b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
@@ -14,7 +14,8 @@
 #include "base/time/time.h"
 #include "chrome/browser/chromeos/policy/device_local_account.h"
 #include "chrome/browser/chromeos/policy/device_status_collector.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/settings/cros_settings_names.h"
 #include "components/policy/core/common/cloud/cloud_policy_client.h"
@@ -88,7 +89,6 @@
     chromeos::DBusThreadManager::Initialize();
     client_.SetDMToken("dm_token");
     collector_.reset(new MockDeviceStatusCollector(&prefs_));
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
 
     // Keep a pointer to the mock collector because collector_ gets cleared
     // when it is passed to the StatusUploader constructor.
@@ -171,7 +171,7 @@
 
   content::TestBrowserThreadBundle thread_bundle_;
   scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
-  chromeos::ScopedCrosSettingsTestHelper settings_helper_;
+  chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
   std::unique_ptr<MockDeviceStatusCollector> collector_;
   MockDeviceStatusCollector* collector_ptr_;
   ui::UserActivityDetector detector_;
@@ -195,8 +195,9 @@
 
 TEST_F(StatusUploaderTest, DifferentFrequencyAtStart) {
   const base::TimeDelta new_delay = kDefaultStatusUploadDelay * 2;
-  settings_helper_.SetInteger(chromeos::kReportUploadFrequency,
-                              new_delay.InMilliseconds());
+
+  scoped_testing_cros_settings_.device_settings()->SetInteger(
+      chromeos::kReportUploadFrequency, new_delay.InMilliseconds());
   EXPECT_FALSE(task_runner_->HasPendingTask());
   StatusUploader uploader(&client_, std::move(collector_), task_runner_,
                           kDefaultStatusUploadDelay);
@@ -299,8 +300,8 @@
   // Change the frequency. The new frequency should be reflected in the timing
   // used for the next callback.
   const base::TimeDelta new_delay = kDefaultStatusUploadDelay * 2;
-  settings_helper_.SetInteger(chromeos::kReportUploadFrequency,
-                              new_delay.InMilliseconds());
+  scoped_testing_cros_settings_.device_settings()->SetInteger(
+      chromeos::kReportUploadFrequency, new_delay.InMilliseconds());
   RunPendingUploadTaskAndCheckNext(uploader, new_delay,
                                    true /* upload_success */);
 }
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
index 8621b445..9c96c418 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -603,7 +603,7 @@
           .GetRefreshToken());
 
   if (!refresh_token.empty()) {
-    token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance());
+    token_fetcher_ = PolicyOAuth2TokenFetcher::CreateInstance();
     token_fetcher_->StartWithRefreshToken(
         refresh_token, system_url_loader_factory,
         base::Bind(&UserCloudPolicyManagerChromeOS::OnOAuth2PolicyTokenFetched,
diff --git a/chrome/browser/chromeos/policy/wildcard_login_checker.cc b/chrome/browser/chromeos/policy/wildcard_login_checker.cc
index c64f329..f0f941e 100644
--- a/chrome/browser/chromeos/policy/wildcard_login_checker.cc
+++ b/chrome/browser/chromeos/policy/wildcard_login_checker.cc
@@ -45,7 +45,7 @@
   start_timestamp_ = base::Time::Now();
   callback_ = std::move(callback);
 
-  token_fetcher_.reset(PolicyOAuth2TokenFetcher::CreateInstance());
+  token_fetcher_ = PolicyOAuth2TokenFetcher::CreateInstance();
   token_fetcher_->StartWithRefreshToken(
       refresh_token,
       g_browser_process->system_network_context_manager()
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 766d8f6bc..4319755 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -203,6 +203,11 @@
 
   // This pref is device specific and must not be synced.
   registry->RegisterIntegerPref(
+      prefs::kAccountManagerNumTimesMigrationRanSuccessfully,
+      0 /* default_value */);
+
+  // This pref is device specific and must not be synced.
+  registry->RegisterIntegerPref(
       prefs::kAccountManagerNumTimesWelcomeScreenShown, 0 /* default_value */);
 
   registry->RegisterBooleanPref(
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
index db4f6c8..ec44b30 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
@@ -17,7 +17,8 @@
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_delegate.h"
 #include "chrome/browser/chromeos/settings/device_settings_service.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_install_attributes.h"
 #include "chrome/browser/chromeos/settings/token_encryptor.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/scoped_testing_local_state.h"
@@ -201,8 +202,11 @@
   };
 
   content::TestBrowserThreadBundle test_browser_thread_bundle_;
-  ScopedCrosSettingsTestHelper cros_settings_test_helper_;
+  ScopedStubInstallAttributes scoped_stub_install_attributes_;
   ScopedTestingLocalState scoped_testing_local_state_;
+  ScopedTestDeviceSettingsService scoped_device_settings_service_;
+  ScopedTestCrosSettings scoped_test_cros_settings_{
+      scoped_testing_local_state_.Get()};
   network::TestURLLoaderFactory test_url_loader_factory_;
   scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
       test_shared_loader_factory_;
diff --git a/chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.cc b/chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.cc
index 1de7d5cc..2a5f550f 100644
--- a/chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.cc
+++ b/chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.cc
@@ -37,7 +37,7 @@
 std::unique_ptr<FakeOwnerSettingsService>
 ScopedCrosSettingsTestHelper::CreateOwnerSettingsService(Profile* profile) {
   return std::make_unique<FakeOwnerSettingsService>(
-      profile, new ownership::MockOwnerKeyUtil(), stub_settings_provider_ptr_);
+      stub_settings_provider_ptr_, profile, new ownership::MockOwnerKeyUtil());
 }
 
 void ScopedCrosSettingsTestHelper::ReplaceDeviceSettingsProviderWithStub() {
diff --git a/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc b/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
index 24474d2..e1fc2f71 100644
--- a/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
+++ b/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
@@ -7,7 +7,8 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/run_loop.h"
-#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
+#include "chrome/browser/chromeos/settings/scoped_testing_cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/settings/cros_settings_names.h"
 #include "content/public/test/test_browser_thread_bundle.h"
@@ -25,13 +26,13 @@
   void SetUp() override {
     testing::Test::SetUp();
     DBusThreadManager::Initialize();
-    settings_helper_.ReplaceDeviceSettingsProviderWithStub();
   }
 
   void TearDown() override { DBusThreadManager::Shutdown(); }
 
   void SetRebootOnShutdown(bool reboot_on_shutdown) {
-    settings_helper_.SetBoolean(kRebootOnShutdown, reboot_on_shutdown);
+    scoped_testing_cros_settings_.device_settings()->SetBoolean(
+        kRebootOnShutdown, reboot_on_shutdown);
     base::RunLoop().RunUntilIdle();
   }
 
@@ -43,7 +44,7 @@
 
  protected:
   content::TestBrowserThreadBundle thread_bundle_;
-  ScopedCrosSettingsTestHelper settings_helper_;
+  ScopedTestingCrosSettings scoped_testing_cros_settings_;
   bool reboot_on_shutdown_;
   int delegate_invocations_count_;
 };
diff --git a/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc b/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
index cef3397..b7c29ce 100644
--- a/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
@@ -60,6 +60,26 @@
   current_user_is_owner_ = owner;
 }
 
+void StubCrosSettingsProvider::SetBoolean(const std::string& path,
+                                          bool in_value) {
+  Set(path, base::Value(in_value));
+}
+
+void StubCrosSettingsProvider::SetInteger(const std::string& path,
+                                          int in_value) {
+  Set(path, base::Value(in_value));
+}
+
+void StubCrosSettingsProvider::SetDouble(const std::string& path,
+                                         double in_value) {
+  Set(path, base::Value(in_value));
+}
+
+void StubCrosSettingsProvider::SetString(const std::string& path,
+                                         const std::string& in_value) {
+  Set(path, base::Value(in_value));
+}
+
 void StubCrosSettingsProvider::DoSet(const std::string& path,
                                      const base::Value& value) {
   bool is_value_changed = false;
diff --git a/chrome/browser/chromeos/settings/stub_cros_settings_provider.h b/chrome/browser/chromeos/settings/stub_cros_settings_provider.h
index 4a05dcc..fe41754 100644
--- a/chrome/browser/chromeos/settings/stub_cros_settings_provider.h
+++ b/chrome/browser/chromeos/settings/stub_cros_settings_provider.h
@@ -32,6 +32,13 @@
 
   bool current_user_is_owner() const { return current_user_is_owner_; }
 
+  // Convenience forms of Set(). These methods will replace any existing value
+  // at that |path|, even if it has a different type.
+  void SetBoolean(const std::string& path, bool in_value);
+  void SetInteger(const std::string& path, int in_value);
+  void SetDouble(const std::string& path, double in_value);
+  void SetString(const std::string& path, const std::string& in_value);
+
  private:
   // CrosSettingsProvider implementation:
   void DoSet(const std::string& path, const base::Value& value) override;
diff --git a/chrome/browser/content_settings/local_shared_objects_container.cc b/chrome/browser/content_settings/local_shared_objects_container.cc
index 4ba0c19..8e73e4d 100644
--- a/chrome/browser/content_settings/local_shared_objects_container.cc
+++ b/chrome/browser/content_settings/local_shared_objects_container.cc
@@ -4,6 +4,8 @@
 
 #include "chrome/browser/content_settings/local_shared_objects_container.h"
 
+#include <vector>
+
 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
 #include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h"
 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h"
@@ -21,6 +23,7 @@
 #include "content/public/common/url_constants.h"
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 #include "net/cookies/canonical_cookie.h"
+#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 #include "url/gurl.h"
 
 namespace {
@@ -184,7 +187,7 @@
       OriginAppCacheInfoMap;
   const OriginAppCacheInfoMap& map = appcaches()->GetOriginAppCacheInfoMap();
   for (auto it = map.begin(); it != map.end(); ++it) {
-    const content::AppCacheInfoVector& info_vector = it->second;
+    const std::vector<blink::mojom::AppCacheInfo>& info_vector = it->second;
     for (auto info = info_vector.begin(); info != info_vector.end(); ++info) {
       if (SameDomainOrHost(origin, info->manifest_url))
         ++count;
diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc
index 0845c5a..d7a6f7bb 100644
--- a/chrome/browser/download/download_path_reservation_tracker.cc
+++ b/chrome/browser/download/download_path_reservation_tracker.cc
@@ -26,7 +26,6 @@
 #include "base/task_runner_util.h"
 #include "base/third_party/icu/icu_utf.h"
 #include "base/time/time.h"
-#include "base/time/time_to_iso8601.h"
 #include "build/build_config.h"
 #include "chrome/common/buildflags.h"
 #include "chrome/common/chrome_paths.h"
@@ -140,8 +139,14 @@
     // After we've tried all the unique numeric indices, make one attempt using
     // the timestamp.
     if (uniquifier > DownloadPathReservationTracker::kMaxUniqueFiles) {
+      // Generate an ISO8601 compliant local timestamp suffix that avoids
+      // reserved characters that are forbidden on some OSes like Windows.
+      base::Time::Exploded exploded;
+      download_start_time.LocalExplode(&exploded);
       suffix = base::StringPrintf(
-          " - %s", base::TimeToISO8601(download_start_time).c_str());
+          " - %04d-%02d-%02dT%02d%02d%02d.%03d", exploded.year, exploded.month,
+          exploded.day_of_month, exploded.hour, exploded.minute,
+          exploded.second, exploded.millisecond);
     }
 
     base::FilePath path_to_check(*path);
diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
index 540a34a..c172d47 100644
--- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc
+++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
@@ -102,8 +102,22 @@
   EXPECT_CALL(*item, GetState())
       .WillRepeatedly(Return(DownloadItem::IN_PROGRESS));
   EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL()));
-  EXPECT_CALL(*item, GetStartTime())
-      .WillRepeatedly(Return(base::Time::UnixEpoch()));
+
+  base::Time::Exploded exploded_reference_time;
+  exploded_reference_time.year = 2019;
+  exploded_reference_time.month = 1;
+  exploded_reference_time.day_of_month = 23;
+  exploded_reference_time.day_of_week = 3;
+  exploded_reference_time.hour = 16;
+  exploded_reference_time.minute = 35;
+  exploded_reference_time.second = 30;
+  exploded_reference_time.millisecond = 20;
+
+  base::Time test_time;
+  EXPECT_TRUE(
+      base::Time::FromLocalExploded(exploded_reference_time, &test_time));
+
+  EXPECT_CALL(*item, GetStartTime()).WillRepeatedly(Return(test_time));
   return item;
 }
 
@@ -462,7 +476,7 @@
           path.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", i));
     } else {
       expected_path =
-          path.InsertBeforeExtensionASCII(" - 1970-01-01T00:00:00.000Z");
+          path.InsertBeforeExtensionASCII(" - 2019-01-23T163530.020");
     }
     items[i].reset(CreateDownloadItem(i));
     EXPECT_FALSE(IsPathInUse(expected_path));
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 3e41218..cd6f9c1 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -451,12 +451,14 @@
     const base::FilePath& path) const {
 #if defined(OS_CHROMEOS)
   // If |path| isn't absolute, fall back to the default directory.
-  base::FilePath profile_download_dir = GetDefaultDownloadDirectoryForProfile();
-  if (!path.IsAbsolute() || path.ReferencesParent())
-    return profile_download_dir;
+  base::FilePath profile_myfiles_path =
+      file_manager::util::GetMyFilesFolderForProfile(profile_);
 
-  // Allow default download directory and subdirs.
-  if (profile_download_dir == path || profile_download_dir.IsParent(path))
+  if (!path.IsAbsolute() || path.ReferencesParent())
+    return profile_myfiles_path;
+
+  // Allow myfiles directory and subdirs.
+  if (profile_myfiles_path == path || profile_myfiles_path.IsParent(path))
     return path;
 
   // Allow paths under the drive mount point.
@@ -482,7 +484,7 @@
     return path;
 
   // Fall back to the default download directory for all other paths.
-  return profile_download_dir;
+  return GetDefaultDownloadDirectoryForProfile();
 #endif
   return path;
 }
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
index c6d09f3..39c7e3b0 100644
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -883,6 +883,7 @@
     "//third_party/zlib/google:zip",
     "//ui/accessibility:ax_enums_mojo",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display/manager",
     "//ui/gfx",
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index 9904fc1..e6e3a9f 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -44,18 +44,12 @@
 #include "components/guest_view/browser/guest_view_base.h"
 #include "components/prefs/pref_service.h"
 #include "components/signin/core/browser/account_fetcher_service.h"
-#include "components/signin/core/browser/account_tracker_service.h"
-#include "components/signin/core/browser/signin_buildflags.h"
 #include "components/signin/core/browser/signin_pref_names.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
 #include "content/public/test/test_utils.h"
 #include "extensions/browser/api_test_utils.h"
 #include "extensions/common/extension_builder.h"
-#include "extensions/common/manifest_handlers/oauth2_manifest_handler.h"
-#include "google_apis/gaia/google_service_auth_error.h"
-#include "google_apis/gaia/oauth2_mint_token_flow.h"
-#include "google_apis/gaia/oauth2_token_service.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 #include "services/identity/public/cpp/identity_manager.h"
 #include "services/identity/public/cpp/identity_test_utils.h"
@@ -428,9 +422,6 @@
   }
 
   void OnWillCreateBrowserContextServices(content::BrowserContext* context) {
-    // Replace the signin manager and token service with fakes. Do this ahead of
-    // creating the browser so that a bunch of classes don't register as
-    // observers and end up needing to unregister when the fake is substituted.
     IdentityTestEnvironmentProfileAdaptor::
         SetIdentityTestEnvironmentFactoriesOnBrowserContext(context);
 
diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc
index efe73fe..e6f76fb 100644
--- a/chrome/browser/extensions/external_pref_loader.cc
+++ b/chrome/browser/extensions/external_pref_loader.cc
@@ -21,6 +21,7 @@
 #include "base/task/lazy_task_runner.h"
 #include "base/task/post_task.h"
 #include "build/build_config.h"
+#include "chrome/browser/apps/user_type_filter.h"
 #include "chrome/browser/defaults.h"
 #include "chrome/browser/prefs/pref_service_syncable_util.h"
 #include "chrome/browser/profiles/profile.h"
@@ -167,7 +168,7 @@
 };
 
 ExternalPrefLoader::ExternalPrefLoader(int base_path_id,
-                                       Options options,
+                                       int options,
                                        Profile* profile)
     : base_path_id_(base_path_id), options_(options), profile_(profile) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -317,12 +318,20 @@
     return;
   }
 
+  // TODO(crbug.com/1407498): Remove this once migration is completed.
+  std::unique_ptr<base::ListValue> default_user_types;
+  if (options_ & USE_USER_TYPE_PROFILE_FILTER) {
+    default_user_types = std::make_unique<base::ListValue>();
+    default_user_types->GetList().push_back(
+        base::Value(apps::kUserTypeUnmanaged));
+  }
+
   // For each file read the json description & build the proper
   // associated prefs.
   for (auto it = candidates.begin(); it != candidates.end(); ++it) {
     base::FilePath extension_candidate_path = base_path_.Append(*it);
 
-    std::string id =
+    const std::string id =
 #if defined(OS_WIN)
         base::UTF16ToASCII(
             extension_candidate_path.RemoveExtension().BaseName().value());
@@ -336,10 +345,19 @@
     JSONFileValueDeserializer deserializer(extension_candidate_path);
     std::unique_ptr<base::DictionaryValue> ext_prefs =
         ExtractExtensionPrefs(&deserializer, extension_candidate_path);
-    if (ext_prefs) {
-      DVLOG(1) << "Adding extension with id: " << id;
-      prefs->Set(id, std::move(ext_prefs));
+    if (!ext_prefs)
+      continue;
+
+    if (options_ & USE_USER_TYPE_PROFILE_FILTER &&
+        !apps::ProfileMatchJsonUserType(profile_, id /* app_id */,
+                                        ext_prefs.get(),
+                                        default_user_types.get())) {
+      // Already logged.
+      continue;
     }
+
+    DVLOG(1) << "Adding extension with id: " << id;
+    prefs->Set(id, std::move(ext_prefs));
   }
 }
 
diff --git a/chrome/browser/extensions/external_pref_loader.h b/chrome/browser/extensions/external_pref_loader.h
index 21778534..a13c0da 100644
--- a/chrome/browser/extensions/external_pref_loader.h
+++ b/chrome/browser/extensions/external_pref_loader.h
@@ -34,13 +34,17 @@
     // Delay external preference load. It delays default apps installation
     // to not overload the system on first time user login.
     DELAY_LOAD_UNTIL_PRIORITY_SYNC = 1 << 1,
+
+    // Use profile user type filter to load extensions.
+    USE_USER_TYPE_PROFILE_FILTER = 1 << 2,
   };
 
   // |base_path_id| is the directory containing the external_extensions.json
   // file or the standalone extension manifest files. Relative file paths to
   // extension files are resolved relative to this path. |profile| is used to
   // wait priority sync if DELAY_LOAD_UNTIL_PRIORITY_SYNC set.
-  ExternalPrefLoader(int base_path_id, Options options, Profile* profile);
+  // |options| is combination of |Options|.
+  ExternalPrefLoader(int base_path_id, int options, Profile* profile);
 
   const base::FilePath GetBaseCrxFilePath() override;
 
@@ -56,7 +60,7 @@
   // file containing which extensions to load.
   const int base_path_id_;
 
-  const Options options_;
+  const int options_;
 
  private:
   friend class base::RefCountedThreadSafe<ExternalLoader>;
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index 999c126..d9ced93 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -686,8 +686,9 @@
   // In tests don't install extensions from default external sources.
   // It would only slowdown tests and make them flaky.
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
-          ::switches::kDisableDefaultApps))
+          ::switches::kDisableDefaultApps)) {
     return;
+  }
 
   // On Mac OS, items in /Library/... should be written by the superuser.
   // Check that all components of the path are writable by root only.
@@ -707,29 +708,17 @@
       Extension::WAS_INSTALLED_BY_DEFAULT;
 
   if (!is_chrome_os_public_session) {
-    std::vector<int> external_apps_path_ids;
-    if (profile->IsChild()) {
-      external_apps_path_ids.push_back(chrome::DIR_CHILD_USERS_DEFAULT_APPS);
-    } else if (profile->IsSupervised()) {
-      external_apps_path_ids.push_back(
-          chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS);
-    } else {
-      external_apps_path_ids.push_back(
-          chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS);
-      external_apps_path_ids.push_back(chrome::DIR_CHILD_USERS_DEFAULT_APPS);
-    }
-    const ExternalPrefLoader::Options pref_load_flags =
+    int pref_load_flags =
         profile->IsNewProfile()
             ? ExternalPrefLoader::DELAY_LOAD_UNTIL_PRIORITY_SYNC
             : ExternalPrefLoader::NONE;
-    for (const auto external_apps_path_id : external_apps_path_ids) {
-      provider_list->push_back(std::make_unique<ExternalProviderImpl>(
-          service,
-          new ExternalPrefLoader(external_apps_path_id, pref_load_flags,
-                                 profile),
-          profile, Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD,
-          bundled_extension_creation_flags));
-    }
+    pref_load_flags |= ExternalPrefLoader::USE_USER_TYPE_PROFILE_FILTER;
+    provider_list->push_back(std::make_unique<ExternalProviderImpl>(
+        service,
+        new ExternalPrefLoader(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
+                               pref_load_flags, profile),
+        profile, Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD,
+        bundled_extension_creation_flags));
 
     // OEM default apps.
     int oem_extension_creation_flags =
@@ -758,16 +747,14 @@
     chromeos::DemoSession::Get()->SetExtensionsExternalLoader(loader);
     provider_list->push_back(std::move(demo_apps_provider));
   }
-
 #elif defined(OS_LINUX)
-  if (!profile->IsLegacySupervised()) {
-    provider_list->push_back(std::make_unique<ExternalProviderImpl>(
-        service,
-        new ExternalPrefLoader(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
-                               ExternalPrefLoader::NONE, nullptr),
-        profile, Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD,
-        bundled_extension_creation_flags));
-  }
+  provider_list->push_back(std::make_unique<ExternalProviderImpl>(
+      service,
+      new ExternalPrefLoader(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
+                             ExternalPrefLoader::USE_USER_TYPE_PROFILE_FILTER,
+                             profile),
+      profile, Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD,
+      bundled_extension_creation_flags));
 #endif
 
   if (!profile->IsLegacySupervised()) {
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 350256b..3e4925f8 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -188,11 +188,6 @@
     "expiry_milestone": 74
   },
   {
-    "name": "ash-enable-trilinear-filtering",
-    // "owners": [ "your-team" ],
-    "expiry_milestone": 76
-  },
-  {
     "name": "ash-enable-unified-desktop",
     // "owners": [ "your-team" ],
     "expiry_milestone": 76
@@ -2270,7 +2265,7 @@
   },
   {
     "name": "fill-on-account-select",
-    // "owners": [ "your-team" ],
+    "owners": [ "jdoerrie" ],
     "expiry_milestone": 76
   },
   {
@@ -2599,11 +2594,6 @@
     "expiry_milestone": 76
   },
   {
-    "name": "num-raster-threads",
-    // "owners": [ "your-team" ],
-    "expiry_milestone": 76
-  },
-  {
     "name": "oculus-vr",
     // "owners": [ "your-team" ],
     "expiry_milestone": 76
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index effae83..f641fe7a 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1333,14 +1333,6 @@
     "Enable NTLMv2 HTTP Authentication. This disables NTLMv1 support.";
 #endif
 
-const char kNumRasterThreadsName[] = "Number of raster threads";
-const char kNumRasterThreadsDescription[] =
-    "Specify the number of raster threads.";
-const char kNumRasterThreadsOne[] = "1";
-const char kNumRasterThreadsTwo[] = "2";
-const char kNumRasterThreadsThree[] = "3";
-const char kNumRasterThreadsFour[] = "4";
-
 const char kOfferStoreUnmaskedWalletCardsName[] =
     "Google Payments card saving checkbox";
 const char kOfferStoreUnmaskedWalletCardsDescription[] =
@@ -2804,12 +2796,6 @@
 const char kAutofillDropdownLayoutDescription[] =
     "Alternate visual designs for the Autofill dropdown.";
 
-const char kAutofillPrimaryInfoStyleExperimentName[] =
-    "Autofill experiment with primary info style";
-const char kAutofillPrimaryInfoStyleExperimentDescription[] =
-    "Allow experimentation with different typefaces for primary info on the "
-    "Autofill dropdown (addresses and payment methods)";
-
 const char kDoodlesOnLocalNtpName[] = "Enable doodles on the local NTP";
 const char kDoodlesOnLocalNtpDescription[] =
     "Show doodles on the local New Tab page if Google is the default search "
@@ -3103,10 +3089,6 @@
 const char kAshEnablePipRoundedCornersDescription[] =
     "Enable rounded corners on the Picture-in-Picture window.";
 
-const char kAshEnableTrilinearFilteringName[] = "Enable trilinear filtering.";
-const char kAshEnableTrilinearFilteringDescription[] =
-    "Enable trilinear filtering.";
-
 const char kAshEnableUnifiedDesktopName[] = "Unified desktop mode";
 const char kAshEnableUnifiedDesktopDescription[] =
     "Enable unified desktop mode which allows a window to span multiple "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 98b1543..0b521517 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -816,13 +816,6 @@
 extern const char kNtlmV2EnabledDescription[];
 #endif
 
-extern const char kNumRasterThreadsName[];
-extern const char kNumRasterThreadsDescription[];
-extern const char kNumRasterThreadsOne[];
-extern const char kNumRasterThreadsTwo[];
-extern const char kNumRasterThreadsThree[];
-extern const char kNumRasterThreadsFour[];
-
 extern const char kOfferStoreUnmaskedWalletCardsName[];
 extern const char kOfferStoreUnmaskedWalletCardsDescription[];
 
@@ -1668,9 +1661,6 @@
 extern const char kAutofillDropdownLayoutName[];
 extern const char kAutofillDropdownLayoutDescription[];
 
-extern const char kAutofillPrimaryInfoStyleExperimentName[];
-extern const char kAutofillPrimaryInfoStyleExperimentDescription[];
-
 extern const char kDoodlesOnLocalNtpName[];
 extern const char kDoodlesOnLocalNtpDescription[];
 
@@ -1858,9 +1848,6 @@
 extern const char kAshEnablePipRoundedCornersName[];
 extern const char kAshEnablePipRoundedCornersDescription[];
 
-extern const char kAshEnableTrilinearFilteringName[];
-extern const char kAshEnableTrilinearFilteringDescription[];
-
 extern const char kAshEnableUnifiedDesktopName[];
 extern const char kAshEnableUnifiedDesktopDescription[];
 
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
index 9ffa63d1..95a1f92 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -29,7 +29,6 @@
 #include "chrome/browser/plugins/plugin_utils.h"
 #include "chrome/browser/prerender/prerender_manager.h"
 #include "chrome/browser/prerender/prerender_manager_factory.h"
-#include "chrome/browser/prerender/prerender_resource_throttle.h"
 #include "chrome/browser/prerender/prerender_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_io_data.h"
@@ -444,18 +443,6 @@
 
   if (first_throttle)
     throttles->push_back(base::WrapUnique(first_throttle));
-
-  const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
-  if (info->IsPrerendering()) {
-    // TODO(jam): remove this throttle once http://crbug.com/740130 is fixed and
-    // PrerendererURLLoaderThrottle can be used for frame requests in the
-    // network-service-disabled mode.
-    if (!base::FeatureList::IsEnabled(network::features::kNetworkService) &&
-        content::IsResourceTypeFrame(info->GetResourceType())) {
-      throttles->push_back(
-          std::make_unique<prerender::PrerenderResourceThrottle>(request));
-    }
-  }
 }
 
 bool ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
diff --git a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
index ed5308cd..035ffbb 100644
--- a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
+++ b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
@@ -27,6 +27,7 @@
 #include "services/metrics/public/cpp/ukm_builders.h"
 #include "services/metrics/public/cpp/ukm_source.h"
 #include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h"
+#include "services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h"
 #include "url/gurl.h"
 #include "url/url_constants.h"
 
@@ -833,3 +834,27 @@
   CheckPageInfoUkmMetrics(url1, false /* is_visible */, 2);
   CheckPageInfoUkmMetrics(url2, true /* is_visible */, 2);
 }
+
+// Build id is only emitted for official builds.
+#if defined(OFFICIAL_BUILD)
+#define MAYBE_RendererBuildId RendererBuildId
+#else
+#define MAYBE_RendererBuildId DISABLED_RendererBuildId
+#endif
+IN_PROC_BROWSER_TEST_F(ProcessMemoryMetricsEmitterTest, MAYBE_RendererBuildId) {
+  for (content::RenderProcessHost::iterator rph_iter =
+           content::RenderProcessHost::AllHostsIterator();
+       !rph_iter.IsAtEnd(); rph_iter.Advance()) {
+    const base::Process& process = rph_iter.GetCurrentValue()->GetProcess();
+    auto maps =
+        memory_instrumentation::OSMetrics::GetProcessMemoryMaps(process.Pid());
+    bool found = false;
+    for (const memory_instrumentation::mojom::VmRegionPtr& region : maps) {
+      if (region->module_debugid.empty())
+        continue;
+      found = true;
+      break;
+    }
+    EXPECT_TRUE(found);
+  }
+}
diff --git a/chrome/browser/net/variations_http_headers_browsertest.cc b/chrome/browser/net/variations_http_headers_browsertest.cc
index 3aa17fe..8b47297a 100644
--- a/chrome/browser/net/variations_http_headers_browsertest.cc
+++ b/chrome/browser/net/variations_http_headers_browsertest.cc
@@ -101,21 +101,25 @@
   const net::EmbeddedTestServer* server() const { return &https_server_; }
   net::EmbeddedTestServer* server() { return &https_server_; }
 
-  GURL GetGoogleUrl(const std::string& path) const {
+  GURL GetGoogleUrlWithPath(const std::string& path) const {
     return server()->GetURL("www.google.com", path);
   }
 
-  GURL GetGoogleUrl() const { return GetGoogleUrl("/landing.html"); }
+  GURL GetGoogleUrl() const { return GetGoogleUrlWithPath("/landing.html"); }
 
-  GURL GetGoogleRedirectUrl1() const { return GetGoogleUrl("/redirect"); }
+  GURL GetGoogleRedirectUrl1() const {
+    return GetGoogleUrlWithPath("/redirect");
+  }
 
-  GURL GetGoogleRedirectUrl2() const { return GetGoogleUrl("/redirect2"); }
+  GURL GetGoogleRedirectUrl2() const {
+    return GetGoogleUrlWithPath("/redirect2");
+  }
 
-  GURL GetExampleUrl(const std::string& path) const {
+  GURL GetExampleUrlWithPath(const std::string& path) const {
     return server()->GetURL("www.example.com", path);
   }
 
-  GURL GetExampleUrl() const { return GetExampleUrl("/landing.html"); }
+  GURL GetExampleUrl() const { return GetExampleUrlWithPath("/landing.html"); }
 
   // Returns whether a given |header| has been received for a |url|. If
   // |url| has not been observed, fails an EXPECT and returns false.
@@ -153,12 +157,14 @@
 
   // Registers a service worker for google.com root scope.
   void RegisterServiceWorker(const std::string& worker_path) {
-    GURL url = GetGoogleUrl("/service_worker/create_service_worker.html");
+    GURL url =
+        GetGoogleUrlWithPath("/service_worker/create_service_worker.html");
     EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), url));
 
     const std::string scope = "/";
-    EXPECT_EQ("DONE", EvalJs(GetWebContents(), "register('" + worker_path +
-                                                   "', '" + scope + "');"));
+    EXPECT_EQ("DONE",
+              EvalJs(GetWebContents(), base::StrCat({"register('", worker_path,
+                                                     "', '", scope, "');"})));
   }
 
   // Registers the given service worker for google.com then tests navigation and
@@ -168,7 +174,8 @@
     RegisterServiceWorker(worker_path);
 
     // Navigate to a Google URL.
-    GURL page_url = GetGoogleUrl("/service_worker/fetch_from_page.html");
+    GURL page_url =
+        GetGoogleUrlWithPath("/service_worker/fetch_from_page.html");
     ui_test_utils::NavigateToURL(browser(), page_url);
     EXPECT_TRUE(HasReceivedHeader(page_url, "X-Client-Data"));
     // Check that there is a controller to check that the test is really testing
@@ -177,15 +184,15 @@
               EvalJs(GetWebContents(), "!!navigator.serviceWorker.controller"));
 
     // Verify subresource requests from the page also have X-Client-Data.
-    EXPECT_EQ("hello",
-              EvalJs(GetWebContents(),
-                     "fetch_from_page('" + GetGoogleUrl().spec() + "');"));
+    EXPECT_EQ("hello", EvalJs(GetWebContents(),
+                              base::StrCat({"fetch_from_page('",
+                                            GetGoogleUrl().spec(), "');"})));
     EXPECT_TRUE(HasReceivedHeader(GetGoogleUrl(), "X-Client-Data"));
 
     // But not if they are to non-Google domains.
-    EXPECT_EQ("hello",
-              EvalJs(GetWebContents(),
-                     "fetch_from_page('" + GetExampleUrl().spec() + "');"));
+    EXPECT_EQ("hello", EvalJs(GetWebContents(),
+                              base::StrCat({"fetch_from_page('",
+                                            GetExampleUrl().spec(), "');"})));
     EXPECT_FALSE(HasReceivedHeader(GetExampleUrl(), "X-Client-Data"));
   }
 
@@ -199,17 +206,17 @@
   void WorkerScriptTest(const std::string& page, const std::string& worker) {
     // Build a worker URL for a google.com worker that imports
     // an example.com script.
-    GURL absolute_import = GetExampleUrl("/workers/empty.js");
+    GURL absolute_import = GetExampleUrlWithPath("/workers/empty.js");
     const std::string worker_path = base::StrCat(
         {worker, "?import=",
          net::EscapeQueryParamValue(absolute_import.spec(), false)});
-    GURL worker_url = GetGoogleUrl(worker_path);
+    GURL worker_url = GetGoogleUrlWithPath(worker_path);
 
     // Build the page URL that tells the page to create the worker.
     const std::string page_path = base::StrCat(
         {page,
          "?worker_url=", net::EscapeQueryParamValue(worker_url.spec(), false)});
-    GURL page_url = GetGoogleUrl(page_path);
+    GURL page_url = GetGoogleUrlWithPath(page_path);
 
     // Navigate and test.
     EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), page_url));
@@ -219,8 +226,8 @@
     EXPECT_TRUE(HasReceivedHeader(worker_url, "X-Client-Data"));
 
     // And on import script requests to Google.
-    EXPECT_TRUE(
-        HasReceivedHeader(GetGoogleUrl("/workers/empty.js"), "X-Client-Data"));
+    EXPECT_TRUE(HasReceivedHeader(GetGoogleUrlWithPath("/workers/empty.js"),
+                                  "X-Client-Data"));
 
     // But not on requests not to Google.
     EXPECT_FALSE(HasReceivedHeader(absolute_import, "X-Client-Data"));
@@ -464,18 +471,20 @@
 // attached to requests for service worker scripts.
 IN_PROC_BROWSER_TEST_F(VariationsHttpHeadersBrowserTest, ServiceWorkerScript) {
   // Register a service worker that imports scripts.
-  GURL absolute_import = GetExampleUrl("/service_worker/empty.js");
+  GURL absolute_import = GetExampleUrlWithPath("/service_worker/empty.js");
   const std::string worker_path =
       "/service_worker/import_scripts_worker.js?import=" +
       net::EscapeQueryParamValue(absolute_import.spec(), false);
   RegisterServiceWorker(worker_path);
 
   // Test that the header is present on the main script request.
-  EXPECT_TRUE(HasReceivedHeader(GetGoogleUrl(worker_path), "X-Client-Data"));
+  EXPECT_TRUE(
+      HasReceivedHeader(GetGoogleUrlWithPath(worker_path), "X-Client-Data"));
 
   // And on import script requests to Google.
-  EXPECT_TRUE(HasReceivedHeader(GetGoogleUrl("/service_worker/empty.js"),
-                                "X-Client-Data"));
+  EXPECT_TRUE(HasReceivedHeader(
+      GetGoogleUrlWithPath("/service_worker/empty.js"), "X-Client-Data"));
+
   // But not on requests not to Google.
   EXPECT_FALSE(HasReceivedHeader(absolute_import, "X-Client-Data"));
 }
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index c5d65ca..2c2a3bb 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -158,6 +158,8 @@
     const blink::NotificationResources& notification_resources) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
+  closed_notifications_.erase(notification_id);
+
   // Posted tasks can request notifications to be added, which would cause a
   // crash (see |ScopedKeepAlive|). We just do nothing here, the user would not
   // see the notification anyway, since we are shutting down.
diff --git a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc
index 00c10ed..9d0e597 100644
--- a/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc
+++ b/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc
@@ -558,6 +558,51 @@
 }
 
 IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
+                       CloseAndUserClosePersistentNotificationWithTag) {
+  GrantNotificationPermissionForTest();
+  {
+    std::string script_result;
+    ASSERT_TRUE(RunScript(
+        R"(DisplayPersistentNotification('action_close', {
+            tag: 'tag-1'
+        }))",
+        &script_result));
+    EXPECT_EQ("ok", script_result);
+
+    std::vector<message_center::Notification> notifications =
+        GetDisplayedNotifications(true /* is_persistent */);
+    ASSERT_EQ(1u, notifications.size());
+
+    display_service_tester_->SimulateClick(
+        NotificationHandler::Type::WEB_PERSISTENT, notifications[0].id(),
+        base::nullopt /* action_index */, base::nullopt /* reply */);
+
+    ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result));
+    EXPECT_EQ("action_close", script_result);
+  }
+  {
+    std::string script_result;
+    ASSERT_TRUE(RunScript(
+        R"(DisplayPersistentNotification('close_test', {
+            tag: 'tag-1'
+        }))",
+        &script_result));
+    EXPECT_EQ("ok", script_result);
+
+    std::vector<message_center::Notification> notifications =
+        GetDisplayedNotifications(true /* is_persistent */);
+    ASSERT_EQ(1u, notifications.size());
+
+    display_service_tester_->RemoveNotification(
+        NotificationHandler::Type::WEB_PERSISTENT, notifications[0].id(),
+        true /* by_user */);
+
+    ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result));
+    EXPECT_EQ("closing notification: close_test", script_result);
+  }
+}
+
+IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
                        TestDisplayOriginContextMessage) {
   RequestAndAcceptPermission();
 
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
index 9b51a90..ed7b671 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
@@ -1190,7 +1190,8 @@
 
 // Main frame delivers an input notification. Subsequently, a subframe delivers
 // an input notification, where the input occurred first. Verify that
-// FirstInputDelay and FirstInputTimestamp come from the subframe.
+// FirstInputDelay and FirstInputTimestamp come from the main frame, as FID is
+// currently main-frame-only.
 TEST_F(MetricsWebContentsObserverTest,
        FirstInputDelayAndTimingSubframeFirstDeliveredSecond) {
   mojom::PageLoadTiming timing;
@@ -1231,12 +1232,11 @@
   const mojom::InteractiveTiming& interactive_timing =
       *complete_timings().back()->interactive_timing;
 
-  EXPECT_EQ(base::TimeDelta::FromMilliseconds(15),
+  EXPECT_EQ(base::TimeDelta::FromMilliseconds(10),
             interactive_timing.first_input_delay);
-  // Ensure the timestamp is from the subframe. The main frame timestamp was 100
-  // minutes.
-  EXPECT_LT(interactive_timing.first_input_timestamp,
-            base::TimeDelta::FromMinutes(10));
+  // Ensure the timestamp is from the main frame.
+  EXPECT_EQ(interactive_timing.first_input_timestamp,
+            base::TimeDelta::FromMinutes(100));
 
   CheckNoErrorEvents();
 }
@@ -1280,7 +1280,6 @@
   timing.interactive_timing->first_input_timestamp =
       base::TimeDelta::FromMilliseconds(90);
 
-  web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl));
   SimulateTimingUpdate(timing);
 
   // Navigate again to confirm the timing updated for the mainframe message.
@@ -1330,7 +1329,6 @@
       base::TimeDelta::FromMilliseconds(100);
   main_frame_timing.interactive_timing->longest_input_timestamp =
       base::TimeDelta::FromMilliseconds(2000);
-  web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl));
   SimulateTimingUpdate(main_frame_timing);
 
   // Second subframe.
@@ -1366,6 +1364,9 @@
 //     LID (15ms)                 LID (100ms)                LID (200ms)
 //
 // Delivery order: Main Frame -> Subframe1 -> Subframe2.
+//
+// Since LID is only recorded in the main frame, we expect the subframe LID to
+// be ignored.
 TEST_F(MetricsWebContentsObserverTest, LongestInputInSubframe) {
   content::WebContentsTester* web_contents_tester =
       content::WebContentsTester::For(web_contents());
@@ -1413,15 +1414,11 @@
   const mojom::InteractiveTiming& interactive_timing =
       *complete_timings().back()->interactive_timing;
 
-  EXPECT_EQ(base::TimeDelta::FromMilliseconds(200),
+  EXPECT_EQ(base::TimeDelta::FromMilliseconds(100),
             interactive_timing.longest_input_delay);
 
-  // Actual LID timestamp includes the delta between navigation start in
-  // subframe2 and navigation time in the main frame. That delta varies with
-  // different runs, so we only check here that the timestamp is greater than
-  // 3s.
-  EXPECT_GT(interactive_timing.longest_input_timestamp.value(),
-            base::TimeDelta::FromMilliseconds(3000));
+  EXPECT_EQ(interactive_timing.longest_input_timestamp.value(),
+            base::TimeDelta::FromMilliseconds(2000));
 
   CheckNoErrorEvents();
 }
diff --git a/chrome/browser/page_load_metrics/observers/local_network_requests_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/local_network_requests_page_load_metrics_observer_unittest.cc
index 57680975..256fcbd 100644
--- a/chrome/browser/page_load_metrics/observers/local_network_requests_page_load_metrics_observer_unittest.cc
+++ b/chrome/browser/page_load_metrics/observers/local_network_requests_page_load_metrics_observer_unittest.cc
@@ -722,7 +722,9 @@
   }
 
   // At this point, we should still only see the domain type UKM entry.
-  EXPECT_EQ(1ul, test_ukm_recorder().entries_count());
+  // Also history manipulation intervention will log a UKM for navigating away
+  // from a page without user interaction.
+  EXPECT_EQ(2ul, test_ukm_recorder().entries_count());
 
   // Close the page.
   DeleteContents();
@@ -891,6 +893,8 @@
   navigation_simulator->CommitErrorPage();
 
   // Nothing should have been generated.
-  EXPECT_EQ(0ul, test_ukm_recorder().entries_count());
+  // Note that the expected count is 1 because history manipulation intervention
+  // will log a UKM for navigating away from a page without user interaction.
+  EXPECT_EQ(1ul, test_ukm_recorder().entries_count());
   ExpectNoHistograms();
 }
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc
index 3d2173fc..e1546de 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc
+++ b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc
@@ -369,29 +369,16 @@
           new_interactive_timing.first_invalidating_input;
       target_interactive_timing->interactive_detection =
           new_interactive_timing.interactive_detection;
-    }
 
-    if (MaybeUpdateTimeDelta(&target_interactive_timing->first_input_timestamp,
-                             navigation_start_offset,
-                             new_interactive_timing.first_input_timestamp)) {
-      // If we updated the first input timestamp, also update the
-      // associated first input delay.
+      // first/longest input delay are currently only tracked in the main frame.
       target_interactive_timing->first_input_delay =
           new_interactive_timing.first_input_delay;
-    }
-
-    if (new_interactive_timing.longest_input_delay.has_value()) {
-      base::TimeDelta new_longest_input_timestamp =
-          navigation_start_offset +
-          new_interactive_timing.longest_input_timestamp.value();
-      if (!target_interactive_timing->longest_input_delay.has_value() ||
-          new_interactive_timing.longest_input_delay.value() >
-              target_interactive_timing->longest_input_delay.value()) {
-        target_interactive_timing->longest_input_delay =
-            new_interactive_timing.longest_input_delay;
-        target_interactive_timing->longest_input_timestamp =
-            new_longest_input_timestamp;
-      }
+      target_interactive_timing->first_input_timestamp =
+          new_interactive_timing.first_input_timestamp;
+      target_interactive_timing->longest_input_delay =
+          new_interactive_timing.longest_input_delay;
+      target_interactive_timing->longest_input_timestamp =
+          new_interactive_timing.longest_input_timestamp;
     }
   }
 
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index 92a2243..e50fc68 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -79,8 +79,8 @@
 #include "ui/accessibility/ax_node.h"
 #include "ui/accessibility/ax_tree.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/base/resource/resource_bundle.h"
-#include "ui/base/test/test_clipboard.h"
 #include "ui/events/keycodes/dom/keycode_converter.h"
 #include "ui/gfx/geometry/point.h"
 #include "url/gurl.h"
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 5a807b58..7a73ab7 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -21,7 +21,6 @@
 #include "chrome/browser/prerender/prerender_handle.h"
 #include "chrome/browser/prerender/prerender_manager.h"
 #include "chrome/browser/prerender/prerender_manager_factory.h"
-#include "chrome/browser/prerender/prerender_resource_throttle.h"
 #include "chrome/browser/prerender/prerender_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/task_manager/web_contents_tags.h"
@@ -57,23 +56,6 @@
 
 namespace prerender {
 
-namespace {
-
-void ResumeThrottles(
-    std::vector<base::WeakPtr<PrerenderResourceThrottle>> throttles,
-    std::vector<base::WeakPtr<PrerenderResourceThrottle>> idle_resources) {
-  for (auto resource : idle_resources) {
-    if (resource)
-      resource->ResetResourcePriority();
-  }
-  for (size_t i = 0; i < throttles.size(); i++) {
-    if (throttles[i])
-      throttles[i]->ResumeHandler();
-  }
-}
-
-}  // namespace
-
 class PrerenderContentsFactoryImpl : public PrerenderContents::Factory {
  public:
   PrerenderContents* CreatePrerenderContents(
@@ -740,12 +722,6 @@
   }
 
   NotifyPrerenderStop();
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::IO},
-      base::BindOnce(&ResumeThrottles, resource_throttles_, idle_resources_));
-  resource_throttles_.clear();
-  idle_resources_.clear();
 }
 
 void PrerenderContents::CancelPrerenderForPrinting() {
@@ -771,16 +747,6 @@
     prerender_canceler_binding_.Bind(std::move(request));
 }
 
-void PrerenderContents::AddResourceThrottle(
-    const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
-  resource_throttles_.push_back(throttle);
-}
-
-void PrerenderContents::AddIdleResource(
-    const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
-  idle_resources_.push_back(throttle);
-}
-
 void PrerenderContents::AddNetworkBytes(int64_t bytes) {
   network_bytes_ += bytes;
   for (Observer& observer : observer_list_)
diff --git a/chrome/browser/prerender/prerender_contents.h b/chrome/browser/prerender/prerender_contents.h
index cd67528e..12cd7304b 100644
--- a/chrome/browser/prerender/prerender_contents.h
+++ b/chrome/browser/prerender/prerender_contents.h
@@ -52,7 +52,6 @@
 namespace prerender {
 
 class PrerenderManager;
-class PrerenderResourceThrottle;
 
 class PrerenderContents : public content::NotificationObserver,
                           public content::WebContentsObserver,
@@ -227,18 +226,6 @@
   // Marks prerender as used and releases any throttled resource requests.
   void PrepareForUse();
 
-  // Called when a PrerenderResourceThrottle defers a request. If the prerender
-  // is used it'll be resumed on the IO thread, otherwise they will get
-  // cancelled automatically if prerendering is cancelled.
-  void AddResourceThrottle(
-      const base::WeakPtr<PrerenderResourceThrottle>& throttle);
-
-  // Called when a PrerenderResourceThrottle changes a resource priority to
-  // net::IDLE. The resources are reset back to their original priorities when
-  // the prerender contents is swapped in.
-  void AddIdleResource(
-      const base::WeakPtr<PrerenderResourceThrottle>& throttle);
-
   // Increments the number of bytes fetched over the network for this prerender.
   void AddNetworkBytes(int64_t bytes);
 
@@ -365,12 +352,6 @@
   // Caches pages to be added to the history.
   AddPageVector add_page_vector_;
 
-  // Resources that are throttled, pending a prerender use. Can only access a
-  // throttle on the IO thread.
-  std::vector<base::WeakPtr<PrerenderResourceThrottle> > resource_throttles_;
-  // Resources for which the priority was lowered to net::IDLE.
-  std::vector<base::WeakPtr<PrerenderResourceThrottle>> idle_resources_;
-
   // A running tally of the number of bytes this prerender has caused to be
   // transferred over the network for resources.  Updated with AddNetworkBytes.
   int64_t network_bytes_;
diff --git a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
index 82d1174..4033dd7d 100644
--- a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
+++ b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
@@ -50,6 +50,7 @@
 #include "services/network/public/cpp/features.h"
 #include "services/network/public/mojom/cookie_manager.mojom.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 
 using prerender::test_utils::DestructionWaiter;
 using prerender::test_utils::RequestCounter;
diff --git a/chrome/browser/prerender/prerender_resource_throttle.cc b/chrome/browser/prerender/prerender_resource_throttle.cc
deleted file mode 100644
index 72e98b0..0000000
--- a/chrome/browser/prerender/prerender_resource_throttle.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Copyright 2013 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/prerender/prerender_resource_throttle.h"
-
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "base/numerics/safe_conversions.h"
-#include "base/task/post_task.h"
-#include "build/build_config.h"
-#include "chrome/browser/prerender/prerender_final_status.h"
-#include "chrome/browser/prerender/prerender_manager.h"
-#include "chrome/browser/prerender/prerender_util.h"
-#include "chrome/common/prerender_util.h"
-#include "content/public/browser/browser_task_traits.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/resource_dispatcher_host.h"
-#include "content/public/browser/web_contents.h"
-#include "net/base/load_flags.h"
-#include "net/http/http_response_headers.h"
-#include "net/url_request/redirect_info.h"
-#include "net/url_request/url_request.h"
-
-using content::BrowserThread;
-using content::ResourceRequestInfo;
-using content::ResourceType;
-
-namespace prerender {
-
-namespace {
-PrerenderContents* g_prerender_contents_for_testing;
-
-// Returns true if the response has a "no-store" cache control header.
-bool IsNoStoreResponse(const net::URLRequest& request) {
-  const net::HttpResponseInfo& response_info = request.response_info();
-  return response_info.headers.get() &&
-         response_info.headers->HasHeaderValue("cache-control", "no-store");
-}
-
-}  // namespace
-
-// Used to pass information between different UI thread tasks of the same
-// throttle. This is reference counted as the throttler may be destroyed before
-// the UI thread task has a chance to run.
-//
-// This class is created on the IO thread, and destroyed on the UI thread. Its
-// members should only be accessed on the UI thread.
-class PrerenderThrottleInfo
-    : public base::RefCountedThreadSafe<PrerenderThrottleInfo,
-                                        BrowserThread::DeleteOnUIThread> {
- public:
-  PrerenderThrottleInfo()
-      : mode_(NO_PRERENDER), origin_(ORIGIN_NONE), manager_(nullptr) {}
-
-  void Set(PrerenderMode mode, Origin origin, PrerenderManager* manager) {
-    DCHECK_CURRENTLY_ON(BrowserThread::UI);
-    mode_ = mode;
-    origin_ = origin;
-    manager_ = manager->AsWeakPtr();
-  }
-
-  PrerenderMode mode() const { return mode_; }
-  Origin origin() const { return origin_; }
-  base::WeakPtr<PrerenderManager> manager() const {
-    DCHECK_CURRENTLY_ON(BrowserThread::UI);
-    return manager_;
-  }
-
- private:
-  friend class base::RefCountedThreadSafe<PrerenderThrottleInfo>;
-  friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
-  friend class base::DeleteHelper<PrerenderThrottleInfo>;
-  ~PrerenderThrottleInfo() {}
-
-  PrerenderMode mode_;
-  Origin origin_;
-  base::WeakPtr<PrerenderManager> manager_;
-};
-
-void PrerenderResourceThrottle::OverridePrerenderContentsForTesting(
-    PrerenderContents* contents) {
-  g_prerender_contents_for_testing = contents;
-}
-
-PrerenderResourceThrottle::PrerenderResourceThrottle(net::URLRequest* request)
-    : request_(request),
-      prerender_throttle_info_(new PrerenderThrottleInfo()) {
-// Priorities for prerendering requests are lowered, to avoid competing with
-// other page loads, except on Android where this is less likely to be a
-// problem. In some cases, this may negatively impact the performance of
-// prerendering, see https://crbug.com/652746 for details.
-#if !defined(OS_ANDROID)
-  // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs)
-  // should remain at MAXIMUM_PRIORITY.
-  if (request_->load_flags() & net::LOAD_IGNORE_LIMITS) {
-    DCHECK_EQ(request_->priority(), net::MAXIMUM_PRIORITY);
-  } else if (request_->priority() != net::IDLE) {
-    original_request_priority_ = request_->priority();
-    // In practice, the resource scheduler does not know about the request yet,
-    // and it falls back to calling request_->SetPriority(), so it would be
-    // possible to do just that here. It is cleaner and more robust to go
-    // through the resource dispatcher host though.
-    if (content::ResourceDispatcherHost::Get()) {
-      content::ResourceDispatcherHost::Get()->ReprioritizeRequest(request_,
-                                                                  net::IDLE);
-    }
-  }
-#endif  // OS_ANDROID
-}
-
-PrerenderResourceThrottle::~PrerenderResourceThrottle() {}
-
-void PrerenderResourceThrottle::WillStartRequest(bool* defer) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  const content::ResourceRequestInfo* info =
-      content::ResourceRequestInfo::ForRequest(request_);
-  *defer = true;
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::UI},
-      base::BindOnce(&PrerenderResourceThrottle::WillStartRequestOnUI,
-                     AsWeakPtr(), request_->method(), info->GetResourceType(),
-                     request_->url(), info->GetWebContentsGetterForRequest(),
-                     prerender_throttle_info_));
-}
-
-void PrerenderResourceThrottle::WillRedirectRequest(
-    const net::RedirectInfo& redirect_info,
-    bool* defer) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  const content::ResourceRequestInfo* info =
-      content::ResourceRequestInfo::ForRequest(request_);
-  *defer = true;
-  std::string header;
-  request_->GetResponseHeaderByName(kFollowOnlyWhenPrerenderShown, &header);
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::UI},
-      base::BindOnce(&PrerenderResourceThrottle::WillRedirectRequestOnUI,
-                     AsWeakPtr(), header, info->GetResourceType(),
-                     info->IsAsync(), IsNoStoreResponse(*request_),
-                     redirect_info.new_url,
-                     info->GetWebContentsGetterForRequest()));
-}
-
-void PrerenderResourceThrottle::WillProcessResponse(bool* defer) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  const content::ResourceRequestInfo* info =
-      content::ResourceRequestInfo::ForRequest(request_);
-  if (!info)
-    return;
-
-  DCHECK_GT(request_->url_chain().size(), 0u);
-  int redirect_count =
-      base::saturated_cast<int>(request_->url_chain().size()) - 1;
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::UI},
-      base::BindOnce(&PrerenderResourceThrottle::WillProcessResponseOnUI,
-                     content::IsResourceTypeFrame(info->GetResourceType()),
-                     IsNoStoreResponse(*request_), redirect_count,
-                     prerender_throttle_info_));
-}
-
-const char* PrerenderResourceThrottle::GetNameForLogging() const {
-  return "PrerenderResourceThrottle";
-}
-
-void PrerenderResourceThrottle::ResumeHandler() {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  Resume();
-}
-
-void PrerenderResourceThrottle::ResetResourcePriority() {
-  if (!original_request_priority_)
-    return;
-
-  if (content::ResourceDispatcherHost::Get()) {
-    content::ResourceDispatcherHost::Get()->ReprioritizeRequest(
-        request_, original_request_priority_.value());
-  }
-}
-
-// static
-void PrerenderResourceThrottle::WillStartRequestOnUI(
-    const base::WeakPtr<PrerenderResourceThrottle>& throttle,
-    const std::string& method,
-    ResourceType resource_type,
-    const GURL& url,
-    const ResourceRequestInfo::WebContentsGetter& web_contents_getter,
-    scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  bool cancel = false;
-  PrerenderContents* prerender_contents =
-      PrerenderContentsFromGetter(web_contents_getter);
-  if (prerender_contents) {
-    DCHECK(prerender_throttle_info);
-    prerender_throttle_info->Set(prerender_contents->prerender_mode(),
-                                 prerender_contents->origin(),
-                                 prerender_contents->prerender_manager());
-
-    // Abort any prerenders that spawn requests that use unsupported HTTP
-    // methods or schemes.
-    if (!IsValidHttpMethod(prerender_contents->prerender_mode(), method)) {
-      // If this is a full prerender, cancel the prerender in response to
-      // invalid requests.  For prefetches, cancel invalid requests but keep the
-      // prefetch going, unless it's the main frame that's invalid.
-      if (prerender_contents->prerender_mode() == FULL_PRERENDER ||
-          resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
-        prerender_contents->Destroy(FINAL_STATUS_INVALID_HTTP_METHOD);
-      }
-      cancel = true;
-    } else if (!DoesSubresourceURLHaveValidScheme(url) &&
-               resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
-      // Destroying the prerender for unsupported scheme only for non-main
-      // resource to allow chrome://crash to actually crash in the
-      // *RendererCrash tests instead of being intercepted here. The
-      // unsupported
-      // scheme for the main resource is checked in WillRedirectRequestOnUI()
-      // and PrerenderContents::CheckURL(). See http://crbug.com/673771.
-      prerender_contents->Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME);
-      ReportUnsupportedPrerenderScheme(url);
-      cancel = true;
-#if defined(OS_ANDROID)
-    } else if (resource_type == content::RESOURCE_TYPE_FAVICON) {
-      // Delay icon fetching until the contents are getting swapped in
-      // to conserve network usage in mobile devices.
-      prerender_contents->AddResourceThrottle(throttle);
-
-      // No need to call AddIdleResource() on Android.
-      return;
-#endif
-    }
-
-#if !defined(OS_ANDROID)
-    if (!cancel)
-      prerender_contents->AddIdleResource(throttle);
-#endif
-  }
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::IO},
-      base::BindOnce(cancel ? &PrerenderResourceThrottle::Cancel
-                            : &PrerenderResourceThrottle::ResumeHandler,
-                     throttle));
-}
-
-// static
-void PrerenderResourceThrottle::WillRedirectRequestOnUI(
-    const base::WeakPtr<PrerenderResourceThrottle>& throttle,
-    const std::string& follow_only_when_prerender_shown_header,
-    ResourceType resource_type,
-    bool async,
-    bool is_no_store,
-    const GURL& new_url,
-    const ResourceRequestInfo::WebContentsGetter& web_contents_getter) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  bool cancel = false;
-  PrerenderContents* prerender_contents =
-      PrerenderContentsFromGetter(web_contents_getter);
-  if (prerender_contents) {
-    RecordPrefetchResponseReceived(
-        PrerenderHistograms::GetHistogramPrefix(prerender_contents->origin()),
-        content::IsResourceTypeFrame(resource_type), true /* is_redirect */,
-        is_no_store);
-    // Abort any prerenders with requests which redirect to invalid schemes.
-    if (!DoesURLHaveValidScheme(new_url)) {
-      prerender_contents->Destroy(FINAL_STATUS_UNSUPPORTED_SCHEME);
-      ReportUnsupportedPrerenderScheme(new_url);
-      cancel = true;
-    } else if (follow_only_when_prerender_shown_header == "1" &&
-               resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
-      // Only defer redirects with the Follow-Only-When-Prerender-Shown
-      // header. Do not defer redirects on main frame loads.
-      if (!async) {
-        // Cancel on deferred synchronous requests. Those will
-        // indefinitely hang up a renderer process.
-        prerender_contents->Destroy(FINAL_STATUS_BAD_DEFERRED_REDIRECT);
-        cancel = true;
-      } else {
-        // Defer the redirect until the prerender is used or canceled.
-        prerender_contents->AddResourceThrottle(throttle);
-        return;
-      }
-    }
-  }
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {BrowserThread::IO},
-      base::BindOnce(cancel ? &PrerenderResourceThrottle::Cancel
-                            : &PrerenderResourceThrottle::ResumeHandler,
-                     throttle));
-}
-
-// static
-void PrerenderResourceThrottle::WillProcessResponseOnUI(
-    bool is_main_resource,
-    bool is_no_store,
-    int redirect_count,
-    scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  DCHECK(prerender_throttle_info);
-  if (!prerender_throttle_info->manager())
-    return;
-
-  if (prerender_throttle_info->mode() != PREFETCH_ONLY)
-    return;
-
-  auto histogram_prefix = PrerenderHistograms::GetHistogramPrefix(
-      prerender_throttle_info->origin());
-  RecordPrefetchResponseReceived(histogram_prefix, is_main_resource,
-                                 false /* is_redirect */, is_no_store);
-  RecordPrefetchRedirectCount(histogram_prefix, is_main_resource,
-                              redirect_count);
-}
-
-// static
-PrerenderContents* PrerenderResourceThrottle::PrerenderContentsFromGetter(
-    const ResourceRequestInfo::WebContentsGetter& web_contents_getter) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  if (g_prerender_contents_for_testing)
-    return g_prerender_contents_for_testing;
-  return PrerenderContents::FromWebContents(web_contents_getter.Run());
-}
-
-}  // namespace prerender
diff --git a/chrome/browser/prerender/prerender_resource_throttle.h b/chrome/browser/prerender/prerender_resource_throttle.h
deleted file mode 100644
index a117d9bd..0000000
--- a/chrome/browser/prerender/prerender_resource_throttle.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2013 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_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_
-#define CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_
-
-#include <string>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
-#include "chrome/common/prerender_types.h"
-#include "content/public/browser/resource_request_info.h"
-#include "content/public/browser/resource_throttle.h"
-#include "content/public/common/resource_type.h"
-#include "net/base/request_priority.h"
-
-class GURL;
-
-namespace net {
-class URLRequest;
-}
-
-namespace prerender {
-class PrerenderContents;
-class PrerenderThrottleInfo;
-
-// This class implements policy on resource requests in prerenders.  It cancels
-// prerenders on certain requests.  It also defers certain requests until after
-// the prerender is swapped in.
-//
-// TODO(davidben): Experiment with deferring network requests that
-// would otherwise cancel the prerender.
-class PrerenderResourceThrottle
-    : public content::ResourceThrottle,
-      public base::SupportsWeakPtr<PrerenderResourceThrottle> {
- public:
-  explicit PrerenderResourceThrottle(net::URLRequest* request);
-
-  ~PrerenderResourceThrottle() override;
-
-  // content::ResourceThrottle implementation:
-  void WillStartRequest(bool* defer) override;
-  void WillRedirectRequest(const net::RedirectInfo& redirect_info,
-                           bool* defer) override;
-  void WillProcessResponse(bool* defer) override;
-  const char* GetNameForLogging() const override;
-
-  // Called by the PrerenderContents when a prerender becomes visible.
-  // May only be called if currently throttling the resource.
-  void ResumeHandler();
-
-  // Resets the resource priority back to its original value.
-  void ResetResourcePriority();
-
-  static void OverridePrerenderContentsForTesting(PrerenderContents* contents);
-
- private:
-  static void WillStartRequestOnUI(
-      const base::WeakPtr<PrerenderResourceThrottle>& throttle,
-      const std::string& method,
-      content::ResourceType resource_type,
-      const GURL& url,
-      const content::ResourceRequestInfo::WebContentsGetter&
-          web_contents_getter,
-      scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info);
-
-  static void WillRedirectRequestOnUI(
-      const base::WeakPtr<PrerenderResourceThrottle>& throttle,
-      const std::string& follow_only_when_prerender_shown_header,
-      content::ResourceType resource_type,
-      bool async,
-      bool is_no_store,
-      const GURL& new_url,
-      const content::ResourceRequestInfo::WebContentsGetter&
-          web_contents_getter);
-
-  static void WillProcessResponseOnUI(
-      bool is_main_resource,
-      bool is_no_store,
-      int redirect_count,
-      scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info);
-
-  // Helper to return the PrerenderContents given a WebContentsGetter. May
-  // return nullptr if it's gone.
-  static PrerenderContents* PrerenderContentsFromGetter(
-      const content::ResourceRequestInfo::WebContentsGetter&
-          web_contents_getter);
-
-  net::URLRequest* request_;
-
-  // The throttle changes most request priorities to IDLE during prerendering.
-  // The priority is reset back to the original priority when prerendering is
-  // finished.
-  base::Optional<net::RequestPriority> original_request_priority_;
-
-  scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_;
-
-  DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle);
-};
-
-}  // namespace prerender
-
-#endif  // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_
diff --git a/chrome/browser/prerender/prerender_resource_throttle_unittest.cc b/chrome/browser/prerender/prerender_resource_throttle_unittest.cc
deleted file mode 100644
index 8b74b9dd..0000000
--- a/chrome/browser/prerender/prerender_resource_throttle_unittest.cc
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright (c) 2012 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 <set>
-#include <utility>
-
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "base/macros.h"
-#include "base/run_loop.h"
-#include "chrome/browser/net/url_request_mock_util.h"
-#include "chrome/browser/prerender/prerender_contents.h"
-#include "chrome/browser/prerender/prerender_manager.h"
-#include "chrome/browser/prerender/prerender_resource_throttle.h"
-#include "chrome/test/base/testing_browser_process.h"
-#include "content/public/browser/resource_request_info.h"
-#include "content/public/browser/resource_throttle.h"
-#include "content/public/common/previews_state.h"
-#include "content/public/test/test_browser_thread.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "content/public/test/test_utils.h"
-#include "ipc/ipc_message.h"
-#include "net/base/request_priority.h"
-#include "net/test/url_request/url_request_mock_http_job.h"
-#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
-#include "net/url_request/redirect_info.h"
-#include "net/url_request/url_request.h"
-#include "net/url_request/url_request_test_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using content::BrowserThread;
-
-namespace prerender {
-
-namespace {
-
-class TestPrerenderContents : public PrerenderContents {
- public:
-  TestPrerenderContents(PrerenderManager* prerender_manager,
-                        int child_id, int route_id)
-      : PrerenderContents(prerender_manager, static_cast<Profile*>(NULL),
-                          GURL(), content::Referrer(), ORIGIN_NONE),
-        child_id_(child_id),
-        route_id_(route_id) {
-    PrerenderResourceThrottle::OverridePrerenderContentsForTesting(this);
-  }
-
-  ~TestPrerenderContents() override {
-    if (final_status() == FINAL_STATUS_MAX)
-      SetFinalStatus(FINAL_STATUS_USED);
-    PrerenderResourceThrottle::OverridePrerenderContentsForTesting(NULL);
-  }
-
-  bool GetChildId(int* child_id) const override {
-    *child_id = child_id_;
-    return true;
-  }
-
-  bool GetRouteId(int* route_id) const override {
-    *route_id = route_id_;
-    return true;
-  }
-
-  void Start() {
-    prerendering_has_started_ = true;
-    NotifyPrerenderStart();
-  }
-
-  void Cancel() {
-    Destroy(FINAL_STATUS_CANCELLED);
-  }
-
-  void Use() {
-    PrepareForUse();
-  }
-
- private:
-  int child_id_;
-  int route_id_;
-};
-
-class TestPrerenderManager : public PrerenderManager {
- public:
-  TestPrerenderManager() : PrerenderManager(nullptr) {
-    mutable_config().rate_limit_enabled = false;
-  }
-
-  // We never allocate our PrerenderContents in PrerenderManager, so we don't
-  // ever want the default pending delete behaviour.
-  void MoveEntryToPendingDelete(PrerenderContents* entry,
-                                FinalStatus final_status) override {}
-};
-
-class DeferredRedirectDelegate : public net::URLRequest::Delegate,
-                                 public content::ResourceThrottle::Delegate {
- public:
-  DeferredRedirectDelegate()
-      : throttle_(NULL),
-        was_deferred_(false),
-        cancel_called_(false),
-        resume_called_(false) {
-  }
-
-  void SetThrottle(PrerenderResourceThrottle* throttle) {
-    throttle_ = throttle;
-    throttle_->set_delegate_for_testing(this);
-  }
-
-  void Run() {
-    run_loop_.reset(new base::RunLoop());
-    run_loop_->Run();
-  }
-
-  bool was_deferred() const { return was_deferred_; }
-  bool cancel_called() const { return cancel_called_; }
-  bool resume_called() const { return resume_called_; }
-
-  // net::URLRequest::Delegate implementation:
-  void OnReceivedRedirect(net::URLRequest* request,
-                          const net::RedirectInfo& redirect_info,
-                          bool* defer_redirect) override {
-    // Defer the redirect either way.
-    *defer_redirect = true;
-
-    // Find out what the throttle would have done.
-    throttle_->WillRedirectRequest(redirect_info, &was_deferred_);
-    run_loop_->Quit();
-  }
-  void OnResponseStarted(net::URLRequest* request, int net_error) override {}
-  void OnReadCompleted(net::URLRequest* request, int bytes_read) override {}
-
-  // content::ResourceThrottle::Delegate implementation:
-  void Cancel() override {
-    EXPECT_FALSE(cancel_called_);
-    EXPECT_FALSE(resume_called_);
-
-    cancel_called_ = true;
-    run_loop_->Quit();
-  }
-  void CancelWithError(int error_code) override { Cancel(); }
-  void Resume() override {
-    EXPECT_TRUE(was_deferred_);
-    EXPECT_FALSE(cancel_called_);
-    EXPECT_FALSE(resume_called_);
-
-    resume_called_ = true;
-    run_loop_->Quit();
-  }
-
- private:
-  std::unique_ptr<base::RunLoop> run_loop_;
-  PrerenderResourceThrottle* throttle_;
-  bool was_deferred_;
-  bool cancel_called_;
-  bool resume_called_;
-
-  DISALLOW_COPY_AND_ASSIGN(DeferredRedirectDelegate);
-};
-
-}  // namespace
-
-class PrerenderResourceThrottleTest : public testing::Test {
- public:
-  static const int kDefaultChildId = 0;
-  static const int kDefaultRouteId = 100;
-
-  PrerenderResourceThrottleTest()
-      : test_browser_thread_bundle_(
-            content::TestBrowserThreadBundle::IO_MAINLOOP),
-        test_contents_(&prerender_manager_, kDefaultChildId, kDefaultRouteId) {
-    chrome_browser_net::SetUrlRequestMocksEnabled(true);
-  }
-
-  ~PrerenderResourceThrottleTest() override {
-    chrome_browser_net::SetUrlRequestMocksEnabled(false);
-
-    // Cleanup work so the file IO tasks from URLRequestMockHTTPJob are gone.
-    content::RunAllTasksUntilIdle();
-  }
-
-  TestPrerenderManager* prerender_manager() {
-    return &prerender_manager_;
-  }
-
-  TestPrerenderContents* test_contents() {
-    return &test_contents_;
-  }
-
-  // Runs any tasks queued on either thread.
-  void RunEvents() { base::RunLoop().RunUntilIdle(); }
-
- private:
-  content::TestBrowserThreadBundle test_browser_thread_bundle_;
-
-  TestPrerenderManager prerender_manager_;
-  TestPrerenderContents test_contents_;
-};
-
-// Checks that deferred redirects are throttled and resumed correctly.
-TEST_F(PrerenderResourceThrottleTest, RedirectResume) {
-  test_contents()->Start();
-  RunEvents();
-
-  // Fake a request.
-  net::TestURLRequestContext url_request_context;
-  DeferredRedirectDelegate delegate;
-  std::unique_ptr<net::URLRequest> request(url_request_context.CreateRequest(
-      net::URLRequestMockHTTPJob::GetMockUrl("prerender/image-deferred.png"),
-      net::DEFAULT_PRIORITY, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
-  content::ResourceRequestInfo::AllocateForTesting(
-      request.get(), content::RESOURCE_TYPE_IMAGE, NULL, kDefaultChildId,
-      kDefaultRouteId, MSG_ROUTING_NONE,
-      /*is_main_frame=*/false,
-      /*allow_download=*/true,
-      /*is_async=*/true, content::PREVIEWS_OFF, nullptr);
-
-  // Install a prerender throttle.
-  PrerenderResourceThrottle throttle(request.get());
-  delegate.SetThrottle(&throttle);
-
-  // Start the request and wait for a redirect.
-  request->Start();
-  delegate.Run();
-  EXPECT_TRUE(delegate.was_deferred());
-  // This calls WillRedirectRequestOnUI().
-  RunEvents();
-
-  // Display the prerendered RenderView and wait for the throttle to
-  // notice.
-  test_contents()->Use();
-  delegate.Run();
-  EXPECT_TRUE(delegate.resume_called());
-  EXPECT_FALSE(delegate.cancel_called());
-}
-
-// Checks that redirects in main frame loads are not deferred.
-TEST_F(PrerenderResourceThrottleTest, RedirectMainFrame) {
-  test_contents()->Start();
-  RunEvents();
-
-  // Fake a request.
-  net::TestURLRequestContext url_request_context;
-  DeferredRedirectDelegate delegate;
-  std::unique_ptr<net::URLRequest> request(url_request_context.CreateRequest(
-      net::URLRequestMockHTTPJob::GetMockUrl("prerender/image-deferred.png"),
-      net::DEFAULT_PRIORITY, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
-  content::ResourceRequestInfo::AllocateForTesting(
-      request.get(), content::RESOURCE_TYPE_MAIN_FRAME, NULL, kDefaultChildId,
-      kDefaultRouteId, MSG_ROUTING_NONE,
-      /*is_main_frame=*/true,
-      /*allow_download=*/true,
-      /*is_async=*/true, content::PREVIEWS_OFF, nullptr);
-
-  // Install a prerender throttle.
-  PrerenderResourceThrottle throttle(request.get());
-  delegate.SetThrottle(&throttle);
-
-  // Start the request and wait for a redirect. This time, it should
-  // not be deferred.
-  request->Start();
-  delegate.Run();
-  // This calls WillRedirectRequestOnUI().
-  RunEvents();
-
-  // Cleanup work so the prerender is gone.
-  test_contents()->Cancel();
-  RunEvents();
-}
-
-// Checks that attempting to defer a synchronous request aborts the
-// prerender.
-TEST_F(PrerenderResourceThrottleTest, RedirectSyncXHR) {
-  test_contents()->Start();
-  RunEvents();
-
-  // Fake a request.
-  net::TestURLRequestContext url_request_context;
-  DeferredRedirectDelegate delegate;
-  std::unique_ptr<net::URLRequest> request(url_request_context.CreateRequest(
-      net::URLRequestMockHTTPJob::GetMockUrl("prerender/image-deferred.png"),
-      net::DEFAULT_PRIORITY, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
-  content::ResourceRequestInfo::AllocateForTesting(
-      request.get(), content::RESOURCE_TYPE_XHR, NULL, kDefaultChildId,
-      kDefaultRouteId, MSG_ROUTING_NONE,
-      /*is_main_frame=*/false,
-      /*allow_download=*/true,
-      /*is_async=*/false, content::PREVIEWS_OFF, nullptr);
-
-  // Install a prerender throttle.
-  PrerenderResourceThrottle throttle(request.get());
-  delegate.SetThrottle(&throttle);
-
-  // Start the request and wait for a redirect.
-  request->Start();
-  delegate.Run();
-  // This calls WillRedirectRequestOnUI().
-  RunEvents();
-
-  // We should have cancelled the prerender.
-  EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT,
-            test_contents()->final_status());
-
-  // Cleanup work so the prerender is gone.
-  test_contents()->Cancel();
-  RunEvents();
-}
-
-}  // namespace prerender
diff --git a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
index a02d84b..2ee9337 100644
--- a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
+++ b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
@@ -26,12 +26,12 @@
 class PrivetHTTPResolution {
  public:
   using ResultCallback =
-      base::RepeatingCallback<void(std::unique_ptr<PrivetHTTPClient>)>;
+      base::OnceCallback<void(std::unique_ptr<PrivetHTTPClient>)>;
 
   virtual ~PrivetHTTPResolution() {}
 
   virtual void Start(const net::HostPortPair& address,
-                     const ResultCallback& callback) = 0;
+                     ResultCallback callback) = 0;
 };
 
 class PrivetHTTPAsynchronousFactory {
diff --git a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
index e3727c4..03f8206 100644
--- a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
+++ b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
@@ -39,21 +39,21 @@
 
 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::Start(
     const net::HostPortPair& address,
-    const ResultCallback& callback) {
-  endpoint_resolver_->Start(address,
-                            base::Bind(&ResolutionImpl::ResolveComplete,
-                                       base::Unretained(this), callback));
+    ResultCallback callback) {
+  endpoint_resolver_->Start(
+      address, base::BindOnce(&ResolutionImpl::ResolveComplete,
+                              base::Unretained(this), std::move(callback)));
 }
 
 void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolveComplete(
-    const ResultCallback& callback,
+    ResultCallback callback,
     const net::IPEndPoint& endpoint) {
   if (endpoint.address().empty())
-    return callback.Run(std::unique_ptr<PrivetHTTPClient>());
+    return std::move(callback).Run(nullptr);
 
   net::HostPortPair new_address = net::HostPortPair::FromIPEndPoint(endpoint);
-  callback.Run(std::make_unique<PrivetHTTPClientImpl>(name_, new_address,
-                                                      url_loader_factory_));
+  std::move(callback).Run(std::make_unique<PrivetHTTPClientImpl>(
+      name_, new_address, url_loader_factory_));
 }
 
 }  // namespace cloud_print
diff --git a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
index c59cd66..c8b8a7b3 100644
--- a/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
+++ b/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
@@ -41,10 +41,10 @@
     ~ResolutionImpl() override;
 
     void Start(const net::HostPortPair& address,
-               const ResultCallback& callback) override;
+               ResultCallback callback) override;
 
    private:
-    void ResolveComplete(const ResultCallback& callback,
+    void ResolveComplete(ResultCallback callback,
                          const net::IPEndPoint& endpoint);
     std::string name_;
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
diff --git a/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc b/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
index 1e8afcf..9ac3c06 100644
--- a/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
+++ b/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
@@ -61,10 +61,10 @@
     ~MockResolution() override {}
 
     void Start(const net::HostPortPair& address,
-               const ResultCallback& callback) override {
+               ResultCallback callback) override {
       auto privet_http_client = std::make_unique<PrivetHTTPClientImpl>(
           name_, net::HostPortPair("1.2.3.4", 8080), url_loader_factory_);
-      callback.Run(std::move(privet_http_client));
+      std::move(callback).Run(std::move(privet_http_client));
     }
 
    private:
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index f3952ca..a603683a 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -2155,9 +2155,17 @@
       ExecPictureInPicture();
       break;
 
-    case IDC_CONTENT_CONTEXT_EMOJI:
-      GetBrowser()->window()->ShowEmojiPanel();
+    case IDC_CONTENT_CONTEXT_EMOJI: {
+      Browser* browser = GetBrowser();
+      if (browser) {
+        browser->window()->ShowEmojiPanel();
+      } else {
+        // TODO(https://crbug.com/919167): Ensure this is called in the correct
+        // process. This fails in print preview for PWA windows on Mac.
+        ui::ShowEmojiPanel();
+      }
       break;
+    }
 
     default:
       NOTREACHED();
@@ -2349,7 +2357,7 @@
     return false;
 
   return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable(
-      ui::Clipboard::GetPlainTextFormatType(),
+      ui::ClipboardFormatType::GetPlainTextType(),
       ui::CLIPBOARD_TYPE_COPY_PASTE);
 }
 
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
index b17651a..1c195de 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
@@ -548,6 +548,17 @@
   EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_EMOJI));
 }
 
+// Executing the emoji panel item with no associated browser should not crash.
+IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
+                       ContextMenuForEmojiPanel_NullBrowserCrash) {
+  std::unique_ptr<content::WebContents> detached_web_contents =
+      content::WebContents::Create(
+          content::WebContents::CreateParams(browser()->profile()));
+  TestRenderViewContextMenu menu(detached_web_contents->GetMainFrame(), {});
+  menu.Init();
+  menu.ExecuteCommand(IDC_CONTENT_CONTEXT_EMOJI, 0);
+}
+
 // Only Chrome OS supports emoji panel callbacks.
 #if defined(OS_CHROMEOS)
 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
index 80fd492..dae9390 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc
@@ -164,19 +164,19 @@
   switch (format) {
     case PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT: {
       bool plain = clipboard->IsFormatAvailable(
-          ui::Clipboard::GetPlainTextFormatType(), type);
+          ui::ClipboardFormatType::GetPlainTextType(), type);
       bool plainw = clipboard->IsFormatAvailable(
-          ui::Clipboard::GetPlainTextWFormatType(), type);
+          ui::ClipboardFormatType::GetPlainTextWType(), type);
       available = plain || plainw;
       break;
     }
     case PP_FLASH_CLIPBOARD_FORMAT_HTML:
       available = clipboard->IsFormatAvailable(
-          ui::Clipboard::GetHtmlFormatType(), type);
+          ui::ClipboardFormatType::GetHtmlType(), type);
       break;
     case PP_FLASH_CLIPBOARD_FORMAT_RTF:
-      available =
-          clipboard->IsFormatAvailable(ui::Clipboard::GetRtfFormatType(), type);
+      available = clipboard->IsFormatAvailable(
+          ui::ClipboardFormatType::GetRtfType(), type);
       break;
     case PP_FLASH_CLIPBOARD_FORMAT_INVALID:
       break;
@@ -184,7 +184,7 @@
       if (custom_formats_.IsFormatRegistered(format)) {
         std::string format_name = custom_formats_.GetFormatName(format);
         std::string clipboard_data;
-        clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
+        clipboard->ReadData(ui::ClipboardFormatType::GetPepperCustomDataType(),
                             &clipboard_data);
         base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
         available =
@@ -211,8 +211,8 @@
   int32_t result = PP_ERROR_FAILED;
   switch (format) {
     case PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT: {
-      if (clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
-                                       type)) {
+      if (clipboard->IsFormatAvailable(
+              ui::ClipboardFormatType::GetPlainTextWType(), type)) {
         base::string16 text;
         clipboard->ReadText(type, &text);
         if (!text.empty()) {
@@ -223,15 +223,15 @@
       }
       // If the PlainTextW format isn't available or is empty, take the
       // ASCII text format.
-      if (clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
-                                       type)) {
+      if (clipboard->IsFormatAvailable(
+              ui::ClipboardFormatType::GetPlainTextType(), type)) {
         result = PP_OK;
         clipboard->ReadAsciiText(type, &clipboard_string);
       }
       break;
     }
     case PP_FLASH_CLIPBOARD_FORMAT_HTML: {
-      if (!clipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(),
+      if (!clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(),
                                         type)) {
         break;
       }
@@ -247,7 +247,7 @@
       break;
     }
     case PP_FLASH_CLIPBOARD_FORMAT_RTF: {
-      if (!clipboard->IsFormatAvailable(ui::Clipboard::GetRtfFormatType(),
+      if (!clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(),
                                         type)) {
         break;
       }
@@ -262,7 +262,7 @@
         base::string16 format_name =
             base::UTF8ToUTF16(custom_formats_.GetFormatName(format));
         std::string clipboard_data;
-        clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
+        clipboard->ReadData(ui::ClipboardFormatType::GetPepperCustomDataType(),
                             &clipboard_data);
         base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
         if (IsFormatAvailableInPickle(format_name, pickle)) {
@@ -342,7 +342,7 @@
     base::Pickle pickle;
     WriteDataToPickle(custom_data_map, &pickle);
     scw.WritePickledData(pickle,
-                         ui::Clipboard::GetPepperCustomDataFormatType());
+                         ui::ClipboardFormatType::GetPepperCustomDataType());
   }
 
   if (res != PP_OK) {
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
index 0612623..4276ed5 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -1937,7 +1937,8 @@
   });
 });
 
-TEST_F('ChromeVoxBackgroundTest', 'ValidationTest', function() {
+// See https://crbug.com/924976
+TEST_F('ChromeVoxBackgroundTest', 'DISABLED_ValidationTest', function() {
   var mockFeedback = this.createMockFeedback();
   this.runWithLoadedTree(function() {/*
     <label for="in1">Name:</label>
diff --git a/chrome/browser/resources/md_downloads/item.html b/chrome/browser/resources/md_downloads/item.html
index 3bef26e..ebc798a 100644
--- a/chrome/browser/resources/md_downloads/item.html
+++ b/chrome/browser/resources/md_downloads/item.html
@@ -198,7 +198,7 @@
         margin-top: 16px;
       }
 
-      .is-active #description {
+      :host-context(html:not([dark])) .is-active #description {
         color: #616161;
       }
 
diff --git a/chrome/browser/resources/settings/people_page/sync_page.html b/chrome/browser/resources/settings/people_page/sync_page.html
index 7166121..a2530a21 100644
--- a/chrome/browser/resources/settings/people_page/sync_page.html
+++ b/chrome/browser/resources/settings/people_page/sync_page.html
@@ -218,7 +218,8 @@
             </div>
           </template>
 
-          <template is="dom-if" if="[[driveSuggestAvailable_]]">
+          <template is="dom-if"
+              if="[[shouldShowDriveSuggest_(unifiedConsentEnabled)]]" restamp>
             <settings-toggle-button
                 class$="[[getListItemClass_(unifiedConsentEnabled)]]"
                 pref="{{prefs.documentsuggest.enabled}}"
@@ -325,7 +326,7 @@
         <h2>$i18n{nonPersonalizedServicesSectionLabel}</h2>
       </div>
       <settings-personalization-options class="list-frame" prefs="{{prefs}}"
-          page-visibility="[[pageVisibility]]"
+          page-visibility="[[pageVisibility]]" sync-status="[[syncStatus]]"
           unified-consent-enabled="[[unifiedConsentEnabled]]">
       </settings-personalization-options>
     </template>
diff --git a/chrome/browser/resources/settings/people_page/sync_page.js b/chrome/browser/resources/settings/people_page/sync_page.js
index 7a84d9c..fa8ba3af 100644
--- a/chrome/browser/resources/settings/people_page/sync_page.js
+++ b/chrome/browser/resources/settings/people_page/sync_page.js
@@ -133,14 +133,6 @@
           'syncStatus.hasError, syncStatus.statusAction)',
     },
 
-    /** @private */
-    driveSuggestAvailable_: {
-      type: Boolean,
-      value: function() {
-        return loadTimeData.getBoolean('driveSuggestAvailable');
-      }
-    },
-
     // <if expr="not chromeos">
     diceEnabled: Boolean,
     // </if>
@@ -542,6 +534,15 @@
   onSyncAdvancedTap_: function() {
     settings.navigateTo(settings.routes.SYNC_ADVANCED);
   },
+
+  /**
+   * @return {boolean}
+   * @private
+   */
+  shouldShowDriveSuggest_: function() {
+    return loadTimeData.getBoolean('driveSuggestAvailable') &&
+        !this.unifiedConsentEnabled;
+  },
 });
 
 })();
diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.html b/chrome/browser/resources/settings/privacy_page/personalization_options.html
index eba047b..091666e 100644
--- a/chrome/browser/resources/settings/privacy_page/personalization_options.html
+++ b/chrome/browser/resources/settings/privacy_page/personalization_options.html
@@ -82,6 +82,14 @@
         hidden="[[!showSpellCheckControl_(prefs.spellcheck.dictionaries)]]">
     </settings-toggle-button>
 </if><!-- _google_chrome -->
+    <template is="dom-if" if="[[shouldShowDriveSuggest_(unifiedConsentEnabled,
+        syncStatus, syncStatus.signedIn, syncStatus.statusAction)]]" restamp>
+      <settings-toggle-button id="driveSuggestControl"
+          pref="{{prefs.documentsuggest.enabled}}"
+          label="$i18n{driveSuggestPref}"
+          sub-label="$i18n{driveSuggestPrefDesc}">
+      </settings-toggle-button>
+    </template>
   </template>
   <script src="personalization_options.js"></script>
 </dom-module>
diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.js b/chrome/browser/resources/settings/privacy_page/personalization_options.js
index 509a6a99..fcdf4ec1 100644
--- a/chrome/browser/resources/settings/privacy_page/personalization_options.js
+++ b/chrome/browser/resources/settings/privacy_page/personalization_options.js
@@ -52,6 +52,9 @@
 
     unifiedConsentEnabled: Boolean,
 
+    /** @type {settings.SyncStatus} */
+    syncStatus: Object,
+
     // <if expr="_google_chrome and not chromeos">
     // TODO(dbeam): make a virtual.* pref namespace and set/get this normally
     // (but handled differently in C++).
@@ -136,5 +139,16 @@
          /** @type {!Array<string>} */
          (this.prefs.spellcheck.dictionaries.value).length > 0);
   },
+
+  /**
+   * @return {boolean}
+   * @private
+   */
+  shouldShowDriveSuggest_: function() {
+    return loadTimeData.getBoolean('driveSuggestAvailable') &&
+        !!this.unifiedConsentEnabled && !!this.syncStatus &&
+        !!this.syncStatus.signedIn &&
+        this.syncStatus.statusAction !== settings.StatusAction.REAUTHENTICATE;
+  },
 });
 })();
diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc
index 8d1147f3..8946b691 100644
--- a/chrome/browser/search/local_ntp_source.cc
+++ b/chrome/browser/search/local_ntp_source.cc
@@ -1281,7 +1281,7 @@
   }
 
   SearchSuggestData suggest_data = *data;
-  search_suggest_service_->ClearSearchSuggestData();
+  search_suggest_service_->SuggestionsDisplayed();
   scoped_refptr<base::RefCountedString> result;
   std::string js;
   base::JSONWriter::Write(*ConvertSearchSuggestDataToDict(suggest_data), &js);
diff --git a/chrome/browser/search/search_suggest/search_suggest_data.cc b/chrome/browser/search/search_suggest/search_suggest_data.cc
index 7d335f1..a8870b7 100644
--- a/chrome/browser/search/search_suggest/search_suggest_data.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_data.cc
@@ -4,7 +4,10 @@
 
 #include "chrome/browser/search/search_suggest/search_suggest_data.h"
 
-SearchSuggestData::SearchSuggestData() = default;
+SearchSuggestData::SearchSuggestData()
+    : impression_cap_expire_time_ms(0),
+      request_freeze_time_ms(0),
+      max_impressions(0) {}
 SearchSuggestData::SearchSuggestData(const SearchSuggestData&) = default;
 SearchSuggestData::SearchSuggestData(SearchSuggestData&&) = default;
 SearchSuggestData::~SearchSuggestData() = default;
@@ -15,7 +18,11 @@
 
 bool operator==(const SearchSuggestData& lhs, const SearchSuggestData& rhs) {
   return lhs.suggestions_html == rhs.suggestions_html &&
-         lhs.end_of_body_script == rhs.end_of_body_script;
+         lhs.end_of_body_script == rhs.end_of_body_script &&
+         lhs.impression_cap_expire_time_ms ==
+             rhs.impression_cap_expire_time_ms &&
+         lhs.request_freeze_time_ms == rhs.request_freeze_time_ms &&
+         lhs.max_impressions == rhs.max_impressions;
 }
 
 bool operator!=(const SearchSuggestData& lhs, const SearchSuggestData& rhs) {
diff --git a/chrome/browser/search/search_suggest/search_suggest_data.h b/chrome/browser/search/search_suggest/search_suggest_data.h
index b78eb4d..de576a87 100644
--- a/chrome/browser/search/search_suggest/search_suggest_data.h
+++ b/chrome/browser/search/search_suggest/search_suggest_data.h
@@ -24,6 +24,11 @@
   // Javascript for search suggestion that should be appended at the end of the
   // New Tab Page <body>.
   std::string end_of_body_script;
+
+  // Parameters that control impression capping and freezing.
+  int impression_cap_expire_time_ms;
+  int request_freeze_time_ms;
+  int max_impressions;
 };
 
 bool operator==(const SearchSuggestData& lhs, const SearchSuggestData& rhs);
diff --git a/chrome/browser/search/search_suggest/search_suggest_loader.h b/chrome/browser/search/search_suggest/search_suggest_loader.h
index 9e7fb1b..7a041ee 100644
--- a/chrome/browser/search/search_suggest/search_suggest_loader.h
+++ b/chrome/browser/search/search_suggest/search_suggest_loader.h
@@ -26,8 +26,12 @@
     // A fatal error occurred, such as the server responding with an error code
     // or with invalid data. Any previously cached response should be cleared.
     FATAL_ERROR,
-    // The user has opted out of seeing search suggestions on the NTP.
-    OPTED_OUT
+    // The user has opted out of seeing search suggestions on the NTP
+    OPTED_OUT,
+    // The limit for number of impressions was hit.
+    IMPRESSION_CAP,
+    // Received an empty response so requests are temporarily frozen.
+    REQUESTS_FROZEN
   };
   using SearchSuggestionsCallback =
       base::OnceCallback<void(Status,
diff --git a/chrome/browser/search/search_suggest/search_suggest_loader_impl.cc b/chrome/browser/search/search_suggest/search_suggest_loader_impl.cc
index d9f1ee0..a69ea3e 100644
--- a/chrome/browser/search/search_suggest/search_suggest_loader_impl.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_loader_impl.cc
@@ -75,6 +75,32 @@
 
   result.end_of_body_script = end_of_body_script;
 
+  int impression_cap_expire_time_ms;
+  if (!query_suggestions->GetInteger("impression_cap_expire_time_ms",
+                                     &impression_cap_expire_time_ms)) {
+    DLOG(WARNING) << "Parse error: no impression_cap_expire_time_ms";
+    return base::nullopt;
+  }
+
+  result.impression_cap_expire_time_ms = impression_cap_expire_time_ms;
+
+  int request_freeze_time_ms;
+  if (!query_suggestions->GetInteger("request_freeze_time_ms",
+                                     &request_freeze_time_ms)) {
+    DLOG(WARNING) << "Parse error: no request_freeze_time_ms";
+    return base::nullopt;
+  }
+
+  result.request_freeze_time_ms = request_freeze_time_ms;
+
+  int max_impressions;
+  if (!query_suggestions->GetInteger("max_impressions", &max_impressions)) {
+    DLOG(WARNING) << "Parse error: no max_impressions";
+    return base::nullopt;
+  }
+
+  result.max_impressions = max_impressions;
+
   return result;
 }
 
diff --git a/chrome/browser/search/search_suggest/search_suggest_loader_impl_unittest.cc b/chrome/browser/search/search_suggest/search_suggest_loader_impl_unittest.cc
index a9e511e4..50541cc 100644
--- a/chrome/browser/search/search_suggest/search_suggest_loader_impl_unittest.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_loader_impl_unittest.cc
@@ -39,7 +39,9 @@
 const char kApplicationLocale[] = "us";
 
 const char kMinimalValidResponse[] = R"json({"update": { "query_suggestions": {
-  "query_suggestions_with_html": "", "script": ""
+  "query_suggestions_with_html": "", "script": "",
+  "impression_cap_expire_time_ms": 0, "request_freeze_time_ms": 0,
+  "max_impressions": 0
 }}})json";
 
 // Required to instantiate a GoogleUrlTracker in UNIT_TEST_MODE.
@@ -170,9 +172,11 @@
 }
 
 TEST_F(SearchSuggestLoaderImplTest, ParsesFullResponse) {
-  SetUpResponseWithData(
-      R"json({"update": { "query_suggestions": {"query_suggestions_with_html" :
-      "<div></div>", "script" : "<script></script>"}}})json");
+  SetUpResponseWithData(R"json({"update": { "query_suggestions": {
+            "query_suggestions_with_html": "<div></div>",
+            "script": "<script></script>", "impression_cap_expire_time_ms": 1,
+            "request_freeze_time_ms": 2, "max_impressions": 3
+            }}})json");
 
   base::MockCallback<SearchSuggestLoader::SearchSuggestionsCallback> callback;
   std::string blacklist;
@@ -185,8 +189,11 @@
   loop.Run();
 
   ASSERT_TRUE(data.has_value());
-  EXPECT_THAT(data->suggestions_html, Eq("<div></div>"));
-  EXPECT_THAT(data->end_of_body_script, Eq("<script></script>"));
+  EXPECT_EQ("<div></div>", data->suggestions_html);
+  EXPECT_EQ("<script></script>", data->end_of_body_script);
+  EXPECT_EQ(1, data->impression_cap_expire_time_ms);
+  EXPECT_EQ(2, data->request_freeze_time_ms);
+  EXPECT_EQ(3, data->max_impressions);
 }
 
 TEST_F(SearchSuggestLoaderImplTest, CoalescesMultipleRequests) {
diff --git a/chrome/browser/search/search_suggest/search_suggest_service.cc b/chrome/browser/search/search_suggest/search_suggest_service.cc
index 89002be..83c1a59 100644
--- a/chrome/browser/search/search_suggest/search_suggest_service.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_service.cc
@@ -13,6 +13,34 @@
 #include "components/prefs/scoped_user_pref_update.h"
 #include "services/identity/public/cpp/identity_manager.h"
 
+namespace {
+
+const char kFirstShownTimeMs[] = "first_shown_time_ms";
+const char kImpressionCapExpireTimeMs[] = "impression_cap_expire_time_ms";
+const char kImpressionsCount[] = "impressions_count";
+const char kIsRequestFrozen[] = "is_request_frozen";
+const char kMaxImpressions[] = "max_impressions";
+const char kRequestFreezeTimeMs[] = "request_freeze_time_ms";
+const char kRequestFrozenTimeMs[] = "request_frozen_time_ms";
+
+// Default value for max_impressions specified by the VASCO team.
+const int kDefaultMaxImpressions = 4;
+
+std::unique_ptr<base::DictionaryValue> ImpressionDictDefaults() {
+  std::unique_ptr<base::DictionaryValue> defaults =
+      std::make_unique<base::DictionaryValue>();
+  defaults->SetInteger(kFirstShownTimeMs, 0);
+  defaults->SetInteger(kImpressionCapExpireTimeMs, 0);
+  defaults->SetInteger(kImpressionsCount, 0);
+  defaults->SetBoolean(kIsRequestFrozen, false);
+  defaults->SetInteger(kMaxImpressions, kDefaultMaxImpressions);
+  defaults->SetInteger(kRequestFreezeTimeMs, 0);
+  defaults->SetInteger(kRequestFrozenTimeMs, 0);
+  return defaults;
+}
+
+}  // namespace
+
 class SearchSuggestService::SigninObserver
     : public identity::IdentityManager::Observer {
  public:
@@ -72,6 +100,12 @@
   } else if (pref_service_->GetBoolean(prefs::kNtpSearchSuggestionsOptOut)) {
     SearchSuggestDataLoaded(SearchSuggestLoader::Status::OPTED_OUT,
                             base::nullopt);
+  } else if (RequestsFrozen()) {
+    SearchSuggestDataLoaded(SearchSuggestLoader::Status::REQUESTS_FROZEN,
+                            base::nullopt);
+  } else if (ImpressionCapReached()) {
+    SearchSuggestDataLoaded(SearchSuggestLoader::Status::IMPRESSION_CAP,
+                            base::nullopt);
   } else {
     const std::string blacklist = GetBlacklistAsString();
     loader_->Load(blacklist,
@@ -102,10 +136,22 @@
   // In case of transient errors, keep our cached data (if any), but still
   // notify observers of the finished load (attempt).
   if (status != SearchSuggestLoader::Status::TRANSIENT_ERROR) {
-    // TODO(crbug/904565): Verify that cached data is also cleared when the
-    // impression cap is reached. Including the response from the request made
-    // on the same load that the cap was hit.
     search_suggest_data_ = data;
+
+    DictionaryPrefUpdate update(pref_service_,
+                                prefs::kNtpSearchSuggestionsImpressions);
+
+    if (data.has_value()) {
+      base::DictionaryValue* dict = update.Get();
+      dict->SetInteger(kMaxImpressions, data->max_impressions);
+      dict->SetInteger(kImpressionCapExpireTimeMs,
+                       data->impression_cap_expire_time_ms);
+      dict->SetInteger(kRequestFreezeTimeMs, data->request_freeze_time_ms);
+    } else if (status == SearchSuggestLoader::Status::FATAL_ERROR) {
+      base::DictionaryValue* dict = update.Get();
+      dict->SetBoolean(kIsRequestFrozen, true);
+      dict->SetInteger(kRequestFrozenTimeMs, base::Time::Now().ToTimeT());
+    }
   }
   NotifyObservers();
 }
@@ -116,6 +162,61 @@
   }
 }
 
+bool SearchSuggestService::ImpressionCapReached() {
+  const base::DictionaryValue* dict =
+      pref_service_->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+
+  int first_shown_time_ms = 0;
+  int impression_cap_expire_time_ms = 0;
+  int impression_count = 0;
+  int max_impressions = 0;
+  dict->GetInteger(kFirstShownTimeMs, &first_shown_time_ms);
+  dict->GetInteger(kImpressionCapExpireTimeMs, &impression_cap_expire_time_ms);
+  dict->GetInteger(kImpressionsCount, &impression_count);
+  dict->GetInteger(kMaxImpressions, &max_impressions);
+
+  int64_t time_delta =
+      base::TimeDelta(base::Time::Now() -
+                      base::Time::FromTimeT(first_shown_time_ms))
+          .InMilliseconds();
+  if (time_delta > impression_cap_expire_time_ms) {
+    impression_count = 0;
+    DictionaryPrefUpdate update(pref_service_,
+                                prefs::kNtpSearchSuggestionsImpressions);
+    update.Get()->SetInteger(kImpressionsCount, impression_count);
+  }
+
+  return impression_count >= max_impressions;
+}
+
+bool SearchSuggestService::RequestsFrozen() {
+  const base::DictionaryValue* dict =
+      pref_service_->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+
+  bool is_request_frozen = false;
+  int request_freeze_time_ms = 0;
+  int request_frozen_time_ms = 0;
+  dict->GetBoolean(kIsRequestFrozen, &is_request_frozen);
+  dict->GetInteger(kRequestFrozenTimeMs, &request_frozen_time_ms);
+  dict->GetInteger(kRequestFreezeTimeMs, &request_freeze_time_ms);
+
+  int64_t time_delta =
+      base::TimeDelta(base::Time::Now() -
+                      base::Time::FromTimeT(request_frozen_time_ms))
+          .InMilliseconds();
+  if (is_request_frozen) {
+    if (time_delta < request_freeze_time_ms) {
+      return true;
+    } else {
+      DictionaryPrefUpdate update(pref_service_,
+                                  prefs::kNtpSearchSuggestionsImpressions);
+      update.Get()->SetBoolean(kIsRequestFrozen, false);
+    }
+  }
+
+  return false;
+}
+
 void SearchSuggestService::BlacklistSearchSuggestion(int task_version,
                                                      long task_id) {
   std::string task_version_id =
@@ -178,6 +279,23 @@
   return blacklist_as_string;
 }
 
+void SearchSuggestService::SuggestionsDisplayed() {
+  search_suggest_data_ = base::nullopt;
+
+  DictionaryPrefUpdate update(pref_service_,
+                              prefs::kNtpSearchSuggestionsImpressions);
+  base::DictionaryValue* dict = update.Get();
+
+  int impression_count = 0;
+  dict->GetInteger(kImpressionsCount, &impression_count);
+  dict->SetInteger(kImpressionsCount, impression_count + 1);
+
+  // When suggestions are displayed for the first time record the timestamp.
+  if (impression_count == 0) {
+    dict->SetInteger(kFirstShownTimeMs, base::Time::Now().ToTimeT());
+  }
+}
+
 void SearchSuggestService::OptOutOfSearchSuggestions() {
   pref_service_->SetBoolean(prefs::kNtpSearchSuggestionsOptOut, true);
 
@@ -187,5 +305,7 @@
 // static
 void SearchSuggestService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
   registry->RegisterDictionaryPref(prefs::kNtpSearchSuggestionsBlacklist);
+  registry->RegisterDictionaryPref(prefs::kNtpSearchSuggestionsImpressions,
+                                   ImpressionDictDefaults());
   registry->RegisterBooleanPref(prefs::kNtpSearchSuggestionsOptOut, false);
 }
diff --git a/chrome/browser/search/search_suggest/search_suggest_service.h b/chrome/browser/search/search_suggest/search_suggest_service.h
index 4972ae1..986910d 100644
--- a/chrome/browser/search/search_suggest/search_suggest_service.h
+++ b/chrome/browser/search/search_suggest/search_suggest_service.h
@@ -38,11 +38,11 @@
     return search_suggest_data_;
   }
 
-  // Clears any currently cached search suggest data.
-  void ClearSearchSuggestData() { search_suggest_data_ = base::nullopt; }
-
-  // Requests an asynchronous refresh from the network. After the update
-  // completes, OnSearchSuggestDataUpdated will be called on the observers.
+  // Determines if a request for search suggestions should be made. If a request
+  // should not be made immediately call SearchSuggestDataLoaded with the
+  // reason. Otherwise requests an asynchronous refresh from the network. After
+  // the update completes, regardless of success, OnSearchSuggestDataUpdated
+  // will be called on the observers.
   void Refresh();
 
   // Add/remove observers. All observers must unregister themselves before the
@@ -82,16 +82,37 @@
   // "task_id1:hash1,hash2,hash3;task_id2;task_id3:hash1,hash2".
   std::string GetBlacklistAsString();
 
+  // Called when suggestions are displayed on the NTP, clears the cached data
+  // and updates timestamps and impression counts.
+  void SuggestionsDisplayed();
+
  private:
   class SigninObserver;
 
   void SigninStatusChanged();
 
+  // Called when a Refresh() is requested. If |status|==OK, |data| will contain
+  // the fetched data. Otherwise |data| will be nullopt and |status| will
+  // indicate if the request failed or the reason it was not sent.
+  //
+  // If the |status|==FATAL_ERROR freeze future requests until the request
+  // freeze interval has elapsed.
   void SearchSuggestDataLoaded(SearchSuggestLoader::Status status,
                                const base::Optional<SearchSuggestData>& data);
 
   void NotifyObservers();
 
+  // Returns true if the number of impressions has reached the maxmium allowed
+  // for the impression interval (e.g. 4 impressions / 12 hours), and false
+  // otherwise.
+  bool ImpressionCapReached();
+
+  // Returns true if requests are frozen and request freeze time interval has
+  // not elapsed, false otherwise.
+  //
+  // Requests are frozen on any request that results in a FATAL_ERROR.
+  bool RequestsFrozen();
+
   std::unique_ptr<SearchSuggestLoader> loader_;
 
   std::unique_ptr<SigninObserver> signin_observer_;
diff --git a/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc b/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
index dcb3e01..22a1fc2 100644
--- a/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
+++ b/chrome/browser/search/search_suggest/search_suggest_service_unittest.cc
@@ -12,6 +12,9 @@
 #include "base/test/scoped_task_environment.h"
 #include "chrome/browser/search/search_suggest/search_suggest_data.h"
 #include "chrome/browser/search/search_suggest/search_suggest_loader.h"
+#include "chrome/common/pref_names.h"
+#include "components/signin/core/browser/account_tracker_service.h"
+#include "components/signin/core/browser/test_signin_client.h"
 #include "components/sync_preferences/testing_pref_service_syncable.h"
 #include "services/identity/public/cpp/identity_test_environment.h"
 #include "services/identity/public/cpp/identity_test_utils.h"
@@ -61,6 +64,9 @@
 
   FakeSearchSuggestLoader* loader() { return loader_; }
   SearchSuggestService* service() { return service_.get(); }
+  sync_preferences::TestingPrefServiceSyncable* pref_service() {
+    return &pref_service_;
+  }
 
   void SignIn() {
     AccountInfo account_info =
@@ -72,6 +78,26 @@
     identity_env_.SetCookieAccounts({});
   }
 
+  // Returns a default data object for testing, initializes the impression
+  // parameters to values where they won't prevent fetching.
+  SearchSuggestData TestSearchSuggestData() {
+    SearchSuggestData data;
+    data.suggestions_html = "<div></div>";
+    data.impression_cap_expire_time_ms = 60000;
+    data.request_freeze_time_ms = 60000;
+    data.max_impressions = 10;
+    return data;
+  }
+
+  void RunFor(base::TimeDelta time_period) {
+    base::RunLoop run_loop;
+    base::CancelableCallback<void()> callback(run_loop.QuitWhenIdleClosure());
+    base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+        FROM_HERE, callback.callback(), time_period);
+    run_loop.Run();
+    callback.Cancel();
+  }
+
  private:
   base::test::ScopedTaskEnvironment task_environment_;
 
@@ -103,8 +129,7 @@
   EXPECT_THAT(loader()->GetCallbackCount(), Eq(1u));
 
   // Fulfill it.
-  SearchSuggestData data;
-  data.suggestions_html = "<div></div>";
+  SearchSuggestData data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
   EXPECT_THAT(service()->search_suggest_data(), Eq(data));
 
@@ -116,8 +141,7 @@
   EXPECT_THAT(service()->search_suggest_data(), Eq(data));
 
   // Fulfill the second request.
-  SearchSuggestData other_data;
-  other_data.suggestions_html = "<div>Different!</div>";
+  SearchSuggestData other_data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, other_data);
   EXPECT_THAT(service()->search_suggest_data(), Eq(other_data));
 }
@@ -128,8 +152,7 @@
 
   // Load some data.
   service()->Refresh();
-  SearchSuggestData data;
-  data.suggestions_html = "<div></div>";
+  SearchSuggestData data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
   ASSERT_THAT(service()->search_suggest_data(), Eq(data));
 
@@ -147,8 +170,7 @@
 
   // Load some data.
   service()->Refresh();
-  SearchSuggestData data;
-  data.suggestions_html = "<div></div>";
+  SearchSuggestData data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
   ASSERT_THAT(service()->search_suggest_data(), Eq(data));
 
@@ -166,8 +188,7 @@
 
   // Load some data.
   service()->Refresh();
-  SearchSuggestData data;
-  data.suggestions_html = "<div></div>";
+  SearchSuggestData data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
   ASSERT_THAT(service()->search_suggest_data(), Eq(data));
 
@@ -216,8 +237,7 @@
   EXPECT_THAT(loader()->GetCallbackCount(), Eq(1u));
 
   // Fulfill it.
-  SearchSuggestData data;
-  data.suggestions_html = "<div></div>";
+  SearchSuggestData data = TestSearchSuggestData();
   loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
   EXPECT_THAT(service()->search_suggest_data(), Eq(data));
 
@@ -245,3 +265,169 @@
   EXPECT_THAT(loader()->GetCallbackCount(), Eq(0u));
   EXPECT_THAT(service()->search_suggest_data(), Eq(base::nullopt));
 }
+
+TEST_F(SearchSuggestServiceTest, UpdateImpressionCapParameters) {
+  ASSERT_EQ(base::nullopt, service()->search_suggest_data());
+  SignIn();
+
+  // Request a refresh. That should arrive at the loader.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  // Fulfill it.
+  SearchSuggestData data = TestSearchSuggestData();
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+
+  // Request another refresh.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  // For now, the old data should still be there.
+  EXPECT_EQ(data, service()->search_suggest_data());
+
+  // Fulfill the second request.
+  SearchSuggestData other_data;
+  other_data.suggestions_html = "<div>different</div>";
+  other_data.impression_cap_expire_time_ms = 1234;
+  other_data.request_freeze_time_ms = 4321;
+  other_data.max_impressions = 456;
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, other_data);
+  EXPECT_EQ(other_data, service()->search_suggest_data());
+
+  // Ensure the pref parses successfully.
+  const base::DictionaryValue* dict =
+      pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  int impression_cap_expire_time_ms = 0;
+  ASSERT_TRUE(dict->GetInteger("impression_cap_expire_time_ms",
+                               &impression_cap_expire_time_ms));
+  int request_freeze_time_ms = 0;
+  ASSERT_TRUE(
+      dict->GetInteger("request_freeze_time_ms", &request_freeze_time_ms));
+  int max_impressions = 0;
+  ASSERT_TRUE(dict->GetInteger("max_impressions", &max_impressions));
+
+  EXPECT_EQ(1234, impression_cap_expire_time_ms);
+  EXPECT_EQ(4321, request_freeze_time_ms);
+  EXPECT_EQ(456, max_impressions);
+}
+
+TEST_F(SearchSuggestServiceTest, DontRequestWhenImpressionCapped) {
+  ASSERT_EQ(base::nullopt, service()->search_suggest_data());
+  SignIn();
+
+  const base::DictionaryValue* dict =
+      pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  int impressions_count = 0;
+  ASSERT_TRUE(dict->GetInteger("impressions_count", &impressions_count));
+  EXPECT_EQ(0, impressions_count);
+
+  // Request a refresh. That should arrive at the loader.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  // Fulfill it.
+  SearchSuggestData data = TestSearchSuggestData();
+  data.max_impressions = 2;
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+  service()->SuggestionsDisplayed();
+
+  dict = pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  ASSERT_TRUE(dict->GetInteger("impressions_count", &impressions_count));
+  EXPECT_EQ(1, impressions_count);
+
+  // Request another refresh.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+  service()->SuggestionsDisplayed();
+
+  dict = pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  ASSERT_TRUE(dict->GetInteger("impressions_count", &impressions_count));
+  EXPECT_EQ(2, impressions_count);
+
+  // Should not make another request as we've reached the cap
+  service()->Refresh();
+  EXPECT_EQ(0u, loader()->GetCallbackCount());
+}
+
+TEST_F(SearchSuggestServiceTest, ImpressionCountResetsAfterTimeout) {
+  ASSERT_EQ(base::nullopt, service()->search_suggest_data());
+  SignIn();
+
+  const base::DictionaryValue* dict =
+      pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  int impressions_count = 0;
+  ASSERT_TRUE(dict->GetInteger("impressions_count", &impressions_count));
+  EXPECT_EQ(0, impressions_count);
+
+  // Request a refresh. That should arrive at the loader.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  // Fulfill it.
+  SearchSuggestData data = TestSearchSuggestData();
+  data.max_impressions = 1;
+  data.impression_cap_expire_time_ms = 1000;
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+  service()->SuggestionsDisplayed();
+
+  dict = pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  ASSERT_TRUE(dict->GetInteger("impressions_count", &impressions_count));
+  EXPECT_EQ(1, impressions_count);
+
+  // The impression cap has been reached.
+  service()->Refresh();
+  EXPECT_EQ(base::nullopt, service()->search_suggest_data());
+
+  RunFor(base::TimeDelta::FromMilliseconds(1000));
+
+  // The impression cap timeout has expired.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+}
+
+TEST_F(SearchSuggestServiceTest, RequestsFreezeOnEmptyResponse) {
+  ASSERT_EQ(base::nullopt, service()->search_suggest_data());
+  SignIn();
+
+  // Request a refresh. That should arrive at the loader.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  // Fulfill it.
+  SearchSuggestData data = TestSearchSuggestData();
+  data.request_freeze_time_ms = 1000;
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+
+  // Request a refresh. That should arrive at the loader.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::FATAL_ERROR,
+                                  base::nullopt);
+
+  const base::DictionaryValue* dict =
+      pref_service()->GetDictionary(prefs::kNtpSearchSuggestionsImpressions);
+  bool is_request_frozen;
+  ASSERT_TRUE(dict->GetBoolean("is_request_frozen", &is_request_frozen));
+  EXPECT_TRUE(is_request_frozen);
+
+  // No request should be made since they are frozen.
+  service()->Refresh();
+  EXPECT_EQ(base::nullopt, service()->search_suggest_data());
+
+  RunFor(base::TimeDelta::FromMilliseconds(1000));
+
+  // The freeze timeout has expired.
+  service()->Refresh();
+  EXPECT_EQ(1u, loader()->GetCallbackCount());
+  loader()->RespondToAllCallbacks(SearchSuggestLoader::Status::OK, data);
+  EXPECT_EQ(data, service()->search_suggest_data());
+}
diff --git a/chrome/browser/signin/dice_response_handler_unittest.cc b/chrome/browser/signin/dice_response_handler_unittest.cc
index 1dff00b..0080f381 100644
--- a/chrome/browser/signin/dice_response_handler_unittest.cc
+++ b/chrome/browser/signin/dice_response_handler_unittest.cc
@@ -246,7 +246,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   EXPECT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -268,8 +268,11 @@
   EXPECT_EQ(1, reconcilor_blocked_count_);
   EXPECT_EQ(1, reconcilor_unblocked_count_);
   // Check that the AccountInfo::is_under_advanced_protection is set.
-  EXPECT_TRUE(account_tracker_service_.GetAccountInfo(account_id)
-                  .is_under_advanced_protection);
+  EXPECT_TRUE(
+      identity_manager()
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(account_id)
+          .value()
+          .is_under_advanced_protection);
 }
 
 // Checks that a GaiaAuthFetcher failure is handled correctly.
@@ -277,7 +280,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   EXPECT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -305,7 +308,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -325,8 +328,11 @@
       false /* is_advanced_protection*/));
   // Check that the token has been inserted in the token service.
   EXPECT_TRUE(identity_manager()->HasAccountWithRefreshToken(account_id));
-  EXPECT_FALSE(account_tracker_service_.GetAccountInfo(account_id)
-                   .is_under_advanced_protection);
+  EXPECT_FALSE(
+      identity_manager()
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(account_id)
+          .value()
+          .is_under_advanced_protection);
 }
 
 // Checks that two SIGNIN requests can happen concurrently.
@@ -338,9 +344,9 @@
   dice_params_2.signin_info->account_info.email = "other_email";
   dice_params_2.signin_info->account_info.gaia_id = "other_gaia_id";
   const auto& account_info_2 = dice_params_2.signin_info->account_info;
-  std::string account_id_1 = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id_1 = identity_manager()->LegacyPickAccountIdForAccount(
       account_info_1.gaia_id, account_info_1.email);
-  std::string account_id_2 = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id_2 = identity_manager()->LegacyPickAccountIdForAccount(
       account_info_2.gaia_id, account_info_2.email);
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id_1));
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id_2));
@@ -364,16 +370,22 @@
       true /* is_advanced_protection*/));
   // Check that the token has been inserted in the token service.
   EXPECT_TRUE(identity_manager()->HasAccountWithRefreshToken(account_id_1));
-  EXPECT_TRUE(account_tracker_service_.GetAccountInfo(account_id_1)
-                  .is_under_advanced_protection);
+  EXPECT_TRUE(
+      identity_manager()
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(account_id_1)
+          .value()
+          .is_under_advanced_protection);
   // Simulate GaiaAuthFetcher success for the second request.
   consumer_2->OnClientOAuthSuccess(GaiaAuthConsumer::ClientOAuthResult(
       "refresh_token", "access_token", 10, false /* is_child_account */,
       false /* is_advanced_protection*/));
   // Check that the token has been inserted in the token service.
   EXPECT_TRUE(identity_manager()->HasAccountWithRefreshToken(account_id_2));
-  EXPECT_FALSE(account_tracker_service_.GetAccountInfo(account_id_2)
-                   .is_under_advanced_protection);
+  EXPECT_FALSE(
+      identity_manager()
+          ->FindAccountInfoForAccountWithRefreshTokenByAccountId(account_id_2)
+          .value()
+          .is_under_advanced_protection);
   // Check that the reconcilor was blocked and unblocked exactly once.
   EXPECT_EQ(1, reconcilor_blocked_count_);
   EXPECT_EQ(1, reconcilor_unblocked_count_);
@@ -385,7 +397,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -417,7 +429,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -447,7 +459,7 @@
   InitializeDiceResponseHandler(signin::AccountConsistencyMethod::kDice);
   DiceResponseParams dice_params = MakeDiceParams(DiceAction::SIGNIN);
   const auto& account_info = dice_params.signin_info->account_info;
-  std::string account_id = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id = identity_manager()->LegacyPickAccountIdForAccount(
       account_info.gaia_id, account_info.email);
   ASSERT_FALSE(identity_manager()->HasAccountWithRefreshToken(account_id));
   dice_response_handler_->ProcessDiceHeader(
@@ -660,9 +672,9 @@
   signin_params_2.signin_info->account_info.gaia_id = "other_gaia_id";
   const auto& signin_account_info_1 = signin_params_1.signin_info->account_info;
   const auto& signin_account_info_2 = signin_params_2.signin_info->account_info;
-  std::string account_id_1 = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id_1 = identity_manager()->LegacyPickAccountIdForAccount(
       signin_account_info_1.gaia_id, signin_account_info_1.email);
-  std::string account_id_2 = account_tracker_service_.PickAccountIdForAccount(
+  std::string account_id_2 = identity_manager()->LegacyPickAccountIdForAccount(
       signin_account_info_2.gaia_id, signin_account_info_2.email);
   dice_response_handler_->ProcessDiceHeader(
       signin_params_1, std::make_unique<TestProcessDiceHeaderDelegate>(this));
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index e15071e..0e4e2df 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -525,6 +525,7 @@
     "//third_party/zlib",
     "//ui/accessibility",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/compositor",
     "//ui/content_accelerators",
diff --git a/chrome/browser/ui/app_list/search/internal_app_result.cc b/chrome/browser/ui/app_list/search/internal_app_result.cc
index 66ea2aa..1bf2034 100644
--- a/chrome/browser/ui/app_list/search/internal_app_result.cc
+++ b/chrome/browser/ui/app_list/search/internal_app_result.cc
@@ -105,7 +105,7 @@
     // Desired size of the icon. If not available, a smaller one will be used.
     constexpr int min_source_size_in_pixel = 16;
     constexpr int desired_size_in_pixel = 32;
-    large_icon_service_->GetLargeIconImageOrFallbackStyle(
+    large_icon_service_->GetLargeIconImageOrFallbackStyleForPageUrl(
         url_for_continuous_reading_, min_source_size_in_pixel,
         desired_size_in_pixel,
         base::BindRepeating(&InternalAppResult::OnGetFaviconFromCacheFinished,
diff --git a/chrome/browser/ui/ash/chrome_screenshot_grabber_browsertest.cc b/chrome/browser/ui/ash/chrome_screenshot_grabber_browsertest.cc
index c62328f..be34a70 100644
--- a/chrome/browser/ui/ash/chrome_screenshot_grabber_browsertest.cc
+++ b/chrome/browser/ui/ash/chrome_screenshot_grabber_browsertest.cc
@@ -67,7 +67,8 @@
 
   bool IsImageClipboardAvailable() {
     return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable(
-        ui::Clipboard::GetBitmapFormatType(), ui::CLIPBOARD_TYPE_COPY_PASTE);
+        ui::ClipboardFormatType::GetBitmapType(),
+        ui::CLIPBOARD_TYPE_COPY_PASTE);
   }
 
   scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
diff --git a/chrome/browser/ui/omnibox/clipboard_utils.cc b/chrome/browser/ui/omnibox/clipboard_utils.cc
index 239c7f4c9..de83f73 100644
--- a/chrome/browser/ui/omnibox/clipboard_utils.cc
+++ b/chrome/browser/ui/omnibox/clipboard_utils.cc
@@ -12,7 +12,7 @@
 base::string16 GetClipboardText() {
   // Try text format.
   ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
-  if (clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
+  if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextWType(),
                                    ui::CLIPBOARD_TYPE_COPY_PASTE)) {
     base::string16 text;
     clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &text);
@@ -26,7 +26,7 @@
   // and pastes from the URL bar to itself, the text will get fixed up and
   // cannonicalized, which is not what the user expects.  By pasting in this
   // order, we are sure to paste what the user copied.
-  if (clipboard->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(),
+  if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetUrlWType(),
                                    ui::CLIPBOARD_TYPE_COPY_PASTE)) {
     std::string url_str;
     clipboard->ReadBookmark(NULL, &url_str);
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc
index de4516d5..3deee8fb 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc
@@ -159,10 +159,8 @@
                                                int text_context,
                                                int text_style) const;
 
-  // Sets |font_weight| as the font weight to be used for primary information on
-  // the current item. Returns false if no custom font weight is undefined.
-  virtual bool ShouldUseCustomFontWeightForPrimaryInfo(
-      gfx::Font::Weight* font_weight) const = 0;
+  // Returns the font weight to be applied to primary info.
+  virtual gfx::Font::Weight GetPrimaryTextWeight() const = 0;
 
  private:
   void AddIcon(gfx::ImageSkia icon);
@@ -192,8 +190,7 @@
   std::unique_ptr<views::Background> CreateBackground() override;
   PopupItemLayoutType GetLayoutType() const override;
   int GetPrimaryTextStyle() override;
-  bool ShouldUseCustomFontWeightForPrimaryInfo(
-      gfx::Font::Weight* font_weight) const override;
+  gfx::Font::Weight GetPrimaryTextWeight() const override;
   views::View* CreateSubtextLabel() override;
   views::View* CreateDescriptionLabel() override;
 
@@ -219,8 +216,7 @@
   views::View* CreateValueLabel() override;
   views::View* CreateSubtextLabel() override;
   views::View* CreateDescriptionLabel() override;
-  bool ShouldUseCustomFontWeightForPrimaryInfo(
-      gfx::Font::Weight* font_weight) const override;
+  gfx::Font::Weight GetPrimaryTextWeight() const override;
 
  private:
   PasswordPopupSuggestionView(AutofillPopupViewNativeViews* popup_view,
@@ -249,8 +245,7 @@
   void CreateContent() override;
   std::unique_ptr<views::Background> CreateBackground() override;
   int GetPrimaryTextStyle() override;
-  bool ShouldUseCustomFontWeightForPrimaryInfo(
-      gfx::Font::Weight* font_weight) const override;
+  gfx::Font::Weight GetPrimaryTextWeight() const override;
 
  private:
   AutofillPopupFooterView(AutofillPopupViewNativeViews* popup_view,
@@ -460,8 +455,8 @@
       popup_view_->controller()->GetElidedValueAt(line_number_),
       ChromeTextContext::CONTEXT_BODY_TEXT_LARGE, GetPrimaryTextStyle());
 
-  gfx::Font::Weight font_weight;
-  if (ShouldUseCustomFontWeightForPrimaryInfo(&font_weight)) {
+  const gfx::Font::Weight font_weight = GetPrimaryTextWeight();
+  if (font_weight != text_label->font_list().GetFontWeight()) {
     text_label->SetFontList(
         text_label->font_list().DeriveWithWeight(font_weight));
   }
@@ -562,20 +557,8 @@
   return views::style::TextStyle::STYLE_PRIMARY;
 }
 
-bool AutofillPopupSuggestionView::ShouldUseCustomFontWeightForPrimaryInfo(
-    gfx::Font::Weight* font_weight) const {
-  switch (autofill::GetForcedFontWeight()) {
-    case ForcedFontWeight::kDefault:
-      return false;
-
-    case ForcedFontWeight::kMedium:
-      *font_weight = views::TypographyProvider::MediumWeightForUI();
-      return true;
-
-    case ForcedFontWeight::kBold:
-      *font_weight = gfx::Font::Weight::BOLD;
-      return true;
-  }
+gfx::Font::Weight AutofillPopupSuggestionView::GetPrimaryTextWeight() const {
+  return views::TypographyProvider::MediumWeightForUI();
 }
 
 AutofillPopupSuggestionView::AutofillPopupSuggestionView(
@@ -659,9 +642,8 @@
   return new ConstrainedWidthView(label, kAutofillPopupPasswordMaxWidth);
 }
 
-bool PasswordPopupSuggestionView::ShouldUseCustomFontWeightForPrimaryInfo(
-    gfx::Font::Weight* font_weight) const {
-  return false;
+gfx::Font::Weight PasswordPopupSuggestionView::GetPrimaryTextWeight() const {
+  return gfx::Font::Weight::NORMAL;
 }
 
 PasswordPopupSuggestionView::PasswordPopupSuggestionView(
@@ -717,9 +699,8 @@
   return ChromeTextStyle::STYLE_SECONDARY;
 }
 
-bool AutofillPopupFooterView::ShouldUseCustomFontWeightForPrimaryInfo(
-    gfx::Font::Weight* font_weight) const {
-  return false;
+gfx::Font::Weight AutofillPopupFooterView::GetPrimaryTextWeight() const {
+  return gfx::Font::Weight::NORMAL;
 }
 
 AutofillPopupFooterView::AutofillPopupFooterView(
diff --git a/chrome/browser/ui/views/autofill/dialog_view_ids.h b/chrome/browser/ui/views/autofill/dialog_view_ids.h
index 3a9b2be..eb7d8ac 100644
--- a/chrome/browser/ui/views/autofill/dialog_view_ids.h
+++ b/chrome/browser/ui/views/autofill/dialog_view_ids.h
@@ -8,21 +8,17 @@
 #include "components/autofill/core/browser/field_types.h"
 
 // This defines an enumeration of IDs that can uniquely identify a view within
-// the scope of the local and upload credit card save bubbles as well as the
-// local card migration bubble and dialogs.
+// the scope of the local and upload credit card save bubbles.
 
 namespace autofill {
 
 enum DialogViewId : int {
   VIEW_ID_NONE = 0,
 
-  // The following views are contained in SaveCardBubbleViews.
-  MAIN_CONTENT_VIEW_LOCAL,   // The main content view for a local
-                             // save bubble
-  MAIN_CONTENT_VIEW_UPLOAD,  // The main content view for an upload
-                             // save bubble
-  FOOTNOTE_VIEW,             // The footnote view of either an upload
-                             // save bubble or a manage cards view.
+  // The following are the important containing views of the bubble.
+  MAIN_CONTENT_VIEW_LOCAL,   // The main content view, for a local save bubble
+  MAIN_CONTENT_VIEW_UPLOAD,  // The main content view, for an upload save bubble
+  FOOTNOTE_VIEW,             // Contains the legal messages for upload save
   SIGN_IN_PROMO_VIEW,        // Contains the sign-in promo view
   MANAGE_CARDS_VIEW,         // The manage cards view
   EXPIRATION_DATE_VIEW,      // Contains the dropdowns for expiration date
@@ -30,12 +26,6 @@
   // The sub-view that contains the sign-in button in the promo.
   SIGN_IN_VIEW,
 
-  // The main content view for a migration offer bubble.
-  MAIN_CONTENT_VIEW_MIGRATION_BUBBLE,
-
-  // The main content view for the main migration dialog.
-  MAIN_CONTENT_VIEW_MIGRATION_OFFER_DIALOG,
-
   // The following are views::LabelButton objects (clickable).
   OK_BUTTON,            // Can say [Save], [Next], [Confirm],
                         // or [Done] depending on context
diff --git a/chrome/browser/ui/views/autofill/local_card_migration_browsertest.cc b/chrome/browser/ui/views/autofill/local_card_migration_browsertest.cc
deleted file mode 100644
index f124e0c2..0000000
--- a/chrome/browser/ui/views/autofill/local_card_migration_browsertest.cc
+++ /dev/null
@@ -1,675 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <ctime>
-#include <list>
-#include <memory>
-#include <string>
-#include <utility>
-
-#include "base/callback_list.h"
-#include "base/command_line.h"
-#include "base/macros.h"
-#include "base/test/metrics/histogram_tester.h"
-#include "base/test/scoped_feature_list.h"
-#include "chrome/browser/signin/account_fetcher_service_factory.h"
-#include "chrome/browser/signin/account_tracker_service_factory.h"
-#include "chrome/browser/signin/fake_account_fetcher_service_builder.h"
-#include "chrome/browser/signin/fake_signin_manager_builder.h"
-#include "chrome/browser/signin/identity_manager_factory.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
-#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
-#include "chrome/browser/sync/test/integration/sync_test.h"
-#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
-#include "chrome/browser/ui/autofill/local_card_migration_bubble_controller_impl.h"
-#include "chrome/browser/ui/autofill/local_card_migration_dialog_controller_impl.h"
-#include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/location_bar/location_bar.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/browser/ui/views/autofill/dialog_view_ids.h"
-#include "chrome/browser/ui/views/autofill/local_card_migration_bubble_views.h"
-#include "chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h"
-#include "chrome/browser/ui/views/autofill/local_card_migration_icon_view.h"
-#include "chrome/browser/ui/views/autofill/save_card_bubble_views.h"
-#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "components/autofill/content/browser/content_autofill_driver.h"
-#include "components/autofill/core/browser/autofill_test_utils.h"
-#include "components/autofill/core/browser/credit_card_save_manager.h"
-#include "components/autofill/core/browser/form_data_importer.h"
-#include "components/autofill/core/browser/local_card_migration_manager.h"
-#include "components/autofill/core/browser/personal_data_manager.h"
-#include "components/autofill/core/browser/test_event_waiter.h"
-#include "components/autofill/core/common/autofill_features.h"
-#include "components/autofill/core/common/autofill_prefs.h"
-#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#include "components/network_session_configurator/common/network_switches.h"
-#include "components/prefs/pref_registry_simple.h"
-#include "components/signin/core/browser/account_tracker_service.h"
-#include "components/signin/core/browser/fake_account_fetcher_service.h"
-#include "components/sync/test/fake_server/fake_server.h"
-#include "components/sync/test/fake_server/fake_server_network_resources.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "content/public/test/browser_test_utils.h"
-#include "content/public/test/test_navigation_observer.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"
-#include "services/identity/public/cpp/identity_manager.h"
-#include "services/identity/public/cpp/identity_test_utils.h"
-#include "services/network/public/cpp/shared_url_loader_factory.h"
-#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
-#include "services/network/test/test_url_loader_factory.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/events/base_event_utils.h"
-#include "ui/views/bubble/bubble_frame_view.h"
-#include "ui/views/controls/button/button.h"
-#include "ui/views/controls/button/label_button.h"
-#include "ui/views/test/widget_test.h"
-#include "ui/views/window/dialog_client_view.h"
-
-using base::Bucket;
-using testing::ElementsAre;
-
-namespace autofill {
-
-namespace {
-
-constexpr char kURLGetUploadDetailsRequest[] =
-    "https://payments.google.com/payments/apis/chromepaymentsservice/"
-    "getdetailsforsavecard";
-constexpr char kResponseGetUploadDetailsSuccess[] =
-    "{\"legal_message\":{\"line\":[{\"template\":\"Legal message template with "
-    "link: "
-    "{0}.\",\"template_parameter\":[{\"display_text\":\"Link\",\"url\":\"https:"
-    "//www.example.com/\"}]}]},\"context_token\":\"dummy_context_token\"}";
-constexpr char kResponseGetUploadDetailsFailure[] =
-    "{\"error\":{\"code\":\"FAILED_PRECONDITION\",\"user_error_message\":\"An "
-    "unexpected error has occurred. Please try again later.\"}}";
-
-constexpr char kCreditCardFormURL[] =
-    "/credit_card_upload_form_address_and_cc.html";
-
-constexpr char kFirstCardNumber[] = "5428424047572420";   // Mastercard
-constexpr char kSecondCardNumber[] = "4782187095085933";  // Visa
-
-constexpr double kFakeGeolocationLatitude = 1.23;
-constexpr double kFakeGeolocationLongitude = 4.56;
-
-}  // namespace
-
-class LocalCardMigrationBrowserTest
-    : public SyncTest,
-      public LocalCardMigrationManager::ObserverForTest {
- protected:
-  // Various events that can be waited on by the DialogEventWaiter.
-  enum class DialogEvent : int {
-    REQUESTED_LOCAL_CARD_MIGRATION,
-    RECEIVED_GET_UPLOAD_DETAILS_RESPONSE,
-    SENT_MIGRATE_CARDS_REQUEST,
-    RECEIVED_MIGRATE_CARDS_RESPONSE
-  };
-
-  LocalCardMigrationBrowserTest() : SyncTest(SINGLE_CLIENT) {}
-
-  ~LocalCardMigrationBrowserTest() override {}
-
-  void SetUpOnMainThread() override {
-    SyncTest::SetUpOnMainThread();
-
-    // Set up the HTTPS server (uses the embedded_test_server).
-    ASSERT_TRUE(embedded_test_server()->InitializeAndListen());
-    embedded_test_server()->ServeFilesFromSourceDirectory(
-        "components/test/data/autofill");
-    embedded_test_server()->StartAcceptingConnections();
-
-    ProfileSyncServiceFactory::GetForProfile(browser()->profile())
-        ->OverrideNetworkResourcesForTest(
-            std::make_unique<fake_server::FakeServerNetworkResources>(
-                GetFakeServer()->AsWeakPtr()));
-
-    std::string username;
-#if defined(OS_CHROMEOS)
-    // In ChromeOS browser tests, the profile may already by authenticated with
-    // stub account |user_manager::kStubUserEmail|.
-    AccountInfo info =
-        IdentityManagerFactory::GetForProfile(browser()->profile())
-            ->GetPrimaryAccountInfo();
-    username = info.email;
-#endif
-    if (username.empty())
-      username = "user@gmail.com";
-
-    harness_ = ProfileSyncServiceHarness::Create(
-        browser()->profile(), username, "password",
-        ProfileSyncServiceHarness::SigninType::FAKE_SIGNIN);
-
-    // Set up the URL loader factory for the payments client so we can intercept
-    // those network requests too.
-    test_shared_loader_factory_ =
-        base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
-            &test_url_loader_factory_);
-    ContentAutofillDriver::GetForRenderFrameHost(
-        GetActiveWebContents()->GetMainFrame())
-        ->autofill_manager()
-        ->client()
-        ->GetPaymentsClient()
-        ->set_url_loader_factory_for_testing(test_shared_loader_factory_);
-
-    // Set up this class as the ObserverForTest implementation.
-    LocalCardMigrationManager* local_card_migration_manager =
-        ContentAutofillDriver::GetForRenderFrameHost(
-            GetActiveWebContents()->GetMainFrame())
-            ->autofill_manager()
-            ->client()
-            ->GetFormDataImporter()
-            ->local_card_migration_manager_.get();
-
-    local_card_migration_manager->SetEventObserverForTesting(this);
-    personal_data_ = local_card_migration_manager->personal_data_manager_;
-
-    // Set up the fake geolocation data.
-    geolocation_overrider_ =
-        std::make_unique<device::ScopedGeolocationOverrider>(
-            kFakeGeolocationLatitude, kFakeGeolocationLongitude);
-
-    // Set up billing customer ID.
-    ContentAutofillDriver::GetForRenderFrameHost(
-        GetActiveWebContents()->GetMainFrame())
-        ->autofill_manager()
-        ->client()
-        ->GetPrefs()
-        ->SetDouble(prefs::kAutofillBillingCustomerNumber, 1234);
-
-    scoped_feature_list_.InitAndEnableFeature(
-        features::kAutofillCreditCardLocalCardMigration);
-    ASSERT_TRUE(harness_->SetupSync());
-    SetUploadDetailsRpcPaymentsAccepts();
-  }
-
-  void NavigateTo(const std::string& file_path) {
-    ui_test_utils::NavigateToURL(
-        browser(), file_path.find("data:") == 0U
-                       ? GURL(file_path)
-                       : embedded_test_server()->GetURL(file_path));
-  }
-
-  void OnDecideToRequestLocalCardMigration() override {
-    if (event_waiter_)
-      event_waiter_->OnEvent(DialogEvent::REQUESTED_LOCAL_CARD_MIGRATION);
-  }
-
-  void OnReceivedGetUploadDetailsResponse() override {
-    if (event_waiter_)
-      event_waiter_->OnEvent(DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE);
-  }
-
-  void OnSentMigrateCardsRequest() override {
-    if (event_waiter_)
-      event_waiter_->OnEvent(DialogEvent::SENT_MIGRATE_CARDS_REQUEST);
-  }
-
-  void OnReceivedMigrateCardsResponse() override {
-    if (event_waiter_)
-      event_waiter_->OnEvent(DialogEvent::RECEIVED_MIGRATE_CARDS_RESPONSE);
-  }
-
-  void SaveLocalCard(std::string card_number) {
-    CreditCard local_card;
-    test::SetCreditCardInfo(&local_card, "John Smith", card_number.c_str(),
-                            "12", test::NextYear().c_str(), "1");
-    local_card.set_guid("00000000-0000-0000-0000-" + card_number.substr(0, 12));
-    local_card.set_record_type(CreditCard::LOCAL_CARD);
-    personal_data_->AddCreditCard(local_card);
-  }
-
-  void SaveServerCard(std::string card_number) {
-    CreditCard server_card;
-    test::SetCreditCardInfo(&server_card, "John Smith", card_number.c_str(),
-                            "12", test::NextYear().c_str(), "1");
-    server_card.set_guid("00000000-0000-0000-0000-" +
-                         card_number.substr(0, 12));
-    server_card.set_record_type(CreditCard::FULL_SERVER_CARD);
-    server_card.set_server_id("full_id_" + card_number);
-    personal_data_->AddFullServerCreditCard(server_card);
-  }
-
-  void UseCardAndWaitForMigrationOffer(std::string card_number) {
-    // Reusing a card should show the migration offer bubble.
-    ResetEventWaiterForSequence(
-        {DialogEvent::REQUESTED_LOCAL_CARD_MIGRATION,
-         DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE});
-    FillAndSubmitFormWithCard(card_number);
-    WaitForObservedEvent();
-  }
-
-  void FillAndSubmitFormWithCard(std::string card_number) {
-    NavigateTo(kCreditCardFormURL);
-    content::WebContents* web_contents = GetActiveWebContents();
-
-    const std::string click_fill_button_js =
-        "(function() { document.getElementById('fill_form').click(); })();";
-    ASSERT_TRUE(content::ExecuteScript(web_contents, click_fill_button_js));
-
-    const std::string fill_cc_number_js =
-        "(function() { document.getElementsByName(\"cc_number\")[0].value = " +
-        card_number + "; })();";
-    ASSERT_TRUE(content::ExecuteScript(web_contents, fill_cc_number_js));
-
-    const std::string click_submit_button_js =
-        "(function() { document.getElementById('submit').click(); })();";
-    content::TestNavigationObserver nav_observer(web_contents);
-    ASSERT_TRUE(content::ExecuteScript(web_contents, click_submit_button_js));
-    nav_observer.Wait();
-  }
-
-  void SetUploadDetailsRpcPaymentsAccepts() {
-    test_url_loader_factory()->AddResponse(kURLGetUploadDetailsRequest,
-                                           kResponseGetUploadDetailsSuccess);
-  }
-
-  void SetUploadDetailsRpcPaymentsDeclines() {
-    test_url_loader_factory()->AddResponse(kURLGetUploadDetailsRequest,
-                                           kResponseGetUploadDetailsFailure);
-  }
-
-  void ClickOnView(views::View* view) {
-    DCHECK(view);
-    ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
-                           ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
-                           ui::EF_LEFT_MOUSE_BUTTON);
-    view->OnMousePressed(pressed);
-    ui::MouseEvent released_event =
-        ui::MouseEvent(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(),
-                       ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
-                       ui::EF_LEFT_MOUSE_BUTTON);
-    view->OnMouseReleased(released_event);
-  }
-
-  void ClickOnDialogViewAndWait(
-      views::View* view,
-      views::DialogDelegateView* local_card_migration_view) {
-    DCHECK(local_card_migration_view);
-    views::test::WidgetDestroyedWaiter destroyed_waiter(
-        local_card_migration_view->GetWidget());
-    local_card_migration_view->GetDialogClientView()
-        ->ResetViewShownTimeStampForTesting();
-    views::BubbleFrameView* bubble_frame_view =
-        static_cast<views::BubbleFrameView*>(
-            local_card_migration_view->GetWidget()
-                ->non_client_view()
-                ->frame_view());
-    bubble_frame_view->ResetViewShownTimeStampForTesting();
-    ClickOnView(view);
-    destroyed_waiter.Wait();
-  }
-
-  views::View* FindViewInDialogById(
-      DialogViewId view_id,
-      views::DialogDelegateView* local_card_migration_view) {
-    DCHECK(local_card_migration_view);
-
-    views::View* specified_view =
-        local_card_migration_view->GetViewByID(static_cast<int>(view_id));
-
-    if (!specified_view) {
-      specified_view =
-          local_card_migration_view->GetDialogClientView()->GetViewByID(
-              static_cast<int>(view_id));
-    }
-
-    return specified_view;
-  }
-
-  void ClickOnOkButton(views::DialogDelegateView* local_card_migration_view) {
-    views::View* ok_button =
-        local_card_migration_view->GetDialogClientView()->ok_button();
-
-    ClickOnDialogViewAndWait(ok_button, local_card_migration_view);
-  }
-
-  void ClickOnCancelButton(
-      views::DialogDelegateView* local_card_migration_view) {
-    views::View* cancel_button =
-        local_card_migration_view->GetDialogClientView()->cancel_button();
-    ClickOnDialogViewAndWait(cancel_button, local_card_migration_view);
-  }
-
-  views::DialogDelegateView* GetLocalCardMigrationOfferBubbleViews() {
-    LocalCardMigrationBubbleControllerImpl*
-        local_card_migration_bubble_controller_impl =
-            LocalCardMigrationBubbleControllerImpl::FromWebContents(
-                GetActiveWebContents());
-    if (!local_card_migration_bubble_controller_impl)
-      return nullptr;
-    return static_cast<LocalCardMigrationBubbleViews*>(
-        local_card_migration_bubble_controller_impl
-            ->local_card_migration_bubble_view());
-  }
-
-  views::DialogDelegateView* GetLocalCardMigrationMainDialogView() {
-    LocalCardMigrationDialogControllerImpl*
-        local_card_migration_dialog_controller_impl =
-            LocalCardMigrationDialogControllerImpl::FromWebContents(
-                GetActiveWebContents());
-    if (!local_card_migration_dialog_controller_impl)
-      return nullptr;
-    return static_cast<LocalCardMigrationDialogView*>(
-        local_card_migration_dialog_controller_impl
-            ->local_card_migration_dialog_view());
-  }
-
-  LocalCardMigrationIconView* GetLocalCardMigrationIconView() {
-    if (!browser())
-      return nullptr;
-    LocationBarView* location_bar_view =
-        static_cast<LocationBarView*>(browser()->window()->GetLocationBar());
-    DCHECK(location_bar_view->local_card_migration_icon_view());
-    return location_bar_view->local_card_migration_icon_view();
-  }
-
-  views::View* GetCloseButton() {
-    LocalCardMigrationBubbleViews* local_card_migration_bubble_views =
-        static_cast<LocalCardMigrationBubbleViews*>(
-            GetLocalCardMigrationOfferBubbleViews());
-    DCHECK(local_card_migration_bubble_views);
-    return local_card_migration_bubble_views->GetBubbleFrameView()
-        ->GetCloseButtonForTest();
-  }
-
-  views::View* GetCardListView() {
-    return static_cast<LocalCardMigrationDialogView*>(
-               GetLocalCardMigrationMainDialogView())
-        ->card_list_view_;
-  }
-
-  content::WebContents* GetActiveWebContents() {
-    return browser()->tab_strip_model()->GetActiveWebContents();
-  }
-
-  void ResetEventWaiterForSequence(std::list<DialogEvent> event_sequence) {
-    event_waiter_ =
-        std::make_unique<EventWaiter<DialogEvent>>(std::move(event_sequence));
-  }
-
-  void WaitForObservedEvent() { event_waiter_->Wait(); }
-
-  network::TestURLLoaderFactory* test_url_loader_factory() {
-    return &test_url_loader_factory_;
-  }
-
-  PersonalDataManager* personal_data_ = nullptr;
-
-  std::unique_ptr<
-      base::CallbackList<void(content::BrowserContext*)>::Subscription>
-      will_create_browser_context_services_subscription_;
-
-  base::test::ScopedFeatureList scoped_feature_list_;
-
-  std::unique_ptr<ProfileSyncServiceHarness> harness_;
-
- private:
-  std::unique_ptr<autofill::EventWaiter<DialogEvent>> event_waiter_;
-  std::unique_ptr<net::FakeURLFetcherFactory> url_fetcher_factory_;
-  network::TestURLLoaderFactory test_url_loader_factory_;
-  scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_;
-  std::unique_ptr<device::ScopedGeolocationOverrider> geolocation_overrider_;
-
-  DISALLOW_COPY_AND_ASSIGN(LocalCardMigrationBrowserTest);
-};
-
-// Ensures that migration is not offered when user saves a new card.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       UsingNewCardDoesNotShowIntermediateMigrationOffer) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  FillAndSubmitFormWithCard(kSecondCardNumber);
-
-  // No migration bubble should be showing, because the single card upload
-  // bubble should be displayed instead.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // No metrics are recorded when migration is not offered.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.LocalCardMigrationBubbleOffer.FirstShow", 0);
-}
-
-// Ensures that migration is not offered when payments declines the cards.
-IN_PROC_BROWSER_TEST_F(
-    LocalCardMigrationBrowserTest,
-    IntermediateMigrationOfferDoesNotShowWhenPaymentsDeclines) {
-  base::HistogramTester histogram_tester;
-  SetUploadDetailsRpcPaymentsDeclines();
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  FillAndSubmitFormWithCard(kFirstCardNumber);
-
-  // No bubble should be showing.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // No metrics are recorded when migration is not offered.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.LocalCardMigrationBubbleOffer.FirstShow", 0);
-}
-
-// Ensures that the intermediate migration bubble is not shown after reusing a
-// saved server card, if there are no other cards to migrate.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ReusingServerCardDoesNotShowIntermediateMigrationOffer) {
-  base::HistogramTester histogram_tester;
-
-  SaveServerCard(kFirstCardNumber);
-  FillAndSubmitFormWithCard(kFirstCardNumber);
-
-  // No bubble should be showing.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // No metrics are recorded when migration is not offered.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.LocalCardMigrationBubbleOffer.FirstShow", 0);
-}
-
-// Ensures that the intermediate migration bubble is not shown after reusing a
-// previously saved local card, if there are no other cards to migrate.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ReusingLocalCardDoesNotShowIntermediateMigrationOffer) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  FillAndSubmitFormWithCard(kFirstCardNumber);
-
-  // No migration bubble should be showing, because the single card upload
-  // bubble should be displayed instead.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // No metrics are recorded when migration is not offered.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.LocalCardMigrationBubbleOffer.FirstShow", 0);
-}
-
-// Ensures that the intermediate migration bubble is triggered after reusing a
-// saved local card, if there are multiple local cards available to migrate.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ReusingLocalCardShowsIntermediateMigrationOffer) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-
-  // The intermediate migration bubble should show.
-  EXPECT_TRUE(
-      FindViewInDialogById(DialogViewId::MAIN_CONTENT_VIEW_MIGRATION_BUBBLE,
-                           GetLocalCardMigrationOfferBubbleViews())
-          ->visible());
-  // Metrics
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationBubbleOffer.FirstShow"),
-      ElementsAre(
-          Bucket(AutofillMetrics::LOCAL_CARD_MIGRATION_BUBBLE_REQUESTED, 1),
-          Bucket(AutofillMetrics::LOCAL_CARD_MIGRATION_BUBBLE_SHOWN, 1)));
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationOrigin.UseOfLocalCard",
-      AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1);
-}
-
-// Ensures that clicking [X] on the offer bubble makes the bubble disappear.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ClickingCloseClosesBubble) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-  ClickOnDialogViewAndWait(GetCloseButton(),
-                           GetLocalCardMigrationOfferBubbleViews());
-
-  // No bubble should be showing.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // Metrics
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationOrigin.UseOfLocalCard",
-      AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1);
-}
-
-// Ensures that clicking on the credit card icon in the omnibox reopens the
-// offer bubble after closing it.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ClickingOmniboxIconReshowsBubble) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-  ClickOnDialogViewAndWait(GetCloseButton(),
-                           GetLocalCardMigrationOfferBubbleViews());
-  ClickOnView(GetLocalCardMigrationIconView());
-
-  // Clicking the icon should reshow the bubble.
-  EXPECT_TRUE(
-      FindViewInDialogById(DialogViewId::MAIN_CONTENT_VIEW_MIGRATION_BUBBLE,
-                           GetLocalCardMigrationOfferBubbleViews())
-          ->visible());
-  // Metrics
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationOrigin.UseOfLocalCard"),
-      ElementsAre(Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1)));
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationBubbleOffer.Reshows"),
-      ElementsAre(
-          Bucket(AutofillMetrics::LOCAL_CARD_MIGRATION_BUBBLE_REQUESTED, 1),
-          Bucket(AutofillMetrics::LOCAL_CARD_MIGRATION_BUBBLE_SHOWN, 1)));
-}
-
-// Ensures that accepting the intermediate migration offer opens up the main
-// migration dialog.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ClickingContinueOpensDialog) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-  // Click the [Continue] button.
-  ClickOnOkButton(GetLocalCardMigrationOfferBubbleViews());
-
-  // Dialog should be visible.
-  EXPECT_TRUE(FindViewInDialogById(
-                  DialogViewId::MAIN_CONTENT_VIEW_MIGRATION_OFFER_DIALOG,
-                  GetLocalCardMigrationMainDialogView())
-                  ->visible());
-  // Intermediate bubble should be gone.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationOfferBubbleViews());
-  // Metrics
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationOrigin.UseOfLocalCard"),
-      ElementsAre(Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1),
-                  Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_ACCEPTED, 1),
-                  Bucket(AutofillMetrics::MAIN_DIALOG_SHOWN, 1)));
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationBubbleUserInteraction.FirstShow",
-      AutofillMetrics::LOCAL_CARD_MIGRATION_BUBBLE_CLOSED_ACCEPTED, 1);
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationDialogOffer",
-      AutofillMetrics::LOCAL_CARD_MIGRATION_DIALOG_SHOWN, 1);
-}
-
-// Ensures that rejecting the main migration dialog closes the dialog.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ClickingCancelClosesDialog) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-  // Click the [Continue] button.
-  ClickOnOkButton(GetLocalCardMigrationOfferBubbleViews());
-  // Click the [Cancel] button.
-  ClickOnCancelButton(GetLocalCardMigrationMainDialogView());
-
-  // No dialog should be showing.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationMainDialogView());
-  // Metrics
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationOrigin.UseOfLocalCard"),
-      ElementsAre(Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1),
-                  Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_ACCEPTED, 1),
-                  Bucket(AutofillMetrics::MAIN_DIALOG_SHOWN, 1)));
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationDialogUserInteraction",
-      AutofillMetrics::LOCAL_CARD_MIGRATION_DIALOG_CLOSED_CANCEL_BUTTON_CLICKED,
-      1);
-}
-
-// Ensures that accepting the main migration dialog closes the dialog.
-IN_PROC_BROWSER_TEST_F(LocalCardMigrationBrowserTest,
-                       ClickingSaveClosesDialog) {
-  base::HistogramTester histogram_tester;
-
-  SaveLocalCard(kFirstCardNumber);
-  SaveLocalCard(kSecondCardNumber);
-  UseCardAndWaitForMigrationOffer(kFirstCardNumber);
-  // Click the [Continue] button in the bubble.
-  ClickOnOkButton(GetLocalCardMigrationOfferBubbleViews());
-  // Click the [Save] button in the dialog.
-  // TODO(crbug.com/897998): Add Payments Rpc setup and event waiter.
-  ClickOnOkButton(GetLocalCardMigrationMainDialogView());
-
-  // No dialog should be showing.
-  EXPECT_EQ(nullptr, GetLocalCardMigrationMainDialogView());
-  // Metrics
-  EXPECT_THAT(
-      histogram_tester.GetAllSamples(
-          "Autofill.LocalCardMigrationOrigin.UseOfLocalCard"),
-      ElementsAre(Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_SHOWN, 1),
-                  Bucket(AutofillMetrics::INTERMEDIATE_BUBBLE_ACCEPTED, 1),
-                  Bucket(AutofillMetrics::MAIN_DIALOG_SHOWN, 1),
-                  Bucket(AutofillMetrics::MAIN_DIALOG_ACCEPTED, 1)));
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.LocalCardMigrationDialogUserInteraction",
-      AutofillMetrics::LOCAL_CARD_MIGRATION_DIALOG_CLOSED_SAVE_BUTTON_CLICKED,
-      1);
-}
-
-// TODO(crbug.com/897998): Add these following tests.
-// 1) Reusing a server card shows the intermediate bubble.
-// 2) All valid cards are visible in the migration offer view.
-// 3) Local cards should get deleted after migration.
-// 4) Expired and invalid cards should not be shown.
-// 5) When user navigates away after five seconds, the bubble disappears.
-// 6) When user navigates away after five seconds, the dialog should stay.
-// 7) When user clicks legal message links, browser should show a pop-up window.
-// 8) Simulate checkboxes to ensure
-//    LocalCardMigrationDialogUserSelectionPercentage is logged correctly.
-// 9) Ensure LocalCardMigrationDialogActiveDuration is logged correctly.
-
-}  // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc
index 472062fe..b2cfc02 100644
--- a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc
+++ b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.cc
@@ -6,7 +6,6 @@
 
 #include <stddef.h>
 #include <memory>
-#include <utility>
 
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
@@ -30,7 +29,6 @@
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/layout/fill_layout.h"
 #include "ui/views/style/typography.h"
-#include "ui/views/window/dialog_client_view.h"
 
 namespace autofill {
 
@@ -156,7 +154,6 @@
   explanatory_message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
   explanatory_message->SetMultiLine(true);
   AddChildView(explanatory_message);
-  set_id(DialogViewId::MAIN_CONTENT_VIEW_MIGRATION_BUBBLE);
 }
 
 }  // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.h b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.h
index aa0f787..80b3503d 100644
--- a/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.h
+++ b/chrome/browser/ui/views/autofill/local_card_migration_bubble_views.h
@@ -47,8 +47,6 @@
   void WindowClosing() override;
 
  private:
-  friend class LocalCardMigrationBrowserTest;
-
   ~LocalCardMigrationBubbleViews() override;
 
   // views::BubbleDialogDelegateView:
diff --git a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc
index 3ce85b2..84b0331 100644
--- a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc
+++ b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.cc
@@ -4,10 +4,6 @@
 
 #include "chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h"
 
-#include <memory>
-#include <string>
-#include <vector>
-
 #include "base/i18n/message_formatter.h"
 #include "base/location.h"
 #include "base/macros.h"
@@ -315,8 +311,6 @@
   }
 
  private:
-  friend class LocalCardMigrationDialogView;
-
   LocalCardMigrationDialogController* controller_;
 
   views::View* card_list_view_ = nullptr;
@@ -473,8 +467,6 @@
 
   if (view_state == LocalCardMigrationDialogState::kOffered) {
     offer_view_ = new LocalCardMigrationOfferView(controller_, this);
-    offer_view_->set_id(DialogViewId::MAIN_CONTENT_VIEW_MIGRATION_OFFER_DIALOG);
-    card_list_view_ = offer_view_->card_list_view_;
     AddChildView(offer_view_);
   } else {
     AddChildView(CreateFeedbackContentView(controller_, this).release());
diff --git a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h
index 5f559cd..4b2759b 100644
--- a/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h
+++ b/chrome/browser/ui/views/autofill/local_card_migration_dialog_view.h
@@ -51,10 +51,7 @@
   void UpdateLayout();
 
  private:
-  friend class LocalCardMigrationBrowserTest;
-
   void ConstructView();
-
   base::string16 GetOkButtonLabel() const;
   base::string16 GetCancelButtonLabel() const;
 
@@ -66,10 +63,6 @@
   // dialog is not in the 'offer' state.
   LocalCardMigrationOfferView* offer_view_ = nullptr;
 
-  // The view containing a list of cards. It is the content of the scroll bar.
-  // Owned by the LocalCardMigrationOfferView.
-  views::View* card_list_view_;
-
   DISALLOW_COPY_AND_ASSIGN(LocalCardMigrationDialogView);
 };
 
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 6c58db7..0f3c4b6 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -993,7 +993,7 @@
 
 bool BookmarkBarView::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   if (!model_ || !model_->loaded())
     return false;
   *formats = ui::OSExchangeData::URL;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
index 46cc2eba..0b4d1377 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -164,9 +164,8 @@
   void ViewHierarchyChanged(
       const ViewHierarchyChangedDetails& details) override;
   void PaintChildren(const views::PaintInfo& paint_info) override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const ui::OSExchangeData& data) override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
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 a19f91c7..66d30a452 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -47,7 +47,7 @@
 #include "ui/aura/env_observer.h"
 #include "ui/aura/window.h"
 #include "ui/base/clipboard/clipboard.h"
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/base/test/ui_controls.h"
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/views/background.h"
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
index 9ea2ca97..b926a57 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
@@ -99,7 +99,7 @@
 bool BookmarkMenuController::GetDropFormats(
     MenuItemView* menu,
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   return menu_delegate_->GetDropFormats(menu, formats, format_types);
 }
 
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
index 701d547..1caaa0e6 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
@@ -85,10 +85,9 @@
   void ExecuteCommand(int id, int mouse_event_flags) override;
   bool ShouldExecuteCommandWithoutClosingMenu(int id,
                                               const ui::Event& e) override;
-  bool GetDropFormats(
-      views::MenuItemView* menu,
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(views::MenuItemView* menu,
+                      int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired(views::MenuItemView* menu) override;
   bool CanDrop(views::MenuItemView* menu,
                const ui::OSExchangeData& data) override;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 34550f9..a8496f1 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -199,7 +199,7 @@
 bool BookmarkMenuDelegate::GetDropFormats(
     MenuItemView* menu,
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   *formats = ui::OSExchangeData::URL;
   format_types->insert(BookmarkNodeData::GetBookmarkFormatType());
   return true;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
index e31ee2ce..c9104df 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
@@ -109,10 +109,9 @@
                           const ui::Event& e);
   void ExecuteCommand(int id, int mouse_event_flags);
   bool ShouldExecuteCommandWithoutClosingMenu(int id, const ui::Event& e);
-  bool GetDropFormats(
-      views::MenuItemView* menu,
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types);
+  bool GetDropFormats(views::MenuItemView* menu,
+                      int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types);
   bool AreDropTypesRequired(views::MenuItemView* menu);
   bool CanDrop(views::MenuItemView* menu, const ui::OSExchangeData& data);
   int GetDropOperation(views::MenuItemView* item,
diff --git a/chrome/browser/ui/views/chrome_typography_provider.cc b/chrome/browser/ui/views/chrome_typography_provider.cc
index 5034ac4..53c6a83 100644
--- a/chrome/browser/ui/views/chrome_typography_provider.cc
+++ b/chrome/browser/ui/views/chrome_typography_provider.cc
@@ -244,9 +244,11 @@
       return native_theme->SystemDarkModeEnabled() ? gfx::kGoogleGrey500
                                                    : gfx::kGoogleGrey700;
     case STYLE_RED:
-      return gfx::kGoogleRed700;
+      return native_theme->SystemDarkModeEnabled() ? gfx::kGoogleRed300
+                                                   : gfx::kGoogleRed700;
     case STYLE_GREEN:
-      return gfx::kGoogleGreen700;
+      return native_theme->SystemDarkModeEnabled() ? gfx::kGoogleGreen300
+                                                   : gfx::kGoogleGreen700;
   }
 
   // Use default primary color for everything else.
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
index 82c5470d..32ff6599 100644
--- a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
+++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
@@ -30,7 +30,7 @@
 }
 
 bool BrowserActionDragData::GetDropFormats(
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   format_types->insert(GetBrowserActionFormatType());
   return true;
 }
@@ -73,10 +73,10 @@
 }
 
 // static
-const ui::Clipboard::FormatType&
+const ui::ClipboardFormatType&
 BrowserActionDragData::GetBrowserActionFormatType() {
-  static base::NoDestructor<ui::Clipboard::FormatType> format(
-      ui::Clipboard::GetFormatType(kClipboardFormatString));
+  static base::NoDestructor<ui::ClipboardFormatType> format(
+      ui::ClipboardFormatType::GetType(kClipboardFormatString));
 
   return *format;
 }
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.h b/chrome/browser/ui/views/extensions/browser_action_drag_data.h
index 51851aa6..f40a9fd 100644
--- a/chrome/browser/ui/views/extensions/browser_action_drag_data.h
+++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.h
@@ -29,7 +29,7 @@
   // These mirror the views::View and views::MenuDelegate methods for dropping,
   // and return the appropriate results for being able to drop an extension's
   // BrowserAction view.
-  static bool GetDropFormats(std::set<ui::Clipboard::FormatType>* format_types);
+  static bool GetDropFormats(std::set<ui::ClipboardFormatType>* format_types);
   static bool AreDropTypesRequired();
   static bool CanDrop(const ui::OSExchangeData& data, const Profile* profile);
 
@@ -46,8 +46,8 @@
   // Restores this data from the clipboard, returning true on success.
   bool Read(const ui::OSExchangeData& data);
 
-  // Returns the FormatType this class supports (for Browser Actions).
-  static const ui::Clipboard::FormatType& GetBrowserActionFormatType();
+  // Returns the ClipboardFormatType this class supports (for Browser Actions).
+  static const ui::ClipboardFormatType& GetBrowserActionFormatType();
 #endif
 
  private:
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
index 8066389..1edc3db1 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc
@@ -366,33 +366,6 @@
       ash::kBlockedForAssistantSnapshotKey));
 }
 
-// Tests that FrameCaptionButtonContainer has been relaid out in response to
-// tablet mode being toggled.
-IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest,
-                       ToggleTabletModeRelayout) {
-  BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
-  BrowserNonClientFrameViewAsh* frame_view = GetFrameViewAsh(browser_view);
-
-  const gfx::Rect initial = frame_view->caption_button_container_->bounds();
-  ASSERT_NO_FATAL_FAILURE(test::SetAndWaitForTabletMode(true));
-  ash::FrameCaptionButtonContainerView::TestApi test(
-      frame_view->caption_button_container_);
-  test.EndAnimations();
-  const gfx::Rect during_maximize =
-      frame_view->caption_button_container_->bounds();
-  EXPECT_GT(initial.width(), during_maximize.width());
-  ASSERT_NO_FATAL_FAILURE(test::SetAndWaitForTabletMode(false));
-  test.EndAnimations();
-  const gfx::Rect after_restore =
-      frame_view->caption_button_container_->bounds();
-  EXPECT_EQ(initial.origin(), after_restore.origin());
-  EXPECT_EQ(initial.width(), after_restore.width());
-
-  // Switching from non-tablet to tablet mode will increase the height of the
-  // top frame and toolbar if the MD mode is set to "Dynamic Refresh".
-  EXPECT_GE(initial.height(), after_restore.height());
-}
-
 // Tests that browser frame minimum size constraint is updated in response to
 // browser view layout.
 IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest,
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 8b08e61..ebf8531 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -113,7 +113,7 @@
 
 bool BrowserRootView::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   if (tabstrip()->visible() || toolbar()->visible()) {
     *formats = ui::OSExchangeData::URL | ui::OSExchangeData::STRING;
     return true;
diff --git a/chrome/browser/ui/views/frame/browser_root_view.h b/chrome/browser/ui/views/frame/browser_root_view.h
index 8b5da77..4684632 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.h
+++ b/chrome/browser/ui/views/frame/browser_root_view.h
@@ -58,9 +58,8 @@
   ~BrowserRootView() override;
 
   // views::View:
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const ui::OSExchangeData& data) override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
index 368ee50..1ce55ab 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
@@ -53,24 +53,18 @@
   LocatedEventRetargeter() {}
   ~LocatedEventRetargeter() override {}
 
-  ui::EventRewriteStatus RewriteEvent(
+  ui::EventDispatchDetails RewriteEvent(
       const ui::Event& event,
-      std::unique_ptr<ui::Event>* rewritten_event) override {
+      const base::WeakPtr<Continuation> continuation) override {
     if (!event.IsLocatedEvent())
-      return ui::EVENT_REWRITE_CONTINUE;
+      return SendEvent(continuation, &event);
 
-    *rewritten_event = ui::Event::Clone(event);
+    std::unique_ptr<ui::Event> replacement_event = ui::Event::Clone(event);
     // Cloning strips the EventTarget. The only goal of this EventRewriter is to
     // null the target, so there's no need to do anything extra here.
-    DCHECK(!(*rewritten_event)->target());
+    DCHECK(!replacement_event->target());
 
-    return ui::EVENT_REWRITE_REWRITTEN;
-  }
-
-  ui::EventRewriteStatus NextDispatchEvent(
-      const ui::Event& last_event,
-      std::unique_ptr<ui::Event>* new_event) override {
-    return ui::EVENT_REWRITE_CONTINUE;
+    return SendEventFinally(continuation, replacement_event.get());
   }
 
  private:
@@ -118,7 +112,7 @@
 void ImmersiveModeControllerAsh::Init(BrowserView* browser_view) {
   browser_view_ = browser_view;
   controller_->Init(this, browser_view_->frame(),
-      browser_view_->top_container());
+                    browser_view_->top_container());
 
   observed_windows_.Add(
       !features::IsUsingWindowService()
@@ -273,15 +267,15 @@
   browser_view_->frame()->GetFrameView()->UpdateClientArea();
 }
 
-std::vector<gfx::Rect>
-ImmersiveModeControllerAsh::GetVisibleBoundsInScreen() const {
+std::vector<gfx::Rect> ImmersiveModeControllerAsh::GetVisibleBoundsInScreen()
+    const {
   views::View* top_container_view = browser_view_->top_container();
   gfx::Rect top_container_view_bounds = top_container_view->GetVisibleBounds();
   // TODO(tdanderson): Implement View::ConvertRectToScreen().
   gfx::Point top_container_view_bounds_in_screen_origin(
       top_container_view_bounds.origin());
-  views::View::ConvertPointToScreen(top_container_view,
-      &top_container_view_bounds_in_screen_origin);
+  views::View::ConvertPointToScreen(
+      top_container_view, &top_container_view_bounds_in_screen_origin);
   gfx::Rect top_container_view_bounds_in_screen(
       top_container_view_bounds_in_screen_origin,
       top_container_view_bounds.size());
@@ -301,8 +295,8 @@
     return;
 
   // Auto hide the shelf in immersive browser fullscreen.
-  bool in_tab_fullscreen = content::Source<FullscreenController>(source)->
-      IsWindowFullscreenForTabOrPending();
+  bool in_tab_fullscreen = content::Source<FullscreenController>(source)
+                               ->IsWindowFullscreenForTabOrPending();
   browser_view_->GetNativeWindow()->SetProperty(
       ash::kHideShelfWhenFullscreenKey, in_tab_fullscreen);
 }
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
index 406b2c4..acda0da0 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
@@ -286,7 +286,7 @@
   test::SetAndWaitForTabletMode(true);
   frame_test_api.EndAnimations();
 
-  EXPECT_FALSE(frame_test_api.size_button()->visible());
+  EXPECT_TRUE(frame_test_api.size_button()->visible());
 
   VerifyButtonsInImmersiveMode(frame_view);
 
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 78532a0..0e651a2 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -79,6 +79,7 @@
 #include "extensions/common/feature_switch.h"
 #include "third_party/metrics_proto/omnibox_event.pb.h"
 #include "ui/accessibility/ax_node_data.h"
+#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/dragdrop/drag_drop_types.h"
 #include "ui/base/ime/input_method.h"
 #include "ui/base/ime/input_method_keyboard_controller.h"
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc
index 3543b30..30caa57a 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -19,6 +19,7 @@
 #include "content/public/common/url_constants.h"
 #include "extensions/common/constants.h"
 #include "ui/accessibility/ax_node_data.h"
+#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/views/controls/label.h"
 
diff --git a/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc b/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc
index 3a1947b5..13f3887 100644
--- a/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc
+++ b/chrome/browser/ui/views/menu_view_drag_and_drop_test.cc
@@ -64,9 +64,8 @@
 
  private:
   // views::View:
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const OSExchangeData& data) override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
@@ -105,7 +104,7 @@
 
 bool TestTargetView::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   *formats = ui::OSExchangeData::STRING;
   return true;
 }
@@ -155,10 +154,9 @@
   void BuildMenu(views::MenuItemView* menu) override;
 
   // views::MenuDelegate:
-  bool GetDropFormats(
-      views::MenuItemView* menu,
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(views::MenuItemView* menu,
+                      int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired(views::MenuItemView* menu) override;
   bool CanDrop(views::MenuItemView* menu,
                const ui::OSExchangeData& data) override;
@@ -213,7 +211,7 @@
 bool MenuViewDragAndDropTest::GetDropFormats(
     views::MenuItemView* menu,
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   *formats = ui::OSExchangeData::STRING;
   return true;
 }
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 0bd826ba..4cbdf61a 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -1639,7 +1639,7 @@
 
 void OmniboxViewViews::AppendDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   *formats = *formats | ui::OSExchangeData::URL;
 }
 
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.h b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
index b84027be..84feecc 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
@@ -264,7 +264,7 @@
   void OnGetDragOperationsForTextfield(int* drag_operations) override;
   void AppendDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+      std::set<ui::ClipboardFormatType>* format_types) override;
   int OnDrop(const ui::OSExchangeData& data) override;
   void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) override;
 
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
index 7e8706f..4dd17cf 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
@@ -600,16 +600,16 @@
 
   // Make sure both HTML and Plain Text formats are available.
   EXPECT_TRUE(clipboard->IsFormatAvailable(
-      ui::Clipboard::GetPlainTextFormatType(), clipboard_type));
-  EXPECT_TRUE(clipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(),
-                                           clipboard_type));
+      ui::ClipboardFormatType::GetPlainTextType(), clipboard_type));
+  EXPECT_TRUE(clipboard->IsFormatAvailable(
+      ui::ClipboardFormatType::GetHtmlType(), clipboard_type));
 
   // Windows clipboard only supports text URLs.
   // Mac clipboard not reporting URL format available for some reason.
   // crbug.com/751031
 #if defined(OS_LINUX)
-  EXPECT_TRUE(clipboard->IsFormatAvailable(ui::Clipboard::GetUrlFormatType(),
-                                           clipboard_type));
+  EXPECT_TRUE(clipboard->IsFormatAvailable(
+      ui::ClipboardFormatType::GetUrlType(), clipboard_type));
 #endif
 
   std::string read_from_clipboard;
@@ -635,9 +635,9 @@
   // Make sure HTML format isn't written. See
   // BookmarkNodeData::WriteToClipboard() for details.
   EXPECT_TRUE(clipboard->IsFormatAvailable(
-      ui::Clipboard::GetPlainTextFormatType(), clipboard_type));
-  EXPECT_FALSE(clipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(),
-                                            clipboard_type));
+      ui::ClipboardFormatType::GetPlainTextType(), clipboard_type));
+  EXPECT_FALSE(clipboard->IsFormatAvailable(
+      ui::ClipboardFormatType::GetHtmlType(), clipboard_type));
 
   std::string read_from_clipboard;
   clipboard->ReadAsciiText(clipboard_type, &read_from_clipboard);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 7cbf9bc7..85e5d1d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -48,6 +48,7 @@
 #include "third_party/skia/include/effects/SkLayerDrawLooper.h"
 #include "third_party/skia/include/pathops/SkPathOps.h"
 #include "ui/accessibility/ax_node_data.h"
+#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/default_theme_provider.h"
 #include "ui/base/dragdrop/drag_drop_types.h"
 #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index d09ca46..5d2469cb4 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -887,10 +887,9 @@
       MenuDelegate::IsTriggerableEvent(menu, e);
 }
 
-bool AppMenu::GetDropFormats(
-    MenuItemView* menu,
-    int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+bool AppMenu::GetDropFormats(MenuItemView* menu,
+                             int* formats,
+                             std::set<ui::ClipboardFormatType>* format_types) {
   CreateBookmarkMenu();
   return bookmark_menu_delegate_.get() &&
       bookmark_menu_delegate_->GetDropFormats(menu, formats, format_types);
diff --git a/chrome/browser/ui/views/toolbar/app_menu.h b/chrome/browser/ui/views/toolbar/app_menu.h
index fa6e655..919625b 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.h
+++ b/chrome/browser/ui/views/toolbar/app_menu.h
@@ -71,10 +71,9 @@
                                 const gfx::Point& p) const override;
   bool IsTriggerableEvent(views::MenuItemView* menu,
                           const ui::Event& e) override;
-  bool GetDropFormats(
-      views::MenuItemView* menu,
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(views::MenuItemView* menu,
+                      int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired(views::MenuItemView* menu) override;
   bool CanDrop(views::MenuItemView* menu,
                const ui::OSExchangeData& data) override;
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
index a3edc97..854e37d2 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -488,7 +488,7 @@
 
 bool BrowserActionsContainer::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   return BrowserActionDragData::GetDropFormats(format_types);
 }
 
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.h b/chrome/browser/ui/views/toolbar/browser_actions_container.h
index b109d1a3..dbecdff 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.h
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.h
@@ -192,9 +192,8 @@
   int GetHeightForWidth(int width) const override;
   gfx::Size GetMinimumSize() const override;
   void Layout() override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const ui::OSExchangeData& data) override;
   int OnDragUpdated(const ui::DropTargetEvent& event) override;
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
index 41fc42e..946ad533 100644
--- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
+++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
@@ -238,7 +238,7 @@
 
 bool BrowserAppMenuButton::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   return BrowserActionDragData::GetDropFormats(format_types);
 }
 
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.h b/chrome/browser/ui/views/toolbar/browser_app_menu_button.h
index c197ec95..dbfba54 100644
--- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.h
+++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.h
@@ -66,9 +66,8 @@
 
   // AppMenuButton:
   const char* GetClassName() const override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const ui::OSExchangeData& data) override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
diff --git a/chrome/browser/ui/views/toolbar/home_button.cc b/chrome/browser/ui/views/toolbar/home_button.cc
index ed74f9c..3f1307a7 100644
--- a/chrome/browser/ui/views/toolbar/home_button.cc
+++ b/chrome/browser/ui/views/toolbar/home_button.cc
@@ -159,7 +159,7 @@
 
 bool HomeButton::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   *formats = ui::OSExchangeData::URL;
   return true;
 }
diff --git a/chrome/browser/ui/views/toolbar/home_button.h b/chrome/browser/ui/views/toolbar/home_button.h
index 3c6bcee7..fa9d68f 100644
--- a/chrome/browser/ui/views/toolbar/home_button.h
+++ b/chrome/browser/ui/views/toolbar/home_button.h
@@ -19,9 +19,8 @@
  private:
   // ToolbarButton:
   const char* GetClassName() const override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool CanDrop(const OSExchangeData& data) override;
   int OnDragUpdated(const ui::DropTargetEvent& event) override;
   int OnPerformDrop(const ui::DropTargetEvent& event) override;
diff --git a/chrome/browser/ui/webui/browsing_history_handler.cc b/chrome/browser/ui/webui/browsing_history_handler.cc
index ac41a913..85386327 100644
--- a/chrome/browser/ui/webui/browsing_history_handler.cc
+++ b/chrome/browser/ui/webui/browsing_history_handler.cc
@@ -70,18 +70,17 @@
 
 // Gets the name and type of a device for the given sync client ID.
 // |name| and |type| are out parameters.
-void GetDeviceNameAndType(syncer::DeviceInfoSyncService* service,
+void GetDeviceNameAndType(const syncer::DeviceInfoTracker* tracker,
                           const std::string& client_id,
                           std::string* name,
                           std::string* type) {
   // DeviceInfoTracker must be syncing in order for remote history entries to
   // be available.
-  DCHECK(service);
-  DCHECK(service->GetDeviceInfoTracker());
-  DCHECK(service->GetDeviceInfoTracker()->IsSyncing());
+  DCHECK(tracker);
+  DCHECK(tracker->IsSyncing());
 
   std::unique_ptr<syncer::DeviceInfo> device_info =
-      service->GetDeviceInfoTracker()->GetDeviceInfo(client_id);
+      tracker->GetDeviceInfo(client_id);
   if (device_info.get()) {
     *name = device_info->client_name();
     switch (device_info->device_type()) {
@@ -138,7 +137,7 @@
     const BrowsingHistoryService::HistoryEntry& entry,
     BookmarkModel* bookmark_model,
     SupervisedUserService* supervised_user_service,
-    syncer::DeviceInfoSyncService* service,
+    const syncer::DeviceInfoTracker* tracker,
     base::Clock* clock) {
   std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
   SetHistoryEntryUrlAndTitle(entry, result.get());
@@ -202,7 +201,7 @@
   std::string device_name;
   std::string device_type;
   if (!entry.client_id.empty())
-    GetDeviceNameAndType(service, entry.client_id, &device_name, &device_type);
+    GetDeviceNameAndType(tracker, entry.client_id, &device_name, &device_type);
   result->SetString("deviceName", device_name);
   result->SetString("deviceType", device_type);
 
@@ -363,14 +362,17 @@
     supervised_user_service =
         SupervisedUserServiceFactory::GetForProfile(profile);
 #endif
-  syncer::DeviceInfoSyncService* service =
-      DeviceInfoSyncServiceFactory::GetForProfile(profile);
+
+  const syncer::DeviceInfoTracker* tracker =
+      DeviceInfoSyncServiceFactory::GetForProfile(profile)
+          ->GetDeviceInfoTracker();
 
   // Convert the result vector into a ListValue.
+  DCHECK(tracker);
   base::ListValue results_value;
   for (const BrowsingHistoryService::HistoryEntry& entry : results) {
     std::unique_ptr<base::Value> value(HistoryEntryToValue(
-        entry, bookmark_model, supervised_user_service, service, clock_));
+        entry, bookmark_model, supervised_user_service, tracker, clock_));
     results_value.Append(std::move(value));
   }
 
diff --git a/chrome/browser/ui/webui/management_ui_handler.cc b/chrome/browser/ui/webui/management_ui_handler.cc
index d52ad27..5c08bdc7 100644
--- a/chrome/browser/ui/webui/management_ui_handler.cc
+++ b/chrome/browser/ui/webui/management_ui_handler.cc
@@ -17,9 +17,14 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/profiles/profile_util.h"
+#include "chrome/browser/policy/profile_policy_connector_factory.h"
 #include "chrome/browser/profiles/profile.h"
+
 #include "components/strings/grit/components_strings.h"
 #include "content/public/browser/web_contents.h"
+#include "extensions/buildflags/buildflags.h"
+#include "google_apis/gaia/gaia_auth_util.h"
 #include "ui/base/l10n/l10n_util.h"
 
 #if defined(OS_CHROMEOS)
@@ -31,6 +36,9 @@
 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
 #include "chrome/browser/chromeos/policy/status_uploader.h"
 #include "chrome/browser/chromeos/policy/system_log_uploader.h"
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/grit/chromium_strings.h"
+#include "components/user_manager/user_manager.h"
 #endif  // defined(OS_CHROMEOS)
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -76,43 +84,20 @@
 
 namespace {
 
-#if defined(OS_CHROMEOS)
-
-base::string16 GetTitleWithEnterpriseDomain(
-    policy::BrowserPolicyConnectorChromeOS* connector) {
-  if (!connector->IsEnterpriseManaged()) {
-    return l10n_util::GetStringUTF16(IDS_MANAGEMENT_TITLE);
-  }
-  std::string display_domain = connector->GetEnterpriseDisplayDomain();
-
-  if (display_domain.empty()) {
-    if (!connector->IsActiveDirectoryManaged())
-      return l10n_util::GetStringUTF16(IDS_MANAGEMENT_TITLE);
-
-    display_domain = connector->GetRealm();
-  }
-
-  return l10n_util::GetStringFUTF16(IDS_MANAGEMENT_TITLE_BY,
-                                    base::UTF8ToUTF16(display_domain));
+bool IsProfileManaged(Profile* profile) {
+  return policy::ProfilePolicyConnectorFactory::IsProfileManaged(profile);
 }
 
-base::string16 GetEnterpriseDisplayDomain(
-    policy::BrowserPolicyConnectorChromeOS* connector) {
-  if (!connector->IsEnterpriseManaged()) {
-    return l10n_util::GetStringUTF16(IDS_MANAGEMENT_DEVICE_NOT_MANAGED);
-  }
+std::string GetAccountDomain(Profile* profile) {
+  return gaia::ExtractDomainName(profile->GetProfileUserName());
+}
 
-  std::string display_domain = connector->GetEnterpriseDisplayDomain();
+#if defined(OS_CHROMEOS)
 
-  if (display_domain.empty()) {
-    if (!connector->IsActiveDirectoryManaged())
-      return l10n_util::GetStringUTF16(IDS_MANAGEMENT_DEVICE_MANAGED);
-
-    display_domain = connector->GetRealm();
-  }
-
-  return l10n_util::GetStringFUTF16(IDS_MANAGEMENT_DEVICE_MANAGED_BY,
-                                    base::UTF8ToUTF16(display_domain));
+base::string16 GetManagementPageTitle() {
+  return l10n_util::GetStringFUTF16(
+      IDS_MANAGEMENT_TITLE,
+      l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME));
 }
 
 void AddChromeOSReportingDevice(base::Value* report_sources) {
@@ -345,18 +330,84 @@
                           base::Unretained(this)));
 }
 
+base::string16 ManagementUIHandler::GetEnterpriseManagementStatusString() {
+  auto* profile = Profile::FromWebUI(web_ui());
+  const bool account_managed = IsProfileManaged(profile);
+  const std::string account_domain = GetAccountDomain(profile);
+  bool profile_associated_with_gaia_account = true;
+#if defined(OS_CHROMEOS)
+  profile_associated_with_gaia_account =
+      chromeos::IsProfileAssociatedWithGaiaAccount(profile);
+#endif  // defined(OS_CHROMEOS)
+
+  bool device_managed = false;
+  std::string device_domain;
+#if defined(OS_CHROMEOS)
+  policy::BrowserPolicyConnectorChromeOS* connector =
+      g_browser_process->platform_part()->browser_policy_connector_chromeos();
+  device_managed = connector->IsEnterpriseManaged();
+  if (device_managed)
+    device_domain = connector->GetEnterpriseDisplayDomain();
+  if (device_domain.empty() && connector->IsActiveDirectoryManaged())
+    device_domain = connector->GetRealm();
+#endif  // defined(OS_CHROMEOS)
+
+  bool primary_user_managed = false;
+  std::string primary_user_account_domain;
+#if defined(OS_CHROMEOS)
+  auto* primary_user = user_manager::UserManager::Get()->GetPrimaryUser();
+  if (primary_user) {
+    auto* primary_profile =
+        chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user);
+    if (primary_profile) {
+      primary_user_managed = IsProfileManaged(primary_profile);
+      primary_user_account_domain = GetAccountDomain(primary_profile);
+    }
+  }
+#endif  // defined(OS_CHROMEOS)
+
+  if (device_managed) {
+    DCHECK(!device_domain.empty());
+    if (account_managed) {
+      if (device_domain == account_domain ||
+          !profile_associated_with_gaia_account) {
+        return l10n_util::GetStringFUTF16(
+            IDS_MANAGEMENT_DEVICE_AND_ACCOUNT_MANAGED_BY,
+            base::UTF8ToUTF16(device_domain));
+      }
+      DCHECK(!account_domain.empty());
+      return l10n_util::GetStringFUTF16(
+          IDS_MANAGEMENT_DEVICE_MANAGED_BY_ACCOUNT_MANAGED_BY,
+          base::UTF8ToUTF16(device_domain), base::UTF8ToUTF16(account_domain));
+    }
+    return l10n_util::GetStringFUTF16(IDS_MANAGEMENT_DEVICE_MANAGED_BY,
+                                      base::UTF8ToUTF16(device_domain));
+  }
+
+  if (account_managed) {
+    return l10n_util::GetStringFUTF16(IDS_MANAGEMENT_ACCOUNT_MANAGED_BY,
+                                      base::UTF8ToUTF16(account_domain));
+  }
+
+  if (primary_user_managed) {
+    return l10n_util::GetStringFUTF16(
+        IDS_MANAGEMENT_ACCOUNT_MANAGED_BY,
+        base::UTF8ToUTF16(primary_user_account_domain));
+  }
+
+  return l10n_util::GetStringUTF16(IDS_MANAGEMENT_DEVICE_NOT_MANAGED);
+}
+
 void ManagementUIHandler::HandleGetManagementTitle(
     const base::ListValue* args) {
   AllowJavascript();
 #if defined(OS_CHROMEOS)
-  policy::BrowserPolicyConnectorChromeOS* connector =
-      g_browser_process->platform_part()->browser_policy_connector_chromeos();
-
-  base::Value title(GetTitleWithEnterpriseDomain(connector));
+  base::Value title(GetManagementPageTitle());
   ResolveJavascriptCallback(args->GetList()[0] /* callback_id */, title);
 #else
-  RejectJavascriptCallback(args->GetList()[0] /* callback_id */,
-                           base::Value("Management overview"));
+  RejectJavascriptCallback(
+      args->GetList()[0] /* callback_id */,
+      base::Value("No device management title on Chrome desktop"));
 #endif  // defined(OS_CHROMEOS)
 }
 
@@ -364,19 +415,9 @@
     const base::ListValue* args) {
   base::RecordAction(base::UserMetricsAction("ManagementPageViewed"));
   AllowJavascript();
-
-#if defined(OS_CHROMEOS)
-  policy::BrowserPolicyConnectorChromeOS* connector =
-      g_browser_process->platform_part()->browser_policy_connector_chromeos();
-
-  base::Value managed_string(GetEnterpriseDisplayDomain(connector));
+  base::Value managed_string(GetEnterpriseManagementStatusString());
   ResolveJavascriptCallback(args->GetList()[0] /* callback_id */,
                             managed_string);
-#else
-  RejectJavascriptCallback(
-      args->GetList()[0] /* callback_id */,
-      base::Value("No device management status on Chrome desktop"));
-#endif  // defined(OS_CHROMEOS)
 }
 
 void ManagementUIHandler::HandleGetReportingDevice(
diff --git a/chrome/browser/ui/webui/management_ui_handler.h b/chrome/browser/ui/webui/management_ui_handler.h
index 0f70364..d7040dd2 100644
--- a/chrome/browser/ui/webui/management_ui_handler.h
+++ b/chrome/browser/ui/webui/management_ui_handler.h
@@ -70,6 +70,8 @@
   void AddExtensionReportingInfo(base::Value* report_sources);
 #endif  // BUILDFLAG(ENABLE_EXTENSIONS)
 
+  base::string16 GetEnterpriseManagementStatusString();
+
   DISALLOW_COPY_AND_ASSIGN(ManagementUIHandler);
 };
 
diff --git a/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc b/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
index 6674ed4..4765346b 100644
--- a/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
@@ -258,7 +258,7 @@
       printer_lister_ ? printer_lister_->GetDeviceDescription(name) : nullptr;
 
   if (!device_description) {
-    callback.Run(nullptr);
+    std::move(callback).Run(nullptr);
     return;
   }
 
@@ -266,7 +266,8 @@
       cloud_print::PrivetHTTPAsynchronousFactory::CreateInstance(
           profile_->GetURLLoaderFactory());
   privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP(name);
-  privet_http_resolution_->Start(device_description->address, callback);
+  privet_http_resolution_->Start(device_description->address,
+                                 std::move(callback));
 }
 
 }  // namespace printing
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index b9bb18a7..6e713e6 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -438,8 +438,6 @@
      IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES},
     {kManagementReportUsers, IDS_MANAGEMENT_REPORT_DEVICE_USERS},
     {"managementLocalTrustRoots", IDS_MANAGEMENT_LOCAL_TRUST_ROOTS},
-    {"managementTrustRootsNotConfigured",
-     IDS_MANAGEMENT_TRUST_ROOTS_NOT_CONFIGURED},
     {"managementTrustRootsConfigured", IDS_MANAGEMENT_TRUST_ROOTS_CONFIGURED}
 #endif  // defined(OS_CHROMEOS)
   };
diff --git a/chrome/browser/web_applications/bookmark_apps/external_web_apps_unittest.cc b/chrome/browser/web_applications/bookmark_apps/external_web_apps_unittest.cc
index 4ba47cfe..b51883e 100644
--- a/chrome/browser/web_applications/bookmark_apps/external_web_apps_unittest.cc
+++ b/chrome/browser/web_applications/bookmark_apps/external_web_apps_unittest.cc
@@ -51,7 +51,7 @@
 // Returns the chrome/test/data/web_app_default_apps/sub_dir directory that
 // holds the *.json data files from which ScanDirForExternalWebAppsForTesting
 // should extract URLs from.
-static base::FilePath test_dir(const char* sub_dir) {
+static base::FilePath test_dir(const std::string& sub_dir) {
   base::FilePath dir;
   if (!base::PathService::Get(chrome::DIR_TEST_DATA, &dir)) {
     ADD_FAILURE()
@@ -64,15 +64,12 @@
 
 }  // namespace
 
-class ScanDirForExternalWebAppsTest : public testing::Test {};
-
-class ScanDirForExternalWebAppsWithProfileTest
-    : public ScanDirForExternalWebAppsTest {
+class ScanDirForExternalWebAppsTest : public testing::Test {
  public:
-  ScanDirForExternalWebAppsWithProfileTest() = default;
-  ~ScanDirForExternalWebAppsWithProfileTest() override = default;
+  ScanDirForExternalWebAppsTest() = default;
+  ~ScanDirForExternalWebAppsTest() override = default;
 
-  // ScanDirForExternalWebAppsTest:
+  // testing::Test:
   void SetUp() override {
     testing::Test::SetUp();
 #if defined(OS_CHROMEOS)
@@ -110,6 +107,12 @@
     return result;
   }
 
+  std::vector<web_app::PendingAppManager::AppInfo>
+  ScanTestDirForExternalWebApps(const std::string& dir) {
+    return web_app::ScanDirForExternalWebAppsForTesting(test_dir(dir),
+                                                        CreateProfile().get());
+  }
+
   // Helper that creates simple test profile.
   std::unique_ptr<TestingProfile> CreateProfile() {
     TestingProfile::Builder profile_builder;
@@ -166,21 +169,11 @@
   // To support context of browser threads.
   content::TestBrowserThreadBundle thread_bundle_;
 
-  DISALLOW_COPY_AND_ASSIGN(ScanDirForExternalWebAppsWithProfileTest);
-};
-
-class ScanDirForExternalWebAppsNonPrimaryProfileTest
-    : public ScanDirForExternalWebAppsTest {
-  ScanDirForExternalWebAppsNonPrimaryProfileTest() = default;
-  ~ScanDirForExternalWebAppsNonPrimaryProfileTest() override = default;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ScanDirForExternalWebAppsNonPrimaryProfileTest);
+  DISALLOW_COPY_AND_ASSIGN(ScanDirForExternalWebAppsTest);
 };
 
 TEST_F(ScanDirForExternalWebAppsTest, GoodJson) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir(kGoodJsonTestDir));
+  const auto app_infos = ScanTestDirForExternalWebApps(kGoodJsonTestDir);
 
   // The good_json directory contains two good JSON files:
   // chrome_platform_status.json and google_io_2016.json.
@@ -213,16 +206,14 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, BadJson) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("bad_json"));
+  const auto app_infos = ScanTestDirForExternalWebApps("bad_json");
 
   // The bad_json directory contains one (malformed) JSON file.
   EXPECT_EQ(0u, app_infos.size());
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, TxtButNoJson) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("txt_but_no_json"));
+  const auto app_infos = ScanTestDirForExternalWebApps("txt_but_no_json");
 
   // The txt_but_no_json directory contains one file, and the contents of that
   // file is valid JSON, but that file's name does not end with ".json".
@@ -230,8 +221,7 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, MixedJson) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("mixed_json"));
+  const auto app_infos = ScanTestDirForExternalWebApps("mixed_json");
 
   // The mixed_json directory contains one empty JSON file, one malformed JSON
   // file and one good JSON file. ScanDirForExternalWebAppsForTesting should
@@ -244,8 +234,7 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, MissingAppUrl) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("missing_app_url"));
+  const auto app_infos = ScanTestDirForExternalWebApps("missing_app_url");
 
   // The missing_app_url directory contains one JSON file which is correct
   // except for a missing "app_url" field.
@@ -253,8 +242,7 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, EmptyAppUrl) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("empty_app_url"));
+  const auto app_infos = ScanTestDirForExternalWebApps("empty_app_url");
 
   // The empty_app_url directory contains one JSON file which is correct
   // except for an empty "app_url" field.
@@ -262,8 +250,7 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, InvalidAppUrl) {
-  const auto app_infos =
-      web_app::ScanDirForExternalWebAppsForTesting(test_dir("invalid_app_url"));
+  const auto app_infos = ScanTestDirForExternalWebApps("invalid_app_url");
 
   // The invalid_app_url directory contains one JSON file which is correct
   // except for an invalid "app_url" field.
@@ -271,8 +258,8 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, InvalidCreateShortcuts) {
-  const auto app_infos = web_app::ScanDirForExternalWebAppsForTesting(
-      test_dir("invalid_create_shortcuts"));
+  const auto app_infos =
+      ScanTestDirForExternalWebApps("invalid_create_shortcuts");
 
   // The invalid_create_shortcuts directory contains one JSON file which is
   // correct except for an invalid "create_shortctus" field.
@@ -280,8 +267,8 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, MissingLaunchContainer) {
-  const auto app_infos = web_app::ScanDirForExternalWebAppsForTesting(
-      test_dir("missing_launch_container"));
+  const auto app_infos =
+      ScanTestDirForExternalWebApps("missing_launch_container");
 
   // The missing_launch_container directory contains one JSON file which is
   // correct except for a missing "launch_container" field.
@@ -289,8 +276,8 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, InvalidLaunchContainer) {
-  const auto app_infos = web_app::ScanDirForExternalWebAppsForTesting(
-      test_dir("invalid_launch_container"));
+  const auto app_infos =
+      ScanTestDirForExternalWebApps("invalid_launch_container");
 
   // The invalidg_launch_container directory contains one JSON file which is
   // correct except for an invalid "launch_container" field.
@@ -301,8 +288,7 @@
   base::test::ScopedFeatureList scoped_feature_list;
   scoped_feature_list.InitAndEnableFeature(
       base::Feature{"test_feature_name", base::FEATURE_DISABLED_BY_DEFAULT});
-  const auto app_infos = web_app::ScanDirForExternalWebAppsForTesting(
-      test_dir("enabled_by_finch"));
+  const auto app_infos = ScanTestDirForExternalWebApps("enabled_by_finch");
 
   // The enabled_by_finch directory contains two JSON file containing apps
   // that have field trials. As the matching featureis enabled, they should be
@@ -311,8 +297,7 @@
 }
 
 TEST_F(ScanDirForExternalWebAppsTest, NotEnabledByFinch) {
-  const auto app_infos = web_app::ScanDirForExternalWebAppsForTesting(
-      test_dir("enabled_by_finch"));
+  const auto app_infos = ScanTestDirForExternalWebApps("enabled_by_finch");
 
   // The enabled_by_finch directory contains two JSON file containing apps
   // that have field trials. As the matching featureis enabled, they should not
@@ -321,42 +306,42 @@
 }
 
 #if defined(OS_CHROMEOS)
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, ChildUser) {
+TEST_F(ScanDirForExternalWebAppsTest, ChildUser) {
   const auto profile = CreateProfileAndLogin();
   profile->SetSupervisedUserId(supervised_users::kChildAccountSUID);
   VerifySetOfApps(profile.get(), {GURL(kAppAllUrl), GURL(kAppChildUrl)});
 }
 
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, GuestUser) {
+TEST_F(ScanDirForExternalWebAppsTest, GuestUser) {
   VerifySetOfApps(CreateGuestProfileAndLogin().get(),
                   {GURL(kAppAllUrl), GURL(kAppGuestUrl)});
 }
 
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, ManagedUser) {
+TEST_F(ScanDirForExternalWebAppsTest, ManagedUser) {
   const auto profile = CreateProfileAndLogin();
   policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile.get())
       ->OverrideIsManagedForTesting(true);
   VerifySetOfApps(profile.get(), {GURL(kAppAllUrl), GURL(kAppManagedUrl)});
 }
 
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, SupervisedUser) {
+TEST_F(ScanDirForExternalWebAppsTest, SupervisedUser) {
   const auto profile = CreateProfileAndLogin();
   profile->SetSupervisedUserId("asdf");
   VerifySetOfApps(profile.get(), {GURL(kAppAllUrl), GURL(kAppSupervisedUrl)});
 }
 
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, UnmanagedUser) {
+TEST_F(ScanDirForExternalWebAppsTest, UnmanagedUser) {
   VerifySetOfApps(CreateProfileAndLogin().get(),
                   {GURL(kAppAllUrl), GURL(kAppUnmanagedUrl)});
 }
 
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, NonPrimaryProfile) {
+TEST_F(ScanDirForExternalWebAppsTest, NonPrimaryProfile) {
   EXPECT_TRUE(
       ScanApps(CreateProfile().get(), test_dir(kUserTypesTestDir)).empty());
 }
 #else
 // No app is expected for non-ChromeOS builds.
-TEST_F(ScanDirForExternalWebAppsWithProfileTest, NoApp) {
+TEST_F(ScanDirForExternalWebAppsTest, NoApp) {
   EXPECT_TRUE(
       ScanApps(CreateProfile().get(), test_dir(kUserTypesTestDir)).empty());
 }
diff --git a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
index 91173e4..3888e794 100644
--- a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
+++ b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
@@ -60,6 +60,44 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/image/image_family.h"
 
+// A TerminationObserver observes a NSRunningApplication for when it
+// terminates. On termination, it will run the specified callback, and then
+// release itself.
+@interface TerminationObserver : NSObject {
+  NSRunningApplication* app_;
+  base::OnceClosure callback_;
+}
+- (id)initWithRunningApplication:(NSRunningApplication*)app
+                        callback:(base::OnceClosure)callback;
+@end
+
+@implementation TerminationObserver
+- (id)initWithRunningApplication:(NSRunningApplication*)app
+                        callback:(base::OnceClosure)callback {
+  if (self = [super init]) {
+    app_ = app;
+    callback_ = std::move(callback);
+    [app_ retain];
+    [app_ addObserver:self
+           forKeyPath:@"isTerminated"
+              options:NSKeyValueObservingOptionNew
+              context:nullptr];
+  }
+  return self;
+}
+- (void)observeValueForKeyPath:(NSString*)keyPath
+                      ofObject:(id)object
+                        change:(NSDictionary*)change
+                       context:(void*)context {
+  [app_ removeObserver:self forKeyPath:@"isTerminated" context:nullptr];
+  base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
+                           std::move(callback_));
+  [app_ release];
+  app_ = nil;
+  [self release];
+}
+@end
+
 bool g_app_shims_allow_update_and_launch_in_tests = false;
 
 namespace {
@@ -235,13 +273,17 @@
       command_line.AppendSwitch(app_mode::kLaunchedAfterRebuild);
 
     // Launch without activating (NSWorkspaceLaunchWithoutActivation).
-    base::Process process = base::mac::OpenApplicationWithPath(
+    NSRunningApplication* app = base::mac::OpenApplicationWithPath(
         shim_path, command_line,
         NSWorkspaceLaunchDefault | NSWorkspaceLaunchWithoutActivation);
-    if (process.IsValid()) {
+    if (app) {
+      base::Process process([app processIdentifier]);
       base::PostTaskWithTraits(
           FROM_HERE, {content::BrowserThread::UI},
           base::BindOnce(std::move(launched_callback), std::move(process)));
+      [[TerminationObserver alloc]
+          initWithRunningApplication:app
+                            callback:std::move(terminated_callback)];
       return;
     }
   }
diff --git a/chrome/browser/web_applications/external_web_apps.cc b/chrome/browser/web_applications/external_web_apps.cc
index 6b2ba746..a5888762 100644
--- a/chrome/browser/web_applications/external_web_apps.cc
+++ b/chrome/browser/web_applications/external_web_apps.cc
@@ -19,8 +19,7 @@
 #include "base/task/post_task.h"
 #include "base/threading/scoped_blocking_call.h"
 #include "build/build_config.h"
-#include "chrome/browser/policy/profile_policy_connector.h"
-#include "chrome/browser/policy/profile_policy_connector_factory.h"
+#include "chrome/browser/apps/user_type_filter.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/web_applications/components/web_app_constants.h"
 #include "chrome/common/chrome_paths.h"
@@ -55,16 +54,6 @@
 constexpr char kLaunchContainerTab[] = "tab";
 constexpr char kLaunchContainerWindow[] = "window";
 
-// kUserType is required key that specifies enumeration of user types for which
-// web app is visible. See kUserType* constants
-constexpr char kUserType[] = "user_type";
-
-constexpr char kUserTypeChild[] = "child";
-constexpr char kUserTypeGuest[] = "guest";
-constexpr char kUserTypeManaged[] = "managed";
-constexpr char kUserTypeSupervised[] = "supervised";
-constexpr char kUserTypeUnmanaged[] = "unmanaged";
-
 #if defined(OS_CHROMEOS)
 // The sub-directory of the extensions directory in which to scan for external
 // web apps (as opposed to external extensions or external ARC apps).
@@ -98,7 +87,7 @@
 
 std::vector<web_app::PendingAppManager::AppInfo> ScanDir(
     const base::FilePath& dir,
-    const std::string& user_type) {
+    Profile* profile) {
   base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
   base::FilePath::StringType extension(FILE_PATH_LITERAL(".json"));
   base::FileEnumerator json_files(dir,
@@ -126,28 +115,15 @@
       continue;
     }
 
-    const base::Value* value =
-        dict->FindKeyOfType(kUserType, base::Value::Type::LIST);
-    if (!value) {
-      LOG(ERROR) << file.value() << " has no user type filter";
-      continue;
-    }
-    bool user_type_match = false;
-    for (const auto& it : value->GetList()) {
-      if (!it.is_string()) {
-        LOG(ERROR) << file.value() << " has invalid user type value";
-        user_type_match = false;
-        break;
-      }
-      user_type_match |= (it.GetString() == user_type);
-    }
-    if (!user_type_match) {
-      VLOG(1) << file.value() << " skip, does not match user type "
-              << user_type;
+    if (!apps::ProfileMatchJsonUserType(
+            profile, file.MaybeAsASCII() /* app_id */, dict.get(),
+            nullptr /* default_user_types */)) {
+      // Already logged.
       continue;
     }
 
-    value = dict->FindKeyOfType(kFeatureName, base::Value::Type::STRING);
+    const base::Value* value =
+        dict->FindKeyOfType(kFeatureName, base::Value::Type::STRING);
     if (value) {
       std::string feature_name = value->GetString();
       VLOG(1) << file.value() << " checking feature " << feature_name;
@@ -230,28 +206,14 @@
   return dir;
 }
 
-std::string DetermineUserType(Profile* profile) {
-  DCHECK(!profile->IsOffTheRecord());
-  if (profile->IsGuestSession())
-    return kUserTypeGuest;
-  if (profile->IsChild())
-    return kUserTypeChild;
-  if (profile->IsLegacySupervised())
-    return kUserTypeSupervised;
-  if (policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile)
-          ->IsManaged()) {
-    return kUserTypeManaged;
-  }
-  return kUserTypeUnmanaged;
-}
-
 }  // namespace
 
 namespace web_app {
 
 std::vector<web_app::PendingAppManager::AppInfo>
-ScanDirForExternalWebAppsForTesting(const base::FilePath& dir) {
-  return ScanDir(dir, kUserTypeUnmanaged);
+ScanDirForExternalWebAppsForTesting(const base::FilePath& dir,
+                                    Profile* profile) {
+  return ScanDir(dir, profile);
 }
 
 void ScanForExternalWebApps(Profile* profile,
@@ -275,8 +237,7 @@
       FROM_HERE,
       {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
        base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
-      base::BindOnce(&ScanDir, dir, DetermineUserType(profile)),
-      std::move(callback));
+      base::BindOnce(&ScanDir, dir, profile), std::move(callback));
 }
 
 }  //  namespace web_app
diff --git a/chrome/browser/web_applications/external_web_apps.h b/chrome/browser/web_applications/external_web_apps.h
index bb72d49..aad38fa 100644
--- a/chrome/browser/web_applications/external_web_apps.h
+++ b/chrome/browser/web_applications/external_web_apps.h
@@ -30,7 +30,8 @@
 //
 // This function performs file I/O, and must not be scheduled on UI threads.
 std::vector<web_app::PendingAppManager::AppInfo>
-ScanDirForExternalWebAppsForTesting(const base::FilePath& dir);
+ScanDirForExternalWebAppsForTesting(const base::FilePath& dir,
+                                    Profile* profile);
 
 }  // namespace web_app
 
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index cac96e6..b3cff585 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -418,15 +418,6 @@
       break;
 #endif
 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
-#if defined(OS_LINUX)
-    case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS:
-      if (!base::PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
-                                  &cur)) {
-        return false;
-      }
-      cur = cur.Append(FILE_PATH_LITERAL("managed_users"));
-      break;
-#endif
     case chrome::DIR_SUPERVISED_USER_INSTALLED_WHITELISTS:
       if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur))
         return false;
@@ -570,13 +561,6 @@
       cur = base::FilePath(kChromeOSComponentFlash);
       create_dir = false;
       break;
-    case chrome::DIR_CHILD_USERS_DEFAULT_APPS:
-      if (!base::PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
-                                  &cur)) {
-        return false;
-      }
-      cur = cur.Append(FILE_PATH_LITERAL("child_users"));
-      break;
     case chrome::FILE_CHROME_OS_TPM_FIRMWARE_UPDATE_LOCATION:
       cur = base::FilePath(kChromeOSTPMFirmwareUpdateLocation);
       create_dir = false;
diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h
index 1fe0600..34e42c5 100644
--- a/chrome/common/chrome_paths.h
+++ b/chrome/common/chrome_paths.h
@@ -104,9 +104,6 @@
   DIR_CHROMEOS_CUSTOM_WALLPAPERS,     // Directory where custom wallpapers
                                       // reside.
 #endif
-  DIR_SUPERVISED_USERS_DEFAULT_APPS,  // Directory where installer places .crx
-                                      // files to be installed when managed user
-                                      // session starts.
   DIR_SUPERVISED_USER_INSTALLED_WHITELISTS,  // Directory where sanitized
                                              // supervised user whitelists are
                                              // installed.
@@ -132,9 +129,6 @@
 #if defined(OS_CHROMEOS)
   FILE_CHROME_OS_COMPONENT_FLASH,  // The location of component updated Flash on
                                    // Chrome OS.
-  DIR_CHILD_USERS_DEFAULT_APPS,    // Directory where installer places .crx
-                                   // files to be installed when child user
-                                   // session starts.
 
   // File containing the location of the updated TPM firmware binary in the file
   // system.
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index de2a4cb..8161c150 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -468,6 +468,11 @@
 
 #if defined(OS_CHROMEOS)
 // An integer preference to store the number of times the Chrome OS Account
+// Manager migration flow ran successfully.
+const char kAccountManagerNumTimesMigrationRanSuccessfully[] =
+    "account_manager.num_times_migration_ran_successfully";
+
+// An integer preference to store the number of times the Chrome OS Account
 // Manager welcome screen has been shown.
 const char kAccountManagerNumTimesWelcomeScreenShown[] =
     "account_manager.num_times_welcome_screen_shown";
@@ -1539,6 +1544,8 @@
 // Data associated with search suggestions that appear on the NTP.
 const char kNtpSearchSuggestionsBlacklist[] =
     "ntp.search_suggestions_blacklist";
+const char kNtpSearchSuggestionsImpressions[] =
+    "ntp.search_suggestions_impressions";
 const char kNtpSearchSuggestionsOptOut[] = "ntp.search_suggestions_opt_out";
 #endif  // defined(OS_ANDROID)
 
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index d38e483..f2383b9 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -186,6 +186,7 @@
 extern const char kDefaultAppsInstallState[];
 extern const char kHideWebStoreIcon[];
 #if defined(OS_CHROMEOS)
+extern const char kAccountManagerNumTimesMigrationRanSuccessfully[];
 extern const char kAccountManagerNumTimesWelcomeScreenShown[];
 extern const char kTapToClickEnabled[];
 extern const char kEnableTouchpadThreeFingerClick[];
@@ -536,6 +537,7 @@
 extern const char kNtpCustomBackgroundDict[];
 extern const char kNtpCustomBackgroundLocalToDevice[];
 extern const char kNtpSearchSuggestionsBlacklist[];
+extern const char kNtpSearchSuggestionsImpressions[];
 extern const char kNtpSearchSuggestionsOptOut[];
 #endif  // defined(OS_ANDROID)
 extern const char kNtpShownPage[];
diff --git a/chrome/common/thread_profiler.cc b/chrome/common/thread_profiler.cc
index cbb2c98..1bae616 100644
--- a/chrome/common/thread_profiler.cc
+++ b/chrome/common/thread_profiler.cc
@@ -10,6 +10,7 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/lazy_instance.h"
+#include "base/message_loop/work_id_provider.h"
 #include "base/rand_util.h"
 #include "base/threading/platform_thread.h"
 #include "base/threading/sequence_local_storage_slot.h"
@@ -65,14 +66,6 @@
   return CallStackProfileParams::UNKNOWN_PROCESS;
 }
 
-std::unique_ptr<base::StackSamplingProfiler::ProfileBuilder>
-CreateProfileBuilder(
-    const CallStackProfileParams& params,
-    base::OnceClosure completed_callback = base::OnceClosure()) {
-  return std::make_unique<CallStackProfileBuilder>(
-      params, std::move(completed_callback));
-}
-
 }  // namespace
 
 // The scheduler works by splitting execution time into repeated periods such
@@ -124,7 +117,26 @@
   return base::TimeTicks::Now();
 }
 
-ThreadProfiler::~ThreadProfiler() {}
+// Records the current unique id for the work item being executed in the target
+// thread's message loop.
+class ThreadProfiler::WorkIdRecorder : public metrics::WorkIdRecorder {
+ public:
+  explicit WorkIdRecorder(base::WorkIdProvider* work_id_provider)
+      : work_id_provider_(work_id_provider) {}
+
+  // Invoked on the profiler thread while the target thread is suspended.
+  unsigned int RecordWorkId() const override {
+    return work_id_provider_->GetWorkId();
+  }
+
+  WorkIdRecorder(const WorkIdRecorder&) = delete;
+  WorkIdRecorder& operator=(const WorkIdRecorder&) = delete;
+
+ private:
+  base::WorkIdProvider* const work_id_provider_;
+};
+
+ThreadProfiler::~ThreadProfiler() = default;
 
 // static
 std::unique_ptr<ThreadProfiler> ThreadProfiler::CreateAndStartOnMainThread() {
@@ -201,14 +213,18 @@
     scoped_refptr<base::SingleThreadTaskRunner> owning_thread_task_runner)
     : thread_(thread),
       owning_thread_task_runner_(owning_thread_task_runner),
+      work_id_recorder_(std::make_unique<WorkIdRecorder>(
+          base::WorkIdProvider::GetForCurrentThread())),
       weak_factory_(this) {
   if (!StackSamplingConfiguration::Get()->IsProfilerEnabledForCurrentProcess())
     return;
 
   startup_profiler_ = std::make_unique<StackSamplingProfiler>(
       base::PlatformThread::CurrentId(), kSamplingParams,
-      CreateProfileBuilder(CallStackProfileParams(
-          GetProcess(), thread, CallStackProfileParams::PROCESS_STARTUP)));
+      std::make_unique<CallStackProfileBuilder>(
+          CallStackProfileParams(GetProcess(), thread,
+                                 CallStackProfileParams::PROCESS_STARTUP),
+          work_id_recorder_.get()));
 
   startup_profiler_->Start();
 
@@ -251,9 +267,10 @@
   // NB: Destroys the previous profiler as side effect.
   periodic_profiler_ = std::make_unique<StackSamplingProfiler>(
       base::PlatformThread::CurrentId(), kSamplingParams,
-      CreateProfileBuilder(
+      std::make_unique<CallStackProfileBuilder>(
           CallStackProfileParams(GetProcess(), thread_,
                                  CallStackProfileParams::PERIODIC_COLLECTION),
+          work_id_recorder_.get(),
           base::BindOnce(&ThreadProfiler::OnPeriodicCollectionCompleted,
                          owning_thread_task_runner_,
                          weak_factory_.GetWeakPtr())));
diff --git a/chrome/common/thread_profiler.h b/chrome/common/thread_profiler.h
index d708836..5a3de1f 100644
--- a/chrome/common/thread_profiler.h
+++ b/chrome/common/thread_profiler.h
@@ -91,6 +91,8 @@
       service_manager::Connector* connector);
 
  private:
+  class WorkIdRecorder;
+
   // Creates the profiler. The task runner will be supplied for child threads
   // but not for main threads.
   ThreadProfiler(
@@ -114,6 +116,8 @@
 
   scoped_refptr<base::SingleThreadTaskRunner> owning_thread_task_runner_;
 
+  std::unique_ptr<WorkIdRecorder> work_id_recorder_;
+
   std::unique_ptr<base::StackSamplingProfiler> startup_profiler_;
 
   std::unique_ptr<base::StackSamplingProfiler> periodic_profiler_;
diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
index 2b87880..fbc0a43 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -122,6 +122,13 @@
     base::RunLoop().RunUntilIdle();
     ASSERT_EQ(available, GetCalledAutomaticGenerationStatusChangedTrue());
     fake_pw_client_.reset_called_automatic_generation_status_changed_true();
+
+    // Check that aria-autocomplete attribute is set correctly.
+    if (available) {
+      WebDocument doc = GetMainFrame()->GetDocument();
+      WebElement element = doc.GetElementById(WebString::FromUTF8(element_id));
+      EXPECT_EQ("list", element.GetAttribute("aria-autocomplete"));
+    }
   }
 
   void ExpectFormClassifierVoteReceived(
diff --git a/chrome/services/noop/BUILD.gn b/chrome/services/noop/BUILD.gn
new file mode 100644
index 0000000..fbb8beb
--- /dev/null
+++ b/chrome/services/noop/BUILD.gn
@@ -0,0 +1,23 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//services/service_manager/public/service_manifest.gni")
+
+source_set("lib") {
+  sources = [
+    "noop_service.cc",
+    "noop_service.h",
+  ]
+
+  deps = [
+    "//chrome/services/noop/public/mojom",
+    "//mojo/public/cpp/bindings",
+    "//services/service_manager/public/cpp",
+  ]
+}
+
+service_manifest("manifest") {
+  name = "noop"
+  source = "manifest.json"
+}
diff --git a/chrome/services/noop/OWNERS b/chrome/services/noop/OWNERS
new file mode 100644
index 0000000..5235261
--- /dev/null
+++ b/chrome/services/noop/OWNERS
@@ -0,0 +1,4 @@
+cduvall@chromium.org
+
+per-file manifest.json=set noparent
+per-file manifest.json=file://ipc/SECURITY_OWNERS
diff --git a/chrome/services/noop/manifest.json b/chrome/services/noop/manifest.json
new file mode 100644
index 0000000..699bc4c1
--- /dev/null
+++ b/chrome/services/noop/manifest.json
@@ -0,0 +1,17 @@
+{
+  "name": "noop",
+  "display_name": "No-op Service",
+  "sandbox_type": "network",
+  "options" : {
+    "instance_sharing" : "shared_instance_across_users"
+  },
+  "interface_provider_specs": {
+    "service_manager:connector": {
+      "provides": {
+        "noop": [
+          "chrome.mojom.Noop"
+        ]
+      }
+    }
+  }
+}
diff --git a/chrome/services/noop/noop_service.cc b/chrome/services/noop/noop_service.cc
new file mode 100644
index 0000000..0992765
--- /dev/null
+++ b/chrome/services/noop/noop_service.cc
@@ -0,0 +1,28 @@
+// Copyright 2019 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/services/noop/noop_service.h"
+
+namespace chrome {
+
+NoopService::NoopService(service_manager::mojom::ServiceRequest request)
+    : service_binding_(this, std::move(request)) {
+  registry_.AddInterface<mojom::Noop>(base::BindRepeating(
+      &NoopService::BindNoopRequest, base::Unretained(this)));
+}
+
+NoopService::~NoopService() = default;
+
+void NoopService::OnBindInterface(
+    const service_manager::BindSourceInfo& source_info,
+    const std::string& interface_name,
+    mojo::ScopedMessagePipeHandle interface_pipe) {
+  registry_.BindInterface(interface_name, std::move(interface_pipe));
+}
+
+void NoopService::BindNoopRequest(mojom::NoopRequest request) {
+  bindings_.AddBinding(this, std::move(request));
+}
+
+}  // namespace chrome
diff --git a/chrome/services/noop/noop_service.h b/chrome/services/noop/noop_service.h
new file mode 100644
index 0000000..4a3ddcf
--- /dev/null
+++ b/chrome/services/noop/noop_service.h
@@ -0,0 +1,41 @@
+// Copyright 2019 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_SERVICES_NOOP_NOOP_SERVICE_H_
+#define CHROME_SERVICES_NOOP_NOOP_SERVICE_H_
+
+#include "chrome/services/noop/public/mojom/noop.mojom.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_binding.h"
+#include "services/service_manager/public/mojom/service.mojom.h"
+
+namespace chrome {
+
+// No-op service that does nothing. Will be used to analyze memory usage of
+// starting an extra process.
+class NoopService : public service_manager::Service, public mojom::Noop {
+ public:
+  explicit NoopService(service_manager::mojom::ServiceRequest request);
+  ~NoopService() override;
+
+ private:
+  // service_manager::Service:
+  void OnBindInterface(const service_manager::BindSourceInfo& source_info,
+                       const std::string& interface_name,
+                       mojo::ScopedMessagePipeHandle interface_pipe) override;
+
+  void BindNoopRequest(mojom::NoopRequest request);
+
+  service_manager::ServiceBinding service_binding_;
+  service_manager::BinderRegistry registry_;
+  mojo::BindingSet<mojom::Noop> bindings_;
+
+  DISALLOW_COPY_AND_ASSIGN(NoopService);
+};
+
+}  // namespace chrome
+
+#endif  // CHROME_SERVICES_NOOP_NOOP_SERVICE_H_
diff --git a/chrome/services/noop/public/cpp/BUILD.gn b/chrome/services/noop/public/cpp/BUILD.gn
new file mode 100644
index 0000000..529b9f359
--- /dev/null
+++ b/chrome/services/noop/public/cpp/BUILD.gn
@@ -0,0 +1,16 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+source_set("cpp") {
+  sources = [
+    "utils.cc",
+    "utils.h",
+  ]
+
+  deps = [
+    "//base",
+    "//chrome/services/noop/public/mojom",
+    "//services/service_manager/public/cpp",
+  ]
+}
diff --git a/chrome/services/noop/public/cpp/utils.cc b/chrome/services/noop/public/cpp/utils.cc
new file mode 100644
index 0000000..ce132e4
--- /dev/null
+++ b/chrome/services/noop/public/cpp/utils.cc
@@ -0,0 +1,40 @@
+// Copyright 2019 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/services/noop/public/cpp/utils.h"
+
+#include "base/feature_list.h"
+#include "chrome/services/noop/public/mojom/noop.mojom.h"
+#include "content/public/common/service_manager_connection.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace chrome {
+namespace {
+
+// If enabled, starts a service that does nothing. This will be used to analyze
+// memory usage of starting an extra process.
+const base::Feature kNoopService{"NoopService",
+                                 base::FEATURE_DISABLED_BY_DEFAULT};
+
+}  // namespace
+
+void MaybeStartNoopService() {
+  if (!IsNoopServiceEnabled())
+    return;
+
+  static mojom::NoopPtr* noop_ptr = new mojom::NoopPtr;
+  if (!noop_ptr->is_bound() || noop_ptr->encountered_error()) {
+    content::ServiceManagerConnection::GetForProcess()
+        ->GetConnector()
+        ->BindInterface(mojom::kNoopServiceName, noop_ptr);
+    noop_ptr->set_connection_error_handler(
+        base::BindOnce(&MaybeStartNoopService));
+  }
+}
+
+bool IsNoopServiceEnabled() {
+  return base::FeatureList::IsEnabled(kNoopService);
+}
+
+}  // namespace chrome
diff --git a/chrome/services/noop/public/cpp/utils.h b/chrome/services/noop/public/cpp/utils.h
new file mode 100644
index 0000000..25928bb
--- /dev/null
+++ b/chrome/services/noop/public/cpp/utils.h
@@ -0,0 +1,18 @@
+// Copyright 2019 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_SERVICES_NOOP_PUBLIC_CPP_UTILS_H_
+#define CHROME_SERVICES_NOOP_PUBLIC_CPP_UTILS_H_
+
+namespace chrome {
+
+// Make sure the no-op service is started if it is enabled.
+void MaybeStartNoopService();
+
+// Whether the no-op service should be launched.
+bool IsNoopServiceEnabled();
+
+}  // namespace chrome
+
+#endif  // CHROME_SERVICES_NOOP_PUBLIC_CPP_UTILS_H_
diff --git a/chrome/services/noop/public/mojom/BUILD.gn b/chrome/services/noop/public/mojom/BUILD.gn
new file mode 100644
index 0000000..971500f
--- /dev/null
+++ b/chrome/services/noop/public/mojom/BUILD.gn
@@ -0,0 +1,11 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//mojo/public/tools/bindings/mojom.gni")
+
+mojom("mojom") {
+  sources = [
+    "noop.mojom",
+  ]
+}
diff --git a/chrome/services/noop/public/mojom/OWNERS b/chrome/services/noop/public/mojom/OWNERS
new file mode 100644
index 0000000..08850f4
--- /dev/null
+++ b/chrome/services/noop/public/mojom/OWNERS
@@ -0,0 +1,2 @@
+per-file *.mojom=set noparent
+per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/chrome/services/noop/public/mojom/noop.mojom b/chrome/services/noop/public/mojom/noop.mojom
new file mode 100644
index 0000000..ab4f3f0
--- /dev/null
+++ b/chrome/services/noop/public/mojom/noop.mojom
@@ -0,0 +1,12 @@
+// Copyright 2019 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.
+
+module chrome.mojom;
+
+const string kNoopServiceName = "noop";
+
+// No-op interface that does nothing. Will be used to analyze memory usage of
+// starting an extra process.
+interface Noop {
+};
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 545cdb5..b9f0217 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -1106,6 +1106,7 @@
       "//third_party/widevine/cdm:headers",
       "//ui/accessibility:test_support",
       "//ui/base:test_support",
+      "//ui/base/clipboard:clipboard_test_support",
       "//ui/compositor:test_support",
       "//ui/resources",
       "//ui/web_dialogs:test_support",
@@ -1538,7 +1539,6 @@
         "../browser/ui/views/autofill/autofill_popup_base_view_browsertest.cc",
         "../browser/ui/views/autofill/card_unmask_prompt_view_tester_views.cc",
         "../browser/ui/views/autofill/card_unmask_prompt_view_tester_views.h",
-        "../browser/ui/views/autofill/local_card_migration_browsertest.cc",
         "../browser/ui/views/autofill/save_card_bubble_views_browsertest.cc",
         "../browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc",
         "../browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h",
@@ -2412,6 +2412,7 @@
     "../browser/android/webapk/webapk_web_manifest_checker_unittest.cc",
     "../browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc",
     "../browser/app_controller_mac_unittest.mm",
+    "../browser/apps/user_type_filter_unittest.cc",
     "../browser/autocomplete/chrome_autocomplete_provider_client_unittest.cc",
     "../browser/autocomplete/chrome_autocomplete_scheme_classifier_unittest.cc",
     "../browser/autocomplete/search_provider_unittest.cc",
@@ -2671,7 +2672,6 @@
     "../browser/prefs/proxy_policy_unittest.cc",
     "../browser/prefs/session_startup_pref_unittest.cc",
     "../browser/prerender/prerender_history_unittest.cc",
-    "../browser/prerender/prerender_resource_throttle_unittest.cc",
     "../browser/prerender/prerender_unittest.cc",
     "../browser/prerender/prerender_util_unittest.cc",
     "../browser/previews/previews_infobar_delegate_unittest.cc",
@@ -4907,6 +4907,7 @@
       "//third_party/zlib",
       "//ui/base:base_interactive_ui_tests",
       "//ui/base:test_support",
+      "//ui/base/clipboard:clipboard_test_support",
       "//ui/events:events_interactive_ui_tests",
       "//ui/resources:ui_test_pak",
       "//ui/web_dialogs:test_support",
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc
index 15ed429..69520fad 100644
--- a/chrome/test/base/view_event_test_base.cc
+++ b/chrome/test/base/view_event_test_base.cc
@@ -14,6 +14,7 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/view_event_test_platform_part.h"
 #include "mojo/core/embedder/embedder.h"
+#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/ime/input_method_initializer.h"
 #include "ui/base/test/ui_controls.h"
 #include "ui/compositor/test/context_factories_for_test.h"
diff --git a/chrome/test/chromedriver/js/call_function.js b/chrome/test/chromedriver/js/call_function.js
index 4bdca10..cccd494d 100644
--- a/chrome/test/chromedriver/js/call_function.js
+++ b/chrome/test/chromedriver/js/call_function.js
@@ -8,7 +8,7 @@
  */
 var StatusCode = {
   STALE_ELEMENT_REFERENCE: 10,
-  UNKNOWN_ERROR: 13,
+  JAVA_SCRIPT_ERROR: 17,
 };
 
 /**
@@ -361,7 +361,7 @@
   try {
     var returnValue = wrap(func.apply(null, unwrap(args, cache)));
   } catch (error) {
-    status = error.code || StatusCode.UNKNOWN_ERROR;
+    status = error.code || StatusCode.JAVA_SCRIPT_ERROR;
     var returnValue = error.message;
   }
   return {
diff --git a/chrome/test/chromedriver/js/call_function_test.html b/chrome/test/chromedriver/js/call_function_test.html
index 9dedc54..1acd5fe 100644
--- a/chrome/test/chromedriver/js/call_function_test.html
+++ b/chrome/test/chromedriver/js/call_function_test.html
@@ -43,7 +43,7 @@
 
   var result = callFunction(null, function() { throw new Error('fake error'); },
       []);
-  assertEquals(StatusCode.UNKNOWN_ERROR, result.status);
+  assertEquals(StatusCode.JAVA_SCRIPT_ERROR, result.status);
   assertEquals('fake error', result.value);
 
   result = callFunction(null, function() {
diff --git a/chrome/test/chromedriver/server/http_handler.cc b/chrome/test/chromedriver/server/http_handler.cc
index 7d114fb8..5ac166a99 100644
--- a/chrome/test/chromedriver/server/http_handler.cc
+++ b/chrome/test/chromedriver/server/http_handler.cc
@@ -1010,7 +1010,8 @@
       response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
       break;
     case kJavaScriptError:
-      response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
+      response.reset(
+          new net::HttpServerResponseInfo(net::HTTP_INTERNAL_SERVER_ERROR));
       break;
     case kMoveTargetOutOfBounds:
       response.reset(
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py
index 1d2c2b59..378e4ce4 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -1793,7 +1793,7 @@
 
   def testThrowErrorWithExecuteScript(self):
     self.assertRaisesRegexp(
-        chromedriver.UnknownError, "some error",
+        chromedriver.JavaScriptError, "some error",
         self._driver.ExecuteScript, 'throw new Error("some error")')
 
   def testDoesntCrashWhenScriptLogsUndefinedValue(self):
diff --git a/chrome/test/data/extensions/external_standalone/child_users/hcglmfcclpfgljeaiahehebeoaiicbko.json b/chrome/test/data/extensions/external_standalone/child_users/hcglmfcclpfgljeaiahehebeoaiicbko.json
deleted file mode 100644
index e2302c5..0000000
--- a/chrome/test/data/extensions/external_standalone/child_users/hcglmfcclpfgljeaiahehebeoaiicbko.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "external_crx": "hcglmfcclpfgljeaiahehebeoaiicbko.crx",
-  "external_version": "1.0"
-}
diff --git a/chrome/test/data/extensions/external_standalone/child_users/hcglmfcclpfgljeaiahehebeoaiicbko.crx b/chrome/test/data/extensions/external_standalone/hcglmfcclpfgljeaiahehebeoaiicbko.crx
similarity index 100%
rename from chrome/test/data/extensions/external_standalone/child_users/hcglmfcclpfgljeaiahehebeoaiicbko.crx
rename to chrome/test/data/extensions/external_standalone/hcglmfcclpfgljeaiahehebeoaiicbko.crx
Binary files differ
diff --git a/chrome/test/data/extensions/external_standalone/hcglmfcclpfgljeaiahehebeoaiicbko.json b/chrome/test/data/extensions/external_standalone/hcglmfcclpfgljeaiahehebeoaiicbko.json
new file mode 100644
index 0000000..b8485c3
--- /dev/null
+++ b/chrome/test/data/extensions/external_standalone/hcglmfcclpfgljeaiahehebeoaiicbko.json
@@ -0,0 +1,5 @@
+{
+  "external_crx": "hcglmfcclpfgljeaiahehebeoaiicbko.crx",
+  "external_version": "1.0",
+  "user_type": ["unmanaged", "child"]
+}
diff --git a/chrome/test/data/extensions/external_standalone/ldnnhddmnhbkjipkidpdiheffobcpfmf.json b/chrome/test/data/extensions/external_standalone/ldnnhddmnhbkjipkidpdiheffobcpfmf.json
index 5673548e..a16dd63b 100644
--- a/chrome/test/data/extensions/external_standalone/ldnnhddmnhbkjipkidpdiheffobcpfmf.json
+++ b/chrome/test/data/extensions/external_standalone/ldnnhddmnhbkjipkidpdiheffobcpfmf.json
@@ -1,4 +1,5 @@
 {
   "external_crx": "ldnnhddmnhbkjipkidpdiheffobcpfmf.crx",
-  "external_version": "1"
+  "external_version": "1",
+  "user_type": ["unmanaged"]
 }
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js
index 9228aa2..3321322 100644
--- a/chrome/test/data/webui/settings/cr_settings_browsertest.js
+++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -1011,9 +1011,9 @@
 
 GEN('#endif  // defined(USE_NSS_CERTS)');
 
-GEN('#if defined(GOOGLE_CHROME_BUILD)');
 /**
- * Test fixture for chrome/browser/resources/settings/privacy_page/.
+ * Test fixture for
+ * chrome/browser/resources/settings/privacy_page/personalization_options.html.
  * @constructor
  * @extends {CrSettingsBrowserTest}
  */
@@ -1035,14 +1035,19 @@
   ]),
 };
 
+TEST_F('CrSettingsPersonalizationOptionsTest', 'AllBuilds', function() {
+  mocha.grep('PersonalizationOptionsTests_AllBuilds').run();
+});
 
+GEN('#if defined(GOOGLE_CHROME_BUILD)');
 TEST_F('CrSettingsPersonalizationOptionsTest', 'OfficialBuild', function() {
-  mocha.run();
+  mocha.grep('PersonalizationOptionsTests_OfficialBuild').run();
 });
 GEN('#endif');
 
 /**
- * Test fixture for chrome/browser/resources/settings/privacy_page/.
+ * Test fixture for
+ * chrome/browser/resources/settings/privacy_page/privacy_page.html.
  * @constructor
  * @extends {CrSettingsBrowserTest}
  */
diff --git a/chrome/test/data/webui/settings/people_page_sync_page_test.js b/chrome/test/data/webui/settings/people_page_sync_page_test.js
index 8a8dbfe3..ac2c34f 100644
--- a/chrome/test/data/webui/settings/people_page_sync_page_test.js
+++ b/chrome/test/data/webui/settings/people_page_sync_page_test.js
@@ -153,7 +153,7 @@
       assertTrue(syncPage.$$('#sync-separator').hidden);
       assertTrue(otherItems.classList.contains('list-frame'));
       assertEquals(
-          otherItems.querySelectorAll(':scope > .list-item').length, 5);
+          otherItems.querySelectorAll(':scope > .list-item').length, 4);
 
       // Test sync paused state.
       syncPage.syncStatus = {
diff --git a/chrome/test/data/webui/settings/personalization_options_test.js b/chrome/test/data/webui/settings/personalization_options_test.js
index 1a4e3e6..1b67286 100644
--- a/chrome/test/data/webui/settings/personalization_options_test.js
+++ b/chrome/test/data/webui/settings/personalization_options_test.js
@@ -3,7 +3,53 @@
 // found in the LICENSE file.
 
 cr.define('settings_personalization_options', function() {
-  suite('SafeBrowsingExtendedReportingOfficialBuild', function() {
+  suite('PersonalizationOptionsTests_AllBuilds', function() {
+    /** @type {settings.TestPrivacyPageBrowserProxy} */
+    let testBrowserProxy;
+
+    /** @type {SettingsPersonalizationOptionsElement} */
+    let testElement;
+
+    suiteSetup(function() {
+      loadTimeData.overrideValues({
+        driveSuggestAvailable: true,
+      });
+    });
+
+    setup(function() {
+      testBrowserProxy = new TestPrivacyPageBrowserProxy();
+      settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy;
+      PolymerTest.clearBody();
+      testElement = document.createElement('settings-personalization-options');
+      document.body.appendChild(testElement);
+      Polymer.dom.flush();
+    });
+
+    teardown(function() {
+      testElement.remove();
+    });
+
+    test('DriveSearchSuggestControl', function() {
+      assertFalse(!!testElement.$$('#driveSuggestControl'));
+
+      testElement.unifiedConsentEnabled = true;
+      testElement.syncStatus = {
+        signedIn: true,
+        statusAction: settings.StatusAction.NO_ACTION
+      };
+      Polymer.dom.flush();
+      assertTrue(!!testElement.$$('#driveSuggestControl'));
+
+      testElement.syncStatus = {
+        signedIn: true,
+        statusAction: settings.StatusAction.REAUTHENTICATE
+      };
+      Polymer.dom.flush();
+      assertFalse(!!testElement.$$('#driveSuggestControl'));
+    });
+  });
+
+  suite('PersonalizationOptionsTests_OfficialBuild', function() {
     /** @type {settings.TestPrivacyPageBrowserProxy} */
     let testBrowserProxy;
 
@@ -22,19 +68,6 @@
       testElement.remove();
     });
 
-    test('displaying toggles depending on unified consent', function() {
-      testElement.unifiedConsentEnabled = false;
-      Polymer.dom.flush();
-      assertEquals(
-          7,
-          testElement.root.querySelectorAll('settings-toggle-button').length);
-      testElement.unifiedConsentEnabled = true;
-      Polymer.dom.flush();
-      assertEquals(
-          8,
-          testElement.root.querySelectorAll('settings-toggle-button').length);
-    });
-
     test('UnifiedConsent spellcheck toggle', function() {
       testElement.unifiedConsentEnabled = true;
       testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
index 69408e0..57329eb 100644
--- a/chrome/utility/BUILD.gn
+++ b/chrome/utility/BUILD.gn
@@ -31,6 +31,8 @@
     "//chrome:strings",
     "//chrome/common",
     "//chrome/common:mojo_bindings",
+    "//chrome/services/noop:lib",
+    "//chrome/services/noop/public/cpp",
     "//components/mirroring/mojom:constants",
     "//components/mirroring/service:mirroring_service",
     "//components/search_engines",
diff --git a/chrome/utility/DEPS b/chrome/utility/DEPS
index 0093f3d..27e9516 100644
--- a/chrome/utility/DEPS
+++ b/chrome/utility/DEPS
@@ -8,6 +8,8 @@
   "+chrome/services/isolated_xr_device",
   "+chrome/services/media_gallery_util/media_gallery_util_service.h",
   "+chrome/services/media_gallery_util/public/mojom",
+  "+chrome/services/noop/noop_service.h",
+  "+chrome/services/noop/public/cpp",
   # TODO(crbug.com/798782): remove dependency to pdf_to_emf_converter_factory.h
   # when Cloud print chrome/service is removed.
   "+chrome/services/printing/pdf_to_emf_converter_factory.h",
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 0004ff1..24e316e0 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -15,6 +15,8 @@
 #include "base/threading/sequenced_task_runner_handle.h"
 #include "base/time/time.h"
 #include "chrome/common/buildflags.h"
+#include "chrome/services/noop/noop_service.h"
+#include "chrome/services/noop/public/cpp/utils.h"
 #include "components/mirroring/mojom/constants.mojom.h"
 #include "components/mirroring/service/features.h"
 #include "components/mirroring/service/mirroring_service.h"
@@ -261,6 +263,11 @@
   if (service_name == unzip::mojom::kServiceName)
     return std::make_unique<unzip::UnzipService>(std::move(request));
 
+  if (service_name == chrome::mojom::kNoopServiceName &&
+      chrome::IsNoopServiceEnabled()) {
+    return std::make_unique<chrome::NoopService>(std::move(request));
+  }
+
 #if BUILDFLAG(ENABLE_PRINTING)
   if (service_name == printing::mojom::kServiceName)
     return printing::CreatePdfCompositorService(std::move(request));
diff --git a/chromecast/browser/extensions/api/automation_internal/automation_event_router.cc b/chromecast/browser/extensions/api/automation_internal/automation_event_router.cc
index e69fdbb..98cf854 100644
--- a/chromecast/browser/extensions/api/automation_internal/automation_event_router.cc
+++ b/chromecast/browser/extensions/api/automation_internal/automation_event_router.cc
@@ -24,6 +24,10 @@
 #include "ui/accessibility/ax_enums.mojom.h"
 #include "ui/accessibility/ax_node_data.h"
 
+#if defined(USE_AURA)
+#include "chromecast/browser/ui/aura/accessibility/automation_manager_aura.h"
+#endif
+
 namespace extensions {
 namespace cast {
 
@@ -39,6 +43,10 @@
                  content::NotificationService::AllBrowserContextsAndSources());
   registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
                  content::NotificationService::AllBrowserContextsAndSources());
+#if defined(USE_AURA)
+  // Not reset because |this| is leaked.
+  AutomationManagerAura::GetInstance()->set_event_bundle_sink(this);
+#endif
 }
 
 AutomationEventRouter::~AutomationEventRouter() {}
@@ -159,6 +167,20 @@
     iter->tree_ids.insert(ax_tree_id);
 }
 
+void AutomationEventRouter::DispatchAccessibilityEvents(
+    const ui::AXTreeID& tree_id,
+    std::vector<ui::AXTreeUpdate> updates,
+    const gfx::Point& mouse_location,
+    std::vector<ui::AXEvent> events) {
+  ExtensionMsg_AccessibilityEventBundleParams event_bundle;
+  event_bundle.tree_id = tree_id;
+  event_bundle.updates = std::move(updates);
+  event_bundle.mouse_location = mouse_location;
+  event_bundle.events = std::move(events);
+
+  DispatchAccessibilityEvents(event_bundle);
+}
+
 void AutomationEventRouter::Observe(
     int type,
     const content::NotificationSource& source,
diff --git a/chromecast/browser/extensions/api/automation_internal/automation_event_router.h b/chromecast/browser/extensions/api/automation_internal/automation_event_router.h
index 6d6f4e88..37cc0c4 100644
--- a/chromecast/browser/extensions/api/automation_internal/automation_event_router.h
+++ b/chromecast/browser/extensions/api/automation_internal/automation_event_router.h
@@ -17,6 +17,8 @@
 #include "content/public/browser/notification_registrar.h"
 #include "extensions/common/extension_id.h"
 #include "extensions/common/extension_messages.h"
+#include "ui/accessibility/ax_event_bundle_sink.h"
+#include "ui/accessibility/ax_tree_id.h"
 
 namespace content {
 class BrowserContext;
@@ -33,8 +35,9 @@
 namespace cast {
 struct AutomationListener;
 
-class AutomationEventRouter : public AutomationEventRouterInterface,
-                              content::NotificationObserver {
+class AutomationEventRouter : public ui::AXEventBundleSink,
+                              public AutomationEventRouterInterface,
+                              public content::NotificationObserver {
  public:
   static AutomationEventRouter* GetInstance();
 
@@ -89,6 +92,12 @@
                 ui::AXTreeID source_ax_tree_id,
                 bool desktop);
 
+  // ui::AXEventBundleSink:
+  void DispatchAccessibilityEvents(const ui::AXTreeID& tree_id,
+                                   std::vector<ui::AXTreeUpdate> updates,
+                                   const gfx::Point& mouse_location,
+                                   std::vector<ui::AXEvent> events) override;
+
   // content::NotificationObserver interface.
   void Observe(int type,
                const content::NotificationSource& source,
diff --git a/chromecast/browser/extensions/api/automation_internal/automation_internal_api.cc b/chromecast/browser/extensions/api/automation_internal/automation_internal_api.cc
index 135506f..a6725b3 100644
--- a/chromecast/browser/extensions/api/automation_internal/automation_internal_api.cc
+++ b/chromecast/browser/extensions/api/automation_internal/automation_internal_api.cc
@@ -101,8 +101,8 @@
       return false;
 
     IPC_BEGIN_MESSAGE_MAP(QuerySelectorHandler, message)
-    IPC_MESSAGE_HANDLER(ExtensionHostMsg_AutomationQuerySelector_Result,
-                        OnQueryResponse)
+      IPC_MESSAGE_HANDLER(ExtensionHostMsg_AutomationQuerySelector_Result,
+                          OnQueryResponse)
     IPC_END_MESSAGE_MAP()
     return true;
   }
@@ -149,12 +149,6 @@
   return false;
 }
 
-ui::AXTreeID GetAXTreeIDFromRenderFrameHost(content::RenderFrameHost* rfh) {
-  auto* registry = ui::AXTreeIDRegistry::GetInstance();
-  return registry->GetAXTreeID(ui::AXTreeIDRegistry::FrameID(
-      rfh->GetProcess()->GetID(), rfh->GetRoutingID()));
-}
-
 }  // namespace
 
 // Helper class that receives accessibility data from |WebContents|.
@@ -194,7 +188,7 @@
 
   void RenderFrameDeleted(
       content::RenderFrameHost* render_frame_host) override {
-    ui::AXTreeID tree_id = GetAXTreeIDFromRenderFrameHost(render_frame_host);
+    ui::AXTreeID tree_id = render_frame_host->GetAXTreeID();
     AutomationEventRouter::GetInstance()->DispatchTreeDestroyedEvent(
         tree_id, browser_context_);
   }
@@ -202,8 +196,7 @@
   void MediaStartedPlaying(const MediaPlayerInfo& video_type,
                            const MediaPlayerId& id) override {
     content::AXEventNotificationDetails content_event_bundle;
-    content_event_bundle.ax_tree_id =
-        GetAXTreeIDFromRenderFrameHost(id.render_frame_host);
+    content_event_bundle.ax_tree_id = id.render_frame_host->GetAXTreeID();
     content_event_bundle.events.resize(1);
     content_event_bundle.events[0].event_type =
         ax::mojom::Event::kMediaStartedPlaying;
@@ -215,8 +208,7 @@
       const MediaPlayerId& id,
       WebContentsObserver::MediaStoppedReason reason) override {
     content::AXEventNotificationDetails content_event_bundle;
-    content_event_bundle.ax_tree_id =
-        GetAXTreeIDFromRenderFrameHost(id.render_frame_host);
+    content_event_bundle.ax_tree_id = id.render_frame_host->GetAXTreeID();
     content_event_bundle.events.resize(1);
     content_event_bundle.events[0].event_type =
         ax::mojom::Event::kMediaStoppedPlaying;
@@ -235,7 +227,7 @@
         return;
 
       content::AXEventNotificationDetails content_event_bundle;
-      content_event_bundle.ax_tree_id = GetAXTreeIDFromRenderFrameHost(rfh);
+      content_event_bundle.ax_tree_id = rfh->GetAXTreeID();
       content_event_bundle.events.resize(1);
       content_event_bundle.events[0].event_type =
           ax::mojom::Event::kMediaStartedPlaying;
@@ -421,6 +413,18 @@
     case api::automation::ACTION_TYPE_SETSCROLLOFFSET:
       return RespondNow(
           Error("Unsupported action: " + params->args.action_type));
+    case api::automation::ACTION_TYPE_GETTEXTLOCATION: {
+      api::automation_internal::GetTextLocationDataParams
+          get_text_location_params;
+      EXTENSION_FUNCTION_VALIDATE(
+          api::automation_internal::GetTextLocationDataParams::Populate(
+              params->opt_args.additional_properties,
+              &get_text_location_params));
+      action->action = ax::mojom::Action::kGetTextLocation;
+      action->start_index = get_text_location_params.start_index;
+      action->end_index = get_text_location_params.end_index;
+      break;
+    }
     case api::automation::ACTION_TYPE_NONE:
       break;
   }
@@ -439,63 +443,55 @@
   ui::AXActionHandler* action_handler = registry->GetActionHandler(
       ui::AXTreeID::FromString(params->args.tree_id));
   if (action_handler) {
-#if defined(USE_AURA)
+    // Handle an AXActionHandler with a rfh first. Some actions require a rfh ->
+    // web contents and this api requires web contents to perform a permissions
+    // check.
+    content::RenderFrameHost* rfh = content::RenderFrameHost::FromAXTreeID(
+        ui::AXTreeID::FromString(params->args.tree_id));
+    if (rfh) {
+      content::WebContents* contents =
+          content::WebContents::FromRenderFrameHost(rfh);
+      if (!CanRequestAutomation(extension(), automation_info, contents)) {
+        return RespondNow(
+            Error(kCannotRequestAutomationOnPage, contents->GetURL().spec()));
+      }
+
+      // Handle internal actions.
+      api::automation_internal::ActionTypePrivate internal_action_type =
+          api::automation_internal::ParseActionTypePrivate(
+              params->args.action_type);
+      content::MediaSession* session = content::MediaSession::Get(contents);
+      switch (internal_action_type) {
+        case api::automation_internal::ACTION_TYPE_PRIVATE_STARTDUCKINGMEDIA:
+          session->StartDucking();
+          return RespondNow(NoArguments());
+        case api::automation_internal::ACTION_TYPE_PRIVATE_STOPDUCKINGMEDIA:
+          session->StopDucking();
+          return RespondNow(NoArguments());
+        case api::automation_internal::ACTION_TYPE_PRIVATE_RESUMEMEDIA:
+          session->Resume(content::MediaSession::SuspendType::kSystem);
+          return RespondNow(NoArguments());
+        case api::automation_internal::ACTION_TYPE_PRIVATE_SUSPENDMEDIA:
+          session->Suspend(content::MediaSession::SuspendType::kSystem);
+          return RespondNow(NoArguments());
+        case api::automation_internal::ACTION_TYPE_PRIVATE_NONE:
+          // Not a private action.
+          break;
+      }
+    }
+
     ui::AXActionData data;
     ExtensionFunction::ResponseAction result =
         ConvertToAXActionData(params.get(), &data);
     action_handler->PerformAction(data);
     return result;
-#else
-    NOTREACHED();
-    return RespondNow(
-        Error("Unexpected action on desktop automation tree;"
-              " platform does not support desktop automation"));
-#endif  // defined(USE_AURA)
   }
-  content::RenderFrameHost* rfh = content::RenderFrameHost::FromAXTreeID(
-      ui::AXTreeID::FromString(params->args.tree_id));
-  if (!rfh)
-    return RespondNow(Error("Ignoring action on destroyed node"));
-
-  content::WebContents* contents =
-      content::WebContents::FromRenderFrameHost(rfh);
-  if (!CanRequestAutomation(extension(), automation_info, contents)) {
-    return RespondNow(
-        Error(kCannotRequestAutomationOnPage, contents->GetURL().spec()));
-  }
-
-  // Handle internal actions.
-  api::automation_internal::ActionTypePrivate internal_action_type =
-      api::automation_internal::ParseActionTypePrivate(
-          params->args.action_type);
-  content::MediaSession* session = content::MediaSession::Get(contents);
-  switch (internal_action_type) {
-    case api::automation_internal::ACTION_TYPE_PRIVATE_STARTDUCKINGMEDIA:
-      session->StartDucking();
-      return RespondNow(NoArguments());
-    case api::automation_internal::ACTION_TYPE_PRIVATE_STOPDUCKINGMEDIA:
-      session->StopDucking();
-      return RespondNow(NoArguments());
-    case api::automation_internal::ACTION_TYPE_PRIVATE_RESUMEMEDIA:
-      session->Resume(content::MediaSession::SuspendType::kSystem);
-      return RespondNow(NoArguments());
-    case api::automation_internal::ACTION_TYPE_PRIVATE_SUSPENDMEDIA:
-      session->Suspend(content::MediaSession::SuspendType::kSystem);
-      return RespondNow(NoArguments());
-    case api::automation_internal::ACTION_TYPE_PRIVATE_NONE:
-      // Not a private action.
-      break;
-  }
-
-  ui::AXActionData data;
-  ExtensionFunction::ResponseAction result =
-      ConvertToAXActionData(params.get(), &data);
-  rfh->AccessibilityPerformAction(data);
-  return result;
+  return RespondNow(Error("Unable to perform action on unknown tree."));
 }
 
 ExtensionFunction::ResponseAction
 AutomationInternalEnableDesktopFunction::Run() {
+#if defined(USE_AURA)
   const AutomationInfo* automation_info = AutomationInfo::Get(extension());
   if (!automation_info || !automation_info->desktop)
     return RespondNow(Error("desktop permission must be requested"));
@@ -504,8 +500,14 @@
   AutomationEventRouter::GetInstance()->RegisterListenerWithDesktopPermission(
       extension_id(), source_process_id());
 
-  AutomationManagerAura::GetInstance()->Enable(browser_context());
-  return RespondNow(NoArguments());
+  AutomationManagerAura::GetInstance()->Enable();
+  ui::AXTreeID ax_tree_id = AutomationManagerAura::GetInstance()->ax_tree_id();
+  return RespondNow(
+      ArgumentList(api::automation_internal::EnableDesktop::Results::Create(
+          ax_tree_id.ToString())));
+#else
+  return RespondNow(Error("getDesktop is unsupported by this platform"));
+#endif  // defined(USE_AURA)
 }
 
 // static
diff --git a/chromecast/browser/ui/aura/accessibility/automation_manager_aura.cc b/chromecast/browser/ui/aura/accessibility/automation_manager_aura.cc
index a82c987c..236c14c 100644
--- a/chromecast/browser/ui/aura/accessibility/automation_manager_aura.cc
+++ b/chromecast/browser/ui/aura/accessibility/automation_manager_aura.cc
@@ -6,18 +6,15 @@
 
 #include <stddef.h>
 
-#include "base/memory/singleton.h"
+#include "base/no_destructor.h"
 #include "build/build_config.h"
 #include "chromecast/browser/accessibility/accessibility_manager.h"
 #include "chromecast/browser/cast_browser_process.h"
-#include "chromecast/browser/extensions/api/automation_internal/automation_event_router.h"
-#include "chromecast/common/extensions_api/cast_extension_messages.h"
-#include "content/public/browser/ax_event_notification_details.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/render_frame_host.h"
-#include "extensions/common/extension_messages.h"
 #include "ui/accessibility/ax_action_data.h"
+#include "ui/accessibility/ax_enum_util.h"
 #include "ui/accessibility/ax_enums.mojom.h"
+#include "ui/accessibility/ax_event.h"
+#include "ui/accessibility/ax_event_bundle_sink.h"
 #include "ui/accessibility/ax_tree_id_registry.h"
 #include "ui/accessibility/platform/aura_window_properties.h"
 #include "ui/aura/env.h"
@@ -25,34 +22,22 @@
 #include "ui/aura/window_tree_host.h"
 #include "ui/views/accessibility/accessibility_alert_window.h"
 #include "ui/views/accessibility/ax_aura_obj_wrapper.h"
+#include "ui/views/accessibility/ax_event_manager.h"
 #include "ui/views/accessibility/ax_root_obj_wrapper.h"
 #include "ui/views/view.h"
 #include "ui/views/widget/widget.h"
 
-using content::BrowserContext;
-using extensions::cast::AutomationEventRouter;
-
-namespace {
-
-// Returns default browser context for sending events in case it was not
-// provided.
-BrowserContext* GetDefaultEventContext() {
-  // TODO(rmrossi) Temporary stub
-  return nullptr;
-}
-
-}  // namespace
-
 // static
 AutomationManagerAura* AutomationManagerAura::GetInstance() {
-  return base::Singleton<AutomationManagerAura>::get();
+  static base::NoDestructor<AutomationManagerAura> instance;
+  return instance.get();
 }
 
-void AutomationManagerAura::Enable(BrowserContext* context) {
+void AutomationManagerAura::Enable() {
   enabled_ = true;
   Reset(false);
 
-  SendEvent(context, current_tree_->GetRoot(), ax::mojom::Event::kLoadComplete);
+  SendEvent(current_tree_->GetRoot(), ax::mojom::Event::kLoadComplete);
   views::AXAuraObjCache::GetInstance()->SetDelegate(this);
 
   aura::Window* active_window =
@@ -63,29 +48,67 @@
   if (active_window) {
     views::AXAuraObjWrapper* focus =
         views::AXAuraObjCache::GetInstance()->GetOrCreate(active_window);
-    SendEvent(context, focus, ax::mojom::Event::kChildrenChanged);
+    SendEvent(focus, ax::mojom::Event::kChildrenChanged);
   }
 }
 
 void AutomationManagerAura::Disable() {
   enabled_ = false;
   Reset(true);
+
+#if defined(OS_CHROMEOS)
+  AXHostService::SetAutomationEnabled(false);
+#endif
 }
 
-void AutomationManagerAura::HandleEvent(BrowserContext* context,
-                                        views::View* view,
+void AutomationManagerAura::OnViewEvent(views::View* view,
                                         ax::mojom::Event event_type) {
+  CHECK(view);
+
   if (!enabled_)
     return;
 
-  views::AXAuraObjWrapper* aura_obj =
-      view ? views::AXAuraObjCache::GetInstance()->GetOrCreate(view)
-           : current_tree_->GetRoot();
-  SendEvent(nullptr, aura_obj, event_type);
+  views::AXAuraObjWrapper* obj =
+      views::AXAuraObjCache::GetInstance()->GetOrCreate(view);
+  if (!obj)
+    return;
+
+  // Ignore toplevel window activate and deactivate events. These are causing
+  // issues with ChromeOS accessibility tests and are currently only used on
+  // desktop Linux platforms.
+  // TODO(https://crbug.com/89717): Need to harmonize the firing of
+  // accessibility events between platforms.
+  if (event_type == ax::mojom::Event::kWindowActivated ||
+      event_type == ax::mojom::Event::kWindowDeactivated) {
+    return;
+  }
+
+  // Post a task to handle the event at the end of the current call stack.
+  // This helps us avoid firing accessibility events for transient changes.
+  // because there's a chance that the underlying object being wrapped could
+  // be deleted, pass the ID of the object rather than the object pointer.
+  int32_t id = obj->GetUniqueId();
+  base::ThreadTaskRunnerHandle::Get()->PostTask(
+      FROM_HERE, base::BindOnce(&AutomationManagerAura::SendEventOnObjectById,
+                                base::Unretained(this), id, event_type));
 }
 
-void AutomationManagerAura::HandleAlert(content::BrowserContext* context,
-                                        const std::string& text) {
+void AutomationManagerAura::HandleEvent(ax::mojom::Event event_type) {
+  views::AXAuraObjWrapper* obj = current_tree_->GetRoot();
+  if (!obj)
+    return;
+
+  AutomationManagerAura::SendEvent(obj, event_type);
+}
+
+void AutomationManagerAura::SendEventOnObjectById(int32_t id,
+                                                  ax::mojom::Event event_type) {
+  views::AXAuraObjWrapper* obj = views::AXAuraObjCache::GetInstance()->Get(id);
+  if (obj)
+    SendEvent(obj, event_type);
+}
+
+void AutomationManagerAura::HandleAlert(const std::string& text) {
   if (alert_window_.get())
     alert_window_->HandleAlert(text);
 }
@@ -104,18 +127,21 @@
   if (!parent)
     parent = current_tree_->GetRoot();
 
-  SendEvent(nullptr, parent, ax::mojom::Event::kChildrenChanged);
+  SendEvent(parent, ax::mojom::Event::kChildrenChanged);
 }
 
 void AutomationManagerAura::OnEvent(views::AXAuraObjWrapper* aura_obj,
                                     ax::mojom::Event event_type) {
-  SendEvent(nullptr, aura_obj, event_type);
+  SendEvent(aura_obj, event_type);
 }
 
 AutomationManagerAura::AutomationManagerAura()
-    : enabled_(false), processing_events_(false) {}
+    : enabled_(false), processing_events_(false) {
+  views::AXEventManager::Get()->AddObserver(this);
+}
 
-AutomationManagerAura::~AutomationManagerAura() {}
+// Never runs because object is leaked.
+AutomationManagerAura::~AutomationManagerAura() = default;
 
 void AutomationManagerAura::Reset(bool reset_serializer) {
   if (!current_tree_) {
@@ -141,14 +167,13 @@
   }
 }
 
-void AutomationManagerAura::SendEvent(BrowserContext* context,
-                                      views::AXAuraObjWrapper* aura_obj,
+void AutomationManagerAura::SendEvent(views::AXAuraObjWrapper* aura_obj,
                                       ax::mojom::Event event_type) {
-  if (!current_tree_serializer_)
+  if (!enabled_)
     return;
 
-  if (!context)
-    context = GetDefaultEventContext();
+  if (!current_tree_serializer_)
+    return;
 
   if (processing_events_) {
     pending_events_.push_back(std::make_pair(aura_obj, event_type));
@@ -156,16 +181,14 @@
   }
   processing_events_ = true;
 
-  ExtensionMsg_AccessibilityEventBundleParams event_bundle;
-  event_bundle.tree_id = ax_tree_id();
-  event_bundle.mouse_location = aura::Env::GetInstance()->last_mouse_location();
-
+  std::vector<ui::AXTreeUpdate> tree_updates;
   ui::AXTreeUpdate update;
   if (!current_tree_serializer_->SerializeChanges(aura_obj, &update)) {
-    LOG(ERROR) << "Unable to serialize one accessibility event.";
+    LOG(ERROR) << "Unable to serialize one accessibility event: "
+               << update.ToString();
     return;
   }
-  event_bundle.updates.push_back(update);
+  tree_updates.push_back(update);
 
   // Make sure the focused node is serialized.
   views::AXAuraObjWrapper* focus =
@@ -173,22 +196,32 @@
   if (focus) {
     ui::AXTreeUpdate focused_node_update;
     current_tree_serializer_->SerializeChanges(focus, &focused_node_update);
-    event_bundle.updates.push_back(focused_node_update);
+    tree_updates.push_back(focused_node_update);
   }
 
-  ui::AXEvent event;
-  event.id = aura_obj->GetUniqueId();
-  event.event_type = event_type;
-  event_bundle.events.push_back(event);
+  std::vector<ui::AXEvent> events;
+  // Fire the event on the node, but only if it's actually in the tree.
+  // Sometimes we get events fired on nodes with an ancestor that's
+  // marked invisible, for example. In those cases we should still
+  // call SerializeChanges (because the change may have affected the
+  // ancestor) but we shouldn't fire the event on the node not in the tree.
+  if (current_tree_serializer_->IsInClientTree(aura_obj)) {
+    ui::AXEvent event;
+    event.id = aura_obj->GetUniqueId();
+    event.event_type = event_type;
+    events.push_back(event);
+  }
 
-  AutomationEventRouter* router = AutomationEventRouter::GetInstance();
-  router->DispatchAccessibilityEvents(event_bundle);
+  if (event_bundle_sink_) {
+    event_bundle_sink_->DispatchAccessibilityEvents(
+        ax_tree_id(), std::move(tree_updates),
+        aura::Env::GetInstance()->last_mouse_location(), std::move(events));
+  }
 
   processing_events_ = false;
   auto pending_events_copy = pending_events_;
   pending_events_.clear();
   for (size_t i = 0; i < pending_events_copy.size(); ++i) {
-    SendEvent(context, pending_events_copy[i].first,
-              pending_events_copy[i].second);
+    SendEvent(pending_events_copy[i].first, pending_events_copy[i].second);
   }
 }
diff --git a/chromecast/browser/ui/aura/accessibility/automation_manager_aura.h b/chromecast/browser/ui/aura/accessibility/automation_manager_aura.h
index a9309b2..064f3ec 100644
--- a/chromecast/browser/ui/aura/accessibility/automation_manager_aura.h
+++ b/chromecast/browser/ui/aura/accessibility/automation_manager_aura.h
@@ -17,17 +17,19 @@
 #include "ui/accessibility/ax_action_handler.h"
 #include "ui/accessibility/ax_tree_serializer.h"
 #include "ui/views/accessibility/ax_aura_obj_cache.h"
+#include "ui/views/accessibility/ax_event_observer.h"
+#include "ui/views/accessibility/ax_tree_source_views.h"
 
 class AXRootObjWrapper;
 
 namespace base {
 template <typename T>
-struct DefaultSingletonTraits;
+class NoDestructor;
 }  // namespace base
 
-namespace content {
-class BrowserContext;
-}  // namespace content
+namespace ui {
+class AXEventBundleSink;
+}
 
 namespace views {
 class AccessibilityAlertWindow;
@@ -40,23 +42,22 @@
 
 // Manages a tree of automation nodes.
 class AutomationManagerAura : public ui::AXActionHandler,
-                              public views::AXAuraObjCache::Delegate {
+                              public views::AXAuraObjCache::Delegate,
+                              public views::AXEventObserver {
  public:
   // Get the single instance of this class.
   static AutomationManagerAura* GetInstance();
 
   // Enable automation support for views.
-  void Enable(content::BrowserContext* context);
+  void Enable();
 
   // Disable automation support for views.
   void Disable();
 
-  // Handle an event fired upon a |View|.
-  void HandleEvent(content::BrowserContext* context,
-                   views::View* view,
-                   ax::mojom::Event event_type);
+  // Handle an event fired upon the root view.
+  void HandleEvent(ax::mojom::Event event_type);
 
-  void HandleAlert(content::BrowserContext* context, const std::string& text);
+  void HandleAlert(const std::string& text);
 
   // AXActionHandler implementation.
   void PerformAction(const ui::AXActionData& data) override;
@@ -66,21 +67,28 @@
   void OnEvent(views::AXAuraObjWrapper* aura_obj,
                ax::mojom::Event event_type) override;
 
- protected:
+  // views::AXEventObserver:
+  void OnViewEvent(views::View* view, ax::mojom::Event event_type) override;
+
+  void set_event_bundle_sink(ui::AXEventBundleSink* sink) {
+    event_bundle_sink_ = sink;
+  }
+
+ private:
+  friend class base::NoDestructor<AutomationManagerAura>;
+
+  FRIEND_TEST_ALL_PREFIXES(AutomationManagerAuraBrowserTest, WebAppearsOnce);
+
   AutomationManagerAura();
   ~AutomationManagerAura() override;
 
- private:
-  friend struct base::DefaultSingletonTraits<AutomationManagerAura>;
-
-  FRIEND_TEST_ALL_PREFIXES(AutomationManagerAuraBrowserTest, WebAppearsOnce);
+  void SendEventOnObjectById(int32_t id, ax::mojom::Event event_type);
 
   // Reset state in this manager. If |reset_serializer| is true, reset the
   // serializer to save memory.
   void Reset(bool reset_serializer);
 
-  void SendEvent(content::BrowserContext* context,
-                 views::AXAuraObjWrapper* aura_obj,
+  void SendEvent(views::AXAuraObjWrapper* aura_obj,
                  ax::mojom::Event event_type);
 
   // Whether automation support for views is enabled.
@@ -103,6 +111,10 @@
   std::vector<std::pair<views::AXAuraObjWrapper*, ax::mojom::Event>>
       pending_events_;
 
+  // The handler for AXEvents (e.g. the extensions subsystem in production, or
+  // a fake for tests).
+  ui::AXEventBundleSink* event_bundle_sink_ = nullptr;
+
   std::unique_ptr<views::AccessibilityAlertWindow> alert_window_;
 
   DISALLOW_COPY_AND_ASSIGN(AutomationManagerAura);
diff --git a/chromecast/common/extensions_api/automation.idl b/chromecast/common/extensions_api/automation.idl
index 85672020a..d684388 100644
--- a/chromecast/common/extensions_api/automation.idl
+++ b/chromecast/common/extensions_api/automation.idl
@@ -191,6 +191,7 @@
     list,
     listBox,
     listBoxOption,
+    listGrid,  // Native
     listItem,
     listMarker,
     log,
@@ -291,6 +292,7 @@
     doDefault,
     focus,
     getImageData,
+    getTextLocation,
     hitTest,
     increment,
     loadInlineTextBoxes,
@@ -489,6 +491,8 @@
   // Callback called for actions with a response.
   callback PerformActionCallback = void(boolean result);
   callback PerformActionCallbackWithNode = void(AutomationNode node);
+  callback BoundsForRangeCallback = void(Rect bounds);
+
 
   dictionary CustomAction {
     long id;
@@ -515,11 +519,12 @@
     // screen coordinates.
     Rect? location;
 
-    // Computes the bounding box of a subrange of this node in global screen
-    // coordinates. Returns the same as |location| if range information
-    // is not available. The start and end indices are zero-based offsets
-    // into the node's "name" string attribute.
-    static Rect boundsForRange(long startIndex, long endIndex);
+    // Determines the location of the text within the node specified by
+    // |startIndex| and |endIndex|, inclusively. Invokes |callback| with the
+    // bounding rectangle, in screen coordinates. |callback| can be invoked
+    // either synchronously or asynchronously.
+    static void boundsForRange(long startIndex, long endIndex,
+        BoundsForRangeCallback callback);
 
     // The location (as a bounding box) of this node in global screen
     // coordinates without applying any clipping from ancestors.
diff --git a/chromecast/common/extensions_api/automation_internal.idl b/chromecast/common/extensions_api/automation_internal.idl
index 115a045..084f0576 100644
--- a/chromecast/common/extensions_api/automation_internal.idl
+++ b/chromecast/common/extensions_api/automation_internal.idl
@@ -31,6 +31,17 @@
     long actionRequestID;
   };
 
+  dictionary AXTextLocationParams {
+    DOMString treeID;
+    long nodeID;
+    boolean result;
+    long left;
+    long top;
+    long width;
+    long height;
+    long requestID;
+  };
+
   // Actions internally used by automation.
   enum ActionTypePrivate {
     resumeMedia,
@@ -101,12 +112,19 @@
     DOMString eventToFire;
   };
 
+  // Arguments for getTextLocation action.
+  dictionary GetTextLocationDataParams {
+    long startIndex;
+    long endIndex;
+  };
+
   // Returns the accessibility tree id of the web contents who's accessibility
   // was enabled using enableTab().
   callback EnableTabCallback = void(DOMString tree_id);
 
-  // Callback called when enableDesktop() returns.
-  callback EnableDesktopCallback = void();
+  // Callback called when enableDesktop() returns. Returns the accessibility
+  // tree id of the desktop tree.
+  callback EnableDesktopCallback = void(DOMString tree_id);
 
   // Callback called when querySelector() returns.
   callback QuerySelectorCallback = void(long resultAutomationNodeID);
@@ -139,6 +157,8 @@
 
     static void onAccessibilityTreeDestroyed(DOMString treeID);
 
+    static void onGetTextLocationResult(AXTextLocationParams params);
+
     static void onTreeChange(long observerID,
                              DOMString treeID,
                              long nodeID,
diff --git a/chromecast/renderer/BUILD.gn b/chromecast/renderer/BUILD.gn
index fd3e68b..3678bd2 100644
--- a/chromecast/renderer/BUILD.gn
+++ b/chromecast/renderer/BUILD.gn
@@ -84,6 +84,10 @@
       "extensions/automation_ax_tree_wrapper.h",
       "extensions/automation_internal_custom_bindings.cc",
       "extensions/automation_internal_custom_bindings.h",
+      "extensions/extension_hooks_delegate.cc",
+      "extensions/extension_hooks_delegate.h",
+      "extensions/tabs_hooks_delegate.cc",
+      "extensions/tabs_hooks_delegate.h",
     ]
 
     deps += [
diff --git a/chromecast/renderer/cast_extensions_dispatcher_delegate.cc b/chromecast/renderer/cast_extensions_dispatcher_delegate.cc
index 664aff30..d2c516e 100644
--- a/chromecast/renderer/cast_extensions_dispatcher_delegate.cc
+++ b/chromecast/renderer/cast_extensions_dispatcher_delegate.cc
@@ -10,8 +10,10 @@
 #include "base/feature_list.h"
 #include "base/sha1.h"
 #include "base/strings/string_number_conversions.h"
-#include "chromecast/renderer/grit/extensions_renderer_resources.h"
 #include "chromecast/renderer/extensions/automation_internal_custom_bindings.h"
+#include "chromecast/renderer/extensions/extension_hooks_delegate.h"
+#include "chromecast/renderer/extensions/tabs_hooks_delegate.h"
+#include "chromecast/renderer/grit/extensions_renderer_resources.h"
 #include "components/version_info/version_info.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/renderer/render_thread.h"
@@ -24,6 +26,7 @@
 #include "extensions/common/permissions/permission_set.h"
 #include "extensions/common/permissions/permissions_data.h"
 #include "extensions/common/switches.h"
+#include "extensions/renderer/bindings/api_binding_hooks.h"
 #include "extensions/renderer/bindings/api_bindings_system.h"
 #include "extensions/renderer/css_native_handler.h"
 #include "extensions/renderer/dispatcher.h"
@@ -82,5 +85,11 @@
     extensions::Dispatcher* dispatcher,
     extensions::NativeExtensionBindingsSystem* bindings_system) {
   DCHECK(base::FeatureList::IsEnabled(extensions_features::kNativeCrxBindings));
-  // TODO(rmrossi): Stub
+  extensions::APIBindingsSystem* bindings = bindings_system->api_system();
+  bindings->GetHooksForAPI("extension")
+      ->SetDelegate(std::make_unique<extensions::ExtensionHooksDelegate>(
+          bindings_system->messaging_service()));
+  bindings->GetHooksForAPI("tabs")->SetDelegate(
+      std::make_unique<extensions::TabsHooksDelegate>(
+          bindings_system->messaging_service()));
 }
diff --git a/chromecast/renderer/extensions/automation_internal_custom_bindings.cc b/chromecast/renderer/extensions/automation_internal_custom_bindings.cc
index ba0d9ce..e6a5cfd 100644
--- a/chromecast/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chromecast/renderer/extensions/automation_internal_custom_bindings.cc
@@ -7,7 +7,11 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <algorithm>
 #include <memory>
+#include <set>
+#include <string>
+#include <utility>
 
 #include "base/bind.h"
 #include "base/i18n/string_search.h"
@@ -704,10 +708,8 @@
       [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
          AutomationAXTreeWrapper* tree_wrapper, ui::AXNode* node, int start,
          int end) {
-        if (node->data().role != ax::mojom::Role::kInlineTextBox) {
-          gfx::Rect global_bounds = ComputeGlobalNodeBounds(tree_wrapper, node);
-          result.Set(RectToV8Object(isolate, global_bounds));
-        }
+        if (node->data().role != ax::mojom::Role::kInlineTextBox)
+          return;
 
         // Use character offsets to compute the local bounds of this subrange.
         gfx::RectF local_bounds(0, 0,
@@ -811,8 +813,18 @@
         ax::mojom::IntAttribute attribute =
             ui::ParseIntAttribute(attribute_name.c_str());
         int attr_value;
-        if (!node->data().GetIntAttribute(attribute, &attr_value))
+
+        if (attribute == ax::mojom::IntAttribute::kPosInSet) {
+          attr_value = node->GetPosInSet();
+          if (attr_value == 0)
+            return;
+        } else if (attribute == ax::mojom::IntAttribute::kSetSize) {
+          attr_value = node->GetSetSize();
+          if (attr_value == 0)
+            return;
+        } else if (!node->data().GetIntAttribute(attribute, &attr_value)) {
           return;
+        }
 
         result.Set(v8::Integer::New(isolate, attr_value));
       });
@@ -1134,6 +1146,16 @@
                             v8::Integer::New(isolate, row_headers[i]));
         result.Set(array_result);
       });
+  RouteNodeIDFunction(
+      "GetTableCellColumnIndex",
+      [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
+         AutomationAXTreeWrapper* tree_wrapper,
+         ui::AXNode* node) { result.Set(node->GetTableCellColIndex()); });
+  RouteNodeIDFunction(
+      "GetTableCellRowIndex",
+      [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
+         AutomationAXTreeWrapper* tree_wrapper,
+         ui::AXNode* node) { result.Set(node->GetTableCellRowIndex()); });
 }
 
 void AutomationInternalCustomBindings::Invalidate() {
@@ -1148,7 +1170,7 @@
 // http://crbug.com/784266
 // clang-format off
 void AutomationInternalCustomBindings::OnMessageReceived(
-    const IPC::Message& message){
+    const IPC::Message& message) {
   IPC_BEGIN_MESSAGE_MAP(AutomationInternalCustomBindings, message)
     IPC_MESSAGE_HANDLER(ExtensionMsg_AccessibilityEventBundle,
                         OnAccessibilityEvents)
@@ -1335,7 +1357,6 @@
     ThrowInvalidArgumentsException(this);
     return;
   }
-
   ui::AXTreeID tree_id = ui::AXTreeID::FromString(
       *v8::String::Utf8Value(args.GetIsolate(), args[0]));
   AutomationAXTreeWrapper* tree_wrapper =
diff --git a/chromecast/renderer/extensions/extension_hooks_delegate.cc b/chromecast/renderer/extensions/extension_hooks_delegate.cc
new file mode 100644
index 0000000..3b01827
--- /dev/null
+++ b/chromecast/renderer/extensions/extension_hooks_delegate.cc
@@ -0,0 +1,338 @@
+// Copyright 2019 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 "chromecast/renderer/extensions/extension_hooks_delegate.h"
+
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "content/public/renderer/v8_value_converter.h"
+#include "extensions/common/api/messaging/message.h"
+#include "extensions/common/constants.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest.h"
+#include "extensions/common/view_type.h"
+#include "extensions/renderer/bindings/api_signature.h"
+#include "extensions/renderer/extension_frame_helper.h"
+#include "extensions/renderer/extensions_renderer_client.h"
+#include "extensions/renderer/get_script_context.h"
+#include "extensions/renderer/message_target.h"
+#include "extensions/renderer/messaging_util.h"
+#include "extensions/renderer/native_renderer_messaging_service.h"
+#include "extensions/renderer/script_context.h"
+#include "gin/converter.h"
+#include "gin/dictionary.h"
+
+namespace extensions {
+
+namespace {
+
+using RequestResult = APIBindingHooks::RequestResult;
+
+constexpr char kSendExtensionRequest[] = "extension.sendRequest";
+constexpr char kGetURL[] = "extension.getURL";
+constexpr char kGetBackgroundPage[] = "extension.getBackgroundPage";
+constexpr char kGetViews[] = "extension.getViews";
+constexpr char kGetExtensionTabs[] = "extension.getExtensionTabs";
+
+// We alias a bunch of chrome.extension APIs to their chrome.runtime
+// counterparts.
+// NOTE(devlin): This is a very simple alias, in which we just return the
+// runtime version from the chrome.runtime object. This is important to note
+// for a few reasons:
+// - Modifications to the chrome.runtime object will affect the return result
+//   here. i.e., if script does chrome.runtime.sendMessage = 'some string',
+//   then chrome.extension.sendMessage will also be 'some string'.
+// - Events will share listeners. i.e., a listener added to
+//   chrome.extension.onMessage will fire from a runtime.onMessage event, and
+//   vice versa.
+// All of these APIs have been deprecated, and are no longer even documented,
+// but still have usage. This is the cheap workaround that JS bindings have been
+// using, and, while not robust, it should be secure, so use it native bindings,
+// too.
+void GetAliasedFeature(v8::Local<v8::Name> property_name,
+                       const v8::PropertyCallbackInfo<v8::Value>& info) {
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::HandleScope handle_scope(isolate);
+  v8::Local<v8::Context> context = info.Holder()->CreationContext();
+
+  v8::TryCatch try_catch(isolate);
+  v8::Local<v8::Value> chrome;
+  if (!context->Global()
+           ->Get(context, gin::StringToSymbol(isolate, "chrome"))
+           .ToLocal(&chrome) ||
+      !chrome->IsObject()) {
+    return;
+  }
+
+  v8::Local<v8::Value> runtime;
+  if (!chrome.As<v8::Object>()
+           ->Get(context, gin::StringToSymbol(isolate, "runtime"))
+           .ToLocal(&runtime) ||
+      !runtime->IsObject()) {
+    return;
+  }
+
+  v8::Local<v8::Object> runtime_obj = runtime.As<v8::Object>();
+  v8::Maybe<bool> has_property =
+      runtime_obj->HasRealNamedProperty(context, property_name);
+  if (!has_property.IsJust() || !has_property.FromJust())
+    return;
+
+  info.GetReturnValue().Set(
+      runtime_obj->Get(context, property_name).ToLocalChecked());
+}
+
+// A helper method to throw a deprecation error on access.
+void ThrowDeprecatedAccessError(
+    v8::Local<v8::Name> name,
+    const v8::PropertyCallbackInfo<v8::Value>& info) {
+  static constexpr char kError[] =
+      "extension.sendRequest, extension.onRequest, and "
+      "extension.onRequestExternal are deprecated. Please use "
+      "runtime.sendMessage, runtime.onMessage, and runtime.onMessageExternal "
+      "instead.";
+  v8::Isolate* isolate = info.GetIsolate();
+  isolate->ThrowException(
+      v8::Exception::Error(gin::StringToV8(isolate, kError)));
+}
+
+}  // namespace
+
+ExtensionHooksDelegate::ExtensionHooksDelegate(
+    NativeRendererMessagingService* messaging_service)
+    : messaging_service_(messaging_service) {}
+ExtensionHooksDelegate::~ExtensionHooksDelegate() {}
+
+RequestResult ExtensionHooksDelegate::HandleRequest(
+    const std::string& method_name,
+    const APISignature* signature,
+    v8::Local<v8::Context> context,
+    std::vector<v8::Local<v8::Value>>* arguments,
+    const APITypeReferenceMap& refs) {
+  // TODO(devlin): This logic is the same in the RuntimeCustomHooksDelegate -
+  // would it make sense to share it?
+  using Handler = RequestResult (ExtensionHooksDelegate::*)(
+      ScriptContext*, const std::vector<v8::Local<v8::Value>>&);
+  static struct {
+    Handler handler;
+    base::StringPiece method;
+  } kHandlers[] = {
+      {&ExtensionHooksDelegate::HandleSendRequest, kSendExtensionRequest},
+      {&ExtensionHooksDelegate::HandleGetURL, kGetURL},
+      {&ExtensionHooksDelegate::HandleGetBackgroundPage, kGetBackgroundPage},
+      {&ExtensionHooksDelegate::HandleGetExtensionTabs, kGetExtensionTabs},
+      {&ExtensionHooksDelegate::HandleGetViews, kGetViews},
+  };
+
+  ScriptContext* script_context = GetScriptContextFromV8ContextChecked(context);
+
+  Handler handler = nullptr;
+  for (const auto& handler_entry : kHandlers) {
+    if (handler_entry.method == method_name) {
+      handler = handler_entry.handler;
+      break;
+    }
+  }
+
+  if (!handler)
+    return RequestResult(RequestResult::NOT_HANDLED);
+
+  if (method_name == kSendExtensionRequest) {
+    messaging_util::MassageSendMessageArguments(context->GetIsolate(), false,
+                                                arguments);
+  }
+
+  std::string error;
+  std::vector<v8::Local<v8::Value>> parsed_arguments;
+  if (!signature->ParseArgumentsToV8(context, *arguments, refs,
+                                     &parsed_arguments, &error)) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  return (this->*handler)(script_context, parsed_arguments);
+}
+
+void ExtensionHooksDelegate::InitializeTemplate(
+    v8::Isolate* isolate,
+    v8::Local<v8::ObjectTemplate> object_template,
+    const APITypeReferenceMap& type_refs) {
+  static constexpr const char* kAliases[] = {
+      "connect",   "connectNative",     "sendMessage", "sendNativeMessage",
+      "onConnect", "onConnectExternal", "onMessage",   "onMessageExternal",
+  };
+
+  for (const auto* alias : kAliases) {
+    object_template->SetAccessor(gin::StringToSymbol(isolate, alias),
+                                 &GetAliasedFeature);
+  }
+
+  bool is_incognito = ExtensionsRendererClient::Get()->IsIncognitoProcess();
+  object_template->Set(isolate, "inIncognitoContext",
+                       v8::Boolean::New(isolate, is_incognito));
+}
+
+void ExtensionHooksDelegate::InitializeInstance(
+    v8::Local<v8::Context> context,
+    v8::Local<v8::Object> instance) {
+  // Throw access errors for deprecated sendRequest-related properties. This
+  // isn't terribly efficient, but is only done for certain unpacked extensions
+  // and only if they access the chrome.extension module.
+  if (messaging_util::IsSendRequestDisabled(
+          GetScriptContextFromV8ContextChecked(context))) {
+    static constexpr const char* kDeprecatedSendRequestProperties[] = {
+        "sendRequest", "onRequest", "onRequestExternal"};
+    for (const char* property : kDeprecatedSendRequestProperties) {
+      v8::Maybe<bool> success = instance->SetAccessor(
+          context, gin::StringToV8(context->GetIsolate(), property),
+          &ThrowDeprecatedAccessError);
+      DCHECK(success.IsJust());
+      DCHECK(success.FromJust());
+    }
+  }
+}
+
+RequestResult ExtensionHooksDelegate::HandleSendRequest(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  DCHECK_EQ(3u, arguments.size());
+  // This DCHECK() is correct because no context with sendRequest-related
+  // APIs disabled should have scriptable access to a context with them
+  // enabled.
+  DCHECK(!messaging_util::IsSendRequestDisabled(script_context));
+
+  std::string target_id;
+  std::string error;
+  if (!messaging_util::GetTargetExtensionId(script_context, arguments[0],
+                                            "extension.sendRequest", &target_id,
+                                            &error)) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  v8::Local<v8::Value> v8_message = arguments[1];
+  std::unique_ptr<Message> message = messaging_util::MessageFromV8(
+      script_context->v8_context(), v8_message, &error);
+  if (!message) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  v8::Local<v8::Function> response_callback;
+  if (!arguments[2]->IsNull())
+    response_callback = arguments[2].As<v8::Function>();
+
+  messaging_service_->SendOneTimeMessage(
+      script_context, MessageTarget::ForExtension(target_id),
+      messaging_util::kSendRequestChannel, false, *message, response_callback);
+
+  return RequestResult(RequestResult::HANDLED);
+}
+
+RequestResult ExtensionHooksDelegate::HandleGetURL(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  DCHECK_EQ(1u, arguments.size());
+  DCHECK(arguments[0]->IsString());
+  DCHECK(script_context->extension());
+
+  std::string path = gin::V8ToString(script_context->isolate(), arguments[0]);
+
+  RequestResult result(RequestResult::HANDLED);
+  result.return_value =
+      gin::StringToV8(script_context->isolate(),
+                      script_context->extension()->GetResourceURL(path).spec());
+  return result;
+}
+
+APIBindingHooks::RequestResult ExtensionHooksDelegate::HandleGetViews(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  const Extension* extension = script_context->extension();
+  DCHECK(extension);
+
+  ViewType view_type = VIEW_TYPE_INVALID;
+  int window_id = extension_misc::kUnknownWindowId;
+  int tab_id = extension_misc::kUnknownTabId;
+
+  if (!arguments[0]->IsNull()) {
+    gin::Dictionary options_dict(script_context->isolate(),
+                                 arguments[0].As<v8::Object>());
+    v8::Local<v8::Value> v8_window_id;
+    v8::Local<v8::Value> v8_tab_id;
+    v8::Local<v8::Value> v8_view_type;
+    if (!options_dict.Get("windowId", &v8_window_id) ||
+        !options_dict.Get("tabId", &v8_tab_id) ||
+        !options_dict.Get("type", &v8_view_type)) {
+      NOTREACHED()
+          << "Unexpected exception: argument parsing produces plain objects";
+      return RequestResult(RequestResult::THROWN);
+    }
+
+    if (!v8_window_id->IsUndefined()) {
+      DCHECK(v8_window_id->IsInt32());
+      window_id = v8_window_id.As<v8::Int32>()->Value();
+    }
+
+    if (!v8_tab_id->IsUndefined()) {
+      DCHECK(v8_tab_id->IsInt32());
+      tab_id = v8_tab_id.As<v8::Int32>()->Value();
+    }
+
+    if (!v8_view_type->IsUndefined()) {
+      DCHECK(v8_view_type->IsString());
+      std::string view_type_string = base::ToUpperASCII(
+          gin::V8ToString(script_context->isolate(), v8_view_type));
+      if (view_type_string != "ALL") {
+        bool success = GetViewTypeFromString(view_type_string, &view_type);
+        DCHECK(success);
+      }
+    }
+  }
+
+  RequestResult result(RequestResult::HANDLED);
+  result.return_value = ExtensionFrameHelper::GetV8MainFrames(
+      script_context->v8_context(), extension->id(), window_id, tab_id,
+      view_type);
+  return result;
+}
+
+RequestResult ExtensionHooksDelegate::HandleGetExtensionTabs(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  const Extension* extension = script_context->extension();
+  DCHECK(extension);
+
+  ViewType view_type = VIEW_TYPE_TAB_CONTENTS;
+  int window_id = extension_misc::kUnknownWindowId;
+  int tab_id = extension_misc::kUnknownTabId;
+
+  if (!arguments[0]->IsNull())
+    window_id = arguments[0].As<v8::Int32>()->Value();
+
+  RequestResult result(RequestResult::HANDLED);
+  result.return_value = ExtensionFrameHelper::GetV8MainFrames(
+      script_context->v8_context(), extension->id(), window_id, tab_id,
+      view_type);
+  return result;
+}
+
+RequestResult ExtensionHooksDelegate::HandleGetBackgroundPage(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  const Extension* extension = script_context->extension();
+  DCHECK(extension);
+
+  RequestResult result(RequestResult::HANDLED);
+  result.return_value = ExtensionFrameHelper::GetV8BackgroundPageMainFrame(
+      script_context->isolate(), extension->id());
+  return result;
+}
+
+}  // namespace extensions
diff --git a/chromecast/renderer/extensions/extension_hooks_delegate.h b/chromecast/renderer/extensions/extension_hooks_delegate.h
new file mode 100644
index 0000000..bb285ab
--- /dev/null
+++ b/chromecast/renderer/extensions/extension_hooks_delegate.h
@@ -0,0 +1,66 @@
+// Copyright 2019 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 CHROMECAST_RENDERER_EXTENSIONS_EXTENSION_HOOKS_DELEGATE_H_
+#define CHROMECAST_RENDERER_EXTENSIONS_EXTENSION_HOOKS_DELEGATE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "extensions/renderer/bindings/api_binding_hooks_delegate.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+class NativeRendererMessagingService;
+class ScriptContext;
+
+// The custom hooks for the chrome.extension API.
+class ExtensionHooksDelegate : public APIBindingHooksDelegate {
+ public:
+  explicit ExtensionHooksDelegate(
+      NativeRendererMessagingService* messaging_service);
+  ~ExtensionHooksDelegate() override;
+
+  // APIBindingHooksDelegate:
+  APIBindingHooks::RequestResult HandleRequest(
+      const std::string& method_name,
+      const APISignature* signature,
+      v8::Local<v8::Context> context,
+      std::vector<v8::Local<v8::Value>>* arguments,
+      const APITypeReferenceMap& refs) override;
+  void InitializeTemplate(v8::Isolate* isolate,
+                          v8::Local<v8::ObjectTemplate> object_template,
+                          const APITypeReferenceMap& type_refs) override;
+  void InitializeInstance(v8::Local<v8::Context> context,
+                          v8::Local<v8::Object> instance) override;
+
+ private:
+  // Request handlers for the corresponding API methods.
+  APIBindingHooks::RequestResult HandleSendRequest(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleGetURL(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleGetViews(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleGetExtensionTabs(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleGetBackgroundPage(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+
+  // The messaging service to handle messaging calls.
+  // Guaranteed to outlive this object.
+  NativeRendererMessagingService* const messaging_service_;
+
+  DISALLOW_COPY_AND_ASSIGN(ExtensionHooksDelegate);
+};
+
+}  // namespace extensions
+
+#endif  // CHROMECAST_RENDERER_EXTENSIONS_EXTENSION_HOOKS_DELEGATE_H_
diff --git a/chromecast/renderer/extensions/tabs_hooks_delegate.cc b/chromecast/renderer/extensions/tabs_hooks_delegate.cc
new file mode 100644
index 0000000..e5f77423
--- /dev/null
+++ b/chromecast/renderer/extensions/tabs_hooks_delegate.cc
@@ -0,0 +1,171 @@
+// Copyright 2019 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 "chromecast/renderer/extensions/tabs_hooks_delegate.h"
+
+#include <string>
+#include <memory>
+#include <utility>
+
+#include "base/strings/stringprintf.h"
+#include "content/public/renderer/v8_value_converter.h"
+#include "extensions/common/api/messaging/message.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest.h"
+#include "extensions/renderer/bindings/api_signature.h"
+#include "extensions/renderer/get_script_context.h"
+#include "extensions/renderer/message_target.h"
+#include "extensions/renderer/messaging_util.h"
+#include "extensions/renderer/native_renderer_messaging_service.h"
+#include "extensions/renderer/script_context.h"
+#include "gin/converter.h"
+
+namespace extensions {
+
+namespace {
+
+using RequestResult = APIBindingHooks::RequestResult;
+
+constexpr char kConnect[] = "tabs.connect";
+constexpr char kSendMessage[] = "tabs.sendMessage";
+constexpr char kSendTabsRequest[] = "tabs.sendRequest";
+
+}  // namespace
+
+TabsHooksDelegate::TabsHooksDelegate(
+    NativeRendererMessagingService* messaging_service)
+    : messaging_service_(messaging_service) {}
+TabsHooksDelegate::~TabsHooksDelegate() {}
+
+RequestResult TabsHooksDelegate::HandleRequest(
+    const std::string& method_name,
+    const APISignature* signature,
+    v8::Local<v8::Context> context,
+    std::vector<v8::Local<v8::Value>>* arguments,
+    const APITypeReferenceMap& refs) {
+  // TODO(devlin): This logic is the same in the RuntimeCustomHooksDelegate -
+  // would it make sense to share it?
+  using Handler = RequestResult (TabsHooksDelegate::*)(
+      ScriptContext*, const std::vector<v8::Local<v8::Value>>&);
+  static const struct {
+    Handler handler;
+    base::StringPiece method;
+  } kHandlers[] = {
+      {&TabsHooksDelegate::HandleSendMessage, kSendMessage},
+      {&TabsHooksDelegate::HandleSendRequest, kSendTabsRequest},
+      {&TabsHooksDelegate::HandleConnect, kConnect},
+  };
+
+  ScriptContext* script_context = GetScriptContextFromV8ContextChecked(context);
+
+  Handler handler = nullptr;
+  for (const auto& handler_entry : kHandlers) {
+    if (handler_entry.method == method_name) {
+      handler = handler_entry.handler;
+      break;
+    }
+  }
+
+  if (!handler)
+    return RequestResult(RequestResult::NOT_HANDLED);
+
+  std::string error;
+  std::vector<v8::Local<v8::Value>> parsed_arguments;
+  if (!signature->ParseArgumentsToV8(context, *arguments, refs,
+                                     &parsed_arguments, &error)) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  return (this->*handler)(script_context, parsed_arguments);
+}
+
+RequestResult TabsHooksDelegate::HandleSendRequest(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  DCHECK_EQ(3u, arguments.size());
+
+  int tab_id = messaging_util::ExtractIntegerId(arguments[0]);
+  v8::Local<v8::Value> v8_message = arguments[1];
+  std::string error;
+  std::unique_ptr<Message> message = messaging_util::MessageFromV8(
+      script_context->v8_context(), v8_message, &error);
+  if (!message) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  v8::Local<v8::Function> response_callback;
+  if (!arguments[2]->IsNull())
+    response_callback = arguments[2].As<v8::Function>();
+
+  messaging_service_->SendOneTimeMessage(
+      script_context, MessageTarget::ForTab(tab_id, messaging_util::kNoFrameId),
+      messaging_util::kSendRequestChannel, false, *message, response_callback);
+
+  return RequestResult(RequestResult::HANDLED);
+}
+
+RequestResult TabsHooksDelegate::HandleSendMessage(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  DCHECK_EQ(4u, arguments.size());
+
+  int tab_id = messaging_util::ExtractIntegerId(arguments[0]);
+  messaging_util::MessageOptions options;
+  if (!arguments[2]->IsNull()) {
+    options = messaging_util::ParseMessageOptions(
+        script_context->v8_context(), arguments[2].As<v8::Object>(),
+        messaging_util::PARSE_FRAME_ID);
+  }
+
+  v8::Local<v8::Value> v8_message = arguments[1];
+  DCHECK(!v8_message.IsEmpty());
+  std::string error;
+  std::unique_ptr<Message> message = messaging_util::MessageFromV8(
+      script_context->v8_context(), v8_message, &error);
+  if (!message) {
+    RequestResult result(RequestResult::INVALID_INVOCATION);
+    result.error = std::move(error);
+    return result;
+  }
+
+  v8::Local<v8::Function> response_callback;
+  if (!arguments[3]->IsNull())
+    response_callback = arguments[3].As<v8::Function>();
+
+  messaging_service_->SendOneTimeMessage(
+      script_context, MessageTarget::ForTab(tab_id, options.frame_id),
+      messaging_util::kSendMessageChannel, false, *message, response_callback);
+
+  return RequestResult(RequestResult::HANDLED);
+}
+
+RequestResult TabsHooksDelegate::HandleConnect(
+    ScriptContext* script_context,
+    const std::vector<v8::Local<v8::Value>>& arguments) {
+  DCHECK_EQ(2u, arguments.size());
+
+  int tab_id = messaging_util::ExtractIntegerId(arguments[0]);
+
+  messaging_util::MessageOptions options;
+  if (!arguments[1]->IsNull()) {
+    options = messaging_util::ParseMessageOptions(
+        script_context->v8_context(), arguments[1].As<v8::Object>(),
+        messaging_util::PARSE_FRAME_ID | messaging_util::PARSE_CHANNEL_NAME);
+  }
+
+  gin::Handle<GinPort> port = messaging_service_->Connect(
+      script_context, MessageTarget::ForTab(tab_id, options.frame_id),
+      options.channel_name, false);
+  DCHECK(!port.IsEmpty());
+
+  RequestResult result(RequestResult::HANDLED);
+  result.return_value = port.ToV8();
+  return result;
+}
+
+}  // namespace extensions
diff --git a/chromecast/renderer/extensions/tabs_hooks_delegate.h b/chromecast/renderer/extensions/tabs_hooks_delegate.h
new file mode 100644
index 0000000..89a2423
--- /dev/null
+++ b/chromecast/renderer/extensions/tabs_hooks_delegate.h
@@ -0,0 +1,54 @@
+// Copyright 2019 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 CHROMECAST_RENDERER_EXTENSIONS_TABS_HOOKS_DELEGATE_H_
+#define CHROMECAST_RENDERER_EXTENSIONS_TABS_HOOKS_DELEGATE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "extensions/renderer/bindings/api_binding_hooks_delegate.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+class NativeRendererMessagingService;
+class ScriptContext;
+
+// The custom hooks for the tabs API.
+class TabsHooksDelegate : public APIBindingHooksDelegate {
+ public:
+  explicit TabsHooksDelegate(NativeRendererMessagingService* messaging_service);
+  ~TabsHooksDelegate() override;
+
+  // APIBindingHooksDelegate:
+  APIBindingHooks::RequestResult HandleRequest(
+      const std::string& method_name,
+      const APISignature* signature,
+      v8::Local<v8::Context> context,
+      std::vector<v8::Local<v8::Value>>* arguments,
+      const APITypeReferenceMap& refs) override;
+
+ private:
+  // Request handlers for the corresponding API methods.
+  APIBindingHooks::RequestResult HandleSendRequest(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleSendMessage(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+  APIBindingHooks::RequestResult HandleConnect(
+      ScriptContext* script_context,
+      const std::vector<v8::Local<v8::Value>>& arguments);
+
+  // The messaging service to handle connect() and sendMessage() calls.
+  // Guaranteed to outlive this object.
+  NativeRendererMessagingService* const messaging_service_;
+
+  DISALLOW_COPY_AND_ASSIGN(TabsHooksDelegate);
+};
+
+}  // namespace extensions
+
+#endif  // CHROMECAST_RENDERER_EXTENSIONS_TABS_HOOKS_DELEGATE_H_
diff --git a/chromecast/renderer/resources/extensions/automation/automation_node.js b/chromecast/renderer/resources/extensions/automation/automation_node.js
index b969a268..ea9f407 100644
--- a/chromecast/renderer/resources/extensions/automation/automation_node.js
+++ b/chromecast/renderer/resources/extensions/automation/automation_node.js
@@ -179,6 +179,18 @@
 var GetBoundsForRange = natives.GetBoundsForRange;
 
 /**
+ * @param {number} left The left location of the text range.
+ * @param {number} top The top location of the text range.
+ * @param {number} width The width of text range.
+ * @param {number} height The height of the text range.
+ * @param {number} requestID The request id associated with the query
+ *    for this range.
+ * @return {?automation.Rect} The bounding box of the subrange of this node,
+ *     specified by arguments provided to the function.
+ */
+var ComputeGlobalBounds = natives.ComputeGlobalBounds;
+
+/**
  * @param {string} axTreeID The id of the accessibility tree.
  * @param {number} nodeID The id of a node.
  * @return {?automation.Rect} The unclipped location of the node, or
@@ -354,6 +366,20 @@
  */
 var GetTableCellRowHeaders = natives.GetTableCellRowHeaders;
 
+/**
+ * @param {string} axTreeID The id of the accessibility tree.
+ * @param {number} nodeID The id of a node.
+ * @return {number} Column index for this cell.
+ */
+var GetTableCellColumnIndex = natives.GetTableCellColumnIndex;
+
+/**
+ * @param {string} axTreeID The id of the accessibility tree.
+ * @param {number} nodeID The id of a node.
+ * @return {number} Row index for this cell.
+ */
+var GetTableCellRowIndex = natives.GetTableCellRowIndex;
+
 var logging = requireNative('logging');
 var utils = require('utils');
 
@@ -369,7 +395,7 @@
 
 AutomationNodeImpl.prototype = {
   __proto__: null,
-  treeID: "",
+  treeID: '',
   id: -1,
   isRootNode: false,
 
@@ -413,8 +439,33 @@
     return GetLocation(this.treeID, this.id);
   },
 
-  boundsForRange: function(startIndex, endIndex) {
-    return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex);
+  boundsForRange: function(startIndex, endIndex, callback) {
+    if (!this.rootImpl)
+      return;
+
+    // Not yet initialized.
+    if (this.rootImpl.treeID === undefined || this.id === undefined) {
+      return;
+    }
+
+    if (!callback)
+      return;
+
+    if (!GetBoolAttribute(this.treeID, this.id, 'supportsTextLocation')) {
+      try {
+        callback(
+            GetBoundsForRange(this.treeID, this.id, startIndex, endIndex));
+        return;
+      } catch (e) {
+        logging.WARNING('Error with bounds for range callback' + e);
+      }
+      return;
+    }
+
+    this.performAction_(
+        'getTextLocation', {startIndex: startIndex, endIndex: endIndex},
+        callback);
+    return;
   },
 
   get unclippedLocation() {
@@ -545,6 +596,14 @@
     }
   },
 
+  get tableCellColumnIndex() {
+    return GetTableCellColumnIndex(this.treeID, this.id);
+  },
+
+  get tableCellRowIndex() {
+    return GetTableCellRowIndex(this.treeID, this.id);
+  },
+
   doDefault: function() {
     this.performAction_('doDefault');
   },
@@ -906,7 +965,7 @@
       return false;
 
     if ('role' in params && this.role != params.role)
-        return false;
+      return false;
 
     if ('state' in params) {
       for (var state in params.state) {
@@ -958,14 +1017,8 @@
     'value'];
 
 var boolAttributes = [
-    'busy',
-    'clickable',
-    'containerLiveAtomic',
-    'containerLiveBusy',
-    'liveAtomic',
-    'modal',
-    'scrollable',
-    'selected'
+  'busy', 'clickable', 'containerLiveAtomic', 'containerLiveBusy', 'liveAtomic',
+  'modal', 'scrollable', 'selected', 'supportsTextLocation'
 ];
 
 var intAttributes = [
@@ -981,10 +1034,8 @@
     'scrollYMax',
     'scrollYMin',
     'setSize',
-    'tableCellColumnIndex',
     'ariaCellColumnIndex',
     'tableCellColumnSpan',
-    'tableCellRowIndex',
     'ariaCellRowIndex',
     'tableCellRowSpan',
     'tableColumnCount',
@@ -1217,7 +1268,10 @@
 
 utils.defineProperty(
     AutomationRootNodeImpl, 'getNodeFromTree', function(treeId, nodeId) {
-  var impl = privates(AutomationRootNodeImpl.get(treeId)).impl;
+  var tree = AutomationRootNodeImpl.get(treeId);
+  if (!tree)
+    return;
+  var impl = privates(tree).impl;
   if (impl)
     return impl.get(nodeId);
 });
@@ -1249,7 +1303,7 @@
   /**
    * @type {string}
    */
-  treeID: "",
+  treeID: '',
 
   /**
    * A map from id to AutomationNode.
@@ -1332,7 +1386,7 @@
     if (id == this.id)
       return this.wrapper;
 
-   var obj = this.axNodeDataCache_[id];
+    var obj = this.axNodeDataCache_[id];
     if (obj)
       return obj;
 
@@ -1386,6 +1440,28 @@
     return AutomationRootNodeImpl.actionRequestCounter;
   },
 
+  onGetTextLocationResult: function(textLocationParams) {
+    let requestID = textLocationParams.requestID;
+    if (requestID in AutomationRootNodeImpl.actionRequestIDToCallback) {
+      let callback =
+          AutomationRootNodeImpl.actionRequestIDToCallback[requestID];
+      try {
+        if (textLocationParams.result) {
+          callback(ComputeGlobalBounds(
+              this.treeID, textLocationParams.nodeID, textLocationParams.left,
+              textLocationParams.top, textLocationParams.width,
+              textLocationParams.height));
+        } else {
+          callback(undefined);
+        }
+      } catch (e) {
+        logging.WARNING('Error with onGetTextLocationResult callback:' + e);
+      }
+      delete AutomationNodeImpl.actionRequestIDToCallback[requestID];
+    }
+  },
+
+
   onActionResult: function(requestID, result) {
     if (requestID in AutomationRootNodeImpl.actionRequestIDToCallback) {
       AutomationRootNodeImpl.actionRequestIDToCallback[requestID](result);
@@ -1450,35 +1526,39 @@
     'toString',
     'boundsForRange',
   ],
-  readonly: $Array.concat(publicAttributes, [
-      'parent',
-      'firstChild',
-      'lastChild',
-      'children',
-      'previousSibling',
-      'nextSibling',
-      'isRootNode',
-      'role',
-      'checked',
-      'defaultActionVerb',
-      'restriction',
-      'state',
-      'location',
-      'indexInParent',
-      'lineStartOffsets',
-      'root',
-      'htmlAttributes',
-      'nameFrom',
-      'bold',
-      'italic',
-      'underline',
-      'lineThrough',
-      'customActions',
-      'standardActions',
-      'unclippedLocation',
-      'tableCellColumnHeaders',
-      'tableCellRowHeaders',
-  ]),
+  readonly: $Array.concat(
+      publicAttributes,
+      [
+        'parent',
+        'firstChild',
+        'lastChild',
+        'children',
+        'previousSibling',
+        'nextSibling',
+        'isRootNode',
+        'role',
+        'checked',
+        'defaultActionVerb',
+        'restriction',
+        'state',
+        'location',
+        'indexInParent',
+        'lineStartOffsets',
+        'root',
+        'htmlAttributes',
+        'nameFrom',
+        'bold',
+        'italic',
+        'underline',
+        'lineThrough',
+        'customActions',
+        'standardActions',
+        'unclippedLocation',
+        'tableCellColumnHeaders',
+        'tableCellRowHeaders',
+        'tableCellColumnIndex',
+        'tableCellRowIndex',
+      ]),
 });
 
 function AutomationRootNode() {
diff --git a/chromecast/renderer/resources/extensions/automation_custom_bindings.js b/chromecast/renderer/resources/extensions/automation_custom_bindings.js
index 50b5c89..1569aa11 100644
--- a/chromecast/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chromecast/renderer/resources/extensions/automation_custom_bindings.js
@@ -37,7 +37,7 @@
 // TODO(aboxhall): Look into using WeakMap
 var idToCallback = {};
 
-var DESKTOP_TREE_ID = "0";
+var desktopId = undefined;
 
 automationUtil.storeTreeCallback = function(id, callback) {
   if (!callback)
@@ -79,7 +79,10 @@
  * @return {AutomationNode}
  */
 automationUtil.getFocus = function() {
-  var focusedNodeInfo = GetFocusNative(DESKTOP_TREE_ID);
+  if (desktopId === undefined)
+    return;
+
+  var focusedNodeInfo = GetFocusNative(desktopId);
   if (!focusedNodeInfo)
     return null;
   var tree = AutomationRootNode.getOrCreate(focusedNodeInfo.treeId);
@@ -130,21 +133,22 @@
   var desktopTree = null;
   apiFunctions.setHandleRequest('getDesktop', function(callback) {
     StartCachingAccessibilityTrees();
-    desktopTree = AutomationRootNode.get(DESKTOP_TREE_ID);
+    if (desktopId !== undefined)
+      desktopTree = AutomationRootNode.get(desktopId);
     if (!desktopTree) {
-      if (DESKTOP_TREE_ID in idToCallback)
-        idToCallback[DESKTOP_TREE_ID].push(callback);
-      else
-        idToCallback[DESKTOP_TREE_ID] = [callback];
-
-      // TODO(dtseng): Disable desktop tree once desktop object goes out of
-      // scope.
-      automationInternal.enableDesktop(function() {
+      automationInternal.enableDesktop(function(treeId) {
         if (hasLastError()) {
-          AutomationRootNode.destroy(DESKTOP_TREE_ID);
+          AutomationRootNode.destroy(treeId);
+          desktopId = undefined;
           callback();
           return;
         }
+        desktopId = treeId;
+        desktopTree = AutomationRootNode.getOrCreate(desktopId);
+        callback(desktopTree);
+
+        // TODO(dtseng): Disable desktop tree once desktop object goes out of
+        // scope.
       });
     } else {
       callback(desktopTree);
@@ -184,7 +188,7 @@
     var focusNodeImpl = privates(params.focusObject).impl;
     if (anchorNodeImpl.treeID !== focusNodeImpl.treeID)
       throw new Error('Selection anchor and focus must be in the same tree.');
-    if (anchorNodeImpl.treeID === DESKTOP_TREE_ID) {
+    if (anchorNodeImpl.treeID === desktopId) {
       throw new Error('Use AutomationNode.setSelection to set the selection ' +
           'in the desktop tree.');
     }
@@ -265,6 +269,9 @@
     // root node when nothing has focus, we need to treat those as focus
     // events but otherwise not handle blur events specially.
     var node = privates(targetTree).impl.get(eventParams.targetID);
+    if (!node)
+      return;
+
     if (node == node.root)
       automationUtil.updateFocusedNodeOnBlur();
   } else if (eventParams.eventType == 'mediaStartedPlaying' ||
@@ -306,8 +313,7 @@
   // attribute or child nodes. If we've got that, wait for the full tree before
   // calling the callback.
   // TODO(dmazzoni): Don't send down placeholder (crbug.com/397553)
-  if (id != DESKTOP_TREE_ID && !targetTree.url &&
-      targetTree.children.length == 0)
+  if (id != desktopId && !targetTree.url && targetTree.children.length == 0)
     return;
 
   // If the tree wasn't available when getTree() was called, the callback will
@@ -339,14 +345,22 @@
   automationInternal.enableFrame(id);
 });
 
-automationInternal.onActionResult.addListener(
-    function(treeID, requestID, result) {
+automationInternal.onActionResult.addListener(function(
+    treeID, requestID, result) {
   var targetTree = AutomationRootNode.get(treeID);
   if (!targetTree)
     return;
 
   privates(targetTree).impl.onActionResult(requestID, result);
-    });
+});
+
+automationInternal.onGetTextLocationResult.addListener(function(
+    textLocationParams) {
+  var targetTree = AutomationRootNode.get(textLocationParams.treeID);
+  if (!targetTree)
+    return;
+  privates(targetTree).impl.onGetTextLocationResult(textLocationParams);
+});
 
 if (!apiBridge)
   exports.$set('binding', automation.generate());
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index cd20d92..8ec94aa2 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -320,7 +320,7 @@
                        base::Value(network_technology()));
     dictionary->SetKey(shill::kActivationStateProperty,
                        base::Value(activation_state()));
-    dictionary->SetKey(shill::kRoamingStateProperty, base::Value(roaming()));
+    dictionary->SetKey(shill::kRoamingStateProperty, base::Value(roaming_));
     dictionary->SetKey(shill::kOutOfCreditsProperty,
                        base::Value(cellular_out_of_credits()));
   }
@@ -405,6 +405,11 @@
          tethering_state() == shill::kTetheringConfirmedState;
 }
 
+bool NetworkState::IndicateRoaming() const {
+  return type() == shill::kTypeCellular &&
+         roaming_ == shill::kRoamingStateRoaming && !provider_requires_roaming_;
+}
+
 bool NetworkState::IsDynamicWep() const {
   return security_class_ == shill::kSecurityWep &&
          eap_key_mgmt_ == shill::kKeyManagementIEEE8021X;
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
index 9b2d54f5..ae9fa3d 100644
--- a/chromeos/network/network_state.h
+++ b/chromeos/network/network_state.h
@@ -116,7 +116,6 @@
   const std::string& network_technology() const { return network_technology_; }
   const std::string& activation_type() const { return activation_type_; }
   const std::string& activation_state() const { return activation_state_; }
-  const std::string& roaming() const { return roaming_; }
   const std::string& payment_url() const { return payment_url_; }
   const std::string& payment_post_data() const { return payment_post_data_; }
   bool cellular_out_of_credits() const { return cellular_out_of_credits_; }
@@ -146,7 +145,11 @@
   // |onc_source_|).
   bool IsManagedByPolicy() const;
 
-  // Returns true if current connection is using mobile data.
+  // Returns true if the network is romaing and the provider does not require
+  // roaming.
+  bool IndicateRoaming() const;
+
+  // Returns true if the current connection is using mobile data.
   bool IsUsingMobileData() const;
 
   // Returns true if the network securty is WEP_8021x (Dynamic WEP)
@@ -265,6 +268,7 @@
   std::string activation_type_;
   std::string activation_state_;
   std::string roaming_;
+  bool provider_requires_roaming_ = false;
   std::string payment_url_;
   std::string payment_post_data_;
   bool cellular_out_of_credits_ = false;
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 4f6c888..ce2a088 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -1257,6 +1257,8 @@
 
   UpdateGuid(network);
   UpdateCaptivePortalProvider(network);
+  if (network->Matches(NetworkTypePattern::Cellular()))
+    UpdateCellularStateFromDevice(network);
 
   network_list_sorted_ = false;
 
@@ -1634,6 +1636,13 @@
                                     portal_iter->second.name);
 }
 
+void NetworkStateHandler::UpdateCellularStateFromDevice(NetworkState* network) {
+  const DeviceState* device = GetDeviceState(network->device_path());
+  if (!device)
+    return;
+  network->provider_requires_roaming_ = device->provider_requires_roaming();
+}
+
 std::unique_ptr<NetworkState>
 NetworkStateHandler::MaybeCreateDefaultCellularNetwork() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index 915dd9d..db4b931 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -478,6 +478,9 @@
   // |hex_ssid_to_captive_portal_provider_map_|.
   void UpdateCaptivePortalProvider(NetworkState* network);
 
+  // Update networkState properties from the associated DeviceState.
+  void UpdateCellularStateFromDevice(NetworkState* network);
+
   // Cellular networks may not have an associated Shill Service (e.g. when the
   // SIM is locked or a mobile network is not available). This returns a new
   // default cellular network if necessary.
diff --git a/components/arc/BUILD.gn b/components/arc/BUILD.gn
index bd5a045..8a54e198 100644
--- a/components/arc/BUILD.gn
+++ b/components/arc/BUILD.gn
@@ -112,6 +112,7 @@
     "//third_party/re2:re2",
     "//ui/aura",
     "//ui/base:base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display/manager",
     "//ui/events",
@@ -351,6 +352,7 @@
     "//ui/aura",
     "//ui/aura:test_support",
     "//ui/base:test_support",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/events",
     "//ui/events:dom_keycode_converter",
diff --git a/components/arc/clipboard/arc_clipboard_bridge.cc b/components/arc/clipboard/arc_clipboard_bridge.cc
index 6e6faab..c47770c 100644
--- a/components/arc/clipboard/arc_clipboard_bridge.cc
+++ b/components/arc/clipboard/arc_clipboard_bridge.cc
@@ -14,6 +14,7 @@
 #include "components/arc/arc_bridge_service.h"
 #include "components/arc/arc_browser_context_keyed_service_factory_base.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_monitor.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
 
@@ -53,7 +54,7 @@
   std::string text(base::UTF16ToUTF8(
       markup16.substr(fragment_start, fragment_end - fragment_start)));
 
-  std::string mime_type(ui::Clipboard::kMimeTypeHTML);
+  std::string mime_type(ui::kMimeTypeHTML);
 
   // Send non-sanitized HTML content. Instance should sanitize it if needed.
   return mojom::ClipRepresentation::New(mime_type,
@@ -66,7 +67,7 @@
   // Unused. Title is not used at Instance.
   base::string16 title;
   std::string text;
-  std::string mime_type(ui::Clipboard::kMimeTypeText);
+  std::string mime_type(ui::kMimeTypeText);
 
   // Both Bookmark and AsciiText are represented by text/plain. If both are
   // present, only use Bookmark.
@@ -91,9 +92,9 @@
   // Populate ClipData with ClipRepresentation objects.
   for (const auto& mime_type16 : mime_types) {
     const std::string mime_type(base::UTF16ToUTF8(mime_type16));
-    if (mime_type == ui::Clipboard::kMimeTypeHTML) {
+    if (mime_type == ui::kMimeTypeHTML) {
       clip_data->representations.push_back(CreateHTML(clipboard));
-    } else if (mime_type == ui::Clipboard::kMimeTypeText) {
+    } else if (mime_type == ui::kMimeTypeText) {
       clip_data->representations.push_back(CreatePlainText(clipboard));
     } else {
       // TODO(ricardoq): Add other supported mime_types here.
@@ -175,9 +176,9 @@
 
   for (const auto& repr : clip_data->representations) {
     const std::string& mime_type(repr->mime_type);
-    if (mime_type == ui::Clipboard::kMimeTypeHTML) {
+    if (mime_type == ui::kMimeTypeHTML) {
       ProcessHTML(repr.get(), &writer);
-    } else if (mime_type == ui::Clipboard::kMimeTypeText) {
+    } else if (mime_type == ui::kMimeTypeText) {
       ProcessPlainText(repr.get(), &writer);
     }
   }
diff --git a/components/arc/clipboard/arc_clipboard_bridge_unittest.cc b/components/arc/clipboard/arc_clipboard_bridge_unittest.cc
index e7810bc..9019902 100644
--- a/components/arc/clipboard/arc_clipboard_bridge_unittest.cc
+++ b/components/arc/clipboard/arc_clipboard_bridge_unittest.cc
@@ -13,6 +13,7 @@
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
 
 namespace arc {
@@ -84,7 +85,7 @@
   }
 
   mojom::ClipDataPtr expected_clip_data =
-      CreateClipData(ui::Clipboard::kMimeTypeText, kSampleText);
+      CreateClipData(ui::kMimeTypeText, kSampleText);
   base::MockCallback<ArcClipboardBridge::GetClipContentCallback> callback;
   EXPECT_CALL(std::move(callback),
               Run(ClipDataMatcher(expected_clip_data.get())))
@@ -100,7 +101,7 @@
   }
 
   mojom::ClipDataPtr expected_clip_data =
-      CreateClipData(ui::Clipboard::kMimeTypeHTML, kSampleHtml);
+      CreateClipData(ui::kMimeTypeHTML, kSampleHtml);
   base::MockCallback<ArcClipboardBridge::GetClipContentCallback> callback;
   EXPECT_CALL(std::move(callback),
               Run(ClipDataMatcher(expected_clip_data.get())))
@@ -110,8 +111,7 @@
 }
 
 TEST_F(ArcClipboardBridgeTest, SetClipContent_PlainText) {
-  mojom::ClipDataPtr clip_data =
-      CreateClipData(ui::Clipboard::kMimeTypeText, kSampleText);
+  mojom::ClipDataPtr clip_data = CreateClipData(ui::kMimeTypeText, kSampleText);
 
   clipboard_bridge_->SetClipContent(std::move(clip_data));
 
@@ -120,7 +120,7 @@
   GetClipboard()->ReadAvailableTypes(ui::CLIPBOARD_TYPE_COPY_PASTE, &mime_types,
                                      &contains_files);
   ASSERT_EQ(1u, mime_types.size());
-  EXPECT_EQ(ui::Clipboard::kMimeTypeText, base::UTF16ToUTF8(mime_types[0]));
+  EXPECT_EQ(ui::kMimeTypeText, base::UTF16ToUTF8(mime_types[0]));
 
   base::string16 result;
   GetClipboard()->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &result);
@@ -128,8 +128,7 @@
 }
 
 TEST_F(ArcClipboardBridgeTest, SetClipContent_Html) {
-  mojom::ClipDataPtr clip_data =
-      CreateClipData(ui::Clipboard::kMimeTypeHTML, kSampleHtml);
+  mojom::ClipDataPtr clip_data = CreateClipData(ui::kMimeTypeHTML, kSampleHtml);
 
   clipboard_bridge_->SetClipContent(std::move(clip_data));
 
@@ -138,7 +137,7 @@
   GetClipboard()->ReadAvailableTypes(ui::CLIPBOARD_TYPE_COPY_PASTE, &mime_types,
                                      &contains_files);
   ASSERT_EQ(1u, mime_types.size());
-  EXPECT_EQ(ui::Clipboard::kMimeTypeHTML, base::UTF16ToUTF8(mime_types[0]));
+  EXPECT_EQ(ui::kMimeTypeHTML, base::UTF16ToUTF8(mime_types[0]));
 
   base::string16 markup16;
   std::string url;
@@ -159,4 +158,4 @@
 }
 
 }  // namespace
-}  // namespace arc
\ No newline at end of file
+}  // namespace arc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index e09449e..ed933f7 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -1846,8 +1846,6 @@
   field_data_manager->UpdateFieldDataMap(
       *password_element, password,
       FieldPropertiesFlags::AUTOFILLED_ON_PAGELOAD);
-  ProvisionallySavePassword(password_element->Form(), *password_element,
-                            RESTRICTION_NONE);
   gatekeeper_.RegisterElement(password_element);
   password_element->SetAutofillState(WebAutofillState::kAutofilled);
 
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc
index 98d7320..e10af1bd7 100644
--- a/components/autofill/content/renderer/password_generation_agent.cc
+++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -36,9 +36,10 @@
 #include "ui/gfx/geometry/rect.h"
 
 using blink::WebAutofillState;
-using blink::WebInputElement;
+using blink::WebDocument;
 using blink::WebFormControlElement;
 using blink::WebFormElement;
+using blink::WebInputElement;
 using blink::WebLocalFrame;
 
 namespace autofill {
@@ -490,6 +491,20 @@
 void PasswordGenerationAgent::FoundFormEligibleForGeneration(
     const NewPasswordFormGenerationData& form) {
   generation_enabled_fields_[form.new_password_renderer_id] = form;
+
+  if (mark_generation_element_) {
+    // Mark the input element with renderer id |form.new_password_renderer_id|.
+    if (!render_frame())
+      return;
+    WebDocument doc = render_frame()->GetWebFrame()->GetDocument();
+    if (doc.IsNull())
+      return;
+    WebFormControlElement new_password_input =
+        form_util::FindFormControlElementsByUniqueRendererId(
+            doc, form.new_password_renderer_id);
+    if (!new_password_input.IsNull())
+      new_password_input.SetAttribute("password_creation_field", "1");
+  }
 }
 
 void PasswordGenerationAgent::UserTriggeredGeneratePassword(
@@ -828,7 +843,7 @@
 }
 
 void PasswordGenerationAgent::MaybeCreateCurrentGenerationItem(
-    const WebInputElement& element) {
+    WebInputElement element) {
   // Do not create |current_generation_item_| if it already is created for
   // |element| or the user accepted generated password. So if the user accepted
   // the generated password, generation is not offered on any other field.
@@ -861,6 +876,8 @@
 
   current_generation_item_.reset(new GenerationItemInfo(
       element, std::move(*password_form), std::move(passwords)));
+
+  element.SetAttribute("aria-autocomplete", "list");
 }
 
 const mojom::PasswordManagerDriverAssociatedPtr&
diff --git a/components/autofill/content/renderer/password_generation_agent.h b/components/autofill/content/renderer/password_generation_agent.h
index d36ad4a7..8582c21 100644
--- a/components/autofill/content/renderer/password_generation_agent.h
+++ b/components/autofill/content/renderer/password_generation_agent.h
@@ -163,7 +163,7 @@
   // Creates |current_generation_item_| for |element| if |element| is a
   // generation enabled element. If |current_generation_item_| is already
   // created for |element| it is not recreated.
-  void MaybeCreateCurrentGenerationItem(const blink::WebInputElement& element);
+  void MaybeCreateCurrentGenerationItem(blink::WebInputElement element);
 
   // Runs HTML parsing based classifier and saves its outcome to proto.
   // TODO(crbug.com/621442): Remove client-side form classifier when server-side
diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc
index 2f016a7..13e96eb 100644
--- a/components/autofill/core/browser/autofill_experiments.cc
+++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -29,26 +29,6 @@
 namespace autofill {
 
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-namespace {
-// Returns the font weight corresponding to the value of param
-// kAutofillForcedFontWeightParameterName, or kDefault if the param is not
-// valid.
-ForcedFontWeight GetFontWeightFromParam() {
-  std::string param = base::GetFieldTrialParamValueByFeature(
-      kAutofillPrimaryInfoStyleExperiment,
-      kAutofillForcedFontWeightParameterName);
-
-  if (param == kAutofillForcedFontWeightParameterMedium)
-    return ForcedFontWeight::kMedium;
-  if (param == kAutofillForcedFontWeightParameterBold)
-    return ForcedFontWeight::kBold;
-
-  return ForcedFontWeight::kDefault;
-}
-}  // namespace
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
 const base::Feature kAutofillDropdownLayoutExperiment{
     "AutofillDropdownLayout", base::FEATURE_DISABLED_BY_DEFAULT};
 const char kAutofillDropdownLayoutParameterName[] = "variant";
@@ -58,14 +38,6 @@
     "two-lines-leading-icon";
 #endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
 
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-const base::Feature kAutofillPrimaryInfoStyleExperiment{
-    "AutofillPrimaryInfoStyleExperiment", base::FEATURE_DISABLED_BY_DEFAULT};
-const char kAutofillForcedFontWeightParameterName[] = "font_weight";
-const char kAutofillForcedFontWeightParameterMedium[] = "medium";
-const char kAutofillForcedFontWeightParameterBold[] = "bold";
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
 bool IsCreditCardUploadEnabled(const PrefService* pref_service,
                                const syncer::SyncService* sync_service,
                                const std::string& user_email) {
@@ -210,17 +182,6 @@
 }
 
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-ForcedFontWeight GetForcedFontWeight() {
-  if (!base::FeatureList::IsEnabled(kAutofillPrimaryInfoStyleExperiment))
-    return ForcedFontWeight::kDefault;
-
-  // Only read the feature param's value the first time it's needed.
-  static ForcedFontWeight font_weight_from_param = GetFontWeightFromParam();
-  return font_weight_from_param;
-}
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
 ForcedPopupLayoutState GetForcedPopupLayoutState() {
   if (!base::FeatureList::IsEnabled(
           autofill::kAutofillDropdownLayoutExperiment))
diff --git a/components/autofill/core/browser/autofill_experiments.h b/components/autofill/core/browser/autofill_experiments.h
index 89e0a00..d4247999 100644
--- a/components/autofill/core/browser/autofill_experiments.h
+++ b/components/autofill/core/browser/autofill_experiments.h
@@ -31,13 +31,6 @@
 extern const char kAutofillDropdownLayoutParameterTwoLinesLeadingIcon[];
 #endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
 
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-extern const base::Feature kAutofillPrimaryInfoStyleExperiment;
-extern const char kAutofillForcedFontWeightParameterName[];
-extern const char kAutofillForcedFontWeightParameterMedium[];
-extern const char kAutofillForcedFontWeightParameterBold[];
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
 // Returns true if uploading credit cards to Wallet servers is enabled. This
 // requires the appropriate flags and user settings to be true and the user to
 // be a member of a supported domain.
@@ -67,20 +60,6 @@
 bool ShouldUseActiveSignedInAccount();
 
 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-enum class ForcedFontWeight {
-  kDefault,  // No change to the font weight.
-  kMedium,
-  kBold,
-};
-
-// Returns the font weight to be used for primary information on the Autofill
-// dropdown for Addresses and Credit Cards. Returns kDefault if feature
-// kAutofillPrimaryInfoStyleExperiment is disabled or if the corresponding
-// feature param is invalid.
-ForcedFontWeight GetForcedFontWeight();
-#endif  // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
 enum class ForcedPopupLayoutState {
   kDefault,       // No popup layout forced by experiment.
   kLeadingIcon,   // Experiment forces leading (left in LTR) icon layout.
diff --git a/components/autofill/core/browser/credit_card_save_manager.h b/components/autofill/core/browser/credit_card_save_manager.h
index 9677680..e9ac73d2 100644
--- a/components/autofill/core/browser/credit_card_save_manager.h
+++ b/components/autofill/core/browser/credit_card_save_manager.h
@@ -124,7 +124,6 @@
  private:
   friend class CreditCardSaveManagerTest;
   friend class CreditCardSaveManagerTestObserverBridge;
-  friend class LocalCardMigrationBrowserTest;
   friend class TestCreditCardSaveManager;
   friend class SaveCardBubbleViewsBrowserTestBase;
 
diff --git a/components/autofill/core/browser/form_data_importer.h b/components/autofill/core/browser/form_data_importer.h
index 37b8d06..412cf02 100644
--- a/components/autofill/core/browser/form_data_importer.h
+++ b/components/autofill/core/browser/form_data_importer.h
@@ -145,7 +145,6 @@
   friend class AutofillMergeTest;
   friend class FormDataImporterTest;
   friend class FormDataImporterTestBase;
-  friend class LocalCardMigrationBrowserTest;
   friend class SaveCardBubbleViewsBrowserTestBase;
   friend class SaveCardInfobarEGTestHelper;
   FRIEND_TEST_ALL_PREFIXES(AutofillMergeTest, MergeProfiles);
diff --git a/components/autofill/core/browser/local_card_migration_manager.cc b/components/autofill/core/browser/local_card_migration_manager.cc
index bc9634e..764f915 100644
--- a/components/autofill/core/browser/local_card_migration_manager.cc
+++ b/components/autofill/core/browser/local_card_migration_manager.cc
@@ -88,9 +88,6 @@
     return;
   migration_request_ = payments::PaymentsClient::MigrationRequestDetails();
 
-  if (observer_for_testing_)
-    observer_for_testing_->OnDecideToRequestLocalCardMigration();
-
   payments_client_->GetUploadDetails(
       std::vector<AutofillProfile>(), GetDetectedValues(),
       /*active_experiments=*/std::vector<const char*>(), app_locale_,
@@ -148,25 +145,15 @@
   bool migration_experiment_enabled =
       features::GetLocalCardMigrationExperimentalFlag() !=
       features::LocalCardMigrationExperimentalFlag::kMigrationDisabled;
-
-  // If |observer_for_testing_| is set, assume we are in a browsertest and
-  // credit card upload should be enabled by default. Cannot get around this as
-  // Chrome OS testing requires an unsupported email domain (i.e.
-  // stub-user@example.com).
-  bool credit_card_upload_enabled =
-      observer_for_testing_ ||
-      ::autofill::IsCreditCardUploadEnabled(
-          client_->GetPrefs(), client_->GetSyncService(),
-          client_->GetIdentityManager()->GetPrimaryAccountInfo().email);
-
+  bool credit_card_upload_enabled = ::autofill::IsCreditCardUploadEnabled(
+      client_->GetPrefs(), client_->GetSyncService(),
+      client_->GetIdentityManager()->GetPrimaryAccountInfo().email);
   bool has_google_payments_account =
       (payments::GetBillingCustomerId(personal_data_manager_,
                                       payments_client_->GetPrefService()) != 0);
-
   bool sync_feature_enabled =
       (personal_data_manager_->GetSyncSigninState() ==
        AutofillSyncSigninState::kSignedInAndSyncFeature);
-
   return migration_experiment_enabled && credit_card_upload_enabled &&
          has_google_payments_account && sync_feature_enabled;
 }
@@ -176,9 +163,6 @@
     AutofillClient::PaymentsRpcResult result,
     const base::string16& context_token,
     std::unique_ptr<base::Value> legal_message) {
-  if (observer_for_testing_)
-    observer_for_testing_->OnReceivedGetUploadDetailsResponse();
-
   if (result == AutofillClient::SUCCESS) {
     migration_request_.context_token = context_token;
     legal_message_ = base::DictionaryValue::From(std::move(legal_message));
@@ -212,9 +196,6 @@
     AutofillClient::PaymentsRpcResult result,
     std::unique_ptr<std::unordered_map<std::string, std::string>> save_result,
     const std::string& display_text) {
-  if (observer_for_testing_)
-    observer_for_testing_->OnReceivedMigrateCardsResponse();
-
   if (!save_result)
     return;
 
@@ -273,9 +254,6 @@
 // Send the migration request. Will call payments_client to create a new
 // PaymentsRequest. Also create a new callback function OnDidMigrateLocalCards.
 void LocalCardMigrationManager::SendMigrateLocalCardsRequest() {
-  if (observer_for_testing_)
-    observer_for_testing_->OnSentMigrateCardsRequest();
-
   migration_request_.app_locale = app_locale_;
   migration_request_.billing_customer_number = payments::GetBillingCustomerId(
       personal_data_manager_, payments_client_->GetPrefService());
diff --git a/components/autofill/core/browser/local_card_migration_manager.h b/components/autofill/core/browser/local_card_migration_manager.h
index dc2fa329..06e5ce5 100644
--- a/components/autofill/core/browser/local_card_migration_manager.h
+++ b/components/autofill/core/browser/local_card_migration_manager.h
@@ -43,7 +43,7 @@
     FAILURE_ON_UPLOAD,
   };
 
-  explicit MigratableCreditCard(const CreditCard& credit_card);
+  MigratableCreditCard(const CreditCard& credit_card);
   ~MigratableCreditCard();
 
   CreditCard credit_card() const { return credit_card_; }
@@ -66,16 +66,6 @@
 // Owned by FormDataImporter.
 class LocalCardMigrationManager {
  public:
-  // An observer class used by browsertests that gets notified whenever
-  // particular actions occur.
-  class ObserverForTest {
-   public:
-    virtual void OnDecideToRequestLocalCardMigration() = 0;
-    virtual void OnReceivedGetUploadDetailsResponse() = 0;
-    virtual void OnSentMigrateCardsRequest() = 0;
-    virtual void OnReceivedMigrateCardsResponse() = 0;
-  };
-
   // The parameters should outlive the LocalCardMigrationManager.
   LocalCardMigrationManager(AutofillClient* client,
                             payments::PaymentsClient* payments_client,
@@ -151,7 +141,6 @@
   payments::PaymentsClient* payments_client_;
 
  private:
-  friend class LocalCardMigrationBrowserTest;
   FRIEND_TEST_ALL_PREFIXES(LocalCardMigrationManagerTest,
                            MigrateCreditCard_MigrationPermanentFailure);
   FRIEND_TEST_ALL_PREFIXES(LocalCardMigrationManagerTest,
@@ -172,11 +161,6 @@
   // Finalizes the migration request and calls PaymentsClient.
   void SendMigrateLocalCardsRequest();
 
-  // For testing.
-  void SetEventObserverForTesting(ObserverForTest* observer) {
-    observer_for_testing_ = observer;
-  }
-
   std::unique_ptr<base::DictionaryValue> legal_message_;
 
   std::string app_locale_;
@@ -203,9 +187,6 @@
   // Record the triggering source of the local card migration.
   AutofillMetrics::LocalCardMigrationOrigin local_card_migration_origin_;
 
-  // Initialized only during tests.
-  ObserverForTest* observer_for_testing_ = nullptr;
-
   base::WeakPtrFactory<LocalCardMigrationManager> weak_ptr_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(LocalCardMigrationManager);
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc b/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc
index 8fc9c8a..8631ea7 100644
--- a/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc
+++ b/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc
@@ -188,6 +188,15 @@
 base::Optional<syncer::ModelError> AutofillWalletSyncBridge::MergeSyncData(
     std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
     syncer::EntityChangeList entity_data) {
+  // All metadata changes have been already written, return early for an error.
+  base::Optional<syncer::ModelError> error =
+      static_cast<syncer::SyncMetadataStoreChangeList*>(
+          metadata_change_list.get())
+          ->TakeError();
+  if (error) {
+    return error;
+  }
+
   SetSyncData(entity_data);
 
   // After the first sync, we are sure that initial sync is done.
@@ -195,6 +204,8 @@
     initial_sync_done_ = true;
     active_callback_.Run(true);
   }
+  // TODO(crbug.com/853688): Update the AutofillTable API to know about write
+  // errors and report them here.
   return base::nullopt;
 }
 
diff --git a/components/bookmarks/browser/BUILD.gn b/components/bookmarks/browser/BUILD.gn
index 0161b6f3f..ccdf41687 100644
--- a/components/bookmarks/browser/BUILD.gn
+++ b/components/bookmarks/browser/BUILD.gn
@@ -68,6 +68,7 @@
     "//net",
     "//third_party/icu",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/gfx",
     "//url",
   ]
@@ -135,6 +136,7 @@
     "//components/prefs:test_support",
     "//testing/gtest",
     "//ui/base",
+    "//ui/base/clipboard",
     "//url",
   ]
 }
diff --git a/components/bookmarks/browser/bookmark_node_data.cc b/components/bookmarks/browser/bookmark_node_data.cc
index 8cf7ca5..d6e9823c 100644
--- a/components/bookmarks/browser/bookmark_node_data.cc
+++ b/components/bookmarks/browser/bookmark_node_data.cc
@@ -123,7 +123,7 @@
 // static
 bool BookmarkNodeData::ClipboardContainsBookmarks() {
   return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable(
-      ui::Clipboard::GetFormatType(kClipboardFormatString),
+      ui::ClipboardFormatType::GetType(kClipboardFormatString),
       ui::CLIPBOARD_TYPE_COPY_PASTE);
 }
 #endif
@@ -197,15 +197,15 @@
 
   base::Pickle pickle;
   WriteToPickle(base::FilePath(), &pickle);
-  scw.WritePickledData(pickle,
-                       ui::Clipboard::GetFormatType(kClipboardFormatString));
+  scw.WritePickledData(
+      pickle, ui::ClipboardFormatType::GetType(kClipboardFormatString));
 }
 
 bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) {
   DCHECK_EQ(type, ui::CLIPBOARD_TYPE_COPY_PASTE);
   std::string data;
   ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
-  clipboard->ReadData(ui::Clipboard::GetFormatType(kClipboardFormatString),
+  clipboard->ReadData(ui::ClipboardFormatType::GetType(kClipboardFormatString),
                       &data);
 
   if (!data.empty()) {
diff --git a/components/bookmarks/browser/bookmark_node_data.h b/components/bookmarks/browser/bookmark_node_data.h
index 2a691ce6..2da1f18 100644
--- a/components/bookmarks/browser/bookmark_node_data.h
+++ b/components/bookmarks/browser/bookmark_node_data.h
@@ -19,7 +19,7 @@
 #include "url/gurl.h"
 
 #if defined(TOOLKIT_VIEWS)
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #endif
 
 namespace base {
@@ -115,7 +115,7 @@
   ~BookmarkNodeData();
 
 #if defined(TOOLKIT_VIEWS)
-  static const ui::Clipboard::FormatType& GetBookmarkFormatType();
+  static const ui::ClipboardFormatType& GetBookmarkFormatType();
 #endif
 
   static bool ClipboardContainsBookmarks();
diff --git a/components/bookmarks/browser/bookmark_node_data_mac.mm b/components/bookmarks/browser/bookmark_node_data_mac.mm
index 028148f..d2e699b 100644
--- a/components/bookmarks/browser/bookmark_node_data_mac.mm
+++ b/components/bookmarks/browser/bookmark_node_data_mac.mm
@@ -16,9 +16,9 @@
 #if defined(TOOLKIT_VIEWS)
 
 // static
-const ui::Clipboard::FormatType& BookmarkNodeData::GetBookmarkFormatType() {
-  static const base::NoDestructor<ui::Clipboard::FormatType> format(
-      ui::Clipboard::GetFormatType(
+const ui::ClipboardFormatType& BookmarkNodeData::GetBookmarkFormatType() {
+  static const base::NoDestructor<ui::ClipboardFormatType> format(
+      ui::ClipboardFormatType::GetType(
           base::SysNSStringToUTF8(kUTTypeChromiumBookmarkDictionaryList)));
 
   return *format;
diff --git a/components/bookmarks/browser/bookmark_node_data_views.cc b/components/bookmarks/browser/bookmark_node_data_views.cc
index ec119bd..a6735f2 100644
--- a/components/bookmarks/browser/bookmark_node_data_views.cc
+++ b/components/bookmarks/browser/bookmark_node_data_views.cc
@@ -9,15 +9,17 @@
 #include "base/pickle.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "url/url_constants.h"
 
 namespace bookmarks {
 
 // static
-const ui::Clipboard::FormatType& BookmarkNodeData::GetBookmarkFormatType() {
-  static const base::NoDestructor<ui::Clipboard::FormatType> format(
-      ui::Clipboard::GetFormatType(BookmarkNodeData::kClipboardFormatString));
+const ui::ClipboardFormatType& BookmarkNodeData::GetBookmarkFormatType() {
+  static const base::NoDestructor<ui::ClipboardFormatType> format(
+      ui::ClipboardFormatType::GetType(
+          BookmarkNodeData::kClipboardFormatString));
 
   return *format;
 }
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 9f61f28..20b1d16 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -192,6 +192,7 @@
           std::make_unique<syncer::HttpBridgeNetworkResources>()),
       start_behavior_(init_params.start_behavior),
       passphrase_prompt_triggered_by_version_(false),
+      is_stopping_and_clearing_(false),
       sync_enabled_weak_factory_(this),
       weak_factory_(this) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -1674,7 +1675,12 @@
     }
   } else {
     // This will notify the observers.
-    StopImpl(KEEP_DATA);
+    if (is_stopping_and_clearing_) {
+      is_stopping_and_clearing_ = false;
+      StopImpl(CLEAR_DATA);
+    } else {
+      StopImpl(KEEP_DATA);
+    }
 
     // TODO(crbug.com/856179): Evaluate whether we can get away without a full
     // restart (i.e. just reconfigure plus whatever cleanup is necessary).
@@ -1779,12 +1785,6 @@
   return preference_providers_.count(provider) > 0;
 }
 
-const syncer::LocalDeviceInfoProvider*
-ProfileSyncService::GetLocalDeviceInfoProvider() const {
-  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  return sync_client_->GetDeviceInfoSyncService()->GetLocalDeviceInfoProvider();
-}
-
 namespace {
 
 class GetAllNodesRequestHelper
@@ -1918,7 +1918,11 @@
 
 void ProfileSyncService::StopAndClear() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  StopImpl(CLEAR_DATA);
+  DCHECK(!is_stopping_and_clearing_);
+  // We need to remember that clearing of data is needed when sync will be
+  // stopped. This flag is cleared in OnSyncRequestedPrefChange() where sync
+  // gets stopped.
+  is_stopping_and_clearing_ = true;
   user_settings_->SetSyncRequested(false);
 }
 
diff --git a/components/browser_sync/profile_sync_service.h b/components/browser_sync/profile_sync_service.h
index 5a2bebd..74818b5 100644
--- a/components/browser_sync/profile_sync_service.h
+++ b/components/browser_sync/profile_sync_service.h
@@ -55,7 +55,6 @@
 
 namespace syncer {
 class BackendMigrator;
-class LocalDeviceInfoProvider;
 class NetworkResources;
 class SyncTypePreferenceProvider;
 class TypeDebugInfoObserver;
@@ -84,14 +83,17 @@
 //   'Preferred' (user preferences and opt-out for a datatype)
 //
 //      This means the user's opt-in or opt-out preference on a per-datatype
-//      basis.  The sync service will try to make active exactly these types.
+//      basis. The sync service will try to make active exactly these types.
 //      If a user has opted out of syncing a particular datatype, it will
-//      be registered, but not preferred.
+//      be registered, but not preferred. Also note that not all datatypes can
+//      be directly chosen by the user: e.g. AUTOFILL_PROFILE is implied by
+//      AUTOFILL but can't be selected separately. If AUTOFILL is chosen by the
+//      user, then AUTOFILL_PROFILE will also be considered preferred. See
+//      SyncPrefs::ResolvePrefGroups.
 //
-//      This state is controlled by OnUserChoseDatatypes and
-//      GetPreferredDataTypes.  They are stored in the preferences system,
-//      and persist; though if a datatype is not registered, it cannot
-//      be a preferred datatype.
+//      This state is controlled by SyncUserSettings::SetChosenDataTypes. They
+//      are stored in the preferences system and persist; though if a datatype
+//      is not registered, it cannot be a preferred datatype.
 //
 //   'Active' (run-time initialization of sync system for a datatype)
 //
@@ -103,36 +105,25 @@
 //      as necessary.
 //
 //      When a datatype is in the process of becoming active, it may be
-//      in some intermediate state.  Those finer-grained intermediate states
-//      are differentiated by the DataTypeController state.
+//      in some intermediate state. Those finer-grained intermediate states
+//      are differentiated by the DataTypeController state, but not exposed.
 //
 // Sync Configuration:
 //
-//   Sync configuration is accomplished via the following APIs:
-//    * OnUserChoseDatatypes(): Set the data types the user wants to sync.
+//   Sync configuration is accomplished via SyncUserSettings, in particular:
+//    * SetChosenDataTypes(): Set the data types the user wants to sync.
 //    * SetDecryptionPassphrase(): Attempt to decrypt the user's encrypted data
 //        using the passed passphrase.
 //    * SetEncryptionPassphrase(): Re-encrypt the user's data using the passed
 //        passphrase.
 //
-//   Additionally, the current sync configuration can be fetched by calling
-//    * GetRegisteredDataTypes()
-//    * GetPreferredDataTypes()
-//    * GetActiveDataTypes()
-//    * IsUsingSecondaryPassphrase()
-//    * IsEncryptEverythingEnabled()
-//    * IsPassphraseRequired()/IsPassphraseRequiredForDecryption()
-//
-//   The "sync everything" state cannot be read from ProfileSyncService, but
-//   is instead pulled from SyncPrefs.HasKeepEverythingSynced().
-//
 // Initial sync setup:
 //
 //   For privacy reasons, it is usually desirable to avoid syncing any data
 //   types until the user has finished setting up sync. There are two APIs
 //   that control the initial sync download:
 //
-//    * SetFirstSetupComplete()
+//    * SyncUserSettings::SetFirstSetupComplete()
 //    * GetSetupInProgressHandle()
 //
 //   SetFirstSetupComplete() should be called once the user has finished setting
@@ -141,8 +132,7 @@
 //   should be deleted once configuration is complete.
 //
 //   Once first setup has completed and there are no outstanding
-//   setup-in-progress handles, CanConfigureDataTypes() will return true and
-//   datatype configuration can begin.
+//   setup-in-progress handles, datatype configuration will begin.
 class ProfileSyncService : public syncer::SyncService,
                            public syncer::SyncEngineHost,
                            public syncer::SyncPrefObserver,
@@ -195,25 +185,28 @@
   int GetDisableReasons() const override;
   TransportState GetTransportState() const override;
   bool IsLocalSyncEnabled() const override;
-  void TriggerRefresh(const syncer::ModelTypeSet& types) override;
-  void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override;
-  void StopAndClear() override;
-  void AddObserver(syncer::SyncServiceObserver* observer) override;
-  void RemoveObserver(syncer::SyncServiceObserver* observer) override;
-  bool HasObserver(const syncer::SyncServiceObserver* observer) const override;
+  AccountInfo GetAuthenticatedAccountInfo() const override;
+  bool IsAuthenticatedAccountPrimary() const override;
+  const GoogleServiceAuthError& GetAuthError() const override;
+  std::unique_ptr<syncer::SyncSetupInProgressHandle> GetSetupInProgressHandle()
+      override;
+  bool IsSetupInProgress() const override;
   syncer::ModelTypeSet GetRegisteredDataTypes() const override;
   syncer::ModelTypeSet GetForcedDataTypes() const override;
   syncer::ModelTypeSet GetPreferredDataTypes() const override;
   syncer::ModelTypeSet GetActiveDataTypes() const override;
-  std::unique_ptr<syncer::SyncSetupInProgressHandle> GetSetupInProgressHandle()
-      override;
-  bool IsSetupInProgress() const override;
-  const GoogleServiceAuthError& GetAuthError() const override;
+  void StopAndClear() override;
+  void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override;
+  void TriggerRefresh(const syncer::ModelTypeSet& types) override;
+  void ReenableDatatype(syncer::ModelType type) override;
+  void ReadyForStartChanged(syncer::ModelType type) override;
+  void SetInvalidationsForSessionsEnabled(bool enabled) override;
+  void AddObserver(syncer::SyncServiceObserver* observer) override;
+  void RemoveObserver(syncer::SyncServiceObserver* observer) override;
+  bool HasObserver(const syncer::SyncServiceObserver* observer) const override;
   bool IsPassphraseRequiredForDecryption() const override;
   bool IsUsingSecondaryPassphrase() const override;
   syncer::UserShare* GetUserShare() const override;
-  void ReenableDatatype(syncer::ModelType type) override;
-  void ReadyForStartChanged(syncer::ModelType type) override;
   syncer::SyncTokenStatus GetSyncTokenStatus() const override;
   bool QueryDetailedSyncStatus(syncer::SyncStatus* result) const override;
   base::Time GetLastSyncedTime() const override;
@@ -233,9 +226,6 @@
   base::WeakPtr<syncer::JsController> GetJsController() override;
   void GetAllNodes(const base::Callback<void(std::unique_ptr<base::ListValue>)>&
                        callback) override;
-  AccountInfo GetAuthenticatedAccountInfo() const override;
-  bool IsAuthenticatedAccountPrimary() const override;
-  void SetInvalidationsForSessionsEnabled(bool enabled) override;
 
   // Add a sync type preference provider. Each provider may only be added once.
   void AddPreferenceProvider(syncer::SyncTypePreferenceProvider* provider);
@@ -247,10 +237,6 @@
   bool HasPreferenceProvider(
       syncer::SyncTypePreferenceProvider* provider) const;
 
-  // TODO(crbug.com/922971): Remove this getter and migrate away callers to
-  // DeviceInfoSyncService.
-  const syncer::LocalDeviceInfoProvider* GetLocalDeviceInfoProvider() const;
-
   // SyncEngineHost implementation.
   void OnEngineInitialized(
       syncer::ModelTypeSet initial_types,
@@ -648,6 +634,10 @@
   // IsPassphrasePrompted sync preference.
   bool passphrase_prompt_triggered_by_version_;
 
+  // Used by StopAndClear() to remember that clearing of data is needed (as
+  // sync is stopped after a callback from |user_settings_|).
+  bool is_stopping_and_clearing_;
+
   // This weak factory invalidates its issued pointers when Sync is disabled.
   base::WeakPtrFactory<ProfileSyncService> sync_enabled_weak_factory_;
 
diff --git a/components/browser_sync/profile_sync_service_unittest.cc b/components/browser_sync/profile_sync_service_unittest.cc
index 06198cf1..697cbfa 100644
--- a/components/browser_sync/profile_sync_service_unittest.cc
+++ b/components/browser_sync/profile_sync_service_unittest.cc
@@ -313,6 +313,11 @@
     return profile_sync_service_bundle_.component_factory();
   }
 
+  const syncer::LocalDeviceInfoProvider* local_device_info_provider() {
+    return profile_sync_service_bundle_.device_info_sync_service()
+        ->GetLocalDeviceInfoProvider();
+  }
+
  private:
   base::test::ScopedTaskEnvironment scoped_task_environment_;
   ProfileSyncServiceBundle profile_sync_service_bundle_;
@@ -908,7 +913,7 @@
             service()->GetTransportState());
   ASSERT_LT(base::Time::Now() - service()->GetLastSyncedTime(),
             base::TimeDelta::FromMinutes(1));
-  ASSERT_TRUE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  ASSERT_TRUE(local_device_info_provider()->GetLocalDeviceInfo());
 
   // Sign out.
   service()->StopAndClear();
@@ -918,7 +923,7 @@
   EXPECT_FALSE(service()->IsSyncFeatureEnabled());
 
   EXPECT_TRUE(service()->GetLastSyncedTime().is_null());
-  EXPECT_FALSE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  EXPECT_FALSE(local_device_info_provider()->GetLocalDeviceInfo());
 }
 
 TEST_F(ProfileSyncServiceWithStandaloneTransportTest, ClearDataOnSignOut) {
@@ -930,7 +935,7 @@
   base::Time last_synced_time = service()->GetLastSyncedTime();
   ASSERT_LT(base::Time::Now() - last_synced_time,
             base::TimeDelta::FromMinutes(1));
-  ASSERT_TRUE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  ASSERT_TRUE(local_device_info_provider()->GetLocalDeviceInfo());
 
   // Sign out.
   service()->StopAndClear();
@@ -942,7 +947,7 @@
   EXPECT_FALSE(service()->IsSyncFeatureEnabled());
 
   EXPECT_NE(service()->GetLastSyncedTime(), last_synced_time);
-  EXPECT_TRUE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  EXPECT_TRUE(local_device_info_provider()->GetLocalDeviceInfo());
 }
 
 // Verify that credential errors get returned from GetAuthError().
@@ -1383,7 +1388,7 @@
             service()->GetTransportState());
   ASSERT_LT(base::Time::Now() - service()->GetLastSyncedTime(),
             base::TimeDelta::FromMinutes(1));
-  ASSERT_TRUE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  ASSERT_TRUE(local_device_info_provider()->GetLocalDeviceInfo());
 
   syncer::SyncProtocolError client_cmd;
   client_cmd.action = syncer::DISABLE_SYNC_ON_CLIENT;
@@ -1404,7 +1409,7 @@
   EXPECT_EQ(syncer::SyncService::TransportState::DISABLED,
             service()->GetTransportState());
   EXPECT_TRUE(service()->GetLastSyncedTime().is_null());
-  EXPECT_FALSE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  EXPECT_FALSE(local_device_info_provider()->GetLocalDeviceInfo());
 #endif
 
   EXPECT_FALSE(service()->IsSyncFeatureEnabled());
@@ -1420,7 +1425,7 @@
             service()->GetTransportState());
   ASSERT_LT(base::Time::Now() - service()->GetLastSyncedTime(),
             base::TimeDelta::FromMinutes(1));
-  ASSERT_TRUE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  ASSERT_TRUE(local_device_info_provider()->GetLocalDeviceInfo());
 
   syncer::SyncProtocolError client_cmd;
   client_cmd.action = syncer::DISABLE_SYNC_ON_CLIENT;
@@ -1443,7 +1448,7 @@
   EXPECT_EQ(syncer::SyncService::TransportState::DISABLED,
             service()->GetTransportState());
   EXPECT_TRUE(service()->GetLastSyncedTime().is_null());
-  EXPECT_FALSE(service()->GetLocalDeviceInfoProvider()->GetLocalDeviceInfo());
+  EXPECT_FALSE(local_device_info_provider()->GetLocalDeviceInfo());
 #endif
 
   EXPECT_FALSE(service()->IsSyncFeatureEnabled());
diff --git a/components/browser_sync/profile_sync_test_util.h b/components/browser_sync/profile_sync_test_util.h
index ee9dc56..a582718 100644
--- a/components/browser_sync/profile_sync_test_util.h
+++ b/components/browser_sync/profile_sync_test_util.h
@@ -137,6 +137,10 @@
     db_thread_ = db_thread;
   }
 
+  syncer::DeviceInfoSyncService* device_info_sync_service() {
+    return &device_info_sync_service_;
+  }
+
  private:
   scoped_refptr<base::SequencedTaskRunner> db_thread_;
   sync_preferences::TestingPrefServiceSyncable pref_service_;
diff --git a/components/exo/data_offer.cc b/components/exo/data_offer.cc
index e14bc9b..1882ede 100644
--- a/components/exo/data_offer.cc
+++ b/components/exo/data_offer.cc
@@ -14,6 +14,8 @@
 #include "components/exo/data_offer_observer.h"
 #include "components/exo/file_helper.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_types.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "url/gurl.h"
@@ -76,10 +78,10 @@
   return !url_list_string->empty();
 }
 
-ui::Clipboard::FormatType GetClipboardFormatType() {
+ui::ClipboardFormatType GetClipboardFormatType() {
   static const char kFormatString[] = "chromium/x-file-system-files";
-  static base::NoDestructor<ui::Clipboard::FormatType> format_type(
-      ui::Clipboard::GetFormatType(kFormatString));
+  static base::NoDestructor<ui::ClipboardFormatType> format_type(
+      ui::ClipboardFormatType::GetType(kFormatString));
   return *format_type;
 }
 
@@ -166,8 +168,7 @@
 
   base::string16 string_content;
   if (data.HasString() && data.GetString(&string_content)) {
-    const std::string text_mime_type =
-        std::string(ui::Clipboard::kMimeTypeText);
+    const std::string text_mime_type = std::string(ui::kMimeTypeText);
     data_.emplace(text_mime_type,
                   RefCountedString16::TakeString(std::move(string_content)));
     delegate_->OnOffer(text_mime_type);
@@ -178,7 +179,7 @@
 void DataOffer::SetClipboardData(FileHelper* file_helper,
                                  const ui::Clipboard& data) {
   DCHECK_EQ(0u, data_.size());
-  if (data.IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
+  if (data.IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextWType(),
                              ui::CLIPBOARD_TYPE_COPY_PASTE)) {
     base::string16 content;
     data.ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &content);
diff --git a/components/exo/data_offer_unittest.cc b/components/exo/data_offer_unittest.cc
index 1f2a51c4..97f5ef6 100644
--- a/components/exo/data_offer_unittest.cc
+++ b/components/exo/data_offer_unittest.cc
@@ -184,7 +184,7 @@
   pickle.WriteInt64(1000);   // file size
   pickle.WriteString("id");  // filesystem id
   data.SetPickledData(
-      ui::Clipboard::GetFormatType("chromium/x-file-system-files"), pickle);
+      ui::ClipboardFormatType::GetType("chromium/x-file-system-files"), pickle);
   data_offer.SetDropData(&file_helper, data);
 
   EXPECT_EQ(1u, delegate.mime_types().size());
@@ -242,7 +242,7 @@
   pickle.WriteInt64(1000);   // file size
   pickle.WriteString("id");  // filesystem id
   data.SetPickledData(
-      ui::Clipboard::GetFormatType("chromium/x-file-system-files"), pickle);
+      ui::ClipboardFormatType::GetType("chromium/x-file-system-files"), pickle);
   data_offer.SetDropData(&file_helper, data);
 
   // Run callback with a resolved URL.
@@ -278,7 +278,7 @@
   pickle.WriteInt64(1000);   // file size
   pickle.WriteString("id");  // filesystem id
   data.SetPickledData(
-      ui::Clipboard::GetFormatType("chromium/x-file-system-files"), pickle);
+      ui::ClipboardFormatType::GetType("chromium/x-file-system-files"), pickle);
   data_offer.SetDropData(&file_helper, data);
 
   base::ScopedFD read_pipe1;
@@ -326,7 +326,7 @@
   pickle.WriteInt64(1000);   // file size
   pickle.WriteString("id");  // filesystem id
   data.SetPickledData(
-      ui::Clipboard::GetFormatType("chromium/x-file-system-files"), pickle);
+      ui::ClipboardFormatType::GetType("chromium/x-file-system-files"), pickle);
   data_offer.SetDropData(&file_helper, data);
 
   base::ScopedFD read_pipe;
diff --git a/components/favicon/core/large_icon_service.h b/components/favicon/core/large_icon_service.h
index 230f06a..5d7d649d 100644
--- a/components/favicon/core/large_icon_service.h
+++ b/components/favicon/core/large_icon_service.h
@@ -40,8 +40,8 @@
   // - Returns the default fallback icon style.
   // For cases 4 and 5, this function returns the style of the fallback icon
   // instead of rendering an icon so clients can render the icon themselves.
-  // TODO(crbug.com/903617): Rename to GetLargeIconRawBitmapOrFallbackStyle.
-  virtual base::CancelableTaskTracker::TaskId GetLargeIconOrFallbackStyle(
+  virtual base::CancelableTaskTracker::TaskId
+  GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       const GURL& page_url,
       int min_source_size_in_pixel,
       int desired_size_in_pixel,
@@ -50,7 +50,8 @@
 
   // Behaves the same as GetLargeIconOrFallbackStyle(), only returns the large
   // icon (if available) decoded.
-  virtual base::CancelableTaskTracker::TaskId GetLargeIconImageOrFallbackStyle(
+  virtual base::CancelableTaskTracker::TaskId
+  GetLargeIconImageOrFallbackStyleForPageUrl(
       const GURL& page_url,
       int min_source_size_in_pixel,
       int desired_size_in_pixel,
diff --git a/components/favicon/core/large_icon_service_impl.cc b/components/favicon/core/large_icon_service_impl.cc
index 2ebd9b6..c3ee156 100644
--- a/components/favicon/core/large_icon_service_impl.cc
+++ b/components/favicon/core/large_icon_service_impl.cc
@@ -466,7 +466,7 @@
 LargeIconServiceImpl::~LargeIconServiceImpl() {}
 
 base::CancelableTaskTracker::TaskId
-LargeIconServiceImpl::GetLargeIconOrFallbackStyle(
+LargeIconServiceImpl::GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
     const GURL& page_url,
     int min_source_size_in_pixel,
     int desired_size_in_pixel,
@@ -478,7 +478,7 @@
 }
 
 base::CancelableTaskTracker::TaskId
-LargeIconServiceImpl::GetLargeIconImageOrFallbackStyle(
+LargeIconServiceImpl::GetLargeIconImageOrFallbackStyleForPageUrl(
     const GURL& page_url,
     int min_source_size_in_pixel,
     int desired_size_in_pixel,
diff --git a/components/favicon/core/large_icon_service_impl.h b/components/favicon/core/large_icon_service_impl.h
index e9379ab0e..934e942 100644
--- a/components/favicon/core/large_icon_service_impl.h
+++ b/components/favicon/core/large_icon_service_impl.h
@@ -36,13 +36,15 @@
   ~LargeIconServiceImpl() override;
 
   // LargeIconService Implementation.
-  base::CancelableTaskTracker::TaskId GetLargeIconOrFallbackStyle(
+  base::CancelableTaskTracker::TaskId
+  GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       const GURL& page_url,
       int min_source_size_in_pixel,
       int desired_size_in_pixel,
       const favicon_base::LargeIconCallback& callback,
       base::CancelableTaskTracker* tracker) override;
-  base::CancelableTaskTracker::TaskId GetLargeIconImageOrFallbackStyle(
+  base::CancelableTaskTracker::TaskId
+  GetLargeIconImageOrFallbackStyleForPageUrl(
       const GURL& page_url,
       int min_source_size_in_pixel,
       int desired_size_in_pixel,
diff --git a/components/favicon/core/large_icon_service_impl_unittest.cc b/components/favicon/core/large_icon_service_impl_unittest.cc
index 95b1e383d..b7917db7 100644
--- a/components/favicon/core/large_icon_service_impl_unittest.cc
+++ b/components/favicon/core/large_icon_service_impl_unittest.cc
@@ -521,14 +521,14 @@
       int desired_size_in_pixel) {
     // Switch over testing two analogous functions based on the bool param.
     if (GetParam()) {
-      large_icon_service_.GetLargeIconOrFallbackStyle(
+      large_icon_service_.GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
           page_url, min_source_size_in_pixel, desired_size_in_pixel,
           base::BindRepeating(
               &LargeIconServiceGetterTest::RawBitmapResultCallback,
               base::Unretained(this)),
           &cancelable_task_tracker_);
     } else {
-      large_icon_service_.GetLargeIconImageOrFallbackStyle(
+      large_icon_service_.GetLargeIconImageOrFallbackStyleForPageUrl(
           page_url, min_source_size_in_pixel, desired_size_in_pixel,
           base::BindRepeating(&LargeIconServiceGetterTest::ImageResultCallback,
                               base::Unretained(this)),
diff --git a/components/invalidation/impl/fcm_invalidation_listener.cc b/components/invalidation/impl/fcm_invalidation_listener.cc
index 41dc2a4..70bd337 100644
--- a/components/invalidation/impl/fcm_invalidation_listener.cc
+++ b/components/invalidation/impl/fcm_invalidation_listener.cc
@@ -243,6 +243,11 @@
 FCMInvalidationListener::CollectDebugData() const {
   std::unique_ptr<base::DictionaryValue> return_value =
       per_user_topic_registration_manager_->CollectDebugData();
+  return_value->SetString("FCM channel state",
+                          InvalidatorStateToString(fcm_network_state_));
+  return_value->SetString(
+      "Subscription channel state",
+      InvalidatorStateToString(subscription_channel_state_));
   for (const Topic& topic : registered_topics_) {
     if (!return_value->HasKey(topic)) {
       return_value->SetString(topic, "Unregistered");
diff --git a/components/invalidation/impl/fcm_network_handler.cc b/components/invalidation/impl/fcm_network_handler.cc
index 410742c..59e0fd1 100644
--- a/components/invalidation/impl/fcm_network_handler.cc
+++ b/components/invalidation/impl/fcm_network_handler.cc
@@ -111,6 +111,8 @@
 
 void FCMNetworkHandler::DidRetrieveToken(const std::string& subscription_token,
                                          InstanceID::Result result) {
+  UMA_HISTOGRAM_ENUMERATION("FCMInvalidations.InitialTokenRetrievalStatus",
+                            result, InstanceID::Result::LAST_RESULT + 1);
   switch (result) {
     case InstanceID::SUCCESS:
       // The received token is assumed to be valid, therefore, we reschedule
diff --git a/components/invalidation/impl/per_user_topic_registration_manager.cc b/components/invalidation/impl/per_user_topic_registration_manager.cc
index 3b1a907..1c05a26 100644
--- a/components/invalidation/impl/per_user_topic_registration_manager.cc
+++ b/components/invalidation/impl/per_user_topic_registration_manager.cc
@@ -246,55 +246,74 @@
       parse_json_, url_loader_factory_);
 }
 
+void PerUserTopicRegistrationManager::ActOnSuccesfullRegistration(
+    const Topic& topic,
+    const std::string& private_topic_name,
+    PerUserTopicRegistrationRequest::RequestType type) {
+  auto it = registration_statuses_.find(topic);
+  it->second->request_backoff_.InformOfRequest(true);
+  registration_statuses_.erase(it);
+  if (type == PerUserTopicRegistrationRequest::SUBSCRIBE) {
+    DictionaryPrefUpdate update(local_state_, kTypeRegisteredForInvalidation);
+    update->SetKey(topic, base::Value(private_topic_name));
+    topic_to_private_topic_[topic] = private_topic_name;
+    local_state_->CommitPendingWrite();
+  }
+  bool all_subscription_completed = true;
+  for (const auto& entry : registration_statuses_) {
+    if (entry.second->type == PerUserTopicRegistrationRequest::SUBSCRIBE) {
+      all_subscription_completed = false;
+    }
+  }
+  // Emit ENABLED once we recovered from failed request.
+  if (all_subscription_completed &&
+      base::FeatureList::IsEnabled(
+          invalidation::switches::kFCMInvalidationsConservativeEnabling)) {
+    NotifySubscriptionChannelStateChange(INVALIDATIONS_ENABLED);
+  }
+}
+
+void PerUserTopicRegistrationManager::ScheduleRequestForRepetition(
+    const Topic& topic) {
+  auto completition_callback = base::BindOnce(
+      &PerUserTopicRegistrationManager::RegistrationFinishedForTopic,
+      base::Unretained(this));
+  registration_statuses_[topic]->completion_callback =
+      std::move(completition_callback);
+  registration_statuses_[topic]->request_backoff_.InformOfRequest(false);
+  registration_statuses_[topic]->request_retry_timer_.Start(
+      FROM_HERE,
+      registration_statuses_[topic]->request_backoff_.GetTimeUntilRelease(),
+      base::BindRepeating(
+          &PerUserTopicRegistrationManager::StartRegistrationRequest,
+          base::Unretained(this), topic));
+}
+
 void PerUserTopicRegistrationManager::RegistrationFinishedForTopic(
     Topic topic,
     Status code,
     std::string private_topic_name,
     PerUserTopicRegistrationRequest::RequestType type) {
   if (code.IsSuccess()) {
-    auto it = registration_statuses_.find(topic);
-    registration_statuses_.erase(it);
-    if (type == PerUserTopicRegistrationRequest::SUBSCRIBE) {
-      DictionaryPrefUpdate update(local_state_, kTypeRegisteredForInvalidation);
-      update->SetKey(topic, base::Value(private_topic_name));
-      topic_to_private_topic_[topic] = private_topic_name;
-      local_state_->CommitPendingWrite();
-    }
-    bool all_subscription_completed = true;
-    for (const auto& entry : registration_statuses_) {
-      if (entry.second->type == PerUserTopicRegistrationRequest::SUBSCRIBE) {
-        all_subscription_completed = false;
-      }
-    }
-    // Emit ENABLED once we recovered from failed request.
-    if (all_subscription_completed &&
-        base::FeatureList::IsEnabled(
-            invalidation::switches::kFCMInvalidationsConservativeEnabling)) {
-      NotifySubscriptionChannelStateChange(INVALIDATIONS_ENABLED);
-    }
+    ActOnSuccesfullRegistration(topic, private_topic_name, type);
   } else {
+    auto it = registration_statuses_.find(topic);
+    it->second->request_backoff_.InformOfRequest(false);
     if (code.IsAuthFailure()) {
       // Re-request access token and fire registrations again.
       RequestAccessToken();
     } else {
-      // If one of the registration requests failed emit SUBSCRIPTION_FAILURE.
+      // If one of the registration requests failed, emit SUBSCRIPTION_FAILURE.
       if (type == PerUserTopicRegistrationRequest::SUBSCRIBE &&
           base::FeatureList::IsEnabled(
               invalidation::switches::kFCMInvalidationsConservativeEnabling)) {
         NotifySubscriptionChannelStateChange(SUBSCRIPTION_FAILURE);
       }
-      auto completition_callback = base::BindOnce(
-          &PerUserTopicRegistrationManager::RegistrationFinishedForTopic,
-          base::Unretained(this));
-      registration_statuses_[topic]->completion_callback =
-          std::move(completition_callback);
-      registration_statuses_[topic]->request_backoff_.InformOfRequest(false);
-      registration_statuses_[topic]->request_retry_timer_.Start(
-          FROM_HERE,
-          registration_statuses_[topic]->request_backoff_.GetTimeUntilRelease(),
-          base::BindRepeating(
-              &PerUserTopicRegistrationManager::StartRegistrationRequest,
-              base::Unretained(this), topic));
+      if (!code.ShouldRetry()) {
+        registration_statuses_.erase(it);
+        return;
+      }
+      ScheduleRequestForRepetition(topic);
     }
   }
 }
@@ -412,6 +431,7 @@
     return_value->SetString(topic_to_private_topic.first,
                             topic_to_private_topic.second);
   }
+  return_value->SetString("Instance id token", token_);
   return return_value;
 }
 
diff --git a/components/invalidation/impl/per_user_topic_registration_manager.h b/components/invalidation/impl/per_user_topic_registration_manager.h
index 2ea5696e..998138b 100644
--- a/components/invalidation/impl/per_user_topic_registration_manager.h
+++ b/components/invalidation/impl/per_user_topic_registration_manager.h
@@ -85,6 +85,11 @@
   // Tries to register |id|. No retry in case of failure.
   void StartRegistrationRequest(const Topic& id);
 
+  void ActOnSuccesfullRegistration(
+      const Topic& topic,
+      const std::string& private_topic_name,
+      PerUserTopicRegistrationRequest::RequestType type);
+  void ScheduleRequestForRepetition(const Topic& topic);
   void RegistrationFinishedForTopic(
       Topic topic,
       Status code,
diff --git a/components/invalidation/impl/per_user_topic_registration_manager_unittest.cc b/components/invalidation/impl/per_user_topic_registration_manager_unittest.cc
index c60c6b5..3b6d382a 100644
--- a/components/invalidation/impl/per_user_topic_registration_manager_unittest.cc
+++ b/components/invalidation/impl/per_user_topic_registration_manager_unittest.cc
@@ -232,7 +232,7 @@
 
   AddCorrectSubscriptionResponce(
       /* private_topic */ std::string(), kFakeInstanceIdToken,
-      net::HTTP_FORBIDDEN);
+      net::HTTP_INTERNAL_SERVER_ERROR);
 
   per_user_topic_registration_manager->UpdateRegisteredTopics(
       ids, kFakeInstanceIdToken);
@@ -243,6 +243,25 @@
       per_user_topic_registration_manager->HaveAllRequestsFinishedForTest());
 }
 
+TEST_F(PerUserTopicRegistrationManagerTest, ShouldRepeatRequestsOnForbidden) {
+  TopicSet ids = GetSequenceOfTopics(kInvalidationObjectIdsCount);
+
+  auto per_user_topic_registration_manager = BuildRegistrationManager();
+  ASSERT_TRUE(per_user_topic_registration_manager->GetRegisteredIds().empty());
+
+  AddCorrectSubscriptionResponce(
+      /* private_topic */ std::string(), kFakeInstanceIdToken,
+      net::HTTP_FORBIDDEN);
+
+  per_user_topic_registration_manager->UpdateRegisteredTopics(
+      ids, kFakeInstanceIdToken);
+  base::RunLoop().RunUntilIdle();
+
+  EXPECT_TRUE(per_user_topic_registration_manager->GetRegisteredIds().empty());
+  EXPECT_TRUE(
+      per_user_topic_registration_manager->HaveAllRequestsFinishedForTest());
+}
+
 TEST_F(PerUserTopicRegistrationManagerTest,
        ShouldDisableIdsAndDeleteFromPrefs) {
   TopicSet ids = GetSequenceOfTopics(kInvalidationObjectIdsCount);
diff --git a/components/invalidation/impl/per_user_topic_registration_request.cc b/components/invalidation/impl/per_user_topic_registration_request.cc
index b63d12f..6e556680 100644
--- a/components/invalidation/impl/per_user_topic_registration_request.cc
+++ b/components/invalidation/impl/per_user_topic_registration_request.cc
@@ -116,14 +116,18 @@
     std::unique_ptr<std::string> response_body) {
 
   if (response_code != net::HTTP_OK) {
-    std::move(request_completed_callback_)
-        .Run(Status((response_code == net::HTTP_UNAUTHORIZED)
-                        ? StatusCode::AUTH_FAILURE
-                        : StatusCode::FAILED,
-                    base::StringPrintf("HTTP Error: %d", response_code)),
-             std::string());
+    StatusCode status = StatusCode::FAILED;
+    if (response_code == net::HTTP_UNAUTHORIZED) {
+      status = StatusCode::AUTH_FAILURE;
+    } else if (response_code >= 400 && response_code <= 499) {
+      status = StatusCode::FAILED_NON_RETRIABLE;
+    }
     RecordRequestStatus(SubscriptionStatus::kHttpFailure, type_, topic_,
                         net_error, response_code);
+    std::move(request_completed_callback_)
+        .Run(
+            Status(status, base::StringPrintf("HTTP Error: %d", response_code)),
+            std::string());
     return;
   }
 
diff --git a/components/invalidation/impl/per_user_topic_registration_request_unittest.cc b/components/invalidation/impl/per_user_topic_registration_request_unittest.cc
index b2fe913..42478912 100644
--- a/components/invalidation/impl/per_user_topic_registration_request_unittest.cc
+++ b/components/invalidation/impl/per_user_topic_registration_request_unittest.cc
@@ -282,4 +282,58 @@
   EXPECT_EQ(status.message, std::string());
 }
 
+class PerUserTopicRegistrationRequestParamTest
+    : public PerUserTopicRegistrationRequestTest,
+      public testing::WithParamInterface<net::HttpStatusCode> {
+ public:
+  PerUserTopicRegistrationRequestParamTest() = default;
+  ~PerUserTopicRegistrationRequestParamTest() override = default;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(PerUserTopicRegistrationRequestParamTest);
+};
+
+TEST_P(PerUserTopicRegistrationRequestParamTest,
+       ShouldNotSubscribeWhenNonRepeatableError) {
+  std::string token = "1234567890";
+  std::string base_url = "http://valid-url.test";
+  std::string topic = "test";
+  std::string project_id = "smarty-pants-12345";
+  PerUserTopicRegistrationRequest::RequestType type =
+      PerUserTopicRegistrationRequest::SUBSCRIBE;
+
+  base::MockCallback<PerUserTopicRegistrationRequest::CompletedCallback>
+      callback;
+  Status status(StatusCode::FAILED, "initial");
+  std::string private_topic;
+  EXPECT_CALL(callback, Run(_, _))
+      .WillOnce(DoAll(SaveArg<0>(&status), SaveArg<1>(&private_topic)));
+
+  PerUserTopicRegistrationRequest::Builder builder;
+  std::unique_ptr<PerUserTopicRegistrationRequest> request =
+      builder.SetToken(token)
+          .SetScope(base_url)
+          .SetPublicTopicName(topic)
+          .SetProjectId(project_id)
+          .SetType(type)
+          .Build();
+  network::URLLoaderCompletionStatus response_status(net::OK);
+
+  url_loader_factory()->AddResponse(
+      url(request.get()), CreateHeadersForTest(GetParam()),
+      /* response_body */ std::string(), response_status);
+  request->Start(callback.Get(),
+                 base::BindRepeating(&syncer::JsonUnsafeParser::Parse),
+                 url_loader_factory());
+  base::RunLoop().RunUntilIdle();
+
+  EXPECT_EQ(status.code, StatusCode::FAILED_NON_RETRIABLE);
+}
+
+INSTANTIATE_TEST_CASE_P(,
+                        PerUserTopicRegistrationRequestParamTest,
+                        testing::Values(net::HTTP_BAD_REQUEST,
+                                        net::HTTP_FORBIDDEN,
+                                        net::HTTP_NOT_FOUND));
+
 }  // namespace syncer
diff --git a/components/invalidation/impl/status.h b/components/invalidation/impl/status.h
index 899b7ce5..62ad8b0 100644
--- a/components/invalidation/impl/status.h
+++ b/components/invalidation/impl/status.h
@@ -28,7 +28,10 @@
   // Failed with HTTP 401.
   AUTH_FAILURE = 1,
   // The operation failed.
-  FAILED = 2
+  FAILED = 2,
+  // Something is terribly wrong and we shohuldn't retry the requests until
+  // next startup.
+  FAILED_NON_RETRIABLE = 3,
 };
 
 // This struct provides the status code of a request and an optional message
@@ -42,6 +45,7 @@
 
   bool IsSuccess() const { return code == StatusCode::SUCCESS; }
   bool IsAuthFailure() const { return code == StatusCode::AUTH_FAILURE; }
+  bool ShouldRetry() const { return code != StatusCode::FAILED_NON_RETRIABLE; }
 
   StatusCode code;
   // The message is not meant to be displayed to the user.
diff --git a/components/management_strings.grdp b/components/management_strings.grdp
index ed0c163..9e66e7b7 100644
--- a/components/management_strings.grdp
+++ b/components/management_strings.grdp
@@ -1,70 +1,72 @@
 <?xml version="1.0" encoding="utf-8"?>
 <grit-part>
-  <message name="IDS_MANAGEMENT_TITLE" desc="Title of chrome://management page, which shows the administrator's capabilities in a managed environment" translateable="false">
-    Management overview
+  <message name="IDS_MANAGEMENT_TITLE" desc="Title of chrome://management page, which shows the administrator's capabilities in a managed environment">
+    <ph name="PRODUCT_NAME">$1<ex>Chrome OS</ex></ph> management
   </message>
-
-  <message name="IDS_MANAGEMENT_TITLE_BY" desc="Title of chrome://management page, shows when device managed by known organization" translateable="false">
+  <message name="IDS_MANAGEMENT_TITLE_BY" desc="Title of chrome://management page, shows when device managed by known organization">
     Device managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>
   </message>
 
-  <message name="IDS_MANAGEMENT_DEVICE_NOT_MANAGED" desc="Message indicating that the device is not managed" translateable="false">
-    Your device is not managed by an administrator
+  <message name="IDS_MANAGEMENT_DEVICE_NOT_MANAGED" desc="Message indicating that the device is not managed">
+    Your device is not managed by an administrator.
   </message>
-  <message name="IDS_MANAGEMENT_DEVICE_MANAGED_BY" desc="Message indicating that the device is enterprise enrolled to be managed by an administrator, from a specific domain" translateable="false">
-    Your device is managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>. This means your administrators may remotely configure your device and account.
+  <message name="IDS_MANAGEMENT_DEVICE_MANAGED_BY" desc="Message indicating that the device is enterprise enrolled to be managed by an administrator, from a specific domain">
+    Your device is managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>. This means your administrator may remotely configure your device.
   </message>
-  <message name="IDS_MANAGEMENT_DEVICE_MANAGED" desc="Message indicating that the device is enterprise enrolled to be managed by an administrator" translateable="false">
-    Your device is managed by an administrator
+  <message name="IDS_MANAGEMENT_DEVICE_MANAGED_BY_ACCOUNT_MANAGED_BY" desc="Message indicating that the device is enterprise enrolled to be managed by an administrator, from a specific domain. And account is managed by an administrator, from another specific domain.">
+    Your device is managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph > and your account is managed by <ph name="ACCOUNT_DOMAIN">$2<ex>example.com</ex></ph>. This means your administrators may remotely configure your device and account.
+  </message>
+  <message name="IDS_MANAGEMENT_DEVICE_AND_ACCOUNT_MANAGED_BY" desc="Message indicating that the device and account is enterprise enrolled to be managed by an administrator, from a specific domain">
+    Your device and account is managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>. This means your administrator may remotely configure your device and account.
+  </message>
+  <message name="IDS_MANAGEMENT_ACCOUNT_MANAGED_BY" desc="Message indicating that the account is enterprise enrolled to be managed by an administrator">
+    Your account is managed by <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>. This means your administrator may remotely configure your account.
   </message>
 
-  <message name="IDS_MANAGEMENT_DEVICE_REPORTING" desc="Title of the types of device reporting section of the page" translateable="false">
-    Device reporting
+  <message name="IDS_MANAGEMENT_DEVICE_REPORTING" desc="Title of the types of device reporting section of the page">
+    Reporting
   </message>
   <message name="IDS_MANAGEMENT_BROWSER_REPORTING" desc="Title of the types of browser reporting section of the page" translateable="false">
     Browser reporting
   </message>
-  <message name="IDS_MANAGEMENT_DEVICE_CONFIGURATION" desc="Message telling users that their administrator has set some specific policies on their device" translateable="false">
+  <message name="IDS_MANAGEMENT_DEVICE_CONFIGURATION" desc="Message telling users that their administrator has set some specific policies on their device">
     Your device has been configured to:
   </message>
-  <message name="IDS_MANAGEMENT_LOG_UPLOAD_ENABLED" desc="Message stating that administrators have access to system logs on user's device." translateable="false">
+  <message name="IDS_MANAGEMENT_LOG_UPLOAD_ENABLED" desc="Message stating that administrators have access to system logs on user's device.">
     send system logs to the management server
   </message>
-  <message name="IDS_MANAGEMENT_REPORT_DEVICE_ACTIVITY_TIMES" desc="Message stating that administrators see device activity times." translateable="false">
+  <message name="IDS_MANAGEMENT_REPORT_DEVICE_ACTIVITY_TIMES" desc="Message stating that administrators see device activity times.">
     report time periods when a user is active on the device
   </message>
-  <message name="IDS_MANAGEMENT_REPORT_DEVICE_HARDWARE_STATUS" desc="Message stating that administrators see device hardware status." translateable="false">
+  <message name="IDS_MANAGEMENT_REPORT_DEVICE_HARDWARE_STATUS" desc="Message stating that administrators see device hardware status.">
     report hardware statistics such as CPU/RAM usage
   </message>
-  <message name="IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES" desc="Message stating that administrators see device network interfaces." translateable="false">
+  <message name="IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES" desc="Message stating that administrators see device network interfaces.">
     report list of network interfaces with their types and hardware addresses
   </message>
-  <message name="IDS_MANAGEMENT_REPORT_DEVICE_USERS" desc="Message stating that administrators see all users that have used the device recently." translateable="false">
+  <message name="IDS_MANAGEMENT_REPORT_DEVICE_USERS" desc="Message stating that administrators see all users that have used the device recently.">
     report list of device users that have recently logged in
   </message>
 
-  <message name="IDS_MANAGEMENT_EXTENSION_REPORTING" desc="Title of the force installed extensions section of the page" translateable="false">
+  <message name="IDS_MANAGEMENT_EXTENSION_REPORTING" desc="Title of the force installed extensions section of the page">
     Extension reporting
   </message>
-  <message name="IDS_MANAGEMENT_EXTENSIONS_INSTALLED" desc="Message describing that the administrator has installed some powerful extensions on the managed user's browser" translateable="false">
-    Your administrators have installed extensions with powerful capabilities
+  <message name="IDS_MANAGEMENT_EXTENSIONS_INSTALLED" desc="Message describing that the administrator has installed some powerful extensions on the managed user's browser">
+    Your administrators have installed extensions with powerful capabilities.
   </message>
-  <message name="IDS_MANAGEMENT_EXTENSIONS_NAME" desc="Title of a column of the extension table showing the name of the extension" translateable="false">
+  <message name="IDS_MANAGEMENT_EXTENSIONS_NAME" desc="Title of a column of the extension table showing the name of the extension">
     Name
   </message>
-  <message name="IDS_MANAGEMENT_EXTENSIONS_PERMISSIONS" desc="Title of a column of the extension table showing the permissions of the extension" translateable="false">
+  <message name="IDS_MANAGEMENT_EXTENSIONS_PERMISSIONS" desc="Title of a column of the extension table showing the permissions of the extension">
     Permissions
   </message>
 
-  <message name="IDS_MANAGEMENT_LOCAL_TRUST_ROOTS" desc="Title of the types of local trust roots section of the page" translateable="false">
-    Local trust roots
+  <message name="IDS_MANAGEMENT_LOCAL_TRUST_ROOTS" desc="Title of the types of local trust roots section of the page">
+    Custom root certificates
   </message>
   <message name="IDS_MANAGEMENT_TRUST_ROOTS_NOT_CONFIGURED" desc="Message describing that the administrators have not installed certificates" translateable="false">
     The contents of websites that you visit is not seen by your administrators
   </message>
-  <message name="IDS_MANAGEMENT_DESKTOP_MONITORING_NOTICE" desc="Message explaining that the administrators have ways to monitor users outside of chrome's control" translateable="false">
-    Administrators may have other ways of monitoring users, outside of Chrome.
-  </message>
   <message name="IDS_MANAGEMENT_EXTENSION_REPORT_MACHINE_NAME" desc="Message explaining that an extension currently reports the user's machine name" translateable="false">
     Report your machine's name
   </message>
@@ -93,8 +95,11 @@
     Report how much time you spend on each website
   </message>
   <if expr="chromeos">
-    <message name="IDS_MANAGEMENT_TRUST_ROOTS_CONFIGURED" desc="Message describing that the administrators have installed their own certificates" translateable="false">
-      Your account/device has been configured with local trust roots, which might allow administrators to see the contents of websites that you visit
+    <message name="IDS_MANAGEMENT_TRUST_ROOTS_CONFIGURED" desc="Message describing that the administrators have installed their own certificates">
+      Your administrator has configured custom root certificates, which may allow the administrator to see the contents of websites that you visit.
     </message>
   </if>
+  <message name="IDS_MANAGEMENT_DESKTOP_MONITORING_NOTICE" desc="Message explaining that the administrators have ways to monitor users outside of chrome's control" translateable="false">
+    Administrators may have other ways of monitoring users, outside of Chrome.
+  </message>
 </grit-part>
diff --git a/components/metrics/call_stack_profile_builder.cc b/components/metrics/call_stack_profile_builder.cc
index 351c74d..7db290c3 100644
--- a/components/metrics/call_stack_profile_builder.cc
+++ b/components/metrics/call_stack_profile_builder.cc
@@ -47,8 +47,10 @@
 
 CallStackProfileBuilder::CallStackProfileBuilder(
     const CallStackProfileParams& profile_params,
+    const WorkIdRecorder* work_id_recorder,
     base::OnceClosure completed_callback)
-    : profile_start_time_(base::TimeTicks::Now()) {
+    : work_id_recorder_(work_id_recorder),
+      profile_start_time_(base::TimeTicks::Now()) {
   completed_callback_ = std::move(completed_callback);
   sampled_profile_.set_process(
       ToExecutionContextProcess(profile_params.process));
@@ -59,7 +61,20 @@
 
 CallStackProfileBuilder::~CallStackProfileBuilder() = default;
 
-// static
+// This function is invoked on the profiler thread while the target thread is
+// suspended so must not take any locks, including indirectly through use of
+// heap allocation, LOG, CHECK, or DCHECK.
+void CallStackProfileBuilder::RecordMetadata() {
+  if (!work_id_recorder_)
+    return;
+  unsigned int work_id = work_id_recorder_->RecordWorkId();
+  // A work id of 0 indicates that the message loop has not yet started.
+  if (work_id == 0)
+    return;
+  is_continued_work_ = (last_work_id_ == work_id);
+  last_work_id_ = work_id;
+}
+
 void CallStackProfileBuilder::OnSampleCompleted(
     std::vector<base::StackSamplingProfiler::Frame> frames) {
   // Write CallStackProfile::Stack protobuf message.
@@ -110,6 +125,8 @@
   CallStackProfile::StackSample* stack_sample_proto =
       call_stack_profile->add_stack_sample();
   stack_sample_proto->set_stack_index(stack_loc->second);
+  if (is_continued_work_)
+    stack_sample_proto->set_continued_work(is_continued_work_);
 }
 
 void CallStackProfileBuilder::OnProfileCompleted(
diff --git a/components/metrics/call_stack_profile_builder.h b/components/metrics/call_stack_profile_builder.h
index 078511e2..0f22f1c 100644
--- a/components/metrics/call_stack_profile_builder.h
+++ b/components/metrics/call_stack_profile_builder.h
@@ -5,6 +5,7 @@
 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_BUILDER_H_
 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_BUILDER_H_
 
+#include <limits>
 #include <map>
 #include <vector>
 
@@ -18,6 +19,23 @@
 
 namespace metrics {
 
+// Interface that allows the CallStackProfileBuilder to provide ids for distinct
+// work items. Samples with the same id are tagged as coming from the same work
+// item in the recorded samples.
+class WorkIdRecorder {
+ public:
+  WorkIdRecorder() = default;
+  virtual ~WorkIdRecorder() = default;
+
+  // This function is invoked on the profiler thread while the target thread is
+  // suspended so must not take any locks, including indirectly through use of
+  // heap allocation, LOG, CHECK, or DCHECK.
+  virtual unsigned int RecordWorkId() const = 0;
+
+  WorkIdRecorder(const WorkIdRecorder&) = delete;
+  WorkIdRecorder& operator=(const WorkIdRecorder&) = delete;
+};
+
 // An instance of the class is meant to be passed to base::StackSamplingProfiler
 // to collect profiles. The profiles collected are uploaded via the metrics log.
 //
@@ -35,11 +53,13 @@
   // thus the callback must be callable on any thread.
   explicit CallStackProfileBuilder(
       const CallStackProfileParams& profile_params,
+      const WorkIdRecorder* work_id_recorder = nullptr,
       base::OnceClosure completed_callback = base::OnceClosure());
 
   ~CallStackProfileBuilder() override;
 
   // base::StackSamplingProfiler::ProfileBuilder:
+  void RecordMetadata() override;
   void OnSampleCompleted(
       std::vector<base::StackSamplingProfiler::Frame> frames) override;
   void OnProfileCompleted(base::TimeDelta profile_duration,
@@ -68,6 +88,10 @@
                     const CallStackProfile::Stack* stack2) const;
   };
 
+  unsigned int last_work_id_ = std::numeric_limits<unsigned int>::max();
+  bool is_continued_work_ = false;
+  const WorkIdRecorder* const work_id_recorder_;
+
   // The SampledProfile protobuf message which contains the collected stack
   // samples.
   SampledProfile sampled_profile_;
diff --git a/components/metrics/call_stack_profile_builder_unittest.cc b/components/metrics/call_stack_profile_builder_unittest.cc
index d2fd084..a144f3e 100644
--- a/components/metrics/call_stack_profile_builder_unittest.cc
+++ b/components/metrics/call_stack_profile_builder_unittest.cc
@@ -4,6 +4,8 @@
 
 #include "components/metrics/call_stack_profile_builder.h"
 
+#include <memory>
+
 #include "base/files/file_path.h"
 #include "base/sampling_heap_profiler/module_cache.h"
 #include "base/test/bind_test_util.h"
@@ -30,6 +32,7 @@
  public:
   TestingCallStackProfileBuilder(
       const CallStackProfileParams& profile_params,
+      const WorkIdRecorder* work_id_recorder = nullptr,
       base::OnceClosure completed_callback = base::OnceClosure());
 
   ~TestingCallStackProfileBuilder() override;
@@ -47,8 +50,11 @@
 
 TestingCallStackProfileBuilder::TestingCallStackProfileBuilder(
     const CallStackProfileParams& profile_params,
+    const WorkIdRecorder* work_id_recorder,
     base::OnceClosure completed_callback)
-    : CallStackProfileBuilder(profile_params, std::move(completed_callback)) {}
+    : CallStackProfileBuilder(profile_params,
+                              work_id_recorder,
+                              std::move(completed_callback)) {}
 
 TestingCallStackProfileBuilder::~TestingCallStackProfileBuilder() = default;
 
@@ -65,7 +71,7 @@
   EXPECT_CALL(mock_closure, Run()).Times(1);
 
   auto profile_builder = std::make_unique<TestingCallStackProfileBuilder>(
-      kProfileParams, mock_closure.Get());
+      kProfileParams, nullptr, mock_closure.Get());
 
 #if defined(OS_WIN)
   uint64_t module_md5 = 0x46C3E4166659AC02ULL;
@@ -90,7 +96,9 @@
   std::vector<Frame> frames1 = {frame1, frame2};
   std::vector<Frame> frames2 = {frame3};
 
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames1);
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames2);
   profile_builder->OnProfileCompleted(base::TimeDelta::FromMilliseconds(500),
                                       base::TimeDelta::FromMilliseconds(100));
@@ -133,7 +141,9 @@
 
   ASSERT_EQ(2, profile.stack_sample_size());
   EXPECT_EQ(0, profile.stack_sample(0).stack_index());
+  EXPECT_FALSE(profile.stack_sample(0).has_continued_work());
   EXPECT_EQ(1, profile.stack_sample(1).stack_index());
+  EXPECT_FALSE(profile.stack_sample(1).has_continued_work());
 
   ASSERT_TRUE(profile.has_profile_duration_ms());
   EXPECT_EQ(500, profile.profile_duration_ms());
@@ -163,7 +173,9 @@
 
   // Two stacks are completed with the same frames therefore they are deduped
   // to one.
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames);
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames);
 
   profile_builder->OnProfileCompleted(base::TimeDelta(), base::TimeDelta());
@@ -207,7 +219,9 @@
   std::vector<Frame> frames2 = {frame2};
 
   // Two stacks are completed with the different frames therefore not deduped.
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames1);
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames2);
 
   profile_builder->OnProfileCompleted(base::TimeDelta(), base::TimeDelta());
@@ -250,6 +264,7 @@
 
   std::vector<Frame> frames = {frame1, frame2};
 
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames);
   profile_builder->OnProfileCompleted(base::TimeDelta(), base::TimeDelta());
 
@@ -301,6 +316,7 @@
 
   std::vector<Frame> frames = {frame1, frame2};
 
+  profile_builder->RecordMetadata();
   profile_builder->OnSampleCompleted(frames);
   profile_builder->OnProfileCompleted(base::TimeDelta(), base::TimeDelta());
 
@@ -334,4 +350,60 @@
   EXPECT_EQ(module_md5, profile.module_id(0).name_md5_prefix());
 }
 
-}  // namespace metrics
\ No newline at end of file
+TEST(CallStackProfileBuilderTest, WorkIds) {
+  class TestWorkIdRecorder : public WorkIdRecorder {
+   public:
+    unsigned int RecordWorkId() const override { return current_id; }
+
+    unsigned int current_id = 0;
+  };
+
+  TestWorkIdRecorder work_id_recorder;
+  auto profile_builder = std::make_unique<TestingCallStackProfileBuilder>(
+      kProfileParams, &work_id_recorder);
+
+#if defined(OS_WIN)
+  base::FilePath module_path(L"c:\\some\\path\\to\\chrome.exe");
+#else
+  base::FilePath module_path("/some/path/to/chrome");
+#endif
+
+  Module module = {0x1000, "1", module_path};
+  Frame frame = {0x1000 + 0x10, module};
+
+  // Id 0 means the message loop hasn't been started yet, so the sample should
+  // not have continued_work set.
+  profile_builder->RecordMetadata();
+  profile_builder->OnSampleCompleted({frame});
+
+  // The second sample with the same id should have continued_work set.
+  work_id_recorder.current_id = 1;
+  profile_builder->RecordMetadata();
+  profile_builder->OnSampleCompleted({frame});
+  profile_builder->RecordMetadata();
+  profile_builder->OnSampleCompleted({frame});
+
+  // Ids are in general non-contiguous across multiple samples.
+  work_id_recorder.current_id = 10;
+  profile_builder->RecordMetadata();
+  profile_builder->OnSampleCompleted({frame});
+  profile_builder->RecordMetadata();
+  profile_builder->OnSampleCompleted({frame});
+
+  profile_builder->OnProfileCompleted(base::TimeDelta::FromMilliseconds(500),
+                                      base::TimeDelta::FromMilliseconds(100));
+
+  const SampledProfile& proto = profile_builder->test_sampled_profile();
+
+  ASSERT_TRUE(proto.has_call_stack_profile());
+  const CallStackProfile& profile = proto.call_stack_profile();
+
+  ASSERT_EQ(5, profile.stack_sample_size());
+  EXPECT_FALSE(profile.stack_sample(0).has_continued_work());
+  EXPECT_FALSE(profile.stack_sample(1).has_continued_work());
+  EXPECT_TRUE(profile.stack_sample(2).continued_work());
+  EXPECT_FALSE(profile.stack_sample(3).has_continued_work());
+  EXPECT_TRUE(profile.stack_sample(4).continued_work());
+}
+
+}  // namespace metrics
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 0e320f7..dbfaa37 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -231,7 +231,7 @@
 
   // Use desired_size = 0 for getting the icon from the cache (so that the icon
   // is not poorly rescaled by LargeIconService).
-  large_icon_service_->GetLargeIconImageOrFallbackStyle(
+  large_icon_service_->GetLargeIconImageOrFallbackStyleForPageUrl(
       publisher_url, minimum_size_in_pixel, /*desired_size_in_pixel=*/0,
       base::Bind(&ContentSuggestionsService::OnGetFaviconFromCacheFinished,
                  base::Unretained(this), publisher_url, minimum_size_in_pixel,
diff --git a/components/ntp_tiles/icon_cacher_impl.cc b/components/ntp_tiles/icon_cacher_impl.cc
index 47ce15e..90b95a2 100644
--- a/components/ntp_tiles/icon_cacher_impl.cc
+++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -216,7 +216,7 @@
 
   // Desired size 0 means that we do not want the service to resize the image
   // (as we will not use it anyway).
-  large_icon_service_->GetLargeIconOrFallbackStyle(
+  large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       page_url, GetMinimumFetchingSizeForChromeSuggestionsFaviconsFromServer(),
       /*desired_size_in_pixel=*/0,
       base::Bind(&IconCacherImpl::OnGetLargeIconOrFallbackStyleFinished,
diff --git a/components/omnibox/browser/document_provider.cc b/components/omnibox/browser/document_provider.cc
index 470392ef..2867d53 100644
--- a/components/omnibox/browser/document_provider.cc
+++ b/components/omnibox/browser/document_provider.cc
@@ -8,6 +8,7 @@
 
 #include <string>
 #include <utility>
+#include <vector>
 
 #include "base/callback.h"
 #include "base/feature_list.h"
@@ -177,6 +178,7 @@
                              bool minimal_changes) {
   TRACE_EVENT0("omnibox", "DocumentProvider::Start");
   matches_.clear();
+  field_trial_triggered_ = false;
 
   // Perform various checks - feature is enabled, user is allowed to use the
   // feature, we're not under backoff, etc.
@@ -247,14 +249,35 @@
 }
 
 void DocumentProvider::AddProviderInfo(ProvidersInfo* provider_info) const {
-  // TODO(skare): Verify that we don't lose metrics based on what
-  // zero_suggest_provider and BaseSearchProvider add.
-  return;
+  provider_info->push_back(metrics::OmniboxEventProto_ProviderInfo());
+  metrics::OmniboxEventProto_ProviderInfo& new_entry = provider_info->back();
+  new_entry.set_provider(metrics::OmniboxEventProto::DOCUMENT);
+  new_entry.set_provider_done(done_);
+
+  if (field_trial_triggered_ || field_trial_triggered_in_session_) {
+    std::vector<uint32_t> field_trial_hashes;
+    OmniboxFieldTrial::GetActiveSuggestFieldTrialHashes(&field_trial_hashes);
+    for (uint32_t trial : field_trial_hashes) {
+      if (field_trial_triggered_) {
+        new_entry.mutable_field_trial_triggered()->Add(trial);
+      }
+      if (field_trial_triggered_in_session_) {
+        new_entry.mutable_field_trial_triggered_in_session()->Add(trial);
+      }
+    }
+  }
+}
+
+void DocumentProvider::ResetSession() {
+  field_trial_triggered_in_session_ = false;
+  field_trial_triggered_ = false;
 }
 
 DocumentProvider::DocumentProvider(AutocompleteProviderClient* client,
                                    AutocompleteProviderListener* listener)
     : AutocompleteProvider(AutocompleteProvider::TYPE_DOCUMENT),
+      field_trial_triggered_(false),
+      field_trial_triggered_in_session_(false),
       backoff_for_session_(false),
       client_(client),
       listener_(listener),
@@ -372,6 +395,11 @@
   int score2 = base::GetFieldTrialParamByFeatureAsInt(
       omnibox::kDocumentProvider, "DocumentScoreResult3", 300);
 
+  // Some users may be in a counterfactual study arm in which we perform all
+  // necessary work but do not forward the autocomplete matches.
+  bool in_counterfactual_group = base::GetFieldTrialParamByFeatureAsBool(
+      omnibox::kDocumentProvider, "DocumentProviderCounterfactualArm", false);
+
   // Clear the previous results now that new results are available.
   matches->clear();
   for (size_t i = 0; i < num_results; i++) {
@@ -450,7 +478,11 @@
           &match.description_class, 0, ACMatchClassification::NONE);
     }
     match.transition = ui::PAGE_TRANSITION_GENERATED;
-    matches->push_back(match);
+    if (!in_counterfactual_group) {
+      matches->push_back(match);
+    }
+    field_trial_triggered_ = true;
+    field_trial_triggered_in_session_ = true;
   }
   return true;
 }
diff --git a/components/omnibox/browser/document_provider.h b/components/omnibox/browser/document_provider.h
index ecb65346..f10b7b2 100644
--- a/components/omnibox/browser/document_provider.h
+++ b/components/omnibox/browser/document_provider.h
@@ -49,6 +49,7 @@
   void Stop(bool clear_cached_results, bool due_to_user_inactivity) override;
   void DeleteMatch(const AutocompleteMatch& match) override;
   void AddProviderInfo(ProvidersInfo* provider_info) const override;
+  void ResetSession() override;
 
   // Registers a client-side preference to enable document suggestions.
   static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
@@ -112,6 +113,12 @@
       const std::string& modified_timestamp_string,
       base::Time now);
 
+  // Whether a field trial has triggered for this query and this session,
+  // respectively. Works similarly to BaseSearchProvider, though this class does
+  // not inherit from it.
+  bool field_trial_triggered_;
+  bool field_trial_triggered_in_session_;
+
   // Whether the server has instructed us to backoff for this session (in
   // cases where the corpus is uninteresting).
   bool backoff_for_session_;
diff --git a/components/open_from_clipboard/BUILD.gn b/components/open_from_clipboard/BUILD.gn
index 2f9fa810..8df293d 100644
--- a/components/open_from_clipboard/BUILD.gn
+++ b/components/open_from_clipboard/BUILD.gn
@@ -10,13 +10,6 @@
     "clipboard_recent_content_ios.mm",
   ]
 
-  if (!is_ios) {
-    sources += [
-      "clipboard_recent_content_generic.cc",
-      "clipboard_recent_content_generic.h",
-    ]
-  }
-
   deps = [
     ":open_from_clipboard_impl",
     "//base",
@@ -25,6 +18,14 @@
     "//ui/base:base",
     "//url",
   ]
+
+  if (!is_ios) {
+    sources += [
+      "clipboard_recent_content_generic.cc",
+      "clipboard_recent_content_generic.h",
+    ]
+    deps += [ "//ui/base/clipboard" ]
+  }
 }
 
 # Helper classes used by "open_from_clipboard" target. These classes must have
@@ -66,10 +67,6 @@
     "clipboard_recent_content_ios_unittest.mm",
   ]
 
-  if (!is_ios) {
-    sources += [ "clipboard_recent_content_generic_unittest.cc" ]
-  }
-
   deps = [
     ":open_from_clipboard",
     ":open_from_clipboard_impl",
@@ -78,4 +75,9 @@
     "//ui/base:test_support",
     "//url",
   ]
+
+  if (!is_ios) {
+    sources += [ "clipboard_recent_content_generic_unittest.cc" ]
+    deps += [ "//ui/base/clipboard:clipboard_test_support" ]
+  }
 }
diff --git a/components/open_from_clipboard/clipboard_recent_content_generic_unittest.cc b/components/open_from_clipboard/clipboard_recent_content_generic_unittest.cc
index 425537b..cb2a7d9 100644
--- a/components/open_from_clipboard/clipboard_recent_content_generic_unittest.cc
+++ b/components/open_from_clipboard/clipboard_recent_content_generic_unittest.cc
@@ -11,7 +11,7 @@
 #include "base/strings/string16.h"
 #include "base/time/time.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "url/gurl.h"
 
 class ClipboardRecentContentGenericTest : public testing::Test {
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto
index 6a8612a..04de033 100644
--- a/components/policy/proto/device_management_backend.proto
+++ b/components/policy/proto/device_management_backend.proto
@@ -805,6 +805,8 @@
   // The battery discharge rate measured in mW. Positive if the battery is being
   // discharged, negative if it's being charged.
   optional int32 discharge_rate = 5;
+  // Battery charge percentage
+  optional int32 charge_rate = 6;
 }
 
 // Status of the single battery
diff --git a/components/safe_browsing/proto/csd.proto b/components/safe_browsing/proto/csd.proto
index 9989d942..2b1f601 100644
--- a/components/safe_browsing/proto/csd.proto
+++ b/components/safe_browsing/proto/csd.proto
@@ -309,6 +309,10 @@
   // Content area width in DIPs. This field should only be filled for extended
   // reporting users.
   optional int32 content_area_width = 10;
+
+  // Visual features of the current page. This field should only be filled for
+  // extended reporting users.
+  optional VisualFeatures visual_features = 11;
 }
 
 // The message is used for client response for login reputation requests.
@@ -351,6 +355,56 @@
   optional bytes verdict_token = 5;
 }
 
+// This message encapsulates all the visual features of the current page.
+message VisualFeatures {
+  // One bin in a color histogram.
+  message ColorHistogramBin {
+    // The average x-coordinate of the pixels in this bin.
+    optional float centroid_x = 1;
+
+    // The average y-coordinate of the pixels in this bin.
+    optional float centroid_y = 2;
+
+    // The quantized R-value for this bin.
+    optional int32 quantized_r = 3;
+
+    // The quantized G-value for this bin.
+    optional int32 quantized_g = 4;
+
+    // The quantized B-value for this bin.
+    optional int32 quantized_b = 5;
+
+    // The normalized weight of this bin.
+    optional float weight = 6;
+  }
+
+  // Represents the color histogram of a login page.
+  message ColorHistogram { repeated ColorHistogramBin bins = 1; }
+
+  // Color histogram of the current page.
+  optional ColorHistogram color_histogram = 1;
+
+  // Represents the blurred, downsampled image of the login page.
+  message BlurredImage {
+    // The width of the image.
+    optional int32 width = 1;
+
+    // The height of the image.
+    optional int32 height = 2;
+
+    // The image data, stored in RGB order. This will have length
+    // 3*width*height. The bytes are stored in row-major order, starting from
+    // the top most row.
+    optional bytes data = 3;
+  }
+
+  // Blurred, downsampled image of the current page.
+  optional BlurredImage image = 2;
+
+  // The final pHash for the current page.
+  optional bytes phash = 3;
+}
+
 message ClientMalwareResponse {
   required bool blacklist = 1;
   // The confirmed blacklisted bad IP and its url, which will be shown in
diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc
index c66834744..67b3a96e 100644
--- a/components/spellcheck/renderer/spellcheck_provider.cc
+++ b/components/spellcheck/renderer/spellcheck_provider.cc
@@ -192,14 +192,6 @@
   UMA_HISTOGRAM_COUNTS_1M("SpellCheck.api.async", text.length());
 }
 
-void SpellCheckProvider::CancelAllPendingRequests() {
-  for (WebTextCheckCompletions::iterator iter(&text_check_completions_);
-       !iter.IsAtEnd(); iter.Advance()) {
-    iter.GetCurrentValue()->DidCancelCheckingText();
-  }
-  text_check_completions_.Clear();
-}
-
 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
 void SpellCheckProvider::OnRespondSpellingService(
     int identifier,
diff --git a/components/spellcheck/renderer/spellcheck_provider.h b/components/spellcheck/renderer/spellcheck_provider.h
index d142707..2a5f671 100644
--- a/components/spellcheck/renderer/spellcheck_provider.h
+++ b/components/spellcheck/renderer/spellcheck_provider.h
@@ -96,7 +96,6 @@
   void RequestCheckingOfText(
       const blink::WebString& text,
       blink::WebTextCheckingCompletion* completion) override;
-  void CancelAllPendingRequests() override;
 
 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
   void OnRespondSpellingService(int identifier,
diff --git a/components/sync/driver/data_type_encryption_handler.h b/components/sync/driver/data_type_encryption_handler.h
index fa39e94..7c424d53 100644
--- a/components/sync/driver/data_type_encryption_handler.h
+++ b/components/sync/driver/data_type_encryption_handler.h
@@ -15,8 +15,8 @@
   DataTypeEncryptionHandler();
   virtual ~DataTypeEncryptionHandler();
 
-  // Returns true if a passphrase is required for encryption to proceed, false
-  // otherwise.
+  // Returns whether a passphrase is required for encryption or decryption to
+  // proceed.
   virtual bool IsPassphraseRequired() const = 0;
 
   // Returns the current set of encrypted data types.
diff --git a/components/sync/driver/sync_driver_switches.cc b/components/sync/driver/sync_driver_switches.cc
index b631435..eb4d3801 100644
--- a/components/sync/driver/sync_driver_switches.cc
+++ b/components/sync/driver/sync_driver_switches.cc
@@ -125,7 +125,7 @@
 
 // Enable USS implementation of autofill wallet datatype.
 const base::Feature kSyncUSSAutofillWalletData{
-    "SyncUSSAutofillWalletData", base::FEATURE_ENABLED_BY_DEFAULT};
+    "SyncUSSAutofillWalletData", base::FEATURE_DISABLED_BY_DEFAULT};
 
 // Enable USS implementation of autofill wallet metadata datatype.
 const base::Feature kSyncUSSAutofillWalletMetadata{
diff --git a/components/sync/driver/sync_service.h b/components/sync/driver/sync_service.h
index 4443966..a502082 100644
--- a/components/sync/driver/sync_service.h
+++ b/components/sync/driver/sync_service.h
@@ -309,8 +309,8 @@
   // we have an encrypted data type enabled.
   virtual bool IsPassphraseRequiredForDecryption() const = 0;
 
-  // Returns true if a secondary (explicit) passphrase is being used. It is not
-  // legal to call this method before the engine is initialized.
+  // Returns true if a secondary (explicit) passphrase is being used. Before the
+  // engine is initialized, this will always return false.
   virtual bool IsUsingSecondaryPassphrase() const = 0;
 
   //////////////////////////////////////////////////////////////////////////////
diff --git a/components/sync/driver/sync_user_settings.h b/components/sync/driver/sync_user_settings.h
index 67a7096..6a99e85 100644
--- a/components/sync/driver/sync_user_settings.h
+++ b/components/sync/driver/sync_user_settings.h
@@ -49,23 +49,37 @@
   virtual void SetChosenDataTypes(bool sync_everything,
                                   syncer::ModelTypeSet types) = 0;
 
-  // Encryption.
+  // Encryption state.
+  // Note that all of this state may only be queried or modified if the Sync
+  // engine is initialized.
+
+  // Whether the user is allowed to encrypt all their Sync data. For example,
+  // child accounts are not allowed to encrypt their data.
   virtual bool IsEncryptEverythingAllowed() const = 0;
   virtual void SetEncryptEverythingAllowed(bool allowed) = 0;
-  // Returns true if we are currently set to encrypt all the sync data.
+  // Whether we are currently set to encrypt all the Sync data.
   virtual bool IsEncryptEverythingEnabled() const = 0;
   // Turns on encryption for all data. Callers must call SetChosenDataTypes()
   // after calling this to force the encryption to occur.
   virtual void EnableEncryptEverything() = 0;
 
+  // Whether a passphrase is required for encryption or decryption to proceed.
+  // Note that Sync might still be working fine if the user has disabled all
+  // encrypted data types.
   virtual bool IsPassphraseRequired() const = 0;
+  // Whether a passphrase is required to decrypt the data for any currently
+  // enabled data type.
   virtual bool IsPassphraseRequiredForDecryption() const = 0;
-  // "Secondary" means either a custom or a frozen implicit passphrase.
+  // Whether a "secondary" passphrase is in use, which means either a custom or
+  // a frozen implicit passphrase.
   virtual bool IsUsingSecondaryPassphrase() const = 0;
-  // Returns the time the current explicit passphrase (if any), was set.
-  // If no secondary passphrase is in use, or no time is available, returns an
-  // unset base::Time.
+  // The time the current explicit passphrase (if any) was set. If no secondary
+  // passphrase is in use, or no time is available, returns an unset base::Time.
   virtual base::Time GetExplicitPassphraseTime() const = 0;
+  // The type of the passphrase currently in use. This is KEYSTORE_PASSPHRASE if
+  // "encrypt everything" is disabled, or CUSTOM_PASSPHRASE if
+  // "encrypt everything" is enabled. There are also some legacy passphrase
+  // types which may still occur for a small number of users.
   virtual syncer::PassphraseType GetPassphraseType() const = 0;
 
   // Asynchronously sets the passphrase to |passphrase| for encryption.
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
index 6bdcd2d..5a655ec 100644
--- a/components/translate/core/browser/translate_manager.cc
+++ b/components/translate/core/browser/translate_manager.cc
@@ -91,6 +91,55 @@
 
 }  // namespace
 
+struct TranslateManager::TranslateTriggerDecision {
+  void PreventAllTriggering() {
+    can_auto_translate_ = false;
+    can_show_ui_ = false;
+  }
+
+  void PreventAutoTranslate() { can_auto_translate_ = false; }
+  bool can_auto_translate() const { return can_auto_translate_; }
+
+  void PreventShowingUI() { can_show_ui_ = false; }
+  bool can_show_ui() const { return can_show_ui_; }
+
+  void SuppressFromRanker() { should_suppress_from_ranker_ = true; }
+  bool should_suppress_from_ranker() const {
+    return should_suppress_from_ranker_;
+  }
+
+  bool IsTriggeringPossible() const {
+    return can_auto_translate_ || can_show_ui_;
+  }
+
+  bool ShouldAutoTranslate() const { return can_auto_translate_; }
+
+  // Returns true iff:
+  // 1. Showing the UI is disallowed (otherwise it would be chosen over showing
+  //    the UI).
+  // 2. It's possible to show the UI (language/site not blacklisted, connected
+  //    to the internet, etc)
+  // 3. Ranker isn't requesting that the UI be suppressed.
+  bool ShouldShowUI() const {
+    return !can_auto_translate_ && can_show_ui_ &&
+           !should_suppress_from_ranker_;
+  }
+
+  std::vector<TranslateBrowserMetrics::InitiationStatusType>
+      initiation_statuses;
+  std::vector<int> ranker_events;
+  std::string auto_translate_target;
+
+ private:
+  // These fields are private because they should only be set one way. Filters
+  // "blacklist" outcomes, so for example once |can_show_ui_| is set to false,
+  // it shouldn't be reset to true.
+  bool can_auto_translate_ = true;
+  bool can_show_ui_ = true;
+
+  bool should_suppress_from_ranker_ = false;
+};
+
 TranslateManager::~TranslateManager() {}
 
 // static
@@ -119,190 +168,29 @@
 }
 
 void TranslateManager::InitiateTranslation(const std::string& page_lang) {
-  // Short-circuit out if not in a state where initiating translation makes
-  // sense (this method may be called muhtiple times for a given page).
-  if (!language_state_.page_needs_translation() ||
-      language_state_.translation_pending() ||
-      language_state_.translation_declined() ||
-      language_state_.IsPageTranslated() ||
-      !base::FeatureList::IsEnabled(translate::kTranslateUI)) {
-    return;
-  }
-
-  // Also, skip if the connection is currently offline - initiation doesn't make
-  // sense there, either.
-  if (net::NetworkChangeNotifier::IsOffline())
-    return;
-
-  if (!ignore_missing_key_for_testing_ &&
-      !::google_apis::HasAPIKeyConfigured()) {
-    // Without an API key, translate won't work, so don't offer to translate in
-    // the first place. Leave prefs::kOfferTranslateEnabled on, though, because
-    // that settings syncs and we don't want to turn off translate everywhere
-    // else.
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_KEY);
-    return;
-  }
-
   std::unique_ptr<TranslatePrefs> translate_prefs(
       translate_client_->GetTranslatePrefs());
-
-  if (!translate_prefs->IsOfferTranslateEnabled()) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS);
-    std::string target_lang =
-        GetTargetLanguage(translate_prefs.get(), language_model_);
-    std::string language_code =
-        TranslateDownloadManager::GetLanguageCode(page_lang);
-    InitTranslateEvent(language_code, target_lang, *translate_prefs);
-    RecordTranslateEvent(metrics::TranslateEventProto::DISABLED_BY_PREF);
-    const std::string& locale =
-        TranslateDownloadManager::GetInstance()->application_locale();
-    TranslateBrowserMetrics::ReportLocalesOnDisabledByPrefs(locale);
-    return;
-  }
-
-  // MHTML pages currently cannot be translated.
-  // See bug: 217945.
-  if (translate_driver_->GetContentsMimeType() == "multipart/related") {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_MIME_TYPE_IS_NOT_SUPPORTED);
-    return;
-  }
-
-  // Don't translate any Chrome specific page, e.g., New Tab Page, Download,
-  // History, and so on.
-  const GURL& page_url = translate_driver_->GetVisibleURL();
-  if (!translate_client_->IsTranslatableURL(page_url)) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_URL_IS_NOT_SUPPORTED);
-    return;
-  }
-
-  std::string language_code =
+  std::string page_language_code =
       TranslateDownloadManager::GetLanguageCode(page_lang);
   const std::set<std::string>& skipped_languages =
-      GetSkippedLanguagesForExperiments(language_code, translate_prefs.get());
+      GetSkippedLanguagesForExperiments(page_language_code,
+                                        translate_prefs.get());
   std::string target_lang = GetTargetLanguage(
       translate_prefs.get(), language_model_, skipped_languages);
 
-  // Don't translate similar languages (ex: en-US to en).
-  if (language_code == target_lang) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_SIMILAR_LANGUAGES);
-    return;
-  }
+  // TODO(crbug.com/924980): The ranker event shouldn't be a global on this
+  // object. It should instead be passed around to code that uses it.
+  InitTranslateEvent(page_language_code, target_lang, *translate_prefs);
 
-  InitTranslateEvent(language_code, target_lang, *translate_prefs);
+  const TranslateTriggerDecision& decision = ComputePossibleOutcomes(
+      translate_prefs.get(), page_language_code, target_lang);
 
-  // Querying the ranker now, but not exiting immediately so that we may log
-  // other potential suppression reasons.
-  // Ignore Ranker's decision under triggering experiments since it wasn't
-  // trained appropriately under those scenarios.
-  bool should_offer_translation =
-      language::ShouldPreventRankerEnforcementInIndia(
-          translate_prefs->GetForceTriggerOnEnglishPagesCount()) ||
-      translate_ranker_->ShouldOfferTranslation(translate_event_.get());
-
-  // Nothing to do if either the language Chrome is in or the language of
-  // the page is not supported by the translation server.
-  if (target_lang.empty() ||
-      !TranslateDownloadManager::IsSupportedLanguage(language_code)) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED);
-    TranslateBrowserMetrics::ReportUnsupportedLanguageAtInitiation(
-        language_code);
-    RecordTranslateEvent(metrics::TranslateEventProto::UNSUPPORTED_LANGUAGE);
-    return;
-  }
-
-  TranslateAcceptLanguages* accept_languages =
-      translate_client_->GetTranslateAcceptLanguages();
-  // Don't translate any user black-listed languages.
-  if (!translate_prefs->CanTranslateLanguage(accept_languages, language_code)) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_CONFIG);
-    RecordTranslateEvent(
-        metrics::TranslateEventProto::LANGUAGE_DISABLED_BY_USER_CONFIG);
-    return;
-  }
-
-  // Don't translate any user black-listed URLs.
-  if (translate_prefs->IsSiteBlacklisted(page_url.HostNoBrackets())) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_CONFIG);
-    RecordTranslateEvent(
-        metrics::TranslateEventProto::URL_DISABLED_BY_USER_CONFIG);
-    return;
-  }
-
-  // If the user has previously selected "always translate" for this language we
-  // automatically translate.  Note that in incognito mode we disable that
-  // feature; the user will get an infobar, so they can control whether the
-  // page's text is sent to the translate server.
-  if (!translate_driver_->IsIncognito()) {
-    std::string auto_target_lang =
-        GetAutoTargetLanguage(language_code, translate_prefs.get());
-    if (!auto_target_lang.empty()) {
-      TranslateBrowserMetrics::ReportInitiationStatus(
-          TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_CONFIG);
-      translate_event_->set_modified_target_language(auto_target_lang);
-      RecordTranslateEvent(
-          metrics::TranslateEventProto::AUTO_TRANSLATION_BY_PREF);
-      TranslatePage(language_code, auto_target_lang, false);
-      return;
-    }
-  }
-
-  std::string auto_translate_to = language_state_.AutoTranslateTo();
-  if (!auto_translate_to.empty()) {
-    // This page was navigated through a click from a translated page.
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_LINK);
-    translate_event_->set_modified_target_language(auto_translate_to);
-    RecordTranslateEvent(
-        metrics::TranslateEventProto::AUTO_TRANSLATION_BY_LINK);
-    TranslatePage(language_code, auto_translate_to, false);
-    return;
-  }
-
-  // Show the omnibar icon if we've gotten this far.
-  language_state_.SetTranslateEnabled(true);
-  TranslateBrowserMetrics::ReportInitiationStatus(
-      TranslateBrowserMetrics::INITIATION_STATUS_SHOW_ICON);
-
-  // Will be true if we've decided to show the infobar/bubble UI to the user.
-  bool did_show_ui = false;
-
-  if (should_offer_translation) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_SHOW_INFOBAR);
-
-    // If the source language matches the UI language, it means the translation
-    // prompt is being forced by an experiment. Report this so the count of how
-    // often it happens can be tracked to suppress the experiment as necessary.
-    if (language_code ==
-        TranslateDownloadManager::GetLanguageCode(
-            TranslateDownloadManager::GetInstance()->application_locale())) {
-      translate_prefs->ReportForceTriggerOnEnglishPages();
-    }
-
-    // Prompts the user if they want the page translated.
-    did_show_ui = translate_client_->ShowTranslateUI(
-        translate::TRANSLATE_STEP_BEFORE_TRANSLATE, language_code, target_lang,
-        TranslateErrors::NONE, false);
-
-  } else {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_ABORTED_BY_RANKER);
-    RecordTranslateEvent(metrics::TranslateEventProto::DISABLED_BY_RANKER);
-  }
-
-  if (!did_show_ui) {
-    TranslateBrowserMetrics::ReportInitiationStatus(
-        TranslateBrowserMetrics::INITIATION_STATUS_SUPPRESS_INFOBAR);
-  }
+  MaybeShowOmniboxIcon(decision);
+  bool ui_shown = MaterializeDecision(decision, translate_prefs.get(),
+                                      page_language_code, target_lang);
+  RecordDecisionMetrics(decision, page_language_code, ui_shown);
+  RecordDecisionRankerEvent(decision, translate_prefs.get(), page_language_code,
+                            target_lang);
 }
 
 // static
@@ -722,4 +610,306 @@
   }
 }
 
+const TranslateManager::TranslateTriggerDecision
+TranslateManager::ComputePossibleOutcomes(TranslatePrefs* translate_prefs,
+                                          const std::string& page_language_code,
+                                          const std::string& target_lang) {
+  // This function looks at a bunch of signals and determines which of three
+  // outcomes should be selected:
+  // 1. Auto-translate the page
+  // 2. Show translate UI
+  // 3. Do nothing
+  // This is achieved by passing the |decision| object to the different Filter*
+  // functions, which will mark certain outcomes as undesirable. This |decision|
+  // object is then used to trigger the correct behavior, and finally record
+  // corresponding metrics in InitiateTranslation.
+  TranslateTriggerDecision decision;
+
+  FilterIsTranslatePossible(&decision, translate_prefs, page_language_code,
+                            target_lang);
+
+  // Querying the ranker now, but not exiting immediately so that we may log
+  // other potential suppression reasons.
+  // Ignore Ranker's decision under triggering experiments since it wasn't
+  // trained appropriately under those scenarios.
+  if (!language::ShouldPreventRankerEnforcementInIndia(
+          translate_prefs->GetForceTriggerOnEnglishPagesCount()) &&
+      !translate_ranker_->ShouldOfferTranslation(translate_event_.get())) {
+    decision.SuppressFromRanker();
+  }
+
+  FilterForUserPrefs(&decision, translate_prefs, page_language_code);
+  FilterAutoTranslate(&decision, translate_prefs, page_language_code);
+
+  return decision;
+}
+
+void TranslateManager::FilterIsTranslatePossible(
+    TranslateTriggerDecision* decision,
+    TranslatePrefs* translate_prefs,
+    const std::string& page_language_code,
+    const std::string& target_lang) {
+  // Short-circuit out if not in a state where initiating translation makes
+  // sense (this method may be called muhtiple times for a given page).
+  if (!language_state_.page_needs_translation() ||
+      language_state_.translation_pending() ||
+      language_state_.translation_declined() ||
+      language_state_.IsPageTranslated() ||
+      !base::FeatureList::IsEnabled(translate::kTranslateUI)) {
+    decision->PreventAllTriggering();
+  }
+
+  // Also, skip if the connection is currently offline - initiation doesn't make
+  // sense there, either.
+  if (net::NetworkChangeNotifier::IsOffline())
+    decision->PreventAllTriggering();
+
+  if (!ignore_missing_key_for_testing_ &&
+      !::google_apis::HasAPIKeyConfigured()) {
+    // Without an API key, translate won't work, so don't offer to translate in
+    // the first place. Leave prefs::kOfferTranslateEnabled on, though, because
+    // that settings syncs and we don't want to turn off translate everywhere
+    // else.
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_KEY);
+  }
+
+  // MHTML pages currently cannot be translated.
+  // See bug: 217945.
+  if (translate_driver_->GetContentsMimeType() == "multipart/related") {
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_MIME_TYPE_IS_NOT_SUPPORTED);
+  }
+
+  // Don't translate any Chrome specific page, e.g., New Tab Page, Download,
+  // History, and so on.
+  const GURL& page_url = translate_driver_->GetVisibleURL();
+  if (!translate_client_->IsTranslatableURL(page_url)) {
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_URL_IS_NOT_SUPPORTED);
+  }
+
+  if (!translate_prefs->IsOfferTranslateEnabled()) {
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::DISABLED_BY_PREF);
+  }
+
+  // Don't translate similar languages (ex: en-US to en).
+  if (page_language_code == target_lang) {
+    // This doesn't prevent *all* possible translate outcomes because some could
+    // use a different target language, making this condition only relevant to
+    // regular auto-translate/show UI.
+    decision->PreventAutoTranslate();
+    decision->PreventShowingUI();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_SIMILAR_LANGUAGES);
+  }
+
+  // Nothing to do if either the language Chrome is in or the language of
+  // the page is not supported by the translation server.
+  if (target_lang.empty() ||
+      !TranslateDownloadManager::IsSupportedLanguage(page_language_code)) {
+    // This doesn't prevent *all* possible translate outcomes because some could
+    // use a different target language, making this condition only relevant to
+    // regular auto-translate/show UI.
+    decision->PreventAutoTranslate();
+    decision->PreventShowingUI();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::UNSUPPORTED_LANGUAGE);
+  }
+}
+
+void TranslateManager::FilterAutoTranslate(
+    TranslateTriggerDecision* decision,
+    TranslatePrefs* translate_prefs,
+    const std::string& page_language_code) {
+  // Determine whether auto-translate is required, and if so for which target
+  // language.
+  std::string always_translate_target =
+      GetAutoTargetLanguage(page_language_code, translate_prefs);
+  std::string link_auto_translate_target = language_state_.AutoTranslateTo();
+  if (!translate_driver_->IsIncognito() && !always_translate_target.empty()) {
+    // If the user has previously selected "always translate" for this language
+    // we automatically translate.  Note that in incognito mode we disable that
+    // feature; the user will get an infobar, so they can control whether the
+    // page's text is sent to the translate server.
+    decision->auto_translate_target = always_translate_target;
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_CONFIG);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::AUTO_TRANSLATION_BY_PREF);
+  } else if (!link_auto_translate_target.empty()) {
+    // This page was navigated through a click from a translated page.
+    decision->auto_translate_target = link_auto_translate_target;
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_AUTO_BY_LINK);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::AUTO_TRANSLATION_BY_LINK);
+  }
+
+  if (decision->auto_translate_target.empty()) {
+    decision->PreventAutoTranslate();
+  }
+}
+
+void TranslateManager::FilterForUserPrefs(
+    TranslateTriggerDecision* decision,
+    TranslatePrefs* translate_prefs,
+    const std::string& page_language_code) {
+  TranslateAcceptLanguages* accept_languages =
+      translate_client_->GetTranslateAcceptLanguages();
+  // Don't translate any user black-listed languages.
+  if (!translate_prefs->CanTranslateLanguage(accept_languages,
+                                             page_language_code)) {
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_CONFIG);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::LANGUAGE_DISABLED_BY_USER_CONFIG);
+  }
+
+  // Don't translate any user black-listed URLs.
+  const GURL& page_url = translate_driver_->GetVisibleURL();
+  if (translate_prefs->IsSiteBlacklisted(page_url.HostNoBrackets())) {
+    decision->PreventAllTriggering();
+    decision->initiation_statuses.push_back(
+        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_CONFIG);
+    decision->ranker_events.push_back(
+        metrics::TranslateEventProto::URL_DISABLED_BY_USER_CONFIG);
+  }
+}
+
+void TranslateManager::MaybeShowOmniboxIcon(
+    const TranslateTriggerDecision& decision) {
+  if (decision.IsTriggeringPossible()) {
+    // Show the omnibox icon if any translate trigger is possible.
+    language_state_.SetTranslateEnabled(true);
+    TranslateBrowserMetrics::ReportInitiationStatus(
+        TranslateBrowserMetrics::INITIATION_STATUS_SHOW_ICON);
+  }
+}
+
+bool TranslateManager::MaterializeDecision(
+    const TranslateTriggerDecision& decision,
+    TranslatePrefs* translate_prefs,
+    const std::string& page_language_code,
+    const std::string target_lang) {
+  // Auto-translating always happens if it's still possible here.
+  if (decision.can_auto_translate()) {
+    TranslatePage(page_language_code, decision.auto_translate_target, false);
+    return false;
+  }
+
+  // Auto-translate didn't happen, so check if the UI should be shown. It must
+  // not be suppressed by preference, system state, or the Ranker.
+
+  // Will be true if we've decided to show the infobar/bubble UI to the user.
+  bool did_show_ui = false;
+  if (decision.ShouldShowUI()) {
+    // If the source language matches the UI language, it means the translation
+    // prompt is being forced by an experiment. Report this so the count of how
+    // often it happens can be tracked to suppress the experiment as necessary.
+    if (page_language_code ==
+        TranslateDownloadManager::GetLanguageCode(
+            TranslateDownloadManager::GetInstance()->application_locale())) {
+      translate_prefs->ReportForceTriggerOnEnglishPages();
+    }
+
+    // Prompts the user if they want the page translated.
+    did_show_ui = translate_client_->ShowTranslateUI(
+        translate::TRANSLATE_STEP_BEFORE_TRANSLATE, page_language_code,
+        target_lang, TranslateErrors::NONE, false);
+  }
+
+  return did_show_ui;
+}
+
+void TranslateManager::RecordDecisionMetrics(
+    const TranslateTriggerDecision& decision,
+    const std::string& page_language_code,
+    bool ui_shown) {
+  // If the chosen outcome is to show the UI or let it be suppressed, log a few
+  // explicit things.
+  if (!decision.can_auto_translate() && decision.can_show_ui()) {
+    // By getting here it's expected that nothing caused the translation to
+    // be aborted or happen automatically. Because of that,
+    // |decision.initiation_statuses| should be empty.
+    DCHECK(decision.initiation_statuses.empty());
+
+    if (decision.should_suppress_from_ranker() || !ui_shown) {
+      TranslateBrowserMetrics::ReportInitiationStatus(
+          TranslateBrowserMetrics::INITIATION_STATUS_SUPPRESS_INFOBAR);
+    }
+
+    // If the UI was suppressed, log the suppression source.
+    if (decision.should_suppress_from_ranker()) {
+      TranslateBrowserMetrics::ReportInitiationStatus(
+          TranslateBrowserMetrics::INITIATION_STATUS_ABORTED_BY_RANKER);
+    } else {
+      // Always log INITIATION_STATUS_SHOW_INFOBAR regardless of whether it's
+      // being subsequently suppressed or not. It's a measure of how often a
+      // decision is taken to show it, and other metrics track *actual*
+      // instances of it being shown.
+      TranslateBrowserMetrics::ReportInitiationStatus(
+          TranslateBrowserMetrics::INITIATION_STATUS_SHOW_INFOBAR);
+    }
+
+    // There's nothing else to log if the UI was shown.
+    return;
+  }
+
+  // To match previous behavior, this function will log the first initiation
+  // status that was recorded in the vector. This ensures that the histograms
+  // reflect which conditions were met first to either trigger or prevent
+  // translate triggering.
+  if (!decision.initiation_statuses.empty()) {
+    auto status = decision.initiation_statuses[0];
+    TranslateBrowserMetrics::ReportInitiationStatus(status);
+
+    // The following metrics are logged alongside extra info.
+    if (status ==
+        TranslateBrowserMetrics::INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED) {
+      TranslateBrowserMetrics::ReportUnsupportedLanguageAtInitiation(
+          page_language_code);
+    }
+
+    if (status ==
+        TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS) {
+      const std::string& locale =
+          TranslateDownloadManager::GetInstance()->application_locale();
+      TranslateBrowserMetrics::ReportLocalesOnDisabledByPrefs(locale);
+    }
+  }
+}
+
+void TranslateManager::RecordDecisionRankerEvent(
+    const TranslateTriggerDecision& decision,
+    TranslatePrefs* translate_prefs,
+    const std::string& page_language_code,
+    const std::string& target_lang) {
+  if (!decision.auto_translate_target.empty()) {
+    translate_event_->set_modified_target_language(
+        decision.auto_translate_target);
+  }
+
+  if (!decision.ranker_events.empty()) {
+    auto event = decision.ranker_events[0];
+    RecordTranslateEvent(event);
+  }
+
+  // Finally, if the decision was to show UI and ranker suppressed it, log that.
+  if (!decision.can_auto_translate() && decision.can_show_ui() &&
+      decision.should_suppress_from_ranker()) {
+    RecordTranslateEvent(metrics::TranslateEventProto::DISABLED_BY_RANKER);
+  }
+}
+
 }  // namespace translate
diff --git a/components/translate/core/browser/translate_manager.h b/components/translate/core/browser/translate_manager.h
index 6529e93..03465a1 100644
--- a/components/translate/core/browser/translate_manager.h
+++ b/components/translate/core/browser/translate_manager.h
@@ -174,6 +174,8 @@
  private:
   friend class translate::testing::TranslateManagerTest;
 
+  struct TranslateTriggerDecision;
+
   // Sends a translation request to the TranslateDriver.
   void DoTranslatePage(const std::string& translate_script,
                        const std::string& source_lang,
@@ -197,6 +199,58 @@
   void AddTargetLanguageToAcceptLanguages(
       const std::string& target_language_code);
 
+  // Creates a TranslateTriggerDecision and filters out possible outcomes based
+  // on the current state. Returns a decision objects ready to be used to
+  // trigger behavior and record metrics.
+  const TranslateTriggerDecision ComputePossibleOutcomes(
+      TranslatePrefs* translate_prefs,
+      const std::string& page_language_code,
+      const std::string& target_lang);
+
+  // Determines whether translation is even possible (connected to the internet,
+  // source and target languages don't match, etc) and mutates |decision| based
+  // on the result.
+  void FilterIsTranslatePossible(TranslateTriggerDecision* decision,
+                                 TranslatePrefs* translate_prefs,
+                                 const std::string& page_language_code,
+                                 const std::string& target_lang);
+
+  // Determines whether auto-translate is a possible outcome, and mutates
+  // |decision| accordingly.
+  void FilterAutoTranslate(TranslateTriggerDecision* decision,
+                           TranslatePrefs* translate_prefs,
+                           const std::string& page_language_code);
+
+  // Determines whether user prefs prohibit translations for this specific
+  // navigation. For example, a user can select "never translate this language".
+  // Mutates |decision| accordingly.
+  void FilterForUserPrefs(TranslateTriggerDecision* decision,
+                          TranslatePrefs* translate_prefs,
+                          const std::string& page_language_code);
+
+  // Enables or disables the translate omnibox icon depending on |decision|. The
+  // icon is always shown if translate UI is shown, auto-translation happens, or
+  // the UI is suppressed by ranker.
+  void MaybeShowOmniboxIcon(const TranslateTriggerDecision& decision);
+
+  // Shows the UI or auto-translates based on the state of |decision|. Returns
+  // true if UI was shown, false otherwise.
+  bool MaterializeDecision(const TranslateTriggerDecision& decision,
+                           TranslatePrefs* translate_prefs,
+                           const std::string& page_language_code,
+                           const std::string target_lang);
+
+  // Records all UMA metrics related to the current |decision|.
+  void RecordDecisionMetrics(const TranslateTriggerDecision& decision,
+                             const std::string& page_language_code,
+                             bool ui_shown);
+
+  // Records the RankerEvent associated with the current |decision|.
+  void RecordDecisionRankerEvent(const TranslateTriggerDecision& decision,
+                                 TranslatePrefs* translate_prefs,
+                                 const std::string& page_language_code,
+                                 const std::string& target_lang);
+
   // Sequence number of the current page.
   int page_seq_no_;
 
diff --git a/components/translate/core/browser/translate_manager_unittest.cc b/components/translate/core/browser/translate_manager_unittest.cc
index b5227a8..d3e14a07 100644
--- a/components/translate/core/browser/translate_manager_unittest.cc
+++ b/components/translate/core/browser/translate_manager_unittest.cc
@@ -664,6 +664,11 @@
 
 TEST_F(TranslateManagerTest, DontTranslateOffline) {
   TranslateManager::SetIgnoreMissingKeyForTesting(true);
+
+  TranslateAcceptLanguages accept_languages(&prefs_, accept_languages_prefs);
+  ON_CALL(mock_translate_client_, GetTranslateAcceptLanguages())
+      .WillByDefault(Return(&accept_languages));
+
   translate_manager_.reset(new translate::TranslateManager(
       &mock_translate_client_, &mock_translate_ranker_, &mock_language_model_));
 
@@ -675,19 +680,18 @@
 
   translate_manager_->GetLanguageState().LanguageDetermined("de", true);
 
-  // In the offline case, Initiate will early-out before even hitting the API
-  // key test.
+  // In the offline case, Initiate won't trigger any translate behavior, so no
+  // UI showing and no auto-translate.
   network_notifier_.SimulateOffline();
   translate_manager_->InitiateTranslation("de");
-  histogram_tester.ExpectTotalCount(kInitiationStatusName, 0);
-
-  // In the online case, InitiateTranslation will proceed past early out tests.
-  network_notifier_.SimulateOnline();
-  translate_manager_->InitiateTranslation("de");
-  histogram_tester.ExpectUniqueSample(
-      kInitiationStatusName,
-      translate::TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS,
-      1);
+  EXPECT_THAT(histogram_tester.GetAllSamples(kInitiationStatusName),
+              Not(Contains(Bucket(INITIATION_STATUS_SHOW_INFOBAR, 1))));
+  EXPECT_THAT(histogram_tester.GetAllSamples(kInitiationStatusName),
+              Not(Contains(Bucket(INITIATION_STATUS_SHOW_ICON, 1))));
+  EXPECT_THAT(histogram_tester.GetAllSamples(kInitiationStatusName),
+              Not(Contains(Bucket(INITIATION_STATUS_AUTO_BY_CONFIG, 1))));
+  EXPECT_THAT(histogram_tester.GetAllSamples(kInitiationStatusName),
+              Not(Contains(Bucket(INITIATION_STATUS_AUTO_BY_LINK, 1))));
 }
 
 TEST_F(TranslateManagerTest, TestRecordTranslateEvent) {
diff --git a/components/url_formatter/BUILD.gn b/components/url_formatter/BUILD.gn
index 85e0992f..53368d11 100644
--- a/components/url_formatter/BUILD.gn
+++ b/components/url_formatter/BUILD.gn
@@ -21,8 +21,12 @@
     "url_formatter_android.cc",
   ]
 
-  # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-  configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
+  configs += [
+    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+    "//build/config/compiler:no_size_t_to_int_warning",
+
+    "//build/config/compiler:noshadowing",
+  ]
 
   deps = [
     "//base",
diff --git a/components/version_info/version_info.h b/components/version_info/version_info.h
index 82b4739..4e5c20e 100644
--- a/components/version_info/version_info.h
+++ b/components/version_info/version_info.h
@@ -32,14 +32,14 @@
 std::string GetLastChange();
 
 // Returns whether this is an "official" release of the current version, i.e.
-// whether kwnowing GetVersionNumber() is enough to completely determine what
+// whether knowing GetVersionNumber() is enough to completely determine what
 // GetLastChange() is.
 bool IsOfficialBuild();
 
-// Returns the OS type, e.g. "Windows", "Linux", "FreeBDS", ...
+// Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ...
 std::string GetOSType();
 
-// Returns a string equivalent of |channel|, indenpendent of whether the build
+// Returns a string equivalent of |channel|, independent of whether the build
 // is branded or not and without any additional modifiers.
 std::string GetChannelString(Channel channel);
 
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 2f87c627..2ececf6 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -200,6 +200,7 @@
     "//ui/accessibility:ax_enums_mojo",
     "//ui/base",
     "//ui/base:buildflags",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display",
     "//ui/display/types",
@@ -464,6 +465,8 @@
     "background_fetch/storage/get_metadata_task.h",
     "background_fetch/storage/get_registration_task.cc",
     "background_fetch/storage/get_registration_task.h",
+    "background_fetch/storage/get_request_blob_task.cc",
+    "background_fetch/storage/get_request_blob_task.h",
     "background_fetch/storage/image_helpers.cc",
     "background_fetch/storage/image_helpers.h",
     "background_fetch/storage/mark_registration_for_deletion_task.cc",
diff --git a/content/browser/appcache/appcache_frontend.h b/content/browser/appcache/appcache_frontend.h
index 223aea9..4abf8c63 100644
--- a/content/browser/appcache/appcache_frontend.h
+++ b/content/browser/appcache/appcache_frontend.h
@@ -11,7 +11,6 @@
 #include "base/files/file_path.h"
 #include "content/common/appcache_interfaces.h"
 #include "content/common/content_export.h"
-#include "content/public/common/appcache_info.h"
 #include "services/network/public/mojom/url_loader_factory.mojom.h"
 #include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
diff --git a/content/browser/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc
index 077926d..d3b7bdd 100644
--- a/content/browser/appcache/appcache_host.cc
+++ b/content/browser/appcache/appcache_host.cc
@@ -18,7 +18,6 @@
 #include "content/browser/appcache/appcache_request_handler.h"
 #include "content/browser/appcache/appcache_subresource_url_factory.h"
 #include "content/common/appcache_interfaces.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/content_features.h"
 #include "net/url_request/url_request.h"
 #include "services/network/public/cpp/features.h"
@@ -64,9 +63,9 @@
                            AppCacheServiceImpl* service)
     : host_id_(host_id),
       process_id_(process_id),
-      spawning_host_id_(kAppCacheNoHostId),
+      spawning_host_id_(blink::mojom::kAppCacheNoHostId),
       spawning_process_id_(0),
-      parent_host_id_(kAppCacheNoHostId),
+      parent_host_id_(blink::mojom::kAppCacheNoHostId),
       parent_process_id_(0),
       pending_main_resource_cache_id_(blink::mojom::kAppCacheNoCacheId),
       pending_selected_cache_id_(blink::mojom::kAppCacheNoCacheId),
diff --git a/content/browser/appcache/appcache_host.h b/content/browser/appcache/appcache_host.h
index 16b962c..ad140ba 100644
--- a/content/browser/appcache/appcache_host.h
+++ b/content/browser/appcache/appcache_host.h
@@ -251,7 +251,7 @@
 
   // Returns true if this host is for a dedicated worker context.
   bool is_for_dedicated_worker() const {
-    return parent_host_id_ != kAppCacheNoHostId;
+    return parent_host_id_ != blink::mojom::kAppCacheNoHostId;
   }
 
   // Returns the parent context's host instance. This is only valid
diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc
index c22dd4c..3e4c514d 100644
--- a/content/browser/appcache/appcache_interceptor.cc
+++ b/content/browser/appcache/appcache_interceptor.cc
@@ -18,6 +18,7 @@
 #include "content/browser/loader/resource_requester_info.h"
 #include "content/common/appcache_interfaces.h"
 #include "net/url_request/url_request.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 
 static int kHandlerKey;  // Value is not used.
@@ -42,7 +43,7 @@
                                               int host_id,
                                               ResourceType resource_type,
                                               bool should_reset_appcache) {
-  if (!service || (host_id == kAppCacheNoHostId))
+  if (!service || (host_id == blink::mojom::kAppCacheNoHostId))
     return;
 
   AppCacheBackendImpl* backend = service->GetBackend(process_id);
diff --git a/content/browser/appcache/appcache_internals_ui.cc b/content/browser/appcache/appcache_internals_ui.cc
index 6e0a207..f03f5472 100644
--- a/content/browser/appcache/appcache_internals_ui.cc
+++ b/content/browser/appcache/appcache_internals_ui.cc
@@ -5,6 +5,7 @@
 #include "content/browser/appcache/appcache_internals_ui.h"
 
 #include <stddef.h>
+#include <vector>
 
 #include "base/bind.h"
 #include "base/logging.h"
@@ -91,7 +92,7 @@
 }
 
 std::unique_ptr<base::ListValue> GetListValueForAppCacheInfoVector(
-    const AppCacheInfoVector& appcache_info_vector) {
+    const std::vector<blink::mojom::AppCacheInfo> appcache_info_vector) {
   std::unique_ptr<base::ListValue> list(new base::ListValue());
   for (const blink::mojom::AppCacheInfo& info : appcache_info_vector)
     list->Append(GetDictionaryValueForAppCacheInfo(info));
diff --git a/content/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc
index c54d4e1..7d106c8 100644
--- a/content/browser/appcache/appcache_response.cc
+++ b/content/browser/appcache/appcache_response.cc
@@ -30,6 +30,8 @@
 
 namespace {
 
+using OnceCompletionCallback = base::OnceCallback<void(int)>;
+
 // Disk cache entry data indices.
 enum { kResponseInfoIndex, kResponseContentIndex, kResponseMetadataIndex };
 
diff --git a/content/browser/appcache/appcache_service_impl.cc b/content/browser/appcache/appcache_service_impl.cc
index b95cb20d..515f641 100644
--- a/content/browser/appcache/appcache_service_impl.cc
+++ b/content/browser/appcache/appcache_service_impl.cc
@@ -6,6 +6,7 @@
 
 #include <functional>
 #include <utility>
+#include <vector>
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
@@ -27,6 +28,7 @@
 #include "content/browser/appcache/appcache_storage_impl.h"
 #include "net/base/io_buffer.h"
 #include "storage/browser/quota/special_storage_policy.h"
+#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
 
 namespace content {
 
@@ -174,7 +176,8 @@
   }
 
   // We have some caches to delete.
-  const AppCacheInfoVector& caches_to_delete = found->second;
+  const std::vector<blink::mojom::AppCacheInfo>& caches_to_delete =
+      found->second;
   successes_ = 0;
   failures_ = 0;
   num_caches_to_delete_ = static_cast<int>(caches_to_delete.size());
diff --git a/content/browser/appcache/appcache_service_impl.h b/content/browser/appcache/appcache_service_impl.h
index d83fc409..f143ec77 100644
--- a/content/browser/appcache/appcache_service_impl.h
+++ b/content/browser/appcache/appcache_service_impl.h
@@ -67,6 +67,7 @@
 // exclusive access to its cache_directory on disk.
 class CONTENT_EXPORT AppCacheServiceImpl : public AppCacheService {
  public:
+  using OnceCompletionCallback = base::OnceCallback<void(int)>;
 
   class CONTENT_EXPORT Observer {
    public:
diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc
index 1337a3b9..c99cd284 100644
--- a/content/browser/appcache/appcache_service_unittest.cc
+++ b/content/browser/appcache/appcache_service_unittest.cc
@@ -5,6 +5,7 @@
 #include <stdint.h>
 
 #include <string>
+#include <vector>
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
@@ -222,7 +223,7 @@
   mock_manifest_1.manifest_url = kOriginURL.Resolve("manifest1");
   mock_manifest_2.manifest_url = kOriginURL.Resolve("manifest2");
   mock_manifest_3.manifest_url = kOriginURL.Resolve("manifest3");
-  AppCacheInfoVector info_vector;
+  std::vector<blink::mojom::AppCacheInfo> info_vector;
   info_vector.push_back(mock_manifest_1);
   info_vector.push_back(mock_manifest_2);
   info_vector.push_back(mock_manifest_3);
diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc
index ff6fefcf..8277756f 100644
--- a/content/browser/appcache/appcache_storage_impl.cc
+++ b/content/browser/appcache/appcache_storage_impl.cc
@@ -371,7 +371,8 @@
   std::set<url::Origin> origins;
   database_->FindOriginsWithGroups(&origins);
   for (const url::Origin& origin : origins) {
-    AppCacheInfoVector& infos = info_collection_->infos_by_origin[origin];
+    std::vector<blink::mojom::AppCacheInfo>& infos =
+        info_collection_->infos_by_origin[origin];
     std::vector<AppCacheDatabase::GroupRecord> groups;
     database_->FindGroupsForOrigin(origin, &groups);
     for (const auto& group : groups) {
diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc
index a45f1c4..cc943c9 100644
--- a/content/browser/appcache/appcache_storage_impl_unittest.cc
+++ b/content/browser/appcache/appcache_storage_impl_unittest.cc
@@ -1692,6 +1692,14 @@
       EXPECT_EQ(static_cast<int>(kCorruptData.length()),
                 base::WriteFile(
                     index_file, kCorruptData.data(), kCorruptData.length()));
+
+      // Also add a corrupt entry file so that simple disk_cache does not try
+      // to automatically recover from the corrupted index.
+      base::FilePath entry_file =
+          disk_cache_directory.AppendASCII("01234567_0");
+      EXPECT_EQ(static_cast<int>(kCorruptData.length()),
+                base::WriteFile(entry_file, kCorruptData.data(),
+                                kCorruptData.length()));
     }
 
     // Create records for a degenerate cached manifest that only contains
diff --git a/content/browser/background_fetch/background_fetch.proto b/content/browser/background_fetch/background_fetch.proto
index c043817..fb3bcd0 100644
--- a/content/browser/background_fetch/background_fetch.proto
+++ b/content/browser/background_fetch/background_fetch.proto
@@ -93,16 +93,24 @@
 // the following steps:
 // 1. Add a new enum value (SV_ENABLE_NEW_KEY_FORMAT) and increment
 //    `SV_CURRENT`
-// 2. Migrate the old formats on database load (GetInitializationDataTask).
+// 2. Migrate the old formats on database load (DatabaseMigrationTask).
 // 3. Add a TODO with a bug to clean this up after 2 milestones or so.
 //
-// Next Tag: 2
+// Next Value: 3
 enum BackgroundFetchStorageVersion {
+  // There was an error when trying to get the storage version.
+  SV_ERROR = -1;
+  // No storage version was found.
   SV_UNINITIALIZED = 0;
+
+  // Migrate registered fetches to use the new Cache URL key format, to make
+  // them unique, and allow for duplicate requests in a registration.
+  SV_UNIQUE_CACHE_KEYS = 1;
+
   // Add new versions here.
 
   // Must be last.
-  SV_CURRENT = 1;
+  SV_CURRENT = 2;
 }
 
 // Stores information about the background fetch that will be persisted
diff --git a/content/browser/background_fetch/background_fetch_data_manager.cc b/content/browser/background_fetch/background_fetch_data_manager.cc
index 4283f10fc..824d131 100644
--- a/content/browser/background_fetch/background_fetch_data_manager.cc
+++ b/content/browser/background_fetch/background_fetch_data_manager.cc
@@ -19,6 +19,7 @@
 #include "content/browser/background_fetch/storage/get_developer_ids_task.h"
 #include "content/browser/background_fetch/storage/get_metadata_task.h"
 #include "content/browser/background_fetch/storage/get_registration_task.h"
+#include "content/browser/background_fetch/storage/get_request_blob_task.h"
 #include "content/browser/background_fetch/storage/mark_registration_for_deletion_task.h"
 #include "content/browser/background_fetch/storage/mark_request_complete_task.h"
 #include "content/browser/background_fetch/storage/match_requests_task.h"
@@ -159,6 +160,16 @@
           this, registration_id, std::move(callback)));
 }
 
+void BackgroundFetchDataManager::GetRequestBlob(
+    const BackgroundFetchRegistrationId& registration_id,
+    const scoped_refptr<BackgroundFetchRequestInfo>& request_info,
+    GetRequestBlobCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  AddDatabaseTask(std::make_unique<background_fetch::GetRequestBlobTask>(
+      this, registration_id, request_info, std::move(callback)));
+}
+
 void BackgroundFetchDataManager::MarkRequestAsComplete(
     const BackgroundFetchRegistrationId& registration_id,
     scoped_refptr<BackgroundFetchRequestInfo> request_info,
diff --git a/content/browser/background_fetch/background_fetch_data_manager.h b/content/browser/background_fetch/background_fetch_data_manager.h
index 6932733..7a74f88 100644
--- a/content/browser/background_fetch/background_fetch_data_manager.h
+++ b/content/browser/background_fetch/background_fetch_data_manager.h
@@ -70,6 +70,9 @@
   using MarkRegistrationForDeletionCallback =
       base::OnceCallback<void(blink::mojom::BackgroundFetchError,
                               blink::mojom::BackgroundFetchFailureReason)>;
+  using GetRequestBlobCallback =
+      base::OnceCallback<void(blink::mojom::BackgroundFetchError,
+                              blink::mojom::SerializedBlobPtr)>;
   using MarkRequestCompleteCallback =
       base::OnceCallback<void(blink::mojom::BackgroundFetchError)>;
   using NextRequestCallback =
@@ -127,6 +130,13 @@
   void PopNextRequest(const BackgroundFetchRegistrationId& registration_id,
                       NextRequestCallback callback);
 
+  // Retrieves the request blob associated with |request_info|. THis should be
+  // called for requests that are known to have a blob.
+  void GetRequestBlob(
+      const BackgroundFetchRegistrationId& registration_id,
+      const scoped_refptr<BackgroundFetchRequestInfo>& request_info,
+      GetRequestBlobCallback callback);
+
   // Marks |request_info| as complete and calls |callback| when done.
   void MarkRequestAsComplete(
       const BackgroundFetchRegistrationId& registration_id,
diff --git a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
index 07defde3..b1025b5 100644
--- a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
@@ -104,6 +104,12 @@
   std::move(quit_closure).Run();
 }
 
+void DidStoreUserData(base::OnceClosure quit_closure,
+                      blink::ServiceWorkerStatusCode status) {
+  DCHECK_EQ(blink::ServiceWorkerStatusCode::kOk, status);
+  std::move(quit_closure).Run();
+}
+
 void AnnotateRequestInfoWithFakeDownloadManagerData(
     BackgroundFetchRequestInfo* request_info,
     bool success = false,
@@ -339,6 +345,32 @@
   }
 
   // Synchronous version of
+  // BackgroundFetchDataManager::GetRequestBlob().
+  std::string GetRequestBlobAsString(
+      const BackgroundFetchRegistrationId& registration_id,
+      const scoped_refptr<BackgroundFetchRequestInfo>& request_info,
+      blink::mojom::BackgroundFetchError* out_error) {
+    DCHECK(out_error);
+
+    blink::mojom::SerializedBlobPtr blob;
+
+    base::RunLoop run_loop;
+    background_fetch_data_manager_->GetRequestBlob(
+        registration_id, request_info,
+        base::BindOnce(&BackgroundFetchDataManagerTest::DidGetRequestBlob,
+                       base::Unretained(this), run_loop.QuitClosure(),
+                       out_error, &blob));
+    run_loop.Run();
+
+    if (blob && blob->blob) {
+      blink::mojom::BlobPtr blob_ptr(std::move(blob->blob));
+      return CopyBody(blob_ptr.get());
+    }
+
+    return std::string();
+  }
+
+  // Synchronous version of
   // BackgroundFetchDataManager::MarkRegistrationForDeletion().
   void MarkRegistrationForDeletion(
       const BackgroundFetchRegistrationId& registration_id,
@@ -428,6 +460,19 @@
     return data;
   }
 
+  // Synchronously writes data to the SW DB.
+  void StoreUserData(int64_t service_worker_registration_id,
+                     const std::string& key,
+                     const std::string& value) {
+    std::vector<std::string> data;
+
+    base::RunLoop run_loop;
+    embedded_worker_test_helper()->context_wrapper()->StoreRegistrationUserData(
+        service_worker_registration_id, origin().GetURL(), {{key, value}},
+        base::BindOnce(&DidStoreUserData, run_loop.QuitClosure()));
+    run_loop.Run();
+  }
+
   // Synchronous version of CacheStorageManager::HasCache().
   bool HasCache(const std::string& cache_name) {
     bool result = false;
@@ -504,6 +549,42 @@
     }
   }
 
+  void PutInCache(const blink::mojom::FetchAPIRequestPtr& request,
+                  blink::mojom::FetchAPIResponsePtr response) {
+    CacheStorageCacheHandle handle;
+    {
+      base::RunLoop run_loop;
+      CacheStorageHandle cache_storage =
+          background_fetch_data_manager_->cache_manager()->OpenCacheStorage(
+              origin(), CacheStorageOwner::kBackgroundFetch);
+      cache_storage.value()->OpenCache(
+          /* cache_name= */ kExampleUniqueId,
+          base::BindOnce(&BackgroundFetchDataManagerTest::DidOpenCache,
+                         base::Unretained(this), run_loop.QuitClosure(),
+                         &handle));
+      run_loop.Run();
+    }
+
+    DCHECK(handle.value());
+
+    {
+      base::RunLoop run_loop;
+      std::vector<blink::mojom::BatchOperationPtr> operation_ptr_vec;
+      operation_ptr_vec.push_back(blink::mojom::BatchOperation::New());
+      operation_ptr_vec[0]->operation_type = blink::mojom::OperationType::kPut;
+      operation_ptr_vec[0]->request =
+          BackgroundFetchSettledFetch::CloneRequest(request);
+      operation_ptr_vec[0]->response = std::move(response);
+      handle.value()->BatchOperation(
+          std::move(operation_ptr_vec), /* fail_on_duplicates= */ true,
+          base::BindOnce(&BackgroundFetchDataManagerTest::DidDeleteFromCache,
+                         base::Unretained(this), run_loop.QuitClosure()),
+          base::DoNothing());
+
+      run_loop.Run();
+    }
+  }
+
   // Returns the title and the icon.
   std::pair<std::string, SkBitmap> GetUIOptions(
       int64_t service_worker_registration_id) {
@@ -661,6 +742,16 @@
     std::move(quit_closure).Run();
   }
 
+  void DidGetRequestBlob(base::OnceClosure quit_closure,
+                         blink::mojom::BackgroundFetchError* out_error,
+                         blink::mojom::SerializedBlobPtr* out_blob,
+                         blink::mojom::BackgroundFetchError error,
+                         blink::mojom::SerializedBlobPtr blob) {
+    *out_error = error;
+    *out_blob = std::move(blob);
+    std::move(quit_closure).Run();
+  }
+
   void DidMarkRequestAsComplete(base::OnceClosure quit_closure,
                                 blink::mojom::BackgroundFetchError* out_error,
                                 blink::mojom::BackgroundFetchError error) {
@@ -1441,6 +1532,59 @@
                           /* completed_requests= */ 2}));
 }
 
+TEST_F(BackgroundFetchDataManagerTest, GetUploadBody) {
+  int64_t sw_id = RegisterServiceWorker();
+  ASSERT_NE(blink::mojom::kInvalidServiceWorkerRegistrationId, sw_id);
+
+  std::vector<blink::mojom::FetchAPIRequestPtr> requests;
+  {
+    auto request = blink::mojom::FetchAPIRequest::New();
+    request->url = GURL("https://example.com/upload");
+    request->method = "POST";
+    request->referrer = blink::mojom::Referrer::New();
+    requests.push_back(BackgroundFetchSettledFetch::CloneRequest(request));
+    requests.push_back(BackgroundFetchSettledFetch::CloneRequest(request));
+  }
+  requests[0]->blob = BuildBlob("upload1");
+  requests[1]->blob = BuildBlob("upload2");
+
+  auto options = blink::mojom::BackgroundFetchOptions::New();
+  blink::mojom::BackgroundFetchError error;
+
+  BackgroundFetchRegistrationId registration_id(
+      sw_id, origin(), kExampleDeveloperId, kExampleUniqueId);
+
+  {
+    EXPECT_CALL(*this, OnRegistrationCreated(registration_id, _, _, _, _, _));
+
+    CreateRegistration(registration_id, std::move(requests), std::move(options),
+                       SkBitmap(), &error);
+    ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+  }
+
+  scoped_refptr<BackgroundFetchRequestInfo> request_info1;
+  PopNextRequest(registration_id, &error, &request_info1);
+  ASSERT_TRUE(request_info1);
+  EXPECT_EQ(request_info1->request_index(), 0);
+  EXPECT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+
+  scoped_refptr<BackgroundFetchRequestInfo> request_info2;
+  PopNextRequest(registration_id, &error, &request_info2);
+  ASSERT_TRUE(request_info2);
+  EXPECT_EQ(request_info2->request_index(), 1);
+  EXPECT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+
+  auto payload1 =
+      GetRequestBlobAsString(registration_id, request_info1, &error);
+  EXPECT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+  EXPECT_EQ(payload1, "upload1");
+
+  auto payload2 =
+      GetRequestBlobAsString(registration_id, request_info2, &error);
+  EXPECT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+  EXPECT_EQ(payload2, "upload2");
+}
+
 TEST_F(BackgroundFetchDataManagerTest, RegistrationBytesUpdated) {
   int64_t sw_id = RegisterServiceWorker();
   ASSERT_NE(blink::mojom::kInvalidServiceWorkerRegistrationId, sw_id);
@@ -2385,4 +2529,72 @@
   }
 }
 
+TEST_F(BackgroundFetchDataManagerTest, CacheUrlMigration) {
+  int64_t sw_id = RegisterServiceWorker();
+  ASSERT_NE(blink::mojom::kInvalidServiceWorkerRegistrationId, sw_id);
+
+  BackgroundFetchRegistrationId registration_id(
+      sw_id, origin(), kExampleDeveloperId, kExampleUniqueId);
+
+  std::vector<blink::mojom::FetchAPIRequestPtr> requests =
+      CreateValidRequests(origin(), 2u);
+
+  // Create a Registration and complete one of the entries.
+  {
+    blink::mojom::BackgroundFetchError error;
+    CreateRegistration(registration_id, CloneRequestVector(requests),
+                       blink::mojom::BackgroundFetchOptions::New(), SkBitmap(),
+                       &error);
+    ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+    scoped_refptr<BackgroundFetchRequestInfo> request_info;
+    PopNextRequest(registration_id, &error, &request_info);
+    ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+    AnnotateRequestInfoWithFakeDownloadManagerData(request_info.get(),
+                                                   /* succeeded= */ true);
+    EXPECT_CALL(*this, OnRequestCompleted(kExampleUniqueId, _, _));
+    MarkRequestAsComplete(registration_id, request_info.get(), &error);
+    EXPECT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+  }
+
+  // Delete the entries from Cache and rewrite them in the old format.
+  DeleteFromCache(requests[0]);
+  DeleteFromCache(requests[1]);
+  PutInCache(requests[0], blink::mojom::FetchAPIResponse::New());
+  auto response = blink::mojom::FetchAPIResponse::New();
+  response->blob = BuildBlob("data!");
+  response->url_list = {requests[1]->url};
+  PutInCache(requests[1], std::move(response));
+
+  // Rewrite the storage version.
+  StoreUserData(sw_id, background_fetch::StorageVersionKey(kExampleUniqueId),
+                base::NumberToString(proto::SV_UNIQUE_CACHE_KEYS));
+
+  // Run the DB migration task.
+  std::vector<BackgroundFetchInitializationData> data = GetInitializationData();
+  ASSERT_EQ(data.size(), 1u);
+
+  // Check that the storage version was updated.
+  auto storage_version = GetRegistrationUserDataByKeyPrefix(
+      sw_id, background_fetch::StorageVersionKey(kExampleUniqueId));
+  ASSERT_EQ(storage_version.size(), 1u);
+  EXPECT_EQ(storage_version[0], base::NumberToString(proto::SV_CURRENT));
+
+  // Check that the data in the cache makes sense.
+  std::vector<blink::mojom::BackgroundFetchSettledFetchPtr> settled_fetches;
+  blink::mojom::BackgroundFetchError error;
+  MatchRequests(registration_id, /* request_to_match= */ nullptr,
+                /* cache_query_params= */ nullptr, /* match_all= */ true,
+                &error, &settled_fetches);
+  ASSERT_EQ(error, blink::mojom::BackgroundFetchError::NONE);
+  ASSERT_EQ(settled_fetches.size(), requests.size());
+
+  EXPECT_EQ(settled_fetches[0]->request->url, requests[0]->url);
+  EXPECT_EQ(settled_fetches[1]->request->url, requests[1]->url);
+
+  ASSERT_TRUE(settled_fetches[1]->response);
+  blink::mojom::BlobPtr blob(
+      std::move(settled_fetches[1]->response->blob->blob));
+  EXPECT_EQ(CopyBody(blob.get()), "data!");
+}
+
 }  // namespace content
diff --git a/content/browser/background_fetch/background_fetch_delegate_proxy.cc b/content/browser/background_fetch/background_fetch_delegate_proxy.cc
index e56ddcd..97bb7565 100644
--- a/content/browser/background_fetch/background_fetch_delegate_proxy.cc
+++ b/content/browser/background_fetch/background_fetch_delegate_proxy.cc
@@ -573,10 +573,8 @@
   auto& job_details = job_details_map_.find(job_unique_id)->second;
   DCHECK(job_details.controller);
 
-  const auto& request =
-      job_details.current_request_map[download_guid]->fetch_request_ptr();
-  job_details.controller->GetUploadData(
-      BackgroundFetchSettledFetch::CloneRequest(request), std::move(callback));
+  const auto& request = job_details.current_request_map[download_guid];
+  job_details.controller->GetUploadData(request, std::move(callback));
 }
 
 }  // namespace content
diff --git a/content/browser/background_fetch/background_fetch_delegate_proxy.h b/content/browser/background_fetch/background_fetch_delegate_proxy.h
index 2ec79134..6dcd1871 100644
--- a/content/browser/background_fetch/background_fetch_delegate_proxy.h
+++ b/content/browser/background_fetch/background_fetch_delegate_proxy.h
@@ -59,7 +59,7 @@
     // Called by the delegate when the Download Service is requesting the
     // upload data.
     virtual void GetUploadData(
-        blink::mojom::FetchAPIRequestPtr request,
+        const scoped_refptr<BackgroundFetchRequestInfo>& request,
         BackgroundFetchDelegate::GetUploadDataCallback callback) = 0;
 
     virtual ~Controller() {}
diff --git a/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc b/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc
index 5ad8987..12dd1f4 100644
--- a/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc
@@ -159,7 +159,7 @@
       blink::mojom::BackgroundFetchFailureReason reason_to_abort) override {}
 
   void GetUploadData(
-      blink::mojom::FetchAPIRequestPtr request,
+      const scoped_refptr<BackgroundFetchRequestInfo>& request,
       BackgroundFetchDelegate::GetUploadDataCallback callback) override {}
 
   bool request_started_ = false;
diff --git a/content/browser/background_fetch/background_fetch_job_controller.cc b/content/browser/background_fetch/background_fetch_job_controller.cc
index d22b800..c4cca92 100644
--- a/content/browser/background_fetch/background_fetch_job_controller.cc
+++ b/content/browser/background_fetch/background_fetch_job_controller.cc
@@ -318,13 +318,10 @@
 }
 
 void BackgroundFetchJobController::GetUploadData(
-    blink::mojom::FetchAPIRequestPtr request,
+    const scoped_refptr<BackgroundFetchRequestInfo>& request,
     BackgroundFetchDelegate::GetUploadDataCallback callback) {
-  data_manager_->MatchRequests(
-      registration_id(),
-      std::make_unique<BackgroundFetchRequestMatchParams>(
-          std::move(request), /* match_params= */ nullptr,
-          /* match_all= */ false),
+  data_manager_->GetRequestBlob(
+      registration_id(), request,
       base::BindOnce(&BackgroundFetchJobController::DidGetUploadData,
                      GetWeakPtr(), std::move(callback)));
 }
@@ -332,17 +329,15 @@
 void BackgroundFetchJobController::DidGetUploadData(
     BackgroundFetchDelegate::GetUploadDataCallback callback,
     BackgroundFetchError error,
-    std::vector<blink::mojom::BackgroundFetchSettledFetchPtr> fetches) {
+    blink::mojom::SerializedBlobPtr blob) {
   if (error != BackgroundFetchError::NONE) {
     Abort(BackgroundFetchFailureReason::SERVICE_WORKER_UNAVAILABLE,
           base::DoNothing());
     std::move(callback).Run(nullptr);
-    return;
   }
 
-  DCHECK_EQ(fetches.size(), 1u);
-  DCHECK(fetches[0]->request->blob);
-  std::move(callback).Run(std::move(fetches[0]->request->blob));
+  DCHECK(blob);
+  std::move(callback).Run(std::move(blob));
 }
 
 }  // namespace content
diff --git a/content/browser/background_fetch/background_fetch_job_controller.h b/content/browser/background_fetch/background_fetch_job_controller.h
index 15515c2..d185260 100644
--- a/content/browser/background_fetch/background_fetch_job_controller.h
+++ b/content/browser/background_fetch/background_fetch_job_controller.h
@@ -103,7 +103,7 @@
   void AbortFromDelegate(
       blink::mojom::BackgroundFetchFailureReason failure_reason) override;
   void GetUploadData(
-      blink::mojom::FetchAPIRequestPtr request,
+      const scoped_refptr<BackgroundFetchRequestInfo>& request,
       BackgroundFetchDelegate::GetUploadDataCallback callback) override;
 
   // Aborts the fetch. |callback| will run with the result of marking the
@@ -133,10 +133,9 @@
   void Finish(blink::mojom::BackgroundFetchFailureReason reason_to_abort,
               ErrorCallback callback);
 
-  void DidGetUploadData(
-      BackgroundFetchDelegate::GetUploadDataCallback callback,
-      blink::mojom::BackgroundFetchError error,
-      std::vector<blink::mojom::BackgroundFetchSettledFetchPtr> fetches);
+  void DidGetUploadData(BackgroundFetchDelegate::GetUploadDataCallback callback,
+                        blink::mojom::BackgroundFetchError error,
+                        blink::mojom::SerializedBlobPtr blob);
 
   // Manager for interacting with the DB. It is owned by the
   // BackgroundFetchContext.
diff --git a/content/browser/background_fetch/storage/database_task.cc b/content/browser/background_fetch/storage/database_task.cc
index 8907d0b..aa4370f 100644
--- a/content/browser/background_fetch/storage/database_task.cc
+++ b/content/browser/background_fetch/storage/database_task.cc
@@ -107,10 +107,11 @@
                                         blink::ServiceWorkerStatusCode status) {
   switch (ToDatabaseStatus(status)) {
     case DatabaseStatus::kNotFound:
-    case DatabaseStatus::kFailed:
-      // This shouldn't happen.
       std::move(callback).Run(proto::SV_UNINITIALIZED);
       return;
+    case DatabaseStatus::kFailed:
+      std::move(callback).Run(proto::SV_ERROR);
+      return;
     case DatabaseStatus::kOk:
       break;
   }
@@ -120,7 +121,7 @@
 
   if (!base::StringToInt(data[0], &storage_version) ||
       !proto::BackgroundFetchStorageVersion_IsValid(storage_version)) {
-    storage_version = proto::SV_UNINITIALIZED;
+    storage_version = proto::SV_ERROR;
   }
 
   std::move(callback).Run(
diff --git a/content/browser/background_fetch/storage/get_initialization_data_task.cc b/content/browser/background_fetch/storage/get_initialization_data_task.cc
index 3fb59529..093f80a 100644
--- a/content/browser/background_fetch/storage/get_initialization_data_task.cc
+++ b/content/browser/background_fetch/storage/get_initialization_data_task.cc
@@ -378,6 +378,158 @@
   DISALLOW_COPY_AND_ASSIGN(FillFromMetadataTask);
 };
 
+// If the storage version was updated, this performs the necessary schema
+// updates on startup.
+class CacheStorageMigrationTask : public InitializationSubTask {
+ public:
+  CacheStorageMigrationTask(DatabaseTaskHost* host,
+                            const SubTaskInit& sub_task_init,
+                            base::OnceClosure done_closure)
+      : InitializationSubTask(host, sub_task_init, std::move(done_closure)),
+        weak_factory_(this) {}
+
+  ~CacheStorageMigrationTask() override = default;
+
+  void Start() override {
+    GetStorageVersion(
+        sub_task_init().service_worker_registration_id,
+        sub_task_init().unique_id,
+        base::BindOnce(&CacheStorageMigrationTask::DidGetStorageVersion,
+                       weak_factory_.GetWeakPtr()));
+  }
+
+ private:
+  void DidGetStorageVersion(
+      proto::BackgroundFetchStorageVersion storage_version) {
+    if (storage_version == proto::SV_ERROR) {
+      FinishWithError(blink::mojom::BackgroundFetchError::STORAGE_ERROR);
+      return;
+    }
+
+    if (storage_version == proto::SV_CURRENT) {
+      // Already on latest version, nothing to do here.
+      FinishWithError(blink::mojom::BackgroundFetchError::NONE);
+      return;
+    }
+
+    cache_storage_handle_ = GetOrOpenCacheStorage(
+        sub_task_init().initialization_data->registration_id);
+    cache_storage_handle_.value()->OpenCache(
+        /* cache_name= */ sub_task_init().unique_id,
+        base::BindOnce(&CacheStorageMigrationTask::DidOpenCache,
+                       weak_factory_.GetWeakPtr()));
+  }
+
+  void DidOpenCache(CacheStorageCacheHandle handle,
+                    blink::mojom::CacheStorageError error) {
+    if (error != blink::mojom::CacheStorageError::kSuccess) {
+      SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+      return;
+    }
+
+    DCHECK(handle.value());
+    // Get all entries in the cache.
+    handle.value()->GetAllMatchedEntries(
+        /* request= */ nullptr, /* query_params= */ nullptr,
+        base::BindOnce(&CacheStorageMigrationTask::DidGetAllMatchedEntries,
+                       weak_factory_.GetWeakPtr(), handle.Clone()));
+  }
+
+  void DidGetAllMatchedEntries(
+      CacheStorageCacheHandle handle,
+      blink::mojom::CacheStorageError error,
+      std::vector<CacheStorageCache::CacheEntry> entries) {
+    if (error != blink::mojom::CacheStorageError::kSuccess) {
+      SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+      return;
+    }
+
+    entries_ = std::move(entries);
+
+    // Delete Cache.
+    cache_storage_handle_.value()->DoomCache(
+        /* cache_name= */ sub_task_init().unique_id,
+        base::BindOnce(&CacheStorageMigrationTask::DidDoomCache,
+                       weak_factory_.GetWeakPtr()));
+  }
+
+  void DidDoomCache(blink::mojom::CacheStorageError error) {
+    if (error != blink::mojom::CacheStorageError::kSuccess) {
+      SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+      return;
+    }
+
+    // Recreate the cache.
+    cache_storage_handle_.value()->OpenCache(
+        /* cache_name= */ sub_task_init().unique_id,
+        base::BindOnce(&CacheStorageMigrationTask::DidReopenCache,
+                       weak_factory_.GetWeakPtr()));
+  }
+
+  void DidReopenCache(CacheStorageCacheHandle handle,
+                      blink::mojom::CacheStorageError error) {
+    if (error != blink::mojom::CacheStorageError::kSuccess) {
+      SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+      return;
+    }
+
+    std::vector<blink::mojom::BatchOperationPtr> operations;
+    operations.reserve(entries_.size());
+    for (size_t i = 0; i < entries_.size(); i++) {
+      auto& entry = entries_[i];
+      auto operation = blink::mojom::BatchOperation::New();
+      operation->operation_type = blink::mojom::OperationType::kPut;
+      entry.first->url =
+          MakeCacheUrlUnique(entry.first->url, sub_task_init().unique_id, i);
+      operation->request = std::move(entry.first);
+      operation->response = std::move(entry.second);
+      operations.push_back(std::move(operation));
+    }
+
+    DCHECK(handle.value());
+
+    // Rewrite the URLs with the new format.
+    handle.value()->BatchOperation(
+        std::move(operations), /* fail_on_duplicates= */ false,
+        base::BindOnce(&CacheStorageMigrationTask::DidStoreRequests,
+                       weak_factory_.GetWeakPtr(), handle.Clone()),
+        base::DoNothing());
+  }
+
+  void DidStoreRequests(CacheStorageCacheHandle handle,
+                        blink::mojom::CacheStorageVerboseErrorPtr error) {
+    if (error->value != blink::mojom::CacheStorageError::kSuccess) {
+      SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+      return;
+    }
+
+    // Update the storage version.
+    service_worker_context()->StoreRegistrationUserData(
+        sub_task_init().service_worker_registration_id,
+        sub_task_init().initialization_data->registration_id.origin().GetURL(),
+        {{StorageVersionKey(sub_task_init().unique_id),
+          base::NumberToString(proto::SV_CURRENT)}},
+        base::BindOnce(&CacheStorageMigrationTask::DidUpdateStorageVersion,
+                       weak_factory_.GetWeakPtr()));
+  }
+
+  void DidUpdateStorageVersion(blink::ServiceWorkerStatusCode status) {
+    if (status == blink::ServiceWorkerStatusCode::kOk) {
+      FinishWithError(blink::mojom::BackgroundFetchError::NONE);
+      return;
+    }
+    SetStorageErrorAndFinish(
+        BackgroundFetchStorageError::kServiceWorkerStorageError);
+  }
+
+  CacheStorageHandle cache_storage_handle_;
+  std::vector<CacheStorageCache::CacheEntry> entries_;
+
+  base::WeakPtrFactory<CacheStorageMigrationTask> weak_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(CacheStorageMigrationTask);
+};
+
 // Asynchronously calls the SubTasks required to collect all the information for
 // the BackgroundFetchInitializationData.
 class FillBackgroundFetchInitializationDataTask : public InitializationSubTask {
@@ -397,14 +549,9 @@
     // 2. Request statuses and state sanitization
     // 3. UI Options (+ icon deserialization)
     base::RepeatingClosure barrier_closure = base::BarrierClosure(
-        3u,
-        base::BindOnce(
-            [](base::WeakPtr<FillBackgroundFetchInitializationDataTask> task) {
-              if (task)
-                task->FinishWithError(
-                    task->sub_task_init().initialization_data->error);
-            },
-            weak_factory_.GetWeakPtr()));
+        3u, base::BindOnce(&FillBackgroundFetchInitializationDataTask::
+                               DidQueryInitializationData,
+                           weak_factory_.GetWeakPtr()));
     AddSubTask(std::make_unique<FillFromMetadataTask>(this, sub_task_init(),
                                                       barrier_closure));
     AddSubTask(std::make_unique<GetRequestsTask>(this, sub_task_init(),
@@ -413,6 +560,24 @@
                                                   barrier_closure));
   }
 
+  void DidQueryInitializationData() {
+    if (sub_task_init().initialization_data->error !=
+        blink::mojom::BackgroundFetchError::NONE) {
+      FinishWithError(sub_task_init().initialization_data->error);
+      return;
+    }
+
+    AddSubTask(std::make_unique<CacheStorageMigrationTask>(
+        this, sub_task_init(),
+        base::BindOnce(&FillBackgroundFetchInitializationDataTask::
+                           DidMigrateCacheStorageTask,
+                       weak_factory_.GetWeakPtr())));
+  }
+
+  void DidMigrateCacheStorageTask() {
+    FinishWithError(sub_task_init().initialization_data->error);
+  }
+
  private:
   base::WeakPtrFactory<FillBackgroundFetchInitializationDataTask>
       weak_factory_;  // Keep as last.
diff --git a/content/browser/background_fetch/storage/get_request_blob_task.cc b/content/browser/background_fetch/storage/get_request_blob_task.cc
new file mode 100644
index 0000000..bba3e4c
--- /dev/null
+++ b/content/browser/background_fetch/storage/get_request_blob_task.cc
@@ -0,0 +1,82 @@
+// Copyright 2019 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/background_fetch/storage/get_request_blob_task.h"
+#include "content/browser/background_fetch/background_fetch_request_match_params.h"
+#include "content/browser/background_fetch/storage/database_helpers.h"
+#include "content/common/background_fetch/background_fetch_types.h"
+
+namespace content {
+namespace background_fetch {
+
+GetRequestBlobTask::GetRequestBlobTask(
+    DatabaseTaskHost* host,
+    const BackgroundFetchRegistrationId& registration_id,
+    const scoped_refptr<BackgroundFetchRequestInfo>& request_info,
+    GetRequestBlobCallback callback)
+    : DatabaseTask(host),
+      registration_id_(registration_id),
+      request_info_(request_info),
+      callback_(std::move(callback)),
+      weak_factory_(this) {}
+
+GetRequestBlobTask::~GetRequestBlobTask() = default;
+
+void GetRequestBlobTask::Start() {
+  CacheStorageHandle cache_storage = GetOrOpenCacheStorage(registration_id_);
+  cache_storage.value()->OpenCache(
+      /* cache_name= */ registration_id_.unique_id(),
+      base::BindOnce(&GetRequestBlobTask::DidOpenCache,
+                     weak_factory_.GetWeakPtr()));
+}
+
+void GetRequestBlobTask::DidOpenCache(CacheStorageCacheHandle handle,
+                                      blink::mojom::CacheStorageError error) {
+  if (error != blink::mojom::CacheStorageError::kSuccess) {
+    SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+    return;
+  }
+
+  DCHECK(handle.value());
+  auto request =
+      BackgroundFetchSettledFetch::CloneRequest(request_info_->fetch_request());
+  request->url = MakeCacheUrlUnique(request->url, registration_id_.unique_id(),
+                                    request_info_->request_index());
+
+  handle.value()->GetAllMatchedEntries(
+      std::move(request), /* match_params= */ nullptr,
+      base::BindOnce(&GetRequestBlobTask::DidMatchRequest,
+                     weak_factory_.GetWeakPtr(), handle.Clone()));
+}
+
+void GetRequestBlobTask::DidMatchRequest(
+    CacheStorageCacheHandle handle,
+    blink::mojom::CacheStorageError error,
+    std::vector<CacheStorageCache::CacheEntry> entries) {
+  if (error != blink::mojom::CacheStorageError::kSuccess || entries.empty()) {
+    SetStorageErrorAndFinish(BackgroundFetchStorageError::kCacheStorageError);
+    return;
+  }
+
+  DCHECK_EQ(entries.size(), 1u);
+  DCHECK(entries[0].first->blob);
+
+  blob_ = std::move(entries[0].first->blob);
+  FinishWithError(blink::mojom::BackgroundFetchError::NONE);
+}
+
+void GetRequestBlobTask::FinishWithError(
+    blink::mojom::BackgroundFetchError error) {
+  ReportStorageError();
+
+  std::move(callback_).Run(error, std::move(blob_));
+  Finished();
+}
+
+std::string GetRequestBlobTask::HistogramName() const {
+  return "GetRequestBlobTask";
+}
+
+}  // namespace background_fetch
+}  // namespace content
diff --git a/content/browser/background_fetch/storage/get_request_blob_task.h b/content/browser/background_fetch/storage/get_request_blob_task.h
new file mode 100644
index 0000000..1dd98e8
--- /dev/null
+++ b/content/browser/background_fetch/storage/get_request_blob_task.h
@@ -0,0 +1,61 @@
+// Copyright 2019 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_BACKGROUND_FETCH_STORAGE_GET_REQUEST_BLOB_TASK_H_
+#define CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_REQUEST_BLOB_TASK_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/scoped_refptr.h"
+#include "content/browser/background_fetch/background_fetch_request_info.h"
+#include "content/browser/background_fetch/storage/database_task.h"
+#include "storage/browser/blob/blob_data_handle.h"
+#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
+
+namespace content {
+namespace background_fetch {
+
+class GetRequestBlobTask : public DatabaseTask {
+ public:
+  using GetRequestBlobCallback =
+      base::OnceCallback<void(blink::mojom::BackgroundFetchError,
+                              blink::mojom::SerializedBlobPtr)>;
+
+  GetRequestBlobTask(
+      DatabaseTaskHost* host,
+      const BackgroundFetchRegistrationId& registration_id,
+      const scoped_refptr<BackgroundFetchRequestInfo>& request_info,
+      GetRequestBlobCallback callback);
+
+  ~GetRequestBlobTask() override;
+
+  // DatabaseTask implementation:
+  void Start() override;
+
+ private:
+  void DidOpenCache(CacheStorageCacheHandle handle,
+                    blink::mojom::CacheStorageError error);
+
+  void DidMatchRequest(CacheStorageCacheHandle handle,
+                       blink::mojom::CacheStorageError error,
+                       std::vector<CacheStorageCache::CacheEntry> entries);
+
+  void FinishWithError(blink::mojom::BackgroundFetchError error) override;
+
+  std::string HistogramName() const override;
+
+  BackgroundFetchRegistrationId registration_id_;
+  scoped_refptr<BackgroundFetchRequestInfo> request_info_;
+  GetRequestBlobCallback callback_;
+
+  blink::mojom::SerializedBlobPtr blob_;
+
+  base::WeakPtrFactory<GetRequestBlobTask> weak_factory_;  // Keep as last.
+
+  DISALLOW_COPY_AND_ASSIGN(GetRequestBlobTask);
+};
+
+}  // namespace background_fetch
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_REQUEST_BLOB_TASK_H_
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc
index 16066e0..9eee068 100644
--- a/content/browser/devtools/protocol/page_handler.cc
+++ b/content/browser/devtools/protocol/page_handler.cc
@@ -627,6 +627,18 @@
     callback->sendFailure(Response::InternalError());
     return;
   }
+  if (clip.isJust()) {
+    if (clip.fromJust()->GetWidth() == 0) {
+      callback->sendFailure(
+          Response::Error("Cannot take screenshot with 0 width."));
+      return;
+    }
+    if (clip.fromJust()->GetHeight() == 0) {
+      callback->sendFailure(
+          Response::Error("Cannot take screenshot with 0 height."));
+      return;
+    }
+  }
 
   RenderWidgetHostImpl* widget_host = host_->GetRenderWidgetHost();
   std::string screenshot_format = format.fromMaybe(kPng);
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 4a2b9d6a..5249401e 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -81,6 +81,8 @@
 #include "media/base/mime_util.h"
 #include "net/base/escape.h"
 #include "net/http/http_status_code.h"
+#include "services/metrics/public/cpp/ukm_builders.h"
+#include "services/metrics/public/cpp/ukm_recorder.h"
 #include "skia/ext/platform_canvas.h"
 #include "third_party/blink/public/common/blob/blob_utils.h"
 #include "third_party/blink/public/common/mime_util/mime_util.h"
@@ -1439,6 +1441,16 @@
     GetLastCommittedEntry()->set_should_skip_on_back_forward_ui(true);
     UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.SetShouldSkipOnBackForwardUI",
                           true);
+
+    // Log UKM with the URL of the page we are navigating away from. Note that
+    // GetUkmSourceIdForLastCommittedSource looks into the WebContents to get
+    // the last committed source. Since WebContents has not yet been updated
+    // with the current URL being committed, this should give the correct source
+    // even though |rfh| here belongs to the current navigation.
+    ukm::SourceId source_id = rfh->delegate()
+        ->GetUkmSourceIdForLastCommittedSource();
+    ukm::builders::HistoryManipulationIntervention(source_id).Record(
+        ukm::UkmRecorder::Get());
   } else if (last_committed_entry_index_ != -1) {
     UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.SetShouldSkipOnBackForwardUI",
                           false);
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 952ed88..559d095 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -52,7 +52,6 @@
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/site_isolation_policy.h"
 #include "content/public/browser/storage_partition.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/child_process_host.h"
 #include "content/public/common/content_client.h"
 #include "content/public/common/content_features.h"
@@ -76,6 +75,7 @@
 #include "third_party/blink/public/common/blob/blob_utils.h"
 #include "third_party/blink/public/common/frame/sandbox_flags.h"
 #include "third_party/blink/public/common/service_worker/service_worker_utils.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
 #include "third_party/blink/public/platform/resource_request_blocked_reason.h"
 #include "third_party/blink/public/platform/web_feature.mojom.h"
@@ -1077,7 +1077,7 @@
   commit_params_.appcache_host_id =
       navigation_handle_->appcache_handle()
           ? navigation_handle_->appcache_handle()->appcache_host_id()
-          : kAppCacheNoHostId;
+          : blink::mojom::kAppCacheNoHostId;
 
   // Update fetch start timing. While NavigationRequest updates fetch start
   // timing for redirects, it's not aware of service worker interception so
diff --git a/content/browser/indexed_db/database_impl.cc b/content/browser/indexed_db/database_impl.cc
index f69b3d4..5f054cf 100644
--- a/content/browser/indexed_db/database_impl.cc
+++ b/content/browser/indexed_db/database_impl.cc
@@ -136,7 +136,7 @@
   void AbortWithError(int64_t transaction_id,
                       scoped_refptr<IndexedDBCallbacks> callbacks,
                       const IndexedDBDatabaseError& error);
-  void Commit(int64_t transaction_id);
+  void Commit(int64_t transaction_id, int64_t num_errors_handled);
   void OnGotUsageAndQuotaForCommit(int64_t transaction_id,
                                    blink::mojom::QuotaStatusCode status,
                                    int64_t usage,
@@ -471,10 +471,11 @@
                                 base::Unretained(helper_), transaction_id));
 }
 
-void DatabaseImpl::Commit(int64_t transaction_id) {
+void DatabaseImpl::Commit(int64_t transaction_id, int64_t num_errors_handled) {
   idb_runner_->PostTask(
-      FROM_HERE, base::BindOnce(&IDBSequenceHelper::Commit,
-                                base::Unretained(helper_), transaction_id));
+      FROM_HERE,
+      base::BindOnce(&IDBSequenceHelper::Commit, base::Unretained(helper_),
+                     transaction_id, num_errors_handled));
 }
 
 DatabaseImpl::IDBSequenceHelper::IDBSequenceHelper(
@@ -904,7 +905,8 @@
   connection_->AbortTransaction(transaction, error);
 }
 
-void DatabaseImpl::IDBSequenceHelper::Commit(int64_t transaction_id) {
+void DatabaseImpl::IDBSequenceHelper::Commit(int64_t transaction_id,
+                                             int64_t num_errors_handled) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   if (!connection_->IsConnected())
     return;
@@ -914,6 +916,8 @@
   if (!transaction)
     return;
 
+  transaction->SetNumErrorsHandled(num_errors_handled);
+
   // Always allow empty or delete-only transactions.
   if (transaction->size() == 0) {
     connection_->database()->Commit(transaction);
diff --git a/content/browser/indexed_db/database_impl.h b/content/browser/indexed_db/database_impl.h
index 2edebc3..ce43ae9 100644
--- a/content/browser/indexed_db/database_impl.h
+++ b/content/browser/indexed_db/database_impl.h
@@ -123,7 +123,7 @@
                    int64_t index_id,
                    const base::string16& new_name) override;
   void Abort(int64_t transaction_id) override;
-  void Commit(int64_t transaction_id) override;
+  void Commit(int64_t transaction_id, int64_t num_errors_handled) override;
 
  private:
   class IDBSequenceHelper;
diff --git a/content/browser/indexed_db/indexed_db_cursor.cc b/content/browser/indexed_db/indexed_db_cursor.cc
index 4edd87d..631b5f06 100644
--- a/content/browser/indexed_db/indexed_db_cursor.cc
+++ b/content/browser/indexed_db/indexed_db_cursor.cc
@@ -87,7 +87,10 @@
   IDB_TRACE("IndexedDBCursor::Continue");
 
   if (closed_) {
-    callbacks->OnError(CreateCursorClosedError());
+    callbacks->OnError(CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                                   "The cursor has been closed.",
+                                   transaction_));
+
     return;
   }
 
@@ -108,16 +111,18 @@
     base::PostTaskWithTraits(
         FROM_HERE, {BrowserThread::IO},
         base::BindOnce(
-            [](blink::mojom::IDBCursor::AdvanceCallback callback) {
+            [](blink::mojom::IDBCursor::AdvanceCallback callback,
+               IndexedDBTransaction* transaction) {
               const IndexedDBDatabaseError closed_error(
                   CreateCursorClosedError());
               DCHECK_NE(closed_error.code(), 0);
               std::move(callback).Run(
-                  blink::mojom::IDBError::New(closed_error.code(),
-                                              closed_error.message()),
+                  CreateIDBError(closed_error.code(),
+                                 base::string16(closed_error.message()),
+                                 transaction),
                   blink::mojom::IDBCursorValuePtr());
             },
-            std::move(callback)));
+            std::move(callback), transaction_));
     return;
   }
 
@@ -154,14 +159,15 @@
     base::PostTaskWithTraits(
         FROM_HERE, {BrowserThread::IO},
         base::BindOnce(
-            [](blink::mojom::IDBCursor::AdvanceCallback callback) {
+            [](blink::mojom::IDBCursor::AdvanceCallback callback,
+               IndexedDBTransaction* transaction) {
               std::move(callback).Run(
-                  blink::mojom::IDBError::New(
-                      blink::kWebIDBDatabaseExceptionUnknownError,
-                      base::ASCIIToUTF16("Error advancing cursor")),
+                  CreateIDBError(blink::kWebIDBDatabaseExceptionUnknownError,
+                                 base::ASCIIToUTF16("Error advancing cursor"),
+                                 transaction),
                   blink::mojom::IDBCursorValuePtr());
             },
-            std::move(callback)));
+            std::move(callback), transaction_));
     return s;
   }
 
@@ -220,9 +226,8 @@
       return s;
     }
     Close();
-    callbacks->OnError(
-        IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionUnknownError,
-                               "Error continuing cursor."));
+    callbacks->OnError(CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                                   "Error continuing cursor.", transaction_));
     return s;
   }
 
@@ -236,7 +241,9 @@
   IDB_TRACE("IndexedDBCursor::PrefetchContinue");
 
   if (closed_) {
-    callbacks->OnError(CreateCursorClosedError());
+    callbacks->OnError(CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                                   "The cursor has been closed.",
+                                   transaction_));
     return;
   }
 
@@ -274,8 +281,8 @@
       }
       Close();
       callbacks->OnError(
-          IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionUnknownError,
-                                 "Error continuing cursor."));
+          CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                      "Error continuing cursor.", transaction_));
       return s;
     }
 
@@ -351,4 +358,22 @@
   transaction_ = nullptr;
 }
 
+IndexedDBDatabaseError IndexedDBCursor::CreateError(
+    uint16_t code,
+    const char* message,
+    IndexedDBTransaction* transaction) {
+  DCHECK(transaction);
+  transaction->IncrementNumErrorsSent();
+  return IndexedDBDatabaseError(code, message);
+}
+
+blink::mojom::IDBErrorPtr IndexedDBCursor::CreateIDBError(
+    uint16_t code,
+    const base::string16& message,
+    IndexedDBTransaction* transaction) {
+  DCHECK(transaction);
+  transaction->IncrementNumErrorsSent();
+  return blink::mojom::IDBError::New(code, message);
+}
+
 }  // namespace content
diff --git a/content/browser/indexed_db/indexed_db_cursor.h b/content/browser/indexed_db/indexed_db_cursor.h
index 1f1f678..3b99629 100644
--- a/content/browser/indexed_db/indexed_db_cursor.h
+++ b/content/browser/indexed_db/indexed_db_cursor.h
@@ -65,6 +65,14 @@
       scoped_refptr<IndexedDBCallbacks> callbacks,
       IndexedDBTransaction* transaction);
 
+  static IndexedDBDatabaseError CreateError(uint16_t code,
+                                            const char* message,
+                                            IndexedDBTransaction* transaction);
+  static blink::mojom::IDBErrorPtr CreateIDBError(
+      uint16_t code,
+      const base::string16& message,
+      IndexedDBTransaction* transaction);
+
  private:
   blink::mojom::IDBTaskType task_type_;
   indexed_db::CursorType cursor_type_;
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index c29430fa..e43ec59 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1160,8 +1160,8 @@
       response_size += return_value.SizeEstimate();
     if (response_size > GetUsableMessageSizeInBytes()) {
       callbacks->OnError(
-          IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionUnknownError,
-                                 "Maximum IPC message size exceeded."));
+          CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                      "Maximum IPC message size exceeded.", transaction));
       return s;
     }
 
@@ -1287,8 +1287,8 @@
     key_was_generated = true;
     if (!auto_inc_key->IsValid()) {
       params->callbacks->OnError(
-          IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionConstraintError,
-                                 "Maximum key generator value reached."));
+          CreateError(blink::kWebIDBDatabaseExceptionConstraintError,
+                      "Maximum key generator value reached.", transaction));
       return s;
     }
     key = std::move(auto_inc_key);
@@ -1308,8 +1308,8 @@
       return found_status;
     if (found) {
       params->callbacks->OnError(
-          IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionConstraintError,
-                                 "Key already exists in the object store."));
+          CreateError(blink::kWebIDBDatabaseExceptionConstraintError,
+                      "Key already exists in the object store.", transaction));
       return found_status;
     }
   }
@@ -1328,14 +1328,16 @@
                                                 &error_message,
                                                 &obeys_constraints);
   if (!backing_store_success) {
-    params->callbacks->OnError(IndexedDBDatabaseError(
-        blink::kWebIDBDatabaseExceptionUnknownError,
-        "Internal error: backing store error updating index keys."));
+    params->callbacks->OnError(
+        CreateError(blink::kWebIDBDatabaseExceptionUnknownError,
+                    "Internal error: backing store error updating index keys.",
+                    transaction));
     return s;
   }
   if (!obeys_constraints) {
-    params->callbacks->OnError(IndexedDBDatabaseError(
-        blink::kWebIDBDatabaseExceptionConstraintError, error_message));
+    params->callbacks->OnError(
+        CreateError(blink::kWebIDBDatabaseExceptionConstraintError,
+                    error_message, transaction));
     return s;
   }
 
@@ -1987,4 +1989,20 @@
   }
 }
 
+IndexedDBDatabaseError IndexedDBDatabase::CreateError(
+    uint16_t code,
+    const char* message,
+    IndexedDBTransaction* transaction) {
+  transaction->IncrementNumErrorsSent();
+  return IndexedDBDatabaseError(code, message);
+}
+
+IndexedDBDatabaseError IndexedDBDatabase::CreateError(
+    uint16_t code,
+    const base::string16& message,
+    IndexedDBTransaction* transaction) {
+  transaction->IncrementNumErrorsSent();
+  return IndexedDBDatabaseError(code, message);
+}
+
 }  // namespace content
diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h
index 8f0de49..6bf67bf 100644
--- a/content/browser/indexed_db/indexed_db_database.h
+++ b/content/browser/indexed_db/indexed_db_database.h
@@ -298,6 +298,13 @@
   // May be overridden in tests.
   virtual size_t GetUsableMessageSizeInBytes() const;
 
+  static IndexedDBDatabaseError CreateError(uint16_t code,
+                                            const char* message,
+                                            IndexedDBTransaction* transaction);
+  static IndexedDBDatabaseError CreateError(uint16_t code,
+                                            const base::string16& message,
+                                            IndexedDBTransaction* transaction);
+
  private:
   friend class base::RefCounted<IndexedDBDatabase>;
   friend class IndexedDBClassFactory;
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
index 0bd4a5a..4c881dab 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
@@ -290,7 +290,7 @@
     connection.database->CreateObjectStore(kTransactionId, kObjectStoreId,
                                            base::UTF8ToUTF16(kObjectStoreName),
                                            blink::IndexedDBKeyPath(), false);
-    connection.database->Commit(kTransactionId);
+    connection.database->Commit(kTransactionId, 0);
     loop.Run();
   }
 }
@@ -357,7 +357,7 @@
     connection1.database->CreateObjectStore(kTransactionId, kObjectStoreId,
                                             base::UTF8ToUTF16(kObjectStoreName),
                                             blink::IndexedDBKeyPath(), false);
-    connection1.database->Commit(kTransactionId);
+    connection1.database->Commit(kTransactionId, 0);
     loop.Run();
   }
 
@@ -450,7 +450,7 @@
         IndexedDBKey(base::UTF8ToUTF16("hello")),
         blink::mojom::IDBPutMode::AddOnly, std::vector<IndexedDBIndexKeys>(),
         put_callbacks->CreateInterfacePtrAndBind());
-    connection.database->Commit(kTransactionId);
+    connection.database->Commit(kTransactionId, 0);
     loop.Run();
   }
 }
@@ -502,7 +502,7 @@
         .Times(1)
         .WillOnce(RunClosure(quit_closure));
 
-    connection.database->Commit(kTransactionId);
+    connection.database->Commit(kTransactionId, 0);
     idb_mojo_factory_->AbortTransactionsAndCompactDatabase(base::BindOnce(
         &StatusCallback, std::move(quit_closure), &callback_result));
 
@@ -687,10 +687,9 @@
         .Times(1)
         .WillOnce(RunClosure(quit_closure));
 
-    connection.database->Commit(kTransactionId);
+    connection.database->Commit(kTransactionId, 0);
     idb_mojo_factory_->AbortTransactionsForDatabase(base::BindOnce(
         &StatusCallback, std::move(quit_closure), &callback_result));
-
     loop.Run();
   }
   EXPECT_EQ(blink::mojom::IDBStatus::OK, callback_result);
@@ -886,7 +885,7 @@
     connection1.database->CreateIndex(kTransactionId1, kObjectStoreId, kIndexId,
                                       base::UTF8ToUTF16(kIndexName),
                                       blink::IndexedDBKeyPath(), false, false);
-    connection1.database->Commit(kTransactionId1);
+    connection1.database->Commit(kTransactionId1, 0);
     loop.Run();
   }
   EXPECT_EQ(2, observer.notify_list_changed_count);
@@ -936,7 +935,7 @@
     ASSERT_TRUE(connection2.database.is_bound());
     connection2.database->DeleteIndex(kTransactionId2, kObjectStoreId,
                                       kIndexId);
-    connection2.database->Commit(kTransactionId2);
+    connection2.database->Commit(kTransactionId2, 0);
     loop.Run();
   }
   EXPECT_EQ(3, observer.notify_list_changed_count);
@@ -985,7 +984,7 @@
 
     ASSERT_TRUE(connection3.database.is_bound());
     connection3.database->DeleteObjectStore(kTransactionId3, kObjectStoreId);
-    connection3.database->Commit(kTransactionId3);
+    connection3.database->Commit(kTransactionId3, 0);
     loop.Run();
   }
   EXPECT_EQ(4, observer.notify_list_changed_count);
@@ -1071,7 +1070,7 @@
         IndexedDBKey(base::UTF8ToUTF16("key")),
         blink::mojom::IDBPutMode::AddOnly, std::vector<IndexedDBIndexKeys>(),
         put_callbacks->CreateInterfacePtrAndBind());
-    connection1.database->Commit(kTransactionId1);
+    connection1.database->Commit(kTransactionId1, 0);
     loop.Run();
   }
   EXPECT_EQ(2, observer.notify_list_changed_count);
@@ -1128,7 +1127,7 @@
     ASSERT_TRUE(connection2.database.is_bound());
     connection2.database->Clear(kTransactionId2, kObjectStoreId,
                                 clear_callbacks->CreateInterfacePtrAndBind());
-    connection2.database->Commit(kTransactionId2);
+    connection2.database->Commit(kTransactionId2, 0);
     loop.Run();
   }
   EXPECT_EQ(3, observer.notify_list_changed_count);
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index c9aa87e4..d418674 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -198,6 +198,7 @@
 void IndexedDBTransaction::Abort(const IndexedDBDatabaseError& error) {
   DCHECK(!processing_event_queue_);
   DCHECK(!is_commit_pending_);
+
   if (state_ == FINISHED)
     return;
 
@@ -357,6 +358,16 @@
   if (HasPendingTasks())
     return leveldb::Status::OK();
 
+  // If a transaction is being committed but it has sent more errors to the
+  // front end than have been handled at this point, the transaction should be
+  // aborted as it is unknown whether or not any errors unaccounted for will be
+  // properly handled.
+  if (num_errors_sent_ != num_errors_handled_) {
+    is_commit_pending_ = false;
+    Abort(IndexedDBDatabaseError(blink::kWebIDBDatabaseExceptionUnknownError));
+    return leveldb::Status::OK();
+  }
+
   state_ = COMMITTING;
 
   leveldb::Status s;
diff --git a/content/browser/indexed_db/indexed_db_transaction.h b/content/browser/indexed_db/indexed_db_transaction.h
index f13e1a0..d7ed340 100644
--- a/content/browser/indexed_db/indexed_db_transaction.h
+++ b/content/browser/indexed_db/indexed_db_transaction.h
@@ -111,6 +111,12 @@
   IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); }
   IndexedDBConnection* connection() const { return connection_.get(); }
   bool is_commit_pending() const { return is_commit_pending_; }
+  int64_t num_errors_sent() const { return num_errors_sent_; }
+  int64_t num_errors_handled() const { return num_errors_handled_; }
+  void IncrementNumErrorsSent() { ++num_errors_sent_; }
+  void SetNumErrorsHandled(int64_t num_errors_handled) {
+    num_errors_handled_ = num_errors_handled;
+  }
 
   State state() const { return state_; }
   bool IsTimeoutTimerRunning() const { return timeout_timer_.IsRunning(); }
@@ -250,6 +256,9 @@
   int pending_preemptive_events_ = 0;
   bool processing_event_queue_ = false;
 
+  int64_t num_errors_sent_ = 0;
+  int64_t num_errors_handled_ = 0;
+
   std::set<IndexedDBCursor*> open_cursors_;
 
   // This timer is started after requests have been processed. If no subsequent
diff --git a/content/browser/loader/cross_site_document_blocking_browsertest.cc b/content/browser/loader/cross_site_document_blocking_browsertest.cc
index 895f9140..b8a92fd 100644
--- a/content/browser/loader/cross_site_document_blocking_browsertest.cc
+++ b/content/browser/loader/cross_site_document_blocking_browsertest.cc
@@ -573,6 +573,33 @@
   }
 }
 
+// This test covers an aspect of Cross-Origin-Resource-Policy (CORP, different
+// from CORB) that cannot be covered by wpt/fetch/cross-origin-resource-policy:
+// whether blocking occurs *before* the response reaches the renderer process.
+IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest,
+                       CrossOriginResourcePolicy) {
+  embedded_test_server()->StartAcceptingConnections();
+
+  // Navigate to the test page while request interceptor is active.
+  GURL resource_url("http://cross-origin.com/site_isolation/png-corp.png");
+  RequestInterceptor interceptor(resource_url);
+  EXPECT_TRUE(NavigateToURL(shell(), GURL("http://foo.com/title1.html")));
+
+  // Issue the request that will be intercepted.
+  const char kScriptTemplate[] = R"(
+      var img = document.createElement('img');
+      img.src = $1;
+      document.body.appendChild(img); )";
+  EXPECT_TRUE(ExecJs(shell(), JsReplace(kScriptTemplate, resource_url)));
+  interceptor.WaitForRequestCompletion();
+
+  // Verify that Cross-Origin-Resource-Policy blocked the response before it
+  // reached the renderer process.
+  EXPECT_EQ(net::ERR_BLOCKED_BY_RESPONSE,
+            interceptor.completion_status().error_code);
+  EXPECT_EQ("", interceptor.response_body());
+}
+
 IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, BlockFetches) {
   embedded_test_server()->StartAcceptingConnections();
   GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc
index 7d5a3367..bd62ed078 100644
--- a/content/browser/loader/cross_site_document_resource_handler.cc
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
@@ -34,6 +34,7 @@
 #include "net/url_request/url_request.h"
 #include "services/metrics/public/cpp/ukm_builders.h"
 #include "services/metrics/public/cpp/ukm_recorder.h"
+#include "services/network/cross_origin_resource_policy.h"
 
 using MimeType = network::CrossOriginReadBlocking::MimeType;
 
@@ -41,6 +42,17 @@
 
 namespace {
 
+// Pre-NetworkService code has to blindly trust the |request_initiator| value
+// provided by the renderer process.
+//
+// TODO(lukasza): It might make sense to use ChildProcessSecurityPolicyImpl's
+// CanAccessDataForOrigin.  We don't do it, because
+// 1) non-NetworkService doesn't protect against content script problems (i.e.
+//    CanAccessDataForOrigin would only plug one hole in the non-NetworkService
+//    world)
+// 2) we hope that NetworkService will ship soon.
+constexpr base::nullopt_t kNonNetworkServiceInitiatorLock = base::nullopt;
+
 // An IOBuffer to enable writing into a existing IOBuffer at a given offset.
 class LocalIoBufferWithOffset : public net::WrappedIOBuffer {
  public:
@@ -211,19 +223,49 @@
 CrossSiteDocumentResourceHandler::CrossSiteDocumentResourceHandler(
     std::unique_ptr<ResourceHandler> next_handler,
     net::URLRequest* request,
-    bool is_nocors_plugin_request)
+    network::mojom::FetchRequestMode fetch_request_mode)
     : LayeredResourceHandler(request, std::move(next_handler)),
       weak_next_handler_(next_handler_.get()),
-      is_nocors_plugin_request_(is_nocors_plugin_request),
+      fetch_request_mode_(fetch_request_mode),
       weak_this_(this) {}
 
 CrossSiteDocumentResourceHandler::~CrossSiteDocumentResourceHandler() {}
 
+void CrossSiteDocumentResourceHandler::OnRequestRedirected(
+    const net::RedirectInfo& redirect_info,
+    network::ResourceResponse* response,
+    std::unique_ptr<ResourceController> controller) {
+  // Enforce the Cross-Origin-Resource-Policy (CORP) header.
+  if (network::CrossOriginResourcePolicy::kBlock ==
+      network::CrossOriginResourcePolicy::Verify(
+          *request(), *response, fetch_request_mode_,
+          kNonNetworkServiceInitiatorLock)) {
+    blocked_read_completed_ = true;
+    blocked_by_cross_origin_resource_policy_ = true;
+    controller->Cancel();
+    return;
+  }
+
+  next_handler_->OnRequestRedirected(redirect_info, response,
+                                     std::move(controller));
+}
+
 void CrossSiteDocumentResourceHandler::OnResponseStarted(
     network::ResourceResponse* response,
     std::unique_ptr<ResourceController> controller) {
   has_response_started_ = true;
 
+  // Enforce the Cross-Origin-Resource-Policy (CORP) header.
+  if (network::CrossOriginResourcePolicy::kBlock ==
+      network::CrossOriginResourcePolicy::Verify(
+          *request(), *response, fetch_request_mode_,
+          kNonNetworkServiceInitiatorLock)) {
+    blocked_read_completed_ = true;
+    blocked_by_cross_origin_resource_policy_ = true;
+    controller->Cancel();
+    return;
+  }
+
   if (request()->initiator().has_value()) {
     const char* initiator_scheme_exception =
         GetContentClient()
@@ -254,6 +296,10 @@
     scoped_refptr<net::IOBuffer>* buf,
     int* buf_size,
     std::unique_ptr<ResourceController> controller) {
+  // If a Cross-Origin-Resource Policy (CORP) header blocked this load, it
+  // should cause an error and not get as far as OnWillRead.
+  DCHECK(!blocked_by_cross_origin_resource_policy_);
+
   // For allowed responses, the data is directly streamed to the next handler.
   // Note that OnWillRead may be called before OnResponseStarted (because the
   // MimeSniffingResourceHandler upstream changes the order of the calls) - this
@@ -554,10 +600,16 @@
     const net::URLRequestStatus& status,
     std::unique_ptr<ResourceController> controller) {
   if (blocked_read_completed_) {
-    // Report blocked responses as successful, rather than the cancellation
-    // from OnWillRead.
-    next_handler_->OnResponseCompleted(net::URLRequestStatus(),
-                                       std::move(controller));
+    // Most responses blocked by CORB should be reported as successful, rather
+    // than the cancellation from OnWillRead.  OTOH, responses blocked by
+    // Cross-Origin-Resource-Policy should fail with a specific error code.
+    net::URLRequestStatus overriden_status;
+    if (blocked_by_cross_origin_resource_policy_) {
+      overriden_status =
+          net::URLRequestStatus::FromError(net::ERR_BLOCKED_BY_RESPONSE);
+    }
+
+    next_handler_->OnResponseCompleted(overriden_status, std::move(controller));
   } else {
     // Only report CORB status for successful (i.e. non-aborted,
     // non-errored-out) requests.
@@ -584,21 +636,11 @@
     const network::ResourceResponse& response) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
-  // Pre-NetworkService code has to blindly trust the |request_initiator| value
-  // provided by the renderer process.
-  //
-  // TODO(lukasza): It might make sense to use ChildProcessSecurityPolicyImpl's
-  // CanAccessDataForOrigin below.  We don't do it, because
-  // 1) non-NetworkService doesn't protect against content scripts attack vector
-  //    (i.e. CanAccessDataForOrigin would only plug one hole in the
-  //    non-NetworkService world)
-  // 2) we hope that NetworkService will ship soon.
-  base::Optional<url::Origin> kInitiatorLock = base::nullopt;
-
   // Delegate most decisions to CrossOriginReadBlocking::ResponseAnalyzer.
   analyzer_ =
       std::make_unique<network::CrossOriginReadBlocking::ResponseAnalyzer>(
-          *request(), response, kInitiatorLock);
+          *request(), response, kNonNetworkServiceInitiatorLock,
+          fetch_request_mode_);
   if (analyzer_->ShouldAllow())
     return false;
 
@@ -614,8 +656,8 @@
 
   // Don't block some plugin requests.
   //
-  // Note that in practice this exception only only matters to Flash and test
-  // plugins (both can issue requests without CORS and both will be covered by
+  // Note that in practice this exception only matters to Flash and test plugins
+  // (both can issue requests without CORS and both will be covered by
   // CORB::ShouldAllowForPlugin below).
   //
   // This exception is not needed for:
@@ -625,7 +667,7 @@
   //   additionally PDF doesn't _really_ make *cross*-origin requests - it just
   //   seems that way because of the usage of the Chrome extension).
   if (info->GetResourceType() == RESOURCE_TYPE_PLUGIN_RESOURCE &&
-      is_nocors_plugin_request_ &&
+      fetch_request_mode_ == network::mojom::FetchRequestMode::kNoCors &&
       network::CrossOriginReadBlocking::ShouldAllowForPlugin(
           info->GetChildID())) {
     return false;
diff --git a/content/browser/loader/cross_site_document_resource_handler.h b/content/browser/loader/cross_site_document_resource_handler.h
index 5f11dc70..bb39be8 100644
--- a/content/browser/loader/cross_site_document_resource_handler.h
+++ b/content/browser/loader/cross_site_document_resource_handler.h
@@ -16,6 +16,7 @@
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/common/resource_type.h"
 #include "services/network/cross_origin_read_blocking.h"
+#include "services/network/public/mojom/fetch_api.mojom.h"
 
 namespace net {
 class URLRequest;
@@ -59,10 +60,14 @@
   CrossSiteDocumentResourceHandler(
       std::unique_ptr<ResourceHandler> next_handler,
       net::URLRequest* request,
-      bool is_nocors_plugin_request);
+      network::mojom::FetchRequestMode fetch_request_mode);
   ~CrossSiteDocumentResourceHandler() override;
 
   // LayeredResourceHandler overrides:
+  void OnRequestRedirected(
+      const net::RedirectInfo& redirect_info,
+      network::ResourceResponse* response,
+      std::unique_ptr<ResourceController> controller) override;
   void OnResponseStarted(
       network::ResourceResponse* response,
       std::unique_ptr<ResourceController> controller) override;
@@ -138,12 +143,8 @@
   // the response or not.
   std::unique_ptr<network::CrossOriginReadBlocking::ResponseAnalyzer> analyzer_;
 
-  // Indicates whether this request was made by a plugin and was not using CORS.
-  // Such requests are exempt from blocking, while other plugin requests must be
-  // blocked if the CORS check fails.
-  // TODO(creis, nick): Replace this with a plugin process ID check to see if
-  // the plugin has universal access.
-  bool is_nocors_plugin_request_;
+  // Fetch request mode (e.g. 'no-cors' VS 'cors' VS 'same-origin', etc.).
+  network::mojom::FetchRequestMode fetch_request_mode_;
 
   // Tracks whether OnResponseStarted has been called, to ensure that it happens
   // before OnWillRead and OnReadCompleted.
@@ -172,6 +173,11 @@
   // happening.
   bool initiator_scheme_prevented_blocking_ = false;
 
+  // Whether the response is being blocked because of the presence of
+  // Cross-Origin-Resource-Policy header in 'no-cors' mode (in this case the
+  // response should fail with net::ERR_BLOCKED_BY_RESPONSE error code).
+  bool blocked_by_cross_origin_resource_policy_ = false;
+
   base::WeakPtrFactory<CrossSiteDocumentResourceHandler> weak_this_;
 
   DISALLOW_COPY_AND_ASSIGN(CrossSiteDocumentResourceHandler);
diff --git a/content/browser/loader/cross_site_document_resource_handler_unittest.cc b/content/browser/loader/cross_site_document_resource_handler_unittest.cc
index d0e7c6c..626614a 100644
--- a/content/browser/loader/cross_site_document_resource_handler_unittest.cc
+++ b/content/browser/loader/cross_site_document_resource_handler_unittest.cc
@@ -1203,11 +1203,11 @@
     stream_sink_ = stream_sink->GetWeakPtr();
 
     // Create the CrossSiteDocumentResourceHandler.
-    bool is_nocors_plugin_request =
-        resource_type == RESOURCE_TYPE_PLUGIN_RESOURCE &&
-        cors_request == OriginHeader::kOmit;
+    auto fetch_request_mode = cors_request == OriginHeader::kOmit
+                                  ? network::mojom::FetchRequestMode::kNoCors
+                                  : network::mojom::FetchRequestMode::kCors;
     auto document_blocker = std::make_unique<CrossSiteDocumentResourceHandler>(
-        std::move(stream_sink), request_.get(), is_nocors_plugin_request);
+        std::move(stream_sink), request_.get(), fetch_request_mode);
     document_blocker_ = document_blocker.get();
     first_handler_ = std::move(document_blocker);
 
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 8a67808f..a206be7 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -464,23 +464,23 @@
     network::ResourceResponse* response,
     std::string* payload) {
   payload->clear();
-  ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
   const std::string& mime_type = response->head.mime_type;
 
   GURL origin;
   if (!delegate_ || !delegate_->ShouldInterceptResourceAsStream(
                         request, mime_type, &origin, payload)) {
-    return std::unique_ptr<ResourceHandler>();
+    return nullptr;
   }
 
+  ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
   StreamContext* stream_context =
       GetStreamContextForResourceContext(info->GetContext());
 
-  std::unique_ptr<StreamResourceHandler> handler(new StreamResourceHandler(
-      request, stream_context->registry(), origin, false));
+  auto handler = std::make_unique<StreamResourceHandler>(
+      request, stream_context->registry(), origin, false);
 
   info->set_is_stream(true);
-  std::unique_ptr<StreamInfo> stream_info(new StreamInfo);
+  auto stream_info = std::make_unique<StreamInfo>();
   stream_info->handle = handler->stream()->CreateHandle();
   stream_info->original_url = request->url();
   stream_info->mime_type = mime_type;
@@ -489,7 +489,8 @@
   // ResourceDispatcherHostDelegate.
   if (response->head.headers.get()) {
     stream_info->response_headers =
-        new net::HttpResponseHeaders(response->head.headers->raw_headers());
+        base::MakeRefCounted<net::HttpResponseHeaders>(
+            response->head.headers->raw_headers());
   }
   delegate_->OnStreamCreated(request, std::move(stream_info));
   return std::move(handler);
@@ -1135,11 +1136,8 @@
 
   if (!IsResourceTypeFrame(resource_type)) {
     // Add a handler to block cross-site documents from the renderer process.
-    bool is_nocors_plugin_request =
-        resource_type == RESOURCE_TYPE_PLUGIN_RESOURCE &&
-        fetch_request_mode == network::mojom::FetchRequestMode::kNoCors;
     handler.reset(new CrossSiteDocumentResourceHandler(
-        std::move(handler), request, is_nocors_plugin_request));
+        std::move(handler), request, fetch_request_mode));
   }
 
   // Insert a buffered event handler to sniff the mime type.
@@ -1888,7 +1886,7 @@
 
   std::unique_ptr<LoadInfoMap> info_map =
       PickMoreInterestingLoadInfos(std::move(infos));
-  for (const auto& load_info: *info_map) {
+  for (const auto& load_info : *info_map) {
     loader_delegate->LoadStateChanged(
         load_info.first, load_info.second.host, load_info.second.load_state,
         load_info.second.upload_position, load_info.second.upload_size);
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 04ed160..d06ee90f 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -86,6 +86,7 @@
 #include "storage/browser/blob/shareable_file_reference.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 
 // TODO(eroman): Write unit tests for SafeBrowsing that exercise
 //               SafeBrowsingResourceHandler.
@@ -107,7 +108,7 @@
   request.load_flags = 0;
   request.plugin_child_id = -1;
   request.resource_type = type;
-  request.appcache_host_id = kAppCacheNoHostId;
+  request.appcache_host_id = blink::mojom::kAppCacheNoHostId;
   request.should_reset_appcache = false;
   request.render_frame_id = 0;
   request.is_main_frame = true;
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 66122809..96b740a8 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -26,7 +26,6 @@
 #include "content/browser/ssl/ssl_manager.h"
 #include "content/public/browser/content_browser_client.h"
 #include "content/public/browser/login_delegate.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/content_client.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/navigation_policy.h"
diff --git a/content/browser/renderer_host/clipboard_host_impl.cc b/content/browser/renderer_host/clipboard_host_impl.cc
index 0b8dc15..dd5362b 100644
--- a/content/browser/renderer_host/clipboard_host_impl.cc
+++ b/content/browser/renderer_host/clipboard_host_impl.cc
@@ -16,6 +16,7 @@
 #include "mojo/public/cpp/system/platform_handle.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
 #include "url/gurl.h"
@@ -65,23 +66,24 @@
   bool result = false;
   switch (format) {
     case blink::mojom::ClipboardFormat::kPlaintext:
-      result = clipboard_->IsFormatAvailable(
-                   ui::Clipboard::GetPlainTextWFormatType(), clipboard_type) ||
-               clipboard_->IsFormatAvailable(
-                   ui::Clipboard::GetPlainTextFormatType(), clipboard_type);
+      result =
+          clipboard_->IsFormatAvailable(
+              ui::ClipboardFormatType::GetPlainTextWType(), clipboard_type) ||
+          clipboard_->IsFormatAvailable(
+              ui::ClipboardFormatType::GetPlainTextType(), clipboard_type);
       break;
     case blink::mojom::ClipboardFormat::kHtml:
-      result = clipboard_->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(),
-                                             clipboard_type);
+      result = clipboard_->IsFormatAvailable(
+          ui::ClipboardFormatType::GetHtmlType(), clipboard_type);
       break;
     case blink::mojom::ClipboardFormat::kSmartPaste:
       result = clipboard_->IsFormatAvailable(
-          ui::Clipboard::GetWebKitSmartPasteFormatType(), clipboard_type);
+          ui::ClipboardFormatType::GetWebKitSmartPasteType(), clipboard_type);
       break;
     case blink::mojom::ClipboardFormat::kBookmark:
 #if defined(OS_WIN) || defined(OS_MACOSX)
-      result = clipboard_->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(),
-                                             clipboard_type);
+      result = clipboard_->IsFormatAvailable(
+          ui::ClipboardFormatType::GetUrlWType(), clipboard_type);
 #else
       result = false;
 #endif
@@ -93,11 +95,11 @@
 void ClipboardHostImpl::ReadText(ui::ClipboardType clipboard_type,
                                  ReadTextCallback callback) {
   base::string16 result;
-  if (clipboard_->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
-                                    clipboard_type)) {
+  if (clipboard_->IsFormatAvailable(
+          ui::ClipboardFormatType::GetPlainTextWType(), clipboard_type)) {
     clipboard_->ReadText(clipboard_type, &result);
   } else if (clipboard_->IsFormatAvailable(
-                 ui::Clipboard::GetPlainTextFormatType(), clipboard_type)) {
+                 ui::ClipboardFormatType::GetPlainTextType(), clipboard_type)) {
     std::string ascii;
     clipboard_->ReadAsciiText(clipboard_type, &ascii);
     result = base::ASCIIToUTF16(ascii);
@@ -159,7 +161,7 @@
   base::Pickle pickle;
   ui::WriteCustomDataToPickle(data, &pickle);
   clipboard_writer_->WritePickledData(
-      pickle, ui::Clipboard::GetWebCustomDataFormatType());
+      pickle, ui::ClipboardFormatType::GetWebCustomDataType());
 }
 
 void ClipboardHostImpl::WriteBookmark(ui::ClipboardType,
diff --git a/content/browser/renderer_host/clipboard_host_impl_unittest.cc b/content/browser/renderer_host/clipboard_host_impl_unittest.cc
index 16556e4..128e01e 100644
--- a/content/browser/renderer_host/clipboard_host_impl_unittest.cc
+++ b/content/browser/renderer_host/clipboard_host_impl_unittest.cc
@@ -15,7 +15,7 @@
 #include "mojo/public/cpp/system/message_pipe.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/gfx/skia_util.h"
 
 namespace content {
@@ -55,9 +55,10 @@
   EXPECT_NE(sequence_number, system_clipboard()->GetSequenceNumber(
                                  ui::CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_FALSE(system_clipboard()->IsFormatAvailable(
-      ui::Clipboard::GetPlainTextFormatType(), ui::CLIPBOARD_TYPE_COPY_PASTE));
+      ui::ClipboardFormatType::GetPlainTextType(),
+      ui::CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(system_clipboard()->IsFormatAvailable(
-      ui::Clipboard::GetBitmapFormatType(), ui::CLIPBOARD_TYPE_COPY_PASTE));
+      ui::ClipboardFormatType::GetBitmapType(), ui::CLIPBOARD_TYPE_COPY_PASTE));
 
   SkBitmap actual =
       system_clipboard()->ReadImage(ui::CLIPBOARD_TYPE_COPY_PASTE);
diff --git a/content/browser/renderer_host/direct_manipulation_browsertest.cc b/content/browser/renderer_host/direct_manipulation_browsertest.cc
index 9a266c8..5ed43cc5 100644
--- a/content/browser/renderer_host/direct_manipulation_browsertest.cc
+++ b/content/browser/renderer_host/direct_manipulation_browsertest.cc
@@ -119,7 +119,7 @@
   shell2->Close();
 }
 
-// EventLogger is to obserser the events sent from WindowEventTarget (the root
+// EventLogger is to observe the events sent from WindowEventTarget (the root
 // window).
 class EventLogger : public ui::EventRewriter {
  public:
@@ -132,19 +132,12 @@
 
  private:
   // ui::EventRewriter
-  ui::EventRewriteStatus RewriteEvent(
+  ui::EventDispatchDetails RewriteEvent(
       const ui::Event& event,
-      std::unique_ptr<ui::Event>* new_event) override {
+      const base::WeakPtr<Continuation> continuation) override {
     DCHECK(!last_event_);
     last_event_ = ui::Event::Clone(event);
-    return ui::EVENT_REWRITE_CONTINUE;
-  }
-
-  // ui::EventRewriter
-  ui::EventRewriteStatus NextDispatchEvent(
-      const ui::Event& last_event,
-      std::unique_ptr<ui::Event>* new_event) override {
-    return ui::EVENT_REWRITE_CONTINUE;
+    return SendEvent(continuation, &event);
   }
 
   std::unique_ptr<ui::Event> last_event_ = nullptr;
diff --git a/content/browser/renderer_host/input/touch_action_filter.cc b/content/browser/renderer_host/input/touch_action_filter.cc
index 944df4c..e61ffb2 100644
--- a/content/browser/renderer_host/input/touch_action_filter.cc
+++ b/content/browser/renderer_host/input/touch_action_filter.cc
@@ -331,6 +331,18 @@
 
     case WebInputEvent::kGestureTapDown:
       gesture_sequence_in_progress_ = true;
+      if (allowed_touch_action_.has_value())
+        gesture_sequence_.append("AY");
+      else
+        gesture_sequence_.append("AN");
+      if (white_listed_touch_action_.has_value())
+        gesture_sequence_.append("WY");
+      else
+        gesture_sequence_.append("WN");
+      if (active_touch_action_.has_value())
+        gesture_sequence_.append("OY");
+      else
+        gesture_sequence_.append("ON");
       // TODO(xidachen): investigate why the touch action has no value.
       if (compositor_touch_action_enabled_ && !touch_action.has_value())
         SetTouchAction(cc::kTouchActionAuto);
@@ -339,10 +351,6 @@
       if (num_of_active_touches_ <= 0)
         SetTouchAction(cc::kTouchActionAuto);
       active_touch_action_ = allowed_touch_action_;
-      if (active_touch_action_.has_value())
-        gesture_sequence_.append("OY");
-      else
-        gesture_sequence_.append("ON");
       gesture_sequence_.append(
           base::NumberToString(gesture_event->unique_touch_event_id));
       DCHECK(!drop_current_tap_ending_event_);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 801517c67..316e7cf 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -101,7 +101,7 @@
 #include "skia/ext/platform_canvas.h"
 #include "storage/browser/fileapi/isolated_context.h"
 #include "third_party/blink/public/web/web_ime_text_span.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/ui_base_switches.h"
 #include "ui/display/display_switches.h"
 #include "ui/display/screen.h"
@@ -226,20 +226,17 @@
   std::vector<DropData::Metadata> metadata;
   if (!drop_data.text.is_null()) {
     metadata.push_back(DropData::Metadata::CreateForMimeType(
-        DropData::Kind::STRING,
-        base::ASCIIToUTF16(ui::Clipboard::kMimeTypeText)));
+        DropData::Kind::STRING, base::ASCIIToUTF16(ui::kMimeTypeText)));
   }
 
   if (drop_data.url.is_valid()) {
     metadata.push_back(DropData::Metadata::CreateForMimeType(
-        DropData::Kind::STRING,
-        base::ASCIIToUTF16(ui::Clipboard::kMimeTypeURIList)));
+        DropData::Kind::STRING, base::ASCIIToUTF16(ui::kMimeTypeURIList)));
   }
 
   if (!drop_data.html.is_null()) {
     metadata.push_back(DropData::Metadata::CreateForMimeType(
-        DropData::Kind::STRING,
-        base::ASCIIToUTF16(ui::Clipboard::kMimeTypeHTML)));
+        DropData::Kind::STRING, base::ASCIIToUTF16(ui::kMimeTypeHTML)));
   }
 
   // On Aura, filenames are available before drop.
@@ -1029,7 +1026,9 @@
 
   // TODO(jonross): Enable on ChromeOS once blocking mus bugs are fixed:
   // https://crbug.com/920642 https://crbug.com/920006
-#if !defined(OS_CHROMEOS)
+  // TODO(jonross): Enable on Android once root cause of crash is found and
+  // fixed: https://crbug.com/923742
+#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
   // When the size has changed, we must ensure that there is a new, updated
   // viz::LocalSurfaceId. Otherwise we encounter Surface Invariants Violation at
   // the time of frame submission. Check for this violation here in order to
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index 04c35ffe..1f255df 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -35,7 +35,6 @@
 #include "content/public/browser/resource_context.h"
 #include "content/public/browser/resource_dispatcher_host.h"
 #include "content/public/browser/storage_partition.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/navigation_policy.h"
 #include "content/public/test/browser_test_utils.h"
@@ -65,6 +64,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/blob/blob_url_store.mojom-test-utils.h"
 #include "third_party/blink/public/web/web_triggering_event_info.h"
 
@@ -141,7 +141,7 @@
   request.load_flags = 0;
   request.plugin_child_id = -1;
   request.resource_type = RESOURCE_TYPE_XHR;
-  request.appcache_host_id = kAppCacheNoHostId;
+  request.appcache_host_id = blink::mojom::kAppCacheNoHostId;
   request.should_reset_appcache = false;
   request.is_main_frame = true;
   request.transition_type = ui::PAGE_TRANSITION_LINK;
diff --git a/content/browser/service_worker/service_worker_installed_script_reader.h b/content/browser/service_worker/service_worker_installed_script_reader.h
index 4c5a2a1..a0bfb5a 100644
--- a/content/browser/service_worker/service_worker_installed_script_reader.h
+++ b/content/browser/service_worker/service_worker_installed_script_reader.h
@@ -12,6 +12,7 @@
 #include "content/browser/service_worker/service_worker_disk_cache.h"
 #include "content/common/content_export.h"
 #include "mojo/public/cpp/system/data_pipe.h"
+#include "mojo/public/cpp/system/simple_watcher.h"
 #include "services/network/public/cpp/net_adapters.h"
 
 namespace content {
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc
index 3e8bc1c8..9e8d88d 100644
--- a/content/browser/site_per_process_hit_test_browsertest.cc
+++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -704,18 +704,11 @@
   ~SystemEventRewriter() override = default;
 
  private:
-  ui::EventRewriteStatus RewriteEvent(
+  ui::EventDispatchDetails RewriteEvent(
       const ui::Event& event,
-      std::unique_ptr<ui::Event>* new_event) override {
-    return num_of_scoped_allows_ ? ui::EVENT_REWRITE_CONTINUE
-                                 : ui::EVENT_REWRITE_DISCARD;
-  }
-
-  ui::EventRewriteStatus NextDispatchEvent(
-      const ui::Event& event,
-      std::unique_ptr<ui::Event>* new_event) override {
-    NOTREACHED();
-    return ui::EVENT_REWRITE_CONTINUE;
+      const base::WeakPtr<Continuation> continuation) override {
+    return num_of_scoped_allows_ ? continuation->SendEvent(&event)
+                                 : continuation->DiscardEvent();
   }
 
   // Count of ScopedAllow objects. When it is greater than 0, events are allowed
diff --git a/content/browser/tracing/background_tracing_manager_impl.cc b/content/browser/tracing/background_tracing_manager_impl.cc
index 904de98..de8d6c5d 100644
--- a/content/browser/tracing/background_tracing_manager_impl.cc
+++ b/content/browser/tracing/background_tracing_manager_impl.cc
@@ -662,6 +662,27 @@
 void BackgroundTracingManagerImpl::OnAbortScenarioReceived(
     std::unique_ptr<const base::DictionaryValue> metadata,
     base::RefCountedString* trace_str) {
+  if (base::trace_event::TraceLog::GetInstance()->IsEnabled()) {
+    // Since the BackgroundTracingManager directly enables tracing
+    // in TraceLog, in addition to going through Mojo, there's an edge-case
+    // where tracing is rapidly stopped after starting, too quickly for the
+    // TraceEventAgent of the browser process to register itself, which means
+    // that we're left in a state where the Mojo interface doesn't think we're
+    // tracing but TraceLog is still enabled. If that's the case, we abort
+    // tracing here.
+    auto record_mode =
+        (config_->tracing_mode() == BackgroundTracingConfigImpl::PREEMPTIVE)
+            ? base::trace_event::RECORD_CONTINUOUSLY
+            : base::trace_event::RECORD_UNTIL_FULL;
+    TraceConfig config =
+        GetConfigForCategoryPreset(config_->category_preset(), record_mode);
+
+    uint8_t modes = base::trace_event::TraceLog::RECORDING_MODE;
+    if (!config.event_filters().empty())
+      modes |= base::trace_event::TraceLog::FILTERING_MODE;
+    base::trace_event::TraceLog::GetInstance()->SetDisabled(modes);
+  }
+
   is_tracing_ = false;
   triggered_named_event_handle_ = -1;
   config_.reset();
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc
index d59699d3..3abe338 100644
--- a/content/browser/tracing/tracing_controller_browsertest.cc
+++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -129,6 +129,29 @@
   }
 };
 
+class WaitForTraceLogEnabled
+    : public base::trace_event::TraceLog::EnabledStateObserver {
+ public:
+  WaitForTraceLogEnabled() {
+    base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this);
+  }
+
+  ~WaitForTraceLogEnabled() override {
+    base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(
+        this);
+  }
+
+  void Wait() { wait_for_tracelog_.Run(); }
+
+  // TraceLog::EnabledStateObserver overrides:
+  void OnTraceLogEnabled() override { wait_for_tracelog_.Quit(); }
+
+  void OnTraceLogDisabled() override {}
+
+ private:
+  base::RunLoop wait_for_tracelog_;
+};
+
 class TracingControllerTest : public ContentBrowserTest {
  public:
   TracingControllerTest() {}
@@ -222,9 +245,11 @@
       TraceConfig config;
       if (enable_systrace)
         config.EnableSystrace();
+      WaitForTraceLogEnabled wait_for_tracelog;
       bool result = controller->StartTracing(config, std::move(callback));
       ASSERT_TRUE(result);
       run_loop.Run();
+      wait_for_tracelog.Wait();
       EXPECT_EQ(enable_recording_done_callback_count(), 1);
     }
 
@@ -266,9 +291,11 @@
       TraceConfig config = TraceConfig();
       config.EnableArgumentFilter();
 
+      WaitForTraceLogEnabled wait_for_tracelog;
       bool result = controller->StartTracing(config, std::move(callback));
       ASSERT_TRUE(result);
       run_loop.Run();
+      wait_for_tracelog.Wait();
       EXPECT_EQ(enable_recording_done_callback_count(), 1);
     }
 
@@ -305,10 +332,12 @@
       TracingController::StartTracingDoneCallback callback =
           base::BindOnce(&TracingControllerTest::StartTracingDoneCallbackTest,
                          base::Unretained(this), run_loop.QuitClosure());
+      WaitForTraceLogEnabled wait_for_tracelog;
       bool result =
           controller->StartTracing(TraceConfig(), std::move(callback));
       ASSERT_TRUE(result);
       run_loop.Run();
+      wait_for_tracelog.Wait();
       EXPECT_EQ(enable_recording_done_callback_count(), 1);
     }
 
@@ -340,10 +369,12 @@
       TracingController::StartTracingDoneCallback callback =
           base::BindOnce(&TracingControllerTest::StartTracingDoneCallbackTest,
                          base::Unretained(this), run_loop.QuitClosure());
+      WaitForTraceLogEnabled wait_for_tracelog;
       bool result =
           controller->StartTracing(TraceConfig(), std::move(callback));
       ASSERT_TRUE(result);
       run_loop.Run();
+      wait_for_tracelog.Wait();
       EXPECT_EQ(enable_recording_done_callback_count(), 1);
     }
 
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 994119b..bfc85215 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -35,6 +35,7 @@
 #include "net/base/network_change_notifier.h"
 #include "services/service_manager/public/cpp/connector.h"
 #include "services/tracing/public/cpp/trace_event_agent.h"
+#include "services/tracing/public/cpp/traced_process_impl.h"
 #include "services/tracing/public/mojom/constants.mojom.h"
 #include "v8/include/v8-version-string.h"
 
@@ -127,9 +128,8 @@
 TracingControllerImpl::~TracingControllerImpl() = default;
 
 void TracingControllerImpl::AddAgents() {
-  auto* connector =
-      content::ServiceManagerConnection::GetForProcess()->GetConnector();
-  connector->BindInterface(tracing::mojom::kServiceName, &coordinator_);
+  tracing::TracedProcessImpl::GetInstance()->SetTaskRunner(
+      base::SequencedTaskRunnerHandle::Get());
 
 #if defined(OS_CHROMEOS)
   agents_.push_back(std::make_unique<CrOSTracingAgent>());
@@ -137,14 +137,9 @@
   agents_.push_back(std::make_unique<CastTracingAgent>());
 #endif
 
-  for (auto& agent : agents_)
-    agent->Connect(connector);
-
-  auto* trace_event_agent = tracing::TraceEventAgent::GetInstance();
-  trace_event_agent->Connect(connector);
-
   // For adding general CPU, network, OS, and other system information to the
   // metadata.
+  auto* trace_event_agent = tracing::TraceEventAgent::GetInstance();
   trace_event_agent->AddMetadataGeneratorFunction(base::BindRepeating(
       &TracingControllerImpl::GenerateMetadataDict, base::Unretained(this)));
   if (delegate_) {
@@ -154,6 +149,18 @@
   }
 }
 
+void TracingControllerImpl::ConnectToServiceIfNeeded() {
+  if (!coordinator_) {
+    ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
+        tracing::mojom::kServiceName, &coordinator_);
+  }
+}
+
+void TracingControllerImpl::DisconnectFromService() {
+  coordinator_ = nullptr;
+}
+
+// Can be called on any thread.
 std::unique_ptr<base::DictionaryValue>
 TracingControllerImpl::GenerateMetadataDict() const {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -319,6 +326,8 @@
   }
   trace_config_ =
       std::make_unique<base::trace_event::TraceConfig>(trace_config);
+
+  ConnectToServiceIfNeeded();
   coordinator_->StartTracing(
       trace_config.ToString(),
       base::BindOnce(
@@ -376,6 +385,7 @@
     GetTraceBufferUsageCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
+  ConnectToServiceIfNeeded();
   coordinator_->RequestBufferUsage(base::BindOnce(
       [](GetTraceBufferUsageCallback callback, bool success, float percent_full,
          uint32_t approximate_count) {
diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h
index 4d7434a..dbb0b86 100644
--- a/content/browser/tracing/tracing_controller_impl.h
+++ b/content/browser/tracing/tracing_controller_impl.h
@@ -75,6 +75,8 @@
 
   ~TracingControllerImpl() override;
   void AddAgents();
+  void ConnectToServiceIfNeeded();
+  void DisconnectFromService();
   std::unique_ptr<base::DictionaryValue> GenerateMetadataDict() const;
 
   // mojo::DataPipeDrainer::Client
@@ -85,7 +87,6 @@
 
   void CompleteFlush();
 
-  tracing::mojom::AgentRegistryPtr agent_registry_;
   tracing::mojom::CoordinatorPtr coordinator_;
   std::vector<std::unique_ptr<tracing::BaseAgent>> agents_;
   std::unique_ptr<TracingDelegate> delegate_;
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index eabf883c..ab316c8 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -28,6 +28,7 @@
 #include "jni/DragEvent_jni.h"
 #include "ui/android/overscroll_refresh_handler.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/display/screen.h"
 #include "ui/events/android/drag_event_android.h"
 #include "ui/events/android/gesture_event_android.h"
@@ -413,9 +414,9 @@
       base::string16 drop_content =
           ConvertJavaStringToUTF16(env, event.GetJavaContent());
       for (const base::string16& mime_type : event.mime_types()) {
-        if (base::EqualsASCII(mime_type, ui::Clipboard::kMimeTypeURIList)) {
+        if (base::EqualsASCII(mime_type, ui::kMimeTypeURIList)) {
           drop_data.url = GURL(drop_content);
-        } else if (base::EqualsASCII(mime_type, ui::Clipboard::kMimeTypeText)) {
+        } else if (base::EqualsASCII(mime_type, ui::kMimeTypeText)) {
           drop_data.text = base::NullableString16(drop_content, false);
         } else {
           drop_data.html = base::NullableString16(drop_content, false);
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 8e02ca3..68fb77a4 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -227,14 +227,13 @@
 }
 #endif  // defined(OS_WIN)
 
-// Returns the FormatType to store file system files.
-const ui::Clipboard::FormatType& GetFileSystemFileFormatType() {
-  static base::NoDestructor<ui::Clipboard::FormatType> format(
-      ui::Clipboard::GetFormatType("chromium/x-file-system-files"));
+// Returns the ClipboardFormatType to store file system files.
+const ui::ClipboardFormatType& GetFileSystemFileFormatType() {
+  static base::NoDestructor<ui::ClipboardFormatType> format(
+      ui::ClipboardFormatType::GetType("chromium/x-file-system-files"));
   return *format;
 }
 
-
 // Utility to fill a ui::OSExchangeDataProvider object from DropData.
 void PrepareDragData(const DropData& drop_data,
                      ui::OSExchangeData::Provider* provider,
@@ -274,7 +273,7 @@
   if (!drop_data.custom_data.empty()) {
     base::Pickle pickle;
     ui::WriteCustomDataToPickle(drop_data.custom_data, &pickle);
-    provider->SetPickledData(ui::Clipboard::GetWebCustomDataFormatType(),
+    provider->SetPickledData(ui::ClipboardFormatType::GetWebCustomDataType(),
                              pickle);
   }
 }
@@ -314,7 +313,8 @@
           pickle, &file_system_files))
     drop_data->file_system_files = file_system_files;
 
-  if (data.GetPickledData(ui::Clipboard::GetWebCustomDataFormatType(), &pickle))
+  if (data.GetPickledData(ui::ClipboardFormatType::GetWebCustomDataType(),
+                          &pickle))
     ui::ReadCustomDataIntoMap(
         pickle.data(), pickle.size(), &drop_data->custom_data);
 }
diff --git a/content/browser/web_contents/web_contents_view_cocoa.mm b/content/browser/web_contents/web_contents_view_cocoa.mm
index c83ae296..c346646 100644
--- a/content/browser/web_contents/web_contents_view_cocoa.mm
+++ b/content/browser/web_contents/web_contents_view_cocoa.mm
@@ -14,6 +14,7 @@
 #include "content/public/browser/web_contents_view_delegate.h"
 #include "content/public/common/web_contents_ns_view_bridge.mojom.h"
 #import "third_party/mozilla/NSPasteboard+Utils.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/base/cocoa/cocoa_base_utils.h"
 #include "ui/base/dragdrop/cocoa_dnd_util.h"
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index 576d60b..9423f9c 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -19,6 +19,7 @@
 #include "content/public/common/web_contents_ns_view_bridge.mojom.h"
 #include "third_party/blink/public/platform/web_input_event.h"
 #import "third_party/mozilla/NSPasteboard+Utils.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_util_mac.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/base/cocoa/cocoa_base_utils.h"
diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm
index d62ce7a..d858836 100644
--- a/content/browser/web_contents/web_drag_source_mac.mm
+++ b/content/browser/web_contents/web_drag_source_mac.mm
@@ -31,6 +31,7 @@
 #include "net/base/escape.h"
 #include "net/base/filename_util.h"
 #include "net/base/mime_util.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_util_mac.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/base/cocoa/cocoa_base_utils.h"
diff --git a/content/browser/worker_host/shared_worker_host.cc b/content/browser/worker_host/shared_worker_host.cc
index a81b137f..b872440d 100644
--- a/content/browser/worker_host/shared_worker_host.cc
+++ b/content/browser/worker_host/shared_worker_host.cc
@@ -31,6 +31,7 @@
 #include "third_party/blink/public/common/loader/url_loader_factory_bundle.h"
 #include "third_party/blink/public/common/messaging/message_port_channel.h"
 #include "third_party/blink/public/common/service_worker/service_worker_utils.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/worker/worker_content_settings_proxy.mojom.h"
 #include "third_party/blink/public/platform/web_feature.mojom.h"
 
@@ -266,7 +267,7 @@
       renderer_preferences, std::move(preference_watcher_request),
       std::move(content_settings), std::move(service_worker_provider_info),
       appcache_handle_ ? appcache_handle_->appcache_host_id()
-                       : kAppCacheNoHostId,
+                       : blink::mojom::kAppCacheNoHostId,
       std::move(main_script_loader_factory), std::move(main_script_load_params),
       std::move(subresource_loader_factories), std::move(controller),
       std::move(host), std::move(worker_request_),
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index a0cd22fd..754533a 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -71,7 +71,6 @@
 #include "services/service_manager/public/cpp/interface_provider.h"
 #include "services/service_manager/runner/common/client_util.h"
 #include "services/service_manager/sandbox/sandbox_type.h"
-#include "services/tracing/public/cpp/trace_event_agent.h"
 
 #if defined(OS_POSIX)
 #include "base/posix/global_descriptors.h"
@@ -571,8 +570,6 @@
 
   channel_->AddFilter(new tracing::ChildTraceMessageFilter(
       ChildProcess::current()->io_task_runner()));
-
-  tracing::TraceEventAgent::GetInstance()->Connect(GetConnector());
 }
 
 ChildThreadImpl::~ChildThreadImpl() {
diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h
index a4792c9..6930f39f 100644
--- a/content/child/child_thread_impl.h
+++ b/content/child/child_thread_impl.h
@@ -181,7 +181,7 @@
 
   void Init(const Options& options);
 
-  // Sets chrome_trace_event_agent_ if necessary.
+  // Initializes tracing if necessary.
   void InitTracing();
 
   // We create the channel first without connecting it so we can add filters
diff --git a/content/child/dwrite_font_proxy/OWNERS b/content/child/dwrite_font_proxy/OWNERS
index e87d635..7555082 100644
--- a/content/child/dwrite_font_proxy/OWNERS
+++ b/content/child/dwrite_font_proxy/OWNERS
@@ -1,2 +1,3 @@
+drott@chromium.org
 jschuh@chromium.org
 wfh@chromium.org
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index 0aa429dd..11de6b9e 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -105,6 +105,11 @@
 
   if (!GetFontProxy().FindFamily(name, &family_index)) {
     LogFontProxyError(FIND_FAMILY_SEND_FAILED);
+    // TODO(https://crbug.com/922403): We're inserting an assertion here to
+    // gather crash reports and find more about clients in which this
+    // fails. Investigate crash reports resulting from this failure, then
+    // remove this assertion.
+    CHECK(false);
     return E_FAIL;
   }
 
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 811519f..78443144 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -97,12 +97,6 @@
 #if !defined(OS_MACOSX)
   WebRuntimeFeatures::EnableNotificationContentImage(true);
 #endif
-
-// The Media Session API is enabled by default on Android, Chrome OS and
-// Windows.
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
-  WebRuntimeFeatures::EnableMediaSession(true);
-#endif
 }
 
 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
diff --git a/content/common/appcache_interfaces.h b/content/common/appcache_interfaces.h
index b01e211..0836206 100644
--- a/content/common/appcache_interfaces.h
+++ b/content/common/appcache_interfaces.h
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "content/common/content_export.h"
-#include "content/public/common/appcache_info.h"
+#include "url/gurl.h"
 
 namespace content {
 
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h
index 8cc6de6..ccdb57a 100644
--- a/content/common/navigation_params.h
+++ b/content/common/navigation_params.h
@@ -19,7 +19,6 @@
 #include "content/common/content_security_policy/csp_disposition_enum.h"
 #include "content/common/frame_message_enums.h"
 #include "content/common/service_worker/service_worker_types.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/page_state.h"
 #include "content/public/common/previews_state.h"
 #include "content/public/common/referrer.h"
@@ -28,6 +27,7 @@
 #include "services/network/public/cpp/resource_request_body.h"
 #include "services/network/public/cpp/resource_response.h"
 #include "services/network/public/cpp/resource_response_info.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
 #include "third_party/blink/public/platform/web_mixed_content_context_type.h"
 #include "ui/base/page_transition_types.h"
@@ -370,7 +370,7 @@
 
   // PlzNavigate
   // The AppCache host id to be used to identify this navigation.
-  int appcache_host_id = kAppCacheNoHostId;
+  int appcache_host_id = blink::mojom::kAppCacheNoHostId;
 
   // Set to |kYes| if a navigation is following the rules of user activation
   // propagation. This is different from |has_user_gesture|
diff --git a/content/public/browser/appcache_service.h b/content/public/browser/appcache_service.h
index 0e140ae..1ed0d80 100644
--- a/content/public/browser/appcache_service.h
+++ b/content/public/browser/appcache_service.h
@@ -8,13 +8,19 @@
 #include <map>
 #include <memory>
 #include <set>
+#include <vector>
 
 #include "base/memory/ref_counted.h"
 #include "content/common/content_export.h"
-#include "content/public/common/appcache_info.h"
 #include "net/base/completion_once_callback.h"
 #include "url/origin.h"
 
+namespace blink {
+namespace mojom {
+class AppCacheInfo;
+}  // namespace mojom
+}  // namespace blink
+
 namespace content {
 
 // Refcounted container to avoid copying the collection in callbacks.
@@ -22,7 +28,8 @@
     : public base::RefCountedThreadSafe<AppCacheInfoCollection> {
   AppCacheInfoCollection();
 
-  std::map<url::Origin, AppCacheInfoVector> infos_by_origin;
+  std::map<url::Origin, std::vector<blink::mojom::AppCacheInfo>>
+      infos_by_origin;
 
  private:
   friend class base::RefCountedThreadSafe<AppCacheInfoCollection>;
@@ -38,7 +45,7 @@
   // acquires a reference to the 'collection' until completion.
   // This method always completes asynchronously.
   virtual void GetAllAppCacheInfo(AppCacheInfoCollection* collection,
-                                  OnceCompletionCallback callback) = 0;
+                                  net::CompletionOnceCallback callback) = 0;
 
   // Deletes the group identified by 'manifest_url', 'callback' is
   // invoked upon completion. Upon completion, the cache group and
diff --git a/content/public/common/appcache_info.h b/content/public/common/appcache_info.h
deleted file mode 100644
index d8b0f1d..0000000
--- a/content/public/common/appcache_info.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_
-#define CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_
-
-#include <stdint.h>
-
-#include <vector>
-
-#include "base/time/time.h"
-#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
-#include "third_party/blink/public/platform/web_application_cache_host.h"
-#include "url/gurl.h"
-
-namespace content {
-
-typedef base::OnceCallback<void(int)> OnceCompletionCallback;
-
-static const int kAppCacheNoHostId =
-    blink::WebApplicationCacheHost::kAppCacheNoHostId;
-
-typedef std::vector<blink::mojom::AppCacheInfo> AppCacheInfoVector;
-
-}  // namespace
-
-#endif  // CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_
diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h
index a902e8e..242b062 100644
--- a/content/public/common/common_param_traits_macros.h
+++ b/content/public/common/common_param_traits_macros.h
@@ -196,7 +196,9 @@
   IPC_STRUCT_TRAITS_MEMBER(accelerated_video_decode_enabled)
   IPC_STRUCT_TRAITS_MEMBER(animation_policy)
   IPC_STRUCT_TRAITS_MEMBER(user_gesture_required_for_presentation)
+  IPC_STRUCT_TRAITS_MEMBER(text_track_background_color)
   IPC_STRUCT_TRAITS_MEMBER(text_track_margin_percentage)
+  IPC_STRUCT_TRAITS_MEMBER(text_track_text_color)
   IPC_STRUCT_TRAITS_MEMBER(text_autosizing_enabled)
   IPC_STRUCT_TRAITS_MEMBER(double_tap_to_zoom_enabled)
 #if defined(OS_ANDROID)
diff --git a/content/public/common/web_preferences.h b/content/public/common/web_preferences.h
index 12b30f3..32cc528 100644
--- a/content/public/common/web_preferences.h
+++ b/content/public/common/web_preferences.h
@@ -210,6 +210,11 @@
 
   bool user_gesture_required_for_presentation;
 
+  // These fields specify the foreground and background color for WebVTT text
+  // tracks. Their values can be any legal CSS color descriptor.
+  std::string text_track_background_color;
+  std::string text_track_text_color;
+
   // Specifies the margin for WebVTT text tracks as a percentage of media
   // element height/width (for horizontal/vertical text respectively).
   // Cues will not be placed in this margin area.
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 9a02b44..480a30f 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -114,8 +114,8 @@
 #include "third_party/blink/public/mojom/filesystem/file_system.mojom.h"
 #include "ui/base/clipboard/clipboard.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/base/resource/resource_bundle.h"
-#include "ui/base/test/test_clipboard.h"
 #include "ui/compositor/test/draw_waiter_for_test.h"
 #include "ui/events/base_event_utils.h"
 #include "ui/events/gesture_detection/gesture_configuration.h"
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 9ad2783..c3cd5b7a 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -736,6 +736,7 @@
     "//third_party/widevine/cdm:headers",
     "//ui/accessibility",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display",
     "//ui/events:dom_keycode_converter",
diff --git a/content/renderer/appcache/web_application_cache_host_impl.cc b/content/renderer/appcache/web_application_cache_host_impl.cc
index 6acf5faf..2fd4fa2 100644
--- a/content/renderer/appcache/web_application_cache_host_impl.cc
+++ b/content/renderer/appcache/web_application_cache_host_impl.cc
@@ -69,13 +69,13 @@
       was_select_cache_called_(false) {
   DCHECK(client && backend);
   // PlzNavigate: The browser passes the ID to be used.
-  if (appcache_host_id != kAppCacheNoHostId) {
+  if (appcache_host_id != blink::mojom::kAppCacheNoHostId) {
     all_hosts()->AddWithID(this, appcache_host_id);
     host_id_ = appcache_host_id;
   } else {
     host_id_ = all_hosts()->Add(this);
   }
-  DCHECK(host_id_ != kAppCacheNoHostId);
+  DCHECK(host_id_ != blink::mojom::kAppCacheNoHostId);
 
   backend_->RegisterHost(host_id_);
 }
diff --git a/content/renderer/drop_data_builder.cc b/content/renderer/drop_data_builder.cc
index 1ffa4fa..ad2fa8d 100644
--- a/content/renderer/drop_data_builder.cc
+++ b/content/renderer/drop_data_builder.cc
@@ -13,7 +13,7 @@
 #include "third_party/blink/public/platform/web_drag_data.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/platform/web_vector.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 
 using blink::WebDragData;
 using blink::WebString;
@@ -31,20 +31,20 @@
     switch (item.storage_type) {
       case WebDragData::Item::kStorageTypeString: {
         base::string16 str_type(item.string_type.Utf16());
-        if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) {
+        if (base::EqualsASCII(str_type, ui::kMimeTypeText)) {
           result.text = WebString::ToNullableString16(item.string_data);
           break;
         }
-        if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeURIList)) {
+        if (base::EqualsASCII(str_type, ui::kMimeTypeURIList)) {
           result.url = blink::WebStringToGURL(item.string_data);
           result.url_title = item.title.Utf16();
           break;
         }
-        if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeDownloadURL)) {
+        if (base::EqualsASCII(str_type, ui::kMimeTypeDownloadURL)) {
           result.download_metadata = item.string_data.Utf16();
           break;
         }
-        if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeHTML)) {
+        if (base::EqualsASCII(str_type, ui::kMimeTypeHTML)) {
           result.html = WebString::ToNullableString16(item.string_data);
           result.html_base_url = item.base_url;
           break;
diff --git a/content/renderer/loader/web_worker_fetch_context_impl.h b/content/renderer/loader/web_worker_fetch_context_impl.h
index 608786a..8ebd8bc 100644
--- a/content/renderer/loader/web_worker_fetch_context_impl.h
+++ b/content/renderer/loader/web_worker_fetch_context_impl.h
@@ -18,6 +18,7 @@
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "services/network/public/mojom/url_loader_factory.mojom.h"
 #include "services/service_manager/public/cpp/connector.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/blob/blob_registry.mojom.h"
 #include "third_party/blink/public/mojom/service_worker/service_worker_object.mojom.h"
 #include "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom.h"
@@ -234,7 +235,7 @@
   GURL site_for_cookies_;
   bool is_secure_context_ = false;
   GURL origin_url_;
-  int appcache_host_id_ = blink::WebApplicationCacheHost::kAppCacheNoHostId;
+  int appcache_host_id_ = blink::mojom::kAppCacheNoHostId;
 
   RendererPreferences renderer_preferences_;
 
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0fcfc0b..f213144fb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -66,7 +66,6 @@
 #include "content/common/service_worker/service_worker_types.h"
 #include "content/common/swapped_out_messages.h"
 #include "content/common/view_messages.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/bind_interface_helpers.h"
 #include "content/public/common/bindings_policy.h"
 #include "content/public/common/content_constants.h"
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 19be288..77b93bd 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -801,6 +801,10 @@
   settings->SetPresentationRequiresUserGesture(
       prefs.user_gesture_required_for_presentation);
 
+  settings->SetTextTrackBackgroundColor(
+      WebString::FromASCII(prefs.text_track_background_color));
+  settings->SetTextTrackTextColor(
+      WebString::FromASCII(prefs.text_track_text_color));
   settings->SetTextTrackMarginPercentage(prefs.text_track_margin_percentage);
 
   // Needs to happen before SetDefaultPageScaleLimits below since that'll
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index ff843ae..93ba70e0 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -106,7 +106,7 @@
 #include "third_party/blink/public/web/web_view.h"
 #include "third_party/blink/public/web/web_widget.h"
 #include "third_party/skia/include/core/SkShader.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/ui_base_features.h"
 #include "ui/base/ui_base_switches.h"
 #include "ui/events/base_event_utils.h"
@@ -226,8 +226,7 @@
       // DropData::MetaData --> WebDragData-->DropData. In the end, DropData
       // will contain an empty URL (which means no URL is dragged) if the URL in
       // WebDragData is empty.
-      if (base::EqualsASCII(meta_data_item.mime_type,
-                            ui::Clipboard::kMimeTypeURIList)) {
+      if (base::EqualsASCII(meta_data_item.mime_type, ui::kMimeTypeURIList)) {
         item.string_data = WebString::FromUTF8("about:dragdrop-placeholder");
       }
       item_list.push_back(item);
@@ -272,7 +271,7 @@
   if (!drop_data.text.is_null()) {
     WebDragData::Item item;
     item.storage_type = WebDragData::Item::kStorageTypeString;
-    item.string_type = WebString::FromUTF8(ui::Clipboard::kMimeTypeText);
+    item.string_type = WebString::FromUTF8(ui::kMimeTypeText);
     item.string_data = WebString::FromUTF16(drop_data.text.string());
     item_list.push_back(item);
   }
@@ -280,7 +279,7 @@
   if (!drop_data.url.is_empty()) {
     WebDragData::Item item;
     item.storage_type = WebDragData::Item::kStorageTypeString;
-    item.string_type = WebString::FromUTF8(ui::Clipboard::kMimeTypeURIList);
+    item.string_type = WebString::FromUTF8(ui::kMimeTypeURIList);
     item.string_data = WebString::FromUTF8(drop_data.url.spec());
     item.title = WebString::FromUTF16(drop_data.url_title);
     item_list.push_back(item);
@@ -289,7 +288,7 @@
   if (!drop_data.html.is_null()) {
     WebDragData::Item item;
     item.storage_type = WebDragData::Item::kStorageTypeString;
-    item.string_type = WebString::FromUTF8(ui::Clipboard::kMimeTypeHTML);
+    item.string_type = WebString::FromUTF8(ui::kMimeTypeHTML);
     item.string_data = WebString::FromUTF16(drop_data.html.string());
     item.base_url = drop_data.html_base_url;
     item_list.push_back(item);
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
index 79de948e..dcf63ad 100644
--- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc
+++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
@@ -11,7 +11,6 @@
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "content/common/possibly_associated_wrapper_shared_url_loader_factory.h"
-#include "content/public/common/appcache_info.h"
 #include "content/public/common/content_features.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/network_service_util.h"
@@ -35,6 +34,7 @@
 #include "third_party/blink/public/common/messaging/message_port_channel.h"
 #include "third_party/blink/public/common/privacy_preferences.h"
 #include "third_party/blink/public/common/service_worker/service_worker_utils.h"
+#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
 #include "third_party/blink/public/mojom/service_worker/service_worker_object.mojom.h"
 #include "third_party/blink/public/platform/interface_provider.h"
 #include "third_party/blink/public/platform/modules/service_worker/web_service_worker_network_provider.h"
@@ -110,7 +110,7 @@
   // The ID of the precreated AppCacheHost can be valid only when the
   // NetworkService is enabled.
   DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService) ||
-         appcache_host_id == kAppCacheNoHostId);
+         appcache_host_id == blink::mojom::kAppCacheNoHostId);
 
   if (main_script_load_params) {
     response_override_ =
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 1a90666..62224e0 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -324,6 +324,7 @@
     "//third_party/blink/public:test_support",
     "//third_party/icu",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display",
     "//ui/events:events_base",
diff --git a/content/shell/test_runner/spell_check_client.cc b/content/shell/test_runner/spell_check_client.cc
index 55dda0df3..25857c99 100644
--- a/content/shell/test_runner/spell_check_client.cc
+++ b/content/shell/test_runner/spell_check_client.cc
@@ -90,13 +90,6 @@
   }
 }
 
-void SpellCheckClient::CancelAllPendingRequests() {
-  if (!last_requested_text_checking_completion_)
-    return;
-  last_requested_text_checking_completion_->DidCancelCheckingText();
-  last_requested_text_checking_completion_ = nullptr;
-}
-
 void SpellCheckClient::FinishLastTextCheck() {
   if (!last_requested_text_checking_completion_)
     return;
diff --git a/content/shell/test_runner/spell_check_client.h b/content/shell/test_runner/spell_check_client.h
index f5a8061..1145cf3f5 100644
--- a/content/shell/test_runner/spell_check_client.h
+++ b/content/shell/test_runner/spell_check_client.h
@@ -50,7 +50,6 @@
   void RequestCheckingOfText(
       const blink::WebString& text,
       blink::WebTextCheckingCompletion* completion) override;
-  void CancelAllPendingRequests() override;
 
  private:
   void FinishLastTextCheck();
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 26813f7..fe332b44 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -388,6 +388,8 @@
     "//ui/base",
     "//ui/base:test_support",
     "//ui/base:ui_data_pack",
+    "//ui/base/clipboard",
+    "//ui/base/clipboard:clipboard_test_support",
     "//ui/base/ime",
     "//ui/compositor:test_support",
     "//ui/display",
@@ -1030,6 +1032,7 @@
     "//ui/accessibility",
     "//ui/accessibility:ax_enums_mojo",
     "//ui/base:test_support",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/compositor",
     "//ui/display",
@@ -1988,6 +1991,7 @@
     "//third_party/widevine/cdm:headers",
     "//ui/accessibility",
     "//ui/base:test_support",
+    "//ui/base/clipboard:clipboard_test_support",
     "//ui/base/ime",
     "//ui/compositor:test_support",
     "//ui/display",
diff --git a/content/test/data/site_isolation/png-corp.png b/content/test/data/site_isolation/png-corp.png
new file mode 100644
index 0000000..5796d61
--- /dev/null
+++ b/content/test/data/site_isolation/png-corp.png
Binary files differ
diff --git a/content/test/data/site_isolation/png-corp.png.mock-http-headers b/content/test/data/site_isolation/png-corp.png.mock-http-headers
new file mode 100644
index 0000000..a433744
--- /dev/null
+++ b/content/test/data/site_isolation/png-corp.png.mock-http-headers
@@ -0,0 +1,3 @@
+HTTP/1.1 200 OK
+Content-Type: image/png
+Cross-Origin-Resource-Policy: same-origin
diff --git a/content/test/gpu/gpu_tests/pixel_expectations.py b/content/test/gpu/gpu_tests/pixel_expectations.py
index 37a91c93..f6bdf1a3 100644
--- a/content/test/gpu/gpu_tests/pixel_expectations.py
+++ b/content/test/gpu/gpu_tests/pixel_expectations.py
@@ -135,3 +135,7 @@
         ['mac', ('amd', 0x679e)], bug=911413)
     self.Fail('Pixel_Video_MP4_FourColors_Rot_270',
         ['mac', ('amd', 0x679e)], bug=911413)
+
+    # TODO(mcasas): re-enable after rebaselining, https://crbug.com/922218
+    self.Fail('Pixel_CanvasLowLatency2D', ['mac'], bug=922218)
+    self.Fail('Pixel_CanvasUnacceleratedLowLatency2D', ['mac'], bug=922218)
diff --git a/docs/gpu/vaapi.md b/docs/gpu/vaapi.md
index 9b54899df..37bc9b3 100644
--- a/docs/gpu/vaapi.md
+++ b/docs/gpu/vaapi.md
@@ -208,14 +208,18 @@
 * `--ignore-gpu-blacklist`
 * `--use-gl=desktop` or `--use-gl=egl`
 
-Also, the environment variable `MESA_GLSL_CACHE_DISABLE=false` should be set:
-
-**TODO(crbug.com/917091): Further clarify the env variable and the flags**
-
 ```shell
- MESA_GLSL_CACHE_DISABLE=false ./out/gn/chrome --ignore-gpu-blacklist --use-gl=egl
+./out/gn/chrome --ignore-gpu-blacklist --use-gl=egl
 ```
 
+Note that you can set the environment variable `MESA_GLSL_CACHE_DISABLE=false`
+if you want the gpu process to run in sandboxed mode, see
+[crbug.com/264818](https://crbug.com/264818). To check if the running gpu
+process is sandboxed or not, just open `chrome://gpu` and search for
+`Sandboxed` in the driver information table. In addition, passing
+`--gpu-sandbox-failures-fatal=yes` will prevent the gpu process to run in
+non-sandboxed mode.
+
 Refer to the [previous section](#verify-vaapi) to verify support and use of
 the VaAPI.
 
diff --git a/docs/updating_clang.md b/docs/updating_clang.md
index 0a47fc2..1a160f7 100644
--- a/docs/updating_clang.md
+++ b/docs/updating_clang.md
@@ -50,7 +50,7 @@
       -b linux_chromium_cfi_rel_ng \
       -b linux_chromium_chromeos_asan_rel_ng -b linux_chromium_msan_rel_ng \
       -b linux_chromium_chromeos_msan_rel_ng -b linux-chromeos-dbg \
-      -b win-asan
+      -b win-asan -b chromeos-amd64-generic-cfi-thin-lto-rel
     ```
 
 1.  Optional: Start Pinpoint perf tryjobs. These are generally too noisy to
diff --git a/gpu/command_buffer/client/raster_implementation_gles_unittest.cc b/gpu/command_buffer/client/raster_implementation_gles_unittest.cc
index f54b9314..2a6964a0 100644
--- a/gpu/command_buffer/client/raster_implementation_gles_unittest.cc
+++ b/gpu/command_buffer/client/raster_implementation_gles_unittest.cc
@@ -15,6 +15,7 @@
 #include "base/containers/flat_map.h"
 #include "cc/paint/color_space_transfer_cache_entry.h"
 #include "cc/paint/display_item_list.h"
+#include "cc/paint/image_provider.h"
 #include "components/viz/common/resources/resource_format_utils.h"
 #include "gpu/GLES2/gl2extchromium.h"
 #include "gpu/command_buffer/client/client_test_helper.h"
diff --git a/headless/BUILD.gn b/headless/BUILD.gn
index ae311542..7450e8c 100644
--- a/headless/BUILD.gn
+++ b/headless/BUILD.gn
@@ -386,6 +386,7 @@
     "//content/public/common:service_names",
     "//services/service_manager/public/cpp",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/compositor",
     "//ui/display",
     "//ui/events/devices",
@@ -738,6 +739,7 @@
     "//services/network/public/mojom",
     "//testing/gmock",
     "//testing/gtest",
+    "//ui/base/clipboard",
   ]
 
   if (!is_fuchsia) {
diff --git a/headless/lib/browser/headless_clipboard.cc b/headless/lib/browser/headless_clipboard.cc
index 9b9fd06..ccf616f 100644
--- a/headless/lib/browser/headless_clipboard.cc
+++ b/headless/lib/browser/headless_clipboard.cc
@@ -7,6 +7,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/numerics/safe_conversions.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 
 namespace headless {
 
@@ -21,7 +22,7 @@
   return GetStore(type).sequence_number;
 }
 
-bool HeadlessClipboard::IsFormatAvailable(const FormatType& format,
+bool HeadlessClipboard::IsFormatAvailable(const ui::ClipboardFormatType& format,
                                           ui::ClipboardType type) const {
   const DataStore& store = GetStore(type);
   return store.data.find(format) != store.data.end();
@@ -36,15 +37,15 @@
                                            bool* contains_filenames) const {
   types->clear();
 
-  if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (IsFormatAvailable(Clipboard::GetHtmlFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
+  if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), type))
+    types->push_back(base::UTF8ToUTF16(ui::kMimeTypeText));
+  if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), type))
+    types->push_back(base::UTF8ToUTF16(ui::kMimeTypeHTML));
 
-  if (IsFormatAvailable(Clipboard::GetRtfFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
-  if (IsFormatAvailable(Clipboard::GetBitmapFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
+  if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), type))
+    types->push_back(base::UTF8ToUTF16(ui::kMimeTypeRTF));
+  if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), type))
+    types->push_back(base::UTF8ToUTF16(ui::kMimeTypePNG));
 
   *contains_filenames = false;
 }
@@ -60,7 +61,7 @@
                                       std::string* result) const {
   result->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetPlainTextFormatType());
+  auto it = store.data.find(ui::ClipboardFormatType::GetPlainTextType());
   if (it != store.data.end())
     *result = it->second;
 }
@@ -73,7 +74,7 @@
   markup->clear();
   src_url->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetHtmlFormatType());
+  auto it = store.data.find(ui::ClipboardFormatType::GetHtmlType());
   if (it != store.data.end())
     *markup = base::UTF8ToUTF16(it->second);
   *src_url = store.html_src_url;
@@ -85,7 +86,7 @@
                                 std::string* result) const {
   result->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetRtfFormatType());
+  auto it = store.data.find(ui::ClipboardFormatType::GetRtfType());
   if (it != store.data.end())
     *result = it->second;
 }
@@ -101,13 +102,13 @@
 void HeadlessClipboard::ReadBookmark(base::string16* title,
                                      std::string* url) const {
   const DataStore& store = GetDefaultStore();
-  auto it = store.data.find(GetUrlWFormatType());
+  auto it = store.data.find(ui::ClipboardFormatType::GetUrlWType());
   if (it != store.data.end())
     *url = it->second;
   *title = base::UTF8ToUTF16(store.url_title);
 }
 
-void HeadlessClipboard::ReadData(const FormatType& format,
+void HeadlessClipboard::ReadData(const ui::ClipboardFormatType& format,
                                  std::string* result) const {
   result->clear();
   const DataStore& store = GetDefaultStore();
@@ -127,12 +128,12 @@
 
 void HeadlessClipboard::WriteText(const char* text_data, size_t text_len) {
   std::string text(text_data, text_len);
-  GetDefaultStore().data[GetPlainTextFormatType()] = text;
+  GetDefaultStore().data[ui::ClipboardFormatType::GetPlainTextType()] = text;
   // Create a dummy entry.
-  GetDefaultStore().data[GetPlainTextWFormatType()];
+  GetDefaultStore().data[ui::ClipboardFormatType::GetPlainTextType()];
   if (IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) {
-    GetStore(ui::CLIPBOARD_TYPE_SELECTION).data[GetPlainTextFormatType()] =
-        text;
+    GetStore(ui::CLIPBOARD_TYPE_SELECTION)
+        .data[ui::ClipboardFormatType::GetPlainTextType()] = text;
   }
 }
 
@@ -142,37 +143,40 @@
                                   size_t url_len) {
   base::string16 markup;
   base::UTF8ToUTF16(markup_data, markup_len, &markup);
-  GetDefaultStore().data[GetHtmlFormatType()] = base::UTF16ToUTF8(markup);
+  GetDefaultStore().data[ui::ClipboardFormatType::GetHtmlType()] =
+      base::UTF16ToUTF8(markup);
   GetDefaultStore().html_src_url = std::string(url_data, url_len);
 }
 
 void HeadlessClipboard::WriteRTF(const char* rtf_data, size_t data_len) {
-  GetDefaultStore().data[GetRtfFormatType()] = std::string(rtf_data, data_len);
+  GetDefaultStore().data[ui::ClipboardFormatType::GetRtfType()] =
+      std::string(rtf_data, data_len);
 }
 
 void HeadlessClipboard::WriteBookmark(const char* title_data,
                                       size_t title_len,
                                       const char* url_data,
                                       size_t url_len) {
-  GetDefaultStore().data[GetUrlWFormatType()] = std::string(url_data, url_len);
+  GetDefaultStore().data[ui::ClipboardFormatType::GetUrlWType()] =
+      std::string(url_data, url_len);
   GetDefaultStore().url_title = std::string(title_data, title_len);
 }
 
 void HeadlessClipboard::WriteWebSmartPaste() {
   // Create a dummy entry.
-  GetDefaultStore().data[GetWebKitSmartPasteFormatType()];
+  GetDefaultStore().data[ui::ClipboardFormatType::GetWebKitSmartPasteType()];
 }
 
 void HeadlessClipboard::WriteBitmap(const SkBitmap& bitmap) {
   // Create a dummy entry.
-  GetDefaultStore().data[GetBitmapFormatType()];
+  GetDefaultStore().data[ui::ClipboardFormatType::GetBitmapType()];
   SkBitmap& dst = GetDefaultStore().image;
   if (dst.tryAllocPixels(bitmap.info())) {
     bitmap.readPixels(dst.info(), dst.getPixels(), dst.rowBytes(), 0, 0);
   }
 }
 
-void HeadlessClipboard::WriteData(const FormatType& format,
+void HeadlessClipboard::WriteData(const ui::ClipboardFormatType& format,
                                   const char* data_data,
                                   size_t data_len) {
   GetDefaultStore().data[format] = std::string(data_data, data_len);
diff --git a/headless/lib/browser/headless_clipboard.h b/headless/lib/browser/headless_clipboard.h
index 720d553..e687ef4 100644
--- a/headless/lib/browser/headless_clipboard.h
+++ b/headless/lib/browser/headless_clipboard.h
@@ -25,7 +25,7 @@
   // Clipboard overrides.
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ui::ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ui::ClipboardFormatType& format,
                          ui::ClipboardType type) const override;
   void Clear(ui::ClipboardType type) override;
   void ReadAvailableTypes(ui::ClipboardType type,
@@ -45,7 +45,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ui::ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ui::ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -59,7 +60,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ui::ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
@@ -69,7 +70,7 @@
     ~DataStore();
     void Clear();
     uint64_t sequence_number;
-    std::map<FormatType, std::string> data;
+    std::map<ui::ClipboardFormatType, std::string> data;
     std::string url_title;
     std::string html_src_url;
     SkBitmap image;
diff --git a/ios/chrome/app/spotlight/base_spotlight_manager.mm b/ios/chrome/app/spotlight/base_spotlight_manager.mm
index 8a20fba..af8dcc26 100644
--- a/ios/chrome/app/spotlight/base_spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/base_spotlight_manager.mm
@@ -238,7 +238,7 @@
   };
 
   base::CancelableTaskTracker::TaskId taskID =
-      _largeIconService->GetLargeIconOrFallbackStyle(
+      _largeIconService->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
           URL, kMinIconSize * [UIScreen mainScreen].scale,
           kIconSize * [UIScreen mainScreen].scale,
           base::BindRepeating(faviconBlock), &_largeIconTaskTracker);
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl.cc b/ios/chrome/browser/browser_state/chrome_browser_state_impl.cc
index 2de8ec0..897a674 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_impl.cc
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl.cc
@@ -68,6 +68,9 @@
   return base.Append(kIOSChromeCacheDirname);
 }
 
+const base::FilePath::CharType kIOSChromeChannelIDFilename[] =
+    FILE_PATH_LITERAL("Origin Bound Certs");
+
 }  // namespace
 
 ChromeBrowserStateImpl::ChromeBrowserStateImpl(
@@ -109,15 +112,20 @@
       this);
 
   base::FilePath cookie_path = state_path_.Append(kIOSChromeCookieFilename);
-  base::FilePath channel_id_path =
-      state_path_.Append(kIOSChromeChannelIDFilename);
   base::FilePath cache_path = GetCachePath(base_cache_path);
   int cache_max_size = 0;
 
+  // TODO(crbug.com/903642): Remove the following when no longer needed.
+  base::FilePath channel_id_path =
+      state_path_.Append(kIOSChromeChannelIDFilename);
+  base::DeleteFile(channel_id_path, false);
+  base::DeleteFile(
+      base::FilePath(channel_id_path.value() + FILE_PATH_LITERAL("-journal")),
+      false);
+
   // Make sure we initialize the io_data_ after everything else has been
   // initialized that we might be reading from the IO thread.
-  io_data_->Init(cookie_path, channel_id_path, cache_path, cache_max_size,
-                 state_path_);
+  io_data_->Init(cookie_path, cache_path, cache_max_size, state_path_);
 
   // Listen for bookmark model load, to bootstrap the sync service.
   bookmarks::BookmarkModel* model =
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h
index 1c426bf..31bf519c 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h
@@ -34,7 +34,6 @@
     // Init() must be called before ~Handle(). It records most of the
     // parameters needed to construct a ChromeURLRequestContextGetter.
     void Init(const base::FilePath& cookie_path,
-              const base::FilePath& channel_id_path,
               const base::FilePath& cache_path,
               int cache_max_size,
               const base::FilePath& profile_path);
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
index 874c9d6..511c50d 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
@@ -35,12 +35,9 @@
 #include "ios/web/public/web_thread.h"
 #include "net/base/cache_type.h"
 #include "net/cookies/cookie_store.h"
-#include "net/extras/sqlite/sqlite_channel_id_store.h"
 #include "net/http/http_cache.h"
 #include "net/http/http_network_session.h"
 #include "net/http/http_server_properties_manager.h"
-#include "net/ssl/channel_id_service.h"
-#include "net/ssl/default_channel_id_store.h"
 #include "net/url_request/url_request_intercepting_job_factory.h"
 #include "net/url_request/url_request_job_factory_impl.h"
 
@@ -65,7 +62,6 @@
 
 void ChromeBrowserStateImplIOData::Handle::Init(
     const base::FilePath& cookie_path,
-    const base::FilePath& channel_id_path,
     const base::FilePath& cache_path,
     int cache_max_size,
     const base::FilePath& profile_path) {
@@ -75,7 +71,6 @@
   LazyParams* lazy_params = new LazyParams();
 
   lazy_params->cookie_path = cookie_path;
-  lazy_params->channel_id_path = channel_id_path;
   lazy_params->cache_path = cache_path;
   lazy_params->cache_max_size = cache_max_size;
   io_data_->lazy_params_.reset(lazy_params);
@@ -223,8 +218,6 @@
 
   main_context->set_proxy_resolution_service(proxy_resolution_service());
 
-  net::ChannelIDService* channel_id_service = NULL;
-
   DCHECK(!lazy_params_->cookie_path.empty());
   cookie_util::CookieStoreConfig ios_cookie_config(
       lazy_params_->cookie_path,
@@ -244,23 +237,6 @@
 
   main_context->set_cookie_store(main_cookie_store_.get());
 
-  // Set up server bound cert service.
-  if (!channel_id_service) {
-    DCHECK(!lazy_params_->channel_id_path.empty());
-
-    scoped_refptr<net::SQLiteChannelIDStore> channel_id_db =
-        new net::SQLiteChannelIDStore(
-            lazy_params_->channel_id_path,
-            base::CreateSequencedTaskRunnerWithTraits(
-                {base::MayBlock(), base::TaskPriority::BEST_EFFORT}));
-    channel_id_service = new net::ChannelIDService(
-        new net::DefaultChannelIDStore(channel_id_db.get()));
-  }
-
-  set_channel_id_service(channel_id_service);
-  main_context->set_channel_id_service(channel_id_service);
-  main_cookie_store_->SetChannelIDServiceID(channel_id_service->GetUniqueID());
-
   std::unique_ptr<net::HttpCache::BackendFactory> main_backend(
       new net::HttpCache::DefaultBackend(
           net::DISK_CACHE, net::CACHE_BACKEND_BLOCKFILE,
@@ -288,14 +264,9 @@
   AppRequestContext* context = new AppRequestContext();
   context->CopyFrom(main_context);
 
-  // Use a separate ChannelIDService.
-  std::unique_ptr<net::ChannelIDService> channel_id_service(
-      new net::ChannelIDService(new net::DefaultChannelIDStore(nullptr)));
-
-  // Build a new HttpNetworkSession that uses the new ChannelIDService.
+  // Build a new HttpNetworkSession.
   net::HttpNetworkSession::Context session_context =
       http_network_session_->context();
-  session_context.channel_id_service = channel_id_service.get();
   std::unique_ptr<net::HttpNetworkSession> http_network_session(
       new net::HttpNetworkSession(http_network_session_->params(),
                                   session_context));
@@ -316,9 +287,8 @@
           ios_cookie_config, std::make_unique<net::NSHTTPSystemCookieStore>(),
           main_context->net_log());
 
-  // Transfer ownership of the ChannelIDStore, HttpNetworkSession, cookies, and
+  // Transfer ownership of the HttpNetworkSession, cookies, and
   // cache to AppRequestContext.
-  context->SetChannelIDService(std::move(channel_id_service));
   context->SetHttpNetworkSession(std::move(http_network_session));
   context->SetCookieStore(std::move(cookie_store));
   context->SetHttpTransactionFactory(std::move(app_http_cache));
diff --git a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
index cd75576..f54fd4196 100644
--- a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
+++ b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
@@ -27,13 +27,10 @@
 #include "ios/web/public/web_thread.h"
 #include "net/cookies/cookie_store.h"
 #include "net/disk_cache/disk_cache.h"
-#include "net/extras/sqlite/sqlite_channel_id_store.h"
 #include "net/ftp/ftp_network_layer.h"
 #include "net/http/http_cache.h"
 #include "net/http/http_network_session.h"
 #include "net/http/http_server_properties_impl.h"
-#include "net/ssl/channel_id_service.h"
-#include "net/ssl/default_channel_id_store.h"
 #include "net/url_request/url_request_job_factory_impl.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -80,8 +77,6 @@
   DCHECK(browser_state);
   io_data_->cookie_path_ =
       browser_state->GetStatePath().Append(kIOSChromeCookieFilename);
-  io_data_->channel_id_path_ =
-      browser_state->GetStatePath().Append(kIOSChromeChannelIDFilename);
 }
 
 OffTheRecordChromeBrowserStateIOData::Handle::~Handle() {
@@ -177,20 +172,6 @@
       new net::HttpServerPropertiesImpl()));
   main_context->set_http_server_properties(http_server_properties());
 
-  // For incognito, we use a non-persistent channel ID store.
-  scoped_refptr<net::DefaultChannelIDStore::PersistentStore> channel_id_store;
-
-  // On iOS, certificates are persisted to the disk in incognito.
-  DCHECK(!channel_id_path_.empty());
-  channel_id_store = new net::SQLiteChannelIDStore(
-      channel_id_path_,
-      base::CreateSequencedTaskRunnerWithTraits(
-          {base::MayBlock(), base::TaskPriority::BEST_EFFORT}));
-
-  net::ChannelIDService* channel_id_service = new net::ChannelIDService(
-      new net::DefaultChannelIDStore(channel_id_store.get()));
-  set_channel_id_service(channel_id_service);
-  main_context->set_channel_id_service(channel_id_service);
   main_cookie_store_ = cookie_util::CreateCookieStore(
       cookie_util::CookieStoreConfig(
           cookie_path_,
@@ -198,7 +179,6 @@
           cookie_util::CookieStoreConfig::COOKIE_STORE_IOS, nullptr),
       std::move(profile_params->system_cookie_store), io_thread->net_log());
   main_context->set_cookie_store(main_cookie_store_.get());
-  main_cookie_store_->SetChannelIDServiceID(channel_id_service->GetUniqueID());
 
   http_network_session_ = CreateHttpNetworkSession(*profile_params);
   main_http_factory_ = CreateMainHttpFactory(
diff --git a/ios/chrome/browser/chrome_constants.cc b/ios/chrome/browser/chrome_constants.cc
index 0de81c66..cc68dcc0 100644
--- a/ios/chrome/browser/chrome_constants.cc
+++ b/ios/chrome/browser/chrome_constants.cc
@@ -9,8 +9,6 @@
 
 const base::FilePath::CharType kIOSChromeCacheDirname[] =
     FILE_PATH_LITERAL("Cache");
-const base::FilePath::CharType kIOSChromeChannelIDFilename[] =
-    FILE_PATH_LITERAL("Origin Bound Certs");
 const base::FilePath::CharType kIOSChromeCookieFilename[] =
     FILE_PATH_LITERAL("Cookies");
 const base::FilePath::CharType kIOSChromeCRLSetFilename[] =
diff --git a/ios/chrome/browser/chrome_constants.h b/ios/chrome/browser/chrome_constants.h
index c2c9704..2bafeb95 100644
--- a/ios/chrome/browser/chrome_constants.h
+++ b/ios/chrome/browser/chrome_constants.h
@@ -13,7 +13,6 @@
 extern const char kIOSChromeMultiBrowserStatePrefix[];
 
 extern const base::FilePath::CharType kIOSChromeCacheDirname[];
-extern const base::FilePath::CharType kIOSChromeChannelIDFilename[];
 extern const base::FilePath::CharType kIOSChromeCookieFilename[];
 extern const base::FilePath::CharType kIOSChromeCRLSetFilename[];
 extern const base::FilePath::CharType
diff --git a/ios/chrome/browser/favicon/favicon_loader.mm b/ios/chrome/browser/favicon/favicon_loader.mm
index 9f2db059..c3d58b5 100644
--- a/ios/chrome/browser/favicon/favicon_loader.mm
+++ b/ios/chrome/browser/favicon/favicon_loader.mm
@@ -140,7 +140,7 @@
   CGFloat favicon_size_in_pixels = [UIScreen mainScreen].scale * size;
   CGFloat min_favicon_size = [UIScreen mainScreen].scale * min_size;
   DCHECK(large_icon_service_);
-  large_icon_service_->GetLargeIconOrFallbackStyle(
+  large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       block_url, min_favicon_size, favicon_size_in_pixels,
       base::BindRepeating(favicon_block), &cancelable_task_tracker_);
 
diff --git a/ios/chrome/browser/favicon/favicon_loader_unittest.mm b/ios/chrome/browser/favicon/favicon_loader_unittest.mm
index 853a390..11b882e 100644
--- a/ios/chrome/browser/favicon/favicon_loader_unittest.mm
+++ b/ios/chrome/browser/favicon/favicon_loader_unittest.mm
@@ -36,7 +36,8 @@
   FakeLargeIconService()
       : favicon::LargeIconServiceImpl(/*favicon_service=*/nullptr,
                                       /*image_fetcher=*/nullptr) {}
-  base::CancelableTaskTracker::TaskId GetLargeIconOrFallbackStyle(
+  base::CancelableTaskTracker::TaskId
+  GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       const GURL& page_url,
       int min_source_size_in_pixel,
       int desired_size_in_pixel,
diff --git a/ios/chrome/browser/suggestions/suggestions_service_factory.h b/ios/chrome/browser/suggestions/suggestions_service_factory.h
index d9d9c8c..82d4535 100644
--- a/ios/chrome/browser/suggestions/suggestions_service_factory.h
+++ b/ios/chrome/browser/suggestions/suggestions_service_factory.h
@@ -8,13 +8,9 @@
 #include <memory>
 
 #include "base/macros.h"
+#include "base/no_destructor.h"
 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
 
-namespace base {
-template <typename T>
-struct DefaultSingletonTraits;
-}  // namespace base
-
 namespace ios {
 class ChromeBrowserState;
 }
@@ -34,7 +30,7 @@
       ios::ChromeBrowserState* browser_state);
 
  private:
-  friend struct base::DefaultSingletonTraits<SuggestionsServiceFactory>;
+  friend class base::NoDestructor<SuggestionsServiceFactory>;
 
   SuggestionsServiceFactory();
   ~SuggestionsServiceFactory() override;
diff --git a/ios/chrome/browser/suggestions/suggestions_service_factory.mm b/ios/chrome/browser/suggestions/suggestions_service_factory.mm
index a01a5583..f822f92 100644
--- a/ios/chrome/browser/suggestions/suggestions_service_factory.mm
+++ b/ios/chrome/browser/suggestions/suggestions_service_factory.mm
@@ -8,7 +8,7 @@
 #include <utility>
 
 #include "base/files/file_path.h"
-#include "base/memory/singleton.h"
+#include "base/no_destructor.h"
 #include "base/task/post_task.h"
 #include "base/time/default_tick_clock.h"
 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
@@ -32,7 +32,8 @@
 
 // static
 SuggestionsServiceFactory* SuggestionsServiceFactory::GetInstance() {
-  return base::Singleton<SuggestionsServiceFactory>::get();
+  static base::NoDestructor<SuggestionsServiceFactory> instance;
+  return instance.get();
 }
 
 // static
diff --git a/ios/chrome/browser/sync/session_sync_service_factory.mm b/ios/chrome/browser/sync/session_sync_service_factory.mm
index 6a41eb2..18c8d69 100644
--- a/ios/chrome/browser/sync/session_sync_service_factory.mm
+++ b/ios/chrome/browser/sync/session_sync_service_factory.mm
@@ -9,9 +9,9 @@
 #include "base/no_destructor.h"
 #include "base/task/post_task.h"
 #include "base/time/time.h"
-#include "components/browser_sync/profile_sync_service.h"
 #include "components/keyed_service/core/service_access_type.h"
 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
+#include "components/sync/device_info/device_info_sync_service.h"
 #include "components/sync/device_info/local_device_info_provider.h"
 #include "components/sync/driver/sync_service.h"
 #include "components/sync/model/model_type_store_service.h"
@@ -24,9 +24,9 @@
 #include "ios/chrome/browser/chrome_url_constants.h"
 #include "ios/chrome/browser/favicon/favicon_service_factory.h"
 #include "ios/chrome/browser/history/history_service_factory.h"
+#include "ios/chrome/browser/sync/device_info_sync_service_factory.h"
 #include "ios/chrome/browser/sync/glue/sync_start_util.h"
 #include "ios/chrome/browser/sync/model_type_store_service_factory.h"
-#include "ios/chrome/browser/sync/profile_sync_service_factory.h"
 #import "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.h"
 #include "ios/chrome/browser/tabs/tab_model_synced_window_delegate_getter.h"
 #include "ios/chrome/common/channel_info.h"
@@ -94,13 +94,8 @@
 
   const syncer::DeviceInfo* GetLocalDeviceInfo() override {
     DCHECK_CURRENTLY_ON(web::WebThread::UI);
-    browser_sync::ProfileSyncService* profile_sync_service =
-        ProfileSyncServiceFactory::
-            GetAsProfileSyncServiceForBrowserStateIfExists(browser_state_);
-    if (!profile_sync_service) {
-      return nullptr;
-    }
-    return profile_sync_service->GetLocalDeviceInfoProvider()
+    return DeviceInfoSyncServiceFactory::GetForBrowserState(browser_state_)
+        ->GetLocalDeviceInfoProvider()
         ->GetLocalDeviceInfo();
   }
 
@@ -153,6 +148,7 @@
     : BrowserStateKeyedServiceFactory(
           "SessionSyncService",
           BrowserStateDependencyManager::GetInstance()) {
+  DependsOn(DeviceInfoSyncServiceFactory::GetInstance());
   DependsOn(ios::FaviconServiceFactory::GetInstance());
   DependsOn(ios::HistoryServiceFactory::GetInstance());
   DependsOn(ModelTypeStoreServiceFactory::GetInstance());
diff --git a/ios/chrome/browser/ui/favicon/favicon_attributes_provider.mm b/ios/chrome/browser/ui/favicon/favicon_attributes_provider.mm
index 9c2e566..972d12c 100644
--- a/ios/chrome/browser/ui/favicon/favicon_attributes_provider.mm
+++ b/ios/chrome/browser/ui/favicon/favicon_attributes_provider.mm
@@ -106,7 +106,7 @@
   // Always call LargeIconService in case the favicon was updated.
   CGFloat faviconSize = [UIScreen mainScreen].scale * self.faviconSize;
   CGFloat minFaviconSize = [UIScreen mainScreen].scale * self.minSize;
-  self.largeIconService->GetLargeIconOrFallbackStyle(
+  self.largeIconService->GetLargeIconRawBitmapOrFallbackStyleForPageUrl(
       URL, minFaviconSize, faviconSize,
       base::BindRepeating(faviconBlockSaveToCache), &_faviconTaskTracker);
 }
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
index 5039c6e..b21ac63 100644
--- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm
+++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -109,20 +109,20 @@
 @property(nonatomic, strong, readwrite)
     DeviceSharingManager* deviceSharingManager;
 
-// Creates a new autoreleased tab model for |browserState|; if |empty| is NO,
+// Sets up the given |tabModel| for use.  If |restorePersistedState| is YES,
 // then any existing tabs that have been saved for |browserState| will be
-// loaded; otherwise, the tab model will be created empty.
-- (TabModel*)tabModelForBrowserState:(ios::ChromeBrowserState*)browserState
-                               empty:(BOOL)empty;
+// loaded; otherwise, the tab model will be left empty.
+- (void)setUpTabModel:(TabModel*)tabModel
+         withBrowserState:(ios::ChromeBrowserState*)browserState
+    restorePersistedState:(BOOL)restorePersistedState;
 
 // Setters for the main and otr Browsers.
 - (void)setMainBrowser:(std::unique_ptr<Browser>)browser;
 - (void)setOtrBrowser:(std::unique_ptr<Browser>)browser;
 
 // Creates a new off-the-record ("incognito") browser state for |_browserState|,
-// then calls -tabModelForBrowserState:empty: and returns a Browser for the
-// result.
-- (std::unique_ptr<Browser>)buildOtrBrowser:(BOOL)empty;
+// then creates and sets up a TabModel and returns a Browser for the result.
+- (std::unique_ptr<Browser>)buildOtrBrowser:(BOOL)restorePersistedState;
 
 // Creates the correct BrowserCoordinator for the corresponding browser state
 // and Browser.
@@ -153,7 +153,12 @@
 }
 
 - (void)createMainBrowser {
-  TabModel* tabModel = [self tabModelForBrowserState:_browserState empty:NO];
+  TabModel* tabModel =
+      [[TabModel alloc] initWithSessionService:[SessionServiceIOS sharedService]
+                                  browserState:_browserState];
+  [self setUpTabModel:tabModel
+           withBrowserState:_browserState
+      restorePersistedState:YES];
 
   _mainBrowser = Browser::Create(_browserState, tabModel);
   // Follow loaded URLs in the main tab model to send those in case of
@@ -224,7 +229,7 @@
 
 - (Browser*)otrBrowser {
   if (!_otrBrowser) {
-    _otrBrowser = [self buildOtrBrowser:NO];
+    _otrBrowser = [self buildOtrBrowser:YES];
   }
   return _otrBrowser.get();
 }
@@ -333,7 +338,7 @@
   // possible to prevent the tabChanged notification being sent. Otherwise,
   // when it is created, a notification with no tabs will be sent, and it will
   // be immediately deleted.
-  [self setOtrBrowser:[self buildOtrBrowser:YES]];
+  [self setOtrBrowser:[self buildOtrBrowser:NO]];
   DCHECK(![self.otrBrowser->GetTabModel() count]);
   DCHECK(_browserState->HasOffTheRecordChromeBrowserState());
 
@@ -367,21 +372,27 @@
 
 #pragma mark - Internal methods
 
-- (std::unique_ptr<Browser>)buildOtrBrowser:(BOOL)empty {
+- (std::unique_ptr<Browser>)buildOtrBrowser:(BOOL)restorePersistedState {
   DCHECK(_browserState);
   // Ensure that the OTR ChromeBrowserState is created.
   ios::ChromeBrowserState* otrBrowserState =
       _browserState->GetOffTheRecordChromeBrowserState();
   DCHECK(otrBrowserState);
-  TabModel* tabModel = [self tabModelForBrowserState:otrBrowserState
-                                               empty:empty];
+  TabModel* tabModel =
+      [[TabModel alloc] initWithSessionService:[SessionServiceIOS sharedService]
+                                  browserState:otrBrowserState];
+  [self setUpTabModel:tabModel
+           withBrowserState:otrBrowserState
+      restorePersistedState:restorePersistedState];
   return Browser::Create(otrBrowserState, tabModel);
 }
 
-- (TabModel*)tabModelForBrowserState:(ios::ChromeBrowserState*)browserState
-                               empty:(BOOL)empty {
+- (void)setUpTabModel:(TabModel*)tabModel
+         withBrowserState:(ios::ChromeBrowserState*)browserState
+    restorePersistedState:(BOOL)restorePersistedState {
+  DCHECK_EQ(0U, tabModel.count);
   SessionWindowIOS* sessionWindow = nil;
-  if (!empty) {
+  if (restorePersistedState) {
     // Load existing saved tab model state.
     NSString* statePath =
         base::SysUTF8ToNSString(browserState->GetStatePath().AsUTF8Unsafe());
@@ -391,21 +402,16 @@
       DCHECK_EQ(session.sessionWindows.count, 1u);
       sessionWindow = session.sessionWindows[0];
     }
+
+    [tabModel restoreSessionWindow:sessionWindow forInitialRestore:YES];
   }
 
-  // Create tab model from saved session (nil is ok).
-  TabModel* tabModel =
-      [[TabModel alloc] initWithSessionService:[SessionServiceIOS sharedService]
-                                  browserState:browserState];
-  [tabModel restoreSessionWindow:sessionWindow forInitialRestore:YES];
   // Add observers.
   if (_tabModelObserver) {
     [tabModel addObserver:_tabModelObserver];
     [tabModel addObserver:self];
   }
   breakpad::MonitorTabStateForTabModel(tabModel);
-
-  return tabModel;
 }
 
 - (BrowserCoordinator*)coordinatorForBrowser:(Browser*)browser {
diff --git a/ios/chrome/browser/ui/translate/BUILD.gn b/ios/chrome/browser/ui/translate/BUILD.gn
index 870aaa1..eee184b 100644
--- a/ios/chrome/browser/ui/translate/BUILD.gn
+++ b/ios/chrome/browser/ui/translate/BUILD.gn
@@ -41,6 +41,15 @@
     "language_selection_provider.h",
     "language_selection_view_controller.h",
     "language_selection_view_controller.mm",
+    "translate_infobar_language_tab_strip_view.h",
+    "translate_infobar_language_tab_strip_view.mm",
+    "translate_infobar_language_tab_strip_view_delegate.h",
+    "translate_infobar_language_tab_view.h",
+    "translate_infobar_language_tab_view.mm",
+    "translate_infobar_language_tab_view_delegate.h",
+    "translate_infobar_view.h",
+    "translate_infobar_view.mm",
+    "translate_infobar_view_delegate.h",
     "translate_notification_delegate.h",
     "translate_notification_handler.h",
     "translate_notification_presenter.h",
@@ -50,7 +59,14 @@
     "//base",
     "//components/strings:components_strings",
     "//ios/chrome/browser",
+    "//ios/chrome/browser/ui/colors",
+    "//ios/chrome/browser/ui/infobars:infobars_ui",
+    "//ios/chrome/browser/ui/toolbar/buttons",
+    "//ios/chrome/browser/ui/translate/resources:translate_dismiss",
+    "//ios/chrome/browser/ui/translate/resources:translate_icon",
+    "//ios/chrome/browser/ui/translate/resources:translate_options",
     "//ios/chrome/browser/ui/util",
+    "//ios/chrome/common/ui_util",
     "//ios/third_party/material_components_ios",
     "//ui/base",
   ]
diff --git a/ios/chrome/browser/ui/translate/resources/BUILD.gn b/ios/chrome/browser/ui/translate/resources/BUILD.gn
new file mode 100644
index 0000000..2666207
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/BUILD.gn
@@ -0,0 +1,32 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ios/asset_catalog.gni")
+
+imageset("translate_icon") {
+  sources = [
+    "translate_icon.imageset/Contents.json",
+    "translate_icon.imageset/translate_icon.png",
+    "translate_icon.imageset/translate_icon@2x.png",
+    "translate_icon.imageset/translate_icon@3x.png",
+  ]
+}
+
+imageset("translate_options") {
+  sources = [
+    "translate_options.imageset/Contents.json",
+    "translate_options.imageset/translate_options.png",
+    "translate_options.imageset/translate_options@2x.png",
+    "translate_options.imageset/translate_options@3x.png",
+  ]
+}
+
+imageset("translate_dismiss") {
+  sources = [
+    "translate_dismiss.imageset/Contents.json",
+    "translate_dismiss.imageset/translate_dismiss.png",
+    "translate_dismiss.imageset/translate_dismiss@2x.png",
+    "translate_dismiss.imageset/translate_dismiss@3x.png",
+  ]
+}
diff --git a/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/Contents.json b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/Contents.json
new file mode 100644
index 0000000..8e231ec3
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+    "images": [
+        {
+            "idiom": "universal",
+            "scale": "1x",
+            "filename": "translate_dismiss.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "2x",
+            "filename": "translate_dismiss@2x.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "3x",
+            "filename": "translate_dismiss@3x.png"
+        }
+    ],
+    "info": {
+        "version": 1,
+        "author": "xcode"
+    }
+}
diff --git a/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss.png b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss.png
new file mode 100644
index 0000000..4886f645
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@2x.png b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@2x.png
new file mode 100644
index 0000000..823160e
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@2x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@3x.png b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@3x.png
new file mode 100644
index 0000000..f536916
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_dismiss.imageset/translate_dismiss@3x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/Contents.json b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/Contents.json
new file mode 100644
index 0000000..8637523
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+    "images": [
+        {
+            "idiom": "universal",
+            "scale": "1x",
+            "filename": "translate_icon.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "2x",
+            "filename": "translate_icon@2x.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "3x",
+            "filename": "translate_icon@3x.png"
+        }
+    ],
+    "info": {
+        "version": 1,
+        "author": "xcode"
+    }
+}
diff --git a/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon.png b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon.png
new file mode 100644
index 0000000..11d7a57
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@2x.png b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@2x.png
new file mode 100644
index 0000000..42ad442
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@2x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@3x.png b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@3x.png
new file mode 100644
index 0000000..76bba6c
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_icon.imageset/translate_icon@3x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_options.imageset/Contents.json b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/Contents.json
new file mode 100644
index 0000000..21eb3bc
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+    "images": [
+        {
+            "idiom": "universal",
+            "scale": "1x",
+            "filename": "translate_options.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "2x",
+            "filename": "translate_options@2x.png"
+        },
+        {
+            "idiom": "universal",
+            "scale": "3x",
+            "filename": "translate_options@3x.png"
+        }
+    ],
+    "info": {
+        "version": 1,
+        "author": "xcode"
+    }
+}
diff --git a/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options.png b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options.png
new file mode 100644
index 0000000..1dcf385
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@2x.png b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@2x.png
new file mode 100644
index 0000000..14b39ba
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@2x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@3x.png b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@3x.png
new file mode 100644
index 0000000..4266df7
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/resources/translate_options.imageset/translate_options@3x.png
Binary files differ
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h
new file mode 100644
index 0000000..a68ce288
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h
@@ -0,0 +1,40 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_H_
+
+#import <UIKit/UIKit.h>
+
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.h"
+
+@protocol TranslateInfobarLanguageTabStripViewDelegate;
+
+// A view containing a scrollable tab strip featuring the source and the target
+// language tabs. When a language tab is tapped, it is scrolled into view, if
+// necessary.
+@interface TranslateInfobarLanguageTabStripView : UIView
+
+// Source language name.
+@property(nonatomic, copy) NSString* sourceLanguage;
+
+// Target language name.
+@property(nonatomic, copy) NSString* targetLanguage;
+
+// State of the source language tab.
+@property(nonatomic)
+    TranslateInfobarLanguageTabViewState sourceLanguageTabState;
+
+// State of the target language tab.
+@property(nonatomic)
+    TranslateInfobarLanguageTabViewState targetLanguageTabState;
+
+// Delegate object that gets notified if user taps the source or the target
+// language tabs.
+@property(nonatomic, weak) id<TranslateInfobarLanguageTabStripViewDelegate>
+    delegate;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_H_
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.mm b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.mm
new file mode 100644
index 0000000..a54d6a02
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.mm
@@ -0,0 +1,209 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h"
+
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view_delegate.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_view_delegate.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_view.h"
+#import "ios/chrome/common/ui_util/constraints_ui_util.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+// The point where the gradient on the leading edge of the scroll view stops.
+CGFloat kScrollViewLeadingGradientStop = 0.025;
+
+// The point where the gradient on the trailing edge of the scroll view starts.
+CGFloat kScrollViewTrailingGradientStart = 0.975;
+
+}  // namespace
+
+@interface TranslateInfobarLanguageTabStripView () <
+    TranslateInfobarLanguageTabViewDelegate,
+    UIScrollViewDelegate>
+
+// Scroll view holding the source and the target language tab views.
+@property(nonatomic, weak) UIScrollView* languagesScrollView;
+
+// Used for the fading effect on the edges of the scroll view.
+@property(nonatomic, weak) CAGradientLayer* gradientLayer;
+
+// Source language tab view.
+@property(nonatomic, weak) TranslateInfobarLanguageTabView* sourceLanguageTab;
+
+// Target language tab view.
+@property(nonatomic, weak) TranslateInfobarLanguageTabView* targetLanguageTab;
+
+@end
+
+@implementation TranslateInfobarLanguageTabStripView
+
+#pragma mark - UIView
+
+- (void)willMoveToSuperview:(UIView*)newSuperview {
+  // Create and add subviews the first time this moves to a superview.
+  if (newSuperview && !self.subviews.count) {
+    [self setupSubviews];
+  }
+  [super willMoveToSuperview:newSuperview];
+}
+
+- (void)layoutSubviews {
+  [super layoutSubviews];
+
+  // Scroll the scroll view so that the selected language tab is visible.
+  if (self.sourceLanguageTabState ==
+      TranslateInfobarLanguageTabViewStateSelected) {
+    [self.languagesScrollView scrollRectToVisible:self.sourceLanguageTab.frame
+                                         animated:YES];
+  } else if (self.targetLanguageTabState ==
+             TranslateInfobarLanguageTabViewStateSelected) {
+    [self.languagesScrollView scrollRectToVisible:self.targetLanguageTab.frame
+                                         animated:YES];
+  }
+
+  [self updateLanguageScrollViewGradient];
+}
+
+#pragma mark - Properties
+
+- (void)setSourceLanguage:(NSString*)sourceLanguage {
+  _sourceLanguage = sourceLanguage;
+  self.sourceLanguageTab.title = sourceLanguage;
+
+  [self updateLanguageScrollViewGradient];
+}
+
+- (void)setTargetLanguage:(NSString*)targetLanguage {
+  _targetLanguage = targetLanguage;
+  self.targetLanguageTab.title = targetLanguage;
+
+  [self updateLanguageScrollViewGradient];
+}
+
+- (void)setSourceLanguageTabState:
+    (TranslateInfobarLanguageTabViewState)sourceLanguageTabState {
+  _sourceLanguageTabState = sourceLanguageTabState;
+
+  self.sourceLanguageTab.state = sourceLanguageTabState;
+}
+
+- (void)setTargetLanguageTabState:
+    (TranslateInfobarLanguageTabViewState)targetLanguageTabState {
+  _targetLanguageTabState = targetLanguageTabState;
+
+  self.targetLanguageTab.state = targetLanguageTabState;
+}
+
+#pragma mark - UIScrollViewDelegate
+
+- (void)scrollViewDidScroll:(UIScrollView*)scrollView {
+  [self updateLanguageScrollViewGradient];
+}
+
+#pragma mark - TranslateInfobarLanguageTabViewDelegate
+
+- (void)translateInfobarTabViewDidTap:(TranslateInfobarLanguageTabView*)sender {
+  [self.languagesScrollView scrollRectToVisible:sender.frame animated:YES];
+
+  if (sender == self.targetLanguageTab) {
+    [self.delegate translateInfobarTabStripViewDidTapTargetLangugage:self];
+  } else {
+    [self.delegate translateInfobarTabStripViewDidTapSourceLangugage:self];
+  }
+}
+
+#pragma mark - Private
+
+- (void)setupSubviews {
+  UIScrollView* languagesScrollView = [[UIScrollView alloc] init];
+  self.languagesScrollView = languagesScrollView;
+  self.languagesScrollView.translatesAutoresizingMaskIntoConstraints = NO;
+  self.languagesScrollView.showsVerticalScrollIndicator = NO;
+  self.languagesScrollView.showsHorizontalScrollIndicator = NO;
+  self.languagesScrollView.canCancelContentTouches = YES;
+  self.languagesScrollView.bounces = NO;
+  self.languagesScrollView.delegate = self;
+  [self addSubview:self.languagesScrollView];
+
+  self.gradientLayer = [CAGradientLayer layer];
+  self.gradientLayer.colors =
+      [NSArray arrayWithObjects:(id)[[UIColor clearColor] CGColor],
+                                (id)[[UIColor whiteColor] CGColor],
+                                (id)[[UIColor whiteColor] CGColor],
+                                (id)[[UIColor clearColor] CGColor], nil];
+  // The following two lines make the gradient horizontal.
+  self.gradientLayer.startPoint = CGPointMake(0.0, 0.5);
+  self.gradientLayer.endPoint = CGPointMake(1.0, 0.5);
+  self.languagesScrollView.layer.mask = self.gradientLayer;
+
+  TranslateInfobarLanguageTabView* sourceLanguageTab =
+      [[TranslateInfobarLanguageTabView alloc] init];
+  self.sourceLanguageTab = sourceLanguageTab;
+  self.sourceLanguageTab.translatesAutoresizingMaskIntoConstraints = NO;
+  self.sourceLanguageTab.title = self.sourceLanguage;
+  self.sourceLanguageTab.delegate = self;
+  [self.languagesScrollView addSubview:self.sourceLanguageTab];
+
+  TranslateInfobarLanguageTabView* targetLanguageTab =
+      [[TranslateInfobarLanguageTabView alloc] init];
+  self.targetLanguageTab = targetLanguageTab;
+  self.targetLanguageTab.translatesAutoresizingMaskIntoConstraints = NO;
+  self.targetLanguageTab.title = self.targetLanguage;
+  self.targetLanguageTab.delegate = self;
+  [self.languagesScrollView addSubview:self.targetLanguageTab];
+
+  ApplyVisualConstraintsWithMetrics(
+      @[
+        @"H:|[scrollView]|",
+        @"H:|[sourceLanguage][targetLanguage]|",
+        @"V:|[scrollView(infobarHeight)]|",
+        @"V:|[sourceLanguage(infobarHeight)]|",
+        @"V:|[targetLanguage(infobarHeight)]|",
+      ],
+      @{
+        @"scrollView" : self.languagesScrollView,
+        @"sourceLanguage" : self.sourceLanguageTab,
+        @"targetLanguage" : self.targetLanguageTab,
+      },
+      @{
+        @"infobarHeight" : @(kInfobarHeight),
+      });
+}
+
+// Updates the scroll view's gradient locations based on whether or not the
+// scroll view has content under the leading fold, trailing fold, or both.
+- (void)updateLanguageScrollViewGradient {
+  // Lay out the scroll view's subviews if needed.
+  [self.languagesScrollView layoutIfNeeded];
+
+  CGFloat scrollViewWidth = CGRectGetWidth(self.languagesScrollView.frame);
+  CGFloat contentWidth = self.languagesScrollView.contentSize.width;
+  CGFloat scrollOffset = self.languagesScrollView.contentOffset.x;
+  BOOL hasContentUnderLeadingFold = (scrollOffset > 0);
+  BOOL hasContentUnderTrailingFold =
+      (scrollOffset + scrollViewWidth < contentWidth);
+  self.gradientLayer.locations = @[
+    @0, hasContentUnderLeadingFold ? @(kScrollViewLeadingGradientStop) : @0,
+    hasContentUnderTrailingFold ? @(kScrollViewTrailingGradientStart) : @1, @1
+  ];
+
+  // Disable animation; or updating the gradient's frame will be animated.
+  [CATransaction begin];
+  [CATransaction setDisableActions:YES];
+
+  // Update the gradient's frame.
+  self.gradientLayer.frame = CGRectMake(
+      scrollOffset, 0, CGRectGetWidth(self.languagesScrollView.bounds),
+      CGRectGetHeight(self.languagesScrollView.bounds));
+
+  // Reenable animation.
+  [CATransaction commit];
+}
+
+@end
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view_delegate.h b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view_delegate.h
new file mode 100644
index 0000000..36212041
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view_delegate.h
@@ -0,0 +1,23 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_DELEGATE_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_DELEGATE_H_
+
+#import <Foundation/Foundation.h>
+
+// A protocol implemented by a delegate of TranslateInfobarLanguageTabStripView.
+@protocol TranslateInfobarLanguageTabStripViewDelegate
+
+// Notifies the delegate that user tapped the source language tab.
+- (void)translateInfobarTabStripViewDidTapSourceLangugage:
+    (TranslateInfobarLanguageTabStripView*)sender;
+
+// Notifies the delegate that user tapped the target language tab.
+- (void)translateInfobarTabStripViewDidTapTargetLangugage:
+    (TranslateInfobarLanguageTabStripView*)sender;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_STRIP_VIEW_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.h b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.h
new file mode 100644
index 0000000..6d2c7c6d
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.h
@@ -0,0 +1,35 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_H_
+
+#import <UIKit/UIKit.h>
+
+// States in which the language tab can be.
+typedef NS_ENUM(NSInteger, TranslateInfobarLanguageTabViewState) {
+  TranslateInfobarLanguageTabViewStateDefault,
+  TranslateInfobarLanguageTabViewStateSelected,
+  TranslateInfobarLanguageTabViewStateLoading,
+};
+
+@protocol TranslateInfobarLanguageTabViewDelegate;
+
+// The language tab view featuring a label. It can be in a default, selected, or
+// loading state. In the selected state the label is highlighted and in the
+// loading state the label is replaced by an activity indicator.
+@interface TranslateInfobarLanguageTabView : UIView
+
+// Title of the language tab.
+@property(nonatomic, copy) NSString* title;
+
+// State of the language tab.
+@property(nonatomic) TranslateInfobarLanguageTabViewState state;
+
+// Delegate object that gets notified if user taps the view.
+@property(nonatomic, weak) id<TranslateInfobarLanguageTabViewDelegate> delegate;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_H_
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.mm b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.mm
new file mode 100644
index 0000000..c67aff5
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.mm
@@ -0,0 +1,142 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_view.h"
+
+#include "base/logging.h"
+#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_view_delegate.h"
+#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
+#import "ios/chrome/common/ui_util/constraints_ui_util.h"
+#import "ios/third_party/material_components_ios/src/components/ActivityIndicator/src/MaterialActivityIndicator.h"
+#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
+#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+// Size of the activity indicator.
+const CGFloat kActivityIndicatorSize = 24;
+
+// Radius of the activity indicator.
+const CGFloat kActivityIndicatorRadius = 10;
+
+// Duration of the animation to make the activity indicator visible.
+const NSTimeInterval kActivityIndicatorVisbilityAnimationDuration = 0.4;
+
+// Title color of the action buttons in RGB.
+const int kButtonTitleColor = 0x4285f4;
+
+// Padding for contents of the button.
+const CGFloat kButtonPadding = 12;
+
+}  // namespace
+
+@interface TranslateInfobarLanguageTabView ()
+
+// Button subview providing the tappable area.
+@property(nonatomic, weak) MDCFlatButton* button;
+
+// Activity indicator replacing the button when in loading state.
+@property(nonatomic, weak) MDCActivityIndicator* activityIndicator;
+
+@end
+
+@implementation TranslateInfobarLanguageTabView
+
+#pragma mark - UIView
+
+- (void)willMoveToSuperview:(UIView*)newSuperview {
+  // Create and add subviews the first time this moves to a superview.
+  if (newSuperview && !self.subviews.count) {
+    [self setupSubviews];
+  }
+  [super willMoveToSuperview:newSuperview];
+}
+
+#pragma mark - Properties
+
+- (void)setTitle:(NSString*)title {
+  _title = title;
+  [self.button setTitle:title forState:UIControlStateNormal];
+}
+
+- (void)setState:(TranslateInfobarLanguageTabViewState)state {
+  _state = state;
+
+  if (state == TranslateInfobarLanguageTabViewStateLoading) {
+    [self.activityIndicator startAnimating];
+    // Animate showing the activity indicator and hiding the button. Otherwise
+    // the ripple effect on the button won't be seen.
+    [UIView animateWithDuration:kActivityIndicatorVisbilityAnimationDuration
+                     animations:^{
+                       self.activityIndicator.hidden = NO;
+                       self.button.hidden = YES;
+                     }];
+  } else {
+    self.button.hidden = NO;
+    self.activityIndicator.hidden = YES;
+    [self.activityIndicator stopAnimating];
+
+    [self.button setTitleColor:[self titleColor] forState:UIControlStateNormal];
+  }
+}
+
+#pragma mark - Private
+
+- (void)setupSubviews {
+  MDCActivityIndicator* activityIndicator = [[MDCActivityIndicator alloc] init];
+  self.activityIndicator = activityIndicator;
+  self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
+  self.activityIndicator.cycleColors =
+      @[ [[MDCPalette cr_bluePalette] tint500] ];
+  [self.activityIndicator setRadius:kActivityIndicatorRadius];
+  self.activityIndicator.hidden = YES;  // Initially hidden.
+  [self addSubview:self.activityIndicator];
+
+  [NSLayoutConstraint activateConstraints:@[
+    [self.activityIndicator.heightAnchor
+        constraintEqualToConstant:kActivityIndicatorSize],
+  ]];
+  AddSameCenterConstraints(self, self.activityIndicator);
+
+  MDCFlatButton* button = [[MDCFlatButton alloc] init];
+  self.button = button;
+  self.button.translatesAutoresizingMaskIntoConstraints = NO;
+  [self.button setUnderlyingColorHint:[UIColor blackColor]];
+  self.button.contentEdgeInsets = UIEdgeInsetsMake(
+      kButtonPadding, kButtonPadding, kButtonPadding, kButtonPadding);
+  self.button.titleLabel.adjustsFontSizeToFitWidth = YES;
+  self.button.titleLabel.minimumScaleFactor = 0.6f;
+  [self.button setTitle:self.title forState:UIControlStateNormal];
+  self.button.uppercaseTitle = NO;
+  [self.button
+      setTitleFont:[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]
+          forState:UIControlStateNormal];
+  [self.button setTitleColor:[self titleColor] forState:UIControlStateNormal];
+  self.button.inkColor = [[MDCPalette greyPalette] tint300];
+  [self.button addTarget:self
+                  action:@selector(buttonWasTapped)
+        forControlEvents:UIControlEventTouchUpInside];
+  [self addSubview:self.button];
+
+  AddSameConstraints(self, self.button);
+}
+
+// Returns the button's title color depending on the state.
+- (UIColor*)titleColor {
+  return self.state == TranslateInfobarLanguageTabViewStateSelected
+             ? UIColorFromRGB(kButtonTitleColor)
+             : [[MDCPalette greyPalette] tint600];
+}
+
+- (void)buttonWasTapped {
+  [self.delegate translateInfobarTabViewDidTap:self];
+}
+
+@end
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view_delegate.h b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view_delegate.h
new file mode 100644
index 0000000..a1b6cb8
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_language_tab_view_delegate.h
@@ -0,0 +1,18 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_DELEGATE_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_DELEGATE_H_
+
+#import <Foundation/Foundation.h>
+
+// A protocol implemented by a delegate of TranslateInfobarLanguageTabView.
+@protocol TranslateInfobarLanguageTabViewDelegate
+
+// Notifies the delegate that user tapped the view.
+- (void)translateInfobarTabViewDidTap:(TranslateInfobarLanguageTabView*)sender;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_LANGUAGE_TAB_VIEW_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_view.h b/ios/chrome/browser/ui/translate/translate_infobar_view.h
new file mode 100644
index 0000000..95945f6
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_view.h
@@ -0,0 +1,50 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_VIEW_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_VIEW_H_
+
+#import <UIKit/UIKit.h>
+
+#include <vector>
+
+// States in which the infobar can be.
+typedef NS_ENUM(NSInteger, TranslateInfobarViewState) {
+  TranslateInfobarViewStateBeforeTranslate,
+  TranslateInfobarViewStateTranslating,
+  TranslateInfobarViewStateAfterTranslate,
+};
+
+// Height of the infobar.
+extern const CGFloat kInfobarHeight;
+
+@protocol TranslateInfobarViewDelegate;
+
+// An infobar for translating the page. Starting from the leading edge, it
+// features an icon followed by the source and the target languages. Toggling
+// between the languages results in the page to be translated or the translation
+// to be reverted. At the trailing edge, the infobar features an options button
+// that opens a popup menu that allows changing translate preferences followed
+// by a dismiss button to close the infobar.
+@interface TranslateInfobarView : UIView
+
+// Source language name.
+@property(nonatomic, copy) NSString* sourceLanguage;
+
+// Target language name.
+@property(nonatomic, copy) NSString* targetLanguage;
+
+// Infobar's state.
+@property(nonatomic) TranslateInfobarViewState state;
+
+// Delegate object that gets notified if user taps the source language tab, the
+// target language tab, the options button, or the dismiss button.
+@property(nonatomic, weak) id<TranslateInfobarViewDelegate> delegate;
+
+// Updates the infobar UI when a popup menu is displayed or dismissed.
+- (void)updateUIForPopUpMenuDisplayed:(BOOL)displayed;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_VIEW_H_
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_view.mm b/ios/chrome/browser/ui/translate/translate_infobar_view.mm
new file mode 100644
index 0000000..5e4f958
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_view.mm
@@ -0,0 +1,291 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/translate/translate_infobar_view.h"
+
+#include "base/logging.h"
+#include "components/strings/grit/components_strings.h"
+#import "ios/chrome/browser/procedural_block_types.h"
+#import "ios/chrome/browser/ui/infobars/infobar_constants.h"
+#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button.h"
+#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_language_tab_strip_view_delegate.h"
+#import "ios/chrome/browser/ui/translate/translate_infobar_view_delegate.h"
+#import "ios/chrome/browser/ui/util/label_link_controller.h"
+#import "ios/chrome/browser/ui/util/layout_guide_names.h"
+#import "ios/chrome/browser/ui/util/named_guide.h"
+#include "ios/chrome/browser/ui/util/ui_util.h"
+#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
+#import "ios/chrome/common/ui_util/constraints_ui_util.h"
+#include "ui/base/l10n/l10n_util.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+const CGFloat kInfobarHeight = 54;
+
+namespace {
+
+// Size of the infobar buttons.
+const CGFloat kButtonSize = 44;
+
+// Size of the infobar icons.
+const CGFloat kIconSize = 24;
+
+// Leading margin for the translate icon.
+const CGFloat kIconLeadingMargin = 16;
+
+// Trailing margin for the translate icon.
+const CGFloat kIconTrailingMargin = 12;
+
+}  // namespace
+
+@interface TranslateInfobarView () <
+    TranslateInfobarLanguageTabStripViewDelegate>
+
+// Translate icon view.
+@property(nonatomic, weak) UIImageView* iconView;
+
+// Scrollable tab strip holding the source and the target language tabs.
+@property(nonatomic, weak) TranslateInfobarLanguageTabStripView* languagesView;
+
+// Options button. Presents the options popup menu when tapped.
+@property(nonatomic, weak) ToolbarButton* optionsButton;
+
+// Dismiss button.
+@property(nonatomic, weak) ToolbarButton* dismissButton;
+
+// Toolbar configuration object used for |optionsButton| and |dismissButton|.
+@property(nonatomic, strong) ToolbarConfiguration* toolbarConfiguration;
+
+// Constraint used to add bottom margin to the view.
+@property(nonatomic, weak) NSLayoutConstraint* bottomAnchorConstraint;
+
+@end
+
+@implementation TranslateInfobarView
+
+#pragma mark - UIView
+
+- (void)willMoveToSuperview:(UIView*)newSuperview {
+  // Create and add subviews the first time this moves to a superview.
+  if (newSuperview && !self.subviews.count) {
+    [self setupSubviews];
+    // Lower constraint's priority to avoid breaking other constraints while
+    // |newSuperview| is animating.
+    // TODO(crbug.com/904521): Investigate why this is needed.
+    self.bottomAnchorConstraint.priority = UILayoutPriorityDefaultLow;
+  }
+  [super willMoveToSuperview:newSuperview];
+}
+
+- (void)didMoveToSuperview {
+  [super didMoveToSuperview];
+  if (!self.superview)
+    return;
+
+  self.state = TranslateInfobarViewStateBeforeTranslate;
+
+  [NamedGuide guideWithName:kTranslateInfobarOptionsGuide
+                       view:self.optionsButton]
+      .constrainedView = self.optionsButton;
+
+  // Increase constraint's priority after the view was added to its superview.
+  // TODO(crbug.com/904521): Investigate why this is needed.
+  self.bottomAnchorConstraint.priority = UILayoutPriorityDefaultHigh;
+}
+
+- (CGSize)sizeThatFits:(CGSize)size {
+  // Calculate the safe area and current Toolbar height. Set the
+  // bottomAnchorConstraint constant to this height to create the bottom
+  // padding.
+  CGFloat bottomSafeAreaInset = self.safeAreaInsets.bottom;
+  CGFloat toolbarHeight = 0;
+  UILayoutGuide* guide = [NamedGuide guideWithName:kSecondaryToolbarGuide
+                                              view:self];
+  UILayoutGuide* guideNoFullscreen =
+      [NamedGuide guideWithName:kSecondaryToolbarNoFullscreenGuide view:self];
+  if (guide && guideNoFullscreen) {
+    CGFloat toolbarHeightCurrent = guide.layoutFrame.size.height;
+    CGFloat toolbarHeightMax = guideNoFullscreen.layoutFrame.size.height;
+    if (toolbarHeightMax > 0) {
+      CGFloat fullscreenProgress = toolbarHeightCurrent / toolbarHeightMax;
+      CGFloat toolbarHeightInSafeArea = toolbarHeightMax - bottomSafeAreaInset;
+      toolbarHeight += fullscreenProgress * toolbarHeightInSafeArea;
+    }
+  }
+  self.bottomAnchorConstraint.constant = toolbarHeight + bottomSafeAreaInset;
+
+  // Now that the constraint constant has been set calculate the fitting size.
+  CGSize computedSize = [self systemLayoutSizeFittingSize:size];
+  return CGSizeMake(size.width, computedSize.height);
+}
+
+#pragma mark - Properties
+
+- (void)setSourceLanguage:(NSString*)sourceLanguage {
+  _sourceLanguage = sourceLanguage;
+  self.languagesView.sourceLanguage = sourceLanguage;
+}
+
+- (void)setTargetLanguage:(NSString*)targetLanguage {
+  _targetLanguage = targetLanguage;
+  self.languagesView.targetLanguage = targetLanguage;
+}
+
+- (void)setState:(TranslateInfobarViewState)state {
+  _state = state;
+  switch (state) {
+    case TranslateInfobarViewStateBeforeTranslate:
+      self.languagesView.sourceLanguageTabState =
+          TranslateInfobarLanguageTabViewStateSelected;
+      self.languagesView.targetLanguageTabState =
+          TranslateInfobarLanguageTabViewStateDefault;
+      break;
+    case TranslateInfobarViewStateTranslating:
+      self.languagesView.sourceLanguageTabState =
+          TranslateInfobarLanguageTabViewStateDefault;
+      self.languagesView.targetLanguageTabState =
+          TranslateInfobarLanguageTabViewStateLoading;
+      break;
+    case TranslateInfobarViewStateAfterTranslate:
+      self.languagesView.sourceLanguageTabState =
+          TranslateInfobarLanguageTabViewStateDefault;
+      self.languagesView.targetLanguageTabState =
+          TranslateInfobarLanguageTabViewStateSelected;
+      break;
+  }
+}
+
+#pragma mark - Public
+
+- (void)updateUIForPopUpMenuDisplayed:(BOOL)displayed {
+  self.optionsButton.spotlighted = displayed;
+  self.optionsButton.dimmed = displayed;
+  self.dismissButton.dimmed = displayed;
+}
+
+#pragma mark - TranslateInfobarLanguageTabStripViewDelegate
+
+- (void)translateInfobarTabStripViewDidTapSourceLangugage:
+    (TranslateInfobarLanguageTabStripView*)sender {
+  [self.delegate translateInfobarViewDidTapSourceLangugage:self];
+}
+
+- (void)translateInfobarTabStripViewDidTapTargetLangugage:
+    (TranslateInfobarLanguageTabStripView*)sender {
+  [self.delegate translateInfobarViewDidTapTargetLangugage:self];
+}
+
+#pragma mark - Private
+
+- (void)setupSubviews {
+  [self setAccessibilityViewIsModal:YES];
+  if (IsUIRefreshPhase1Enabled()) {
+    self.backgroundColor = UIColorFromRGB(kInfobarBackgroundColor);
+  } else {
+    self.backgroundColor = [UIColor whiteColor];
+  }
+  id<LayoutGuideProvider> safeAreaLayoutGuide = self.safeAreaLayoutGuide;
+
+  // The Content view. Holds all the other subviews.
+  UIView* contentView = [[UIView alloc] init];
+  contentView.translatesAutoresizingMaskIntoConstraints = NO;
+  [self addSubview:contentView];
+  self.bottomAnchorConstraint =
+      [self.bottomAnchor constraintEqualToAnchor:contentView.bottomAnchor];
+  [NSLayoutConstraint activateConstraints:@[
+    [safeAreaLayoutGuide.leadingAnchor
+        constraintEqualToAnchor:contentView.leadingAnchor],
+    [safeAreaLayoutGuide.trailingAnchor
+        constraintEqualToAnchor:contentView.trailingAnchor],
+    [self.topAnchor constraintEqualToAnchor:contentView.topAnchor],
+    self.bottomAnchorConstraint
+  ]];
+
+  UIImage* icon = [[UIImage imageNamed:@"translate_icon"]
+      resizableImageWithCapInsets:UIEdgeInsetsZero
+                     resizingMode:UIImageResizingModeStretch];
+  UIImageView* iconView = [[UIImageView alloc] initWithImage:icon];
+  self.iconView = iconView;
+  self.iconView.translatesAutoresizingMaskIntoConstraints = NO;
+  [contentView addSubview:self.iconView];
+
+  TranslateInfobarLanguageTabStripView* languagesView =
+      [[TranslateInfobarLanguageTabStripView alloc] init];
+  self.languagesView = languagesView;
+  self.languagesView.translatesAutoresizingMaskIntoConstraints = NO;
+  self.languagesView.sourceLanguage = self.sourceLanguage;
+  self.languagesView.targetLanguage = self.targetLanguage;
+  self.languagesView.delegate = self;
+  [contentView addSubview:self.languagesView];
+
+  self.toolbarConfiguration =
+      [[ToolbarConfiguration alloc] initWithStyle:NORMAL];
+
+  self.optionsButton =
+      [self toolbarButtonWithImageNamed:@"translate_options"
+                                 target:self
+                                 action:@selector(showOptions)];
+  [contentView addSubview:self.optionsButton];
+
+  self.dismissButton =
+      [self toolbarButtonWithImageNamed:@"translate_dismiss"
+                                 target:self
+                                 action:@selector(dismiss)];
+  [contentView addSubview:self.dismissButton];
+
+  ApplyVisualConstraintsWithMetrics(
+      @[
+        @"H:|-(iconLeadingMargin)-[icon(iconSize)]-(iconTrailingMargin)-[languages][options(buttonSize)][dismiss(buttonSize)]|",
+        @"V:|[languages(infobarHeight)]|",
+        @"V:[icon(iconSize)]",
+        @"V:[options(buttonSize)]",
+        @"V:[dismiss(buttonSize)]",
+      ],
+      @{
+        @"icon" : self.iconView,
+        @"languages" : self.languagesView,
+        @"options" : self.optionsButton,
+        @"dismiss" : self.dismissButton,
+      },
+      @{
+        @"iconSize" : @(kIconSize),
+        @"iconLeadingMargin" : @(kIconLeadingMargin),
+        @"iconTrailingMargin" : @(kIconTrailingMargin),
+        @"infobarHeight" : @(kInfobarHeight),
+        @"buttonSize" : @(kButtonSize),
+      });
+  AddSameCenterYConstraint(contentView, self.iconView);
+  AddSameCenterYConstraint(contentView, self.optionsButton);
+  AddSameCenterYConstraint(contentView, self.dismissButton);
+}
+
+- (ToolbarButton*)toolbarButtonWithImageNamed:(NSString*)name
+                                       target:(id)target
+                                       action:(SEL)action {
+  UIImage* image = [[UIImage imageNamed:name]
+      imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
+  ToolbarButton* button = [ToolbarButton toolbarButtonWithImage:image];
+  [button addTarget:target
+                action:action
+      forControlEvents:UIControlEventTouchUpInside];
+  const CGFloat kButtonPadding = (kButtonSize - kIconSize) / 2;
+  button.contentEdgeInsets = UIEdgeInsetsMake(kButtonPadding, kButtonPadding,
+                                              kButtonPadding, kButtonPadding);
+  button.configuration = self.toolbarConfiguration;
+  return button;
+}
+
+- (void)showOptions {
+  [self.delegate translateInfobarViewDidTapOptions:self];
+}
+
+- (void)dismiss {
+  [self.delegate translateInfobarViewDidTapDismiss:self];
+}
+
+@end
diff --git a/ios/chrome/browser/ui/translate/translate_infobar_view_delegate.h b/ios/chrome/browser/ui/translate/translate_infobar_view_delegate.h
new file mode 100644
index 0000000..604e67c
--- /dev/null
+++ b/ios/chrome/browser/ui/translate/translate_infobar_view_delegate.h
@@ -0,0 +1,27 @@
+// Copyright 2019 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_TRANSLATE_TRANSLATE_INFOBAR_VIEW_DELEGATE_H_
+#define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_VIEW_DELEGATE_H_
+
+#import <Foundation/Foundation.h>
+
+// A protocol implemented by a delegate of TranslateInfobarView.
+@protocol TranslateInfobarViewDelegate
+
+// Notifies the delegate that user tapped the source language button.
+- (void)translateInfobarViewDidTapSourceLangugage:(TranslateInfobarView*)sender;
+
+// Notifies the delegate that user tapped the target language button.
+- (void)translateInfobarViewDidTapTargetLangugage:(TranslateInfobarView*)sender;
+
+// Notifies the delegate that user tapped the options button.
+- (void)translateInfobarViewDidTapOptions:(TranslateInfobarView*)sender;
+
+// Notifies the delegate that user tapped the dismiss button.
+- (void)translateInfobarViewDidTapDismiss:(TranslateInfobarView*)sender;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_INFOBAR_VIEW_DELEGATE_H_
diff --git a/ios/chrome/test/app/sync_test_util.mm b/ios/chrome/test/app/sync_test_util.mm
index 1a62477..4e0272bd 100644
--- a/ios/chrome/test/app/sync_test_util.mm
+++ b/ios/chrome/test/app/sync_test_util.mm
@@ -17,6 +17,7 @@
 #include "components/browser_sync/profile_sync_service.h"
 #include "components/history/core/browser/history_service.h"
 #include "components/keyed_service/core/service_access_type.h"
+#include "components/sync/device_info/device_info_sync_service.h"
 #include "components/sync/device_info/local_device_info_provider.h"
 #include "components/sync/driver/sync_service.h"
 #include "components/sync/engine/net/http_bridge_network_resources.h"
@@ -28,6 +29,7 @@
 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
 #include "ios/chrome/browser/history/history_service_factory.h"
+#include "ios/chrome/browser/sync/device_info_sync_service_factory.h"
 #include "ios/chrome/browser/sync/profile_sync_service_factory.h"
 #include "ios/chrome/browser/sync/sync_setup_service.h"
 #include "ios/chrome/browser/sync/sync_setup_service_factory.h"
@@ -162,11 +164,10 @@
   DCHECK(IsSyncInitialized());
   ios::ChromeBrowserState* browser_state =
       chrome_test_util::GetOriginalBrowserState();
-  browser_sync::ProfileSyncService* sync_service =
-      ProfileSyncServiceFactory::GetAsProfileSyncServiceForBrowserState(
-          browser_state);
+  syncer::DeviceInfoSyncService* service =
+      DeviceInfoSyncServiceFactory::GetForBrowserState(browser_state);
   const syncer::LocalDeviceInfoProvider* info_provider =
-      sync_service->GetLocalDeviceInfoProvider();
+      service->GetLocalDeviceInfoProvider();
   return info_provider->GetLocalSyncCacheGUID();
 }
 
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h
index 432d3e44..1c4414fee 100644
--- a/media/base/mock_filters.h
+++ b/media/base/mock_filters.h
@@ -63,6 +63,7 @@
   MOCK_METHOD0(OnVideoAverageKeyframeDistanceUpdate, void());
   MOCK_METHOD1(OnAudioDecoderChange, void(const std::string&));
   MOCK_METHOD1(OnVideoDecoderChange, void(const std::string&));
+  MOCK_METHOD1(OnRemotePlayStateChange, void(MediaStatus::State state));
 };
 
 class MockPipeline : public Pipeline {
diff --git a/media/base/pipeline.h b/media/base/pipeline.h
index 7444ceb8..7b96cb2 100644
--- a/media/base/pipeline.h
+++ b/media/base/pipeline.h
@@ -13,6 +13,7 @@
 #include "media/base/buffering_state.h"
 #include "media/base/cdm_context.h"
 #include "media/base/media_export.h"
+#include "media/base/media_status.h"
 #include "media/base/media_track.h"
 #include "media/base/pipeline_metadata.h"
 #include "media/base/pipeline_status.h"
@@ -79,6 +80,12 @@
     // during playback.
     virtual void OnAudioDecoderChange(const std::string& name) = 0;
     virtual void OnVideoDecoderChange(const std::string& name) = 0;
+
+    // Executed whenever an important status change has happened, and that this
+    // change was not initiated by Pipeline or Pipeline::Client.
+    // Only used with FlingingRenderer, when an external device pauses/resumes
+    // a video that is playing remotely.
+    virtual void OnRemotePlayStateChange(MediaStatus::State state) = 0;
   };
 
   virtual ~Pipeline() {}
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 15c0c23..e3a45af 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -772,7 +772,9 @@
     MediaStatus::State state) {
   DCHECK(media_task_runner_->BelongsToCurrentThread());
 
-  // TODO(tguilbert): post change to Pipeline
+  main_task_runner_->PostTask(
+      FROM_HERE, base::BindOnce(&PipelineImpl::OnRemotePlayStateChange,
+                                weak_pipeline_, state));
 }
 
 void PipelineImpl::RendererWrapper::OnPipelineError(PipelineStatus error) {
@@ -1406,6 +1408,15 @@
   client_->OnVideoDecoderChange(name);
 }
 
+void PipelineImpl::OnRemotePlayStateChange(MediaStatus::State state) {
+  DVLOG(2) << __func__;
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(IsRunning());
+
+  DCHECK(client_);
+  client_->OnRemotePlayStateChange(state);
+}
+
 void PipelineImpl::OnSeekDone(bool is_suspended) {
   DVLOG(3) << __func__;
   DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index 85dc542..f1240bb 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -146,6 +146,7 @@
   void OnVideoAverageKeyframeDistanceUpdate();
   void OnAudioDecoderChange(const std::string& name);
   void OnVideoDecoderChange(const std::string& name);
+  void OnRemotePlayStateChange(MediaStatus::State state);
 
   // Task completion callbacks from RendererWrapper.
   void OnSeekDone(bool is_suspended);
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 361aa3c..e5a9e2fe 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -2223,6 +2223,10 @@
   UpdateSecondaryProperties();
 }
 
+void WebMediaPlayerImpl::OnRemotePlayStateChange(MediaStatus::State state) {
+  // TODO(tguilbert): request play/pause appropriately.
+}
+
 void WebMediaPlayerImpl::OnFrameHidden() {
   DCHECK(main_task_runner_->BelongsToCurrentThread());
 
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 67ddd50..149de13c 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -353,6 +353,7 @@
   void OnVideoAverageKeyframeDistanceUpdate() override;
   void OnAudioDecoderChange(const std::string& name) override;
   void OnVideoDecoderChange(const std::string& name) override;
+  void OnRemotePlayStateChange(MediaStatus::State state) override;
 
   // Actually seek. Avoids causing |should_notify_time_changed_| to be set when
   // |time_updated| is false.
diff --git a/media/filters/pipeline_controller_unittest.cc b/media/filters/pipeline_controller_unittest.cc
index 1ce0adb..bbf3e237 100644
--- a/media/filters/pipeline_controller_unittest.cc
+++ b/media/filters/pipeline_controller_unittest.cc
@@ -155,6 +155,7 @@
   void OnVideoAverageKeyframeDistanceUpdate() override {}
   void OnAudioDecoderChange(const std::string& name) override {}
   void OnVideoDecoderChange(const std::string& name) override {}
+  void OnRemotePlayStateChange(MediaStatus::State state) override {}
 
   base::MessageLoop message_loop_;
 
diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
index 5853d190..9d7842d 100644
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -74,8 +74,8 @@
 }
 #endif
 
-// Returns true if the CPU is an Intel Kaby Lake or later.
-// cpu platform id's are referenced from the following file in kernel source
+// Returns true if the CPU is an Intel Kaby/Gemini/Sky Lake or later.
+// Cpu platform id's are referenced from the following file in kernel source
 // arch/x86/include/asm/intel-family.h
 bool IsKabyLakeOrLater() {
   constexpr int kPentiumAndLaterFamily = 0x06;
@@ -86,7 +86,6 @@
       cpuid.model() >= kFirstKabyLakeModelId;
   return is_kaby_lake_or_later;
 }
-
 bool IsGeminiLakeOrLater() {
   constexpr int kPentiumAndLaterFamily = 0x06;
   constexpr int kGeminiLakeModelId = 0x7A;
@@ -96,8 +95,16 @@
       cpuid.model() >= kGeminiLakeModelId;
   return is_geminilake_or_later;
 }
+bool IsSkyLakeOrLater() {
+  constexpr int kPentiumAndLaterFamily = 0x06;
+  constexpr int kFirstSkyLakeModelId = 0x4E;
+  static base::CPU cpuid;
+  static bool is_sky_lake_or_later = cpuid.family() == kPentiumAndLaterFamily &&
+                                     cpuid.model() >= kFirstSkyLakeModelId;
+  return is_sky_lake_or_later;
+}
 
-// Decides if the current platform and profile may decode using the client's
+// Decides if the current platform and |profile| may decode using the client's
 // PictureBuffers, or engage the Vpp to adapt VaApi's and the client's format.
 bool ShouldDecodeOnclientPictureBuffers(
     VideoDecodeAccelerator::Config::OutputMode output_mode,
@@ -107,6 +114,14 @@
          profile == VP9PROFILE_PROFILE0;
 }
 
+// Decides if the current platform and |output_mode| may used a reduced number
+// of buffer allocations. See https://crbug.com/920510 for more information.
+bool ShouldUseReducedNumberOfAllocations(
+    VideoDecodeAccelerator::Config::OutputMode output_mode) {
+  return output_mode == VideoDecodeAccelerator::Config::OutputMode::ALLOCATE &&
+         IsSkyLakeOrLater();
+}
+
 }  // namespace
 
 #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \
@@ -256,7 +271,7 @@
       ShouldDecodeOnclientPictureBuffers(output_mode_, profile_);
   use_reduced_number_of_allocations_ =
       !decode_using_client_picture_buffers_ &&
-      output_mode_ == Config::OutputMode::ALLOCATE;
+      ShouldUseReducedNumberOfAllocations(output_mode_);
   previously_requested_num_reference_frames_ = 0;
   return true;
 }
diff --git a/media/test/pipeline_integration_test_base.h b/media/test/pipeline_integration_test_base.h
index c9a314d..af5e34e5 100644
--- a/media/test/pipeline_integration_test_base.h
+++ b/media/test/pipeline_integration_test_base.h
@@ -239,6 +239,7 @@
   MOCK_METHOD0(OnVideoAverageKeyframeDistanceUpdate, void());
   MOCK_METHOD1(OnAudioDecoderChange, void(const std::string&));
   MOCK_METHOD1(OnVideoDecoderChange, void(const std::string&));
+  MOCK_METHOD1(OnRemotePlayStateChange, void(MediaStatus::State state));
 
  private:
   // Runs |run_loop| until it is explicitly Quit() by some part of the calling
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
index 480cca9..379d5813 100644
--- a/mojo/public/cpp/bindings/BUILD.gn
+++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -39,6 +39,8 @@
     "disconnect_reason.h",
     "enum_traits.h",
     "equals_traits.h",
+    "features.cc",
+    "features.h",
     "interface_data_view.h",
     "interface_id.h",
     "lib/array_internal.cc",
diff --git a/mojo/public/cpp/bindings/connector.h b/mojo/public/cpp/bindings/connector.h
index 4ff33e7..b05b747 100644
--- a/mojo/public/cpp/bindings/connector.h
+++ b/mojo/public/cpp/bindings/connector.h
@@ -270,10 +270,7 @@
   bool paused_ = false;
 
   // See |set_force_immediate_dispatch()|.
-  //
-  // TODO(https://866708): Temporarily reverted to batch dispatch mode until M73
-  // branch. Flip this back to |false| after branch.
-  bool force_immediate_dispatch_ = true;
+  bool force_immediate_dispatch_;
 
   // Messages which have been read off the pipe but not yet dispatched. This
   // exists so that we can schedule individual dispatch tasks for each read
diff --git a/mojo/public/cpp/bindings/features.cc b/mojo/public/cpp/bindings/features.cc
new file mode 100644
index 0000000..36c00d99
--- /dev/null
+++ b/mojo/public/cpp/bindings/features.cc
@@ -0,0 +1,28 @@
+// Copyright 2019 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 "mojo/public/cpp/bindings/features.h"
+
+namespace mojo {
+namespace features {
+
+// Enables a task to be scheduled for each individual message dispatched to a
+// Mojo binding endpoint (or reply to an InterfacePtr).
+//
+// When disabled, dispatch happens eagerly in batch, so when a binding is
+// scheduled to dispatch messages, it fully flushes and dispatches all queued
+// messages within the extent of a single scheduler task.
+//
+// Enabling this feature allows for more fine-grained performance control
+// through the scheduler, but may initially cause some important edge cases to
+// regress in performance due to high-priority messages seeing increased
+// latency. Ideally we'd address these cases by giving the affected bindings
+// higher-priority TaskRunners.
+//
+// TODO(https://crbug.com/866708): Enable this by default after M73 branch.
+const base::Feature kTaskPerMessage{"MojoTaskPerMessage",
+                                    base::FEATURE_DISABLED_BY_DEFAULT};
+
+}  // namespace features
+}  // namespace mojo
diff --git a/mojo/public/cpp/bindings/features.h b/mojo/public/cpp/bindings/features.h
new file mode 100644
index 0000000..5d58f0d7
--- /dev/null
+++ b/mojo/public/cpp/bindings/features.h
@@ -0,0 +1,20 @@
+// Copyright 2019 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 MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_
+
+#include "base/component_export.h"
+#include "base/feature_list.h"
+
+namespace mojo {
+namespace features {
+
+COMPONENT_EXPORT(MOJO_CPP_BINDINGS_BASE)
+extern const base::Feature kTaskPerMessage;
+
+}  // namespace features
+}  // namespace mojo
+
+#endif  // MOJO_PUBLIC_CPP_BINDINGS_FEATURES_H_
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index 543eee2..641e3c4 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -17,6 +17,7 @@
 #include "base/synchronization/lock.h"
 #include "base/threading/sequence_local_storage_slot.h"
 #include "base/trace_event/trace_event.h"
+#include "mojo/public/cpp/bindings/features.h"
 #include "mojo/public/cpp/bindings/lib/may_auto_lock.h"
 #include "mojo/public/cpp/bindings/mojo_buildflags.h"
 #include "mojo/public/cpp/bindings/sync_handle_watcher.h"
@@ -45,6 +46,16 @@
 Connector::IncomingSerializationMode g_default_incoming_serialization_mode =
     Connector::IncomingSerializationMode::kDispatchAsIs;
 
+bool EnableTaskPerMessage() {
+  // Const since this may be called from any thread. Initialization is
+  // thread-safe. This is a workaround since some consumers of Mojo (e.g. many
+  // browser tests) use base::FeatureList incorrectly and thus cause data races
+  // when features are queried from arbitrary threads.
+  static const bool enable =
+      base::FeatureList::IsEnabled(features::kTaskPerMessage);
+  return enable;
+}
+
 }  // namespace
 
 // Used to efficiently maintain a doubly-linked list of all Connectors
@@ -146,6 +157,7 @@
     : message_pipe_(std::move(message_pipe)),
       task_runner_(std::move(runner)),
       error_(false),
+      force_immediate_dispatch_(!EnableTaskPerMessage()),
       outgoing_serialization_mode_(g_default_outgoing_serialization_mode),
       incoming_serialization_mode_(g_default_incoming_serialization_mode),
       nesting_observer_(RunLoopNestingObserver::GetForThread()),
diff --git a/mojo/public/js/base.js b/mojo/public/js/base.js
index 45740341..1bf90ea 100644
--- a/mojo/public/js/base.js
+++ b/mojo/public/js/base.js
@@ -121,8 +121,23 @@
 
     markMojomPendingLoad(id);
     var url = new URL(relativePath, document.currentScript.src).href;
-    config.global.document.write('<script type="text/javascript" src="' +
-                                 url + '"><' + '/script>');
+
+    if (config.global.document.readyState === 'loading') {
+      // We can't use dynamic script loading here (such as
+      // `document.createElement(...)` because the loaded script will be
+      // evaluated after the following scripts (if they exist). Thus
+      // `document.write` guarantees the proper evaluation order.
+      config.global.document.write('<script type="text/javascript" src="' +
+                                   url + '"><' + '/script>');
+    } else {
+      // If the parent script is being loaded lazily, we can't use
+      // `document.write` because the document has already been loaded.
+      var scriptElement = document.createElement('script');
+      scriptElement.type = 'text/javascript';
+      scriptElement.async = false;
+      scriptElement.src = url;
+      document.currentScript.parentElement.appendChild(scriptElement);
+    }
   }
 
   internal.exposeNamespace = exposeNamespace;
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index ee78ee1..61fbd8e7 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -111,7 +111,7 @@
 
 // The request failed because the response was delivered along with requirements
 // which are not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor
-// checks, for instance).
+// checks and 'Cross-Origin-Resource-Policy', for instance).
 NET_ERROR(BLOCKED_BY_RESPONSE, -27)
 
 // The request failed after the response was received, based on client-side
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 25742f7..0139565 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -4808,3 +4808,48 @@
   SetSimpleCacheMode();
   BackendOpenOrCreateEntry();
 }
+
+TEST_F(DiskCacheBackendTest, EmptyCorruptSimpleCacheRecovery) {
+  SetSimpleCacheMode();
+
+  const std::string kCorruptData("corrupted");
+
+  // Create a corrupt fake index in an otherwise empty simple cache.
+  ASSERT_TRUE(base::PathExists(cache_path_));
+  const base::FilePath index = cache_path_.AppendASCII("index");
+  ASSERT_EQ(static_cast<int>(kCorruptData.length()),
+            base::WriteFile(index, kCorruptData.data(), kCorruptData.length()));
+
+  base::RunLoop run_loop;
+  std::unique_ptr<disk_cache::Backend> cache;
+  net::TestCompletionCallback cb;
+
+  // Simple cache should be able to recover.
+  int rv = disk_cache::CreateCacheBackend(
+      net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, false, nullptr,
+      &cache, cb.callback());
+  EXPECT_THAT(cb.GetResult(rv), IsOk());
+}
+
+TEST_F(DiskCacheBackendTest, NonEmptyCorruptSimpleCacheDoesNotRecover) {
+  SetSimpleCacheMode();
+  BackendOpenOrCreateEntry();
+
+  const std::string kCorruptData("corrupted");
+
+  // Corrupt the fake index file for the populated simple cache.
+  ASSERT_TRUE(base::PathExists(cache_path_));
+  const base::FilePath index = cache_path_.AppendASCII("index");
+  ASSERT_EQ(static_cast<int>(kCorruptData.length()),
+            base::WriteFile(index, kCorruptData.data(), kCorruptData.length()));
+
+  base::RunLoop run_loop;
+  std::unique_ptr<disk_cache::Backend> cache;
+  net::TestCompletionCallback cb;
+
+  // Simple cache should not be able to recover when there are entry files.
+  int rv = disk_cache::CreateCacheBackend(
+      net::APP_CACHE, net::CACHE_BACKEND_SIMPLE, cache_path_, 0, false, nullptr,
+      &cache, cb.callback());
+  EXPECT_THAT(cb.GetResult(rv), IsError(net::ERR_FAILED));
+}
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 40792c80..34cc653 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -777,6 +777,34 @@
   result.net_error = net::OK;
   SimpleCacheConsistencyResult consistency = FileStructureConsistent(path);
   SIMPLE_CACHE_UMA(ENUMERATION, "ConsistencyResult", cache_type, consistency);
+
+  // If the cache structure is inconsistent make a single attempt at
+  // recovering it.  Previously there were bugs that could cause a partially
+  // written fake index file to be left in an otherwise empty cache.  In
+  // that case we can delete the index files and start over.  Also, some
+  // consistency failures may leave an empty directory directly and we can
+  // retry those cases as well.
+  if (consistency != SimpleCacheConsistencyResult::kOK) {
+    bool deleted_files = disk_cache::DeleteIndexFilesIfCacheIsEmpty(path);
+    SIMPLE_CACHE_UMA(BOOLEAN, "DidDeleteIndexFilesAfterFailedConsistency",
+                     cache_type, deleted_files);
+    if (base::IsDirectoryEmpty(path)) {
+      SimpleCacheConsistencyResult orig_consistency = consistency;
+      consistency = FileStructureConsistent(path);
+      SIMPLE_CACHE_UMA(ENUMERATION, "RetryConsistencyResult", cache_type,
+                       consistency);
+      if (consistency == SimpleCacheConsistencyResult::kOK) {
+        SIMPLE_CACHE_UMA(ENUMERATION,
+                         "OriginalConsistencyResultBeforeSuccessfulRetry",
+                         cache_type, orig_consistency);
+      }
+    }
+    if (deleted_files) {
+      SIMPLE_CACHE_UMA(ENUMERATION, "ConsistencyResultAfterIndexFilesDeleted",
+                       cache_type, consistency);
+    }
+  }
+
   if (consistency != SimpleCacheConsistencyResult::kOK) {
     LOG(ERROR) << "Simple Cache Backend: wrong file structure on disk: "
                << static_cast<int>(consistency)
diff --git a/net/disk_cache/simple/simple_version_upgrade.cc b/net/disk_cache/simple/simple_version_upgrade.cc
index 559edb6..86ac278 100644
--- a/net/disk_cache/simple/simple_version_upgrade.cc
+++ b/net/disk_cache/simple/simple_version_upgrade.cc
@@ -7,6 +7,7 @@
 #include <cstring>
 
 #include "base/files/file.h"
+#include "base/files/file_enumerator.h"
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/files/memory_mapped_file.h"
@@ -23,6 +24,7 @@
 const uint32_t kMinVersionAbleToUpgrade = 5;
 
 const char kFakeIndexFileName[] = "index";
+const char kIndexDirName[] = "index-dir";
 const char kIndexFileName[] = "the-real-index";
 
 void LogMessageFailedUpgradeFromVersion(int version) {
@@ -234,4 +236,26 @@
   return SimpleCacheConsistencyResult::kOK;
 }
 
+bool DeleteIndexFilesIfCacheIsEmpty(const base::FilePath& path) {
+  const base::FilePath fake_index = path.AppendASCII(kFakeIndexFileName);
+  const base::FilePath index_dir = path.AppendASCII(kIndexDirName);
+  // The newer schema versions have the real index in the index directory.
+  // Older versions, however, had a real index file in the same directory.
+  const base::FilePath legacy_index_file = path.AppendASCII(kIndexFileName);
+  base::FileEnumerator e(
+      path, /* recursive = */ false,
+      base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
+  for (base::FilePath name = e.Next(); !name.empty(); name = e.Next()) {
+    if (name == fake_index || name == index_dir || name == legacy_index_file)
+      continue;
+    return false;
+  }
+  bool deleted_fake_index =
+      base::DeleteFile(fake_index, /* recursive = */ false);
+  bool deleted_index_dir = base::DeleteFile(index_dir, /* recursive = */ true);
+  bool deleted_legacy_index_file =
+      base::DeleteFile(legacy_index_file, /* recursive = */ false);
+  return deleted_fake_index || deleted_index_dir || deleted_legacy_index_file;
+}
+
 }  // namespace disk_cache
diff --git a/net/disk_cache/simple/simple_version_upgrade.h b/net/disk_cache/simple/simple_version_upgrade.h
index 168ecba9..b9c34eb 100644
--- a/net/disk_cache/simple/simple_version_upgrade.h
+++ b/net/disk_cache/simple/simple_version_upgrade.h
@@ -46,6 +46,12 @@
 NET_EXPORT_PRIVATE SimpleCacheConsistencyResult
 UpgradeSimpleCacheOnDisk(const base::FilePath& path);
 
+// Check if the cache structure at the given path is empty except for index
+// files.  If so, then delete the index files.  Returns true if any files
+// were deleted.
+NET_EXPORT_PRIVATE bool DeleteIndexFilesIfCacheIsEmpty(
+    const base::FilePath& path);
+
 struct NET_EXPORT_PRIVATE FakeIndexData {
   FakeIndexData();
 
diff --git a/net/disk_cache/simple/simple_version_upgrade_unittest.cc b/net/disk_cache/simple/simple_version_upgrade_unittest.cc
index 974fd1989..e382b0e 100644
--- a/net/disk_cache/simple/simple_version_upgrade_unittest.cc
+++ b/net/disk_cache/simple/simple_version_upgrade_unittest.cc
@@ -26,6 +26,9 @@
 // cache belongs to one backend or another.
 const char kFakeIndexFileName[] = "index";
 
+// Same as |SimpleIndexFile::kIndexDirectory|.
+const char kIndexDirName[] = "index-dir";
+
 // Same as |SimpleIndexFile::kIndexFileName|.
 const char kIndexFileName[] = "the-real-index";
 
@@ -155,4 +158,61 @@
   }
 }
 
+TEST(SimpleVersionUpgradeTest, DeleteAllIndexFilesWhenCacheIsEmpty) {
+  const std::string kCorruptData("corrupt");
+
+  base::ScopedTempDir cache_dir;
+  ASSERT_TRUE(cache_dir.CreateUniqueTempDir());
+  const base::FilePath cache_path = cache_dir.GetPath();
+
+  const base::FilePath fake_index = cache_path.AppendASCII(kFakeIndexFileName);
+  ASSERT_EQ(
+      static_cast<int>(kCorruptData.length()),
+      base::WriteFile(fake_index, kCorruptData.data(), kCorruptData.length()));
+
+  const base::FilePath index_path = cache_path.AppendASCII(kIndexDirName);
+  ASSERT_TRUE(base::CreateDirectory(index_path));
+
+  const base::FilePath index = index_path.AppendASCII(kIndexFileName);
+  ASSERT_EQ(static_cast<int>(kCorruptData.length()),
+            base::WriteFile(index, kCorruptData.data(), kCorruptData.length()));
+
+  EXPECT_TRUE(disk_cache::DeleteIndexFilesIfCacheIsEmpty(cache_path));
+  EXPECT_TRUE(base::PathExists(cache_path));
+  EXPECT_TRUE(base::IsDirectoryEmpty(cache_path));
+}
+
+TEST(SimpleVersionUpgradeTest, DoesNotDeleteIndexFilesWhenCacheIsNotEmpty) {
+  const std::string kCorruptData("corrupt");
+
+  base::ScopedTempDir cache_dir;
+  ASSERT_TRUE(cache_dir.CreateUniqueTempDir());
+  const base::FilePath cache_path = cache_dir.GetPath();
+
+  const base::FilePath fake_index = cache_path.AppendASCII(kFakeIndexFileName);
+  ASSERT_EQ(
+      static_cast<int>(kCorruptData.length()),
+      base::WriteFile(fake_index, kCorruptData.data(), kCorruptData.length()));
+
+  const base::FilePath index_path = cache_path.AppendASCII(kIndexDirName);
+  ASSERT_TRUE(base::CreateDirectory(index_path));
+
+  const base::FilePath index = index_path.AppendASCII(kIndexFileName);
+  ASSERT_EQ(static_cast<int>(kCorruptData.length()),
+            base::WriteFile(index, kCorruptData.data(), kCorruptData.length()));
+
+  const base::FilePath entry_file = cache_path.AppendASCII("01234567_0");
+  ASSERT_EQ(
+      static_cast<int>(kCorruptData.length()),
+      base::WriteFile(entry_file, kCorruptData.data(), kCorruptData.length()));
+
+  EXPECT_FALSE(disk_cache::DeleteIndexFilesIfCacheIsEmpty(cache_path));
+  EXPECT_TRUE(base::PathExists(cache_path));
+  EXPECT_FALSE(base::IsDirectoryEmpty(cache_path));
+  EXPECT_TRUE(base::PathExists(fake_index));
+  EXPECT_TRUE(base::PathExists(index_path));
+  EXPECT_TRUE(base::PathExists(index));
+  EXPECT_TRUE(base::PathExists(entry_file));
+}
+
 }  // namespace
diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
index e054568..03e248c9 100644
--- a/net/dns/dns_reloader.cc
+++ b/net/dns/dns_reloader.cc
@@ -14,7 +14,7 @@
 #include "base/macros.h"
 #include "base/message_loop/message_loop.h"
 #include "base/synchronization/lock.h"
-#include "base/threading/thread_local_storage.h"
+#include "base/threading/thread_local.h"
 #include "net/base/network_change_notifier.h"
 
 namespace net {
@@ -43,10 +43,6 @@
 
 class DnsReloader : public NetworkChangeNotifier::DNSObserver {
  public:
-  struct ReloadState {
-    int resolver_generation;
-  };
-
   // NetworkChangeNotifier::DNSObserver:
   void OnDNSChanged() override {
     DCHECK(base::MessageLoopCurrentForIO::IsSet());
@@ -55,14 +51,14 @@
   }
 
   void MaybeReload() {
-    ReloadState* reload_state = static_cast<ReloadState*>(tls_index_.Get());
+    ReloadState* reload_state = tls_reload_state_.Get();
     base::AutoLock lock(lock_);
 
     if (!reload_state) {
-      reload_state = new ReloadState();
-      reload_state->resolver_generation = resolver_generation_;
+      auto new_reload_state = std::make_unique<ReloadState>();
+      new_reload_state->resolver_generation = resolver_generation_;
       res_ninit(&_res);
-      tls_index_.Set(reload_state);
+      tls_reload_state_.Set(std::move(new_reload_state));
     } else if (reload_state->resolver_generation != resolver_generation_) {
       reload_state->resolver_generation = resolver_generation_;
       // It is safe to call res_nclose here since we know res_ninit will have
@@ -72,15 +68,13 @@
     }
   }
 
-  // Free the allocated state.
-  static void SlotReturnFunction(void* data) {
-    ReloadState* reload_state = static_cast<ReloadState*>(data);
-    if (reload_state)
-      res_nclose(&_res);
-    delete reload_state;
-  }
-
  private:
+  struct ReloadState {
+    ~ReloadState() { res_nclose(&_res); }
+
+    int resolver_generation;
+  };
+
   DnsReloader() { NetworkChangeNotifier::AddDNSObserver(this); }
 
   ~DnsReloader() override {
@@ -92,7 +86,7 @@
   friend struct base::LazyInstanceTraitsBase<DnsReloader>;
 
   // We use thread local storage to identify which ReloadState to interact with.
-  base::ThreadLocalStorage::Slot tls_index_{&SlotReturnFunction};
+  base::ThreadLocalOwnedPointer<ReloadState> tls_reload_state_;
 
   DISALLOW_COPY_AND_ASSIGN(DnsReloader);
 };
diff --git a/net/http/http_stream_factory_unittest.cc b/net/http/http_stream_factory_unittest.cc
index adf774b9a..11667098 100644
--- a/net/http/http_stream_factory_unittest.cc
+++ b/net/http/http_stream_factory_unittest.cc
@@ -104,7 +104,8 @@
     kStreamTypeSpdy,
   };
 
-  explicit MockWebSocketHandshakeStream(StreamType type) : type_(type) {}
+  explicit MockWebSocketHandshakeStream(StreamType type)
+      : type_(type), weak_ptr_factory_(this) {}
 
   ~MockWebSocketHandshakeStream() override = default;
 
@@ -157,8 +158,13 @@
     return std::unique_ptr<WebSocketStream>();
   }
 
+  base::WeakPtr<WebSocketHandshakeStreamBase> GetWeakPtr() override {
+    return weak_ptr_factory_.GetWeakPtr();
+  }
+
  private:
   const StreamType type_;
+  base::WeakPtrFactory<MockWebSocketHandshakeStream> weak_ptr_factory_;
 };
 
 // HttpStreamFactory subclass that can wait until a preconnect is complete.
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 6a8af3b..ed6274e 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -33,7 +33,6 @@
 #include "net/log/net_log_source_type.h"
 #include "net/socket/next_proto.h"
 #include "net/ssl/ssl_cert_request_info.h"
-#include "net/url_request/http_user_agent_settings.h"
 #include "net/url_request/redirect_info.h"
 #include "net/url_request/redirect_util.h"
 #include "net/url_request/url_request_context.h"
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 5aa54e47a..dbe39ae8 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -430,8 +430,6 @@
                                           referrer.spec());
   }
 
-  // This should be kept in sync with the corresponding code in
-  // URLRequest::GetUserAgent.
   request_info_.extra_headers.SetHeaderIfMissing(
       HttpRequestHeaders::kUserAgent,
       http_user_agent_settings_ ?
diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc
index f1377e4..08547fc 100644
--- a/net/websockets/websocket_basic_handshake_stream.cc
+++ b/net/websockets/websocket_basic_handshake_stream.cc
@@ -176,7 +176,8 @@
       requested_sub_protocols_(std::move(requested_sub_protocols)),
       requested_extensions_(std::move(requested_extensions)),
       stream_request_(request),
-      websocket_endpoint_lock_manager_(websocket_endpoint_lock_manager) {
+      websocket_endpoint_lock_manager_(websocket_endpoint_lock_manager),
+      weak_ptr_factory_(this) {
   DCHECK(connect_delegate);
   DCHECK(request);
 }
@@ -390,6 +391,11 @@
   }
 }
 
+base::WeakPtr<WebSocketHandshakeStreamBase>
+WebSocketBasicHandshakeStream::GetWeakPtr() {
+  return weak_ptr_factory_.GetWeakPtr();
+}
+
 void WebSocketBasicHandshakeStream::SetWebSocketKeyForTesting(
     const std::string& key) {
   handshake_challenge_for_testing_ = key;
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h
index 106857a..69e14b8 100644
--- a/net/websockets/websocket_basic_handshake_stream.h
+++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -82,6 +82,8 @@
   // Upgrade() has been called and should be disposed of as soon as possible.
   std::unique_ptr<WebSocketStream> Upgrade() override;
 
+  base::WeakPtr<WebSocketHandshakeStreamBase> GetWeakPtr() override;
+
   // Set the value used for the next Sec-WebSocket-Key header
   // deterministically. The key is only used once, and then discarded.
   // For tests only.
@@ -147,6 +149,8 @@
 
   WebSocketEndpointLockManager* const websocket_endpoint_lock_manager_;
 
+  base::WeakPtrFactory<WebSocketBasicHandshakeStream> weak_ptr_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(WebSocketBasicHandshakeStream);
 };
 
diff --git a/net/websockets/websocket_handshake_stream_base.h b/net/websockets/websocket_handshake_stream_base.h
index 44da6a9..860e0af 100644
--- a/net/websockets/websocket_handshake_stream_base.h
+++ b/net/websockets/websocket_handshake_stream_base.h
@@ -119,6 +119,10 @@
   static std::string MultipleHeaderValuesMessage(
       const std::string& header_name);
 
+  // Subclasses need to implement this method so that the resulting weak
+  // pointers are invalidated as soon as the derived class is destroyed.
+  virtual base::WeakPtr<WebSocketHandshakeStreamBase> GetWeakPtr() = 0;
+
  protected:
   // TODO(ricea): If more extensions are added, replace this with a more general
   // mechanism.
diff --git a/net/websockets/websocket_http2_handshake_stream.cc b/net/websockets/websocket_http2_handshake_stream.cc
index 9bea1903..a5faadc 100644
--- a/net/websockets/websocket_http2_handshake_stream.cc
+++ b/net/websockets/websocket_http2_handshake_stream.cc
@@ -52,7 +52,8 @@
       request_info_(nullptr),
       stream_closed_(false),
       stream_error_(OK),
-      response_headers_complete_(false) {
+      response_headers_complete_(false),
+      weak_ptr_factory_(this) {
   DCHECK(connect_delegate);
   DCHECK(request);
 }
@@ -250,6 +251,11 @@
       std::make_unique<WebSocketDeflatePredictorImpl>());
 }
 
+base::WeakPtr<WebSocketHandshakeStreamBase>
+WebSocketHttp2HandshakeStream::GetWeakPtr() {
+  return weak_ptr_factory_.GetWeakPtr();
+}
+
 void WebSocketHttp2HandshakeStream::OnHeadersSent() {
   base::ResetAndReturn(&callback_).Run(OK);
 }
diff --git a/net/websockets/websocket_http2_handshake_stream.h b/net/websockets/websocket_http2_handshake_stream.h
index 968b127..af73445 100644
--- a/net/websockets/websocket_http2_handshake_stream.h
+++ b/net/websockets/websocket_http2_handshake_stream.h
@@ -94,6 +94,8 @@
   // Upgrade() has been called and should be disposed of as soon as possible.
   std::unique_ptr<WebSocketStream> Upgrade() override;
 
+  base::WeakPtr<WebSocketHandshakeStreamBase> GetWeakPtr() override;
+
   // WebSocketSpdyStreamAdapter::Delegate methods.
   void OnHeadersSent() override;
   void OnHeadersReceived(
@@ -175,6 +177,8 @@
   // to avoid including extension-related header files here.
   std::unique_ptr<WebSocketExtensionParams> extension_params_;
 
+  base::WeakPtrFactory<WebSocketHttp2HandshakeStream> weak_ptr_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(WebSocketHttp2HandshakeStream);
 };
 
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index 46e7a954..07204e5 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -7,6 +7,7 @@
 #include <utility>
 
 #include "base/logging.h"
+#include "base/memory/weak_ptr.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/time/time.h"
 #include "base/timer/timer.h"
@@ -119,7 +120,6 @@
                                             &delegate_,
                                             kTrafficAnnotation)),
         connect_delegate_(std::move(connect_delegate)),
-        handshake_stream_(nullptr),
         perform_upgrade_has_been_called_(false),
         api_delegate_(std::move(api_delegate)) {
     HttpRequestHeaders headers = additional_headers;
@@ -197,13 +197,15 @@
     if (!handshake_stream_) {
       // TODO(https://crbug.com/850183):
       // Find out why this can happen and make it stop.
-      ReportFailureWithMessage("No handshake stream has been created.");
+      ReportFailureWithMessage(
+          "No handshake stream has been created "
+          "or handshake stream is already destroyed.");
       return;
     }
 
     std::unique_ptr<URLRequest> url_request = std::move(url_request_);
-    WebSocketHandshakeStreamBase* handshake_stream = handshake_stream_;
-    handshake_stream_ = nullptr;
+    WebSocketHandshakeStreamBase* handshake_stream = handshake_stream_.get();
+    handshake_stream_.reset();
     // TODO(bnc): Combine into one line after https://crbug.com/850183 is fixed.
     std::unique_ptr<WebSocketStream> stream = handshake_stream->Upgrade();
     connect_delegate_->OnSuccess(std::move(stream));
@@ -272,7 +274,7 @@
     // TODO(bnc): Change to DCHECK after https://crbug.com/850183 is fixed.
     CHECK(handshake_stream);
 
-    handshake_stream_ = handshake_stream;
+    handshake_stream_ = handshake_stream->GetWeakPtr();
   }
 
   // |delegate_| needs to be declared before |url_request_| so that it gets
@@ -291,7 +293,7 @@
   // during the destruction of the URLRequest object associated with the
   // handshake. This is only guaranteed to be a valid pointer if the handshake
   // succeeded.
-  WebSocketHandshakeStreamBase* handshake_stream_;
+  base::WeakPtr<WebSocketHandshakeStreamBase> handshake_stream_;
 
   // TODO(bnc): Remove after https://crbug.com/850183 is fixed.
   bool perform_upgrade_has_been_called_;
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index f7423a2..7ef9271e 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -1614,8 +1614,6 @@
   return results;
 }
 
-void OutOfProcessInstance::DocumentPaintOccurred() {}
-
 void OutOfProcessInstance::DocumentLoadComplete(
     const PDFEngine::DocumentFeatures& document_features,
     uint32_t file_size) {
diff --git a/pdf/out_of_process_instance.h b/pdf/out_of_process_instance.h
index 6da39e2..8b6bdbd1 100644
--- a/pdf/out_of_process_instance.h
+++ b/pdf/out_of_process_instance.h
@@ -131,7 +131,6 @@
   std::vector<SearchStringResult> SearchString(const base::char16* string,
                                                const base::char16* term,
                                                bool case_sensitive) override;
-  void DocumentPaintOccurred() override;
   void DocumentLoadComplete(
       const PDFEngine::DocumentFeatures& document_features,
       uint32_t file_size) override;
diff --git a/pdf/pdf_engine.h b/pdf/pdf_engine.h
index f8d2822..65ef10f 100644
--- a/pdf/pdf_engine.h
+++ b/pdf/pdf_engine.h
@@ -235,9 +235,6 @@
         const base::char16* term,
         bool case_sensitive) = 0;
 
-    // Notifies the client that the engine has painted a page from the document.
-    virtual void DocumentPaintOccurred() {}
-
     // Notifies the client that the document has finished loading.
     virtual void DocumentLoadComplete(const DocumentFeatures& document_features,
                                       uint32_t file_size) {}
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 1b97e40..d8f1ad5 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -644,7 +644,7 @@
       return L'\"';
     case kHebrewPunctuationGereshCharacter:
     case kLeftSingleQuotationMarkCharacter:
-    case kRightSingleQuotationMarkCharacter:;
+    case kRightSingleQuotationMarkCharacter:
       return L'\'';
     default:
       return c;
@@ -3035,8 +3035,6 @@
 
   FPDF_RenderPage_Close(pages_[page_index]->GetPage());
   progressive_paints_.erase(progressive_paints_.begin() + progressive_index);
-
-  client_->DocumentPaintOccurred();
 }
 
 void PDFiumEngine::CancelPaints() {
diff --git a/pdf/preview_mode_client.cc b/pdf/preview_mode_client.cc
index 0cad061..e8ae2740 100644
--- a/pdf/preview_mode_client.cc
+++ b/pdf/preview_mode_client.cc
@@ -117,10 +117,6 @@
   return std::vector<SearchStringResult>();
 }
 
-void PreviewModeClient::DocumentPaintOccurred() {
-  NOTREACHED();
-}
-
 void PreviewModeClient::DocumentLoadComplete(
     const PDFEngine::DocumentFeatures& document_features,
     uint32_t file_size) {
diff --git a/pdf/preview_mode_client.h b/pdf/preview_mode_client.h
index c1fb192..7bb939a 100644
--- a/pdf/preview_mode_client.h
+++ b/pdf/preview_mode_client.h
@@ -59,7 +59,6 @@
   std::vector<SearchStringResult> SearchString(const base::char16* string,
                                                const base::char16* term,
                                                bool case_sensitive) override;
-  void DocumentPaintOccurred() override;
   void DocumentLoadComplete(
       const PDFEngine::DocumentFeatures& document_features,
       uint32_t file_size) override;
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 925065c..105fc13 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -466,7 +466,10 @@
   // And remove the same line from me2me_desktop_environment.cc.
 
 
+  // TODO(jarhar): Replace this ifdef with a chrome policy.
+#ifdef CHROME_REMOTE_DESKTOP_FILE_TRANSFER_ENABLED
   desktop_environment_options_.set_enable_file_transfer(true);
+#endif
 
   StartOnUiThread();
 }
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index e2b29d1..1649b1d 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -9,6 +9,7 @@
 #include "base/bind.h"
 #include "base/memory/weak_ptr.h"
 #include "base/single_thread_task_runner.h"
+#include "base/task/post_task.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
 #include "mojo/public/cpp/system/message_pipe.h"
@@ -116,6 +117,11 @@
 #if !defined(OS_ANDROID)
   device::BatteryStatusService::GetInstance()->Shutdown();
 #endif
+#if (defined(OS_LINUX) && defined(USE_UDEV)) || defined(OS_WIN) || \
+    defined(OS_MACOSX)
+  serial_port_manager_task_runner_->DeleteSoon(FROM_HERE,
+                                               std::move(serial_port_manager_));
+#endif
 }
 
 void DeviceService::OnStart() {
@@ -141,8 +147,6 @@
       &DeviceService::BindTimeZoneMonitorRequest, base::Unretained(this)));
   registry_.AddInterface<mojom::WakeLockProvider>(base::Bind(
       &DeviceService::BindWakeLockProviderRequest, base::Unretained(this)));
-  registry_.AddInterface<mojom::SerialPortManager>(base::Bind(
-      &DeviceService::BindSerialPortManagerRequest, base::Unretained(this)));
   registry_.AddInterface<mojom::UsbDeviceManager>(base::Bind(
       &DeviceService::BindUsbDeviceManagerRequest, base::Unretained(this)));
   registry_.AddInterface<mojom::UsbDeviceManagerTest>(base::Bind(
@@ -167,6 +171,20 @@
       &DeviceService::BindVibrationManagerRequest, base::Unretained(this)));
 #endif
 
+#if (defined(OS_LINUX) && defined(USE_UDEV)) || defined(OS_WIN) || \
+    defined(OS_MACOSX)
+  // SerialPortManagerImpl must live on a thread that is allowed to do
+  // blocking IO.
+  serial_port_manager_ = std::make_unique<SerialPortManagerImpl>(
+      io_task_runner_, base::ThreadTaskRunnerHandle::Get());
+  serial_port_manager_task_runner_ = base::CreateSequencedTaskRunnerWithTraits(
+      {base::MayBlock(), base::TaskPriority::BEST_EFFORT});
+  registry_.AddInterface<mojom::SerialPortManager>(
+      base::BindRepeating(&SerialPortManagerImpl::Bind,
+                          base::Unretained(serial_port_manager_.get())),
+      serial_port_manager_task_runner_);
+#endif
+
 #if defined(OS_CHROMEOS)
   registry_.AddInterface<mojom::BluetoothSystemFactory>(
       base::BindRepeating(&DeviceService::BindBluetoothSystemFactoryRequest,
@@ -305,15 +323,6 @@
                            wake_lock_context_callback_);
 }
 
-void DeviceService::BindSerialPortManagerRequest(
-    mojom::SerialPortManagerRequest request) {
-#if (defined(OS_LINUX) && defined(USE_UDEV)) || defined(OS_WIN) || \
-    defined(OS_MACOSX)
-  if (io_task_runner_)
-    SerialPortManagerImpl::Create(std::move(request), io_task_runner_);
-#endif
-}
-
 void DeviceService::BindUsbDeviceManagerRequest(
     mojom::UsbDeviceManagerRequest request) {
   if (!usb_device_manager_)
diff --git a/services/device/device_service.h b/services/device/device_service.h
index 3314942..44f17808 100644
--- a/services/device/device_service.h
+++ b/services/device/device_service.h
@@ -66,6 +66,7 @@
 
 #if !defined(OS_ANDROID)
 class HidManagerImpl;
+class SerialPortManagerImpl;
 #endif
 
 class DeviceService;
@@ -161,8 +162,6 @@
 
   void BindWakeLockProviderRequest(mojom::WakeLockProviderRequest request);
 
-  void BindSerialPortManagerRequest(mojom::SerialPortManagerRequest request);
-
   void BindUsbDeviceManagerRequest(mojom::UsbDeviceManagerRequest request);
 
   void BindUsbDeviceManagerTestRequest(
@@ -198,6 +197,15 @@
   std::unique_ptr<HidManagerImpl> hid_manager_;
 #endif
 
+#if (defined(OS_LINUX) && defined(USE_UDEV)) || defined(OS_WIN) || \
+    defined(OS_MACOSX)
+  // Requests for the SerialPortManager interface must be bound to
+  // |serial_port_manager_| on |serial_port_manager_task_runner_| and it will
+  // be destroyed on that sequence.
+  std::unique_ptr<SerialPortManagerImpl> serial_port_manager_;
+  scoped_refptr<base::SequencedTaskRunner> serial_port_manager_task_runner_;
+#endif
+
 #if defined(OS_CHROMEOS)
   std::unique_ptr<MtpDeviceManager> mtp_device_manager_;
 #endif
diff --git a/services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer_unittest.cc b/services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer_unittest.cc
index 395a4aa2..b11a5ed 100644
--- a/services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer_unittest.cc
+++ b/services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer_unittest.cc
@@ -5,7 +5,7 @@
 #include <cmath>
 
 #include "base/memory/ref_counted.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
@@ -18,7 +18,7 @@
 
 class
     AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometerTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometerTest() {
     auto fusion_algorithm = std::make_unique<
@@ -67,6 +67,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   AbsoluteOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndMagnetometer*
       fusion_algorithm_;
diff --git a/services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer_unittest.cc b/services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer_unittest.cc
index dab535a..cd59e453 100644
--- a/services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer_unittest.cc
+++ b/services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer_unittest.cc
@@ -4,7 +4,7 @@
 
 #include "services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer.h"
 #include "base/memory/ref_counted.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -14,7 +14,7 @@
 namespace {
 
 class LinearAccelerationFusionAlgorithmUsingAccelerometerTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   LinearAccelerationFusionAlgorithmUsingAccelerometerTest() {
     auto fusion_algorithm =
@@ -106,6 +106,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   LinearAccelerationFusionAlgorithmUsingAccelerometer* fusion_algorithm_;
 };
diff --git a/services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion_unittest.cc b/services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion_unittest.cc
index af79257..4e88022 100644
--- a/services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion_unittest.cc
+++ b/services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion_unittest.cc
@@ -4,7 +4,7 @@
 
 #include "services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion.h"
 #include "base/memory/ref_counted.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
 #include "services/device/generic_sensor/orientation_test_data.h"
@@ -13,7 +13,7 @@
 namespace device {
 
 class OrientationEulerAnglesFusionAlgorithmUsingQuaternionTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   OrientationEulerAnglesFusionAlgorithmUsingQuaternionTest() {
     auto fusion_algorithm =
@@ -26,6 +26,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   OrientationEulerAnglesFusionAlgorithmUsingQuaternion* fusion_algorithm_;
 };
diff --git a/services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles_unittest.cc b/services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles_unittest.cc
index c46b183e..6622334 100644
--- a/services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles_unittest.cc
+++ b/services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles_unittest.cc
@@ -4,18 +4,18 @@
 
 #include <cmath>
 
-#include "services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles.h"
 #include "base/memory/ref_counted.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
+#include "services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles.h"
 #include "services/device/generic_sensor/orientation_test_data.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace device {
 
 class OrientationQuaternionFusionAlgorithmUsingEulerAnglesTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   OrientationQuaternionFusionAlgorithmUsingEulerAnglesTest() {
     auto fusion_algorithm =
@@ -28,6 +28,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   OrientationQuaternionFusionAlgorithmUsingEulerAngles* fusion_algorithm_;
 };
diff --git a/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc b/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
index b2c5a80e..b08f4225 100644
--- a/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
+++ b/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
@@ -6,7 +6,7 @@
 
 #include "base/macros.h"
 #include "base/memory/singleton.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_and_provider.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -16,7 +16,7 @@
 
 namespace device {
 
-class PlatformSensorProviderTest : public DeviceServiceTestBase {
+class PlatformSensorProviderTest : public testing::Test {
  public:
   PlatformSensorProviderTest() {
     provider_ = std::make_unique<FakePlatformSensorProvider>();
@@ -27,6 +27,8 @@
   std::unique_ptr<FakePlatformSensorProvider> provider_;
 
  private:
+  base::test::ScopedTaskEnvironment task_environment_;
+
   DISALLOW_COPY_AND_ASSIGN(PlatformSensorProviderTest);
 };
 
diff --git a/services/device/generic_sensor/platform_sensor_fusion_unittest.cc b/services/device/generic_sensor/platform_sensor_fusion_unittest.cc
index cae6e41..4a961b31 100644
--- a/services/device/generic_sensor/platform_sensor_fusion_unittest.cc
+++ b/services/device/generic_sensor/platform_sensor_fusion_unittest.cc
@@ -7,8 +7,8 @@
 #include "base/bind_helpers.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "base/test/scoped_task_environment.h"
 #include "mojo/public/cpp/bindings/binding.h"
-#include "services/device/device_service_test_base.h"
 #include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"
 #include "services/device/generic_sensor/fake_platform_sensor_and_provider.h"
 #include "services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer.h"
@@ -25,7 +25,7 @@
 
 using mojom::SensorType;
 
-class PlatformSensorFusionTest : public DeviceServiceTestBase {
+class PlatformSensorFusionTest : public testing::Test {
  public:
   PlatformSensorFusionTest() {
     provider_ = std::make_unique<FakePlatformSensorProvider>();
@@ -90,6 +90,7 @@
     EXPECT_TRUE(platform_sensor_fusion_callback_called_);
   }
 
+  base::test::ScopedTaskEnvironment task_environment_;
   std::unique_ptr<FakePlatformSensorProvider> provider_;
   bool accelerometer_callback_called_ = false;
   scoped_refptr<FakePlatformSensor> accelerometer_;
diff --git a/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_gyroscope_unittest.cc b/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_gyroscope_unittest.cc
index a325f1f..8d99ff0c 100644
--- a/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_gyroscope_unittest.cc
+++ b/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_gyroscope_unittest.cc
@@ -6,7 +6,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/numerics/math_constants.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -17,7 +17,7 @@
 
 class
     RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndGyroscopeTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndGyroscopeTest() {
     auto fusion_algorithm = std::make_unique<
@@ -69,6 +69,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometerAndGyroscope*
       fusion_algorithm_;
diff --git a/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_unittest.cc b/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_unittest.cc
index 8b4a107..4c589f4 100644
--- a/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_unittest.cc
+++ b/services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer_unittest.cc
@@ -5,7 +5,7 @@
 #include <cmath>
 
 #include "base/memory/ref_counted.h"
-#include "services/device/device_service_test_base.h"
+#include "base/test/scoped_task_environment.h"
 #include "services/device/generic_sensor/fake_platform_sensor_fusion.h"
 #include "services/device/generic_sensor/generic_sensor_consts.h"
 #include "services/device/generic_sensor/relative_orientation_euler_angles_fusion_algorithm_using_accelerometer.h"
@@ -16,7 +16,7 @@
 namespace {
 
 class RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometerTest
-    : public DeviceServiceTestBase {
+    : public testing::Test {
  public:
   RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometerTest() {
     auto fusion_algorithm = std::make_unique<
@@ -55,6 +55,7 @@
   }
 
  protected:
+  base::test::ScopedTaskEnvironment task_environment_;
   scoped_refptr<FakePlatformSensorFusion> fake_fusion_sensor_;
   RelativeOrientationEulerAnglesFusionAlgorithmUsingAccelerometer*
       fusion_algorithm_;
diff --git a/services/device/serial/serial_port_manager_impl.cc b/services/device/serial/serial_port_manager_impl.cc
index c67b5d0..a939406c 100644
--- a/services/device/serial/serial_port_manager_impl.cc
+++ b/services/device/serial/serial_port_manager_impl.cc
@@ -8,52 +8,24 @@
 #include <utility>
 
 #include "base/sequenced_task_runner.h"
-#include "base/task/post_task.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "services/device/serial/serial_device_enumerator.h"
 #include "services/device/serial/serial_port_impl.h"
 
 namespace device {
 
-namespace {
-
-void CreateAndBindOnBlockableRunner(
-    mojom::SerialPortManagerRequest request,
-    scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
-    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
-  mojo::MakeStrongBinding(
-      std::make_unique<SerialPortManagerImpl>(std::move(io_task_runner),
-                                              std::move(ui_task_runner)),
-      std::move(request));
-}
-
-}  // namespace
-
-// static
-void SerialPortManagerImpl::Create(
-    mojom::SerialPortManagerRequest request,
-    scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) {
-  // SerialPortManagerImpl must live on a thread that is allowed to do
-  // blocking IO.
-  scoped_refptr<base::SequencedTaskRunner> blockable_sequence_runner =
-      base::CreateSequencedTaskRunnerWithTraits(
-          {base::MayBlock(), base::TaskPriority::BEST_EFFORT});
-  blockable_sequence_runner->PostTask(
-      FROM_HERE, base::BindOnce(&CreateAndBindOnBlockableRunner,
-                                std::move(request), std::move(io_task_runner),
-                                base::ThreadTaskRunnerHandle::Get()));
-}
-
-// SerialPortManagerImpl must be created in a blockable runner.
 SerialPortManagerImpl::SerialPortManagerImpl(
     scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
     scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
-    : enumerator_(SerialDeviceEnumerator::Create()),
-      io_task_runner_(std::move(io_task_runner)),
+    : io_task_runner_(std::move(io_task_runner)),
       ui_task_runner_(std::move(ui_task_runner)) {}
 
 SerialPortManagerImpl::~SerialPortManagerImpl() = default;
 
+void SerialPortManagerImpl::Bind(mojom::SerialPortManagerRequest request) {
+  bindings_.AddBinding(this, std::move(request));
+}
+
 void SerialPortManagerImpl::SetSerialEnumeratorForTesting(
     std::unique_ptr<SerialDeviceEnumerator> fake_enumerator) {
   DCHECK(fake_enumerator);
@@ -61,13 +33,15 @@
 }
 
 void SerialPortManagerImpl::GetDevices(GetDevicesCallback callback) {
-  DCHECK(enumerator_);
+  if (!enumerator_)
+    enumerator_ = SerialDeviceEnumerator::Create();
   std::move(callback).Run(enumerator_->GetDevices());
 }
 
 void SerialPortManagerImpl::GetPort(const base::UnguessableToken& token,
                                     mojom::SerialPortRequest request) {
-  DCHECK(enumerator_);
+  if (!enumerator_)
+    enumerator_ = SerialDeviceEnumerator::Create();
   base::Optional<base::FilePath> path = enumerator_->GetPathFromToken(token);
   if (path) {
     io_task_runner_->PostTask(
diff --git a/services/device/serial/serial_port_manager_impl.h b/services/device/serial/serial_port_manager_impl.h
index 476426d..7013395 100644
--- a/services/device/serial/serial_port_manager_impl.h
+++ b/services/device/serial/serial_port_manager_impl.h
@@ -9,6 +9,7 @@
 
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
 #include "services/device/public/mojom/serial.mojom.h"
 
 namespace base {
@@ -25,15 +26,12 @@
 // crbug.com/748505
 class SerialPortManagerImpl : public mojom::SerialPortManager {
  public:
-  static void Create(
-      mojom::SerialPortManagerRequest request,
-      scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
-
   SerialPortManagerImpl(
       scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
       scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
   ~SerialPortManagerImpl() override;
 
+  void Bind(mojom::SerialPortManagerRequest request);
   void SetSerialEnumeratorForTesting(
       std::unique_ptr<SerialDeviceEnumerator> fake_enumerator);
 
@@ -48,6 +46,8 @@
   scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
   scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
 
+  mojo::BindingSet<SerialPortManager> bindings_;
+
   DISALLOW_COPY_AND_ASSIGN(SerialPortManagerImpl);
 };
 
diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn
index 6a852c7d..3d9c394 100644
--- a/services/network/BUILD.gn
+++ b/services/network/BUILD.gn
@@ -30,6 +30,8 @@
     "crl_set_distributor.h",
     "cross_origin_read_blocking.cc",
     "cross_origin_read_blocking.h",
+    "cross_origin_resource_policy.cc",
+    "cross_origin_resource_policy.h",
     "data_pipe_element_reader.cc",
     "data_pipe_element_reader.h",
     "dns_config_change_manager.cc",
@@ -280,6 +282,7 @@
     "cors/cors_url_loader_unittest.cc",
     "cors/preflight_controller_unittest.cc",
     "cross_origin_read_blocking_unittest.cc",
+    "cross_origin_resource_policy_unittest.cc",
     "data_pipe_element_reader_unittest.cc",
     "dns_config_change_manager_unittest.cc",
     "host_resolver_unittest.cc",
diff --git a/services/network/OWNERS b/services/network/OWNERS
index 4de9c844..90fdb34 100644
--- a/services/network/OWNERS
+++ b/services/network/OWNERS
@@ -8,10 +8,13 @@
 tsepez@chromium.org
 yhirano@chromium.org
 
+# Files and features related to component:Internals>Sandbox>SiteIsolation:
 per-file initiator_lock_compatibility*=creis@chromium.org
 per-file initiator_lock_compatibility*=lukasza@chromium.org
 per-file cross_origin_read_blocking*=creis@chromium.org
 per-file cross_origin_read_blocking*=lukasza@chromium.org
+per-file cross_origin_resource_policy*=creis@chromium.org
+per-file cross_origin_resource_policy*=lukasza@chromium.org
 
 per-file expect_ct_reporter*=estark@chromium.org
 
diff --git a/services/network/cross_origin_read_blocking.cc b/services/network/cross_origin_read_blocking.cc
index 25e6bf9b..38bd1e4d 100644
--- a/services/network/cross_origin_read_blocking.cc
+++ b/services/network/cross_origin_read_blocking.cc
@@ -24,6 +24,7 @@
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_request.h"
+#include "services/network/cross_origin_resource_policy.h"
 #include "services/network/public/cpp/features.h"
 #include "services/network/public/cpp/resource_response.h"
 #include "services/network/public/cpp/resource_response_info.h"
@@ -565,13 +566,15 @@
 CrossOriginReadBlocking::ResponseAnalyzer::ResponseAnalyzer(
     const net::URLRequest& request,
     const ResourceResponse& response,
-    base::Optional<url::Origin> request_initiator_site_lock) {
+    base::Optional<url::Origin> request_initiator_site_lock,
+    mojom::FetchRequestMode fetch_request_mode) {
   content_length_ = response.head.content_length;
   http_response_code_ =
       response.head.headers ? response.head.headers->response_code() : 0;
   request_initiator_site_lock_ = request_initiator_site_lock;
 
-  should_block_based_on_headers_ = ShouldBlockBasedOnHeaders(request, response);
+  should_block_based_on_headers_ =
+      ShouldBlockBasedOnHeaders(fetch_request_mode, request, response);
   if (should_block_based_on_headers_ == kNeedToSniffMore)
     CreateSniffers();
 }
@@ -580,6 +583,7 @@
 
 CrossOriginReadBlocking::ResponseAnalyzer::BlockingDecision
 CrossOriginReadBlocking::ResponseAnalyzer::ShouldBlockBasedOnHeaders(
+    mojom::FetchRequestMode fetch_request_mode,
     const net::URLRequest& request,
     const ResourceResponse& response) {
   // The checks in this method are ordered to rule out blocking in most cases as
@@ -623,12 +627,22 @@
   if (initiator.scheme() == url::kFileScheme)
     return kAllow;
 
-  // Allow the response through if it has valid CORS headers.
-  std::string cors_header;
-  response.head.headers->GetNormalizedHeader("access-control-allow-origin",
-                                             &cors_header);
-  if (IsValidCorsHeaderSet(initiator, cors_header)) {
-    return kAllow;
+  // Allow the response through if this is a CORS request and the response has
+  // valid CORS headers.
+  switch (fetch_request_mode) {
+    case mojom::FetchRequestMode::kNavigate:
+    case mojom::FetchRequestMode::kNoCors:
+    case mojom::FetchRequestMode::kSameOrigin:
+      break;
+
+    case mojom::FetchRequestMode::kCors:
+    case mojom::FetchRequestMode::kCorsWithForcedPreflight:
+      std::string cors_header;
+      response.head.headers->GetNormalizedHeader("access-control-allow-origin",
+                                                 &cors_header);
+      if (IsValidCorsHeaderSet(initiator, cors_header))
+        return kAllow;
+      break;
   }
 
   // Requests from foo.example.com will consult foo.example.com's service worker
@@ -680,6 +694,40 @@
   canonical_mime_type_ =
       network::CrossOriginReadBlocking::GetCanonicalMimeType(mime_type);
 
+  // CORS is currently implemented in the renderer process, so it's useful for
+  // CORB to filter failed "cors" mode fetches to avoid leaking the responses to
+  // the renderer when possible (e.g., depending on MIME type and sniffing).
+  // This will eventually be fixed with OOR-CORS.
+  //
+  // In the mean time, we can try to filter a few additional failed CORS
+  // fetches, treating the Cross-Origin-Resource-Policy (CORP) header as an
+  // opt-in to CORB.  CORP headers are enforced elsewhere and normally only
+  // apply to "no-cors" mode fetches.  If such a header happens to be on the
+  // response during other fetch modes, and if the same-origin and
+  // IsValidCorsHeaderSet checks above have failed (and thus the request will
+  // fail in the renderer), then we can let CORB filter the response without
+  // caring about MIME type or sniffing.
+  //
+  // To make CrossOriginResourcePolicy::Verify apply to all fetch modes in this
+  // case and not just "no-cors", we pass kNoCors as a hard-coded value.  This
+  // does not affect the usual enforcement of CORP headers.
+  //
+  // TODO(lukasza): Once OOR-CORS launches (https://crbug.com/736308), this code
+  // block will no longer be necessary since all failed CORS requests will be
+  // blocked before reaching the renderer process (even without CORB's help).
+  // Of course this assumes that OOR-CORS will use trustworthy
+  // |request_initiator| (i.e. vetted against |request_initiator|site_lock|).
+  constexpr mojom::FetchRequestMode kOverreachingFetchMode =
+      mojom::FetchRequestMode::kNoCors;
+  if (CrossOriginResourcePolicy::kBlock ==
+      CrossOriginResourcePolicy::Verify(request, response,
+                                        kOverreachingFetchMode,
+                                        request_initiator_site_lock_)) {
+    // Ignore mime types and/or sniffing and have CORB block all responses with
+    // COR*P* header.
+    return kBlock;
+  }
+
   // If this is a partial response, sniffing is not possible, so allow the
   // response if it's not a protected mime type.
   std::string range_header;
diff --git a/services/network/cross_origin_read_blocking.h b/services/network/cross_origin_read_blocking.h
index 6caca3c..6bef66e 100644
--- a/services/network/cross_origin_read_blocking.h
+++ b/services/network/cross_origin_read_blocking.h
@@ -15,6 +15,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/strings/string_piece_forward.h"
 #include "services/network/initiator_lock_compatibility.h"
+#include "services/network/public/mojom/fetch_api.mojom.h"
 #include "url/gurl.h"
 #include "url/origin.h"
 
@@ -69,7 +70,8 @@
     // ResponseAnalyzer will decide whether |response| needs to be blocked.
     ResponseAnalyzer(const net::URLRequest& request,
                      const ResourceResponse& response,
-                     base::Optional<url::Origin> request_initiator_site_lock);
+                     base::Optional<url::Origin> request_initiator_site_lock,
+                     mojom::FetchRequestMode fetch_request_mode);
 
     ~ResponseAnalyzer();
 
@@ -132,6 +134,7 @@
       kNeedToSniffMore,
     };
     BlockingDecision ShouldBlockBasedOnHeaders(
+        mojom::FetchRequestMode fetch_request_mode,
         const net::URLRequest& request,
         const ResourceResponse& response);
 
diff --git a/services/network/cross_origin_resource_policy.cc b/services/network/cross_origin_resource_policy.cc
new file mode 100644
index 0000000..7b55b7d2
--- /dev/null
+++ b/services/network/cross_origin_resource_policy.cc
@@ -0,0 +1,181 @@
+// Copyright 2019 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 "services/network/cross_origin_resource_policy.h"
+
+#include <string>
+
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "net/http/http_response_headers.h"
+#include "net/url_request/url_request.h"
+#include "services/network/initiator_lock_compatibility.h"
+#include "services/network/public/cpp/resource_response.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+#include "url/url_constants.h"
+
+namespace network {
+
+namespace {
+
+const char kHeaderName[] = "Cross-Origin-Resource-Policy";
+
+// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header says:
+// > ABNF:
+// >  Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site"
+// >  ; case-sensitive
+//
+// https://tools.ietf.org/html/rfc7405 says:
+// > The following prefixes are allowed:
+// >      %s          =  case-sensitive
+// >      %i          =  case-insensitive
+CrossOriginResourcePolicy::ParsedHeader ParseHeader(
+    const net::HttpResponseHeaders* headers) {
+  std::string header_value;
+  if (!headers || !headers->GetNormalizedHeader(kHeaderName, &header_value))
+    return CrossOriginResourcePolicy::kNoHeader;
+
+  if (header_value == "same-origin")
+    return CrossOriginResourcePolicy::kSameOrigin;
+
+  if (header_value == "same-site")
+    return CrossOriginResourcePolicy::kSameSite;
+
+  // TODO(lukasza): Once https://github.com/whatwg/fetch/issues/760 gets
+  // resolved, add support for parsing specific origins.
+  return CrossOriginResourcePolicy::kParsingError;
+}
+
+std::string GetDomain(const url::Origin& origin) {
+  return net::registry_controlled_domains::GetDomainAndRegistry(
+      origin.host(),
+      net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+}
+
+bool ShouldAllowSameSite(const url::Origin& initiator,
+                         const url::Origin& target_origin) {
+  // Different sites might be served from the same IP address - they should
+  // still be considered to be different sites - see also
+  // https://url.spec.whatwg.org/#host-same-site which excludes IP addresses by
+  // imposing the requirement that one of the addresses has to have a non-null
+  // registrable domain.
+  if (initiator.GetURL().HostIsIPAddress() ||
+      target_origin.GetURL().HostIsIPAddress()) {
+    return false;
+  }
+
+  // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header, step 5
+  // says to allow "CORP: same-site" responses
+  // > [...] If the following are true:
+  // > - request’s origin’s host is same site with request’s current URL’s host
+  // > - [...]
+  if (GetDomain(initiator) != GetDomain(target_origin))
+    return false;
+
+  // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header, step 5
+  // says to allow "CORP: same-site" responses
+  // > [...] If the following are true:
+  // > - [...]
+  // > - request’s origin’s scheme is "https" or response’s HTTPS state is
+  //     "none"
+  //
+  // |target_origin.scheme() != url::kHttpsScheme| is pretty much equivalent to
+  // |response’s HTTPS state is "none"| based on the following spec snippets:
+  // - https://fetch.spec.whatwg.org/#http-network-fetch says:
+  //     > If response was retrieved over HTTPS, set its HTTPS state to either
+  //       "deprecated" or "modern".
+  //   and the same spec section also hints that broken responses should result
+  //   in network errors (rather than "none" or other http state):
+  //     > User agents are strongly encouraged to only succeed HTTPS connections
+  //       with strong security properties and return network errors otherwise.
+  return initiator.scheme() == url::kHttpsScheme ||
+         target_origin.scheme() != url::kHttpsScheme;
+}
+
+}  // namespace
+
+// static
+CrossOriginResourcePolicy::VerificationResult CrossOriginResourcePolicy::Verify(
+    const net::URLRequest& request,
+    const ResourceResponse& response,
+    mojom::FetchRequestMode fetch_mode,
+    base::Optional<url::Origin> request_initiator_site_lock) {
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 1. If request’s mode is not "no-cors", then return allowed.
+  if (fetch_mode != mojom::FetchRequestMode::kNoCors)
+    return kAllow;
+
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 3. Let policy be the result of getting `Cross-Origin-Resource-Policy`
+  //      from response’s header list.
+  //
+  // We parse the header earlier than requested by the spec (i.e. we swap steps
+  // 2 and 3 from the spec), to return early if there was no header (before
+  // slightly more expensive steps needed to extract the origins below).
+  ParsedHeader policy = ParseHeader(response.head.headers.get());
+  if (policy == kNoHeader || policy == kParsingError) {
+    // The algorithm only returns kBlock from steps 4 and 6, when policy is
+    // either kSameOrigin or kSameSite.  For other policy values we can
+    // immediately execute step 7 and return kAllow.
+    //
+    // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+    // > 7.  Return allowed.
+    return kAllow;
+  }
+
+  // Compute |target_origin| and |initiator|.  Initial, opaque |initiator| will
+  // be used unless request.initiator() has a value that is compatible with the
+  // |request_initiator_site_lock|.
+  url::Origin target_origin = url::Origin::Create(request.url());
+  url::Origin initiator;
+  InitiatorLockCompatibility initiator_compatibility =
+      VerifyRequestInitiatorLock(request_initiator_site_lock,
+                                 request.initiator());
+  if (request.initiator().has_value() &&
+      initiator_compatibility != InitiatorLockCompatibility::kIncorrectLock) {
+    initiator = request.initiator().value();
+  }
+
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 2. If request’s origin is same origin with request’s current URL’s
+  //      origin, then return allowed.
+  if (initiator == target_origin)
+    return kAllow;
+
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 4. If policy is `same-origin`, then return blocked.
+  if (policy == kSameOrigin)
+    return kBlock;
+
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 5. If the following are true
+  // >      * request’s origin’s host is same site with request’s current URL’s
+  // >        host
+  // >      * request’s origin’s scheme is "https" or response’s HTTPS state is
+  // >      "none"
+  // >    then return allowed.
+  if (ShouldAllowSameSite(initiator, target_origin))
+    return kAllow;
+
+  // From https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  // > 6.  If policy is `same-site`, then return blocked.
+  DCHECK_EQ(kSameSite, policy);
+  return kBlock;
+}
+
+// static
+CrossOriginResourcePolicy::ParsedHeader
+CrossOriginResourcePolicy::ParseHeaderForTesting(
+    const net::HttpResponseHeaders* headers) {
+  return ParseHeader(headers);
+}
+
+// static
+bool CrossOriginResourcePolicy::ShouldAllowSameSiteForTesting(
+    const url::Origin& initiator,
+    const url::Origin& target_origin) {
+  return ShouldAllowSameSite(initiator, target_origin);
+}
+
+}  // namespace network
diff --git a/services/network/cross_origin_resource_policy.h b/services/network/cross_origin_resource_policy.h
new file mode 100644
index 0000000..457ce93a
--- /dev/null
+++ b/services/network/cross_origin_resource_policy.h
@@ -0,0 +1,65 @@
+// Copyright 2019 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 SERVICES_NETWORK_CROSS_ORIGIN_RESOURCE_POLICY_H_
+#define SERVICES_NETWORK_CROSS_ORIGIN_RESOURCE_POLICY_H_
+
+#include "base/component_export.h"
+#include "base/gtest_prod_util.h"
+#include "base/optional.h"
+#include "services/network/public/mojom/fetch_api.mojom-shared.h"
+#include "url/origin.h"
+
+namespace net {
+class URLRequest;
+class HttpResponseHeaders;
+}  // namespace net
+
+namespace network {
+
+struct ResourceResponse;
+
+// Implementation of Cross-Origin-Resource-Policy - see:
+// - https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header
+// - https://github.com/whatwg/fetch/issues/687
+class COMPONENT_EXPORT(NETWORK_SERVICE) CrossOriginResourcePolicy {
+ public:
+  // Only static methods.
+  CrossOriginResourcePolicy() = delete;
+
+  // For "no-cors" fetches, the Verify method checks whether the response has a
+  // Cross-Origin-Resource-Policy header which says the response should not be
+  // delivered to a cross-origin or cross-site context.
+  enum VerificationResult {
+    kBlock,
+    kAllow,
+  };
+  static VerificationResult Verify(
+      const net::URLRequest& request,
+      const ResourceResponse& response,
+      mojom::FetchRequestMode fetch_mode,
+      base::Optional<url::Origin> request_initiator_site_lock);
+
+  // Parsing of the Cross-Origin-Resource-Policy http response header.
+  enum ParsedHeader {
+    kNoHeader,
+    kSameOrigin,
+    kSameSite,
+    kParsingError,
+  };
+  static ParsedHeader ParseHeaderForTesting(
+      const net::HttpResponseHeaders* headers);
+
+  // Determines if the response with "CORP: same-site" header should be allowed
+  // for the given |initiator| and |target_origin|.  Note that responses might
+  // be allowed even if schemes of |initiator| and |target_origin| differ - this
+  // logic is distinct from site-related code in content::SiteInstance and/or
+  // GURL::DomainIs.
+  static bool ShouldAllowSameSiteForTesting(const url::Origin& initiator,
+                                            const url::Origin& target_origin);
+};
+
+}  // namespace network
+
+#endif  // SERVICES_NETWORK_CROSS_ORIGIN_RESOURCE_POLICY_H_
diff --git a/services/network/cross_origin_resource_policy_unittest.cc b/services/network/cross_origin_resource_policy_unittest.cc
new file mode 100644
index 0000000..844cfea5
--- /dev/null
+++ b/services/network/cross_origin_resource_policy_unittest.cc
@@ -0,0 +1,110 @@
+// Copyright 2019 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 <string>
+
+#include "base/memory/ref_counted.h"
+#include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
+#include "services/network/cross_origin_resource_policy.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace network {
+
+CrossOriginResourcePolicy::ParsedHeader ParseHeader(
+    const std::string& test_headers) {
+  std::string all_headers = "HTTP/1.1 200 OK\n" + test_headers + "\n";
+  auto headers = base::MakeRefCounted<net::HttpResponseHeaders>(
+      net::HttpUtil::AssembleRawHeaders(all_headers.c_str(),
+                                        all_headers.size()));
+  return CrossOriginResourcePolicy::ParseHeaderForTesting(headers.get());
+}
+
+// This test is somewhat redundant with
+// wpt/fetch/cross-origin-resource-policy/syntax.any.js
+// The delta in coverage is mostly around testing case insensitivity of the
+// header name.
+TEST(CrossOriginResourcePolicyTest, ParseHeader) {
+  // Basic tests.
+  EXPECT_EQ(CrossOriginResourcePolicy::kNoHeader, ParseHeader(""));
+  EXPECT_EQ(CrossOriginResourcePolicy::kSameOrigin,
+            ParseHeader("Cross-Origin-Resource-Policy: same-origin"));
+  EXPECT_EQ(CrossOriginResourcePolicy::kSameSite,
+            ParseHeader("Cross-Origin-Resource-Policy: same-site"));
+
+  // Header names are case-insensitive.
+  EXPECT_EQ(CrossOriginResourcePolicy::kSameOrigin,
+            ParseHeader("Cross-Origin-RESOURCE-Policy: same-origin"));
+  EXPECT_EQ(CrossOriginResourcePolicy::kSameSite,
+            ParseHeader("Cross-ORIGIN-Resource-Policy: same-site"));
+
+  // Header values are case-sensitive.
+  EXPECT_EQ(CrossOriginResourcePolicy::kParsingError,
+            ParseHeader("Cross-Origin-Resource-Policy: sAme-origin"));
+  EXPECT_EQ(CrossOriginResourcePolicy::kParsingError,
+            ParseHeader("Cross-Origin-Resource-Policy: saMe-site"));
+
+  // Specific origins are not yet part of the spec.  See also:
+  // https://github.com/whatwg/fetch/issues/760
+  EXPECT_EQ(
+      CrossOriginResourcePolicy::kParsingError,
+      ParseHeader("Cross-Origin-Resource-Policy: https://www.example.com"));
+
+  // Parsing failures explicitly called out in the note for step 3:
+  // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header:
+  //
+  //   > This means that `Cross-Origin-Resource-Policy: same-site, same-origin`
+  //   > ends up as allowed below as it will never match anything. Two or more
+  //   > `Cross-Origin-Resource-Policy` headers will have the same effect.
+  //
+  EXPECT_EQ(
+      CrossOriginResourcePolicy::kParsingError,
+      ParseHeader("Cross-Origin-Resource-Policy: same-site, same-origin"));
+  EXPECT_EQ(CrossOriginResourcePolicy::kParsingError,
+            ParseHeader("Cross-Origin-Resource-Policy: same-site\n"
+                        "Cross-Origin-Resource-Policy: same-origin"));
+}
+
+bool ShouldAllowSameSite(const std::string& initiator,
+                         const std::string& target) {
+  return CrossOriginResourcePolicy::ShouldAllowSameSiteForTesting(
+      url::Origin::Create(GURL(initiator)), url::Origin::Create(GURL(target)));
+}
+
+TEST(CrossOriginResourcePolicyTest, ShouldAllowSameSite) {
+  // Basic tests.
+  EXPECT_TRUE(ShouldAllowSameSite("https://foo.com", "https://foo.com"));
+  EXPECT_FALSE(ShouldAllowSameSite("https://foo.com", "https://bar.com"));
+
+  // Subdomains.
+  EXPECT_TRUE(ShouldAllowSameSite("https://foo.a.com", "https://a.com"));
+  EXPECT_TRUE(ShouldAllowSameSite("https://a.com", "https://bar.a.com"));
+  EXPECT_TRUE(ShouldAllowSameSite("https://foo.a.com", "https://bar.a.com"));
+  EXPECT_FALSE(ShouldAllowSameSite("https://foo.a.com", "https://b.com"));
+  EXPECT_FALSE(ShouldAllowSameSite("https://a.com", "https://bar.b.com"));
+  EXPECT_FALSE(ShouldAllowSameSite("https://foo.a.com", "https://bar.b.com"));
+
+  // Same host, different HTTPS vs HTTP scheme.
+  //
+  // The intent here is that HTTPS response shouldn't be exposed to a page
+  // served over HTTP (which might leak it), but serving an HTTP response isn't
+  // secret so we don't need to block it from HTTPS pages.  This behavior should
+  // hopefully help with adoption on sites that still need to use mixed
+  // http/https content.
+  EXPECT_TRUE(ShouldAllowSameSite(
+      /* initiator = */ "https://foo.com", /* target = */ "http://foo.com"));
+  EXPECT_FALSE(ShouldAllowSameSite(
+      /* initiator = */ "http://foo.com", /* target = */ "https://foo.com"));
+
+  // IP addresses.
+  //
+  // Different sites might be served from the same IP address - they should
+  // still be considered to be different sites - see also
+  // https://url.spec.whatwg.org/#host-same-site which excludes IP addresses by
+  // imposing the requirement that one of the addresses has to have a non-null
+  // registrable domain.
+  EXPECT_FALSE(ShouldAllowSameSite("http://127.0.0.1", "http://127.0.0.1"));
+}
+
+}  // namespace network
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 7e8c007..dabe4487 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -33,6 +33,7 @@
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
 #include "services/network/chunked_data_pipe_upload_data_stream.h"
+#include "services/network/cross_origin_resource_policy.h"
 #include "services/network/data_pipe_element_reader.h"
 #include "services/network/empty_url_loader_client.h"
 #include "services/network/loader_util.h"
@@ -397,6 +398,7 @@
       request.fetch_request_mode == mojom::FetchRequestMode::kNoCors &&
       CrossOriginReadBlocking::ShouldAllowForPlugin(
           factory_params_->process_id);
+  fetch_request_mode_ = request.fetch_request_mode;
 
   throttling_token_ = network::ScopedThrottlingToken::MaybeCreate(
       url_request_->net_log().source().id, request.throttling_profile_id);
@@ -657,6 +659,17 @@
     raw_request_headers_ = net::HttpRawRequestHeaders();
     raw_response_headers_ = nullptr;
   }
+
+  // Enforce the Cross-Origin-Resource-Policy (CORP) header.
+  if (CrossOriginResourcePolicy::kBlock ==
+      CrossOriginResourcePolicy::Verify(
+          *url_request_, *response, fetch_request_mode_,
+          factory_params_->request_initiator_site_lock)) {
+    CompleteBlockedResponse(net::ERR_BLOCKED_BY_RESPONSE, false);
+    DeleteSelf();
+    return;
+  }
+
   url_loader_client_->OnReceiveRedirect(redirect_info, response->head);
 }
 
@@ -790,7 +803,18 @@
       base::Bind(&URLLoader::OnResponseBodyStreamReady,
                  base::Unretained(this)));
 
-  // Figure out if we need to sniff (for MIME type detection or for CORB).
+  // Enforce the Cross-Origin-Resource-Policy (CORP) header.
+  if (CrossOriginResourcePolicy::kBlock ==
+      CrossOriginResourcePolicy::Verify(
+          *url_request_, *response_, fetch_request_mode_,
+          factory_params_->request_initiator_site_lock)) {
+    CompleteBlockedResponse(net::ERR_BLOCKED_BY_RESPONSE, false);
+    DeleteSelf();
+    return;
+  }
+
+  // Figure out if we need to sniff (for MIME type detection or for Cross-Origin
+  // Read Blocking / CORB).
   if (factory_params_->is_corb_enabled && !is_nocors_corb_excluded_request_) {
     CrossOriginReadBlocking::LogAction(
         CrossOriginReadBlocking::Action::kResponseStarted);
@@ -798,7 +822,7 @@
     corb_analyzer_ =
         std::make_unique<CrossOriginReadBlocking::ResponseAnalyzer>(
             *url_request_, *response_,
-            factory_params_->request_initiator_site_lock);
+            factory_params_->request_initiator_site_lock, fetch_request_mode_);
     is_more_corb_sniffing_needed_ = corb_analyzer_->needs_sniffing();
     if (corb_analyzer_->ShouldBlock()) {
       DCHECK(!is_more_corb_sniffing_needed_);
@@ -1268,6 +1292,27 @@
   std::move(callback).Run(result);
 }
 
+void URLLoader::CompleteBlockedResponse(int error_code,
+                                        bool should_report_corb_blocking) {
+  // The response headers and body shouldn't yet be sent to the URLLoaderClient.
+  DCHECK(response_);
+  DCHECK(consumer_handle_.is_valid());
+
+  // Tell the URLLoaderClient that the response has been completed.
+  URLLoaderCompletionStatus status;
+  status.error_code = error_code;
+  status.completion_time = base::TimeTicks::Now();
+  status.encoded_data_length = 0;
+  status.encoded_body_length = 0;
+  status.decoded_body_length = 0;
+  status.should_report_corb_blocking = should_report_corb_blocking;
+  url_loader_client_->OnComplete(status);
+
+  // Reset the connection to the URLLoaderClient.  This helps ensure that we
+  // won't accidentally leak any data to the renderer from this point on.
+  url_loader_client_.reset();
+}
+
 URLLoader::BlockResponseForCorbResult URLLoader::BlockResponseForCorb() {
   // The response headers and body shouldn't yet be sent to the URLLoaderClient.
   DCHECK(response_);
@@ -1284,27 +1329,17 @@
       std::move(empty_data_pipe.consumer_handle));
 
   // Tell the real URLLoaderClient that the response has been completed.
-  URLLoaderCompletionStatus status;
+  bool should_report_corb_blocking =
+      corb_analyzer_->ShouldReportBlockedResponse();
   if (resource_type_ == factory_params_->corb_detachable_resource_type) {
     // TODO(lukasza): https://crbug.com/827633#c5: Consider passing net::ERR_OK
     // instead.  net::ERR_ABORTED was chosen for consistency with the old CORB
     // implementation that used to go through DetachableResourceHandler.
-    status.error_code = net::ERR_ABORTED;
+    CompleteBlockedResponse(net::ERR_ABORTED, should_report_corb_blocking);
   } else {
     // CORB responses are reported as a success.
-    status.error_code = net::OK;
+    CompleteBlockedResponse(net::OK, should_report_corb_blocking);
   }
-  status.completion_time = base::TimeTicks::Now();
-  status.encoded_data_length = 0;
-  status.encoded_body_length = 0;
-  status.decoded_body_length = 0;
-  status.should_report_corb_blocking =
-      corb_analyzer_->ShouldReportBlockedResponse();
-  url_loader_client_->OnComplete(status);
-
-  // Reset the connection to the URLLoaderClient.  This helps ensure that we
-  // won't accidentally leak any data to the renderer from this point on.
-  url_loader_client_.reset();
 
   // If the factory is asking to complete requests of this type, then we need to
   // continue processing the response to make sure the network cache is
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 5692c241..6e4ac69 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -26,6 +26,7 @@
 #include "services/network/cross_origin_read_blocking.h"
 #include "services/network/initiator_lock_compatibility.h"
 #include "services/network/keepalive_statistics_recorder.h"
+#include "services/network/public/mojom/fetch_api.mojom.h"
 #include "services/network/public/mojom/network_service.mojom.h"
 #include "services/network/public/mojom/url_loader.mojom.h"
 #include "services/network/resource_scheduler.h"
@@ -199,6 +200,9 @@
       const base::Optional<std::string>& headers,
       const GURL& allowed_unsafe_redirect_url);
 
+  void CompleteBlockedResponse(int error_code,
+                               bool should_report_corb_blocking);
+
   enum BlockResponseForCorbResult {
     // Returned when caller of BlockResponseForCorb doesn't need to continue,
     // because the request will be cancelled soon.
@@ -293,6 +297,8 @@
   // CORB-excluded requests must be blocked if the CORS check fails.
   bool is_nocors_corb_excluded_request_ = false;
 
+  mojom::FetchRequestMode fetch_request_mode_;
+
   scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_;
 
   mojom::SSLPrivateKeyPtr ssl_private_key_;
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc
index 8ba1e3b..c8bd20e2 100644
--- a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc
+++ b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc
@@ -12,10 +12,6 @@
 namespace {
 MemoryInstrumentation* g_instance = nullptr;
 
-void DestroyCoordinatorTLS(void* tls_object) {
-  delete reinterpret_cast<mojom::CoordinatorPtr*>(tls_object);
-};
-
 void WrapGlobalMemoryDump(
     MemoryInstrumentation::RequestGlobalDumpCallback callback,
     bool success,
@@ -42,7 +38,6 @@
     const std::string& service_name)
     : connector_(connector),
       connector_task_runner_(base::ThreadTaskRunnerHandle::Get()),
-      tls_coordinator_(&DestroyCoordinatorTLS),
       service_name_(service_name) {
   DCHECK(connector_task_runner_);
 }
@@ -90,11 +85,11 @@
 
 const mojom::CoordinatorPtr&
 MemoryInstrumentation::GetCoordinatorBindingForCurrentThread() {
-  mojom::CoordinatorPtr* coordinator =
-      reinterpret_cast<mojom::CoordinatorPtr*>(tls_coordinator_.Get());
+  mojom::CoordinatorPtr* coordinator = tls_coordinator_.Get();
   if (!coordinator) {
-    coordinator = new mojom::CoordinatorPtr();
-    tls_coordinator_.Set(coordinator);
+    auto new_coordinator = std::make_unique<mojom::CoordinatorPtr>();
+    coordinator = new_coordinator.get();
+    tls_coordinator_.Set(std::move(new_coordinator));
     mojom::CoordinatorRequest coordinator_req = mojo::MakeRequest(coordinator);
 
     // The connector is not thread safe and BindInterface must be called on its
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h
index d449685..1a29083 100644
--- a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h
+++ b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h
@@ -8,7 +8,7 @@
 #include "base/callback_forward.h"
 #include "base/component_export.h"
 #include "base/memory/ref_counted.h"
-#include "base/threading/thread_local_storage.h"
+#include "base/threading/thread_local.h"
 #include "base/trace_event/memory_dump_request_args.h"
 #include "services/resource_coordinator/public/cpp/memory_instrumentation/coordinator.h"
 #include "services/resource_coordinator/public/cpp/memory_instrumentation/global_memory_dump.h"
@@ -104,7 +104,7 @@
 
   service_manager::Connector* const connector_;
   scoped_refptr<base::SingleThreadTaskRunner> connector_task_runner_;
-  base::ThreadLocalStorage::Slot tls_coordinator_;
+  base::ThreadLocalOwnedPointer<mojom::CoordinatorPtr> tls_coordinator_;
   const std::string service_name_;
 
   DISALLOW_COPY_AND_ASSIGN(MemoryInstrumentation);
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc
index 1bd6859..cddff6e2 100644
--- a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc
+++ b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <dlfcn.h>
 #include <fcntl.h>
 #include <stdint.h>
 #include <memory>
@@ -59,7 +60,28 @@
   return base::ProcessMetrics::CreateProcessMetrics(pid);
 }
 
-bool ParseSmapsHeader(const char* header_line, VmRegion* region) {
+struct ModuleData {
+  std::string path;
+  std::string build_id;
+};
+
+ModuleData GetMainModuleData() {
+  ModuleData module_data;
+  Dl_info dl_info;
+  if (dladdr(&__ehdr_start, &dl_info)) {
+    base::Optional<std::string> build_id =
+        base::debug::ReadElfBuildId(&__ehdr_start);
+    if (build_id) {
+      module_data.path = dl_info.dli_fname;
+      module_data.build_id = *build_id;
+    }
+  }
+  return module_data;
+}
+
+bool ParseSmapsHeader(const char* header_line,
+                      const ModuleData& main_module_data,
+                      VmRegion* region) {
   // e.g., "00400000-00421000 r-xp 00000000 fc:01 1234  /foo.so\n"
   bool res = true;  // Whether this region should be appended or skipped.
   uint64_t end_addr = 0;
@@ -102,12 +124,11 @@
   // official builds. Build ID is only added for the current library (chrome)
   // since it is racy to read other libraries which can be unmapped any time.
 #if defined(OFFICIAL_BUILD)
-  uintptr_t addr = reinterpret_cast<uintptr_t>(&ParseSmapsHeader);
-  if (addr >= region->start_address && addr < end_addr) {
-    base::Optional<std::string> buildid =
-        base::debug::ReadElfBuildId(&__ehdr_start);
-    if (buildid)
-      region->module_debugid = buildid.value();
+  if (!region->mapped_file.empty() &&
+      base::StartsWith(main_module_data.path, region->mapped_file,
+                       base::CompareCase::SENSITIVE) &&
+      !main_module_data.build_id.empty()) {
+    region->module_debugid = main_module_data.build_id;
   }
 #endif  // defined(OFFICIAL_BUILD)
 
@@ -160,6 +181,7 @@
   uint32_t num_valid_regions = 0;
   bool should_add_current_region = false;
   VmRegion region;
+  ModuleData main_module_data = GetMainModuleData();
   for (;;) {
     line[0] = '\0';
     if (fgets(line, kMaxLineSize, smaps_file) == nullptr || !strlen(line))
@@ -167,7 +189,8 @@
     if (isxdigit(line[0]) && !isupper(line[0])) {
       region = VmRegion();
       counters_parsed_for_current_region = 0;
-      should_add_current_region = ParseSmapsHeader(line, &region);
+      should_add_current_region =
+          ParseSmapsHeader(line, main_module_data, &region);
     } else if (should_add_current_region) {
       counters_parsed_for_current_region += ParseSmapsCounter(line, &region);
       DCHECK_LE(counters_parsed_for_current_region,
diff --git a/services/service_manager/public/cpp/BUILD.gn b/services/service_manager/public/cpp/BUILD.gn
index 08524d3..c591275f 100644
--- a/services/service_manager/public/cpp/BUILD.gn
+++ b/services/service_manager/public/cpp/BUILD.gn
@@ -42,6 +42,10 @@
     "//url",
   ]
 
+  deps = [
+    "//services/tracing/public/cpp:traced_process",
+  ]
+
   defines = [
     "IS_SERVICE_MANAGER_CPP_IMPL",
 
diff --git a/services/service_manager/public/cpp/DEPS b/services/service_manager/public/cpp/DEPS
new file mode 100644
index 0000000..31137ba
--- /dev/null
+++ b/services/service_manager/public/cpp/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+  "+services/tracing/public",
+]
diff --git a/services/service_manager/public/cpp/service_binding.cc b/services/service_manager/public/cpp/service_binding.cc
index 31a3d8dc..28356da 100644
--- a/services/service_manager/public/cpp/service_binding.cc
+++ b/services/service_manager/public/cpp/service_binding.cc
@@ -10,6 +10,8 @@
 #include "base/no_destructor.h"
 #include "base/synchronization/lock.h"
 #include "services/service_manager/public/cpp/service.h"
+#include "services/tracing/public/cpp/traced_process.h"
+#include "services/tracing/public/mojom/tracing.mojom.h"
 
 namespace service_manager {
 
@@ -166,6 +168,12 @@
     return;
   }
 
+  if (interface_name == tracing::mojom::TracedProcess::Name_) {
+    tracing::TracedProcess::OnTracedProcessRequest(
+        tracing::mojom::TracedProcessRequest(std::move(interface_pipe)));
+    return;
+  }
+
   service_->OnBindInterface(source_info, interface_name,
                             std::move(interface_pipe));
 }
diff --git a/services/tracing/BUILD.gn b/services/tracing/BUILD.gn
index 7ad33670..5bb9bc0 100644
--- a/services/tracing/BUILD.gn
+++ b/services/tracing/BUILD.gn
@@ -33,6 +33,7 @@
   public_deps = [
     "//base",
     "//mojo/public/cpp/bindings",
+    "//services/service_manager/public/cpp",
     "//services/tracing/public/cpp",
     "//third_party/perfetto:libperfetto",
   ]
diff --git a/services/tracing/agent_registry.cc b/services/tracing/agent_registry.cc
index 5b15616..25d8209 100644
--- a/services/tracing/agent_registry.cc
+++ b/services/tracing/agent_registry.cc
@@ -74,21 +74,23 @@
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 }
 
+void AgentRegistry::DisconnectAllAgents() {
+  bindings_.CloseAllBindings();
+}
+
 void AgentRegistry::BindAgentRegistryRequest(
     scoped_refptr<base::SequencedTaskRunner> task_runner,
-    mojom::AgentRegistryRequest request,
-    const service_manager::BindSourceInfo& source_info) {
+    mojom::AgentRegistryRequest request) {
   task_runner->PostTask(
       FROM_HERE,
       base::BindOnce(&AgentRegistry::BindAgentRegistryRequestOnSequence,
-                     base::Unretained(this), std::move(request), source_info));
+                     base::Unretained(this), std::move(request)));
 }
 
 void AgentRegistry::BindAgentRegistryRequestOnSequence(
-    mojom::AgentRegistryRequest request,
-    const service_manager::BindSourceInfo& source_info) {
+    mojom::AgentRegistryRequest request) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  bindings_.AddBinding(this, std::move(request), source_info.identity);
+  bindings_.AddBinding(this, std::move(request));
 }
 
 size_t AgentRegistry::SetAgentInitializationCallback(
diff --git a/services/tracing/agent_registry.h b/services/tracing/agent_registry.h
index ba1e0e2..d87ba0ee 100644
--- a/services/tracing/agent_registry.h
+++ b/services/tracing/agent_registry.h
@@ -17,10 +17,6 @@
 #include "services/service_manager/public/cpp/identity.h"
 #include "services/tracing/public/mojom/tracing.mojom.h"
 
-namespace service_manager {
-struct BindSourceInfo;
-}  // namespace service_manager
-
 namespace tracing {
 
 class AgentRegistry : public mojom::AgentRegistry {
@@ -69,10 +65,12 @@
   AgentRegistry();
   ~AgentRegistry() override;
 
+  void DisconnectAllAgents();
+
   void BindAgentRegistryRequest(
       scoped_refptr<base::SequencedTaskRunner> task_runner,
-      mojom::AgentRegistryRequest request,
-      const service_manager::BindSourceInfo& source_info);
+      mojom::AgentRegistryRequest request);
+
   // Returns the number of existing agents that the callback was run on.
   size_t SetAgentInitializationCallback(
       const AgentInitializationCallback& callback,
@@ -91,9 +89,7 @@
   friend class AgentRegistryTest;  // For testing.
   friend class CoordinatorTest;    // For testing.
 
-  void BindAgentRegistryRequestOnSequence(
-      mojom::AgentRegistryRequest request,
-      const service_manager::BindSourceInfo& source_info);
+  void BindAgentRegistryRequestOnSequence(mojom::AgentRegistryRequest request);
 
   // mojom::AgentRegistry
   void RegisterAgent(mojom::AgentPtr agent,
@@ -103,7 +99,7 @@
 
   void UnregisterAgent(size_t agent_id);
 
-  mojo::BindingSet<mojom::AgentRegistry, service_manager::Identity> bindings_;
+  mojo::BindingSet<mojom::AgentRegistry> bindings_;
   size_t next_agent_id_ = 0;
   std::map<size_t, std::unique_ptr<AgentEntry>> agents_;
   AgentInitializationCallback agent_initialization_callback_;
diff --git a/services/tracing/coordinator.cc b/services/tracing/coordinator.cc
index 1642c2f..e3fad08 100644
--- a/services/tracing/coordinator.cc
+++ b/services/tracing/coordinator.cc
@@ -268,8 +268,10 @@
   DISALLOW_COPY_AND_ASSIGN(TraceStreamer);
 };
 
-Coordinator::Coordinator(AgentRegistry* agent_registry)
-    : binding_(this),
+Coordinator::Coordinator(AgentRegistry* agent_registry,
+                         const base::RepeatingClosure& on_disconnect_callback)
+    : on_disconnect_callback_(std::move(on_disconnect_callback)),
+      binding_(this),
       task_runner_(base::ThreadTaskRunnerHandle::Get()),
       // USER_VISIBLE because the task posted from StopAndFlushInternal() is
       // required to stop tracing from the UI.
@@ -285,6 +287,14 @@
 }
 
 Coordinator::~Coordinator() {
+  Reset();
+}
+
+bool Coordinator::IsConnected() {
+  return !!binding_;
+}
+
+void Coordinator::Reset() {
   if (!stop_and_flush_callback_.is_null()) {
     base::ResetAndReturn(&stop_and_flush_callback_)
         .Run(base::Value(base::Value::Type::DICTIONARY));
@@ -306,10 +316,17 @@
   }
 }
 
+void Coordinator::OnClientConnectionError() {
+  Reset();
+  binding_.Close();
+  on_disconnect_callback_.Run();
+}
 void Coordinator::BindCoordinatorRequest(
     mojom::CoordinatorRequest request,
     const service_manager::BindSourceInfo& source_info) {
   binding_.Bind(std::move(request));
+  binding_.set_connection_error_handler(base::BindRepeating(
+      &Coordinator::OnClientConnectionError, base::Unretained(this)));
 }
 
 void Coordinator::StartTracing(const std::string& config,
@@ -327,10 +344,12 @@
       base::BindRepeating(&Coordinator::SendStartTracingToAgent,
                           weak_ptr_factory_.GetWeakPtr()),
       false /* call_on_new_agents_only */);
-  if (!agent_registry_->HasDisconnectClosure(&kStartTracingClosureName)) {
-    std::move(callback).Run(true);
-    return;
-  }
+
+  // We specifically don't check for the case where there's
+  // no existing connected agents; meaning in that case we
+  // assume at least one *will* connect and we'll wait for
+  // it to do so and start tracing before calling the callback
+  // so that the trace will contain data from at least one agent.
   start_tracing_callback_ = std::move(callback);
 }
 
@@ -467,7 +486,7 @@
 
   maximum_trace_buffer_usage_ = 0;
   approximate_event_count_ = 0;
-  request_buffer_usage_callback_ = std::move(callback);
+
   agent_registry_->ForAllAgents([this](AgentRegistry::AgentEntry* agent_entry) {
     agent_entry->AddDisconnectClosure(
         &kRequestBufferUsageClosureName,
@@ -479,6 +498,12 @@
         &Coordinator::OnRequestBufferStatusResponse,
         weak_ptr_factory_.GetWeakPtr(), base::Unretained(agent_entry)));
   });
+
+  if (!agent_registry_->HasDisconnectClosure(&kRequestBufferUsageClosureName)) {
+    std::move(callback).Run(true, 0.0f, 0);
+    return;
+  }
+  request_buffer_usage_callback_ = std::move(callback);
 }
 
 void Coordinator::OnRequestBufferStatusResponse(
diff --git a/services/tracing/coordinator.h b/services/tracing/coordinator.h
index f09f013c..eecae55 100644
--- a/services/tracing/coordinator.h
+++ b/services/tracing/coordinator.h
@@ -41,21 +41,28 @@
 // implement the same interface.
 class Coordinator : public mojom::Coordinator {
  public:
-  explicit Coordinator(AgentRegistry* agent_registry);
+  Coordinator(AgentRegistry* agent_registry,
+              const base::RepeatingClosure& on_disconnect_callback);
 
   void BindCoordinatorRequest(
       mojom::CoordinatorRequest request,
       const service_manager::BindSourceInfo& source_info);
 
+  bool IsConnected();
+
  protected:
   ~Coordinator() override;
 
+  virtual void OnClientConnectionError();
+
  private:
   friend std::default_delete<Coordinator>;
   friend class CoordinatorTest;  // For testing.
 
   class TraceStreamer;
 
+  void Reset();
+
   // mojom::Coordinator
   void StartTracing(const std::string& config,
                     StartTracingCallback callback) override;
@@ -82,6 +89,7 @@
                                      uint32_t capacity,
                                      uint32_t count);
 
+  base::RepeatingClosure on_disconnect_callback_;
   mojo::Binding<mojom::Coordinator> binding_;
   const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
   const scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
diff --git a/services/tracing/coordinator_unittest.cc b/services/tracing/coordinator_unittest.cc
index 6ac773a6..f986892 100644
--- a/services/tracing/coordinator_unittest.cc
+++ b/services/tracing/coordinator_unittest.cc
@@ -29,7 +29,8 @@
   // testing::Test
   void SetUp() override {
     agent_registry_ = std::make_unique<AgentRegistry>();
-    coordinator_ = std::make_unique<Coordinator>(agent_registry_.get());
+    coordinator_ = std::make_unique<Coordinator>(agent_registry_.get(),
+                                                 base::RepeatingClosure());
     output_ = "";
   }
 
@@ -341,6 +342,7 @@
 
 TEST_F(CoordinatorTest, IsTracing) {
   base::RunLoop run_loop;
+  AddArrayAgent();
   StartTracing("config", true);
   IsTracing(true);
   run_loop.RunUntilIdle();
diff --git a/services/tracing/manifest.cc b/services/tracing/manifest.cc
index eb30ff0f..80af37f 100644
--- a/services/tracing/manifest.cc
+++ b/services/tracing/manifest.cc
@@ -21,15 +21,15 @@
                            .WithInstanceSharingPolicy(
                                service_manager::Manifest::
                                    InstanceSharingPolicy::kSingleton)
+                           .CanConnectToInstancesWithAnyId(true)
                            .Build())
           .ExposeCapability(
               "tracing",
               service_manager::Manifest::InterfaceList<mojom::Coordinator>())
-          .ExposeCapability("app",
-                            service_manager::Manifest::InterfaceList<
-                                mojom::AgentRegistry, mojom::PerfettoService>())
           .RequireCapability("service_manager",
                              "service_manager:service_manager")
+          .WithInterfacesBindableOnAnyService(
+              service_manager::Manifest::InterfaceList<mojom::TracedProcess>())
           .Build()};
   return *manifest;
 }
diff --git a/services/tracing/perfetto/perfetto_service.cc b/services/tracing/perfetto/perfetto_service.cc
index e4f1acc..91ad804 100644
--- a/services/tracing/perfetto/perfetto_service.cc
+++ b/services/tracing/perfetto/perfetto_service.cc
@@ -82,20 +82,15 @@
   return service_.get();
 }
 
-void PerfettoService::BindRequest(
-    mojom::PerfettoServiceRequest request,
-    const service_manager::BindSourceInfo& source_info) {
+void PerfettoService::BindRequest(mojom::PerfettoServiceRequest request) {
   perfetto_task_runner_.task_runner()->PostTask(
-      FROM_HERE,
-      base::BindOnce(&PerfettoService::BindOnSequence, base::Unretained(this),
-                     std::move(request), source_info.identity));
+      FROM_HERE, base::BindOnce(&PerfettoService::BindOnSequence,
+                                base::Unretained(this), std::move(request)));
 }
 
-void PerfettoService::BindOnSequence(
-    mojom::PerfettoServiceRequest request,
-    const service_manager::Identity& identity) {
+void PerfettoService::BindOnSequence(mojom::PerfettoServiceRequest request) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  bindings_.AddBinding(this, std::move(request), identity);
+  bindings_.AddBinding(this, std::move(request));
 }
 
 void PerfettoService::ConnectToProducerHost(
diff --git a/services/tracing/perfetto/perfetto_service.h b/services/tracing/perfetto/perfetto_service.h
index 7be1c65d..1bcb1c81 100644
--- a/services/tracing/perfetto/perfetto_service.h
+++ b/services/tracing/perfetto/perfetto_service.h
@@ -17,10 +17,6 @@
 #include "services/tracing/public/cpp/perfetto/task_runner.h"
 #include "services/tracing/public/mojom/perfetto_service.mojom.h"
 
-namespace service_manager {
-struct BindSourceInfo;
-}  // namespace service_manager
-
 namespace perfetto {
 class TracingService;
 }  // namespace perfetto
@@ -39,8 +35,7 @@
 
   static PerfettoService* GetInstance();
 
-  void BindRequest(mojom::PerfettoServiceRequest request,
-                   const service_manager::BindSourceInfo& source_info);
+  void BindRequest(mojom::PerfettoServiceRequest request);
 
   // mojom::PerfettoService implementation.
   void ConnectToProducerHost(mojom::ProducerClientPtr producer_client,
@@ -52,13 +47,12 @@
   }
 
  private:
-  void BindOnSequence(mojom::PerfettoServiceRequest request,
-                      const service_manager::Identity& identity);
+  void BindOnSequence(mojom::PerfettoServiceRequest request);
   void CreateServiceOnSequence();
 
   PerfettoTaskRunner perfetto_task_runner_;
   std::unique_ptr<perfetto::TracingService> service_;
-  mojo::BindingSet<mojom::PerfettoService, service_manager::Identity> bindings_;
+  mojo::BindingSet<mojom::PerfettoService> bindings_;
   mojo::StrongBindingSet<mojom::ProducerHost> producer_bindings_;
   SEQUENCE_CHECKER(sequence_checker_);
 
diff --git a/services/tracing/perfetto/perfetto_tracing_coordinator.cc b/services/tracing/perfetto/perfetto_tracing_coordinator.cc
index 109ee11..1916281c 100644
--- a/services/tracing/perfetto/perfetto_tracing_coordinator.cc
+++ b/services/tracing/perfetto/perfetto_tracing_coordinator.cc
@@ -69,8 +69,11 @@
 };
 
 PerfettoTracingCoordinator::PerfettoTracingCoordinator(
-    AgentRegistry* agent_registry)
-    : Coordinator(agent_registry), binding_(this), weak_factory_(this) {
+    AgentRegistry* agent_registry,
+    base::RepeatingClosure on_disconnect_callback)
+    : Coordinator(agent_registry, std::move(on_disconnect_callback)),
+      binding_(this),
+      weak_factory_(this) {
   DETACH_FROM_SEQUENCE(sequence_checker_);
 }
 
@@ -81,6 +84,8 @@
 void PerfettoTracingCoordinator::OnClientConnectionError() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   tracing_session_.reset();
+  binding_.Close();
+  Coordinator::OnClientConnectionError();
 }
 
 void PerfettoTracingCoordinator::BindCoordinatorRequest(
diff --git a/services/tracing/perfetto/perfetto_tracing_coordinator.h b/services/tracing/perfetto/perfetto_tracing_coordinator.h
index add85bb..26b53ed 100644
--- a/services/tracing/perfetto/perfetto_tracing_coordinator.h
+++ b/services/tracing/perfetto/perfetto_tracing_coordinator.h
@@ -26,7 +26,8 @@
 // collecting trace events behind the scenes.
 class PerfettoTracingCoordinator : public Coordinator {
  public:
-  explicit PerfettoTracingCoordinator(AgentRegistry* agent_registry);
+  PerfettoTracingCoordinator(AgentRegistry* agent_registry,
+                             base::RepeatingClosure on_disconnect_callback);
 
   ~PerfettoTracingCoordinator() override;
 
@@ -48,7 +49,7 @@
  private:
   void BindOnSequence(mojom::CoordinatorRequest request);
   void OnTracingOverCallback();
-  void OnClientConnectionError();
+  void OnClientConnectionError() override;
 
   mojo::Binding<mojom::Coordinator> binding_;
 
diff --git a/services/tracing/public/DEPS b/services/tracing/public/DEPS
new file mode 100644
index 0000000..938b520
--- /dev/null
+++ b/services/tracing/public/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+  "-services/service_manager/public",  # The service_manager client lib depends on the tracing one
+]
diff --git a/services/tracing/public/cpp/BUILD.gn b/services/tracing/public/cpp/BUILD.gn
index dfd910a..ff23910 100644
--- a/services/tracing/public/cpp/BUILD.gn
+++ b/services/tracing/public/cpp/BUILD.gn
@@ -2,41 +2,61 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-component("cpp") {
+source_set("traced_process") {
   sources = [
-    "base_agent.cc",
-    "base_agent.h",
-    "perfetto/producer_client.cc",
-    "perfetto/producer_client.h",
-    "perfetto/shared_memory.cc",
-    "perfetto/shared_memory.h",
-    "perfetto/task_runner.cc",
-    "perfetto/task_runner.h",
-    "perfetto/trace_event_data_source.cc",
-    "perfetto/trace_event_data_source.h",
-    "perfetto/traced_value_proto_writer.cc",
-    "perfetto/traced_value_proto_writer.h",
-    "trace_event_agent.cc",
-    "trace_event_agent.h",
-    "tracing_features.cc",
-    "tracing_features.h",
+    "traced_process.cc",
+    "traced_process.h",
   ]
 
-  defines = [ "IS_TRACING_CPP_IMPL" ]
-  output_name = "tracing_cpp"
-
-  configs += [ "//build/config/compiler:wexit_time_destructors" ]
-
   public_deps = [
-    "//base",
-    "//mojo/public/cpp/bindings",
-    "//services/service_manager/public/cpp",
     "//services/tracing/public/mojom",
-    "//third_party/perfetto:libperfetto",
   ]
 
-  deps = [
-    "//third_party/perfetto/include/perfetto/protozero:protozero",
-    "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
-  ]
+  if (!is_nacl && !is_ios) {
+    deps = [
+      ":cpp",
+    ]
+  }
 }
+
+if (!is_nacl && !is_ios) {
+  component("cpp") {
+    sources = [
+      "base_agent.cc",
+      "base_agent.h",
+      "perfetto/producer_client.cc",
+      "perfetto/producer_client.h",
+      "perfetto/shared_memory.cc",
+      "perfetto/shared_memory.h",
+      "perfetto/task_runner.cc",
+      "perfetto/task_runner.h",
+      "perfetto/trace_event_data_source.cc",
+      "perfetto/trace_event_data_source.h",
+      "perfetto/traced_value_proto_writer.cc",
+      "perfetto/traced_value_proto_writer.h",
+      "trace_event_agent.cc",
+      "trace_event_agent.h",
+      "traced_process_impl.cc",
+      "traced_process_impl.h",
+      "tracing_features.cc",
+      "tracing_features.h",
+    ]
+
+    defines = [ "IS_TRACING_CPP_IMPL" ]
+    output_name = "tracing_cpp"
+
+    configs += [ "//build/config/compiler:wexit_time_destructors" ]
+
+    public_deps = [
+      "//base",
+      "//mojo/public/cpp/bindings",
+      "//services/tracing/public/mojom",
+      "//third_party/perfetto:libperfetto",
+    ]
+
+    deps = [
+      "//third_party/perfetto/include/perfetto/protozero:protozero",
+      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
+    ]
+  }
+}  # !is_nacl && !is_ios
diff --git a/services/tracing/public/cpp/base_agent.cc b/services/tracing/public/cpp/base_agent.cc
index 1575036..4c16162 100644
--- a/services/tracing/public/cpp/base_agent.cc
+++ b/services/tracing/public/cpp/base_agent.cc
@@ -6,7 +6,7 @@
 
 #include <utility>
 
-#include "services/service_manager/public/cpp/connector.h"
+#include "services/tracing/public/cpp/traced_process_impl.h"
 #include "services/tracing/public/mojom/constants.mojom.h"
 
 namespace tracing {
@@ -14,22 +14,29 @@
 BaseAgent::BaseAgent(const std::string& label,
                      mojom::TraceDataType type,
                      base::ProcessId pid)
-    : binding_(this), label_(label), type_(type), pid_(pid) {}
+    : binding_(this), label_(label), type_(type), pid_(pid) {
+  TracedProcessImpl::GetInstance()->RegisterAgent(this);
+}
 
-BaseAgent::~BaseAgent() = default;
+BaseAgent::~BaseAgent() {
+  TracedProcessImpl::GetInstance()->UnregisterAgent(this);
+}
 
-void BaseAgent::Connect(service_manager::Connector* connector) {
-  DCHECK(!binding_ || !binding_.is_bound());
-  tracing::mojom::AgentRegistryPtr agent_registry;
-  connector->BindInterface(tracing::mojom::kServiceName, &agent_registry);
-
+void BaseAgent::Connect(tracing::mojom::AgentRegistry* agent_registry) {
   tracing::mojom::AgentPtr agent;
   binding_.Bind(mojo::MakeRequest(&agent));
+  binding_.set_connection_error_handler(
+      base::BindRepeating(&BaseAgent::Disconnect, base::Unretained(this)));
+
   agent_registry->RegisterAgent(std::move(agent), label_, type_, pid_);
 }
 
 void BaseAgent::GetCategories(std::set<std::string>* category_set) {}
 
+void BaseAgent::Disconnect() {
+  binding_.Close();
+}
+
 void BaseAgent::StartTracing(const std::string& config,
                              base::TimeTicks coordinator_time,
                              Agent::StartTracingCallback callback) {
diff --git a/services/tracing/public/cpp/base_agent.h b/services/tracing/public/cpp/base_agent.h
index f93c8dc..8be2cf54 100644
--- a/services/tracing/public/cpp/base_agent.h
+++ b/services/tracing/public/cpp/base_agent.h
@@ -5,16 +5,13 @@
 #ifndef SERVICES_TRACING_PUBLIC_CPP_BASE_AGENT_H_
 #define SERVICES_TRACING_PUBLIC_CPP_BASE_AGENT_H_
 
+#include <set>
 #include <string>
 
 #include "base/component_export.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "services/tracing/public/mojom/tracing.mojom.h"
 
-namespace service_manager {
-class Connector;
-}  // namespace service_manager
-
 // This class is a minimal implementation of mojom::Agent to reduce boilerplate
 // code in tracing agents. A tracing agent can inherit from this class and only
 // override methods that actually do something, in most cases only StartTracing
@@ -24,7 +21,8 @@
  public:
   ~BaseAgent() override;
 
-  virtual void Connect(service_manager::Connector* connector);
+  void Connect(tracing::mojom::AgentRegistry* agent_registry);
+
   virtual void GetCategories(std::set<std::string>* category_set);
 
  protected:
@@ -33,6 +31,8 @@
             base::ProcessId pid);
 
  private:
+  void Disconnect();
+
   // tracing::mojom::Agent:
   void StartTracing(const std::string& config,
                     base::TimeTicks coordinator_time,
diff --git a/services/tracing/public/cpp/perfetto/producer_client.cc b/services/tracing/public/cpp/perfetto/producer_client.cc
index 4ad615f..00d781c9 100644
--- a/services/tracing/public/cpp/perfetto/producer_client.cc
+++ b/services/tracing/public/cpp/perfetto/producer_client.cc
@@ -8,7 +8,6 @@
 
 #include "base/no_destructor.h"
 #include "base/task/post_task.h"
-#include "services/service_manager/public/cpp/connector.h"
 #include "services/tracing/public/cpp/perfetto/shared_memory.h"
 #include "services/tracing/public/mojom/constants.mojom.h"
 #include "third_party/perfetto/include/perfetto/tracing/core/commit_data_request.h"
@@ -81,10 +80,7 @@
   GetPerfettoTaskRunner()->ResetTaskRunnerForTesting(CreateTaskRunner());
 }
 
-void ProducerClient::Connect(service_manager::Connector* connector) {
-  mojom::PerfettoServicePtr perfetto_service;
-  connector->BindInterface(mojom::kServiceName, &perfetto_service);
-
+void ProducerClient::Connect(mojom::PerfettoServicePtr perfetto_service) {
   CreateMojoMessagepipes(base::BindOnce(
       [](mojom::PerfettoServicePtr perfetto_service,
          mojom::ProducerClientPtr producer_client_pipe,
diff --git a/services/tracing/public/cpp/perfetto/producer_client.h b/services/tracing/public/cpp/perfetto/producer_client.h
index 1473236..7514d7c 100644
--- a/services/tracing/public/cpp/perfetto/producer_client.h
+++ b/services/tracing/public/cpp/perfetto/producer_client.h
@@ -25,10 +25,6 @@
 class SharedMemoryArbiter;
 }  // namespace perfetto
 
-namespace service_manager {
-class Connector;
-}  // namespace service_manager
-
 namespace tracing {
 
 class MojoSharedMemory;
@@ -84,7 +80,7 @@
   // Returns the taskrunner used by Perfetto.
   static base::SequencedTaskRunner* GetTaskRunner();
 
-  void Connect(service_manager::Connector* connector);
+  void Connect(mojom::PerfettoServicePtr perfetto_service);
 
   // Create the messagepipes that'll be used to connect
   // to the service-side ProducerHost, on the correct
diff --git a/services/tracing/public/cpp/trace_event_agent.cc b/services/tracing/public/cpp/trace_event_agent.cc
index 214b90d..94cc70a 100644
--- a/services/tracing/public/cpp/trace_event_agent.cc
+++ b/services/tracing/public/cpp/trace_event_agent.cc
@@ -48,16 +48,6 @@
 
 TraceEventAgent::~TraceEventAgent() = default;
 
-void TraceEventAgent::Connect(service_manager::Connector* connector) {
-  // |connector| can be null in tests.
-  if (!connector) {
-    return;
-  }
-
-  BaseAgent::Connect(connector);
-  ProducerClient::Get()->Connect(connector);
-}
-
 void TraceEventAgent::GetCategories(std::set<std::string>* category_set) {
   for (size_t i = base::trace_event::BuiltinCategories::kVisibleCategoryStart;
        i < base::trace_event::BuiltinCategories::Size(); ++i) {
diff --git a/services/tracing/public/cpp/trace_event_agent.h b/services/tracing/public/cpp/trace_event_agent.h
index bceea7e..70063d2 100644
--- a/services/tracing/public/cpp/trace_event_agent.h
+++ b/services/tracing/public/cpp/trace_event_agent.h
@@ -6,6 +6,7 @@
 #define SERVICES_TRACING_PUBLIC_CPP_TRACE_EVENT_AGENT_H_
 
 #include <memory>
+#include <set>
 #include <string>
 #include <vector>
 
@@ -21,10 +22,6 @@
 class TimeTicks;
 }  // namespace base
 
-namespace service_manager {
-class Connector;
-}  // namespace service_manager
-
 namespace tracing {
 
 // Agent used to interface with the legacy tracing system.
@@ -36,7 +33,6 @@
  public:
   static TraceEventAgent* GetInstance();
 
-  void Connect(service_manager::Connector* connector) override;
   void GetCategories(std::set<std::string>* category_set) override;
 
   using MetadataGeneratorFunction =
diff --git a/services/tracing/public/cpp/traced_process.cc b/services/tracing/public/cpp/traced_process.cc
new file mode 100644
index 0000000..56b9f602
--- /dev/null
+++ b/services/tracing/public/cpp/traced_process.cc
@@ -0,0 +1,26 @@
+// Copyright 2019 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 "services/tracing/public/cpp/traced_process.h"
+
+#include <utility>
+
+#include "build/build_config.h"
+
+#if !defined(OS_NACL) && !defined(OS_IOS)
+#include "services/tracing/public/cpp/traced_process_impl.h"
+#endif
+
+namespace tracing {
+
+// static
+void TracedProcess::OnTracedProcessRequest(
+    mojom::TracedProcessRequest request) {
+#if !defined(OS_NACL) && !defined(OS_IOS)
+  tracing::TracedProcessImpl::GetInstance()->OnTracedProcessRequest(
+      std::move(request));
+#endif
+}
+
+}  // namespace tracing
diff --git a/services/tracing/public/cpp/traced_process.h b/services/tracing/public/cpp/traced_process.h
new file mode 100644
index 0000000..3e29463
--- /dev/null
+++ b/services/tracing/public/cpp/traced_process.h
@@ -0,0 +1,19 @@
+// Copyright 2019 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 SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_H_
+#define SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_H_
+
+#include "services/tracing/public/mojom/tracing.mojom.h"
+
+namespace tracing {
+
+class TracedProcess {
+ public:
+  static void OnTracedProcessRequest(mojom::TracedProcessRequest request);
+};
+
+}  // namespace tracing
+
+#endif  // SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_H_
diff --git a/services/tracing/public/cpp/traced_process_impl.cc b/services/tracing/public/cpp/traced_process_impl.cc
new file mode 100644
index 0000000..daa0531
--- /dev/null
+++ b/services/tracing/public/cpp/traced_process_impl.cc
@@ -0,0 +1,101 @@
+// Copyright 2019 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 "services/tracing/public/cpp/traced_process_impl.h"
+
+#include <utility>
+
+#include "base/no_destructor.h"
+#include "services/tracing/public/cpp/base_agent.h"
+#include "services/tracing/public/cpp/perfetto/producer_client.h"
+#include "services/tracing/public/cpp/trace_event_agent.h"
+#include "services/tracing/public/mojom/constants.mojom.h"
+
+namespace tracing {
+
+// static
+TracedProcessImpl* TracedProcessImpl::GetInstance() {
+  static base::NoDestructor<TracedProcessImpl> traced_process;
+  return traced_process.get();
+}
+
+TracedProcessImpl::TracedProcessImpl() : binding_(this) {
+  DETACH_FROM_SEQUENCE(sequence_checker_);
+}
+
+TracedProcessImpl::~TracedProcessImpl() = default;
+
+// OnTracedProcessRequest can be called concurrently from
+// multiple threads, as we get one call per service.
+void TracedProcessImpl::OnTracedProcessRequest(
+    mojom::TracedProcessRequest request) {
+  if (task_runner_ && !task_runner_->RunsTasksInCurrentSequence()) {
+    task_runner_->PostTask(
+        FROM_HERE, base::BindOnce(&TracedProcessImpl::OnTracedProcessRequest,
+                                  base::Unretained(this), std::move(request)));
+    return;
+  }
+
+  // We only need one binding per process.
+  base::AutoLock lock(lock_);
+  if (binding_.is_bound()) {
+    return;
+  }
+
+  binding_.Bind(std::move(request));
+}
+
+// SetTaskRunner must be called before we start receiving
+// any OnTracedProcessRequest calls.
+void TracedProcessImpl::SetTaskRunner(
+    scoped_refptr<base::SequencedTaskRunner> task_runner) {
+  DCHECK(!binding_.is_bound());
+  DCHECK(!task_runner_);
+  task_runner_ = task_runner;
+}
+
+void TracedProcessImpl::RegisterAgent(BaseAgent* agent) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+
+  if (agent_registry_) {
+    agent->Connect(agent_registry_.get());
+  }
+
+  agents_.insert(agent);
+}
+
+void TracedProcessImpl::UnregisterAgent(BaseAgent* agent) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  agents_.erase(agent);
+}
+
+void TracedProcessImpl::ConnectToTracingService(
+    mojom::ConnectToTracingRequestPtr request) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+
+  // Ensure the TraceEventAgent has been created.
+  TraceEventAgent::GetInstance();
+
+  agent_registry_ =
+      tracing::mojom::AgentRegistryPtr(std::move(request->agent_registry));
+  agent_registry_.set_connection_error_handler(base::BindRepeating(
+      [](TracedProcessImpl* traced_process) {
+        // If the AgentRegistryPtr connection closes, the tracing service
+        // has gone down and we'll start accepting new connections from it
+        // again.
+        base::AutoLock lock(traced_process->lock_);
+        traced_process->agent_registry_.reset();
+        traced_process->binding_.Close();
+      },
+      base::Unretained(this)));
+
+  for (auto* agent : agents_) {
+    agent->Connect(agent_registry_.get());
+  }
+
+  ProducerClient::Get()->Connect(
+      tracing::mojom::PerfettoServicePtr(std::move(request->perfetto_service)));
+}
+
+}  // namespace tracing
diff --git a/services/tracing/public/cpp/traced_process_impl.h b/services/tracing/public/cpp/traced_process_impl.h
new file mode 100644
index 0000000..1522fdf
--- /dev/null
+++ b/services/tracing/public/cpp/traced_process_impl.h
@@ -0,0 +1,60 @@
+// Copyright 2019 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 SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_IMPL_H_
+#define SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_IMPL_H_
+
+#include <set>
+#include <string>
+
+#include "base/component_export.h"
+#include "base/sequence_checker.h"
+#include "base/synchronization/lock.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/tracing/public/mojom/tracing.mojom.h"
+
+namespace tracing {
+
+class BaseAgent;
+
+// Each running process will bind this singleton
+// to the mojom::TracedProcess interface, which will be
+// connected to by the tracing service to enable tracing
+// support.
+class COMPONENT_EXPORT(TRACING_CPP) TracedProcessImpl
+    : public mojom::TracedProcess {
+ public:
+  static TracedProcessImpl* GetInstance();
+
+  void OnTracedProcessRequest(mojom::TracedProcessRequest request);
+
+  // Set which taskrunner to bind any incoming requests on.
+  void SetTaskRunner(scoped_refptr<base::SequencedTaskRunner> task_runner);
+
+  void RegisterAgent(BaseAgent* agent);
+  void UnregisterAgent(BaseAgent* agent);
+
+ private:
+  friend class base::NoDestructor<TracedProcessImpl>;
+  TracedProcessImpl();
+  ~TracedProcessImpl() override;
+
+  // tracing::mojom::TracedProcess:
+  void ConnectToTracingService(
+      mojom::ConnectToTracingRequestPtr request) override;
+
+  // Lock protecting binding_.
+  base::Lock lock_;
+  std::set<BaseAgent*> agents_;
+  tracing::mojom::AgentRegistryPtr agent_registry_;
+  mojo::Binding<tracing::mojom::TracedProcess> binding_;
+  scoped_refptr<base::SequencedTaskRunner> task_runner_;
+
+  SEQUENCE_CHECKER(sequence_checker_);
+  DISALLOW_COPY_AND_ASSIGN(TracedProcessImpl);
+};
+
+}  // namespace tracing
+
+#endif  // SERVICES_TRACING_PUBLIC_CPP_TRACED_PROCESS_IMPL_H_
diff --git a/services/tracing/public/mojom/tracing.mojom b/services/tracing/public/mojom/tracing.mojom
index 69e1df7..99d6cfd9 100644
--- a/services/tracing/public/mojom/tracing.mojom
+++ b/services/tracing/public/mojom/tracing.mojom
@@ -7,6 +7,19 @@
 import "mojo/public/mojom/base/process_id.mojom";
 import "mojo/public/mojom/base/time.mojom";
 import "mojo/public/mojom/base/values.mojom";
+import "services/tracing/public/mojom/perfetto_service.mojom";
+
+struct ConnectToTracingRequest {
+  PerfettoService perfetto_service;
+  AgentRegistry agent_registry;
+};
+
+// The tracing service will bind this interface on every other service,
+// and pass it pointers to the interfaces within the tracing service
+// that the other services should register themselves with.
+interface TracedProcess {
+  ConnectToTracingService(ConnectToTracingRequest request);
+};
 
 // The JSON type of data coming from a tracing agents.
 //
diff --git a/services/tracing/tracing_service.cc b/services/tracing/tracing_service.cc
index 9d1d088..15a97e6f 100644
--- a/services/tracing/tracing_service.cc
+++ b/services/tracing/tracing_service.cc
@@ -5,8 +5,10 @@
 #include "services/tracing/tracing_service.h"
 
 #include <utility>
+#include <vector>
 
 #include "base/timer/timer.h"
+#include "services/service_manager/public/mojom/service_manager.mojom.h"
 #include "services/tracing/agent_registry.h"
 #include "services/tracing/coordinator.h"
 #include "services/tracing/perfetto/perfetto_service.h"
@@ -15,6 +17,75 @@
 
 namespace tracing {
 
+// Listener used to connect to every other service and
+// pass them the needed interface pointers to connect
+// back and register with the tracing service.
+class ServiceListener : public service_manager::mojom::ServiceManagerListener {
+ public:
+  ServiceListener(service_manager::Connector* connector,
+                  scoped_refptr<base::SequencedTaskRunner> task_runner,
+                  AgentRegistry* agent_registry)
+      : binding_(this),
+        connector_(connector),
+        task_runner_(task_runner),
+        agent_registry_(agent_registry) {
+    service_manager::mojom::ServiceManagerPtr service_manager;
+    connector_->BindInterface(service_manager::mojom::kServiceName,
+                              &service_manager);
+    service_manager::mojom::ServiceManagerListenerPtr listener;
+    service_manager::mojom::ServiceManagerListenerRequest request(
+        mojo::MakeRequest(&listener));
+    service_manager->AddListener(std::move(listener));
+    binding_.Bind(std::move(request));
+  }
+
+  void ConnectProcessToTracingService(
+      const service_manager::Identity& identity) {
+    mojom::TracedProcessPtr traced_process;
+    connector_->BindInterface(
+        service_manager::ServiceFilter::ForExactIdentity(identity),
+        &traced_process);
+
+    auto new_connection_request = mojom::ConnectToTracingRequest::New();
+
+    PerfettoService::GetInstance()->BindRequest(
+        mojo::MakeRequest(&new_connection_request->perfetto_service));
+
+    agent_registry_->BindAgentRegistryRequest(
+        task_runner_,
+        mojo::MakeRequest(&new_connection_request->agent_registry));
+
+    traced_process->ConnectToTracingService(std::move(new_connection_request));
+  }
+
+  // service_manager::mojom::ServiceManagerListener implementation.
+  void OnInit(std::vector<service_manager::mojom::RunningServiceInfoPtr>
+                  running_services) override {
+    for (auto& service : running_services) {
+      ConnectProcessToTracingService(service->identity);
+    }
+  }
+
+  void OnServiceStarted(const service_manager::Identity& identity,
+                        uint32_t pid) override {
+    ConnectProcessToTracingService(identity);
+  }
+
+  void OnServiceCreated(
+      service_manager::mojom::RunningServiceInfoPtr service) override {}
+  void OnServicePIDReceived(const service_manager::Identity& identity,
+                            uint32_t pid) override {}
+  void OnServiceFailedToStart(
+      const service_manager::Identity& identity) override {}
+  void OnServiceStopped(const service_manager::Identity& identity) override {}
+
+ private:
+  mojo::Binding<service_manager::mojom::ServiceManagerListener> binding_;
+  service_manager::Connector* connector_;
+  scoped_refptr<base::SequencedTaskRunner> task_runner_;
+  AgentRegistry* agent_registry_;
+};
+
 TracingService::TracingService(service_manager::mojom::ServiceRequest request)
     : service_binding_(this, std::move(request)),
       task_runner_(base::SequencedTaskRunnerHandle::Get()) {}
@@ -28,34 +99,39 @@
   }
 }
 
+void TracingService::OnDisconnected() {
+  CloseAgentConnectionsAndTerminate();
+}
+
 void TracingService::OnStart() {
   tracing_agent_registry_ = std::make_unique<AgentRegistry>();
 
-  registry_.AddInterface(base::BindRepeating(
-      &tracing::PerfettoService::BindRequest,
-      base::Unretained(tracing::PerfettoService::GetInstance())));
-
   if (TracingUsesPerfettoBackend()) {
     task_runner_ = tracing::PerfettoService::GetInstance()->task_runner();
 
     auto perfetto_coordinator = std::make_unique<PerfettoTracingCoordinator>(
-        tracing_agent_registry_.get());
+        tracing_agent_registry_.get(),
+        base::BindRepeating(&TracingService::OnCoordinatorConnectionClosed,
+                            base::Unretained(this),
+                            base::SequencedTaskRunnerHandle::Get()));
     registry_.AddInterface(
         base::BindRepeating(&PerfettoTracingCoordinator::BindCoordinatorRequest,
                             base::Unretained(perfetto_coordinator.get())));
     perfetto_tracing_coordinator_ = std::move(perfetto_coordinator);
   } else {
-    auto tracing_coordinator =
-        std::make_unique<Coordinator>(tracing_agent_registry_.get());
+    auto tracing_coordinator = std::make_unique<Coordinator>(
+        tracing_agent_registry_.get(),
+        base::BindRepeating(&TracingService::OnCoordinatorConnectionClosed,
+                            base::Unretained(this), nullptr));
     registry_.AddInterface(
         base::BindRepeating(&Coordinator::BindCoordinatorRequest,
                             base::Unretained(tracing_coordinator.get())));
     tracing_coordinator_ = std::move(tracing_coordinator);
   }
 
-  registry_.AddInterface(base::BindRepeating(
-      &AgentRegistry::BindAgentRegistryRequest,
-      base::Unretained(tracing_agent_registry_.get()), task_runner_));
+  service_listener_ = std::make_unique<ServiceListener>(
+      service_binding_.GetConnector(), task_runner_,
+      tracing_agent_registry_.get());
 }
 
 void TracingService::OnBindInterface(
@@ -66,4 +142,29 @@
                           source_info);
 }
 
+void TracingService::OnCoordinatorConnectionClosed(
+    scoped_refptr<base::SequencedTaskRunner> task_runner) {
+  // TODO(oysteine): Running TracingService and Perfetto on different
+  // sequences is getting messy; refactor so that the service manager
+  // runs the tracing service on a single threaded taskrunner so
+  // Perfetto can use the same.
+  if (task_runner && !task_runner->RunsTasksInCurrentSequence()) {
+    task_runner->PostTask(
+        FROM_HERE,
+        base::BindOnce(&TracingService::OnCoordinatorConnectionClosed,
+                       base::Unretained(this), nullptr));
+    return;
+  }
+
+  service_binding_.RequestClose();
+}
+
+void TracingService::CloseAgentConnectionsAndTerminate() {
+  task_runner_->PostTaskAndReply(
+      FROM_HERE,
+      base::BindOnce(&AgentRegistry::DisconnectAllAgents,
+                     base::Unretained(tracing_agent_registry_.get())),
+      base::BindOnce(&TracingService::Terminate, base::Unretained(this)));
+}
+
 }  // namespace tracing
diff --git a/services/tracing/tracing_service.h b/services/tracing/tracing_service.h
index 291c32e..8be2ea7 100644
--- a/services/tracing/tracing_service.h
+++ b/services/tracing/tracing_service.h
@@ -21,6 +21,7 @@
 
 namespace tracing {
 
+class ServiceListener;
 class PerfettoTracingCoordinator;
 
 class TracingService : public service_manager::Service {
@@ -30,11 +31,16 @@
 
   // service_manager::Service:
   void OnStart() override;
+  void OnDisconnected() override;
   void OnBindInterface(const service_manager::BindSourceInfo& source_info,
                        const std::string& interface_name,
                        mojo::ScopedMessagePipeHandle interface_pipe) override;
 
  private:
+  void OnCoordinatorConnectionClosed(
+      scoped_refptr<base::SequencedTaskRunner> task_runner);
+  void CloseAgentConnectionsAndTerminate();
+
   service_manager::ServiceBinding service_binding_;
 
   service_manager::BinderRegistryWithArgs<
@@ -45,6 +51,8 @@
   scoped_refptr<base::SequencedTaskRunner> task_runner_;
   std::unique_ptr<PerfettoTracingCoordinator> perfetto_tracing_coordinator_;
 
+  std::unique_ptr<ServiceListener> service_listener_;
+
   // WeakPtrFactory members should always come last so WeakPtrs are destructed
   // before other members.
   base::WeakPtrFactory<TracingService> weak_factory_{this};
diff --git a/services/tracing/tracing_service_unittest.cc b/services/tracing/tracing_service_unittest.cc
index e7fcdc4..1ddb942 100644
--- a/services/tracing/tracing_service_unittest.cc
+++ b/services/tracing/tracing_service_unittest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include <memory>
+#include <utility>
 
 #include "base/macros.h"
 #include "base/run_loop.h"
@@ -21,7 +22,9 @@
  public:
   TracingServiceTest()
       : service_(
-            test_connector_factory_.RegisterInstance(mojom::kServiceName)) {}
+            test_connector_factory_.RegisterInstance(mojom::kServiceName)) {
+    test_connector_factory_.set_ignore_unknown_service_requests(true);
+  }
   ~TracingServiceTest() override {}
 
  protected:
@@ -38,16 +41,18 @@
 };
 
 TEST_F(TracingServiceTest, TracingServiceInstantiate) {
-  mojom::AgentRegistryPtr agent_registry;
+  mojom::CoordinatorPtr coordinator;
   connector()->BindInterface(mojom::kServiceName,
-                             mojo::MakeRequest(&agent_registry));
+                             mojo::MakeRequest(&coordinator));
 
-  MockAgent agent1;
-  agent_registry->RegisterAgent(agent1.CreateAgentPtr(), "FOO",
-                                mojom::TraceDataType::STRING,
-                                base::kNullProcessId);
-
-  base::RunLoop().RunUntilIdle();
+  base::RunLoop tracing_started;
+  coordinator->IsTracing(base::BindOnce(
+      [](base::OnceClosure callback, bool is_tracing) {
+        EXPECT_FALSE(is_tracing);
+        std::move(callback).Run();
+      },
+      tracing_started.QuitClosure()));
+  tracing_started.Run();
 }
 
 }  // namespace tracing
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json
index 7fab689e..ff65974 100644
--- a/testing/buildbot/chromium.fyi.json
+++ b/testing/buildbot/chromium.fyi.json
@@ -1107,6 +1107,17 @@
       },
       {
         "args": [
+          "--enable-features=VizDisplayCompositor,UseSkiaRenderer"
+        ],
+        "name": "skia_renderer_browser_tests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "shards": 10
+        },
+        "test": "browser_tests"
+      },
+      {
+        "args": [
           "--disable-features=VizDisplayCompositor"
         ],
         "name": "non_viz_content_browsertests",
@@ -1118,6 +1129,17 @@
       },
       {
         "args": [
+          "--enable-features=VizDisplayCompositor,UseSkiaRenderer"
+        ],
+        "name": "skia_renderer_content_browsertests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "shards": 10
+        },
+        "test": "content_browsertests"
+      },
+      {
+        "args": [
           "--enable-features=VizDisplayCompositor"
         ],
         "name": "viz_content_browsertests",
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl
index ed949e3..61674f5 100644
--- a/testing/buildbot/gn_isolate_map.pyl
+++ b/testing/buildbot/gn_isolate_map.pyl
@@ -649,7 +649,7 @@
   "components_perftests": {
     "args": [
       "--xvfb",
-      "--benchmark=components_perftests",
+      "--gtest-benchmark-name=components_perftests",
       "--non-telemetry=true",
       "--migrated-test=true",
       "components_perftests",
@@ -2578,7 +2578,7 @@
   "views_perftests": {
     "args": [
       "--xvfb",
-      "--benchmark=views_perftests",
+      "--gtest-benchmark-name=views_perftests",
       "--non-telemetry=true",
       "--migrated-test=true",
       "views_perftests",
@@ -2758,6 +2758,9 @@
   },
   "webview_cts_tests": {
     "args": [
+      "--logdog-bin-cmd",
+      "../../bin/logdog_butler",
+      "../../third_party/catapult/devil/devil/android/tools/system_app.py",
       "remove",
       "--package",
       "com.android.webview",
@@ -2775,7 +2778,7 @@
       "-v",
     ],
     "label": "//android_webview/test:webview_cts_tests",
-    "script": "//third_party/catapult/devil/devil/android/tools/system_app.py",
+    "script": "//build/android/test_wrapper/logdog_wrapper.py",
     "type": "script",
   },
   "webview_instrumentation_test_apk": {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl
index e4480194..bd39ad1e 100644
--- a/testing/buildbot/test_suites.pyl
+++ b/testing/buildbot/test_suites.pyl
@@ -4136,6 +4136,27 @@
       },
     },
 
+    'skia_renderer_fyi_gtests': {
+      'skia_renderer_browser_tests': {
+        'args': [
+          '--enable-features=VizDisplayCompositor,UseSkiaRenderer',
+        ],
+        'swarming': {
+          'shards': 10,
+        },
+	'test': 'browser_tests',
+      },
+      'skia_renderer_content_browsertests': {
+        'args': [
+	  '--enable-features=VizDisplayCompositor,UseSkiaRenderer',
+	],
+        'swarming': {
+          'shards': 10,
+        },
+	'test': 'content_browsertests',
+      },
+    },
+
     'system_webview_shell_instrumentation_tests': {
       'system_webview_shell_layout_test_apk': {},
     },
@@ -4868,6 +4889,7 @@
     'linux_viz_gtests': [
       'non_viz_fyi_chromium_gtests',
       'non_viz_non_android_fyi_chromium_gtests',
+      'skia_renderer_fyi_gtests',
       'viz_gtests',
       'viz_non_android_fyi_gtests',
     ],
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index 6fab0b27..b62c805 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -736,36 +736,6 @@
             ]
         }
     ],
-    "AutofillPrimaryInfoStyleExperiment": [
-        {
-            "platforms": [
-                "chromeos",
-                "linux",
-                "mac",
-                "windows"
-            ],
-            "experiments": [
-                {
-                    "name": "Enabled_medium",
-                    "params": {
-                        "font_weight": "medium"
-                    },
-                    "enable_features": [
-                        "AutofillPrimaryInfoStyleExperiment"
-                    ]
-                },
-                {
-                    "name": "Enabled_bold",
-                    "params": {
-                        "font_weight": "bold"
-                    },
-                    "enable_features": [
-                        "AutofillPrimaryInfoStyleExperiment"
-                    ]
-                }
-            ]
-        }
-    ],
     "AutofillRefreshStyleAndroid": [
         {
             "platforms": [
@@ -4274,6 +4244,21 @@
             ]
         }
     ],
+    "SearchReadyOmnibox": [
+        {
+            "platforms": [
+                "android"
+            ],
+            "experiments": [
+                {
+                    "name": "Enabled",
+                    "enable_features": [
+                        "SearchReadyOmnibox"
+                    ]
+                }
+            ]
+        }
+    ],
     "SequenceManagerRollout": [
         {
             "platforms": [
@@ -4575,6 +4560,26 @@
             ]
         }
     ],
+    "SyncUSSAutofillWalletData": [
+        {
+            "platforms": [
+                "android",
+                "chromeos",
+                "ios",
+                "linux",
+                "mac",
+                "windows"
+            ],
+            "experiments": [
+                {
+                    "name": "Enabled",
+                    "enable_features": [
+                        "SyncUSSAutofillWalletData"
+                    ]
+                }
+            ]
+        }
+    ],
     "TabRanker": [
         {
             "platforms": [
diff --git a/third_party/blink/public/mojom/appcache/appcache.mojom b/third_party/blink/public/mojom/appcache/appcache.mojom
index d0a35b9..11939677 100644
--- a/third_party/blink/public/mojom/appcache/appcache.mojom
+++ b/third_party/blink/public/mojom/appcache/appcache.mojom
@@ -8,6 +8,8 @@
 import "url/mojom/url.mojom";
 import "services/network/public/mojom/url_loader_factory.mojom";
 
+const int64 kAppCacheNoHostId = 0;
+
 enum AppCacheEventID {
   APPCACHE_CHECKING_EVENT = 0,
   APPCACHE_ERROR_EVENT,
diff --git a/third_party/blink/public/mojom/indexeddb/indexeddb.mojom b/third_party/blink/public/mojom/indexeddb/indexeddb.mojom
index 9aacff1..7e639bd 100644
--- a/third_party/blink/public/mojom/indexeddb/indexeddb.mojom
+++ b/third_party/blink/public/mojom/indexeddb/indexeddb.mojom
@@ -383,7 +383,8 @@
               int64 index_id,
               mojo_base.mojom.String16 new_name);
   Abort(int64 transaction_id);
-  Commit(int64 transaction_id);
+  Commit(int64 transaction_id,
+         int64 num_errors_handled);
 };
 
 interface IDBFactory {
diff --git a/third_party/blink/public/platform/web_application_cache_host.h b/third_party/blink/public/platform/web_application_cache_host.h
index 1f869e5..d6aa1da 100644
--- a/third_party/blink/public/platform/web_application_cache_host.h
+++ b/third_party/blink/public/platform/web_application_cache_host.h
@@ -31,6 +31,7 @@
 #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_APPLICATION_CACHE_HOST_H_
 #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_APPLICATION_CACHE_HOST_H_
 
+#include "third_party/blink/public/mojom/appcache/appcache.mojom-shared.h"
 #include "third_party/blink/public/mojom/appcache/appcache_info.mojom-shared.h"
 #include "third_party/blink/public/platform/web_common.h"
 #include "third_party/blink/public/platform/web_url.h"
diff --git a/third_party/blink/public/web/web_text_check_client.h b/third_party/blink/public/web/web_text_check_client.h
index 71b4bdfb..d4a7371 100644
--- a/third_party/blink/public/web/web_text_check_client.h
+++ b/third_party/blink/public/web/web_text_check_client.h
@@ -34,10 +34,6 @@
       const WebString& text_to_check,
       WebTextCheckingCompletion* completion_callback) {}
 
-  // Clear all stored references to requests, so that it will not become a
-  // leak source.
-  virtual void CancelAllPendingRequests() {}
-
  protected:
   virtual ~WebTextCheckClient() = default;
 };
diff --git a/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base_constants.h.tmpl b/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base_constants.h.tmpl
index aee3668a..9ca650e2 100644
--- a/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base_constants.h.tmpl
+++ b/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base_constants.h.tmpl
@@ -14,7 +14,7 @@
 {% for enum in enums %}
 enum class {{enum.type_name}} : unsigned {
   {% for value in enum.values %}
-  {{value}}{{print_if(enum.is_set, " = " ~ (0 if loop.first else 2**loop.index0))}},
+  {{value}}{{print_if(enum.is_set, " = " ~ (0 if loop.first else 2**(loop.index0 - 1)))}},
   {% endfor %}
 };
 
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5
index 8bab7d7d..316e06a 100644
--- a/third_party/blink/renderer/core/css/css_properties.json5
+++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -3961,9 +3961,9 @@
       property_methods: ["CSSValueFromComputedStyleInternal"],
       independent: true,
       inherited: true,
-      field_template: "keyword",
+      field_template: "multi_keyword", // We use a bitflag field due peformance issues
       keywords: [
-        "normal", "pre", "pre-wrap", "pre-line", "nowrap", "-webkit-nowrap"
+        "none", "normal", "pre", "pre-wrap", "pre-line", "nowrap", "-webkit-nowrap", "break-spaces"
       ],
       typedom_types: ["Keyword"],
       default_value: "normal",
diff --git a/third_party/blink/renderer/core/css/css_value_keywords.json5 b/third_party/blink/renderer/core/css/css_value_keywords.json5
index c2dc5e6..bfa19f63 100644
--- a/third_party/blink/renderer/core/css/css_value_keywords.json5
+++ b/third_party/blink/renderer/core/css/css_value_keywords.json5
@@ -455,6 +455,7 @@
     "bidi-override",
     "blink",
     "both",
+    "break-spaces",
     "close-quote",
     "embed",
     "fixed",
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
index 07d25b3..45e7ba7 100644
--- a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
+++ b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
@@ -877,7 +877,9 @@
     case CSSPropertyWhiteSpace:
       return value_id == CSSValueNormal || value_id == CSSValuePre ||
              value_id == CSSValuePreWrap || value_id == CSSValuePreLine ||
-             value_id == CSSValueNowrap;
+             value_id == CSSValueNowrap ||
+             (RuntimeEnabledFeatures::CSS3TextBreakSpacesEnabled() &&
+              value_id == CSSValueBreakSpaces);
     case CSSPropertyWordBreak:
       return value_id == CSSValueNormal || value_id == CSSValueBreakAll ||
              value_id == CSSValueKeepAll || value_id == CSSValueBreakWord;
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
index 288f376..9e55b4d9 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -3967,8 +3967,8 @@
 void Document::write(v8::Isolate* isolate,
                      const Vector<String>& text,
                      ExceptionState& exception_state) {
-  if (GetSecurityContext().RequireTrustedTypes()) {
-    DCHECK(RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+  if (IsTrustedTypesEnabledForDoc()) {
+    DCHECK(origin_trials::TrustedDOMTypesEnabled(this));
     exception_state.ThrowTypeError(
         "This document can only write `TrustedHTML` objects.");
     return;
@@ -3987,8 +3987,8 @@
 void Document::writeln(v8::Isolate* isolate,
                        const Vector<String>& text,
                        ExceptionState& exception_state) {
-  if (GetSecurityContext().RequireTrustedTypes()) {
-    DCHECK(RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+  if (IsTrustedTypesEnabledForDoc()) {
+    DCHECK(origin_trials::TrustedDOMTypesEnabled(this));
     exception_state.ThrowTypeError(
         "This document can only write `TrustedHTML` objects.");
     return;
@@ -4004,10 +4004,15 @@
           exception_state);
 }
 
+bool Document::IsTrustedTypesEnabledForDoc() const {
+  return SecurityContext::RequireTrustedTypes() &&
+         origin_trials::TrustedDOMTypesEnabled(this);
+}
+
 void Document::write(v8::Isolate* isolate,
                      TrustedHTML* text,
                      ExceptionState& exception_state) {
-  DCHECK(RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+  DCHECK(origin_trials::TrustedDOMTypesEnabled(this));
   write(text->toString(), EnteredDOMWindow(isolate)->document(),
         exception_state);
 }
@@ -4015,7 +4020,7 @@
 void Document::writeln(v8::Isolate* isolate,
                        TrustedHTML* text,
                        ExceptionState& exception_state) {
-  DCHECK(RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+  DCHECK(origin_trials::TrustedDOMTypesEnabled(this));
   writeln(text->toString(), EnteredDOMWindow(isolate)->document(),
           exception_state);
 }
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h
index bf10191..f71aae0 100644
--- a/third_party/blink/renderer/core/dom/document.h
+++ b/third_party/blink/renderer/core/dom/document.h
@@ -664,6 +664,7 @@
   // TODO(mkwst): Write a spec for this.
   void write(v8::Isolate*, TrustedHTML*, ExceptionState&);
   void writeln(v8::Isolate*, TrustedHTML*, ExceptionState&);
+  bool IsTrustedTypesEnabledForDoc() const;
 
   bool WellFormed() const { return well_formed_; }
 
diff --git a/third_party/blink/renderer/core/dom/document.idl b/third_party/blink/renderer/core/dom/document.idl
index f80ceaf..bcd542a 100644
--- a/third_party/blink/renderer/core/dom/document.idl
+++ b/third_party/blink/renderer/core/dom/document.idl
@@ -123,9 +123,11 @@
     [CallWith=Isolate, CEReactions, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
 
     // TrustedTypes variants of the above.
-    // TODO(mkwst): Write a spec for this.
-    [RuntimeEnabled=TrustedDOMTypes, CallWith=Isolate, CEReactions, CustomElementCallbacks, RaisesException] void write(TrustedHTML text);
-    [RuntimeEnabled=TrustedDOMTypes, CallWith=Isolate, CEReactions, CustomElementCallbacks, RaisesException] void writeln(TrustedHTML text);
+    // Note: This should be gated on [OriginTrialEnabled=TrustedDOMTypes], but
+    // since OriginTrialEnabled isn't compatible with overloaded methods, we're
+    // handling these unconditionally.
+    [CallWith=Isolate, CEReactions, CustomElementCallbacks, RaisesException] void write(TrustedHTML text);
+    [CallWith=Isolate, CEReactions, CustomElementCallbacks, RaisesException] void writeln(TrustedHTML text);
 
     // user interaction
     [Affects=Nothing] readonly attribute Window? defaultView;
diff --git a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc
index e217aa9..335c457 100644
--- a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc
+++ b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc
@@ -140,14 +140,15 @@
     return DispatchEventResult::kNotCanceled;
   }
   std::unique_ptr<EventTiming> eventTiming;
-  if (origin_trials::EventTimingEnabled(&node_->GetDocument())) {
-    LocalFrame* frame = node_->GetDocument().GetFrame();
-    if (frame && frame->DomWindow()) {
-      UseCounter::Count(node_->GetDocument(),
+  const Document& document = node_->GetDocument();
+  LocalFrame* frame = document.GetFrame();
+  if (frame && frame->DomWindow()) {
+    if (origin_trials::EventTimingEnabled(&document)) {
+      UseCounter::Count(document,
                         WebFeature::kPerformanceEventTimingConstructor);
-      eventTiming = std::make_unique<EventTiming>(frame->DomWindow());
-      eventTiming->WillDispatchEvent(*event_);
     }
+    eventTiming = std::make_unique<EventTiming>(frame->DomWindow());
+    eventTiming->WillDispatchEvent(*event_);
   }
   event_->GetEventPath().EnsureWindowEventContext();
 
@@ -155,8 +156,6 @@
       event_->IsMouseEvent() && event_->type() == event_type_names::kClick;
 
   if (is_click && event_->isTrusted()) {
-    Document& document = node_->GetDocument();
-    LocalFrame* frame = document.GetFrame();
     if (frame) {
       // A genuine mouse click cannot be triggered by script so we don't expect
       // there are any script in the stack.
diff --git a/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.cc b/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.cc
index ebae338..3098bd0 100644
--- a/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.cc
+++ b/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.cc
@@ -237,11 +237,6 @@
   // the leak detector, they're all cancelled to prevent flaky leaks being
   // reported.
   request_queue_.clear();
-  // WebTextCheckClient stores a set of WebTextCheckingCompletion objects,
-  // which may store references to already invoked requests. We should clear
-  // these references to prevent them from being a leak source.
-  if (WebTextCheckClient* text_checker_client = GetTextCheckerClient())
-    text_checker_client->CancelAllPendingRequests();
 }
 
 void SpellCheckRequester::InvokeRequest(SpellCheckRequest* request) {
diff --git a/third_party/blink/renderer/core/execution_context/security_context.cc b/third_party/blink/renderer/core/execution_context/security_context.cc
index e617697a..1314284c 100644
--- a/third_party/blink/renderer/core/execution_context/security_context.cc
+++ b/third_party/blink/renderer/core/execution_context/security_context.cc
@@ -104,6 +104,20 @@
   return "public";
 }
 
+void SecurityContext::SetRequireTrustedTypes() {
+  DCHECK(require_safe_types_ ||
+         content_security_policy_->IsRequireTrustedTypes());
+  require_safe_types_ = true;
+}
+
+void SecurityContext::SetRequireTrustedTypesForTesting() {
+  require_safe_types_ = true;
+}
+
+bool SecurityContext::RequireTrustedTypes() const {
+  return require_safe_types_;
+}
+
 void SecurityContext::SetFeaturePolicy(
     std::unique_ptr<FeaturePolicy> feature_policy) {
   // This method should be called before a FeaturePolicy has been created.
diff --git a/third_party/blink/renderer/core/execution_context/security_context.h b/third_party/blink/renderer/core/execution_context/security_context.h
index 837b0f0..c8b85ca 100644
--- a/third_party/blink/renderer/core/execution_context/security_context.h
+++ b/third_party/blink/renderer/core/execution_context/security_context.h
@@ -102,8 +102,9 @@
   mojom::IPAddressSpace AddressSpace() const { return address_space_; }
   String addressSpaceForBindings() const;
 
-  void SetRequireTrustedTypes() { require_safe_types_ = true; }
-  bool RequireTrustedTypes() const { return require_safe_types_; }
+  void SetRequireTrustedTypes();
+  bool RequireTrustedTypes() const;
+  void SetRequireTrustedTypesForTesting();  // Skips sanity checks.
 
   // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-insecure-navigations-set
   void SetInsecureNavigationsSet(const std::vector<unsigned>& set) {
diff --git a/third_party/blink/renderer/core/exported/web_frame_test.cc b/third_party/blink/renderer/core/exported/web_frame_test.cc
index 3270b3a8..4bac8b6 100644
--- a/third_party/blink/renderer/core/exported/web_frame_test.cc
+++ b/third_party/blink/renderer/core/exported/web_frame_test.cc
@@ -6859,12 +6859,6 @@
                              WebTextCheckingCompletion* completion) override {
     completion_ = completion;
   }
-  void CancelAllPendingRequests() override {
-    if (!completion_)
-      return;
-    completion_->DidCancelCheckingText();
-    completion_ = nullptr;
-  }
 
   void KickNoResults() { Kick(-1, -1, kWebTextDecorationTypeSpelling); }
 
diff --git a/third_party/blink/renderer/core/exported/web_layer_test.cc b/third_party/blink/renderer/core/exported/web_layer_test.cc
index 03addfc..68930d4 100644
--- a/third_party/blink/renderer/core/exported/web_layer_test.cc
+++ b/third_party/blink/renderer/core/exported/web_layer_test.cc
@@ -257,6 +257,10 @@
         WebWidget::LifecycleUpdateReason::kTest);
   }
 
+  cc::PropertyTrees* GetPropertyTrees() {
+    return Compositor().layer_tree_view().layer_tree_host()->property_trees();
+  }
+
  private:
   PaintArtifactCompositor* paint_artifact_compositor() {
     return MainFrame().GetFrameView()->GetPaintArtifactCompositorForTesting();
@@ -378,7 +382,8 @@
   EXPECT_FALSE(host->LayersThatShouldPushProperties().count(c_layer));
 }
 
-TEST_P(WebLayerListSimTest, NoopChangeDoesNotCauseFullTreeSync) {
+TEST_P(WebLayerListSimTest,
+       NoopChangeDoesNotCauseFullTreeSyncOrPropertyTreeUpdate) {
   InitializeWithHTML(R"HTML(
       <!DOCTYPE html>
       <style>
@@ -396,10 +401,15 @@
   // Initially the host should not need to sync.
   auto* layer_tree_host = Compositor().layer_tree_view().layer_tree_host();
   EXPECT_FALSE(layer_tree_host->needs_full_tree_sync());
+  int sequence_number = GetPropertyTrees()->sequence_number;
+  EXPECT_GT(sequence_number, 0);
 
   // A no-op update should not cause the host to need a full tree sync.
   UpdateAllLifecyclePhases();
   EXPECT_FALSE(layer_tree_host->needs_full_tree_sync());
+  // It should also not cause a property tree update - the sequence number
+  // should not change.
+  EXPECT_EQ(sequence_number, GetPropertyTrees()->sequence_number);
 }
 
 // When a property tree change occurs that affects layer position, all layers
diff --git a/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc b/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
index 3def816..68128c69 100644
--- a/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
@@ -180,6 +180,7 @@
     // When compositing is after paint, composited plugins should have their
     // layers inserted rather than invoking WebPlugin::paint.
     RecordForeignLayer(context, DisplayItem::kForeignLayerPlugin, layer_);
+    ParentFrameView().SetPaintArtifactCompositorNeedsUpdate();
     return;
   }
 
diff --git a/third_party/blink/renderer/core/feature_policy/dom_feature_policy.cc b/third_party/blink/renderer/core/feature_policy/dom_feature_policy.cc
index 73e2ba5..d3db96b 100644
--- a/third_party/blink/renderer/core/feature_policy/dom_feature_policy.cc
+++ b/third_party/blink/renderer/core/feature_policy/dom_feature_policy.cc
@@ -42,6 +42,13 @@
       GetDefaultFeatureNameMap().at(feature), origin->ToUrlOrigin());
 }
 
+Vector<String> DOMFeaturePolicy::features() const {
+  Vector<String> features;
+  for (const auto& entry : GetDefaultFeatureNameMap())
+    features.push_back(entry.key);
+  return features;
+}
+
 Vector<String> DOMFeaturePolicy::allowedFeatures() const {
   Vector<String> allowed_features;
   for (const auto& entry : GetDefaultFeatureNameMap()) {
diff --git a/third_party/blink/renderer/core/feature_policy/dom_feature_policy.h b/third_party/blink/renderer/core/feature_policy/dom_feature_policy.h
index 48ffe76..e9766df 100644
--- a/third_party/blink/renderer/core/feature_policy/dom_feature_policy.h
+++ b/third_party/blink/renderer/core/feature_policy/dom_feature_policy.h
@@ -30,6 +30,8 @@
   // Returns whether or not the given feature is allowed on the origin of the
   // given URL.
   bool allowsFeature(const String& feature, const String& url) const;
+  // Returns a list of feature names that are supported by the user agent.
+  Vector<String> features() const;
   // Returns a list of feature names that are allowed on the self origin.
   Vector<String> allowedFeatures() const;
   // Returns a list of feature name that are allowed on the origin of the given
diff --git a/third_party/blink/renderer/core/feature_policy/feature_policy.idl b/third_party/blink/renderer/core/feature_policy/feature_policy.idl
index 7cb7595..beadb01 100644
--- a/third_party/blink/renderer/core/feature_policy/feature_policy.idl
+++ b/third_party/blink/renderer/core/feature_policy/feature_policy.idl
@@ -9,6 +9,7 @@
   ImplementedAs=DOMFeaturePolicy
 ] interface FeaturePolicy {
   [MeasureAs=FeaturePolicyJSAPI] boolean allowsFeature(DOMString feature, optional DOMString url);
+  [MeasureAs=FeaturePolicyJSAPI] sequence<DOMString> features();
   [MeasureAs=FeaturePolicyJSAPI] sequence<DOMString> allowedFeatures();
   [MeasureAs=FeaturePolicyJSAPI] sequence<DOMString> getAllowlistForFeature(DOMString feature);
 };
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
index 06174f7..f30eb4eb 100644
--- a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
+++ b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
@@ -1082,8 +1082,8 @@
 }
 
 void ContentSecurityPolicy::RequireTrustedTypes() {
-  if (!RuntimeEnabledFeatures::TrustedDOMTypesEnabled())
-    return;
+  // We store whether CSP demands a policy. The caller still needs to check
+  // whether the feature is enabled in the first place.
   require_safe_types_ = true;
 }
 
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.h b/third_party/blink/renderer/core/frame/csp/content_security_policy.h
index d254fa9..2f70e78 100644
--- a/third_party/blink/renderer/core/frame/csp/content_security_policy.h
+++ b/third_party/blink/renderer/core/frame/csp/content_security_policy.h
@@ -463,6 +463,7 @@
   void EnforceSandboxFlags(SandboxFlags);
   void TreatAsPublicAddress();
   void RequireTrustedTypes();
+  bool IsRequireTrustedTypes() const { return require_safe_types_; }
   String EvalDisabledErrorMessage() const;
 
   // Upgrade-Insecure-Requests and Block-All-Mixed-Content are represented in
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy_test.cc b/third_party/blink/renderer/core/frame/csp/content_security_policy_test.cc
index e2489563..f6065a4 100644
--- a/third_party/blink/renderer/core/frame/csp/content_security_policy_test.cc
+++ b/third_party/blink/renderer/core/frame/csp/content_security_policy_test.cc
@@ -1365,6 +1365,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesNoDirective) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("", kContentSecurityPolicyHeaderTypeEnforce,
                         kContentSecurityPolicyHeaderSourceHTTP);
@@ -1372,6 +1373,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesSimpleDirective) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("trusted-types one two three",
                         kContentSecurityPolicyHeaderTypeEnforce,
@@ -1383,6 +1385,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesWhitespace) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("trusted-types one\ntwo\rthree",
                         kContentSecurityPolicyHeaderTypeEnforce,
@@ -1393,6 +1396,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesEmpty) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("trusted-types",
                         kContentSecurityPolicyHeaderTypeEnforce,
@@ -1401,6 +1405,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesStar) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("trusted-types *",
                         kContentSecurityPolicyHeaderTypeEnforce,
@@ -1409,6 +1414,7 @@
 }
 
 TEST_F(ContentSecurityPolicyTest, TrustedTypesReserved) {
+  execution_context->SetRequireTrustedTypesForTesting();
   csp->BindToDelegate(execution_context->GetContentSecurityPolicyDelegate());
   csp->DidReceiveHeader("trusted-types one \"two\" 'three'",
                         kContentSecurityPolicyHeaderTypeEnforce,
diff --git a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
index 9a9abf9..0e3acb4 100644
--- a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
+++ b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
@@ -1499,12 +1499,11 @@
   } else if (type == ContentSecurityPolicy::DirectiveType::kReportTo &&
              base::FeatureList::IsEnabled(network::features::kReporting)) {
     ParseReportTo(name, value);
+  } else if (type == ContentSecurityPolicy::DirectiveType::kTrustedTypes) {
+    RequireTrustedTypes(name, value);
   } else if (policy_->ExperimentalFeaturesEnabled()) {
     if (type == ContentSecurityPolicy::DirectiveType::kRequireSRIFor) {
       ParseRequireSRIFor(name, value);
-    } else if (type == ContentSecurityPolicy::DirectiveType::kTrustedTypes &&
-               RuntimeEnabledFeatures::TrustedDOMTypesEnabled()) {
-      RequireTrustedTypes(name, value);
     } else if (type == ContentSecurityPolicy::DirectiveType::kPrefetchSrc) {
       SetCSPDirective<SourceListDirective>(name, value, prefetch_src_);
     } else {
diff --git a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc
index 50081f7..9fa20c7 100644
--- a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc
+++ b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc
@@ -14,6 +14,7 @@
 #include "third_party/blink/renderer/core/frame/use_counter.h"
 #include "third_party/blink/renderer/core/loader/document_loader.h"
 #include "third_party/blink/renderer/core/loader/ping_loader.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/probe/core_probes.h"
 #include "third_party/blink/renderer/core/workers/worker_global_scope.h"
 #include "third_party/blink/renderer/platform/network/encoded_form_data.h"
@@ -48,7 +49,8 @@
 }
 
 void ExecutionContextCSPDelegate::SetRequireTrustedTypes() {
-  GetSecurityContext().SetRequireTrustedTypes();
+  if (origin_trials::TrustedDOMTypesEnabled(execution_context_))
+    GetSecurityContext().SetRequireTrustedTypes();
 }
 
 void ExecutionContextCSPDelegate::AddInsecureRequestPolicy(
diff --git a/third_party/blink/renderer/core/frame/frame_overlay.cc b/third_party/blink/renderer/core/frame/frame_overlay.cc
index 4cbe15a..c69be2ad 100644
--- a/third_party/blink/renderer/core/frame/frame_overlay.cc
+++ b/third_party/blink/renderer/core/frame/frame_overlay.cc
@@ -79,11 +79,11 @@
   if (!local_root_frame_widget->IsAcceleratedCompositingActive())
     return;
 
+  GraphicsLayer* parent_layer =
+      frame_->IsMainFrame()
+          ? frame_->GetPage()->GetVisualViewport().ContainerLayer()
+          : local_root_frame_widget->RootGraphicsLayer();
   if (!layer_) {
-    GraphicsLayer* parent_layer =
-        frame_->IsMainFrame()
-            ? frame_->GetPage()->GetVisualViewport().ContainerLayer()
-            : local_root_frame_widget->RootGraphicsLayer();
     if (!parent_layer)
       return;
     layer_ = GraphicsLayer::Create(*this);
@@ -104,6 +104,8 @@
 
   layer_->SetSize(gfx::Size(Size()));
   layer_->SetNeedsDisplay();
+  if (parent_layer)
+    parent_layer->SetPaintArtifactCompositorNeedsUpdate();
 }
 
 IntSize FrameOverlay::Size() const {
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc
index 065f06cd..841f864 100644
--- a/third_party/blink/renderer/core/frame/local_frame_view.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -242,6 +242,7 @@
           base::WrapUnique(g_initial_track_all_paint_invalidations
                                ? new Vector<ObjectPaintInvalidation>
                                : nullptr)),
+      composited_element_ids_(CompositorElementIdSet()),
       main_thread_scrolling_reasons_(0),
       forced_layout_stack_depth_(0),
       forced_layout_start_time_(TimeTicks()),
@@ -2400,8 +2401,7 @@
   if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled() ||
       RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
     if (!print_mode_enabled) {
-      base::Optional<CompositorElementIdSet> composited_element_ids =
-          CompositorElementIdSet();
+      auto& composited_element_ids = composited_element_ids_;
       PushPaintArtifactToCompositor(composited_element_ids.value());
       ForAllNonThrottledLocalFrameViews(
           [&composited_element_ids](LocalFrameView& frame_view) {
@@ -2642,8 +2642,13 @@
     // Devtools overlays query the inspected page's paint data so this update
     // needs to be after other paintings. Because devtools overlays can add
     // layers, this needs to be before layers are collected.
-    if (auto* web_local_frame_impl = WebLocalFrameImpl::FromFrame(frame_))
+    auto* web_local_frame_impl = WebLocalFrameImpl::FromFrame(frame_);
+    if (web_local_frame_impl && web_local_frame_impl->HasDevToolsOverlays()) {
       web_local_frame_impl->UpdateDevToolsOverlays();
+      // Devtools overlays can change cc::Layer property tree nodes and we need
+      // to ensure these updated values are pushed to the compositor.
+      SetPaintArtifactCompositorNeedsUpdate();
+    }
   }
 
   ForAllNonThrottledLocalFrameViews([](LocalFrameView& frame_view) {
@@ -3969,6 +3974,12 @@
   intersection_observation_state_ = state;
 }
 
+void LocalFrameView::SetPaintArtifactCompositorNeedsUpdate() const {
+  LocalFrameView* root = GetFrame().LocalFrameRoot().View();
+  if (root && root->paint_artifact_compositor_)
+    root->paint_artifact_compositor_->SetNeedsUpdate(true);
+}
+
 unsigned LocalFrameView::GetIntersectionObservationFlags() const {
   unsigned flags = 0;
 
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h
index 1b41b51..fb5bd13d6 100644
--- a/third_party/blink/renderer/core/frame/local_frame_view.h
+++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -218,6 +218,8 @@
   // view.
   unsigned GetIntersectionObservationFlags() const;
 
+  void SetPaintArtifactCompositorNeedsUpdate() const;
+
   // Marks this frame, and ancestor frames, as needing a mandatory compositing
   // update. This overrides throttling for one frame, up to kCompositingClean.
   void SetNeedsForcedCompositingUpdate();
@@ -990,6 +992,13 @@
   std::unique_ptr<PaintController> paint_controller_;
   std::unique_ptr<PaintArtifactCompositor> paint_artifact_compositor_;
 
+  // The set of ElementIds that were composited by PaintArtifactCompositor
+  // during the Paint lifecycle phase. Only used by BlinkGenPropertyTrees and
+  // CompositeAfterPaint. These are stored here because sometimes
+  // PaintArtifactCompositor::Update() does not run (if the dirty bit is not
+  // set) and in that case, the element ids from the prior run are retained.
+  base::Optional<CompositorElementIdSet> composited_element_ids_;
+
   MainThreadScrollingReasons main_thread_scrolling_reasons_;
 
   std::unique_ptr<LocalFrameUkmAggregator> ukm_aggregator_;
diff --git a/third_party/blink/renderer/core/frame/visual_viewport.cc b/third_party/blink/renderer/core/frame/visual_viewport.cc
index be610bf..e2895c3 100644
--- a/third_party/blink/renderer/core/frame/visual_viewport.cc
+++ b/third_party/blink/renderer/core/frame/visual_viewport.cc
@@ -1115,6 +1115,11 @@
   ScrollableArea::SetScrollbarsHiddenIfOverlay(hidden);
 }
 
+void VisualViewport::SetPaintArtifactCompositorNeedsUpdate() const {
+  if (MainFrame() && MainFrame()->View())
+    MainFrame()->View()->SetPaintArtifactCompositorNeedsUpdate();
+}
+
 String VisualViewport::DebugName(const GraphicsLayer* graphics_layer) const {
   String name;
   if (graphics_layer == inner_viewport_container_layer_.get()) {
diff --git a/third_party/blink/renderer/core/frame/visual_viewport.h b/third_party/blink/renderer/core/frame/visual_viewport.h
index a43aa5648..2ca0961 100644
--- a/third_party/blink/renderer/core/frame/visual_viewport.h
+++ b/third_party/blink/renderer/core/frame/visual_viewport.h
@@ -297,6 +297,7 @@
                      GraphicsLayerPaintingPhase,
                      const IntRect&) const override;
   void SetOverlayScrollbarsHidden(bool) override;
+  void SetPaintArtifactCompositorNeedsUpdate() const override;
   String DebugName(const GraphicsLayer*) const override;
 
   const ScrollableArea* GetScrollableAreaForTesting(
diff --git a/third_party/blink/renderer/core/frame/window.idl b/third_party/blink/renderer/core/frame/window.idl
index 66b2317a..a0396aac 100644
--- a/third_party/blink/renderer/core/frame/window.idl
+++ b/third_party/blink/renderer/core/frame/window.idl
@@ -215,7 +215,7 @@
     attribute DOMMatrixConstructor WebKitCSSMatrix;
 
     // TrustedTypes API: http://github.com/wicg/trusted-types
-    [RuntimeEnabled=TrustedDOMTypes, Unforgeable] readonly attribute TrustedTypePolicyFactory TrustedTypes;
+    [OriginTrialEnabled=TrustedDOMTypes, Unforgeable] readonly attribute TrustedTypePolicyFactory TrustedTypes;
 };
 
 Window implements GlobalEventHandlers;
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
index 5261bed..c9a271f 100644
--- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
+++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -273,9 +273,8 @@
   }
 
   // Log the aliased context type used.
-  if (!context_) {
+  if (!context_)
     UMA_HISTOGRAM_ENUMERATION("Blink.Canvas.ContextType", context_type);
-  }
 
   context_type =
       CanvasRenderingContext::ResolveContextTypeAliases(context_type);
@@ -317,7 +316,7 @@
     DidDraw();
   }
 
-  if (attributes.low_latency &&
+  if (context_->CreationAttributes().low_latency &&
       origin_trials::LowLatencyCanvasEnabled(&GetDocument())) {
     CreateLayer();
     SetNeedsUnbufferedInputEvents(true);
diff --git a/third_party/blink/renderer/core/html/html_script_element.cc b/third_party/blink/renderer/core/html/html_script_element.cc
index 2d59a131..d763efa 100644
--- a/third_party/blink/renderer/core/html/html_script_element.cc
+++ b/third_party/blink/renderer/core/html/html_script_element.cc
@@ -34,6 +34,7 @@
 #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
 #include "third_party/blink/renderer/core/frame/use_counter.h"
 #include "third_party/blink/renderer/core/html_names.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/script/script_loader.h"
 #include "third_party/blink/renderer/core/script/script_runner.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_script.h"
@@ -93,6 +94,12 @@
     LogUpdateAttributeIfIsolatedWorldAndInDocument("script", params);
   } else if (params.name == kAsyncAttr) {
     loader_->HandleAsyncAttribute();
+  } else if (params.name == kImportanceAttr &&
+             origin_trials::PriorityHintsEnabled(&GetDocument())) {
+    // The only thing we need to do for the the importance attribute/Priority
+    // Hints is count usage upon parsing. Processing the value happens when the
+    // element loads.
+    UseCounter::Count(GetDocument(), WebFeature::kPriorityHints);
   } else {
     HTMLElement::ParseAttribute(params);
   }
@@ -201,6 +208,10 @@
   return getAttribute(kReferrerpolicyAttr);
 }
 
+String HTMLScriptElement::ImportanceAttributeValue() const {
+  return getAttribute(kImportanceAttr);
+}
+
 String HTMLScriptElement::TextFromChildren() {
   return Element::TextFromChildren();
 }
diff --git a/third_party/blink/renderer/core/html/html_script_element.h b/third_party/blink/renderer/core/html/html_script_element.h
index dacc58b..7ccb77f 100644
--- a/third_party/blink/renderer/core/html/html_script_element.h
+++ b/third_party/blink/renderer/core/html/html_script_element.h
@@ -88,6 +88,7 @@
   String CrossOriginAttributeValue() const override;
   String IntegrityAttributeValue() const override;
   String ReferrerPolicyAttributeValue() const override;
+  String ImportanceAttributeValue() const override;
   String TextFromChildren() override;
   bool AsyncAttributeValue() const override;
   bool DeferAttributeValue() const override;
diff --git a/third_party/blink/renderer/core/html/html_script_element.idl b/third_party/blink/renderer/core/html/html_script_element.idl
index 6c9a177..c1bace7b 100644
--- a/third_party/blink/renderer/core/html/html_script_element.idl
+++ b/third_party/blink/renderer/core/html/html_script_element.idl
@@ -29,6 +29,7 @@
     [CEReactions, Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
     [CEReactions, RaisesException=Setter] attribute ScriptString text;
     [CEReactions, Reflect, ReflectOnly=("", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"), ReflectEmpty="", ReflectInvalid=""] attribute DOMString? referrerPolicy;
+    [CEReactions, MeasureAs=PriorityHints, OriginTrialEnabled=PriorityHints, Reflect, ReflectOnly=("low", "auto", "high"), ReflectMissing="auto", ReflectInvalid="auto"] attribute DOMString importance;
 
     // obsolete members
     // https://html.spec.whatwg.org/#HTMLScriptElement-partial
diff --git a/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc b/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
index c3ff2851..365db5fa 100644
--- a/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
+++ b/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
@@ -339,6 +339,10 @@
                !attribute_value.IsNull()) {
       SetReferrerPolicy(attribute_value,
                         kDoNotSupportReferrerPolicyLegacyKeywords);
+    } else if (!importance_mode_set_ &&
+               Match(attribute_name, kImportanceAttr) &&
+               priority_hints_origin_trial_enabled_) {
+      SetImportance(attribute_value);
     }
   }
 
diff --git a/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc b/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc
index 1ed900c..4546544c 100644
--- a/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc
+++ b/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc
@@ -167,6 +167,9 @@
 
     if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) {
       layer_->SetBounds(gfx::Size(frame_overlay.Size()));
+      overlay_->OverlayMainFrame()
+          ->View()
+          ->SetPaintArtifactCompositorNeedsUpdate();
       RecordForeignLayer(graphics_context,
                          DisplayItem::kForeignLayerDevToolsOverlay, layer_,
                          PropertyTreeState::Root());
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h
index d56cda96..b6cb4d4a 100644
--- a/third_party/blink/renderer/core/layout/layout_object.h
+++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -903,6 +903,14 @@
            bitfields_.NeedsPositionedMovementLayout();
   }
 
+  bool NeedsPositionedMovementLayoutOnly() const {
+    return bitfields_.NeedsPositionedMovementLayout() &&
+           !bitfields_.SelfNeedsLayout() &&
+           !bitfields_.NormalChildNeedsLayout() &&
+           !bitfields_.PosChildNeedsLayout() &&
+           !bitfields_.NeedsSimplifiedNormalFlowLayout();
+  }
+
   bool SelfNeedsLayout() const { return bitfields_.SelfNeedsLayout(); }
   bool NeedsPositionedMovementLayout() const {
     return bitfields_.NeedsPositionedMovementLayout();
diff --git a/third_party/blink/renderer/core/layout/line/breaking_context_inline_headers.h b/third_party/blink/renderer/core/layout/line/breaking_context_inline_headers.h
index bc06df1..e0a65b1a 100644
--- a/third_party/blink/renderer/core/layout/line/breaking_context_inline_headers.h
+++ b/third_party/blink/renderer/core/layout/line/breaking_context_inline_headers.h
@@ -125,6 +125,7 @@
                             const Font&,
                             bool apply_word_spacing,
                             float word_spacing);
+  void TrailingSpacesHang(bool can_break_mid_word);
   bool TrailingSpaceExceedsAvailableWidth(bool can_break_mid_word,
                                           const LineLayoutText&,
                                           WordMeasurement&,
@@ -205,6 +206,7 @@
   bool at_start_;
   bool ignoring_spaces_;
   bool current_character_is_space_;
+  bool previous_character_is_space_;
   bool single_leading_space_;
   unsigned current_start_offset_;  // initial offset for the current text
   bool applied_start_width_;
@@ -1044,7 +1046,7 @@
       layout_text_info_.line_break_iterator_.SecondToLastCharacter();
   for (; current_.Offset() < layout_text.TextLength();
        current_.FastIncrementInTextNode()) {
-    bool previous_character_is_space = current_character_is_space_;
+    previous_character_is_space_ = current_character_is_space_;
     UChar c = current_.Current();
     SetCurrentCharacterIsSpace(c);
 
@@ -1106,7 +1108,7 @@
       }
 
       PrepareForNextCharacter(layout_text, prohibit_break_inside,
-                              previous_character_is_space);
+                              previous_character_is_space_);
       at_start_ = false;
       NextCharacter(c, last_character, second_to_last_character);
       continue;
@@ -1146,7 +1148,7 @@
     // We keep track of the total width contributed by trailing space as we
     // often want to exclude it when determining
     // if a run fits on a line.
-    if (collapse_white_space_ && previous_character_is_space &&
+    if (collapse_white_space_ && previous_character_is_space_ &&
         current_character_is_space_ && last_width_measurement)
       width_.SetTrailingWhitespaceWidth(last_width_measurement);
 
@@ -1210,7 +1212,7 @@
     if (CanBreakAtWhitespace(
             break_words, word_measurement, stopped_ignoring_spaces, char_width,
             hyphenated, disable_soft_hyphen, hyphen_width, between_words,
-            mid_word_break, can_break_mid_word, previous_character_is_space,
+            mid_word_break, can_break_mid_word, previous_character_is_space_,
             last_width_measurement, layout_text, font, apply_word_spacing,
             word_spacing))
       return false;
@@ -1250,7 +1252,7 @@
     // go ahead and break up this run and enter a mode where we start collapsing
     // spaces.
     if (!ignoring_spaces_ && current_style_->CollapseWhiteSpace()) {
-      if (current_character_is_space_ && previous_character_is_space) {
+      if (current_character_is_space_ && previous_character_is_space_) {
         ignoring_spaces_ = true;
 
         // We just entered a mode where we are ignoring spaces. Create a
@@ -1263,7 +1265,7 @@
     }
 
     PrepareForNextCharacter(layout_text, prohibit_break_inside,
-                            previous_character_is_space);
+                            previous_character_is_space_);
     at_start_ = false;
     is_line_empty = line_info_.IsEmpty();
     NextCharacter(c, last_character, second_to_last_character);
@@ -1417,6 +1419,22 @@
   return word_measurement;
 }
 
+inline void BreakingContext::TrailingSpacesHang(bool can_break_mid_word) {
+  DCHECK(curr_ws_ == EWhiteSpace::kBreakSpaces);
+  // Avoid breaking before the first white-space after a word if there is a
+  // breaking opportunity before.
+  if (single_leading_space_ && !previous_character_is_space_)
+    return;
+
+  line_break_.MoveTo(current_.GetLineLayoutItem(), current_.Offset(),
+                     current_.NextBreakablePosition());
+
+  // Avoid breaking before the first white-space after a word, unless
+  // overflow-wrap or word-break allow to.
+  if (!previous_character_is_space_ && !can_break_mid_word)
+    line_break_.Increment();
+}
+
 inline bool BreakingContext::TrailingSpaceExceedsAvailableWidth(
     bool can_break_mid_word,
     const LineLayoutText& layout_text,
@@ -1439,8 +1457,13 @@
     // then move the line break to the space and skip all
     // additional whitespace.
     if (!width_.FitsOnLine(char_width)) {
+      if (curr_ws_ == EWhiteSpace::kBreakSpaces) {
+        TrailingSpacesHang(can_break_mid_word);
+        return true;
+      }
       line_break_.MoveTo(current_.GetLineLayoutItem(), current_.Offset(),
                          current_.NextBreakablePosition());
+
       SkipTrailingWhitespace(line_break_, line_info_);
       return true;
     }
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
index 80b1dbc..9a70c3d3 100644
--- a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
+++ b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
@@ -266,7 +266,7 @@
   if (!RuntimeEnabledFeatures::LayoutNGFragmentCachingEnabled())
     return nullptr;
   if (!cached_result_ || !Base::cached_constraint_space_ || break_token ||
-      Base::NeedsLayout())
+      (Base::NeedsLayout() && !NeedsRelativePositionedLayoutOnly()))
     return nullptr;
   const NGConstraintSpace& old_space = *Base::cached_constraint_space_;
   // If we used to contain abspos items, we can't reuse the fragment, because
@@ -322,6 +322,14 @@
     }
   }
 
+  // We can safely re-use this fragment if we are position relative, and only
+  // our position constraints changed (left/top/etc). However we need to clear
+  // the dirty layout bit.
+  if (NeedsRelativePositionedLayoutOnly())
+    Base::ClearNeedsLayout();
+  else
+    DCHECK(!Base::NeedsLayout());
+
   // The checks above should be enough to bail if layout is incomplete, but
   // let's verify:
   DCHECK(IsBlockLayoutComplete(old_space, *cached_result_));
@@ -551,6 +559,12 @@
     NGPaintFragment::DirtyLinesFromChangedChild(child);
 }
 
+template <typename Base>
+bool LayoutNGMixin<Base>::NeedsRelativePositionedLayoutOnly() const {
+  return Base::NeedsPositionedMovementLayoutOnly() &&
+         Base::StyleRef().GetPosition() == EPosition::kRelative;
+}
+
 template class CORE_TEMPLATE_EXPORT LayoutNGMixin<LayoutTableCaption>;
 template class CORE_TEMPLATE_EXPORT LayoutNGMixin<LayoutTableCell>;
 template class CORE_TEMPLATE_EXPORT LayoutNGMixin<LayoutBlockFlow>;
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h
index f5bac64..8dd8445 100644
--- a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h
+++ b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h
@@ -95,10 +95,6 @@
   void AddVisualOverflowFromChildren();
   void AddLayoutOverflowFromChildren() final;
 
- private:
-  void AddScrollingOverflowFromChildren();
-
- protected:
   void AddOutlineRects(Vector<LayoutRect>&,
                        const LayoutPoint& additional_offset,
                        NGOutlineType) const final;
@@ -116,6 +112,10 @@
   scoped_refptr<NGPaintFragment> paint_fragment_;
 
   friend class NGBaseLayoutAlgorithmTest;
+
+ private:
+  void AddScrollingOverflowFromChildren();
+  bool NeedsRelativePositionedLayoutOnly() const;
 };
 
 extern template class CORE_EXTERN_TEMPLATE_EXPORT
diff --git a/third_party/blink/renderer/core/loader/appcache/application_cache_host.cc b/third_party/blink/renderer/core/loader/appcache/application_cache_host.cc
index be828ae9..54808bb 100644
--- a/third_party/blink/renderer/core/loader/appcache/application_cache_host.cc
+++ b/third_party/blink/renderer/core/loader/appcache/application_cache_host.cc
@@ -92,7 +92,7 @@
     return;
 
   int host_id = host_->GetHostID();
-  if (host_id != WebApplicationCacheHost::kAppCacheNoHostId)
+  if (host_id != mojom::blink::kAppCacheNoHostId)
     request.SetAppCacheHostID(host_id);
 }
 
@@ -230,7 +230,7 @@
 
 int ApplicationCacheHost::GetHostID() const {
   if (!host_)
-    return WebApplicationCacheHost::kAppCacheNoHostId;
+    return mojom::blink::kAppCacheNoHostId;
   return host_->GetHostID();
 }
 
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_script_loader.cc b/third_party/blink/renderer/core/loader/modulescript/module_script_loader.cc
index 2f04c6f..66cc339 100644
--- a/third_party/blink/renderer/core/loader/modulescript/module_script_loader.cc
+++ b/third_party/blink/renderer/core/loader/modulescript/module_script_loader.cc
@@ -185,6 +185,12 @@
                                        fetch_params.GetResourceRequest().Url(),
                                        referrer_string));
 
+  // Priority Hints and a request's "importance" are currently non-standard, but
+  // we can assume the following (see https://crbug.com/821464):
+  // Step 5. "... importance is options's importance ..."
+  fetch_params.MutableResourceRequest().SetFetchImportanceMode(
+      options_.Importance());
+
   // Step 5. "... and client is fetch client settings object." [spec text]
   // -> set by ResourceFetcher
 
diff --git a/third_party/blink/renderer/core/paint/box_painter_base.cc b/third_party/blink/renderer/core/paint/box_painter_base.cc
index 0141aa7d..f84f3cfc 100644
--- a/third_party/blink/renderer/core/paint/box_painter_base.cc
+++ b/third_party/blink/renderer/core/paint/box_painter_base.cc
@@ -91,10 +91,6 @@
     if (fill_rect.IsEmpty())
       continue;
 
-    FloatRect shadow_rect(border.Rect());
-    shadow_rect.Inflate(shadow_blur + shadow_spread);
-    shadow_rect.Move(shadow_offset);
-
     // Save the state and clip, if not already done.
     // The clip does not depend on any shadow-specific properties.
     if (!state_saver.Saved()) {
@@ -136,14 +132,6 @@
                       DrawLooperBuilder::kShadowIgnoresAlpha, kDrawShadowOnly);
 
     if (has_border_radius) {
-      FloatRoundedRect influence_rect(
-          PixelSnappedIntRect(LayoutRect(shadow_rect)), border.GetRadii());
-      float change_amount = 2 * shadow_blur + shadow_spread;
-      if (change_amount >= 0)
-        influence_rect.ExpandRadii(change_amount);
-      else
-        influence_rect.ShrinkRadii(-change_amount);
-
       FloatRoundedRect rounded_fill_rect = border;
       rounded_fill_rect.Inflate(shadow_spread);
 
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
index 3d1a2f52..dc4c742 100644
--- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
+++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
@@ -3509,6 +3509,12 @@
     scrollable_area->SetScrollbarsHiddenIfOverlay(hidden);
 }
 
+void CompositedLayerMapping::SetPaintArtifactCompositorNeedsUpdate() const {
+  LocalFrameView* frame_view = GetLayoutObject().View()->GetFrameView();
+  DCHECK(frame_view);
+  frame_view->SetPaintArtifactCompositorNeedsUpdate();
+}
+
 #if DCHECK_IS_ON()
 void CompositedLayerMapping::VerifyNotPainting() {
   DCHECK(!GetLayoutObject().GetFrame()->GetPage() ||
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h
index 0752651b..9deb283 100644
--- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h
+++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h
@@ -215,6 +215,7 @@
   bool ShouldThrottleRendering() const override;
   bool IsTrackingRasterInvalidations() const override;
   void SetOverlayScrollbarsHidden(bool) override;
+  void SetPaintArtifactCompositorNeedsUpdate() const override;
 
 #if DCHECK_IS_ON()
   void VerifyNotPainting() override;
diff --git a/third_party/blink/renderer/core/paint/html_canvas_painter.cc b/third_party/blink/renderer/core/paint/html_canvas_painter.cc
index d0f90bc..83786fa 100644
--- a/third_party/blink/renderer/core/paint/html_canvas_painter.cc
+++ b/third_party/blink/renderer/core/paint/html_canvas_painter.cc
@@ -47,6 +47,10 @@
       layer->SetBounds(gfx::Size(pixel_snapped_rect.Size()));
       layer->SetIsDrawable(true);
       RecordForeignLayer(context, DisplayItem::kForeignLayerCanvas, layer);
+      if (layout_html_canvas_.GetFrameView()) {
+        layout_html_canvas_.GetFrameView()
+            ->SetPaintArtifactCompositorNeedsUpdate();
+      }
       return;
     }
   }
diff --git a/third_party/blink/renderer/core/paint/link_highlight_impl.cc b/third_party/blink/renderer/core/paint/link_highlight_impl.cc
index 392fc38..ef825d58 100644
--- a/third_party/blink/renderer/core/paint/link_highlight_impl.cc
+++ b/third_party/blink/renderer/core/paint/link_highlight_impl.cc
@@ -254,6 +254,12 @@
     FloatPoint offset(current_graphics_layer_->GetOffsetFromTransformNode());
     offset.MoveBy(bounding_rect.Location());
     layer->SetOffsetToTransformParent(gfx::Vector2dF(offset.X(), offset.Y()));
+    if (node_ && node_->GetLayoutObject() &&
+        node_->GetLayoutObject()->GetFrameView()) {
+      node_->GetLayoutObject()
+          ->GetFrameView()
+          ->SetPaintArtifactCompositorNeedsUpdate();
+    }
   }
 
   return path_has_changed;
@@ -489,6 +495,12 @@
     // Always set offset because it is excluded from the above equality check.
     layer->SetOffsetToTransformParent(
         gfx::Vector2dF(bounding_rect.X(), bounding_rect.Y()));
+    if (node_ && node_->GetLayoutObject() &&
+        node_->GetLayoutObject()->GetFrameView()) {
+      node_->GetLayoutObject()
+          ->GetFrameView()
+          ->SetPaintArtifactCompositorNeedsUpdate();
+    }
 
     auto property_tree_state = fragment->LocalBorderBoxProperties();
     DCHECK(fragment->PaintProperties());
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc
index 348970dd..584f9390a 100644
--- a/third_party/blink/renderer/core/paint/paint_layer.cc
+++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -3388,6 +3388,13 @@
 void PaintLayer::SetNeedsRepaint() {
   SetNeedsRepaintInternal();
 
+  // If you need repaint, then you might issue raster invalidations, and in
+  // Composite after Paint mode, we do these in PAC::Update().
+  LocalFrameView* frame_view = GetLayoutObject().GetDocument().View();
+  if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled() && frame_view) {
+    frame_view->SetPaintArtifactCompositorNeedsUpdate();
+  }
+
   // Do this unconditionally to ensure container chain is marked when
   // compositing status of the layer changes.
   MarkCompositingContainerChainForNeedsRepaint();
diff --git a/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc b/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc
index 46c1475c..d6e8e9e 100644
--- a/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc
+++ b/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc
@@ -362,13 +362,23 @@
           auto* mapping = paint_invalidation_layer->GetCompositedLayerMapping();
           if (!mapping)
             mapping = paint_invalidation_layer->GroupedMapping();
-          if (mapping)
+          if (mapping) {
             mapping->SetNeedsCheckRasterInvalidation();
+            mapping->SetPaintArtifactCompositorNeedsUpdate();
+          }
         }
-      } else if (!context.tree_builder_context
-                      ->supports_composited_raster_invalidation) {
-        paint_invalidator_context.subtree_flags |=
-            PaintInvalidatorContext::kSubtreeFullInvalidation;
+      } else {
+        if (object.GetFrame() && object.GetFrame()->LocalFrameRoot().View()) {
+          object.GetFrame()
+              ->LocalFrameRoot()
+              .View()
+              ->SetPaintArtifactCompositorNeedsUpdate();
+        }
+        if (!context.tree_builder_context
+                 ->supports_composited_raster_invalidation) {
+          paint_invalidator_context.subtree_flags |=
+              PaintInvalidatorContext::kSubtreeFullInvalidation;
+        }
       }
     }
   }
diff --git a/third_party/blink/renderer/core/paint/video_painter.cc b/third_party/blink/renderer/core/paint/video_painter.cc
index 5d8bbb1..4adf6f23 100644
--- a/third_party/blink/renderer/core/paint/video_painter.cc
+++ b/third_party/blink/renderer/core/paint/video_painter.cc
@@ -56,6 +56,8 @@
       layer->SetBounds(gfx::Size(snapped_replaced_rect.Size()));
       layer->SetIsDrawable(true);
       RecordForeignLayer(context, DisplayItem::kForeignLayerVideo, layer);
+      if (layout_video_.GetFrameView())
+        layout_video_.GetFrameView()->SetPaintArtifactCompositorNeedsUpdate();
       return;
     }
   }
diff --git a/third_party/blink/renderer/core/script/mock_script_element_base.h b/third_party/blink/renderer/core/script/mock_script_element_base.h
index 8259bc4..bb7fea1 100644
--- a/third_party/blink/renderer/core/script/mock_script_element_base.h
+++ b/third_party/blink/renderer/core/script/mock_script_element_base.h
@@ -33,6 +33,7 @@
   MOCK_CONST_METHOD0(ForAttributeValue, String());
   MOCK_CONST_METHOD0(IntegrityAttributeValue, String());
   MOCK_CONST_METHOD0(ReferrerPolicyAttributeValue, String());
+  MOCK_CONST_METHOD0(ImportanceAttributeValue, String());
   MOCK_CONST_METHOD0(LanguageAttributeValue, String());
   MOCK_CONST_METHOD0(NomoduleAttributeValue, bool());
   MOCK_CONST_METHOD0(SourceAttributeValue, String());
diff --git a/third_party/blink/renderer/core/script/script_element_base.h b/third_party/blink/renderer/core/script/script_element_base.h
index 7f6e6fa2..23e974d 100644
--- a/third_party/blink/renderer/core/script/script_element_base.h
+++ b/third_party/blink/renderer/core/script/script_element_base.h
@@ -51,6 +51,7 @@
   virtual String SourceAttributeValue() const = 0;
   virtual String TypeAttributeValue() const = 0;
   virtual String ReferrerPolicyAttributeValue() const = 0;
+  virtual String ImportanceAttributeValue() const = 0;
 
   virtual String TextFromChildren() = 0;
   virtual bool HasSourceAttribute() const = 0;
diff --git a/third_party/blink/renderer/core/script/script_loader.cc b/third_party/blink/renderer/core/script/script_loader.cc
index 27e7eb4..c58812ff 100644
--- a/third_party/blink/renderer/core/script/script_loader.cc
+++ b/third_party/blink/renderer/core/script/script_loader.cc
@@ -38,6 +38,7 @@
 #include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
 #include "third_party/blink/renderer/core/html_names.h"
 #include "third_party/blink/renderer/core/inspector/console_message.h"
+#include "third_party/blink/renderer/core/loader/importance_attribute.h"
 #include "third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h"
 #include "third_party/blink/renderer/core/loader/subresource_integrity_helper.h"
 #include "third_party/blink/renderer/core/script/classic_pending_script.h"
@@ -382,6 +383,14 @@
         &referrer_policy);
   }
 
+  // Priority Hints is currently a non-standard feature, but we can assume the
+  // following (see https://crbug.com/821464):
+  // <spec step="21">Let importance be the current state of the element's
+  // importance content attribute.</spec>
+  String importance_attr = element_->ImportanceAttributeValue();
+  mojom::FetchImportanceMode importance =
+      GetFetchImportanceAttributeValue(importance_attr);
+
   // <spec step="21">Let parser metadata be "parser-inserted" if the script
   // element has been flagged as "parser-inserted", and "not-parser-inserted"
   // otherwise.</spec>
@@ -411,7 +420,8 @@
   // parser metadata is parser metadata, credentials mode is module script
   // credentials mode, and referrer policy is referrer policy.</spec>
   ScriptFetchOptions options(nonce, integrity_metadata, integrity_attr,
-                             parser_state, credentials_mode, referrer_policy);
+                             parser_state, credentials_mode, referrer_policy,
+                             importance);
 
   // <spec step="23">Let settings object be the element's node document's
   // relevant settings object.</spec>
diff --git a/third_party/blink/renderer/core/style/computed_style.cc b/third_party/blink/renderer/core/style/computed_style.cc
index 02ee116..6bd3651 100644
--- a/third_party/blink/renderer/core/style/computed_style.cc
+++ b/third_party/blink/renderer/core/style/computed_style.cc
@@ -97,7 +97,7 @@
 
  private:
   void* data_refs[7];
-  unsigned bitfields[4];
+  unsigned bitfields[5];
 };
 
 struct SameSizeAsComputedStyle : public SameSizeAsComputedStyleBase,
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h
index 0e7918f4..6948bb1e 100644
--- a/third_party/blink/renderer/core/style/computed_style.h
+++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -2129,9 +2129,13 @@
   }
 
   // Whitespace utility functions.
+  static bool Is(EWhiteSpace a, EWhiteSpace b) {
+    return static_cast<unsigned>(a) & static_cast<unsigned>(b);
+  }
+  static bool IsNot(EWhiteSpace a, EWhiteSpace b) { return !Is(a, b); }
   static bool AutoWrap(EWhiteSpace ws) {
     // Nowrap and pre don't automatically wrap.
-    return ws != EWhiteSpace::kNowrap && ws != EWhiteSpace::kPre;
+    return IsNot(ws, EWhiteSpace::kNowrap | EWhiteSpace::kPre);
   }
 
   bool AutoWrap() const { return AutoWrap(WhiteSpace()); }
@@ -2149,7 +2153,8 @@
 
   static bool CollapseWhiteSpace(EWhiteSpace ws) {
     // Pre and prewrap do not collapse whitespace.
-    return ws != EWhiteSpace::kPre && ws != EWhiteSpace::kPreWrap;
+    return IsNot(ws, EWhiteSpace::kPre | EWhiteSpace::kPreWrap |
+                         EWhiteSpace::kBreakSpaces);
   }
 
   bool CollapseWhiteSpace() const { return CollapseWhiteSpace(WhiteSpace()); }
@@ -2165,15 +2170,15 @@
     return false;
   }
   bool BreakOnlyAfterWhiteSpace() const {
-    return WhiteSpace() == EWhiteSpace::kPreWrap ||
+    return Is(WhiteSpace(),
+              EWhiteSpace::kPreWrap | EWhiteSpace::kBreakSpaces) ||
            GetLineBreak() == LineBreak::kAfterWhiteSpace;
   }
 
   bool BreakWords() const {
     return (WordBreak() == EWordBreak::kBreakWord ||
             OverflowWrap() == EOverflowWrap::kBreakWord) &&
-           WhiteSpace() != EWhiteSpace::kPre &&
-           WhiteSpace() != EWhiteSpace::kNowrap;
+           IsNot(WhiteSpace(), EWhiteSpace::kPre | EWhiteSpace::kNowrap);
   }
 
   // Text direction utility functions.
diff --git a/third_party/blink/renderer/core/svg/svg_script_element.h b/third_party/blink/renderer/core/svg/svg_script_element.h
index 4525f28..5fe1cc2b236 100644
--- a/third_party/blink/renderer/core/svg/svg_script_element.h
+++ b/third_party/blink/renderer/core/svg/svg_script_element.h
@@ -76,6 +76,7 @@
   String ForAttributeValue() const override { return String(); }
   String IntegrityAttributeValue() const override { return String(); }
   String ReferrerPolicyAttributeValue() const override { return String(); }
+  String ImportanceAttributeValue() const override { return String(); }
   String LanguageAttributeValue() const override { return String(); }
   bool NomoduleAttributeValue() const override { return false; }
   String SourceAttributeValue() const override;
diff --git a/third_party/blink/renderer/core/timing/event_timing.cc b/third_party/blink/renderer/core/timing/event_timing.cc
index cca33b2..3315755 100644
--- a/third_party/blink/renderer/core/timing/event_timing.cc
+++ b/third_party/blink/renderer/core/timing/event_timing.cc
@@ -7,6 +7,7 @@
 #include "third_party/blink/renderer/core/dom/events/event.h"
 #include "third_party/blink/renderer/core/events/pointer_event.h"
 #include "third_party/blink/renderer/core/frame/local_dom_window.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/timing/dom_window_performance.h"
 #include "third_party/blink/renderer/core/timing/performance_event_timing.h"
 #include "third_party/blink/renderer/platform/wtf/time.h"
@@ -25,22 +26,29 @@
          event.isTrusted();
 }
 
+void EventTiming::FinishWillDispatch() {
+  processing_start_ = CurrentTimeTicks();
+  finished_will_dispatch_event_ = true;
+}
+
 void EventTiming::WillDispatchEvent(const Event& event) {
   // Assume each event can be dispatched only once.
   DCHECK(!finished_will_dispatch_event_);
   if (!performance_ || !ShouldReportForEventTiming(event))
     return;
 
-  // Although we screen the events for timing by setting these conditions here,
-  // we cannot assume that the conditions should still hold true in
-  // DidDispatchEvent. These conditions have to be re-tested before an entry is
-  // dispatched.
+  // We care about events when the first input is desired or
+  // when the EventTiming origin trial is enabled.
+  if (performance_->FirstInputDesired()) {
+    FinishWillDispatch();
+    return;
+  }
+  if (!origin_trials::EventTimingEnabled(performance_->GetExecutionContext()))
+    return;
   if ((performance_->ShouldBufferEntries() &&
        !performance_->IsEventTimingBufferFull()) ||
-      performance_->HasObserverFor(PerformanceEntry::kEvent) ||
-      !performance_->FirstInputDetected()) {
-    processing_start_ = CurrentTimeTicks();
-    finished_will_dispatch_event_ = true;
+      performance_->HasObserverFor(PerformanceEntry::kEvent)) {
+    FinishWillDispatch();
   }
 }
 
diff --git a/third_party/blink/renderer/core/timing/event_timing.h b/third_party/blink/renderer/core/timing/event_timing.h
index 59bacd8..96648d9d 100644
--- a/third_party/blink/renderer/core/timing/event_timing.h
+++ b/third_party/blink/renderer/core/timing/event_timing.h
@@ -26,6 +26,7 @@
   void DidDispatchEvent(const Event&);
 
  private:
+  void FinishWillDispatch();
   bool ShouldReportForEventTiming(const Event& event) const;
   // The time the first event handler or default action started to execute.
   TimeTicks processing_start_;
diff --git a/third_party/blink/renderer/core/timing/performance_event_timing.idl b/third_party/blink/renderer/core/timing/performance_event_timing.idl
index ef577a5..951011e3 100644
--- a/third_party/blink/renderer/core/timing/performance_event_timing.idl
+++ b/third_party/blink/renderer/core/timing/performance_event_timing.idl
@@ -3,10 +3,8 @@
 // found in the LICENSE file.
 
 // https://github.com/wicg/event-timing
-[
-    Exposed=Window,
-    OriginTrialEnabled=EventTiming
-] interface PerformanceEventTiming : PerformanceEntry {
+[Exposed=Window]
+interface PerformanceEventTiming : PerformanceEntry {
     readonly attribute DOMHighResTimeStamp processingStart;
     readonly attribute DOMHighResTimeStamp processingEnd;
     readonly attribute boolean cancelable;
diff --git a/third_party/blink/renderer/core/timing/performance_observer.cc b/third_party/blink/renderer/core/timing/performance_observer.cc
index fb30b69e..6141b19 100644
--- a/third_party/blink/renderer/core/timing/performance_observer.cc
+++ b/third_party/blink/renderer/core/timing/performance_observer.cc
@@ -59,10 +59,9 @@
   if (execution_context->IsDocument()) {
     if (origin_trials::ElementTimingEnabled(execution_context))
       supportedEntryTypes.push_back(performance_entry_names::kElement);
-    if (origin_trials::EventTimingEnabled(execution_context)) {
+    if (origin_trials::EventTimingEnabled(execution_context))
       supportedEntryTypes.push_back(performance_entry_names::kEvent);
-      supportedEntryTypes.push_back(performance_entry_names::kFirstInput);
-    }
+    supportedEntryTypes.push_back(performance_entry_names::kFirstInput);
     if (origin_trials::LayoutJankAPIEnabled(execution_context))
       supportedEntryTypes.push_back(performance_entry_names::kLayoutJank);
     supportedEntryTypes.push_back(performance_entry_names::kLongtask);
diff --git a/third_party/blink/renderer/core/timing/window_performance.cc b/third_party/blink/renderer/core/timing/window_performance.cc
index 8616fc2..56ef2cf 100644
--- a/third_party/blink/renderer/core/timing/window_performance.cc
+++ b/third_party/blink/renderer/core/timing/window_performance.cc
@@ -333,12 +333,23 @@
   return !timing() || !timing()->loadEventStart();
 }
 
+bool WindowPerformance::FirstInputDesired() const {
+  if (!GetFrame() || !GetFrame()->IsMainFrame())
+    return false;
+
+  return !first_input_timing_;
+}
+
 void WindowPerformance::RegisterEventTiming(const AtomicString& event_type,
                                             TimeTicks start_time,
                                             TimeTicks processing_start,
                                             TimeTicks processing_end,
                                             bool cancelable) {
-  DCHECK(origin_trials::EventTimingEnabled(GetExecutionContext()));
+  if (!GetFrame())
+    return;
+
+  DCHECK(FirstInputDesired() ||
+         origin_trials::EventTimingEnabled(GetExecutionContext()));
 
   // |start_time| could be null in some tests that inject input.
   DCHECK(!processing_start.is_null());
@@ -368,7 +379,11 @@
 
 void WindowPerformance::ReportEventTimings(WebLayerTreeView::SwapResult result,
                                            TimeTicks timestamp) {
-  DCHECK(origin_trials::EventTimingEnabled(GetExecutionContext()));
+  if (!GetFrame())
+    return;
+
+  DCHECK(FirstInputDesired() ||
+         origin_trials::EventTimingEnabled(GetExecutionContext()));
 
   DOMHighResTimeStamp end_time = MonotonicTimeToDOMHighResTimeStamp(timestamp);
   for (const auto& entry : event_timings_) {
@@ -386,8 +401,11 @@
             PerformanceEventTiming::CreateFirstInputTiming(entry));
       }
     }
-    if (duration_in_ms <= kEventTimingDurationThresholdInMs)
+    // Do not report EventTiming unless origin trial is enabled!
+    if (!origin_trials::EventTimingEnabled(GetExecutionContext()) ||
+        duration_in_ms <= kEventTimingDurationThresholdInMs) {
       continue;
+    }
 
     if (HasObserverFor(PerformanceEntry::kEvent)) {
       UseCounter::Count(GetFrame(),
@@ -418,8 +436,6 @@
 
 void WindowPerformance::DispatchFirstInputTiming(
     PerformanceEventTiming* entry) {
-  DCHECK(origin_trials::EventTimingEnabled(GetExecutionContext()));
-
   if (!entry)
     return;
   DCHECK_EQ("firstInput", entry->entryType());
diff --git a/third_party/blink/renderer/core/timing/window_performance.h b/third_party/blink/renderer/core/timing/window_performance.h
index 0d23bad..6efd939 100644
--- a/third_party/blink/renderer/core/timing/window_performance.h
+++ b/third_party/blink/renderer/core/timing/window_performance.h
@@ -71,7 +71,10 @@
 
   bool ShouldBufferEntries();
 
-  bool FirstInputDetected() const { return !!first_input_timing_; }
+  // Currently, returns false always for frames that are not main frames because
+  // we're only shipping FirstInputTiming on main frames. For main frames,
+  // returns true if the first input has not yet been calculated.
+  bool FirstInputDesired() const;
 
   // This method creates a PerformanceEventTiming and if needed creates a swap
   // promise to calculate the |duration| attribute when such promise is
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_html.idl b/third_party/blink/renderer/core/trustedtypes/trusted_html.idl
index 995d8149..fc33951 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_html.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_html.idl
@@ -8,7 +8,7 @@
 
 [
     Exposed=Window,
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedHTML {
     stringifier;
 };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_script.idl b/third_party/blink/renderer/core/trustedtypes/trusted_script.idl
index a8f86e4..7761036 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_script.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_script.idl
@@ -8,7 +8,7 @@
 
 [
     Exposed=Window,
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedScript {
     stringifier;
 };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl b/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl
index 3a4faee..e1a4c0c 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl
@@ -8,7 +8,7 @@
 
 [
     Exposed=Window,
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedScriptURL {
     stringifier;
 };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl
index 60f712be..b6985b33 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl
@@ -8,7 +8,7 @@
 
 [
     Exposed=Window,
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedTypePolicy {
     [Unforgeable] readonly attribute DOMString name;
     [CallWith=ScriptState, RaisesException, Unforgeable] TrustedHTML createHTML(DOMString input);
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc
index eabed0a..b62f1296 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc
@@ -14,9 +14,9 @@
 #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
 #include "third_party/blink/renderer/core/frame/local_frame.h"
 #include "third_party/blink/renderer/core/frame/use_counter.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h"
 #include "third_party/blink/renderer/platform/bindings/exception_state.h"
-#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
 #include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
 
 namespace blink {
@@ -28,8 +28,8 @@
     ExceptionState& exception_state) {
   UseCounter::Count(GetExecutionContext(),
                     WebFeature::kTrustedTypesCreatePolicy);
-
-  if (!GetExecutionContext()
+  if (origin_trials::TrustedDOMTypesEnabled(GetExecutionContext()) &&
+      !GetExecutionContext()
            ->GetContentSecurityPolicy()
            ->AllowTrustedTypePolicy(policy_name)) {
     exception_state.ThrowTypeError("Policy " + policy_name + " disallowed.");
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl
index 2adbc9a..29c5c167 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl
@@ -6,7 +6,7 @@
 
 [
     Exposed=(Window, Worker),
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedTypePolicyFactory {
     [RaisesException, Unforgeable] TrustedTypePolicy createPolicy(DOMString policyName, TrustedTypePolicyOptions policyOptions, optional boolean exposed = false);
     [Unforgeable] TrustedTypePolicy getExposedPolicy(DOMString policyName);
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc
index 66f0e61..ce9921c 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc
@@ -12,6 +12,7 @@
 #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
 #include "third_party/blink/renderer/core/dom/document.h"
 #include "third_party/blink/renderer/core/frame/local_dom_window.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_html.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_script.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_script_url.h"
@@ -27,7 +28,7 @@
     const Document* doc,
     ExceptionState& exception_state) {
   DCHECK(string_or_trusted_type.IsString() ||
-         RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+         origin_trials::TrustedDOMTypesEnabled(doc));
   DCHECK(!string_or_trusted_type.IsNull());
 
   if (string_or_trusted_type.IsString() && doc && doc->RequireTrustedTypes()) {
@@ -128,7 +129,7 @@
                                 const Document* doc,
                                 ExceptionState& exception_state) {
   DCHECK(string_or_trusted_html.IsString() ||
-         RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+         origin_trials::TrustedDOMTypesEnabled(doc));
   DCHECK(!string_or_trusted_html.IsNull());
 
   bool require_trusted_type = doc && doc->RequireTrustedTypes();
@@ -168,7 +169,7 @@
     const Document* doc,
     ExceptionState& exception_state) {
   DCHECK(string_or_trusted_script.IsString() ||
-         RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+         origin_trials::TrustedDOMTypesEnabled(doc));
 
   // To remain compatible with legacy behaviour, HTMLElement uses extended IDL
   // attributes to allow for nullable union of (DOMString or TrustedScript).
@@ -228,10 +229,12 @@
     const Document* doc,
     ExceptionState& exception_state) {
   DCHECK(string_or_trusted_script_url.IsString() ||
-         RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+         origin_trials::TrustedDOMTypesEnabled(doc));
   DCHECK(!string_or_trusted_script_url.IsNull());
 
-  bool require_trusted_type = doc && doc->RequireTrustedTypes();
+  bool require_trusted_type = doc &&
+                              origin_trials::TrustedDOMTypesEnabled(doc) &&
+                              doc->RequireTrustedTypes();
   if (!require_trusted_type && string_or_trusted_script_url.IsString()) {
     return string_or_trusted_script_url.GetAsString();
   }
@@ -270,7 +273,7 @@
                                const Document* doc,
                                ExceptionState& exception_state) {
   DCHECK(string_or_trusted_url.IsUSVString() ||
-         RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
+         origin_trials::TrustedDOMTypesEnabled(doc));
   DCHECK(!string_or_trusted_url.IsNull());
 
   bool require_trusted_type = doc && doc->RequireTrustedTypes();
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc b/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc
index aa97005..ea709f98 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc
@@ -26,7 +26,7 @@
     const StringOrTrustedHTMLOrTrustedScriptOrTrustedScriptURLOrTrustedURL&
         string_or_trusted_type) {
   Document* document = Document::CreateForTest();
-  document->SetRequireTrustedTypes();
+  document->SetRequireTrustedTypesForTesting();
   DummyExceptionStateForTesting exception_state;
   ASSERT_FALSE(exception_state.HadException());
   String s = GetStringFromTrustedType(string_or_trusted_type, document,
@@ -41,7 +41,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   ASSERT_FALSE(exception_state.HadException());
@@ -57,7 +57,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   ASSERT_FALSE(exception_state.HadException());
@@ -73,7 +73,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   ASSERT_FALSE(exception_state.HadException());
@@ -89,7 +89,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   ASSERT_FALSE(exception_state.HadException());
@@ -106,7 +106,7 @@
         string_or_trusted_type,
     String expected) {
   Document* document = Document::CreateForTest();
-  document->SetRequireTrustedTypes();
+  document->SetRequireTrustedTypesForTesting();
   DummyExceptionStateForTesting exception_state;
   String s = GetStringFromTrustedType(string_or_trusted_type, document,
                                       exception_state);
@@ -119,7 +119,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   String s = GetStringFromTrustedHTML(string_or_trusted_html, &document,
@@ -133,7 +133,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   String s = GetStringFromTrustedScript(string_or_trusted_script, &document,
@@ -147,7 +147,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   String s = GetStringFromTrustedScriptURL(string_or_trusted_script_url,
@@ -161,7 +161,7 @@
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Document& document = dummy_page_holder->GetDocument();
-  document.SetRequireTrustedTypes();
+  document.SetRequireTrustedTypesForTesting();
   V8TestingScope scope;
   DummyExceptionStateForTesting exception_state;
   String s = GetStringFromTrustedURL(string_or_trusted_url, &document,
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_url.idl b/third_party/blink/renderer/core/trustedtypes/trusted_url.idl
index b611563..d11a566 100644
--- a/third_party/blink/renderer/core/trustedtypes/trusted_url.idl
+++ b/third_party/blink/renderer/core/trustedtypes/trusted_url.idl
@@ -8,7 +8,7 @@
 
 [
     Exposed=Window,
-    RuntimeEnabled=TrustedDOMTypes
+    OriginTrialEnabled=TrustedDOMTypes
 ] interface TrustedURL {
     stringifier;
 };
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc
index fa257ad7..016a33d 100644
--- a/third_party/blink/renderer/core/workers/worker_global_scope.cc
+++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
@@ -50,6 +50,7 @@
 #include "third_party/blink/renderer/core/loader/threadable_loader.h"
 #include "third_party/blink/renderer/core/messaging/message_port.h"
 #include "third_party/blink/renderer/core/origin_trials/origin_trial_context.h"
+#include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/probe/core_probes.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_script_url.h"
 #include "third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.h"
@@ -143,15 +144,8 @@
     ExceptionState& exception_state) {
   Vector<String> string_urls;
   for (const StringOrTrustedScriptURL& stringOrUrl : urls) {
-    DCHECK(stringOrUrl.IsString() ||
-           RuntimeEnabledFeatures::TrustedDOMTypesEnabled());
-    if (!stringOrUrl.IsTrustedScriptURL() &&
-        GetSecurityContext().RequireTrustedTypes()) {
-      exception_state.ThrowTypeError(
-          "This worker requires `TrustedScriptURL` assignment.");
-      return;
-    }
-
+    // TODO(vogelheim): Re-implement Trusted Types logic when supported by
+    // workers.
     String string_url = stringOrUrl.IsString()
                             ? stringOrUrl.GetAsString()
                             : stringOrUrl.GetAsTrustedScriptURL()->toString();
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.idl b/third_party/blink/renderer/core/workers/worker_global_scope.idl
index 10ede08a..23c7f0cb 100644
--- a/third_party/blink/renderer/core/workers/worker_global_scope.idl
+++ b/third_party/blink/renderer/core/workers/worker_global_scope.idl
@@ -77,9 +77,6 @@
     // https://drafts.csswg.org/css-font-loading-3/#font-face-source
     // TODO(fserb): temporarly until we can enable the interface below.
     [RuntimeEnabled=OffscreenCanvasText] readonly attribute FontFaceSet fonts;
-
-    // TrustedTypes API: http://github.com/wicg/trusted-types
-    [RuntimeEnabled=TrustedDOMTypes, Unforgeable] readonly attribute TrustedTypePolicyFactory TrustedTypes;
 };
 
 WorkerGlobalScope implements WindowOrWorkerGlobalScope;
diff --git a/third_party/blink/renderer/devtools/front_end/network/networkPanel.css b/third_party/blink/renderer/devtools/front_end/network/networkPanel.css
index 1791144d..7e31424 100644
--- a/third_party/blink/renderer/devtools/front_end/network/networkPanel.css
+++ b/third_party/blink/renderer/devtools/front_end/network/networkPanel.css
@@ -37,7 +37,7 @@
 }
 
 .network-details-view-tall-header {
-    margin-top: 4px;
+    border-top: 4px solid var(--toolbar-bg-color);
 }
 
 .network-item-view {
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
index d8349d57..806b3ee 100644
--- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
+++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
@@ -245,24 +245,8 @@
     kurls.insert(request_url);
   }
 
-  const bool has_duplicate_requests = kurls.size() != fetch_api_requests.size();
-
   UMA_HISTOGRAM_BOOLEAN("BackgroundFetch.HasDuplicateRequests",
-                        has_duplicate_requests);
-
-  // Note: This is a proprietary check, due to the way Chrome currently handles
-  // storing background fetch records. Entries are keyed by the URL, so if two
-  // requests have the same URL, and different responses, the first response
-  // will be lost when the second request/response pair is stored.
-  if (has_duplicate_requests) {
-    return ScriptPromise::Reject(
-        script_state,
-        V8ThrowException::CreateTypeError(
-            script_state->GetIsolate(),
-            "Fetches with duplicate requests are not yet supported. "
-            "Consider adding query params to make the requests unique. "
-            "For updates check http://crbug.com/871174"));
-  }
+                        kurls.size() != fetch_api_requests.size());
 
   ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
   ScriptPromise promise = resolver->Promise();
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc
index 51d7ab2..52c1987 100644
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc
@@ -5,6 +5,7 @@
 #include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h"
 
 #include <memory>
+#include "build/build_config.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
@@ -1240,6 +1241,10 @@
 }
 
 TEST_F(CanvasRenderingContext2DTest, LowLatencyIsSingleBuffered) {
+#if defined(OS_MACOSX)
+  // TODO(crbug.com/922218): enable lowLatency on Mac.
+  return;
+#endif
   CreateContext(kNonOpaque, kLowLatency);
   // No need to set-up the layer bridge when testing low latency mode.
   DrawSomething();
diff --git a/third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.cc b/third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.cc
index 7f023cb..40c3bab 100644
--- a/third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.cc
+++ b/third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 #include "third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.h"
 
+#include "build/build_config.h"
 #include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
 #include "third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_module.h"
 
@@ -17,7 +18,12 @@
   result.depth = attrs->depth();
   result.fail_if_major_performance_caveat =
       attrs->failIfMajorPerformanceCaveat();
+#if defined(OS_MACOSX)
+  // TODO(crbug.com/922218): enable lowLatency on Mac.
+  result.low_latency = false;
+#else
   result.low_latency = attrs->lowLatency();
+#endif
   result.pixel_format = attrs->pixelFormat();
   result.premultiplied_alpha = attrs->premultipliedAlpha();
   result.preserve_drawing_buffer = attrs->preserveDrawingBuffer();
diff --git a/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc b/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
index 121b82b..6be47fe 100644
--- a/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
+++ b/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 
+#include "build/build_config.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/platform/modules/frame_sinks/embedded_frame_sink.mojom-blink.h"
@@ -74,6 +75,11 @@
 // Verifies that a lowLatency canvas has the appropriate opacity/blending
 // information sent to the CompositorFrameSink.
 TEST_P(HTMLCanvasElementModuleTest, LowLatencyCanvasCompositorFrameOpacity) {
+#if defined(OS_MACOSX)
+  // TODO(crbug.com/922218): enable lowLatency on Mac.
+  return;
+#endif
+
   ScopedTestingPlatformSupport<TestingPlatformSupportWithGenerateFrameSinkId>
       platform;
 
diff --git a/third_party/blink/renderer/modules/contacts_picker/contacts_manager.idl b/third_party/blink/renderer/modules/contacts_picker/contacts_manager.idl
index 73ac590..be86b92 100644
--- a/third_party/blink/renderer/modules/contacts_picker/contacts_manager.idl
+++ b/third_party/blink/renderer/modules/contacts_picker/contacts_manager.idl
@@ -7,7 +7,7 @@
 [
     Exposed=Window,
     SecureContext,
-    RuntimeEnabled=ContactsManager
+    OriginTrialEnabled=ContactsManager
 ] interface ContactsManager {
     [CallWith=ScriptState] Promise<sequence<ContactInfo>> select(ContactsSelectOptions options);
 };
diff --git a/third_party/blink/renderer/modules/contacts_picker/navigator_contacts.idl b/third_party/blink/renderer/modules/contacts_picker/navigator_contacts.idl
index bb47e9c..cfc26d1 100644
--- a/third_party/blink/renderer/modules/contacts_picker/navigator_contacts.idl
+++ b/third_party/blink/renderer/modules/contacts_picker/navigator_contacts.idl
@@ -8,5 +8,5 @@
     Exposed=Window,
     ImplementedAs=NavigatorContacts
 ] partial interface Navigator {
-    [SecureContext, RuntimeEnabled=ContactsManager] readonly attribute ContactsManager contacts;
+    [SecureContext, OriginTrialEnabled=ContactsManager] readonly attribute ContactsManager contacts;
 };
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request.cc b/third_party/blink/renderer/modules/indexeddb/idb_request.cc
index d85a5e66..0434292 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_request.cc
+++ b/third_party/blink/renderer/modules/indexeddb/idb_request.cc
@@ -691,6 +691,9 @@
   if (transaction_ && ready_state_ == DONE)
     transaction_->UnregisterRequest(this);
 
+  if (event.type() == event_type_names::kError && transaction_)
+    transaction_->IncrementNumErrorsHandled();
+
   event.SetTarget(this);
   DispatchEventResult dispatch_result =
       IDBEventDispatcher::Dispatch(event, targets);
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
index 51a9b3fa..a806787 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
+++ b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
@@ -161,7 +161,7 @@
                    int64_t index_id,
                    const WTF::String& new_name) override {}
   void Abort(int64_t transaction_id) override {}
-  void Commit(int64_t transaction_id) override {}
+  void Commit(int64_t transaction_id, int64_t num_errors_handled) override {}
 
   bool destroyed() { return destroyed_; }
 
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_transaction.cc b/third_party/blink/renderer/modules/indexeddb/idb_transaction.cc
index 97ef274..c962574 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_transaction.cc
+++ b/third_party/blink/renderer/modules/indexeddb/idb_transaction.cc
@@ -337,7 +337,7 @@
   state_ = active ? kActive : kInactive;
 
   if (!active && request_list_.IsEmpty() && BackendDB())
-    BackendDB()->Commit(id_);
+    BackendDB()->Commit(id_, num_errors_handled_);
 }
 
 void IDBTransaction::abort(ExceptionState& exception_state) {
@@ -381,7 +381,7 @@
   state_ = kFinishing;
 
   if (BackendDB())
-    BackendDB()->Commit(id_);
+    BackendDB()->Commit(id_, num_errors_handled_);
 }
 
 void IDBTransaction::RegisterRequest(IDBRequest* request) {
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_transaction.h b/third_party/blink/renderer/modules/indexeddb/idb_transaction.h
index ec5a242a..86ddff0a 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_transaction.h
+++ b/third_party/blink/renderer/modules/indexeddb/idb_transaction.h
@@ -120,6 +120,8 @@
   bool IsVersionChange() const {
     return mode_ == mojom::IDBTransactionMode::VersionChange;
   }
+  int64_t NumErrorsHandled() const { return num_errors_handled_; }
+  void IncrementNumErrorsHandled() { ++num_errors_handled_; }
 
   // Implement the IDBTransaction IDL
   const String& mode() const;
@@ -225,6 +227,7 @@
 
   State state_ = kActive;
   bool has_pending_activity_ = true;
+  int64_t num_errors_handled_ = 0;
   Member<DOMException> error_;
 
   HeapListHashSet<Member<IDBRequest>> request_list_;
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc b/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc
index c9978ef..889759b1 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc
+++ b/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc
@@ -324,7 +324,7 @@
 TEST_F(IDBTransactionTest, TransactionFinish) {
   V8TestingScope scope;
   std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::Create();
-  EXPECT_CALL(*backend, Commit(kTransactionId)).Times(1);
+  EXPECT_CALL(*backend, Commit(kTransactionId, 0)).Times(1);
   EXPECT_CALL(*backend, Close()).Times(1);
   BuildTransaction(scope, std::move(backend));
 
diff --git a/third_party/blink/renderer/modules/indexeddb/mock_web_idb_database.h b/third_party/blink/renderer/modules/indexeddb/mock_web_idb_database.h
index 716a645..0ed42f3 100644
--- a/third_party/blink/renderer/modules/indexeddb/mock_web_idb_database.h
+++ b/third_party/blink/renderer/modules/indexeddb/mock_web_idb_database.h
@@ -38,7 +38,8 @@
   MOCK_METHOD0(Close, void());
   MOCK_METHOD0(VersionChangeIgnored, void());
   MOCK_METHOD1(Abort, void(long long transaction_id));
-  MOCK_METHOD1(Commit, void(long long transaction_id));
+  MOCK_METHOD2(Commit,
+               void(long long transaction_id, long long num_errors_handled));
   MOCK_METHOD7(CreateIndex,
                void(long long transaction_id,
                     long long object_store_id,
diff --git a/third_party/blink/renderer/modules/indexeddb/web_idb_database.h b/third_party/blink/renderer/modules/indexeddb/web_idb_database.h
index da5a838..f2b7089 100644
--- a/third_party/blink/renderer/modules/indexeddb/web_idb_database.h
+++ b/third_party/blink/renderer/modules/indexeddb/web_idb_database.h
@@ -60,7 +60,8 @@
   virtual void VersionChangeIgnored() = 0;
 
   virtual void Abort(long long transaction_id) = 0;
-  virtual void Commit(long long transaction_id) = 0;
+  virtual void Commit(long long transaction_id,
+                      long long num_errors_handled) = 0;
 
   virtual void CreateIndex(long long transaction_id,
                            long long object_store_id,
diff --git a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
index 932da42..c8f5339 100644
--- a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
+++ b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
@@ -260,8 +260,9 @@
   database_->Abort(transaction_id);
 }
 
-void WebIDBDatabaseImpl::Commit(long long transaction_id) {
-  database_->Commit(transaction_id);
+void WebIDBDatabaseImpl::Commit(long long transaction_id,
+                                long long num_errors_handled) {
+  database_->Commit(transaction_id, num_errors_handled);
 }
 
 mojom::blink::IDBCallbacksAssociatedPtrInfo
diff --git a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.h b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.h
index 9d1f7c4..a69c90e 100644
--- a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.h
+++ b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.h
@@ -118,7 +118,7 @@
                    long long index_id,
                    const String& new_name) override;
   void Abort(long long transaction_id) override;
-  void Commit(long long transaction_id) override;
+  void Commit(long long transaction_id, long long num_errors_handled) override;
 
  private:
   mojom::blink::IDBCallbacksAssociatedPtrInfo GetCallbacksProxy(
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc
index ad069f4..9cc99c54 100644
--- a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc
+++ b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc
@@ -87,6 +87,8 @@
          constraint_set->hasChannelCount() || constraint_set->hasDepthFar() ||
          constraint_set->hasDepthNear() || constraint_set->hasDeviceId() ||
          constraint_set->hasEchoCancellation() ||
+         constraint_set->hasNoiseSuppression() ||
+         constraint_set->hasAutoGainControl() ||
          constraint_set->hasFacingMode() || constraint_set->hasResizeMode() ||
          constraint_set->hasFocalLengthX() ||
          constraint_set->hasFocalLengthY() || constraint_set->hasFrameRate() ||
diff --git a/third_party/blink/renderer/platform/exported/web_media_constraints.cc b/third_party/blink/renderer/platform/exported/web_media_constraints.cc
index c671584..05c0f753 100644
--- a/third_party/blink/renderer/platform/exported/web_media_constraints.cc
+++ b/third_party/blink/renderer/platform/exported/web_media_constraints.cc
@@ -361,9 +361,9 @@
       hotword_enabled("hotwordEnabled"),
       goog_echo_cancellation("googEchoCancellation"),
       goog_experimental_echo_cancellation("googExperimentalEchoCancellation"),
-      goog_auto_gain_control("googAutoGainControl"),
+      goog_auto_gain_control("autoGainControl"),
       goog_experimental_auto_gain_control("googExperimentalAutoGainControl"),
-      goog_noise_suppression("googNoiseSuppression"),
+      goog_noise_suppression("noiseSuppression"),
       goog_highpass_filter("googHighpassFilter"),
       goog_typing_noise_detection("googTypingNoiseDetection"),
       goog_experimental_noise_suppression("googExperimentalNoiseSuppression"),
diff --git a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc
index 3214da58..851be76f 100644
--- a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc
+++ b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.cc
@@ -289,9 +289,5 @@
   return texture_holder_->CurrentFrameKnownToBeOpaque();
 }
 
-void AcceleratedStaticBitmapImage::Abandon() {
-  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-  texture_holder_->Abandon();
-}
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h
index fa769532..7fc90d2 100644
--- a/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h
+++ b/third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h
@@ -88,8 +88,6 @@
 
   PaintImage PaintImageForCurrentFrame() override;
 
-  void Abandon() final;
-
   TextureHolder* TextureHolderForTesting() { return texture_holder_.get(); }
 
  private:
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
index d7c0ca1..618a32a 100644
--- a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
+++ b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
@@ -31,6 +31,7 @@
 #include "third_party/blink/renderer/platform/graphics/bitmap_image.h"
 
 #include "base/test/simple_test_tick_clock.h"
+#include "cc/paint/image_provider.h"
 #include "cc/paint/skia_paint_canvas.h"
 #include "cc/tiles/mipmap_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
index 3e9fe96..4d20e8d 100644
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
@@ -68,7 +68,8 @@
     base::RepeatingCallback<void(const gfx::ScrollOffset&,
                                  const cc::ElementId&)> scroll_callback)
     : scroll_callback_(std::move(scroll_callback)),
-      tracks_raster_invalidations_(false) {
+      tracks_raster_invalidations_(false),
+      needs_update_(true) {
   if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled() &&
       !RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())
     return;
@@ -87,6 +88,8 @@
 }
 
 void PaintArtifactCompositor::EnableExtraDataForTesting() {
+  if (!extra_data_for_testing_enabled_)
+    SetNeedsUpdate(true);
   extra_data_for_testing_enabled_ = true;
   extra_data_for_testing_ = std::make_unique<ExtraDataForTesting>();
 }
@@ -789,6 +792,11 @@
   if (!host)
     return;
 
+  // Skip updating property trees, pushing cc::Layers, and issuing raster
+  // invalidations if possible.
+  if (!NeedsUpdate())
+    return;
+
   // When using BlinkGenPropertyTrees, the compositor accepts a list of layers
   // and property trees instead of building property trees. This DCHECK ensures
   // we have not forgotten to set |use_layer_lists|.
@@ -818,6 +826,8 @@
   for (auto& entry : synthesized_clip_cache_)
     entry.in_use = false;
 
+  // Clear prior frame ids before inserting new ones.
+  composited_element_ids.clear();
   for (auto& pending_layer : pending_layers) {
     const auto& property_state = pending_layer.property_tree_state;
     const auto* transform = property_state.Transform();
@@ -923,6 +933,7 @@
   // Mark the property trees as having been rebuilt.
   host->property_trees()->needs_rebuild = false;
   host->property_trees()->ResetCachedData();
+  SetNeedsUpdate(false);
 
   g_s_property_tree_sequence_number++;
 
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
index a582b24..26a8f15 100644
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
@@ -132,6 +132,9 @@
                                      const PropertyTreeState& layer_state,
                                      const PaintChunkSubset& paint_chunks);
 
+  void SetNeedsUpdate(bool needs_update) { needs_update_ = needs_update; }
+  bool NeedsUpdate() const { return needs_update_; }
+
  private:
   // A pending layer is a collection of paint chunks that will end up in
   // the same cc::Layer.
@@ -246,6 +249,7 @@
       scroll_callback_;
 
   bool tracks_raster_invalidations_;
+  bool needs_update_;
 
   scoped_refptr<cc::Layer> root_layer_;
   Vector<std::unique_ptr<ContentLayerClientImpl>> content_layer_clients_;
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc
index 3dc8a95..a601fe2 100644
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor_test.cc
@@ -139,6 +139,7 @@
       CompositorElementIdSet& element_ids,
       const ViewportProperties& viewport_properties = ViewportProperties(),
       const Settings& settings = Settings()) {
+    paint_artifact_compositor_->SetNeedsUpdate(true);
     paint_artifact_compositor_->Update(artifact, element_ids,
                                        viewport_properties, settings);
     layer_tree_->layer_tree_host()->LayoutAndUpdateLayers();
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.cc b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
index 69ef671..75bfb51 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer.cc
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
@@ -452,6 +452,7 @@
     const auto& offset = GetContentsOffsetFromTransformNode();
     contents_layer->SetOffsetToTransformParent(
         gfx::Vector2dF(offset.X(), offset.Y()));
+    SetPaintArtifactCompositorNeedsUpdate();
   }
   contents_layer->SetPosition(
       FloatPoint(contents_rect_.X(), contents_rect_.Y()));
@@ -741,6 +742,10 @@
   UpdateLayerIsDrawable();
 }
 
+void GraphicsLayer::SetPaintArtifactCompositorNeedsUpdate() const {
+  client_.SetPaintArtifactCompositorNeedsUpdate();
+}
+
 void GraphicsLayer::SetClipParent(cc::Layer* parent) {
   has_clip_parent_ = !!parent;
   CcLayer()->SetClipParent(parent);
@@ -1057,6 +1062,7 @@
       ContentsLayer()->SetOffsetToTransformParent(
           gfx::Vector2dF(offset.X(), offset.Y()));
     }
+    SetPaintArtifactCompositorNeedsUpdate();
   }
 }
 
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.h b/third_party/blink/renderer/platform/graphics/graphics_layer.h
index 119dc09c..71f0781 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer.h
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer.h
@@ -173,6 +173,8 @@
   void SetScrollParent(cc::Layer*);
   void SetClipParent(cc::Layer*);
 
+  void SetPaintArtifactCompositorNeedsUpdate() const;
+
   // For special cases, e.g. drawing missing tiles on Android.
   // The compositor should never paint this color in normal cases because the
   // Layer will paint the background by itself.
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer_client.h b/third_party/blink/renderer/platform/graphics/graphics_layer_client.h
index 7561489f..f55c529 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer_client.h
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer_client.h
@@ -97,6 +97,8 @@
 
   virtual void SetOverlayScrollbarsHidden(bool) {}
 
+  virtual void SetPaintArtifactCompositorNeedsUpdate() const {}
+
   virtual String DebugName(const GraphicsLayer*) const = 0;
 
   virtual const ScrollableArea* GetScrollableAreaForTesting(
diff --git a/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc b/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc
index 76a59a71..da6cd935 100644
--- a/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc
+++ b/third_party/blink/renderer/platform/graphics/mailbox_texture_holder.cc
@@ -79,7 +79,7 @@
     return;
   }
 
-  if (!ContextProviderWrapper() || IsAbandoned())
+  if (!ContextProviderWrapper())
     return;
 
   TRACE_EVENT0("blink", "MailboxTextureHolder::Sync");
@@ -129,7 +129,7 @@
     // Just assume valid. Potential problem will be detected later.
     return true;
   }
-  return !IsAbandoned() && !!ContextProviderWrapper();
+  return !!ContextProviderWrapper();
 }
 
 bool MailboxTextureHolder::IsCrossThread() const {
@@ -141,20 +141,18 @@
       new gpu::SyncToken(sync_token_));
   std::unique_ptr<gpu::Mailbox> passed_mailbox(new gpu::Mailbox(mailbox_));
 
-  if (!IsAbandoned()) {
-    if (texture_thread_task_runner_ &&
-        thread_id_ != Thread::Current()->ThreadId()) {
-      PostCrossThreadTask(
-          *texture_thread_task_runner_, FROM_HERE,
-          CrossThreadBind(&ReleaseTexture, is_converted_from_skia_texture_,
-                          texture_id_, WTF::Passed(std::move(passed_mailbox)),
-                          WTF::Passed(ContextProviderWrapper()),
-                          WTF::Passed(std::move(passed_sync_token))));
-    } else {
-      ReleaseTexture(is_converted_from_skia_texture_, texture_id_,
-                     std::move(passed_mailbox), ContextProviderWrapper(),
-                     std::move(passed_sync_token));
-    }
+  if (texture_thread_task_runner_ &&
+      thread_id_ != Thread::Current()->ThreadId()) {
+    PostCrossThreadTask(
+        *texture_thread_task_runner_, FROM_HERE,
+        CrossThreadBind(&ReleaseTexture, is_converted_from_skia_texture_,
+                        texture_id_, WTF::Passed(std::move(passed_mailbox)),
+                        WTF::Passed(ContextProviderWrapper()),
+                        WTF::Passed(std::move(passed_sync_token))));
+  } else {
+    ReleaseTexture(is_converted_from_skia_texture_, texture_id_,
+                   std::move(passed_mailbox), ContextProviderWrapper(),
+                   std::move(passed_sync_token));
   }
 
   texture_id_ = 0u;  // invalidate the texture.
diff --git a/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h b/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
index 4c8bb287..e60c767 100644
--- a/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
+++ b/third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
@@ -37,7 +37,14 @@
         id(id),
         properties(props),
         is_cacheable(id.client.IsCacheable()),
-        client_is_just_created(id.client.IsJustCreated()) {}
+        client_is_just_created(id.client.IsJustCreated()) {
+    // PaintChunk properties should not be null. If these checks are hit,
+    // we may be missing a call to ScopedPaintChunkProperties, see comment in
+    // PaintChunker::IncrementDisplayItemIndex for more information.
+    CHECK(props.Transform());
+    CHECK(props.Clip());
+    CHECK(props.Effect());
+  }
 
   size_t size() const {
     DCHECK_GE(end_index, begin_index);
diff --git a/third_party/blink/renderer/platform/graphics/skia_texture_holder.cc b/third_party/blink/renderer/platform/graphics/skia_texture_holder.cc
index be22081..aae4994 100644
--- a/third_party/blink/renderer/platform/graphics/skia_texture_holder.cc
+++ b/third_party/blink/renderer/platform/graphics/skia_texture_holder.cc
@@ -32,10 +32,6 @@
 
   if (!ContextProvider())
     return;
-  if (texture_holder->IsAbandoned()) {
-    Abandon();
-    return;
-  }
 
   gpu::gles2::GLES2Interface* shared_gl = ContextProvider()->ContextGL();
   GrContext* shared_gr_context = ContextProvider()->GetGrContext();
@@ -66,14 +62,8 @@
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
 }
 
-void SkiaTextureHolder::Abandon() {
-  if (image_ && image_->getTexture())
-    image_->getTexture()->abandon();
-  TextureHolder::Abandon();
-}
-
 bool SkiaTextureHolder::IsValid() const {
-  return !IsAbandoned() && !!ContextProviderWrapper();
+  return !!ContextProviderWrapper();
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/skia_texture_holder.h b/third_party/blink/renderer/platform/graphics/skia_texture_holder.h
index 9ccde9d..d1c4687 100644
--- a/third_party/blink/renderer/platform/graphics/skia_texture_holder.h
+++ b/third_party/blink/renderer/platform/graphics/skia_texture_holder.h
@@ -27,7 +27,6 @@
   bool IsValid() const final;
   bool CurrentFrameKnownToBeOpaque() final { return image_->isOpaque(); }
   sk_sp<SkImage> GetSkImage() final { return image_; }
-  void Abandon() final;
 
   // When creating a AcceleratedStaticBitmap from a texture-backed SkImage, this
   // function will be called to create a TextureHolder object.
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
index 28b6537f..e52affa 100644
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
@@ -65,7 +65,6 @@
   virtual bool HasMailbox() const { return false; }
   virtual bool IsValid() const { return true; }
   virtual void Transfer() {}
-  virtual void Abandon() {}
 
   // Creates a non-gpu copy of the image, or returns this if image is already
   // non-gpu.
diff --git a/third_party/blink/renderer/platform/graphics/texture_holder.h b/third_party/blink/renderer/platform/graphics/texture_holder.h
index def091d1..e57624df 100644
--- a/third_party/blink/renderer/platform/graphics/texture_holder.h
+++ b/third_party/blink/renderer/platform/graphics/texture_holder.h
@@ -48,7 +48,6 @@
     NOTREACHED();
     return nullptr;
   }
-  virtual void Abandon() { is_abandoned_ = true; }  // Overrides must call base.
 
   // Methods that have exactly the same impelmentation for all sub-classes
   base::WeakPtr<WebGraphicsContext3DProviderWrapper> ContextProviderWrapper()
@@ -61,7 +60,6 @@
                ? context_provider_wrapper_->ContextProvider()
                : nullptr;
   }
-  bool IsAbandoned() const { return is_abandoned_; }
 
  protected:
   TextureHolder(base::WeakPtr<WebGraphicsContext3DProviderWrapper>&&
@@ -75,7 +73,6 @@
   // and that we need to clear the resouces associated with that
   // AcceleratedStaticBitmapImage on the original thread.
   base::WeakPtr<WebGraphicsContext3DProviderWrapper> context_provider_wrapper_;
-  bool is_abandoned_ = false;
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc b/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc
index 9d0fbf5..7391ff2 100644
--- a/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.cc
@@ -49,6 +49,11 @@
   // its parser metadata to options's parser metadata, [spec text]
   params.SetParserDisposition(ParserState());
 
+  // Priority Hints is currently non-standard, but we can assume the following
+  // (see https://crbug.com/821464):
+  // its importance to options's importance, [spec text]
+  params.MutableResourceRequest().SetFetchImportanceMode(importance_);
+
   // its referrer policy to options's referrer policy. [spec text]
   params.MutableResourceRequest().SetReferrerPolicy(referrer_policy_);
 
diff --git a/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h b/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h
index 4cb4632..4a24a92 100644
--- a/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h
+++ b/third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h
@@ -35,20 +35,24 @@
   ScriptFetchOptions()
       : parser_state_(ParserDisposition::kNotParserInserted),
         credentials_mode_(network::mojom::FetchCredentialsMode::kOmit),
-        referrer_policy_(network::mojom::ReferrerPolicy::kDefault) {}
+        referrer_policy_(network::mojom::ReferrerPolicy::kDefault),
+        importance_(mojom::FetchImportanceMode::kImportanceAuto) {}
 
   ScriptFetchOptions(const String& nonce,
                      const IntegrityMetadataSet& integrity_metadata,
                      const String& integrity_attribute,
                      ParserDisposition parser_state,
                      network::mojom::FetchCredentialsMode credentials_mode,
-                     network::mojom::ReferrerPolicy referrer_policy)
+                     network::mojom::ReferrerPolicy referrer_policy,
+                     mojom::FetchImportanceMode importance =
+                         mojom::FetchImportanceMode::kImportanceAuto)
       : nonce_(nonce),
         integrity_metadata_(integrity_metadata),
         integrity_attribute_(integrity_attribute),
         parser_state_(parser_state),
         credentials_mode_(credentials_mode),
-        referrer_policy_(referrer_policy) {}
+        referrer_policy_(referrer_policy),
+        importance_(importance) {}
   ~ScriptFetchOptions() = default;
 
   const String& Nonce() const { return nonce_; }
@@ -65,6 +69,7 @@
   network::mojom::ReferrerPolicy GetReferrerPolicy() const {
     return referrer_policy_;
   }
+  mojom::FetchImportanceMode Importance() const { return importance_; }
 
   // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-script
   // Steps 1 and 3.
@@ -90,6 +95,10 @@
 
   // https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-fetch-options-referrer-policy
   const network::mojom::ReferrerPolicy referrer_policy_;
+
+  // Priority Hints and a request's "importance" mode are currently
+  // non-standard. See https://crbug.com/821464.
+  const mojom::FetchImportanceMode importance_;
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index f0d657e..cda6bd8 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -225,6 +225,7 @@
     },
     {
       name: "ContactsManager",
+      origin_trial_feature_name: "ContactsManager",
       status: "experimental",
     },
     {
@@ -244,6 +245,10 @@
       status: "experimental",
     },
     {
+      name: "CSS3TextBreakSpaces",
+      status: "experimental",
+    },
+    {
       name: "CSSAdditiveAnimations",
       depends_on: ["StackedCSSPropertyAnimations"],
       status: "experimental",
@@ -780,11 +785,9 @@
       name: "MediaQueryShape",
       status: "experimental",
     },
-    // MediaSession is enabled by default on Android only.
-    // TODO(rbyers): Add parameter to specify platform.
     {
       name: "MediaSession",
-      status: "test",
+      status: "stable",
     },
     {
       name: "MediaSourceExperimental",
@@ -1307,6 +1310,7 @@
     },
     {
       name: "TrustedDOMTypes",
+      origin_trial_feature_name: "TrustedDOMTypes",
       status: "experimental",
     },
     {
diff --git a/third_party/blink/web_tests/ASANExpectations b/third_party/blink/web_tests/ASANExpectations
index a753424..6cfb6ad 100644
--- a/third_party/blink/web_tests/ASANExpectations
+++ b/third_party/blink/web_tests/ASANExpectations
@@ -47,7 +47,6 @@
 
 # Stack use-after-return detection
 crbug.com/438499 [ Linux ] crypto/worker-random-values-limits.html [ Timeout ]
-crbug.com/438499 [ Linux ] fast/workers/simultaneous-errors.html [ Timeout ]
 crbug.com/438499 [ Linux ] fast/workers/worker-multi-startup.html [ Timeout ]
 crbug.com/438499 [ Linux ] http/tests/websocket/workers/worker-simple.html [ Timeout ]
 crbug.com/438499 [ Linux ] http/tests/workers/text-encoding.html [ Timeout ]
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
index e86c4ba..82a4441 100644
--- a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
+++ b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
@@ -420,6 +420,19 @@
 crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-global.html [ Failure ]
 crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-non-composited-scroll.html [ Failure ]
 
+# These were introduced by the new dirty bit on PaintArtifactCompositor.
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-animation.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-many.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-squashing.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-table.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-transform-changed-nolayout.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects-visibility-hidden.html [ Failure ]
+crbug.com/909749 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
+crbug.com/909749 fast/events/touch/touch-rect-crash-on-unpromote-layer.html [ Failure ]
+crbug.com/924680 virtual/threaded/fast/events/pinch/pinch-zoom-into-center.html [ Failure ]
+crbug.com/924680 virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchpad.html [ Failure ]
+
 # Backdrop filter
 crbug.com/923429 compositing/layer-creation/fixed-position-out-of-view-with-backdrop-filter.html [ Failure ]
 crbug.com/923429 compositing/overflow/scroll-parent-absolute-with-backdrop-filter.html [ Failure ]
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=LayoutNG
index e6d2847..af4b98b 100644
--- a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=LayoutNG
@@ -63,6 +63,29 @@
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/vert-block-size-small-or-larger-than-container-with-min-or-max-content-2a.html [ Pass ]
 crbug.com/613663 external/wpt/quirks/table-cell-width-calculation.html [ Failure ]
 
+# The new 'break-spaces' value is not implemented yet in LayoutNG
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-001.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-002.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-003.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-004.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-005.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-006.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-007.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/break-spaces-008.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/textarea-break-spaces-001.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/textarea-break-spaces-002.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/tab-stop-threshold-005.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/tab-stop-threshold-006.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/white-space-intrinsic-size-001.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/white-space/white-space-intrinsic-size-002.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/word-break/word-break-break-all-012.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/word-break/word-break-break-all-013.html  [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/overflow-wrap/overflow-wrap-anywhere-002.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/overflow-wrap/overflow-wrap-anywhere-003.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ Skip ]
+crbug.com/922437 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html [ Skip ]
+
 # New failures are appended below by the script.
 crbug.com/591099 bluetooth/characteristic/notifications/notification-after-disconnection.html [ Pass ]
 crbug.com/591099 css3/filters/backdrop-filter-rendering.html [ Pass ]
@@ -277,7 +300,6 @@
 crbug.com/591099 paint/invalidation/flexbox/scrollbars-changed.html [ Failure ]
 crbug.com/835484 paint/invalidation/outline/inline-focus.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/opacity-change-on-overflow-float.html [ Failure ]
-crbug.com/714962 paint/invalidation/position/relative-positioned-movement-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/repaint-composited-child-in-scrolled-container.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/svg-background-partial-redraw.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/text-selection-update.svg [ Failure ]
diff --git a/third_party/blink/web_tests/MSANExpectations b/third_party/blink/web_tests/MSANExpectations
index 34f6fcf..84fc4ec 100644
--- a/third_party/blink/web_tests/MSANExpectations
+++ b/third_party/blink/web_tests/MSANExpectations
@@ -9,7 +9,6 @@
 
 # Deliberate infinite recursion. A JS exception is expected, but may crash with
 # a stack overflow due to bloated stack frames under MSan.
-crbug.com/420606 [ Linux ] fast/workers/shared-worker-constructor.html [ Skip ]
 crbug.com/420606 [ Linux ] fast/workers/worker-constructor.html [ Skip ]
 
 # Flaky under MSan (hang forever).
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations
index 4850bed..f33ea2b 100644
--- a/third_party/blink/web_tests/TestExpectations
+++ b/third_party/blink/web_tests/TestExpectations
@@ -2218,7 +2218,6 @@
 crbug.com/626703 external/wpt/css/css-text/word-break/word-break-break-all-004.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/word-break/word-break-break-all-006.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/word-break/word-break-break-all-008.html [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/word-break/word-break-keep-all-003.html [ Failure ]
 crbug.com/626703 [ Linux ] external/wpt/css/css-text/word-break/word-break-normal-bo-000.html [ Failure ]
 crbug.com/626703 [ Win ] external/wpt/css/css-text/word-break/word-break-normal-km-000.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/word-break/word-break-normal-my-000.html [ Failure ]
@@ -3123,7 +3122,6 @@
 crbug.com/626703 external/wpt/css/css-text/text-transform/text-transform-shaping-002.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/white-space/pre-wrap-012.html [ Failure ]
 crbug.com/626703 external/wpt/css/CSS2/text/white-space-pre-element-001.xht [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-anywhere-002.html [ Failure ]
 crbug.com/626703 external/wpt/css/CSS2/text/white-space-003.xht [ Failure ]
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/hori-block-size-small-or-larger-than-container-with-min-or-max-content-2b.html [ Failure ]
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-1a.html [ Failure ]
@@ -3134,7 +3132,6 @@
 crbug.com/626703 external/wpt/css/css-text/white-space/pre-wrap-013.html [ Failure ]
 crbug.com/626703 external/wpt/css/CSS2/text/white-space-processing-040.xht [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/text-transform/text-transform-shaping-003.html [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/white-space/tab-stop-threshold-006.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/white-space/white-space-intrinsic-size-003.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-anywhere-001.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-anywhere-003.html [ Failure ]
@@ -3150,9 +3147,7 @@
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-1b.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/text-transform/text-transform-shaping-001.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/boundary-shaping/boundary-shaping-001.html [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/white-space/white-space-intrinsic-size-002.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/text-indent/text-indent-percentage-004.html [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/white-space/tab-stop-threshold-005.html [ Failure ]
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/vert-block-size-small-or-larger-than-container-with-min-or-max-content-1.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/boundary-shaping/boundary-shaping-004.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-sizing/range-percent-intrinsic-size-2.html [ Failure ]
@@ -3559,7 +3554,6 @@
 crbug.com/626703 external/wpt/content-security-policy/securitypolicyviolation/inside-dedicated-worker.html [ Timeout ]
 crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-min-content-size-002.html [ Failure ]
 crbug.com/626703 external/wpt/content-security-policy/securitypolicyviolation/targeting.html [ Timeout ]
-crbug.com/626703 external/wpt/css/css-text/white-space/textarea-break-spaces-001.html [ Failure ]
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-column-row-gap-003.html [ Failure ]
 crbug.com/863355 [ Mac ] external/wpt/svg/shapes/reftests/pathlength-002.svg [ Failure ]
 crbug.com/366559 external/wpt/svg/shapes/reftests/pathlength-003.svg [ Failure ]
@@ -3567,7 +3561,6 @@
 crbug.com/366559 external/wpt/svg/text/reftests/textpath-shape-001.svg [ Failure ]
 crbug.com/626703 external/wpt/svg/rendering/order/z-index.svg [ Failure ]
 crbug.com/626703 external/wpt/web-animations/timing-model/timelines/update-and-send-events.html [ Timeout ]
-crbug.com/626703 external/wpt/css/css-text/white-space/break-spaces-001.html [ Failure ]
 crbug.com/626703 [ Mac10.12 ] external/wpt/compat/webkit-text-fill-color-property-002.html [ Failure ]
 crbug.com/626703 [ Mac10.13 ] external/wpt/compat/webkit-text-fill-color-property-002.html [ Failure ]
 crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-column-row-gap-001.html [ Failure ]
@@ -3700,8 +3693,6 @@
 crbug.com/626703 [ Win10 ] external/wpt/fetch/api/redirect/redirect-count.any.html [ Timeout ]
 
 crbug.com/626703 external/wpt/css/cssom-view/scroll-behavior-smooth.html [ Timeout ]
-crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ Failure ]
-crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html [ Failure ]
 crbug.com/626703 external/wpt/websockets/Create-Secure-extensions-empty.any.html [ Timeout ]
 crbug.com/626703 external/wpt/websockets/Create-Secure-extensions-empty.any.worker.html [ Timeout ]
 crbug.com/626703 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-integrity-classic.sub.html [ Skip ]
@@ -5899,6 +5890,12 @@
 # Sheriff 2019-01-11
 crbug.com/921038 virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/legacy-performance-memory-counters-enabled.html [ Skip ]
 
+# Fails until document.featurePolicy is available in stable
+crbug.com/917070 virtual/stable/webexposed/feature-policy-features.html [ Failure ]
+
+# Mac doesn't support lowLatency Canvas Contexts.
+crbug.com/922218 [ Mac ] fast/canvas-api/canvas-lowlatency-getContext.html [ Failure ]
+
 # Sheriff 2019-01-14
 crbug.com/921583 http/tests/preload/meta-viewport-link-headers.html [ Failure Pass ]
 crbug.com/921151 [ Linux ] http/tests/security/mixedContent/insecure-iframe-with-hsts.https.html [ Failure Pass ]
@@ -5960,7 +5957,7 @@
 
 # Sheriff 2019-01-17
 crbug.com/922955 external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Failure Pass ]
-crbug.com/922955 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Failure Pass ]
+crbug.com/924990 virtual/webrtc-wpt-plan-b/external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Failure Pass ]
 
 # Sheriff 2019-01-18
 crbug.com/922970 external/wpt/css/css-transitions/CSSTransition-startTime.tentative.html [ Failure Pass ]
@@ -5972,3 +5969,9 @@
 # Sheriff 2019-01-22
 # Likely needs a rebaseline
 crbug.com/921242 [ Mac ] fast/overflow/clip-rects-fixed-ancestor.html [ Failure ]
+
+# Sheriff 2019-01-24
+crbug.com/924954 http/tests/images/feature-policy-image-policies-with-border-radius.html [ Pass Failure ]
+
+# WebXR feature policy feature name in Chrome doesn't match spec.
+crbug.com/924670 external/wpt/webvr/webvr-supported-by-feature-policy.html [ Failure ]
diff --git a/third_party/blink/web_tests/W3CImportExpectations b/third_party/blink/web_tests/W3CImportExpectations
index a113029d..96288da 100644
--- a/third_party/blink/web_tests/W3CImportExpectations
+++ b/third_party/blink/web_tests/W3CImportExpectations
@@ -191,10 +191,6 @@
 external/wpt/css/css-text/text-transform/text-transform-fullwidth-002.xht [ Skip ]
 external/wpt/css/css-text/text-transform/text-transform-fullwidth-004.xht [ Skip ]
 external/wpt/css/css-text/text-transform/text-transform-fullwidth-005.xht [ Skip ]
-external/wpt/css/css-text/white-space/pre-wrap-008.html [ Skip ]
-external/wpt/css/css-text/white-space/pre-wrap-010.html [ Skip ]
-external/wpt/css/css-text/white-space/textarea-pre-wrap-010.html [ Skip ]
-external/wpt/css/css-text/white-space/textarea-pre-wrap-008.html [ Skip ]
 external/wpt/css/css-text/white-space/white-space-collapsing-discard-001.xht [ Skip ]
 external/wpt/css/css-text/white-space/white-space-collapsing-preserve-breaks-001.xht [ Skip ]
 
diff --git a/third_party/blink/web_tests/compositing/iframes/connect-compositing-iframe2.html b/third_party/blink/web_tests/compositing/iframes/connect-compositing-iframe2.html
index 5f4d135..85331a6 100644
--- a/third_party/blink/web_tests/compositing/iframes/connect-compositing-iframe2.html
+++ b/third_party/blink/web_tests/compositing/iframes/connect-compositing-iframe2.html
@@ -22,7 +22,9 @@
       left: 5px;
       background-color: rgba(0, 0, 0, 0.2);
     }
-    
+    .composited {
+      will-change: transform;
+    }
   </style>
   <script type="text/javascript" charset="utf-8">
     if (window.testRunner) {
diff --git a/third_party/blink/web_tests/compositing/masks/mask-of-clipped-layer.html b/third_party/blink/web_tests/compositing/masks/mask-of-clipped-layer.html
index d4c91cc3..2f7b258 100644
--- a/third_party/blink/web_tests/compositing/masks/mask-of-clipped-layer.html
+++ b/third_party/blink/web_tests/compositing/masks/mask-of-clipped-layer.html
@@ -38,8 +38,8 @@
 -->
   <div class="hidesOverflow">
     <div class="shouldNotBeVisible">
-    <div class="composited masked">
-    </div>
+       <div class="composited masked"></div>
+     </div>
   </div>
 </body>
 </html>
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_5.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_5.json
index b7569cfb..f2bcaf8d 100644
--- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_5.json
+++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_5.json
@@ -140229,7 +140229,7 @@
      {}
     ]
    ],
-   "css/css-shadow-parts/interaction-with-tree-abiding-expected.txt": [
+   "css/css-shadow-parts/interaction-with-pseudo-elements-expected.txt": [
     [
      {}
     ]
@@ -157669,6 +157669,11 @@
      {}
     ]
    ],
+   "encrypted-media/clearkey-check-status-for-hdcp.https-expected.txt": [
+    [
+     {}
+    ]
+   ],
    "encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4": [
     [
      {}
@@ -157724,6 +157729,11 @@
      {}
     ]
    ],
+   "encrypted-media/drm-check-status-for-hdcp.https-expected.txt": [
+    [
+     {}
+    ]
+   ],
    "encrypted-media/drm-mp4-playback-temporary-playduration-expected.txt": [
     [
      {}
@@ -157799,11 +157809,21 @@
      {}
     ]
    ],
+   "encrypted-media/scripts/check-encryption-scheme.js": [
+    [
+     {}
+    ]
+   ],
    "encrypted-media/scripts/check-initdata-type.js": [
     [
      {}
     ]
    ],
+   "encrypted-media/scripts/check-status-for-hdcp.js": [
+    [
+     {}
+    ]
+   ],
    "encrypted-media/scripts/clearkey-update-non-ascii-input.js": [
     [
      {}
@@ -211830,9 +211850,9 @@
      {}
     ]
    ],
-   "css/css-shadow-parts/interaction-with-tree-abiding.html": [
+   "css/css-shadow-parts/interaction-with-pseudo-elements.html": [
     [
-     "/css/css-shadow-parts/interaction-with-tree-abiding.html",
+     "/css/css-shadow-parts/interaction-with-pseudo-elements.html",
      {}
     ]
    ],
@@ -230996,12 +231016,24 @@
      {}
     ]
    ],
+   "encrypted-media/clearkey-check-encryption-scheme.https.html": [
+    [
+     "/encrypted-media/clearkey-check-encryption-scheme.https.html",
+     {}
+    ]
+   ],
    "encrypted-media/clearkey-check-initdata-type.https.html": [
     [
      "/encrypted-media/clearkey-check-initdata-type.https.html",
      {}
     ]
    ],
+   "encrypted-media/clearkey-check-status-for-hdcp.https.html": [
+    [
+     "/encrypted-media/clearkey-check-status-for-hdcp.https.html",
+     {}
+    ]
+   ],
    "encrypted-media/clearkey-events-session-closed-event.https.html": [
     [
      "/encrypted-media/clearkey-events-session-closed-event.https.html",
@@ -231294,12 +231326,24 @@
      {}
     ]
    ],
+   "encrypted-media/drm-check-encryption-scheme.https.html": [
+    [
+     "/encrypted-media/drm-check-encryption-scheme.https.html",
+     {}
+    ]
+   ],
    "encrypted-media/drm-check-initdata-type.https.html": [
     [
      "/encrypted-media/drm-check-initdata-type.https.html",
      {}
     ]
    ],
+   "encrypted-media/drm-check-status-for-hdcp.https.html": [
+    [
+     "/encrypted-media/drm-check-status-for-hdcp.https.html",
+     {}
+    ]
+   ],
    "encrypted-media/drm-events-session-closed-event.https.html": [
     [
      "/encrypted-media/drm-events-session-closed-event.https.html",
@@ -353119,12 +353163,12 @@
    "a064789f06111bf5ce791650207bcee195d346ab",
    "reftest"
   ],
-  "css/css-shadow-parts/interaction-with-tree-abiding-expected.txt": [
-   "129e043be1aa49fcd14064a1a70f7b4fe09e374e",
+  "css/css-shadow-parts/interaction-with-pseudo-elements-expected.txt": [
+   "8e2a02fc1fe71105ace2c695b038e5857ad98db7",
    "support"
   ],
-  "css/css-shadow-parts/interaction-with-tree-abiding.html": [
-   "c11da7d12dea91306b79d141613ad6563dffb18f",
+  "css/css-shadow-parts/interaction-with-pseudo-elements.html": [
+   "776ab2eb69dc77927c213a7fd99dd116376cf710",
    "testharness"
   ],
   "css/css-shadow-parts/invalidation-change-exportparts-forward.html": [
@@ -392203,10 +392247,22 @@
    "932c9962d53adc6fdd76a6efcbcefc3acb9fef50",
    "support"
   ],
+  "encrypted-media/clearkey-check-encryption-scheme.https.html": [
+   "eb580ea5f87f465dff7e1b479cd28088c5f8c417",
+   "testharness"
+  ],
   "encrypted-media/clearkey-check-initdata-type.https.html": [
    "00894338ae8a04fe62528771bfda3dc25496ce1f",
    "testharness"
   ],
+  "encrypted-media/clearkey-check-status-for-hdcp.https-expected.txt": [
+   "f02b2e537aaec347f7e3c0afdd217ad68474e731",
+   "support"
+  ],
+  "encrypted-media/clearkey-check-status-for-hdcp.https.html": [
+   "5ec3b262852eebbe82afa68e4fad5db908744d90",
+   "testharness"
+  ],
   "encrypted-media/clearkey-events-session-closed-event.https.html": [
    "ddf3ecbbbf78cce7c6ac985d85445f139b4e9c6c",
    "testharness"
@@ -392439,10 +392495,22 @@
    "659a61cdcf1270cb99a058f89d817f283436e2d9",
    "support"
   ],
+  "encrypted-media/drm-check-encryption-scheme.https.html": [
+   "862591b1b897027d201384857fe37f73ac6b96e6",
+   "testharness"
+  ],
   "encrypted-media/drm-check-initdata-type.https.html": [
    "6b3324027b8aad5f7da65c7ca9a8a3ce3c55c65f",
    "testharness"
   ],
+  "encrypted-media/drm-check-status-for-hdcp.https-expected.txt": [
+   "316abd35c637f6393802f120077f8ac720b53f83",
+   "support"
+  ],
+  "encrypted-media/drm-check-status-for-hdcp.https.html": [
+   "68c45be69b7bfc317f0be2a55b4a38c6e959f55e",
+   "testharness"
+  ],
   "encrypted-media/drm-events-session-closed-event.https.html": [
    "425d17646ca277ff811e55f3216d8a9570e848f5",
    "testharness"
@@ -392711,10 +392779,18 @@
    "3a4262b179c65c0cafad0a934b46397a2f5f6e95",
    "support"
   ],
+  "encrypted-media/scripts/check-encryption-scheme.js": [
+   "5d629271b42ff374e1b40a9a3b4113b42d1afbaf",
+   "support"
+  ],
   "encrypted-media/scripts/check-initdata-type.js": [
    "5c7cb6e4b9a427d4f15364027724e13ba836d89e",
    "support"
   ],
+  "encrypted-media/scripts/check-status-for-hdcp.js": [
+   "ac3081969523864bc5396447c887dc7944c3d5db",
+   "support"
+  ],
   "encrypted-media/scripts/clearkey-update-non-ascii-input.js": [
    "b34c493fd113a91780bf365800b71b98b6a3bfd6",
    "support"
@@ -452564,11 +452640,11 @@
    "support"
   ],
   "webrtc/RTCPeerConnection-iceConnectionState-expected.txt": [
-   "e3cf3163468c69d9f68c8887abd4bbc1039bc86b",
+   "b28601423de0b987c27db05d4b4061ece60f0129",
    "support"
   ],
   "webrtc/RTCPeerConnection-iceConnectionState.html": [
-   "4071033a3c9eff6e5b848531127c1b70ee90bb20",
+   "b647b3d3e35e31f16b33422f67cb30b917d1d0af",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-iceGatheringState-expected.txt": [
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any-expected.txt b/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any-expected.txt
deleted file mode 100644
index 24f8be2..0000000
--- a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-This is a testharness.js-based test.
-PASS Explicitly committed data can be read back out.
-PASS commit() on a version change transaction does not cause errors.
-PASS A committed transaction becomes inactive immediately.
-PASS A committed transaction is inactive in future request callbacks.
-PASS Puts issued after commit are not fulfilled.
-PASS Calling commit on an aborted transaction throws.
-PASS Calling commit on a committed transaction throws.
-PASS Calling abort on a committed transaction throws and does not prevent persisting the data.
-PASS Calling txn.commit() when txn is inactive should throw.
-PASS Transactions with same scope should stay in program order, even if one calls commit.
-FAIL Transactions that explicitly commit and have errors should abort. assert_unreached: Transaction with invalid "add" call should not be completed. Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.js
index da4bd8c..12e56cc 100644
--- a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.js
+++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.js
@@ -188,20 +188,17 @@
   });
   // Txn1 should commit before txn2, even though txn2 uses commit().
   const txn1 = db.transaction(['books'], 'readwrite');
-  const objectStore1 = txn1.objectStore('books');
-  const putRequest1 = objectStore1.put({isbn:'one', title:'title1'});
+  txn1.objectStore('books').put({isbn: 'one', title: 'title1'});
   const releaseTxnFunction = keepAlive(testCase, txn1, 'books');
 
   const txn2 = db.transaction(['books'], 'readwrite');
-  const objectStore2 = txn2.objectStore('books');
-  const putRequest2 = objectStore2.put({isbn:'one', title:'title2'});
+  txn2.objectStore('books').put({isbn:'one', title:'title2'});
   txn2.commit();
 
   // Exercise the IndexedDB transaction ordering by executing one with a
   // different scope.
   const txn3 = db.transaction(['not_books'], 'readwrite');
-  const objectStore3 = txn3.objectStore('not_books');
-  objectStore3.put({'title': 'not_title'}, 'key');
+  txn3.objectStore('not_books').put({'title': 'not_title'}, 'key');
   txn3.oncomplete = function() {
     releaseTxnFunction();
   }
@@ -210,8 +207,7 @@
 
   // Read the data back to verify that txn2 executed last.
   const txn4 = db.transaction(['books'], 'readonly');
-  const objectStore4 = txn4.objectStore('books');
-  const getRequest4 = objectStore4.get('one');
+  const getRequest4 = txn4.objectStore('books').get('one');
   await promiseForTransaction(testCase, txn4);
   assert_equals(getRequest4.result.title, 'title2');
   db.close();
@@ -225,8 +221,7 @@
   });
   // Txn1 creates the book 'one' so the 'add()' below fails.
   const txn1 = db.transaction(['books'], 'readwrite');
-  const objectStore1 = txn1.objectStore('books');
-  const putRequest1 = objectStore1.add({isbn:'one', title:'title1'});
+  txn1.objectStore('books').add({isbn:'one', title:'title1'});
   txn1.commit();
   await promiseForTransaction(testCase, txn1);
 
@@ -235,15 +230,17 @@
   const txn2 = db.transaction(['books'], 'readwrite');
   const objectStore2 = txn2.objectStore('books');
   objectStore2.put({isbn:'two', title:'title2'});
-  const addRequest2 = objectStore2.add({isbn:'one', title:'title2'});
+  const addRequest = objectStore2.add({isbn:'one', title:'title2'});
   txn2.commit();
-  txn2.oncomplete = assert_unreached(
-    'Transaction with invalid "add" call should not be completed.');
+  txn2.oncomplete = () => { assert_unreached(
+    'Transaction with invalid "add" call should not be completed.'); };
 
-  var addWatcher = requestWatcher(testCase, addRequest2);
-  var txnWatcher = transactionWatcher(testCase, txn2);
-  await Promise.all([addWatcher.wait_for('error'),
-                     txnWatcher.wait_for('error', 'abort')]);
+  // Wait for the transaction to complete. We have to explicitly wait for the
+  // error signal on the transaction because of the nature of the test tooling.
+  await Promise.all([
+      requestWatcher(testCase, addRequest).wait_for('error'),
+      transactionWatcher(testCase, txn2).wait_for(['error', 'abort'])
+  ]);
 
   // Read the data back to verify that txn2 was aborted.
   const txn3 = db.transaction(['books'], 'readonly');
@@ -255,3 +252,41 @@
   assert_equals(getRequest2.result, 0);
   db.close();
 }, 'Transactions that explicitly commit and have errors should abort.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn1 = db.transaction(['books'], 'readwrite');
+  txn1.objectStore('books').add({isbn: 'one', title: 'title1'});
+  txn1.commit();
+  await promiseForTransaction(testCase, txn1);
+
+  // The second add request will throw an error, but the onerror handler will
+  // appropriately catch the error allowing the valid put request on the
+  // transaction to commit.
+  const txn2 = db.transaction(['books'], 'readwrite');
+  const objectStore2 = txn2.objectStore('books');
+  objectStore2.put({isbn: 'two', title:'title2'});
+  const addRequest = objectStore2.add({isbn: 'one', title:'unreached_title'});
+  addRequest.onerror = (event) => {
+    event.preventDefault();
+    addRequest.transaction.commit();
+  };
+
+  // Wait for the transaction to complete. We have to explicitly wait for the
+  // error signal on the transaction because of the nature of the test tooling.
+  await transactionWatcher(testCase,txn2).wait_for(['error', 'complete'])
+
+  // Read the data back to verify that txn2 was committed.
+  const txn3 = db.transaction(['books'], 'readonly');
+  const objectStore3 = txn3.objectStore('books');
+  const getRequest1 = objectStore3.get('one');
+  const getRequest2 = objectStore3.get('two');
+  await promiseForTransaction(testCase, txn3);
+  assert_equals(getRequest1.result.title, 'title1');
+  assert_equals(getRequest2.result.title, 'title2');
+  db.close();
+}, 'Transactions that handle all errors properly should be behave as ' +
+   'expected when an explicit commit is called in an onerror handler.');
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.worker-expected.txt
deleted file mode 100644
index 24f8be2..0000000
--- a/third_party/blink/web_tests/external/wpt/IndexedDB/idb-explicit-commit.any.worker-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-This is a testharness.js-based test.
-PASS Explicitly committed data can be read back out.
-PASS commit() on a version change transaction does not cause errors.
-PASS A committed transaction becomes inactive immediately.
-PASS A committed transaction is inactive in future request callbacks.
-PASS Puts issued after commit are not fulfilled.
-PASS Calling commit on an aborted transaction throws.
-PASS Calling commit on a committed transaction throws.
-PASS Calling abort on a committed transaction throws and does not prevent persisting the data.
-PASS Calling txn.commit() when txn is inactive should throw.
-PASS Transactions with same scope should stay in program order, even if one calls commit.
-FAIL Transactions that explicitly commit and have errors should abort. assert_unreached: Transaction with invalid "add" call should not be completed. Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/accelerometer/Accelerometer-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/accelerometer/Accelerometer-supported-by-feature-policy.html
new file mode 100644
index 0000000..8e09c7ac
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/accelerometer/Accelerometer-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that accelerometer is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('accelerometer', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise accelerometer.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/ambient-light/AmbientLightSensor-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/ambient-light/AmbientLightSensor-supported-by-feature-policy.html
new file mode 100644
index 0000000..d5c27c8
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/ambient-light/AmbientLightSensor-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that ambient-light-sensor is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('ambient-light-sensor', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise ambient-light-sensor.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/background-fetch/fetch-uploads.https.window.js b/third_party/blink/web_tests/external/wpt/background-fetch/fetch-uploads.https.window.js
index 4ee618a1..f93f88a6 100644
--- a/third_party/blink/web_tests/external/wpt/background-fetch/fetch-uploads.https.window.js
+++ b/third_party/blink/web_tests/external/wpt/background-fetch/fetch-uploads.https.window.js
@@ -44,3 +44,21 @@
 
   assert_equals(uploaded, uploadData.length);
 }, 'Progress event includes uploaded bytes');
+
+backgroundFetchTest(async (test, backgroundFetch) => {
+  const uploadRequest1 =
+      new Request('resources/upload.py', {method: 'POST', body: 'upload1'});
+  const uploadRequest2 =
+      new Request('resources/upload.py', {method: 'POST', body: 'upload2'});
+
+  await backgroundFetch.fetch(uniqueId(), [uploadRequest1, uploadRequest2]);
+
+  const {type, eventRegistration, results} = await getMessageFromServiceWorker();
+  assert_equals(type, 'backgroundfetchsuccess');
+  assert_equals(results.length, 2);
+  assert_equals(eventRegistration.result, 'success');
+  assert_equals(eventRegistration.failureReason, '');
+
+  assert_array_equals([results[0].text, results[1].text].sort(),
+                      ['upload1', 'upload2']);
+}, 'Duplicate upload requests work and can be distinguished.');
diff --git a/third_party/blink/web_tests/external/wpt/background-fetch/fetch.https.window-expected.txt b/third_party/blink/web_tests/external/wpt/background-fetch/fetch.https.window-expected.txt
index 1b82cd24..88dbd65 100644
--- a/third_party/blink/web_tests/external/wpt/background-fetch/fetch.https.window-expected.txt
+++ b/third_party/blink/web_tests/external/wpt/background-fetch/fetch.https.window-expected.txt
@@ -8,7 +8,7 @@
 PASS Using Background Fetch to successfully fetch a single resource
 PASS Registration object gets updated values when a background fetch completes.
 PASS Background Fetch that exceeds the quota throws a QuotaExceededError
-FAIL Fetches can have requests with duplicate URLs promise_test: Unhandled rejection with value: object "TypeError: Fetches with duplicate requests are not yet supported. Consider adding query params to make the requests unique. For updates check http://crbug.com/871174"
+PASS Fetches can have requests with duplicate URLs
 PASS recordsAvailable is false after onbackgroundfetchsuccess finishes execution.
 PASS Using Background Fetch to fetch a non-existent resource should fail.
 PASS Fetches with mixed content should fail.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html
index 660b7f1..6f90f0c 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html
@@ -22,7 +22,7 @@
 </style>
 
 <p>This test passes if there is nothing below this sentence.
-<div> FAIL <div>
+<div> FAIL </div>
 <!--
 white-space:break-spaces should cause the spaces at the end of the line to be preserved.
 Since there is an allowed break point between the first space and the F,
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html
index 6203b55..05e570b 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html
@@ -22,4 +22,4 @@
 </style>
 
 <p>This test passes if the word FAIL does not appear below.
-<div>PASS FAIL<div>
+<div>PASS FAIL</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-004.html b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-004.html
index b277319..5f36410f 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-004.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-004.html
@@ -3,6 +3,7 @@
 <title>CSS Text Test: overflow-wrap: break-word</title>
 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-word">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
 <meta name="flags" content="ahem">
 <link rel="match" href="reference/overflow-wrap-break-word-001-ref.html">
 <meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: pre-wrap' property, that must prevent the word to be broken.">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html
new file mode 100644
index 0000000..6dc1b4df
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-word">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/overflow-wrap-break-word-001-ref.html">
+<meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: break-spaces' property, that must prevent the word to be broken.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  line-height: 1em;
+  width: 5ch;
+  white-space: break-spaces;
+  overflow-wrap: break-word;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"><br>XXXXX</div>
+  <div class="test"> XXXXX </div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/white-space-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/white-space-valid-expected.txt
deleted file mode 100644
index 742a431..0000000
--- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/white-space-valid-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a testharness.js-based test.
-PASS e.style['white-space'] = "normal" should set the property value
-PASS e.style['white-space'] = "pre" should set the property value
-PASS e.style['white-space'] = "nowrap" should set the property value
-PASS e.style['white-space'] = "pre-wrap" should set the property value
-FAIL e.style['white-space'] = "break-spaces" should set the property value assert_not_equals: property should be set got disallowed value ""
-PASS e.style['white-space'] = "pre-line" should set the property value
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-004.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-004.html
new file mode 100644
index 0000000..e2c043e
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-004.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: break-spaces</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-word">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/pre-wrap-001-ref.html">
+<meta name="assert" content="The word is not broken if there are previous breaking opportunities, honoring the 'white-space: break-spaces' value.">
+<style>
+div {
+   position: relative;
+   font: 20px/1 Ahem;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 2ch;
+
+  white-space: break-spaces;
+  word-break: break-word;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail"><span>XX</span><br>XX</div>
+  <div class="test"> XX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-005.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-005.html
new file mode 100644
index 0000000..d0dafd3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-005.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space - break-spaces</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="match" href="reference/white-space-break-spaces-005-ref.html">
+<meta name="flags" content="ahem">
+<meta name="assert" content="If 'white-space' is set to 'break-spaces', collapsing preserved white-spaces' advance width is not allowed, so that they can be wrapped honoring the 'white-space' propery.">
+<style>
+div {
+   position: relative;
+   font: 10px/1 Ahem;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 100px;
+
+  white-space: break-spaces;
+}
+
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail">XXXX<span>XXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XXXXXXXXXX</span><br><span>XX</span>XXXX<span>XXXX</span></div>
+  <div class="test">XXXX                                                                                        XXXX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-006.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-006.html
new file mode 100644
index 0000000..5f9d605
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-006.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space - break-spaces</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/white-space-break-spaces-005-ref.html">
+<meta name="flags" content="ahem">
+<meta name="assert" content="White spaces are preserved, honoring the 'white-space: break-spaces', but the words are broken, honring the 'word-beak: break-all' even though there are previous breaking opportunities in the white-spaces.">
+<style>
+div {
+   position: relative;
+   font: 25px/1 Ahem;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 4ch;
+
+  white-space: break-spaces;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail"><span>X</span>XXX<br>X<span>X</span>XX<br>X<span>XXX</span><br><span>XXXX</span></div>
+  <div class="test"> XXXX XXX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-007.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-007.html
new file mode 100644
index 0000000..7721361
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-007.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space - break-spaces</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/white-space-break-spaces-005-ref.html">
+<meta name="flags" content="ahem">
+<meta name="assert" content="A single leading white-space should be used, honoring white-space: break-spaces, to avoid overflow; however, a single preserved white-space at the end of the line cannot be wrapped, hence it hangs when breaking after it to move the rest of the text to the next line.">
+<style>
+div {
+   position: relative;
+   font: 25px/1 Ahem;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 4ch;
+
+  white-space: break-spaces;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail"><span>XXXX</span><br>XXXX<br>XXX<span>X</span><br><span>XXXX</span></div>
+  <div class="test"> XXXX XXX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-008.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-008.html
new file mode 100644
index 0000000..d183cac
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/break-spaces-008.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space - break-spaces</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/white-space-break-spaces-005-ref.html">
+<meta name="flags" content="ahem">
+<meta name="assert" content="White spaces are preserved, honoring the 'white-space: break-spaces', which may lead to overfow. However, we can break before the first white-space after the word honoring the 'break-all' value.">
+<style>
+div {
+   position: relative;
+   font: 25px/1 Ahem;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 4ch;
+
+  white-space: break-spaces;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail">XXXX<br><span>X</span>XX<span>X</span><br><span>XXXX</span><br><span>XXXX</span></div>
+  <div class="test">XXXX XX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/pre-wrap-016.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/pre-wrap-016.html
new file mode 100644
index 0000000..5f66a7b
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/pre-wrap-016.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: pre-wrap</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-word">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/pre-wrap-001-ref.html">
+<meta name="assert" content="The word is not broken if there are previous breaking opportunities, honoring the white-space: pre-wrap value.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+}
+.red {
+  position: absolute;
+  white-space: pre;
+  background: green;
+  color: red;
+  width: 40px;
+  height: 40px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  line-height: 1em;
+  width: 2ch;
+
+  white-space: pre-wrap;
+  word-break: break-word;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"><br>XX</div>
+  <div class="test"> XX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/white-space/reference/white-space-break-spaces-005-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/reference/white-space-break-spaces-005-ref.html
new file mode 100644
index 0000000..3247ae5a
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/white-space/reference/white-space-break-spaces-005-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+    <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-010.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-010.html
index 7d3bc05..be46d29 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-010.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-010.html
@@ -1,8 +1,9 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
-<title>CSS Text Test: overflow-wrap: break-word</title>
+<title>CSS Text Test: word-break: break-all</title>
 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
 <meta name="flags" content="ahem">
 <link rel="match" href="reference/word-break-break-all-010-ref.html">
 <meta name="assert" content="The word is broken even if pre-wrap provides a former breaking opportunity in leading white-space.">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-011.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-011.html
index 531c68d8..fade439 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-011.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-011.html
@@ -1,8 +1,9 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
-<title>CSS Text Test: overflow-wrap: break-word</title>
+<title>CSS Text Test: word-break: break-all</title>
 <link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
 <link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
 <meta name="flags" content="ahem">
 <link rel="match" href="reference/word-break-break-all-010-ref.html">
 <meta name="assert" content="A single leading white-space should account as soft breaking opportunity, honoring the 'white-space: pre-wrap', on top to the ones provided by 'word-break: break-all'.">
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html
new file mode 100644
index 0000000..cd3d4405
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="The word is broken even if white-space: break-spaces provides a former breaking opportunity in leading white-space.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+}
+.red {
+  position: absolute;
+  white-space: pre;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  line-height: 1em;
+  width: 5ch;
+
+  white-space: break-spaces;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XXXX<br>X</div>
+  <div class="test"> XXXXX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-013.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-013.html
new file mode 100644
index 0000000..85dce08b
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-013.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="A single leading white-space should account as soft breaking opportunity, honoring the 'white-space: break-spaces', on top to the ones provided by 'word-break: break-all'.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  background: green;
+  line-height: 1em;
+  width: 1ch;
+  white-space: break-spaces;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red">X<br>X<br>X</div>
+  <div class="test"> XX</div>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-encryption-scheme.https.html b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-encryption-scheme.https.html
new file mode 100644
index 0000000..eb580ea5
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-encryption-scheme.https.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Check encryptionScheme with Clear Key</title>
+    <link rel="help" href="https://w3c.github.io/encrypted-media/">
+
+    <!-- Web Platform Test Harness scripts -->
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+
+    <!-- Helper scripts for Encrypted Media Extensions tests  -->
+    <script src=/encrypted-media/util/utils.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!-- Content metadata -->
+    <!--<script src=/encrypted-media/content/content-metadata.js></script>-->
+
+    <!-- The script for this specific test -->
+    <script src=/encrypted-media/scripts/check-encryption-scheme.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: 'org.w3.clearkey' }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https-expected.txt b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https-expected.txt
new file mode 100644
index 0000000..f02b2e5
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https-expected.txt
@@ -0,0 +1,5 @@
+This is a testharness.js-based test.
+FAIL org.w3.clearkey support for empty HDCP version. promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'getStatusForPolicy' on 'MediaKeys': GetStatusForPolicy() is not supported."
+FAIL org.w3.clearkey support for HDCP 1.0. promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'getStatusForPolicy' on 'MediaKeys': GetStatusForPolicy() is not supported."
+Harness: the test ran to completion.
+
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https.html b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https.html
new file mode 100644
index 0000000..5ec3b26
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/clearkey-check-status-for-hdcp.https.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Check HDCP status with Clear Key</title>
+    <link rel="help" href="https://w3c.github.io/encrypted-media/">
+
+    <!-- Web Platform Test Harness scripts -->
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+
+    <!-- Helper scripts for Encrypted Media Extensions tests  -->
+    <script src=/encrypted-media/util/utils.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!-- Content metadata -->
+    <!--<script src=/encrypted-media/content/content-metadata.js></script>-->
+
+    <!-- The script for this specific test -->
+    <script src=/encrypted-media/scripts/check-status-for-hdcp.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: 'org.w3.clearkey' }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-encryption-scheme.https.html b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-encryption-scheme.https.html
new file mode 100644
index 0000000..862591b1
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-encryption-scheme.https.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Check encryptionScheme with DRM</title>
+    <link rel="help" href="https://w3c.github.io/encrypted-media/">
+
+    <!-- Web Platform Test Harness scripts -->
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+
+    <!-- Helper scripts for Encrypted Media Extensions tests  -->
+    <script src=/encrypted-media/util/utils.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!-- Content metadata -->
+    <!--<script src=/encrypted-media/content/content-metadata.js></script>-->
+
+    <!-- The script for this specific test -->
+    <script src=/encrypted-media/scripts/check-encryption-scheme.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: getSupportedKeySystem() }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https-expected.txt b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https-expected.txt
new file mode 100644
index 0000000..316abd3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https-expected.txt
@@ -0,0 +1,5 @@
+This is a testharness.js-based test.
+FAIL drm support for empty HDCP version. promise_test: Unhandled rejection with value: object "NotSupportedError: Unsupported keySystem or supportedConfigurations."
+FAIL drm support for HDCP 1.0. promise_test: Unhandled rejection with value: object "NotSupportedError: Unsupported keySystem or supportedConfigurations."
+Harness: the test ran to completion.
+
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https.html b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https.html
new file mode 100644
index 0000000..68c45be6
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/drm-check-status-for-hdcp.https.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Check HDCP status with DRM</title>
+    <link rel="help" href="https://w3c.github.io/encrypted-media/">
+
+    <!-- Web Platform Test Harness scripts -->
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+
+    <!-- Helper scripts for Encrypted Media Extensions tests  -->
+    <script src=/encrypted-media/util/utils.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!-- Content metadata -->
+    <!--<script src=/encrypted-media/content/content-metadata.js></script>-->
+
+    <!-- The script for this specific test -->
+    <script src=/encrypted-media/scripts/check-status-for-hdcp.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: getSupportedKeySystem() }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/encrypted-media-supported-by-feature-policy.tentative.html b/third_party/blink/web_tests/external/wpt/encrypted-media/encrypted-media-supported-by-feature-policy.tentative.html
new file mode 100644
index 0000000..5b2d2240
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/encrypted-media-supported-by-feature-policy.tentative.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that encrypted-media is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://github.com/w3c/encrypted-media/pull/432">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('encrypted-media', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise encrypted-media.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-encryption-scheme.js b/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-encryption-scheme.js
new file mode 100644
index 0000000..5d629271
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-encryption-scheme.js
@@ -0,0 +1,41 @@
+function runTest(config, qualifier)
+{
+  function checkEncryptionScheme(encryptionScheme)
+  {
+    var simpleConfig = getSimpleConfiguration();
+    assert_greater_than(simpleConfig[0].audioCapabilities.length, 0);
+    simpleConfig[0].audioCapabilities.forEach(function(capability) {
+      capability.encryptionScheme = encryptionScheme;
+    });
+
+    return navigator.requestMediaKeySystemAccess(config.keysystem, simpleConfig)
+        .then(
+            function(access) {
+              var actualConfiguration = access.getConfiguration();
+              for (let i = 0; i < actualConfiguration.audioCapabilities.length; i++) {
+                const capability = actualConfiguration.audioCapabilities[i];
+
+                // If "encryptionScheme" is not supported, fail.
+                if (!('encryptionScheme' in capability)) {
+                  return Promise.reject('Not implemented');
+                }
+
+                // If "encryptionScheme" is supported, it should be returned.
+                assert_equals(capability.encryptionScheme, encryptionScheme);
+              }
+              return Promise.resolve('Supported');
+            },
+            function error() {
+              // CDM does not support "encryptionScheme". Test should still pass.
+              return Promise.resolve('Not supported');
+            });
+  }
+
+  promise_test(
+      () => checkEncryptionScheme('cenc'),
+      testnamePrefix(qualifier, config.keysystem) + ' support for "cenc" encryption scheme.');
+
+  promise_test(
+      () => checkEncryptionScheme('cbcs'),
+      testnamePrefix(qualifier, config.keysystem) + ' support for "cbcs" encryption scheme.');
+}
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-status-for-hdcp.js b/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-status-for-hdcp.js
new file mode 100644
index 0000000..ac30819
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/encrypted-media/scripts/check-status-for-hdcp.js
@@ -0,0 +1,26 @@
+function runTest(config, qualifier)
+{
+  function checkStatusForMinHdcpVersionPolicy(hdcpVersion)
+  {
+    return navigator.requestMediaKeySystemAccess(config.keysystem, getSimpleConfiguration())
+        .then(function(access) {
+          return access.createMediaKeys();
+        })
+        .then(function(mediaKeys) {
+          // As HDCP policy depends on the hardware running this test,
+          // don't bother checking the result returned as it may or
+          // may not be supported. This simply verifies that
+          // getStatusForPolicy() exists and doesn't blow up.
+          return mediaKeys.getStatusForPolicy({minHdcpVersion: hdcpVersion});
+        });
+  }
+
+  promise_test(
+      () => checkStatusForMinHdcpVersionPolicy(''),
+      testnamePrefix(qualifier, config.keysystem) +
+          ' support for empty HDCP version.');
+
+  promise_test(
+      () => checkStatusForMinHdcpVersionPolicy('1.0'),
+      testnamePrefix(qualifier, config.keysystem) + ' support for HDCP 1.0.');
+}
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/supported-types.window.js b/third_party/blink/web_tests/external/wpt/event-timing/supported-types.window.js
new file mode 100644
index 0000000..c81d501
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/event-timing/supported-types.window.js
@@ -0,0 +1,11 @@
+test(() => {
+  if (typeof PerformanceObserver.supportedEntryTypes === "undefined")
+    assert_unreached("supportedEntryTypes is not supported.");
+  const types = PerformanceObserver.supportedEntryTypes;
+  assert_true(types.includes("firstInput"),
+    "There should be 'firstInput' in PerformanceObserver.supportedEntryTypes");
+  assert_true(types.includes("event"),
+    "There should be 'event' in PerformanceObserver.supportedEntryTypes");
+  assert_greater_than(types.indexOf("firstInput"), types.indexOf('event'),
+    "The 'firstInput' entry should appear after the 'event' entry");
+}, "supportedEntryTypes contains 'event' and 'firstInput'.");
diff --git a/third_party/blink/web_tests/external/wpt/feature-policy/idlharness.window-expected.txt b/third_party/blink/web_tests/external/wpt/feature-policy/idlharness.window-expected.txt
index 1d9622d..c9b2434 100644
--- a/third_party/blink/web_tests/external/wpt/feature-policy/idlharness.window-expected.txt
+++ b/third_party/blink/web_tests/external/wpt/feature-policy/idlharness.window-expected.txt
@@ -5,7 +5,7 @@
 PASS Stringification of document.featurePolicy
 PASS FeaturePolicy interface: document.featurePolicy must inherit property "allowsFeature(DOMString, DOMString)" with the proper type
 PASS FeaturePolicy interface: calling allowsFeature(DOMString, DOMString) on document.featurePolicy with too few arguments must throw TypeError
-FAIL FeaturePolicy interface: document.featurePolicy must inherit property "features()" with the proper type assert_inherits: property "features" not found in prototype chain
+PASS FeaturePolicy interface: document.featurePolicy must inherit property "features()" with the proper type
 PASS FeaturePolicy interface: document.featurePolicy must inherit property "allowedFeatures()" with the proper type
 PASS FeaturePolicy interface: document.featurePolicy must inherit property "getAllowlistForFeature(DOMString)" with the proper type
 PASS FeaturePolicy interface: calling getAllowlistForFeature(DOMString) on document.featurePolicy with too few arguments must throw TypeError
diff --git a/third_party/blink/web_tests/external/wpt/feature-policy/payment-supported-by-feature-policy.tentative.html b/third_party/blink/web_tests/external/wpt/feature-policy/payment-supported-by-feature-policy.tentative.html
new file mode 100644
index 0000000..07dec70
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/feature-policy/payment-supported-by-feature-policy.tentative.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that payment is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://github.com/w3c/payment-request/issues/600">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('payment', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise payment.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/feature-policy/picture-in-picture-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/feature-policy/picture-in-picture-supported-by-feature-policy.html
new file mode 100644
index 0000000..a65c682a
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/feature-policy/picture-in-picture-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that picture-in-picture is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://wicg.github.io/picture-in-picture/#feature-policy">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('picture-in-picture', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise picture-in-picture.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/OWNERS b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/OWNERS
new file mode 100644
index 0000000..42d5155
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/OWNERS
@@ -0,0 +1,5 @@
+# COMPONENT: Internals>Sandbox>SiteIsolation
+# TEAM: site-isolation-dev@chromium.org
+# WPT-NOTIFY: true
+creis@chromium.org
+lukasza@chromium.org
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-expected.txt
deleted file mode 100644
index f5d309fa..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Valid cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-iframe-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-iframe-expected.txt
deleted file mode 100644
index 181bcb5f..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-iframe-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-This is a testharness.js-based test.
-FAIL Cross-origin fetch in a data: iframe load fails if the server blocks cross-origin loads with a 'Cross-Origin-Resource-Policy: same-origin' response header. promise_test: Unhandled rejection with value: "Received unexpected message ok"
-FAIL Cross-origin fetch in a data: iframe load fails if the server blocks cross-origin loads with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: "Received unexpected message ok"
-FAIL Cross-origin fetch in a cross origin iframe load fails if the server blocks cross-origin loads with a 'Cross-Origin-Resource-Policy: same-origin' response header. promise_test: Unhandled rejection with value: "Received unexpected message ok"
-FAIL Cross-origin fetch in a cross origin iframe load fails if the server blocks cross-origin loads with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: "Received unexpected message ok"
-PASS Same-origin fetch in a cross origin iframe load succeeds if the server blocks cross-origin loads with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-service-worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-service-worker-expected.txt
deleted file mode 100644
index b8cd3d2..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch-in-service-worker-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL fetch.any.js test Cannot read property 'getRegistration' of undefined
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any-expected.txt
deleted file mode 100644
index 8b1e170..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-scheme (HTTP to HTTPS) no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Valid cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.serviceworker-expected.txt
deleted file mode 100644
index 1db488e..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.serviceworker-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch"
-FAIL Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch"
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Valid cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch"
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection. promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch"
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch"
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.sharedworker-expected.txt
deleted file mode 100644
index 8b1e170..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.sharedworker-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-scheme (HTTP to HTTPS) no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Valid cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.worker-expected.txt
deleted file mode 100644
index 8b1e170..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.any.worker-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-scheme (HTTP to HTTPS) no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch to a same-site URL with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Valid cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any-expected.txt
deleted file mode 100644
index 996f0014..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.serviceworker-expected.txt
deleted file mode 100644
index 996f0014..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.serviceworker-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.sharedworker-expected.txt
deleted file mode 100644
index 996f0014..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.sharedworker-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.worker-expected.txt
deleted file mode 100644
index 996f0014..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.worker-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-site' response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a redirection. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' response header after a cross-origin redirection.
-FAIL Cross-origin no-cors fetch with a 'Cross-Origin-Resource-Policy: same-origin' redirect response header. assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/iframe-loads-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/iframe-loads-expected.txt
deleted file mode 100644
index 2a900674..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/iframe-loads-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL Load an iframe that has Cross-Origin-Resource-Policy header promise_test: Unhandled rejection with value: object "[object Response]"
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/image-loads-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/image-loads-expected.txt
deleted file mode 100644
index 12994a6..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/image-loads-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin image load with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin image load with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors image load with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors image load with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors image load with a 'Cross-Origin-Resource-Policy: same-origin' response header. promise_test: Unhandled rejection with value: object "[object Event]"
-FAIL Cross-origin no-cors image load with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: object "[object Event]"
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any-expected.txt
deleted file mode 100644
index 1467481..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL Cross-Origin-Resource-Policy: same-site blocks retrieving HTTPS from HTTP assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any.worker-expected.txt
deleted file mode 100644
index 1467481..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/scheme-restriction.any.worker-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL Cross-Origin-Resource-Policy: same-site blocks retrieving HTTPS from HTTP assert_unreached: Should have rejected: undefined Reached unreachable code
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/script-loads-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/script-loads-expected.txt
deleted file mode 100644
index 9da3ee5f..0000000
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/script-loads-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a testharness.js-based test.
-PASS Same-origin script load with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Same-origin script load with a 'Cross-Origin-Resource-Policy: same-site' response header.
-PASS Cross-origin cors script load with a 'Cross-Origin-Resource-Policy: same-origin' response header.
-PASS Cross-origin cors script load with a 'Cross-Origin-Resource-Policy: same-site' response header.
-FAIL Cross-origin no-cors script load with a 'Cross-Origin-Resource-Policy: same-origin' response header. promise_test: Unhandled rejection with value: object "[object Event]"
-FAIL Cross-origin no-cors script load with a 'Cross-Origin-Resource-Policy: same-site' response header. promise_test: Unhandled rejection with value: object "[object Event]"
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/syntax.any.js b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/syntax.any.js
index cf5b06d..dc87497 100644
--- a/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/syntax.any.js
+++ b/third_party/blink/web_tests/external/wpt/fetch/cross-origin-resource-policy/syntax.any.js
@@ -8,7 +8,8 @@
   "SAME-ORIGIN",
   "Same-Origin",
   "same-origin, <>",
-  "same-origin, same-origin"
+  "same-origin, same-origin",
+  "https://www.example.com",  // See https://github.com/whatwg/fetch/issues/760
 ].forEach(incorrectHeaderValue => {
   // Note: an incorrect value results in a successful load, so this test is only meaningful in
   // implementations with support for the header.
diff --git a/third_party/blink/web_tests/external/wpt/geolocation-sensor/GeolocationSensor-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/geolocation-sensor/GeolocationSensor-supported-by-feature-policy.html
new file mode 100644
index 0000000..aa05f33
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/geolocation-sensor/GeolocationSensor-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that geolocation is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('geolocation', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise geolocation.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/gyroscope/Gyroscope-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/gyroscope/Gyroscope-supported-by-feature-policy.html
new file mode 100644
index 0000000..06a4137
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/gyroscope/Gyroscope-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that gyroscope is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('gyroscope', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise gyroscope.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/media-elements/autoplay-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/media-elements/autoplay-supported-by-feature-policy.html
new file mode 100644
index 0000000..af4de6b
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/media-elements/autoplay-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that autoplay is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/infrastructure.html#policy-controlled-features">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('autoplay', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise autoplay.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/lint.whitelist b/third_party/blink/web_tests/external/wpt/lint.whitelist
index 2f94041..8c5a32935 100644
--- a/third_party/blink/web_tests/external/wpt/lint.whitelist
+++ b/third_party/blink/web_tests/external/wpt/lint.whitelist
@@ -801,3 +801,5 @@
 # Signed Exchange files have hard-coded URLs in the certUrl field
 WEB-PLATFORM.TEST:signed-exchange/resources/*.sxg
 WEB-PLATFORM.TEST:signed-exchange/resources/generate-test-sxgs.sh
+
+WEB-PLATFORM.TEST: workers/Worker-location.any.js
\ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/magnetometer/Magnetometer-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/magnetometer/Magnetometer-supported-by-feature-policy.html
new file mode 100644
index 0000000..a049363
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/magnetometer/Magnetometer-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that magnetometer is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('magnetometer', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise magnetometer.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/mediacapture-streams/MediaStream-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/mediacapture-streams/MediaStream-supported-by-feature-policy.html
new file mode 100644
index 0000000..ef29ae6e
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/mediacapture-streams/MediaStream-supported-by-feature-policy.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>Test that accelerometer is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/mediacapture-main/#feature-policy-integration">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('camera', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise camera.');
+
+test(() => {
+    assert_in_array('microphone', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise microphone.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html
deleted file mode 100644
index 30dea820..0000000
--- a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!doctype html>
-<html>
-<head>
-  <meta http-equiv="Content-Security-Policy" content="trusted-types *">
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-</head>
-<body>
-<div id=log></div>
-
-<script>
-
-// To test workers, we need to importScripts source files in the workers.
-// Since the point of this test is to test blocking of importScripts, we need
-// to set up one policy that will blindly pass through URLs for use in the test
-// setup, and then have additional policies for the actual test cases.
-//
-// For the same reason we cannot use the otherwise preferred 'META: workers'
-// tag, since the test setup that uses would be blocked as soon trusted types
-// enforcement is enabled.
-const test_setup_policy = TrustedTypes.createPolicy("hurrayanythinggoes", {
-  createScriptURL: x => new URL(x, location.href)
-});
-const test_url =
-  test_setup_policy.createScriptURL("WorkerGlobalScope-importScripts.https.js");
-
-fetch_tests_from_worker(new Worker(test_url));
-
-fetch_tests_from_worker(new SharedWorker(test_url));
-
-// Cargo-culted from code generated from "META: worker".
-if ('serviceWorker' in navigator) {
-  (async function() {
-      const scope = 'some/scope/for/this/test';
-      let reg = await navigator.serviceWorker.getRegistration(scope);
-      if (reg) await reg.unregister();
-      reg = await navigator.serviceWorker.register(test_url, {scope});
-      fetch_tests_from_worker(reg.installing);
-  })();
-}
-</script>
-</body>
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js b/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js
deleted file mode 100644
index 4e491b9f..0000000
--- a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js
+++ /dev/null
@@ -1,70 +0,0 @@
-
-let test_setup_policy = TrustedTypes.createPolicy("hurrayanythinggoes", {
-  createScriptURL: x => new URL(x, location.href)
-});
-importScripts(test_setup_policy.createScriptURL("/resources/testharness.js"));
-
-
-// Determine worker type (for better logging)
-let worker_type = "unknown";
-if (this.DedicatedWorkerGlobalScope !== undefined) {
-  worker_type = "dedicated worker";
-} else if (this.SharedWorkerGlobalScope !== undefined) {
-  worker_type = "shared worker";
-} else if (this.ServiceWorkerGlobalScope !== undefined) {
-  worker_type = "service worker";
-}
-
-const test_policy = TrustedTypes.createPolicy('xxx', {
-  createScriptURL: url => new URL(url.replace("play", "work"), this.location.href) });
-
-test(t => {
-  self.result = "Fail";
-  let trusted_url = test_policy.createScriptURL(new URL("support/player.js", location.href));
-  assert_true(TrustedTypes.isScriptURL(trusted_url));
-  importScripts(trusted_url);  // support/worker.js modifies self.result.
-  assert_equals(self.result, "Pass");
-}, "importScripts with TrustedScriptURL works in " + worker_type);
-
-test(t => {
-  let untrusted_url = "support/player.js";
-  assert_throws(new TypeError(),
-    function() { importScripts(untrusted_url) },
-    "importScripts(untrusted_url)");
-}, "importScripts with untrusted URLs throws in " + worker_type);
-
-test(t => {
-  assert_throws(new TypeError(),
-    function() { importScripts(null) },
-    "importScripts(null)");
-}, "null is not a trusted script URL throws in " + worker_type);
-
-test(t => {
-  self.result = "Fail";
-  let trusted_url = test_policy.createScriptURL(
-      new URL("support/player.js?variant1", location.href));
-  let trusted_url2 = test_policy.createScriptURL(
-      new URL("support/player.js?variant2", location.href));
-  importScripts(trusted_url, trusted_url2);
-  assert_equals(self.result, "Pass");
-}, "importScripts with two URLs, both trusted, in " + worker_type);
-
-test(t => {
-  let untrusted_url = "support/player.js?variant1";
-  let untrusted_url2 = "support/player.js?variant2";
-  assert_throws(new TypeError(),
-    function() { importScripts(untrusted_url, untrusted_url2) },
-    "importScripts(untrusted_url, untrusted_url2)");
-}, "importScripts with two URLs, both strings, in " + worker_type);
-
-test(t => {
-  let untrusted_url = "support/player.js";
-  let trusted_url = test_policy.createScriptURL(
-      new URL(untrusted_url, location.href));
-  assert_throws(new TypeError(),
-    function() { importScripts(untrusted_url, trusted_url) },
-    "importScripts(untrusted_url, trusted_url)");
-}, "importScripts with two URLs, one trusted, in " + worker_type);
-
-done();
-
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js.headers b/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js.headers
deleted file mode 100644
index 1bc33add..0000000
--- a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.js.headers
+++ /dev/null
@@ -1 +0,0 @@
-Content-Security-Policy: trusted-types *
diff --git a/third_party/blink/web_tests/external/wpt/wake-lock/wakelock-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/wake-lock/wakelock-supported-by-feature-policy.html
new file mode 100644
index 0000000..d6289ff
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/wake-lock/wakelock-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that wake-lock is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://w3c.github.io/wake-lock/#dfn-wake-lock-feature">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('wake-lock', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise wake-lock.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/webusb/usb-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/webusb/usb-supported-by-feature-policy.html
new file mode 100644
index 0000000..d5b585a
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/webusb/usb-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that usb is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://wicg.github.io/webusb/#feature-policy">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('usb', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise usb.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/webvr/webvr-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/webvr/webvr-supported-by-feature-policy.html
new file mode 100644
index 0000000..9487c35
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/webvr/webvr-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that xr is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://immersive-web.github.io/webxr/#feature-policy">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('xr', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise xr.');
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-MessageEvent-source.any.js b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-MessageEvent-source.any.js
new file mode 100644
index 0000000..b3a6034
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-MessageEvent-source.any.js
@@ -0,0 +1,6 @@
+// META: global=!default,sharedworker
+const t = async_test("Make sure that MessageEvent.source is properly set in connect event.");
+onconnect = t.step_func_done((event) => {
+  assert_equals(event.__proto__, MessageEvent.prototype);
+  assert_equals(event.source, event.ports[0]);
+});
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-constructor.html b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-constructor.html
new file mode 100644
index 0000000..2bfe7d9
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-constructor.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<title>Test SharedWorker constructor functionality.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+
+test(() => {
+  assert_throws(new Error(),
+                function() {
+                    new SharedWorker({toString:function(){throw new Error()}}, "name") },
+                "toString exception not propagagted");
+}, "Test toString exception propagated correctly.");
+
+test(() => {
+  assert_throws(new RangeError(),
+                function() {
+                    var foo = {toString:function(){new Worker(foo)}}
+                    new SharedWorker(foo, name); },
+                "Trying to create workers recursively did not result in an exception.");
+}, "Test recursive worker creation results in exception.");
+
+test(() => {
+  assert_throws(new TypeError(),
+                function() { new SharedWorker(); },
+                "Invoking SharedWorker constructor without arguments did not result in an exception.");
+}, "Test SharedWorker creation without arguments results in exception.");
+
+test(() => {
+  try {
+    var worker = new SharedWorker("support/SharedWorker-common.js");
+  } catch (ex) {
+    assert_unreached("Constructor failed when no name is passed: (" + ex + ")");
+  }
+}, "Test SharedWorker constructor without a name does not result in an exception.");
+
+test(() => {
+  try {
+    var worker = new SharedWorker("support/SharedWorker-common.js", null);
+  } catch (ex) {
+    assert_unreached("Constructor failed when null name is passed: (" + ex + ")");
+  }
+}, "Test SharedWorker constructor with null name does not result in an exception.");
+
+test(() => {
+  try {
+    var worker = new SharedWorker("support/SharedWorker-common.js", undefined);
+  } catch (ex) {
+    assert_unreached("Constructor failed when undefined name is passed: (" + ex + ")");
+  }
+}, "Test SharedWorker constructor with undefined name does not result in an exception.");
+
+test(() => {
+  try {
+    var worker = new SharedWorker("support/SharedWorker-common.js", "name");
+  } catch (ex) {
+    assert_unreached("Invoking SharedWorker constructor resulted in an exception: (" + ex + ")");
+  }
+}, "Test SharedWorker constructor suceeds.");
+
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-exception.html b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-exception.html
new file mode 100644
index 0000000..b9f4530
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-exception.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>This test checks whether exceptions in SharedWorkers are logged to the parent document. An exception should be logged to the error console.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/SharedWorker-create-common.js"></script>
+<script>
+async_test(function(t) {
+    var worker = createWorker();
+    worker.postMessage("throw");
+    worker.postMessage("ping");
+    worker.onmessage = function(evt) {
+        // Wait for response from ping - that's how we know we have thrown the exception.
+        if (evt.data == "PASS: Received ping message") {
+            t.done();
+        }
+    };
+});
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-replace-EventHandler.any.js b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-replace-EventHandler.any.js
new file mode 100644
index 0000000..be9d7125
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-replace-EventHandler.any.js
@@ -0,0 +1,15 @@
+// META: global=!default,sharedworker
+// https://crbug.com/239669
+const t = async_test("Tests that repeatedly setting 'onerror' within a shared worker doesnt crash.");
+onconnect = t.step_func_done((event) => {
+  function update() {
+    onerror = undefined;
+  }
+  try {
+    for (var i = 0; i < 8; ++i) {
+      update();
+    }
+  } catch (ex) {
+    assert_unreached("FAIL: unexpected exception (" + ex + ") received while updating onerror event handler.");
+  }
+});
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-script-error.html b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-script-error.html
new file mode 100644
index 0000000..3c93cc0
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-script-error.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Test SharedWorker script error handling functionality.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(t => {
+    let worker;
+
+    return new Promise((resolve) => {
+        worker = new SharedWorker("support/SharedWorker-script-error.js");
+        // Shared workers should only invoke onerror for loading errors.
+        worker.onerror = function(evt) {
+            assert_unreached("FAIL: onerror invoked for a script error.");
+        };
+        worker.port.postMessage("unhandledError");
+        worker.port.onmessage = resolve;
+    }).then(e => {
+        assert_equals(e.data, "SUCCESS: unhandled error generated");
+    });
+}, 'Test script error unhandled.')
+
+promise_test(t => {
+    let worker;
+
+    return new Promise((resolve) => {
+        worker = new SharedWorker("support/SharedWorker-script-error.js");
+        // Shared workers should only invoke onerror for loading errors.
+        worker.onerror = function(evt) {
+            assert_unreached("FAIL: onerror invoked for a script error.");
+        };
+        worker.port.postMessage("handledError");
+        worker.port.onmessage = resolve;
+    }).then(e => {
+        assert_equals(e.data, "SUCCESS: error handled via onerror");
+    });
+}, 'Test script error handled.')
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/SharedWorker-simple.html b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-simple.html
new file mode 100644
index 0000000..7cd3f4f
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/SharedWorker-simple.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Test simple shared worker construction case.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(t => {
+    let worker;
+
+    return new Promise(resolve => {
+        worker = new SharedWorker('support/SharedWorker-common.js', 'name');
+        worker.port.postMessage("ping");
+        worker.port.onmessage = resolve;
+    }).then(e => {
+        assert_equals(e.data, "PASS: Received ping message");
+    });
+});
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-base64.any.js b/third_party/blink/web_tests/external/wpt/workers/Worker-base64.any.js
new file mode 100644
index 0000000..b5957f2
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-base64.any.js
@@ -0,0 +1,5 @@
+// META: global=!default,worker
+test(() => {
+  assert_true(typeof atob === 'function');
+  assert_true(typeof btoa === 'function');
+}, 'Tests that atob() / btoa() functions are exposed to workers');
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-call.worker.js b/third_party/blink/web_tests/external/wpt/workers/Worker-call.worker.js
new file mode 100644
index 0000000..ba07498
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-call.worker.js
@@ -0,0 +1,12 @@
+importScripts("/resources/testharness.js");
+test(() => {
+  try {
+    postMessage("SUCCESS: postMessage() called directly");
+    postMessage.call(null, "SUCCESS: postMessage() invoked via postMessage.call()");
+    var saved = postMessage;
+    saved("SUCCESS: postMessage() called via intermediate variable");
+  } catch (ex) {
+    assert_unreached("FAIL: unexpected exception (" + ex + ") received while calling functions from the worker context.");
+  }
+}, 'Test calling functions from WorkerContext.');
+done();
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-constructor-proto.any.js b/third_party/blink/web_tests/external/wpt/workers/Worker-constructor-proto.any.js
new file mode 100644
index 0000000..73eabd552
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-constructor-proto.any.js
@@ -0,0 +1,7 @@
+//META: global=!default, worker
+test(() => {
+  proto = new Number(42)
+  assert_equals(String(Object.getPrototypeOf(WorkerLocation)), "function () { [native code] }");
+  WorkerLocation.__proto__ = proto;
+  assert_object_equals(Object.getPrototypeOf(WorkerLocation), Object(42));
+}, 'Tests that setting the proto of a built in constructor is not reset.');
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-location.any.js b/third_party/blink/web_tests/external/wpt/workers/Worker-location.any.js
new file mode 100644
index 0000000..c2a4590
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-location.any.js
@@ -0,0 +1,14 @@
+// META: global=!default, dedicatedworker, sharedworker
+test(() => {
+  assert_equals(String(WorkerLocation), "function WorkerLocation() { [native code] }");
+  assert_true(location instanceof Object);
+  assert_equals(location.href, "http://web-platform.test:8001/workers/Worker-location.any.worker.js")
+  assert_equals(location.origin, "http://web-platform.test:8001");
+  assert_equals(location.protocol, "http:");
+  assert_equals(location.host, "web-platform.test:8001");
+  assert_equals(location.hostname, "web-platform.test");
+  assert_equals(location.port, "8001");
+  assert_equals(location.pathname, "/workers/Worker-location.any.worker.js");
+  assert_equals(location.search, "");
+  assert_equals(location.hash, "");
+}, 'Test WorkerLocation properties.');
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-replace-global-constructor.any.js b/third_party/blink/web_tests/external/wpt/workers/Worker-replace-global-constructor.any.js
new file mode 100644
index 0000000..f208f373
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-replace-global-constructor.any.js
@@ -0,0 +1,9 @@
+// META: global=!default,worker
+test(() => {
+  try {
+    self.MessageEvent = 'PASS';
+    assert_equals(self.MessageEvent, 'PASS');
+  } catch (ex) {
+    assert_unreached("FAIL: unexpected exception (" + ex + ") received while replacing global constructor MessageEvent.");
+  }
+}, 'Test replacing global constructors in a worker context.');
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-replace-self.any.js b/third_party/blink/web_tests/external/wpt/workers/Worker-replace-self.any.js
new file mode 100644
index 0000000..6e732c0
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-replace-self.any.js
@@ -0,0 +1,9 @@
+// META: global=!default,worker
+test(() => {
+  try {
+    self = 'PASS';
+    assert_true(self instanceof WorkerGlobalScope);
+  } catch (ex) {
+    assert_unreached("FAIL: unexpected exception (" + ex + ") received while replacing self.");
+  }
+}, 'Test that self is not replaceable.');
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-simultaneous-errors.html b/third_party/blink/web_tests/external/wpt/workers/Worker-simultaneous-errors.html
new file mode 100644
index 0000000..4339f2e3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-simultaneous-errors.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Test simultaneous errors on workers.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(t => {
+    var workers = 4;
+    var promises = [];
+
+    for (i = 0; i < workers; ++i) {
+        var worker = new Worker('support/throw-on-message-Worker.js');
+        promises.push(new Promise(function(resolve, reject) {
+            var error = 0;
+            worker.onmessage = function(event) {
+                if (event.data === 'second')
+                    resolve(error);
+                else if (event.data === 'error')
+                    ++error;
+            }
+        }));
+        worker.postMessage('first');
+        worker.postMessage('second');
+    }
+
+    return Promise.all(promises).then(e => {
+        var sum = 0;
+        for (var key in e) {
+            sum += e[key]
+        }
+        assert_equals(sum, workers);
+    });
+});
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/Worker-termination-with-port-messages.html b/third_party/blink/web_tests/external/wpt/workers/Worker-termination-with-port-messages.html
new file mode 100644
index 0000000..bc19784a
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/Worker-termination-with-port-messages.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>This test terminates a worker when there are many undelivered MessagePort messages still waiting to be dispatched into the Worker Context. This causes termination of JS execution and test should not try to dispatch the remaining messages. Test succeeds if it does not hang or crash (if worker thread is running in the separate process, that process could hang or crash).</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+    var worker = new Worker("support/Worker-termination-with-port-messages.js");
+    var channel = new MessageChannel();
+
+    channel.port2.onmessage = function(evt)
+    {
+        // On first message back from worker, terminate it.
+        worker.terminate();
+        t.done();
+    }
+    channel.port2.start();
+
+    worker.postMessage("", [channel.port1]);
+    for (i = 0; i < 1000; i++)
+        channel.port2.postMessage("message to worker");
+});
+</script>
diff --git a/third_party/blink/web_tests/external/wpt/workers/WorkerNavigator.any.js b/third_party/blink/web_tests/external/wpt/workers/WorkerNavigator.any.js
new file mode 100644
index 0000000..3588045
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/WorkerNavigator.any.js
@@ -0,0 +1,12 @@
+// META: global=!default, worker
+test(() => {
+  assert_equals(typeof navigator, "object");
+  assert_true(navigator instanceof WorkerNavigator);
+  assert_equals(navigator.appName, "Netscape");
+  assert_true(navigator.appVersion.indexOf('WebKit') != 0);
+  assert_equals(typeof navigator.platform, "string");
+  assert_true(navigator.userAgent.indexOf('WebKit') != 0);
+  assert_equals(typeof navigator.onLine, "boolean");
+  assert_equals(navigator.appCodeName, 'Mozilla');
+  assert_equals(navigator.product, 'Gecko');
+}, "Testing Navigator properties on workers.");
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-common.js b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-common.js
new file mode 100644
index 0000000..1c1dac3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-common.js
@@ -0,0 +1,32 @@
+function generateError()
+{
+    // Generate an exception by accessing an undefined variable.
+    foo.bar = 0;
+}
+
+onconnect = function(event) {
+    event.ports[0].onmessage = function(evt) { handleMessage(evt, event.ports[0]); };
+};
+
+function handleMessage(event, port) {
+    self.port = port;
+    if (event.data == "ping")
+        port.postMessage("PASS: Received ping message");
+    else if (event.data == "close")
+        close();
+    else if (event.data == "done")
+        port.postMessage("DONE");
+    else if (event.data == "throw")
+        generateError();
+    else if (event.data == "testingNameAttribute")
+        port.postMessage(self.name);
+    else if (/eval.+/.test(event.data)) {
+        try {
+            port.postMessage(event.data.substr(5) + ": " + eval(event.data.substr(5)));
+        } catch (ex) {
+            port.postMessage(event.data.substr(5) + ": " + ex);
+        }
+    }
+    else
+        port.postMessage("FAILURE: Received unknown message: " + event.data);
+}
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-create-common.js b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-create-common.js
new file mode 100644
index 0000000..1d06174
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-create-common.js
@@ -0,0 +1,8 @@
+// Make a SharedWorker that has the same external interface as a DedicatedWorker, to use in shared test code.
+function createWorker()
+{
+    var worker = new SharedWorker('support/SharedWorker-common.js', 'name');
+    worker.port.onmessage = function(evt) { worker.onmessage(evt); };
+    worker.postMessage = function(msg, port) { worker.port.postMessage(msg, port); };
+    return worker;
+}
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-script-error.js b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-script-error.js
new file mode 100644
index 0000000..0e78949d
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/SharedWorker-script-error.js
@@ -0,0 +1,22 @@
+onconnect = function(event) {
+    event.ports[0].onmessage = function(evt) { handleMessage(evt, event.ports[0]); };
+};
+
+function handleMessage(event, port) {
+    if (event.data == "unhandledError") {
+        // Generate an unhandled error.
+        onerror = null;
+        setTimeout(function() {
+            port.postMessage("SUCCESS: unhandled error generated");
+        }, 100);
+        generateError();  // Undefined function call
+    } else if (event.data == "handledError") {
+        onerror = function() {
+            port.postMessage("SUCCESS: error handled via onerror");
+            return true;
+        };
+        generateError();  // Undefined function call
+    } else {
+        port.postMessage("FAIL: Got unexpected message: " + event.data);
+    }
+};
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/Worker-common.js b/third_party/blink/web_tests/external/wpt/workers/support/Worker-common.js
new file mode 100644
index 0000000..55188fe91
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/Worker-common.js
@@ -0,0 +1,16 @@
+onmessage = function(evt)
+{
+    if (evt.data == "ping")
+        postMessage("pong");
+    else if (evt.data == "freeze")
+        while (1) {}
+    else if (evt.data == "close")
+        close();
+    else if (/eval.+/.test(evt.data)) {
+        try {
+            postMessage(evt.data.substr(5) + ": " + eval(evt.data.substr(5)));
+        } catch (ex) {
+            postMessage(evt.data.substr(5) + ": " + ex);
+        }
+    }
+}
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/Worker-create-common.js b/third_party/blink/web_tests/external/wpt/workers/support/Worker-create-common.js
new file mode 100644
index 0000000..f0b8efe4
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/Worker-create-common.js
@@ -0,0 +1,4 @@
+function createWorker()
+{
+    return new Worker('support/Worker-common.js');
+}
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/Worker-termination-with-port-messages.js b/third_party/blink/web_tests/external/wpt/workers/support/Worker-termination-with-port-messages.js
new file mode 100644
index 0000000..a827db3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/Worker-termination-with-port-messages.js
@@ -0,0 +1,10 @@
+function echo(evt)
+{
+    evt.target.postMessage(evt.data);
+}
+
+onmessage = function(evt)
+{
+    evt.ports[0].onmessage = echo;
+    evt.ports[0].start();
+}
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/throw-on-message-Worker.js b/third_party/blink/web_tests/external/wpt/workers/support/throw-on-message-Worker.js
new file mode 100644
index 0000000..3648f1f
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/workers/support/throw-on-message-Worker.js
@@ -0,0 +1,11 @@
+self.onerror = function(evt) {
+  postMessage('error');
+  return true;
+}
+
+self.onmessage = function(evt) {
+    if (evt.data === "first")
+        throw Error();
+    else
+        postMessage(evt.data);
+}
diff --git a/third_party/blink/web_tests/external/wpt/xhr/sync-xhr-supported-by-feature-policy.html b/third_party/blink/web_tests/external/wpt/xhr/sync-xhr-supported-by-feature-policy.html
new file mode 100644
index 0000000..45588bf
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/xhr/sync-xhr-supported-by-feature-policy.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test that sync-xhr is advertised in the feature list</title>
+<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
+<link rel="help" href="https://xhr.spec.whatwg.org/#feature-policy-integration">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+    assert_in_array('sync-xhr', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise sync-xhr.');
+</script>
diff --git a/third_party/blink/web_tests/fast/mediastream/MediaStreamTrack-applyConstraints.html b/third_party/blink/web_tests/fast/mediastream/MediaStreamTrack-applyConstraints.html
index 9366b58..ceb2833 100644
--- a/third_party/blink/web_tests/fast/mediastream/MediaStreamTrack-applyConstraints.html
+++ b/third_party/blink/web_tests/fast/mediastream/MediaStreamTrack-applyConstraints.html
@@ -242,6 +242,16 @@
     {audio: {echoCancellation: {exact: true}}},
     {echoCancellation: {exact: false}});
 
+constraintSyntaxTestContradictingProperties(
+    'Contradicting noiseSuppression constraints', 'noiseSuppression',
+    {audio: {noiseSuppression: {exact: true}}},
+    {noiseSuppression: {exact: false}});
+
+constraintSyntaxTestContradictingProperties(
+    'Contradicting autoGainControl constraints', 'autoGainControl',
+    {audio: {autoGainControl: {exact: true}}},
+    {autoGainControl: {exact: false}});
+
 </script>
 </body>
 </html>
diff --git a/third_party/blink/web_tests/fast/workers/constructor-proto-expected.txt b/third_party/blink/web_tests/fast/workers/constructor-proto-expected.txt
deleted file mode 100644
index 5e3f260..0000000
--- a/third_party/blink/web_tests/fast/workers/constructor-proto-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This tests that setting the proto of a built in constructor is not reset
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-proto = new Number(42): 42
-Object.getPrototypeOf(WorkerLocation): function () { [native code] }
-WorkerLocation.__proto__ = proto: 42
-Object.getPrototypeOf(WorkerLocation): 42
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/blink/web_tests/fast/workers/constructor-proto.html b/third_party/blink/web_tests/fast/workers/constructor-proto.html
deleted file mode 100644
index c0e5e4c2..0000000
--- a/third_party/blink/web_tests/fast/workers/constructor-proto.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<script src="../../resources/js-test.js"></script>
-<script src="resources/worker-create-common.js"></script>
-<script>
-
-var jsTestIsAsync = true;
-
-description('This tests that setting the proto of a built in constructor is not reset');
-
-var worker = createWorker();
-worker.postMessage("eval proto = new Number(42)");
-worker.postMessage("eval Object.getPrototypeOf(WorkerLocation)");
-worker.postMessage("eval WorkerLocation.__proto__ = proto");
-worker.postMessage("eval Object.getPrototypeOf(WorkerLocation)");
-worker.postMessage("eval DONE");
-
-worker.onmessage = function(evt) {
-    if (!/DONE/.test(evt.data))
-        debug(evt.data.replace(new RegExp("/.*(LayoutTests|web_tests)"), "<...>"));
-    else
-        finishJSTest();
-};
-
-</script>
diff --git a/third_party/blink/web_tests/fast/workers/resources/shared-worker-exception.js b/third_party/blink/web_tests/fast/workers/resources/shared-worker-exception.js
deleted file mode 100644
index c0275afd..0000000
--- a/third_party/blink/web_tests/fast/workers/resources/shared-worker-exception.js
+++ /dev/null
@@ -1,26 +0,0 @@
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-description("This test checks whether exceptions in SharedWorkers are logged to the parent document. An exception should be logged to the error console.");
-
-var worker = createWorker();
-worker.postMessage("throw");
-worker.postMessage("ping");
-
-// Wait for response from ping - that's how we know we have thrown the exception.
-worker.onmessage = function(event)
-{
-    debug(event.data);
-
-    // Give the console message a chance to be written out before ending the test (timers are processed after the task queue is empty).
-    setTimeout(done, 0);
-};
-
-function done()
-{
-    debug('<br /><span class="pass">TEST COMPLETE</span>');
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-constructor-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-constructor-expected.txt
deleted file mode 100644
index d2497c5..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-constructor-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Test SharedWorker constructor functionality. Should print a series of PASS messages, followed with DONE.
-
-PASS: toString exception propagated correctly.
-PASS: trying to create workers recursively resulted in an exception (RangeError: Maximum call stack size exceeded)
-PASS: invoking SharedWorker constructor without arguments resulted in an exception (TypeError: Failed to construct 'SharedWorker': 1 argument required, but only 0 present.)
-PASS: invoking SharedWorker constructor without name did not result in an exception
-PASS: invoking SharedWorker constructor with null name did not result in an exception
-PASS: invoking SharedWorker constructor with undefined name did not result in an exception
-PASS: SharedWorker constructor succeeded: [object SharedWorker]
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-constructor.html b/third_party/blink/web_tests/fast/workers/shared-worker-constructor.html
deleted file mode 100644
index 2eec12c..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-constructor.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<body>
-<p>Test SharedWorker constructor functionality. Should print a series of PASS messages, followed with DONE.</p>
-<div id=result></div>
-<script>
-function log(message)
-{
-    document.getElementById("result").innerHTML += message + "<br>";
-}
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-try {
-    new SharedWorker({toString:function(){throw "exception"}}, "name")
-    log("FAIL: toString exception not propagated.");
-} catch (ex) {
-    if (ex == "exception")
-        log("PASS: toString exception propagated correctly.");
-    else
-        log("FAIL: unexpected exception (" + ex + ") received instead of one propagated from toString.");
-}
-
-try {
-    var foo = {toString:function(){new Worker(foo)}}
-    new SharedWorker(foo, name);
-    log("FAIL: no exception when trying to create workers recursively");
-} catch (ex) {
-    log("PASS: trying to create workers recursively resulted in an exception (" + ex + ")");
-}
-
-try {
-    new SharedWorker();
-    log("FAIL: invoking SharedWorker constructor without arguments did not result in an exception");
-} catch (ex) {
-    log("PASS: invoking SharedWorker constructor without arguments resulted in an exception (" + ex + ")");
-}
-
-try {
-    var worker = new SharedWorker("resources/shared-worker-common.js");
-    log("PASS: invoking SharedWorker constructor without name did not result in an exception");
-} catch (ex) {
-    log("FAIL: Constructor failed when no name is passed: (" + ex + ")");
-}
-
-try {
-    new SharedWorker("resources/shared-worker-common.js", null);
-    log("PASS: invoking SharedWorker constructor with null name did not result in an exception");
-} catch (ex) {
-    log("FAIL: invoking SharedWorker constructor with null name resulted in an exception (" + ex + ")");
-}
-
-try {
-    new SharedWorker("resources/shared-worker-common.js", undefined);
-    log("PASS: invoking SharedWorker constructor with undefined name did not result in an exception");
-} catch (ex) {
-    log("FAIL: invoking SharedWorker constructor with undefined name resulted in an exception (" + ex + ")");
-}
-
-try {
-    var worker = new SharedWorker("resources/shared-worker-common.js", "name");
-    log ("PASS: SharedWorker constructor succeeded: " + worker);
-} catch (ex) {
-    log("FAIL: invoking SharedWorker constructor resulted in an exception (" + ex + ")");
-}
-
-log("DONE");
-if (window.testRunner)
-    testRunner.notifyDone();
-
-</script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-exception.html b/third_party/blink/web_tests/fast/workers/shared-worker-exception.html
deleted file mode 100644
index a3b2f871..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-exception.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="resources/shared-worker-create-common.js"></script>
-<script src="resources/shared-worker-exception.js"></script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-location-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-location-expected.txt
deleted file mode 100644
index 6715999..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-location-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Test WorkerLocation properties.
-
-WorkerLocation: function WorkerLocation() { [native code] }
-typeof location: object
-location: file:<...>/fast/workers/resources/shared-worker-common.js
-location.href: file:<...>/fast/workers/resources/shared-worker-common.js
-location.origin: file://
-location.protocol: file:
-location.host:
-location.hostname:
-location.port:
-location.pathname: <...>/fast/workers/resources/shared-worker-common.js
-location.search:
-location.hash:
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-location.html b/third_party/blink/web_tests/fast/workers/shared-worker-location.html
deleted file mode 100644
index ba1c430..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-location.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<body>
-<p>Test WorkerLocation properties.</p>
-<div id=result></div>
-<script src="../../resources/gc.js"></script>
-<script src="resources/shared-worker-create-common.js"></script>
-<script src="resources/worker-location.js">
-</script>
-</body>
-</html>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source-expected.txt
deleted file mode 100644
index c1718aa6..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Make sure that MessageEvent.source is properly set in connect event.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Starting worker: resources/messageevent-source.js
-PASS [Worker]  event.__proto__ is MessageEvent.prototype
-PASS [Worker]  event.source is event.ports[0]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source.html b/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source.html
deleted file mode 100644
index 7c051e4..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-messageevent-source.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script>
-description("Make sure that MessageEvent.source is properly set in connect event.");
-
-startWorker("resources/messageevent-source.js", "shared");
-</script>
-</body>
-</html>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-navigator-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-navigator-expected.txt
deleted file mode 100644
index ed1c57a..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-navigator-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Test Navigator properties.
-
-typeof navigator: object
-navigator: [object WorkerNavigator]
-navigator.appName: Netscape
-navigator.appVersion.indexOf('WebKit') != 0: true
-typeof navigator.platform: string
-navigator.userAgent.indexOf('WebKit') != 0: true
-typeof navigator.onLine: boolean
-navigator.appCodeName === 'Mozilla': true
-navigator.product === 'Gecko': true
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-navigator.html b/third_party/blink/web_tests/fast/workers/shared-worker-navigator.html
deleted file mode 100644
index c86c2a7f..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-navigator.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<body>
-<p>Test Navigator properties.</p>
-<div id=result></div>
-<script src="resources/shared-worker-create-common.js"></script>
-<script src="resources/worker-navigator.js"></script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler-expected.txt
deleted file mode 100644
index 5cde4727..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Tests that repeatedly setting 'onerror' within a shared worker doesn't crash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Starting worker: resources/shared-worker-replace-event-handler.js
-[Worker] 'onerror' repeatedly updated ok.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler.html b/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler.html
deleted file mode 100644
index 0a3b924b..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-event-handler.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<script src="../../resources/js-test.js"></script>
-<script>
-// http://crbug.com/239669
-description("Tests that repeatedly setting 'onerror' within a shared worker doesn't crash.");
-startWorker("resources/shared-worker-replace-event-handler.js", "shared");
-</script>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor-expected.txt
deleted file mode 100644
index 49286a6..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Test replacing global constructors in a worker context.
-
-self.MessageEvent = 'PASS'; MessageEvent;: PASS
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor.html b/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor.html
deleted file mode 100644
index d355c44..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-global-constructor.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<body>
-<p>Test replacing global constructors in a worker context.</p>
-<div id=result></div>
-<script src="resources/shared-worker-create-common.js"></script>
-<script src="resources/worker-replace-global-constructor.js">
-</script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-self-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-replace-self-expected.txt
deleted file mode 100644
index 6eecada3..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-self-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Test that self is not replaceable.
-
-self='PASS': PASS
-self: [object SharedWorkerGlobalScope]
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-replace-self.html b/third_party/blink/web_tests/fast/workers/shared-worker-replace-self.html
deleted file mode 100644
index bde370b..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-replace-self.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<body>
-<p>Test that self is not replaceable.</p>
-<div id=result></div>
-<script src="resources/shared-worker-create-common.js"></script>
-<script src="resources/worker-replace-self.js"></script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-script-error-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-script-error-expected.txt
deleted file mode 100644
index 1d36a2c..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-script-error-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Test SharedWorker script error handling functionality. Should print a series of PASS messages, followed with DONE.
-
-SUCCESS: unhandled error generated
-SUCCESS: error handled via onerror: Uncaught ReferenceError: generateError is not defined
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-script-error.html b/third_party/blink/web_tests/fast/workers/shared-worker-script-error.html
deleted file mode 100644
index df5c7f13..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-script-error.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<body>
-<p>Test SharedWorker script error handling functionality. Should print a series of PASS messages, followed with DONE.</p>
-<div id=result></div>
-<script>
-function log(message)
-{
-    document.getElementById("result").innerHTML += message + "<br>";
-}
-
-var testCases = [
-    "testScriptErrorUnhandled",
-    "testScriptErrorHandled"
-];
-var testIndex = 0;
-
-function runNextTest()
-{
-    if (testIndex < testCases.length) {
-        testIndex++;
-        try {
-            window[testCases[testIndex - 1]]();
-        } catch (ex) {
-            log("FAIL: unexpected exception " + ex);
-            runNextTest();
-        }
-    } else {
-        log("DONE");
-        // Wait briefly to make sure that any pending console messages get written out so they don't spill over into subsequent tests and cause failures.
-        setTimeout(function() {
-            if (window.testRunner)
-                testRunner.notifyDone();
-        }, 10);
-    }
-}
-
-function testScriptErrorUnhandled()
-{
-    var worker = new SharedWorker("resources/shared-worker-script-error.js", "name");
-    // SharedWorkers should only invoke onerror for loading errors.
-    worker.onerror = function(evt) {
-        log("FAIL: onerror invoked for a script error");
-    };
-    worker.port.postMessage("unhandledError");
-    worker.port.onmessage = function(evt) {
-        log(evt.data);
-        runNextTest();
-    }
-}
-
-function testScriptErrorHandled()
-{
-    var worker = new SharedWorker("resources/shared-worker-script-error.js", "name2");
-    // SharedWorkers should only invoke onerror for loading errors.
-    worker.onerror = function(evt) {
-        log("FAIL: onerror invoked for a script error");
-    };
-    worker.port.postMessage("handledError");
-    worker.port.onmessage = function(evt) {
-        log(evt.data);
-        runNextTest();
-    }
-}
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-runNextTest();
-
-</script>
-</body>
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-simple-expected.txt b/third_party/blink/web_tests/fast/workers/shared-worker-simple-expected.txt
deleted file mode 100644
index f10ec17..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-simple-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Test simple shared worker construction case.
-
-PASS: Received ping message
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/shared-worker-simple.html b/third_party/blink/web_tests/fast/workers/shared-worker-simple.html
deleted file mode 100644
index 005f596..0000000
--- a/third_party/blink/web_tests/fast/workers/shared-worker-simple.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<body>
-<p>Test simple shared worker construction case.</p>
-<div id=result></div>
-<script>
-function log(message)
-{
-    document.getElementById("result").innerHTML += message + "<br>";
-}
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-var worker = new SharedWorker('resources/shared-worker-common.js', 'name');
-
-worker.port.postMessage("ping");
-worker.port.postMessage("done");
-
-worker.port.onmessage = function(event) {
-    log(event.data);
-    if (event.data == "DONE")
-        done();
-};
-
-function done()
-{
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
-</script>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/simultaneous-errors-expected.txt b/third_party/blink/web_tests/fast/workers/simultaneous-errors-expected.txt
deleted file mode 100644
index 9ef49f3be..0000000
--- a/third_party/blink/web_tests/fast/workers/simultaneous-errors-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-PASS all worker errors were reported.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/blink/web_tests/fast/workers/simultaneous-errors.html b/third_party/blink/web_tests/fast/workers/simultaneous-errors.html
deleted file mode 100644
index c5cb306..0000000
--- a/third_party/blink/web_tests/fast/workers/simultaneous-errors.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!doctype html>
-<script src="../../resources/js-test.js"></script>
-<script>
-window.jsTestIsAsync = true;
-
-var workers = 4;
-var errorsInWorker = 0;
-var promises = [];
-for (i = 0; i < workers; ++i) {
-  var worker = new Worker('resources/throw-on-message-worker.js');
-  promises.push(new Promise(function(resolve, reject) {
-      worker.onmessage = function(event) {
-          if (event.data === 'second')
-              resolve();
-          else if (event.data === 'error')
-              ++errorsInWorker;
-      }
-  }));
-  worker.postMessage('first');
-  worker.postMessage('second');
-}
-
-Promise.all(promises).then(function() {
-    if (errorsInWorker === workers)
-        testPassed('all worker errors were reported.');
-    else
-        testFailed('only ' + errorsInWorker + ' errors reported in ' + workers + ' workers');
-    finishJSTest();
-});
-</script>
diff --git a/third_party/blink/web_tests/fast/workers/termination-with-port-messages-expected.txt b/third_party/blink/web_tests/fast/workers/termination-with-port-messages-expected.txt
deleted file mode 100644
index 7ae8d299..0000000
--- a/third_party/blink/web_tests/fast/workers/termination-with-port-messages-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-This test terminates a worker when there are many undelivered MessagePort messages still waiting to be dispatched into the Worker Context. This causes termination of JS execution and test should not try to dispatch the remaining messages. Test succeeds if it does not hang or crash (if worker thread is running in the separate process, that process could hang or crash).
diff --git a/third_party/blink/web_tests/fast/workers/termination-with-port-messages.html b/third_party/blink/web_tests/fast/workers/termination-with-port-messages.html
deleted file mode 100644
index 1c19d998..0000000
--- a/third_party/blink/web_tests/fast/workers/termination-with-port-messages.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<script>
-function test()
-{
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-    var worker = new Worker("resources/termination-with-port-messages.js");
-    var channel = new MessageChannel();
-
-    channel.port2.onmessage = function(evt)
-    {
-        // On first message back from worker, terminate it.
-        worker.terminate();
-        if (window.testRunner)
-            setTimeout("testRunner.notifyDone();", 0);
-    }
-    channel.port2.start();
-
-    worker.postMessage("", [channel.port1]);
-    for (i = 0; i < 1000; i++)
-        channel.port2.postMessage("message to worker");
-}
-</script>
-<body onload=test()>
-<p>This test terminates a worker when there are many undelivered MessagePort messages still waiting to be dispatched into the Worker Context. This causes termination of JS execution and test should not try to dispatch the remaining messages. Test succeeds if it does not hang or crash (if worker thread is running in the separate process, that process could hang or crash).</p>
-</body>
diff --git a/third_party/blink/web_tests/fast/workers/worker-base64-expected.txt b/third_party/blink/web_tests/fast/workers/worker-base64-expected.txt
deleted file mode 100644
index 7bde475..0000000
--- a/third_party/blink/web_tests/fast/workers/worker-base64-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-[Worker] Tests that atob() / btoa() functions are exposed to workers
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Starting worker: resources/worker-base64.js
-PASS [Worker] typeof atob === 'function' is true
-PASS [Worker] typeof btoa === 'function' is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/blink/web_tests/fast/workers/worker-base64.html b/third_party/blink/web_tests/fast/workers/worker-base64.html
deleted file mode 100644
index aeea1e2b..0000000
--- a/third_party/blink/web_tests/fast/workers/worker-base64.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-<link rel="help" href="http://www.w3.org/TR/workers/#apis-available-to-workers">
-</head>
-<body>
-<script>
-worker = startWorker("resources/worker-base64.js");
-</script>
-</body>
-</html>
diff --git a/third_party/blink/web_tests/fast/workers/worker-call-expected.txt b/third_party/blink/web_tests/fast/workers/worker-call-expected.txt
deleted file mode 100644
index 621d3b5..0000000
--- a/third_party/blink/web_tests/fast/workers/worker-call-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Test calling functions from WorkerContext. Should print multiple SUCCESS lines, followed by DONE.
-
-SUCCESS: postMessage() called directly
-SUCCESS: postMessage() invoked via postMessage.call()
-SUCCESS: postMessage() called via intermediate variable
-DONE
-
diff --git a/third_party/blink/web_tests/fast/workers/worker-call.html b/third_party/blink/web_tests/fast/workers/worker-call.html
deleted file mode 100644
index 7f0a0e0a..0000000
--- a/third_party/blink/web_tests/fast/workers/worker-call.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<body>
-<p>Test calling functions from WorkerContext. Should print multiple SUCCESS lines, followed by DONE.</p>
-<div id=result></div>
-<script>
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-function log(message)
-{
-    document.getElementById("result").innerHTML += message + "<br>";
-}
-
-var worker = new Worker("resources/worker-call.js");
-worker.onmessage = function(event) {
-    log(event.data);
-    if (event.data == "DONE") {
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-};
-</script>
-</body>
diff --git a/third_party/blink/web_tests/http/tests/contacts/resources/mock_contacts_manager.js b/third_party/blink/web_tests/http/tests/contacts/resources/mock_contacts_manager.js
new file mode 100644
index 0000000..b884a43
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/contacts/resources/mock_contacts_manager.js
@@ -0,0 +1,32 @@
+'use strict';
+
+// Mock implementation of the blink.mojom.ContactsManager interface.
+class MockContactsManager {
+  constructor() {
+    this.selectCallback_ = null;
+
+    this.binding_ = new mojo.Binding(blink.mojom.ContactsManager, this);
+    this.interceptor_ = new MojoInterfaceInterceptor(
+        blink.mojom.ContactsManager.name);
+
+    this.interceptor_.oninterfacerequest = e => this.binding_.bind(e.handle);
+    this.interceptor_.start();
+  }
+
+  // Sets |callback| to be invoked when the ContactsManager.Select() method is
+  // being called over the Mojo connection.
+  setSelectCallback(callback) {
+    this.selectCallback_ = callback;
+  }
+
+  async select(multiple, includeNames, includeEmails, includeTel) {
+    if (this.selectCallback_) {
+      return this.selectCallback_(
+          { multiple, includeNames, includeEmails, includeTel });
+    }
+
+    return { contacts: null };
+  }
+}
+
+const mockContactsManager = new MockContactsManager();
diff --git a/third_party/blink/web_tests/http/tests/contacts/select-function.html b/third_party/blink/web_tests/http/tests/contacts/select-function.html
index 346017a..263dd147f 100644
--- a/third_party/blink/web_tests/http/tests/contacts/select-function.html
+++ b/third_party/blink/web_tests/http/tests/contacts/select-function.html
@@ -1,8 +1,11 @@
 <!doctype html>
 <meta charset="utf-8">
 <title>Contact API: Behaviour of the select() function</title>
+<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
+<script src="/gen/third_party/blink/public/mojom/contacts/contacts_manager.mojom.js"></script>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="resources/mock_contacts_manager.js"></script>
 <script>
 'use strict';
 
@@ -64,11 +67,117 @@
 promise_test(async () => {
   triggerUserGesture();
 
-  // TODO(peter): Fake the Mojo interface so that we can extend this test with
-  // valid behaviour, and actually verify the API's functionality.
+  // Returns a NULL result, indicating that no results are available.
+  mockContactsManager.setSelectCallback(async (options) => {
+    return { contacts: null };
+  });
+
   await expectTypeError(() =>
       navigator.contacts.select({ properties: ['name'] }));
 
 }, 'The Contact API can fail when the selector cannot be opened');
 
+promise_test(async () => {
+  triggerUserGesture();
+
+  let storedOptions = null;
+
+  // Stores the |options| in |storedOptions| for inspection after the call
+  // completes. Deliberately fails the call with no data.
+  mockContactsManager.setSelectCallback(async (options) => {
+    storedOptions = options;
+
+    return { contacts: null };
+  });
+
+  await expectTypeError(() => {
+    return navigator.contacts.select({
+        properties: ['name', 'email'],
+        multiple: true
+    });
+  });
+
+  assert_not_equals(storedOptions, null);
+  assert_true(storedOptions.multiple);
+  assert_true(storedOptions.includeNames);
+  assert_true(storedOptions.includeEmails);
+  assert_false(storedOptions.includeTel);
+
+}, 'The Contact API correctly interprets the JavaScript arguments');
+
+promise_test(async () => {
+  triggerUserGesture();
+
+  // Returns two contacts with all information available.
+  mockContactsManager.setSelectCallback(async (options) => {
+    return {
+      contacts: [
+        { name: ['Finnur'], email: ['finnur@chromium.org'], tel: ['000-0000'] },
+        { name: ['Peter', 'Test'], email: ['peter@chromium.org'], tel: [] },
+      ]
+    };
+  });
+
+  const results = await navigator.contacts.select({
+    properties: ['name', 'email', 'tel'],
+    multiple: true
+  });
+
+  assert_equals(results.length, 2);
+
+  {
+    const finnur = results[0];
+
+    assert_own_property(finnur, 'name');
+    assert_own_property(finnur, 'email');
+    assert_own_property(finnur, 'tel');
+
+    assert_array_equals(finnur.name, ['Finnur']);
+    assert_array_equals(finnur.email, ['finnur@chromium.org']);
+    assert_array_equals(finnur.tel, ['000-0000']);
+  }
+
+  {
+    const peter = results[1];
+
+    assert_own_property(peter, 'name');
+    assert_own_property(peter, 'email');
+    assert_own_property(peter, 'tel');
+
+    assert_array_equals(peter.name, ['Peter', 'Test']);
+    assert_array_equals(peter.email, ['peter@chromium.org']);
+    assert_array_equals(peter.tel, []);
+  }
+
+}, 'The Contact API correctly returns ContactInfo entries');
+
+promise_test(async () => {
+  triggerUserGesture();
+
+  // Returns partial information since no e-mail addresses are requested.
+  mockContactsManager.setSelectCallback(async (options) => {
+    return {
+      contacts: [{ name: ['Tim'], email: null, tel: null }]
+    };
+  });
+
+  const results = await navigator.contacts.select({
+    properties: ['name']
+  });
+
+  assert_equals(results.length, 1);
+
+  {
+    const tim = results[0];
+
+    assert_own_property(tim, 'name');
+    assert_false('email' in tim);
+    assert_false('tel' in tim);
+
+    assert_array_equals(tim.name, ['Tim']);
+    assert_equals(tim.email, undefined);
+    assert_equals(tim.tel, undefined);
+  }
+}, 'The Contact API does not include fields that were not requested');
+
 </script>
diff --git a/third_party/blink/web_tests/http/tests/origin_trials/webexposed/contacts-manager-trial-interfaces.html b/third_party/blink/web_tests/http/tests/origin_trials/webexposed/contacts-manager-trial-interfaces.html
new file mode 100644
index 0000000..76f03ed
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/origin_trials/webexposed/contacts-manager-trial-interfaces.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<!-- Generate token with the command:
+generate_token.py http://127.0.0.1:8000 ContactsManager --expire-timestamp=2000000000
+-->
+<meta http-equiv="origin-trial" content="AjhJrQsVAJPjcnfzGXCx1Juv3fDZ0/Rv71Q/4MZbKNCD3mh+xDRTFLQWSfQAJEqIcj2TFSZASOiF6YDH/pdHVAMAAABXeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQ29udGFjdHNNYW5hZ2VyIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9" />
+<title>Contacts Manager - interfaces exposed by origin trial</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/origin-trials-helper.js"></script>
+<script>
+test(() => {
+  OriginTrialsHelper.check_properties(this, { 'ContactsManager': ['select'] });
+}, 'Contact API interfaces and properties in Origin-Trial enabled document.');
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/link-preload-scanner-use-counter.html b/third_party/blink/web_tests/http/tests/priority-hints/link-preload-scanner-use-counter.html
index 4b7f574..7f368228 100644
--- a/third_party/blink/web_tests/http/tests/priority-hints/link-preload-scanner-use-counter.html
+++ b/third_party/blink/web_tests/http/tests/priority-hints/link-preload-scanner-use-counter.html
@@ -11,7 +11,7 @@
 
   window.onload = t.step_func_done(() => {
     assert_true(internals.isPreloaded(link.href),
-                'The <link> resource was ' + 'fetched by the preload scanner');
+                'The <link> resource was fetched by the preload scanner');
     assert_true(internals.isUseCounted(document, kPriorityHints),
                 'Priority Hints is use-counted when the preload scanner ' +
                 'fetches a <link> with an importance attribute');
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-async-initial-load.html b/third_party/blink/web_tests/http/tests/priority-hints/script-async-initial-load.html
new file mode 100644
index 0000000..c71c76b
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-async-initial-load.html
@@ -0,0 +1,37 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<script id=script1 async importance=high src=../resources/dummy.js></script>
+<script id=script2 async importance=low src=../resources/dummy.js?1></script>
+<script id=script3 async importance=auto src=../resources/dummy.js?2></script>
+<script id=script4 async importance=xyz src=../resources/dummy.js?3></script>
+<script id=script5 async src=../resources/dummy.js?4></script>
+
+<script>
+  async_test(t => {
+    addEventListener('DOMContentLoaded', t.step_func(() => {
+      const msg = 'all scripts were fetched by the preload scanner';
+      assert_true(internals.isPreloaded(script1.src), msg);
+      assert_true(internals.isPreloaded(script2.src), msg);
+      assert_true(internals.isPreloaded(script3.src), msg);
+      assert_true(internals.isPreloaded(script4.src), msg);
+      assert_true(internals.isPreloaded(script5.src), msg);
+
+      assert_equals(getPriority(script1.src), kHigh,
+                    'high importance on async <script> raises the priority ' +
+                    'to kHigh');
+      assert_equals(getPriority(script2.src), kLow,
+                    'low importance on async <script> has no effect');
+      assert_equals(getPriority(script3.src), kLow,
+                    'auto importance on async <script> has no effect');
+      assert_equals(getPriority(script4.src), kLow,
+                    'invalid importance on async <script> has no effect');
+      assert_equals(getPriority(script5.src), kLow,
+                    'missing importance on async <script> has no effect');
+
+      t.done();
+    }));
+  }, 'importance attribute on async <script>s fetched by the ' +
+     'preload scanner takes the correct effect on resource load priority');
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion-expected.txt b/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion-expected.txt
new file mode 100644
index 0000000..9558182
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion-expected.txt
@@ -0,0 +1,13 @@
+This is a testharness.js-based test.
+PASS high importance on dynamically-inserted <script>s translates to kHigh resource load priority
+PASS low importance on dynamically-inserted <script>s has no effect on resource load priority
+PASS auto importance on dynamically-inserted <script>s has no effect on resource load priority
+PASS invalid importance on dynamically-inserted <script>s has no effect on resource load priority
+PASS missing importance on dynamically-inserted <script>s has no effect on resource load priority
+PASS high importance on dynamically-inserted module <script>s has no effect on resource load priority
+FAIL low importance on dynamically-inserted module <script>s translates to kLow resource load priority assert_equals: expected 3 but got 1
+PASS auto importance on dynamically-inserted module <script>s has no effect on resource load priority
+PASS invalid importance on dynamically-inserted module <script>s has no effect on resource load priority
+PASS missing importance on module dynamica-inserted <script>s has no effect on resource load priority
+Harness: the test ran to completion.
+
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion.html b/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion.html
new file mode 100644
index 0000000..0ef68d5
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-dynamic-insertion.html
@@ -0,0 +1,37 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<script>
+  const tests = [
+    // Dynamically-inserted <script> tests.
+    {test: async_test('high importance on dynamically-inserted <script>s translates to kHigh resource load priority'), importance: 'high', expected_priority: kHigh},
+    {test: async_test('low importance on dynamically-inserted <script>s has no effect on resource load priority'), importance: 'low', expected_priority: kLow},
+    {test: async_test('auto importance on dynamically-inserted <script>s has no effect on resource load priority'), importance: 'auto', expected_priority: kLow},
+    {test: async_test('invalid importance on dynamically-inserted <script>s has no effect on resource load priority'), importance: 'xyz', expected_priority: kLow},
+    {test: async_test('missing importance on dynamically-inserted <script>s has no effect on resource load priority'), expected_priority: kLow},
+
+    // Dynamically-inserted <script type=module> tests.
+    {test: async_test('high importance on dynamically-inserted module <script>s has no effect on resource load priority'),
+     importance: 'high', module: true, expected_priority: kHigh},
+    {test: async_test('low importance on dynamically-inserted module <script>s translates to kLow resource load priority'),
+     importance: 'low', module: true, expected_priority: kLow},
+    {test: async_test('auto importance on dynamically-inserted module <script>s has no effect on resource load priority'),
+     importance: 'auto', module: true, expected_priority: kHigh},
+    {test: async_test('invalid importance on dynamically-inserted module <script>s has no effect on resource load priority'),
+     importance: 'xyz', module: true, expected_priority: kHigh},
+    {test: async_test('missing importance on module dynamica-inserted <script>s has no effect on resource load priority'),
+     expected_priority: kLow}
+
+  ];
+
+  let iteration = 0;
+  for (const test of tests) {
+    const script = document.createElement('script');
+    if (test.importance) script.importance = test.importance;
+    if (test.module) script.type = "module";
+    script.src = `../resources/dummy.js?${iteration++}`;
+    script.onload = assert_priority_onload(script.src, test.expected_priority, test.test);
+    document.head.appendChild(script);
+  }
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-element-use-counter.html b/third_party/blink/web_tests/http/tests/priority-hints/script-element-use-counter.html
new file mode 100644
index 0000000..dc309334
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-element-use-counter.html
@@ -0,0 +1,50 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<script>
+  test(t => {
+    t.add_cleanup(clearUseCounter);
+    assert_false(internals.isUseCounted(document, kPriorityHints),
+                 'Priority Hints is not use-counted before the importance ' +
+                 'IDL attribute is set');
+    const script = document.createElement('script');
+    script.importance = 'high';
+    assert_true(internals.isUseCounted(document, kPriorityHints),
+                'Priority Hints is use-counted once the importance IDL ' +
+                'attribute is set');
+  }, 'Priority Hints use-counter works properly with the <script> importance ' +
+     'IDL attribute');
+
+  test(t => {
+    t.add_cleanup(clearUseCounter);
+    assert_false(internals.isUseCounted(document, kPriorityHints),
+                 'Priority Hints is not use-counted before the importance ' +
+                 'content attribute is set');
+    const script = document.createElement('script');
+    script.setAttribute('importance', 'high');
+    assert_true(internals.isUseCounted(document, kPriorityHints),
+                'Priority Hints is use-counted once the importance content ' +
+                'attribute is set');
+  }, 'Priority Hints use-counter works properly with the <script> importance ' +
+     'content attribute');
+
+  const t = async_test('Priority Hints is use-counted when the importance ' +
+                       'content attribute is parsed on the <script> element');
+  t.add_cleanup(clearUseCounter);
+
+  t.step_func(() => {
+    assert_false(internals.isUseCounted(document, kPriorityHints),
+                 'Priority Hints is not use-counted before the importance ' +
+                 'content attribute is parsed');
+  });
+
+  window.addEventListener('DOMContentLoaded', t.step_func_done(() => {
+
+    document.head.innerHTML += "<script src=../resources/dummy.js " +
+                               "importance=high><" + "/script>";
+    assert_true(internals.isUseCounted(document, kPriorityHints),
+                'Priority Hints is use-counted once the importance content ' +
+                'attribute is parsed');
+  }));
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-initial-load.html b/third_party/blink/web_tests/http/tests/priority-hints/script-initial-load.html
new file mode 100644
index 0000000..b32c15be
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-initial-load.html
@@ -0,0 +1,36 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<script id=script1 importance=high src=../resources/dummy.js></script>
+<script id=script2 importance=low src=../resources/dummy.js?1></script>
+<script id=script3 importance=auto src=../resources/dummy.js?2></script>
+<script id=script4 importance=xyz src=../resources/dummy.js?3></script>
+<script id=script5 src=../resources/dummy.js?4></script>
+
+<script>
+  async_test(t => {
+    addEventListener('DOMContentLoaded', t.step_func(() => {
+      const msg = 'all scripts were fetched by the preload scanner';
+      assert_true(internals.isPreloaded(script1.src), msg);
+      assert_true(internals.isPreloaded(script2.src), msg);
+      assert_true(internals.isPreloaded(script3.src), msg);
+      assert_true(internals.isPreloaded(script4.src), msg);
+      assert_true(internals.isPreloaded(script5.src), msg);
+
+      assert_equals(getPriority(script1.src), kHigh,
+                    'high importance on <script> has no effect');
+      assert_equals(getPriority(script2.src), kHigh,
+                    'low importance on <script> has no effect');
+      assert_equals(getPriority(script3.src), kHigh,
+                    'auto importance on <script> has no effect');
+      assert_equals(getPriority(script4.src), kHigh,
+                    'invalid importance on <script> has no effect');
+      assert_equals(getPriority(script5.src), kHigh,
+                    'missing importance on <script> has no effect');
+
+      t.done();
+    }));
+  }, 'importance attribute on non-{async, module} <script>s fetched by the ' +
+     'preload scanner has no effect on resource load priority');
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load-expected.txt b/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load-expected.txt
new file mode 100644
index 0000000..43fb413
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL importance attribute on module <script>s fetched by the preload scanner takes the correct effect on resource load priority assert_equals: low importance on module <script> lowers the priority to kLow expected 1 but got 3
+Harness: the test ran to completion.
+
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load.html b/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load.html
new file mode 100644
index 0000000..b447615
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-module-initial-load.html
@@ -0,0 +1,36 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<script id=script1 type=module importance=high src=../resources/dummy.js></script>
+<script id=script2 type=module importance=low src=../resources/dummy.js?1></script>
+<script id=script3 type=module importance=auto src=../resources/dummy.js?2></script>
+<script id=script4 type=module importance=xyz src=../resources/dummy.js?3></script>
+<script id=script5 type=module src=../resources/dummy.js?4></script>
+
+<script>
+  async_test(t => {
+    addEventListener('DOMContentLoaded', t.step_func(() => {
+      const msg = 'all scripts were fetched by the preload scanner';
+      assert_true(internals.isPreloaded(script1.src), msg);
+      assert_true(internals.isPreloaded(script2.src), msg);
+      assert_true(internals.isPreloaded(script3.src), msg);
+      assert_true(internals.isPreloaded(script4.src), msg);
+      assert_true(internals.isPreloaded(script5.src), msg);
+
+      assert_equals(getPriority(script1.src), kHigh,
+                    'high importance on module <script> has no effect');
+      assert_equals(getPriority(script2.src), kLow,
+                    'low importance on module <script> lowers the priority to kLow');
+      assert_equals(getPriority(script3.src), kHigh,
+                    'auto importance on module <script> has no effect');
+      assert_equals(getPriority(script4.src), kHigh,
+                    'invalid importance on module <script> has no effect');
+      assert_equals(getPriority(script5.src), kHigh,
+                    'missing importance on module <script> has no effect');
+
+      t.done();
+    }));
+  }, 'importance attribute on module <script>s fetched by the ' +
+     'preload scanner takes the correct effect on resource load priority');
+</script>
diff --git a/third_party/blink/web_tests/http/tests/priority-hints/script-preload-scanner-use-counter.html b/third_party/blink/web_tests/http/tests/priority-hints/script-preload-scanner-use-counter.html
new file mode 100644
index 0000000..4ea7597
--- /dev/null
+++ b/third_party/blink/web_tests/http/tests/priority-hints/script-preload-scanner-use-counter.html
@@ -0,0 +1,21 @@
+<script src=resources/common.js></script>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+
+<!-- Note that Priority Hints take no affect on the pending parsing-blocking
+script, as it _must_ be high-prioritized for good user experience -->
+<script id="script" src="../resources/dummy.js" importance="low"></script>
+
+<script>
+  const t = async_test('Priority Hints is use-counted when the importance ' +
+                       'content attribute is parsed on <script>s that are ' +
+                       'fetched by the preload scanner');
+
+  window.onload = t.step_func_done(() => {
+    assert_true(internals.isPreloaded(script.src),
+                'The <script> resource was fetched by the preload scanner');
+    assert_true(internals.isUseCounted(document, kPriorityHints),
+                'Priority Hints is use-counted when the preload scanner ' +
+                'fetches a <script> with an importance attribute');
+  });
+</script>
diff --git a/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
index be76e9c..c150db9 100644
--- a/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
+++ b/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -1248,9 +1248,6 @@
     getter readable
     getter writable
     method constructor
-interface TrustedTypePolicyFactory
-    attribute @@toStringTag
-    method constructor
 interface URL
     attribute @@toStringTag
     getter hash
@@ -3527,7 +3524,6 @@
     attribute console
     attribute globalThis
     attribute internals
-    getter TrustedTypes
     getter clients
     getter cookieStore
     getter onabortpayment
diff --git a/third_party/blink/web_tests/platform/win/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt b/third_party/blink/web_tests/platform/win/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
index 9373e6ef..3236dec 100644
--- a/third_party/blink/web_tests/platform/win/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
+++ b/third_party/blink/web_tests/platform/win/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
@@ -74,28 +74,8 @@
     static method getService
     attribute @@toStringTag
     method constructor
-interface MediaMetadata
-    attribute @@toStringTag
-    getter album
-    getter artist
-    getter artwork
-    getter title
-    method constructor
-    setter album
-    setter artist
-    setter artwork
-    setter title
-interface MediaSession
-    attribute @@toStringTag
-    getter metadata
-    getter playbackState
-    method constructor
-    method setActionHandler
-    setter metadata
-    setter playbackState
 interface Navigator
     getter bluetooth
-    getter mediaSession
 interface Notification : EventTarget
     getter image
 [GLOBAL OBJECT]
diff --git a/third_party/blink/web_tests/platform/win7/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt b/third_party/blink/web_tests/platform/win7/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
index c1bad6e..4a6572b 100644
--- a/third_party/blink/web_tests/platform/win7/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
+++ b/third_party/blink/web_tests/platform/win7/virtual/stable/webexposed/global-interface-listing-platform-specific-expected.txt
@@ -3,27 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 [INTERFACES]
-interface MediaMetadata
-    attribute @@toStringTag
-    getter album
-    getter artist
-    getter artwork
-    getter title
-    method constructor
-    setter album
-    setter artist
-    setter artwork
-    setter title
-interface MediaSession
-    attribute @@toStringTag
-    getter metadata
-    getter playbackState
-    method constructor
-    method setActionHandler
-    setter metadata
-    setter playbackState
 interface Navigator
-    getter mediaSession
 interface Notification : EventTarget
     getter image
 [GLOBAL OBJECT]
diff --git a/third_party/blink/web_tests/resources/global-interface-listing.js b/third_party/blink/web_tests/resources/global-interface-listing.js
index 9e70727..7d05d90 100644
--- a/third_party/blink/web_tests/resources/global-interface-listing.js
+++ b/third_party/blink/web_tests/resources/global-interface-listing.js
@@ -110,8 +110,6 @@
     'BluetoothRemoteGATTServer',
     'BluetoothRemoteGATTService',
     'BluetoothUUID',
-    'MediaMetadata',
-    'MediaSession',
 ]);
 
 // List of all platform-specific properties on interfaces that appear on all
@@ -120,7 +118,6 @@
 var platformSpecificProperties = {
     Navigator: new Set([
         'getter bluetooth',
-        'getter mediaSession',
     ]),
     Notification: new Set([
         'getter image',
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/feature-policy-features-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/feature-policy-features-expected.txt
new file mode 100644
index 0000000..ec58930
--- /dev/null
+++ b/third_party/blink/web_tests/virtual/stable/webexposed/feature-policy-features-expected.txt
@@ -0,0 +1,22 @@
+This test documents Blink's web-exposed policy-controlled features.
+All changes to this list should go through Blink's feature review process: http://www.chromium.org/blink#new-features
+
+accelerometer
+ambient-light-sensor
+autoplay
+camera
+encrypted-media
+fullscreen
+geolocation
+gyroscope
+magnetometer
+microphone
+midi
+payment
+picture-in-picture
+speaker
+sync-xhr
+usb
+vr
+wake-lock
+
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
index a8f7842..4af7d3a 100644
--- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
+++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -3828,6 +3828,17 @@
     method item
     method toString
     setter mediaText
+interface MediaMetadata
+    attribute @@toStringTag
+    getter album
+    getter artist
+    getter artwork
+    getter title
+    method constructor
+    setter album
+    setter artist
+    setter artwork
+    setter title
 interface MediaQueryList : EventTarget
     attribute @@toStringTag
     getter matches
@@ -3868,6 +3879,14 @@
     setter onresume
     setter onstart
     setter onstop
+interface MediaSession
+    attribute @@toStringTag
+    getter metadata
+    getter playbackState
+    method constructor
+    method setActionHandler
+    setter metadata
+    setter playbackState
 interface MediaSettingsRange
     attribute @@toStringTag
     getter max
@@ -4090,6 +4109,7 @@
     getter maxTouchPoints
     getter mediaCapabilities
     getter mediaDevices
+    getter mediaSession
     getter mimeTypes
     getter onLine
     getter permissions
@@ -4510,6 +4530,13 @@
     getter startTime
     method constructor
     method toJSON
+interface PerformanceEventTiming : PerformanceEntry
+    attribute @@toStringTag
+    getter cancelable
+    getter processingEnd
+    getter processingStart
+    method constructor
+    method toJSON
 interface PerformanceLongTaskTiming : PerformanceEntry
     attribute @@toStringTag
     getter attribution
diff --git a/third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt b/third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
index 013960f..54c4281f 100644
--- a/third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
+++ b/third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
@@ -901,6 +901,7 @@
     property defer
     property event
     property htmlFor
+    property importance
     property integrity
     property noModule
     property referrerPolicy
diff --git a/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt b/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt
new file mode 100644
index 0000000..544529b0
--- /dev/null
+++ b/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt
@@ -0,0 +1,33 @@
+This test documents Blink's web-exposed policy-controlled features.
+All changes to this list should go through Blink's feature review process: http://www.chromium.org/blink#new-features
+
+accelerometer
+ambient-light-sensor
+autoplay
+camera
+document-domain
+document-write
+encrypted-media
+font-display-late-swap
+fullscreen
+geolocation
+gyroscope
+layout-animations
+lazyload
+legacy-image-formats
+magnetometer
+microphone
+midi
+oversized-images
+payment
+picture-in-picture
+speaker
+sync-script
+sync-xhr
+unoptimized-images
+unsized-media
+usb
+vertical-scroll
+vr
+wake-lock
+
diff --git a/third_party/blink/web_tests/webexposed/feature-policy-features.html b/third_party/blink/web_tests/webexposed/feature-policy-features.html
new file mode 100644
index 0000000..dc19d98
--- /dev/null
+++ b/third_party/blink/web_tests/webexposed/feature-policy-features.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<pre id="output"></pre>
+<script>
+if (window.testRunner) {
+  testRunner.dumpAsText();
+}
+
+function print(text) {
+  output.textContent += text + '\n';
+}
+
+print('This test documents Blink\'s web-exposed policy-controlled features.');
+print('All changes to this list should go through Blink\'s feature review process: http://www.chromium.org/blink#new-features');
+print('');
+for (const feature of document.featurePolicy.features().sort()) {
+  print(feature);
+}
+</script>
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
index 3b8ae23a..557a346 100644
--- a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
+++ b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3624,7 +3624,6 @@
 [Worker]     attribute console
 [Worker]     attribute globalThis
 [Worker]     attribute internals
-[Worker]     getter TrustedTypes
 [Worker]     getter name
 [Worker]     getter onmessage
 [Worker]     getter onmessageerror
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
index c0dbf6e..4baf164 100644
--- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
+++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -3570,6 +3570,7 @@
     getter defer
     getter event
     getter htmlFor
+    getter importance
     getter integrity
     getter noModule
     getter referrerPolicy
@@ -3583,6 +3584,7 @@
     setter defer
     setter event
     setter htmlFor
+    setter importance
     setter integrity
     setter noModule
     setter referrerPolicy
@@ -4454,6 +4456,17 @@
     method item
     method toString
     setter mediaText
+interface MediaMetadata
+    attribute @@toStringTag
+    getter album
+    getter artist
+    getter artwork
+    getter title
+    method constructor
+    setter album
+    setter artist
+    setter artwork
+    setter title
 interface MediaQueryList : EventTarget
     attribute @@toStringTag
     getter matches
@@ -4494,6 +4507,14 @@
     setter onresume
     setter onstart
     setter onstop
+interface MediaSession
+    attribute @@toStringTag
+    getter metadata
+    getter playbackState
+    method constructor
+    method setActionHandler
+    setter metadata
+    setter playbackState
 interface MediaSettingsRange
     attribute @@toStringTag
     getter max
@@ -4779,6 +4800,7 @@
     getter maxTouchPoints
     getter mediaCapabilities
     getter mediaDevices
+    getter mediaSession
     getter mimeTypes
     getter nfc
     getter onLine
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt
index df31611..9165eb1 100644
--- a/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt
+++ b/third_party/blink/web_tests/webexposed/global-interface-listing-platform-specific-expected.txt
@@ -77,28 +77,8 @@
     static method getService
     attribute @@toStringTag
     method constructor
-interface MediaMetadata
-    attribute @@toStringTag
-    getter album
-    getter artist
-    getter artwork
-    getter title
-    method constructor
-    setter album
-    setter artist
-    setter artwork
-    setter title
-interface MediaSession
-    attribute @@toStringTag
-    getter metadata
-    getter playbackState
-    method constructor
-    method setActionHandler
-    setter metadata
-    setter playbackState
 interface Navigator
     getter bluetooth
-    getter mediaSession
 interface Notification : EventTarget
     getter image
 [GLOBAL OBJECT]
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt
index ae6ce81..eab29218 100644
--- a/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt
+++ b/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3486,7 +3486,6 @@
 [Worker]     attribute console
 [Worker]     attribute globalThis
 [Worker]     attribute internals
-[Worker]     getter TrustedTypes
 [Worker]     getter name
 [Worker]     getter onconnect
 [Worker]     method close
diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn
index a78690d..65c1c736 100644
--- a/third_party/libwebp/BUILD.gn
+++ b/third_party/libwebp/BUILD.gn
@@ -150,6 +150,7 @@
     "src/dsp/mips_macro.h",
     "src/dsp/msa_macro.h",
     "src/dsp/neon.h",
+    "src/dsp/quant.h",
     "src/dsp/rescaler.c",
     "src/dsp/rescaler_mips32.c",
     "src/dsp/rescaler_mips_dsp_r2.c",
@@ -252,6 +253,7 @@
   static_library("libwebp_dsp_neon") {
     sources = [
       "src/dsp/alpha_processing_neon.c",
+      "src/dsp/cost_neon.c",
       "src/dsp/dec_neon.c",
       "src/dsp/enc_neon.c",
       "src/dsp/filters_neon.c",
diff --git a/third_party/libwebp/README.chromium b/third_party/libwebp/README.chromium
index 9564aa4..d6dc4fc 100644
--- a/third_party/libwebp/README.chromium
+++ b/third_party/libwebp/README.chromium
@@ -1,14 +1,14 @@
 Name: WebP image encoder/decoder
 Short Name: libwebp
 URL: http://developers.google.com/speed/webp
-Version: v1.0.1
+Version: v1.0.2
 License: BSD
 License File: LICENSE
 Security Critical: Yes
 
 Description:
 Source archive:
-  https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.1.tar.gz
+  https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz
 
 WebP is an image format that does both lossy and lossless compression of
 digital photographic images. WebP consists of a codec based on VP8, that Google
@@ -23,4 +23,4 @@
    (crbug.com/654974)
  * Pulled in fuzzers from OSS-Fuzz
    https://github.com/google/oss-fuzz/tree/master/projects/libwebp
- * cherry-pick 928a75de webp: Fix VP8LBitWriterClone() bug
+ * Revert 9cf9841b libwebp: Unicode command tools on Windows
diff --git a/third_party/libwebp/src/dec/vp8i_dec.h b/third_party/libwebp/src/dec/vp8i_dec.h
index e5e89df5..2d7900aa 100644
--- a/third_party/libwebp/src/dec/vp8i_dec.h
+++ b/third_party/libwebp/src/dec/vp8i_dec.h
@@ -32,7 +32,7 @@
 // version numbers
 #define DEC_MAJ_VERSION 1
 #define DEC_MIN_VERSION 0
-#define DEC_REV_VERSION 1
+#define DEC_REV_VERSION 2
 
 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
 // Constraints are: We need to store one 16x16 block of luma samples (y),
diff --git a/third_party/libwebp/src/demux/demux.c b/third_party/libwebp/src/demux/demux.c
index a69c65b7..d8f7a40a5 100644
--- a/third_party/libwebp/src/demux/demux.c
+++ b/third_party/libwebp/src/demux/demux.c
@@ -25,7 +25,7 @@
 
 #define DMUX_MAJ_VERSION 1
 #define DMUX_MIN_VERSION 0
-#define DMUX_REV_VERSION 1
+#define DMUX_REV_VERSION 2
 
 typedef struct {
   size_t start_;        // start location of the data
diff --git a/third_party/libwebp/src/dsp/cost.c b/third_party/libwebp/src/dsp/cost.c
index 634ccc20..cc681cd 100644
--- a/third_party/libwebp/src/dsp/cost.c
+++ b/third_party/libwebp/src/dsp/cost.c
@@ -377,6 +377,7 @@
 extern void VP8EncDspCostInitMIPS32(void);
 extern void VP8EncDspCostInitMIPSdspR2(void);
 extern void VP8EncDspCostInitSSE2(void);
+extern void VP8EncDspCostInitNEON(void);
 
 WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) {
   VP8GetResidualCost = GetResidualCost_C;
@@ -399,6 +400,11 @@
       VP8EncDspCostInitSSE2();
     }
 #endif
+#if defined(WEBP_USE_NEON)
+    if (VP8GetCPUInfo(kNEON)) {
+      VP8EncDspCostInitNEON();
+    }
+#endif
   }
 }
 
diff --git a/third_party/libwebp/src/dsp/cost_neon.c b/third_party/libwebp/src/dsp/cost_neon.c
new file mode 100644
index 0000000..8cc8ce58
--- /dev/null
+++ b/third_party/libwebp/src/dsp/cost_neon.c
@@ -0,0 +1,122 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the COPYING file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+// -----------------------------------------------------------------------------
+//
+// ARM NEON version of cost functions
+
+#include "src/dsp/dsp.h"
+
+#if defined(WEBP_USE_NEON)
+
+#include "src/dsp/neon.h"
+#include "src/enc/cost_enc.h"
+
+static const uint8_t position[16] = { 1, 2,  3,  4,  5,  6,  7,  8,
+                                      9, 10, 11, 12, 13, 14, 15, 16 };
+
+static void SetResidualCoeffs_NEON(const int16_t* const coeffs,
+                                   VP8Residual* const res) {
+  const int16x8_t minus_one = vdupq_n_s16(-1);
+  const int16x8_t coeffs_0 = vld1q_s16(coeffs);
+  const int16x8_t coeffs_1 = vld1q_s16(coeffs + 8);
+  const uint16x8_t eob_0 = vtstq_s16(coeffs_0, minus_one);
+  const uint16x8_t eob_1 = vtstq_s16(coeffs_1, minus_one);
+  const uint8x16_t eob = vcombine_u8(vqmovn_u16(eob_0), vqmovn_u16(eob_1));
+  const uint8x16_t masked = vandq_u8(eob, vld1q_u8(position));
+
+#ifdef __aarch64__
+  res->last = vmaxvq_u8(masked) - 1;
+#else
+  const uint8x8_t eob_8x8 = vmax_u8(vget_low_u8(masked), vget_high_u8(masked));
+  const uint16x8_t eob_16x8 = vmovl_u8(eob_8x8);
+  const uint16x4_t eob_16x4 =
+      vmax_u16(vget_low_u16(eob_16x8), vget_high_u16(eob_16x8));
+  const uint32x4_t eob_32x4 = vmovl_u16(eob_16x4);
+  uint32x2_t eob_32x2 =
+      vmax_u32(vget_low_u32(eob_32x4), vget_high_u32(eob_32x4));
+  eob_32x2 = vpmax_u32(eob_32x2, eob_32x2);
+
+  vst1_lane_s32(&res->last, vreinterpret_s32_u32(eob_32x2), 0);
+  --res->last;
+#endif  // __aarch64__
+
+  res->coeffs = coeffs;
+}
+
+static int GetResidualCost_NEON(int ctx0, const VP8Residual* const res) {
+  uint8_t levels[16], ctxs[16];
+  uint16_t abs_levels[16];
+  int n = res->first;
+  // should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1
+  const int p0 = res->prob[n][ctx0][0];
+  CostArrayPtr const costs = res->costs;
+  const uint16_t* t = costs[n][ctx0];
+  // bit_cost(1, p0) is already incorporated in t[] tables, but only if ctx != 0
+  // (as required by the syntax). For ctx0 == 0, we need to add it here or it'll
+  // be missing during the loop.
+  int cost = (ctx0 == 0) ? VP8BitCost(1, p0) : 0;
+
+  if (res->last < 0) {
+    return VP8BitCost(0, p0);
+  }
+
+  {   // precompute clamped levels and contexts, packed to 8b.
+    const uint8x16_t kCst2 = vdupq_n_u8(2);
+    const uint8x16_t kCst67 = vdupq_n_u8(MAX_VARIABLE_LEVEL);
+    const int16x8_t c0 = vld1q_s16(res->coeffs);
+    const int16x8_t c1 = vld1q_s16(res->coeffs + 8);
+    const uint16x8_t E0 = vreinterpretq_u16_s16(vabsq_s16(c0));
+    const uint16x8_t E1 = vreinterpretq_u16_s16(vabsq_s16(c1));
+    const uint8x16_t F = vcombine_u8(vqmovn_u16(E0), vqmovn_u16(E1));
+    const uint8x16_t G = vminq_u8(F, kCst2);   // context = 0,1,2
+    const uint8x16_t H = vminq_u8(F, kCst67);  // clamp_level in [0..67]
+
+    vst1q_u8(ctxs, G);
+    vst1q_u8(levels, H);
+
+    vst1q_u16(abs_levels, E0);
+    vst1q_u16(abs_levels + 8, E1);
+  }
+  for (; n < res->last; ++n) {
+    const int ctx = ctxs[n];
+    const int level = levels[n];
+    const int flevel = abs_levels[n];   // full level
+    cost += VP8LevelFixedCosts[flevel] + t[level];  // simplified VP8LevelCost()
+    t = costs[n + 1][ctx];
+  }
+  // Last coefficient is always non-zero
+  {
+    const int level = levels[n];
+    const int flevel = abs_levels[n];
+    assert(flevel != 0);
+    cost += VP8LevelFixedCosts[flevel] + t[level];
+    if (n < 15) {
+      const int b = VP8EncBands[n + 1];
+      const int ctx = ctxs[n];
+      const int last_p0 = res->prob[b][ctx][0];
+      cost += VP8BitCost(0, last_p0);
+    }
+  }
+  return cost;
+}
+
+//------------------------------------------------------------------------------
+// Entry point
+
+extern void VP8EncDspCostInitNEON(void);
+
+WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitNEON(void) {
+  VP8SetResidualCoeffs = SetResidualCoeffs_NEON;
+  VP8GetResidualCost = GetResidualCost_NEON;
+}
+
+#else  // !WEBP_USE_NEON
+
+WEBP_DSP_INIT_STUB(VP8EncDspCostInitNEON)
+
+#endif  // WEBP_USE_NEON
diff --git a/third_party/libwebp/src/dsp/quant.h b/third_party/libwebp/src/dsp/quant.h
new file mode 100644
index 0000000..5ba6f9c3
--- /dev/null
+++ b/third_party/libwebp/src/dsp/quant.h
@@ -0,0 +1,70 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the COPYING file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+// -----------------------------------------------------------------------------
+
+#ifndef WEBP_DSP_QUANT_H_
+#define WEBP_DSP_QUANT_H_
+
+#include "src/dsp/dsp.h"
+#include "src/webp/types.h"
+
+#if defined(WEBP_USE_NEON) && !defined(WEBP_ANDROID_NEON) && \
+    !defined(WEBP_HAVE_NEON_RTCD)
+#include <arm_neon.h>
+
+#define IsFlat IsFlat_NEON
+
+static uint32x2_t horizontal_add_uint32x4(const uint32x4_t a) {
+  const uint64x2_t b = vpaddlq_u32(a);
+  return vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
+                  vreinterpret_u32_u64(vget_high_u64(b)));
+}
+
+static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
+                              int thresh) {
+  const int16x8_t tst_ones = vdupq_n_s16(-1);
+  uint32x4_t sum = vdupq_n_u32(0);
+
+  for (int i = 0; i < num_blocks; ++i) {
+    // Set DC to zero.
+    const int16x8_t a_0 = vsetq_lane_s16(0, vld1q_s16(levels), 0);
+    const int16x8_t a_1 = vld1q_s16(levels + 8);
+
+    const uint16x8_t b_0 = vshrq_n_u16(vtstq_s16(a_0, tst_ones), 15);
+    const uint16x8_t b_1 = vshrq_n_u16(vtstq_s16(a_1, tst_ones), 15);
+
+    sum = vpadalq_u16(sum, b_0);
+    sum = vpadalq_u16(sum, b_1);
+
+    levels += 16;
+  }
+  return thresh >= (int32_t)vget_lane_u32(horizontal_add_uint32x4(sum), 0);
+}
+
+#else
+
+#define IsFlat IsFlat_C
+
+static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
+                              int thresh) {
+  int score = 0;
+  while (num_blocks-- > 0) {      // TODO(skal): refine positional scoring?
+    int i;
+    for (i = 1; i < 16; ++i) {    // omit DC, we're only interested in AC
+      score += (levels[i] != 0);
+      if (score > thresh) return 0;
+    }
+    levels += 16;
+  }
+  return 1;
+}
+
+#endif  // defined(WEBP_USE_NEON) && !defined(WEBP_ANDROID_NEON) &&
+        // !defined(WEBP_HAVE_NEON_RTCD)
+
+#endif  // WEBP_DSP_QUANT_H_
diff --git a/third_party/libwebp/src/enc/histogram_enc.c b/third_party/libwebp/src/enc/histogram_enc.c
index 4e49e0a..8ac6fa8 100644
--- a/third_party/libwebp/src/enc/histogram_enc.c
+++ b/third_party/libwebp/src/enc/histogram_enc.c
@@ -165,7 +165,7 @@
 void VP8LHistogramSetClear(VP8LHistogramSet* const set) {
   int i;
   const int cache_bits = set->histograms[0]->palette_code_bits_;
-  const int size = set->size;
+  const int size = set->max_size;
   const size_t total_size = HistogramSetTotalSize(size, cache_bits);
   uint8_t* memory = (uint8_t*)set;
 
@@ -180,6 +180,20 @@
   }
 }
 
+// Removes the histogram 'i' from 'set' by setting it to NULL.
+static void HistogramSetRemoveHistogram(VP8LHistogramSet* const set, int i,
+                                        int* const num_used) {
+  assert(set->histograms[i] != NULL);
+  set->histograms[i] = NULL;
+  --*num_used;
+  // If we remove the last valid one, shrink until the next valid one.
+  if (i == set->size - 1) {
+    while (set->size >= 1 && set->histograms[set->size - 1] == NULL) {
+      --set->size;
+    }
+  }
+}
+
 // -----------------------------------------------------------------------------
 
 void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,
@@ -447,7 +461,9 @@
 static double HistogramAddThresh(const VP8LHistogram* const a,
                                  const VP8LHistogram* const b,
                                  double cost_threshold) {
-  double cost = -a->bit_cost_;
+  double cost;
+  assert(a != NULL && b != NULL);
+  cost = -a->bit_cost_;
   GetCombinedHistogramEntropy(a, b, cost_threshold, &cost);
   return cost;
 }
@@ -561,14 +577,17 @@
 }
 
 // Copies the histograms and computes its bit_cost.
-static void HistogramCopyAndAnalyze(
-    VP8LHistogramSet* const orig_histo, VP8LHistogramSet* const image_histo) {
-  int i;
-  const int histo_size = orig_histo->size;
+static const uint16_t kInvalidHistogramSymbol = (uint16_t)(-1);
+static void HistogramCopyAndAnalyze(VP8LHistogramSet* const orig_histo,
+                                    VP8LHistogramSet* const image_histo,
+                                    int* const num_used,
+                                    uint16_t* const histogram_symbols) {
+  int i, cluster_id;
+  int num_used_orig = *num_used;
   VP8LHistogram** const orig_histograms = orig_histo->histograms;
   VP8LHistogram** const histograms = image_histo->histograms;
-  image_histo->size = 0;
-  for (i = 0; i < histo_size; ++i) {
+  assert(image_histo->max_size == orig_histo->max_size);
+  for (cluster_id = 0, i = 0; i < orig_histo->max_size; ++i) {
     VP8LHistogram* const histo = orig_histograms[i];
     UpdateHistogramCost(histo);
 
@@ -576,10 +595,19 @@
     // with no information (when they are skipped because of LZ77).
     if (!histo->is_used_[0] && !histo->is_used_[1] && !histo->is_used_[2]
         && !histo->is_used_[3] && !histo->is_used_[4]) {
-      continue;
+      // The first histogram is always used. If an histogram is empty, we set
+      // its id to be the same as the previous one: this will improve
+      // compressibility for later LZ77.
+      assert(i > 0);
+      HistogramSetRemoveHistogram(image_histo, i, num_used);
+      HistogramSetRemoveHistogram(orig_histo, i, &num_used_orig);
+      histogram_symbols[i] = kInvalidHistogramSymbol;
+    } else {
+      // Copy histograms from orig_histo[] to image_histo[].
+      HistogramCopy(histo, histograms[i]);
+      histogram_symbols[i] = cluster_id++;
+      assert(cluster_id <= image_histo->max_size);
     }
-    // Copy histograms from orig_histo[] to image_histo[].
-    HistogramCopy(histo, histograms[image_histo->size++]);
   }
 }
 
@@ -596,29 +624,33 @@
 
   // Analyze the dominant (literal, red and blue) entropy costs.
   for (i = 0; i < histo_size; ++i) {
+    if (histograms[i] == NULL) continue;
     UpdateDominantCostRange(histograms[i], &cost_range);
   }
 
   // bin-hash histograms on three of the dominant (literal, red and blue)
   // symbol costs and store the resulting bin_id for each histogram.
   for (i = 0; i < histo_size; ++i) {
+    // bin_map[i] is not set to a special value as its use will later be guarded
+    // by another (histograms[i] == NULL).
+    if (histograms[i] == NULL) continue;
     bin_map[i] = GetHistoBinIndex(histograms[i], &cost_range, low_effort);
   }
 }
 
-// Compact image_histo[] by merging some histograms with same bin_id together if
-// it's advantageous.
+// Merges some histograms with same bin_id together if it's advantageous.
+// Sets the remaining histograms to NULL.
 static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo,
+                                       int *num_used,
+                                       const uint16_t* const clusters,
+                                       uint16_t* const cluster_mappings,
                                        VP8LHistogram* cur_combo,
                                        const uint16_t* const bin_map,
-                                       int bin_map_size, int num_bins,
+                                       int num_bins,
                                        double combine_cost_factor,
                                        int low_effort) {
   VP8LHistogram** const histograms = image_histo->histograms;
   int idx;
-  // Work in-place: processed histograms are put at the beginning of
-  // image_histo[]. At the end, we just have to truncate the array.
-  int size = 0;
   struct {
     int16_t first;    // position of the histogram that accumulates all
                       // histograms with the same bin_id
@@ -631,16 +663,19 @@
     bin_info[idx].num_combine_failures = 0;
   }
 
-  for (idx = 0; idx < bin_map_size; ++idx) {
-    const int bin_id = bin_map[idx];
-    const int first = bin_info[bin_id].first;
-    assert(size <= idx);
+  // By default, a cluster matches itself.
+  for (idx = 0; idx < *num_used; ++idx) cluster_mappings[idx] = idx;
+  for (idx = 0; idx < image_histo->size; ++idx) {
+    int bin_id, first;
+    if (histograms[idx] == NULL) continue;
+    bin_id = bin_map[idx];
+    first = bin_info[bin_id].first;
     if (first == -1) {
-      // just move histogram #idx to its final position
-      histograms[size] = histograms[idx];
-      bin_info[bin_id].first = size++;
+      bin_info[bin_id].first = idx;
     } else if (low_effort) {
       HistogramAdd(histograms[idx], histograms[first], histograms[first]);
+      HistogramSetRemoveHistogram(image_histo, idx, num_used);
+      cluster_mappings[clusters[idx]] = clusters[first];
     } else {
       // try to merge #idx into #first (both share the same bin_id)
       const double bit_cost = histograms[idx]->bit_cost_;
@@ -663,19 +698,18 @@
             bin_info[bin_id].num_combine_failures >= max_combine_failures) {
           // move the (better) merged histogram to its final slot
           HistogramSwap(&cur_combo, &histograms[first]);
+          HistogramSetRemoveHistogram(image_histo, idx, num_used);
+          cluster_mappings[clusters[idx]] = clusters[first];
         } else {
-          histograms[size++] = histograms[idx];
           ++bin_info[bin_id].num_combine_failures;
         }
-      } else {
-        histograms[size++] = histograms[idx];
       }
     }
   }
-  image_histo->size = size;
   if (low_effort) {
     // for low_effort case, update the final cost when everything is merged
-    for (idx = 0; idx < size; ++idx) {
+    for (idx = 0; idx < image_histo->size; ++idx) {
+      if (histograms[idx] == NULL) continue;
       UpdateHistogramCost(histograms[idx]);
     }
   }
@@ -706,16 +740,9 @@
   int max_size;
 } HistoQueue;
 
-static int HistoQueueInit(HistoQueue* const histo_queue, const int max_index) {
+static int HistoQueueInit(HistoQueue* const histo_queue, const int max_size) {
   histo_queue->size = 0;
-  // max_index^2 for the queue size is safe. If you look at
-  // HistogramCombineGreedy, and imagine that UpdateQueueFront always pushes
-  // data to the queue, you insert at most:
-  // - max_index*(max_index-1)/2 (the first two for loops)
-  // - max_index - 1 in the last for loop at the first iteration of the while
-  //   loop, max_index - 2 at the second iteration ... therefore
-  //   max_index*(max_index-1)/2 overall too
-  histo_queue->max_size = max_index * max_index;
+  histo_queue->max_size = max_size;
   // We allocate max_size + 1 because the last element at index "size" is
   // used as temporary data (and it could be up to max_size).
   histo_queue->queue = (HistogramPair*)WebPSafeMalloc(
@@ -778,6 +805,8 @@
   const VP8LHistogram* h2;
   HistogramPair pair;
 
+  // Stop here if the queue is full.
+  if (histo_queue->size == histo_queue->max_size) return 0.;
   assert(threshold <= 0.);
   if (idx1 > idx2) {
     const int tmp = idx2;
@@ -794,8 +823,6 @@
   // Do not even consider the pair if it does not improve the entropy.
   if (pair.cost_diff >= threshold) return 0.;
 
-  // We cannot add more elements than the capacity.
-  assert(histo_queue->size < histo_queue->max_size);
   histo_queue->queue[histo_queue->size++] = pair;
   HistoQueueUpdateHead(histo_queue, &histo_queue->queue[histo_queue->size - 1]);
 
@@ -806,42 +833,43 @@
 
 // Combines histograms by continuously choosing the one with the highest cost
 // reduction.
-static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) {
+static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo,
+                                  int* const num_used) {
   int ok = 0;
-  int image_histo_size = image_histo->size;
+  const int image_histo_size = image_histo->size;
   int i, j;
   VP8LHistogram** const histograms = image_histo->histograms;
-  // Indexes of remaining histograms.
-  int* const clusters =
-      (int*)WebPSafeMalloc(image_histo_size, sizeof(*clusters));
   // Priority queue of histogram pairs.
   HistoQueue histo_queue;
 
-  if (!HistoQueueInit(&histo_queue, image_histo_size) || clusters == NULL) {
+  // image_histo_size^2 for the queue size is safe. If you look at
+  // HistogramCombineGreedy, and imagine that UpdateQueueFront always pushes
+  // data to the queue, you insert at most:
+  // - image_histo_size*(image_histo_size-1)/2 (the first two for loops)
+  // - image_histo_size - 1 in the last for loop at the first iteration of
+  //   the while loop, image_histo_size - 2 at the second iteration ...
+  //   therefore image_histo_size*(image_histo_size-1)/2 overall too
+  if (!HistoQueueInit(&histo_queue, image_histo_size * image_histo_size)) {
     goto End;
   }
 
   for (i = 0; i < image_histo_size; ++i) {
-    // Initialize clusters indexes.
-    clusters[i] = i;
+    if (image_histo->histograms[i] == NULL) continue;
     for (j = i + 1; j < image_histo_size; ++j) {
-      // Initialize positions array.
+      // Initialize queue.
+      if (image_histo->histograms[j] == NULL) continue;
       HistoQueuePush(&histo_queue, histograms, i, j, 0.);
     }
   }
 
-  while (image_histo_size > 1 && histo_queue.size > 0) {
+  while (histo_queue.size > 0) {
     const int idx1 = histo_queue.queue[0].idx1;
     const int idx2 = histo_queue.queue[0].idx2;
     HistogramAdd(histograms[idx2], histograms[idx1], histograms[idx1]);
     histograms[idx1]->bit_cost_ = histo_queue.queue[0].cost_combo;
+
     // Remove merged histogram.
-    for (i = 0; i + 1 < image_histo_size; ++i) {
-      if (clusters[i] >= idx2) {
-        clusters[i] = clusters[i + 1];
-      }
-    }
-    --image_histo_size;
+    HistogramSetRemoveHistogram(image_histo, idx2, num_used);
 
     // Remove pairs intersecting the just combined best pair.
     for (i = 0; i < histo_queue.size;) {
@@ -856,24 +884,15 @@
     }
 
     // Push new pairs formed with combined histogram to the queue.
-    for (i = 0; i < image_histo_size; ++i) {
-      if (clusters[i] != idx1) {
-        HistoQueuePush(&histo_queue, histograms, idx1, clusters[i], 0.);
-      }
-    }
-  }
-  // Move remaining histograms to the beginning of the array.
-  for (i = 0; i < image_histo_size; ++i) {
-    if (i != clusters[i]) {  // swap the two histograms
-      HistogramSwap(&histograms[i], &histograms[clusters[i]]);
+    for (i = 0; i < image_histo->size; ++i) {
+      if (i == idx1 || image_histo->histograms[i] == NULL) continue;
+      HistoQueuePush(&histo_queue, image_histo->histograms, idx1, i, 0.);
     }
   }
 
-  image_histo->size = image_histo_size;
   ok = 1;
 
  End:
-  WebPSafeFree(clusters);
   HistoQueueClear(&histo_queue);
   return ok;
 }
@@ -881,47 +900,69 @@
 // Perform histogram aggregation using a stochastic approach.
 // 'do_greedy' is set to 1 if a greedy approach needs to be performed
 // afterwards, 0 otherwise.
+static int PairComparison(const void* idx1, const void* idx2) {
+  // To be used with bsearch: <0 when *idx1<*idx2, >0 if >, 0 when ==.
+  return (*(int*) idx1 - *(int*) idx2);
+}
 static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo,
-                                      int min_cluster_size,
+                                      int* const num_used, int min_cluster_size,
                                       int* const do_greedy) {
-  int iter;
+  int j, iter;
   uint32_t seed = 1;
   int tries_with_no_success = 0;
-  int image_histo_size = image_histo->size;
-  const int outer_iters = image_histo_size;
+  const int outer_iters = *num_used;
   const int num_tries_no_success = outer_iters / 2;
   VP8LHistogram** const histograms = image_histo->histograms;
-  // Priority queue of histogram pairs. Its size of "kCostHeapSizeSqrt"^2
+  // Priority queue of histogram pairs. Its size of 'kHistoQueueSize'
   // impacts the quality of the compression and the speed: the smaller the
   // faster but the worse for the compression.
   HistoQueue histo_queue;
-  const int kHistoQueueSizeSqrt = 3;
+  const int kHistoQueueSize = 9;
   int ok = 0;
+  // mapping from an index in image_histo with no NULL histogram to the full
+  // blown image_histo.
+  int* mappings;
 
-  if (!HistoQueueInit(&histo_queue, kHistoQueueSizeSqrt)) {
+  if (*num_used < min_cluster_size) {
+    *do_greedy = 1;
+    return 1;
+  }
+
+  mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings));
+  if (mappings == NULL || !HistoQueueInit(&histo_queue, kHistoQueueSize)) {
     goto End;
   }
+  // Fill the initial mapping.
+  for (j = 0, iter = 0; iter < image_histo->size; ++iter) {
+    if (histograms[iter] == NULL) continue;
+    mappings[j++] = iter;
+  }
+  assert(j == *num_used);
+
   // Collapse similar histograms in 'image_histo'.
-  ++min_cluster_size;
-  for (iter = 0; iter < outer_iters && image_histo_size >= min_cluster_size &&
-                 ++tries_with_no_success < num_tries_no_success;
+  for (iter = 0;
+       iter < outer_iters && *num_used >= min_cluster_size &&
+           ++tries_with_no_success < num_tries_no_success;
        ++iter) {
+    int* mapping_index;
     double best_cost =
         (histo_queue.size == 0) ? 0. : histo_queue.queue[0].cost_diff;
     int best_idx1 = -1, best_idx2 = 1;
-    int j;
-    const uint32_t rand_range = (image_histo_size - 1) * image_histo_size;
-    // image_histo_size / 2 was chosen empirically. Less means faster but worse
+    const uint32_t rand_range = (*num_used - 1) * (*num_used);
+    // (*num_used) / 2 was chosen empirically. Less means faster but worse
     // compression.
-    const int num_tries = image_histo_size / 2;
+    const int num_tries = (*num_used) / 2;
 
-    for (j = 0; j < num_tries; ++j) {
+    // Pick random samples.
+    for (j = 0; *num_used >= 2 && j < num_tries; ++j) {
       double curr_cost;
       // Choose two different histograms at random and try to combine them.
       const uint32_t tmp = MyRand(&seed) % rand_range;
-      const uint32_t idx1 = tmp / (image_histo_size - 1);
-      uint32_t idx2 = tmp % (image_histo_size - 1);
+      uint32_t idx1 = tmp / (*num_used - 1);
+      uint32_t idx2 = tmp % (*num_used - 1);
       if (idx2 >= idx1) ++idx2;
+      idx1 = mappings[idx1];
+      idx2 = mappings[idx2];
 
       // Calculate cost reduction on combination.
       curr_cost =
@@ -934,18 +975,21 @@
     }
     if (histo_queue.size == 0) continue;
 
-    // Merge the two best histograms.
+    // Get the best histograms.
     best_idx1 = histo_queue.queue[0].idx1;
     best_idx2 = histo_queue.queue[0].idx2;
     assert(best_idx1 < best_idx2);
-    HistogramAddEval(histograms[best_idx1], histograms[best_idx2],
-                     histograms[best_idx1], 0);
-    // Swap the best_idx2 histogram with the last one (which is now unused).
-    --image_histo_size;
-    if (best_idx2 != image_histo_size) {
-      HistogramSwap(&histograms[image_histo_size], &histograms[best_idx2]);
-    }
-    histograms[image_histo_size] = NULL;
+    // Pop best_idx2 from mappings.
+    mapping_index = (int*) bsearch(&best_idx2, mappings, *num_used,
+                                   sizeof(best_idx2), &PairComparison);
+    assert(mapping_index != NULL);
+    memmove(mapping_index, mapping_index + 1, sizeof(*mapping_index) *
+        ((*num_used) - (mapping_index - mappings) - 1));
+    // Merge the histograms and remove best_idx2 from the queue.
+    HistogramAdd(histograms[best_idx2], histograms[best_idx1],
+                 histograms[best_idx1]);
+    histograms[best_idx1]->bit_cost_ = histo_queue.queue[0].cost_combo;
+    HistogramSetRemoveHistogram(image_histo, best_idx2, num_used);
     // Parse the queue and update each pair that deals with best_idx1,
     // best_idx2 or image_histo_size.
     for (j = 0; j < histo_queue.size;) {
@@ -968,12 +1012,6 @@
         p->idx2 = best_idx1;
         do_eval = 1;
       }
-      if (p->idx2 == image_histo_size) {
-        // No need to re-evaluate here as it does not involve a pair
-        // containing best_idx1 or best_idx2.
-        p->idx2 = best_idx2;
-      }
-      assert(p->idx2 < image_histo_size);
       // Make sure the index order is respected.
       if (p->idx1 > p->idx2) {
         const int tmp = p->idx2;
@@ -991,15 +1029,14 @@
       HistoQueueUpdateHead(&histo_queue, p);
       ++j;
     }
-
     tries_with_no_success = 0;
   }
-  image_histo->size = image_histo_size;
-  *do_greedy = (image_histo->size <= min_cluster_size);
+  *do_greedy = (*num_used <= min_cluster_size);
   ok = 1;
 
 End:
   HistoQueueClear(&histo_queue);
+  WebPSafeFree(mappings);
   return ok;
 }
 
@@ -1007,23 +1044,29 @@
 // Histogram refinement
 
 // Find the best 'out' histogram for each of the 'in' histograms.
+// At call-time, 'out' contains the histograms of the clusters.
 // Note: we assume that out[]->bit_cost_ is already up-to-date.
 static void HistogramRemap(const VP8LHistogramSet* const in,
-                           const VP8LHistogramSet* const out,
+                           VP8LHistogramSet* const out,
                            uint16_t* const symbols) {
   int i;
   VP8LHistogram** const in_histo = in->histograms;
   VP8LHistogram** const out_histo = out->histograms;
-  const int in_size = in->size;
+  const int in_size = out->max_size;
   const int out_size = out->size;
   if (out_size > 1) {
     for (i = 0; i < in_size; ++i) {
       int best_out = 0;
       double best_bits = MAX_COST;
       int k;
+      if (in_histo[i] == NULL) {
+        // Arbitrarily set to the previous value if unused to help future LZ77.
+        symbols[i] = symbols[i - 1];
+        continue;
+      }
       for (k = 0; k < out_size; ++k) {
-        const double cur_bits =
-            HistogramAddThresh(out_histo[k], in_histo[i], best_bits);
+        double cur_bits;
+        cur_bits = HistogramAddThresh(out_histo[k], in_histo[i], best_bits);
         if (k == 0 || cur_bits < best_bits) {
           best_bits = cur_bits;
           best_out = k;
@@ -1039,12 +1082,13 @@
   }
 
   // Recompute each out based on raw and symbols.
-  for (i = 0; i < out_size; ++i) {
-    HistogramClear(out_histo[i]);
-  }
+  VP8LHistogramSetClear(out);
+  out->size = out_size;
 
   for (i = 0; i < in_size; ++i) {
-    const int idx = symbols[i];
+    int idx;
+    if (in_histo[i] == NULL) continue;
+    idx = symbols[i];
     HistogramAdd(in_histo[i], out_histo[idx], out_histo[idx]);
   }
 }
@@ -1060,6 +1104,70 @@
   return combine_cost_factor;
 }
 
+// Given a HistogramSet 'set', the mapping of clusters 'cluster_mapping' and the
+// current assignment of the cells in 'symbols', merge the clusters and
+// assign the smallest possible clusters values.
+static void OptimizeHistogramSymbols(const VP8LHistogramSet* const set,
+                                     uint16_t* const cluster_mappings,
+                                     int num_clusters,
+                                     uint16_t* const cluster_mappings_tmp,
+                                     uint16_t* const symbols) {
+  int i, cluster_max;
+  int do_continue = 1;
+  // First, assign the lowest cluster to each pixel.
+  while (do_continue) {
+    do_continue = 0;
+    for (i = 0; i < num_clusters; ++i) {
+      int k;
+      k = cluster_mappings[i];
+      while (k != cluster_mappings[k]) {
+        cluster_mappings[k] = cluster_mappings[cluster_mappings[k]];
+        k = cluster_mappings[k];
+      }
+      if (k != cluster_mappings[i]) {
+        do_continue = 1;
+        cluster_mappings[i] = k;
+      }
+    }
+  }
+  // Create a mapping from a cluster id to its minimal version.
+  cluster_max = 0;
+  memset(cluster_mappings_tmp, 0,
+         set->max_size * sizeof(*cluster_mappings_tmp));
+  assert(cluster_mappings[0] == 0);
+  // Re-map the ids.
+  for (i = 0; i < set->max_size; ++i) {
+    int cluster;
+    if (symbols[i] == kInvalidHistogramSymbol) continue;
+    cluster = cluster_mappings[symbols[i]];
+    assert(symbols[i] < num_clusters);
+    if (cluster > 0 && cluster_mappings_tmp[cluster] == 0) {
+      ++cluster_max;
+      cluster_mappings_tmp[cluster] = cluster_max;
+    }
+    symbols[i] = cluster_mappings_tmp[cluster];
+  }
+
+  // Make sure all cluster values are used.
+  cluster_max = 0;
+  for (i = 0; i < set->max_size; ++i) {
+    if (symbols[i] == kInvalidHistogramSymbol) continue;
+    if (symbols[i] <= cluster_max) continue;
+    ++cluster_max;
+    assert(symbols[i] == cluster_max);
+  }
+}
+
+static void RemoveEmptyHistograms(VP8LHistogramSet* const image_histo) {
+  uint32_t size;
+  int i;
+  for (i = 0, size = 0; i < image_histo->size; ++i) {
+    if (image_histo->histograms[i] == NULL) continue;
+    image_histo->histograms[size++] = image_histo->histograms[i];
+  }
+  image_histo->size = size;
+}
+
 int VP8LGetHistoImageSymbols(int xsize, int ysize,
                              const VP8LBackwardRefs* const refs,
                              int quality, int low_effort,
@@ -1078,27 +1186,36 @@
   // maximum quality q==100 (to preserve the compression gains at that level).
   const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE;
   int entropy_combine;
-
-  if (orig_histo == NULL) goto Error;
+  uint16_t* const map_tmp =
+      WebPSafeMalloc(2 * image_histo_raw_size, sizeof(map_tmp));
+  uint16_t* const cluster_mappings = map_tmp + image_histo_raw_size;
+  int num_used = image_histo_raw_size;
+  if (orig_histo == NULL || map_tmp == NULL) goto Error;
 
   // Construct the histograms from backward references.
   HistogramBuild(xsize, histo_bits, refs, orig_histo);
   // Copies the histograms and computes its bit_cost.
-  HistogramCopyAndAnalyze(orig_histo, image_histo);
+  // histogram_symbols is optimized
+  HistogramCopyAndAnalyze(orig_histo, image_histo, &num_used,
+                          histogram_symbols);
+
   entropy_combine =
-      (image_histo->size > entropy_combine_num_bins * 2) && (quality < 100);
+      (num_used > entropy_combine_num_bins * 2) && (quality < 100);
+
   if (entropy_combine) {
-    const int bin_map_size = image_histo->size;
-    // Reuse histogram_symbols storage. By definition, it's guaranteed to be ok.
-    uint16_t* const bin_map = histogram_symbols;
+    uint16_t* const bin_map = map_tmp;
     const double combine_cost_factor =
         GetCombineCostFactor(image_histo_raw_size, quality);
+    const uint32_t num_clusters = num_used;
 
     HistogramAnalyzeEntropyBin(image_histo, bin_map, low_effort);
     // Collapse histograms with similar entropy.
-    HistogramCombineEntropyBin(image_histo, tmp_histo, bin_map, bin_map_size,
+    HistogramCombineEntropyBin(image_histo, &num_used, histogram_symbols,
+                               cluster_mappings, tmp_histo, bin_map,
                                entropy_combine_num_bins, combine_cost_factor,
                                low_effort);
+    OptimizeHistogramSymbols(image_histo, cluster_mappings, num_clusters,
+                             map_tmp, histogram_symbols);
   }
 
   // Don't combine the histograms using stochastic and greedy heuristics for
@@ -1108,21 +1225,26 @@
     // cubic ramp between 1 and MAX_HISTO_GREEDY:
     const int threshold_size = (int)(1 + (x * x * x) * (MAX_HISTO_GREEDY - 1));
     int do_greedy;
-    if (!HistogramCombineStochastic(image_histo, threshold_size, &do_greedy)) {
+    if (!HistogramCombineStochastic(image_histo, &num_used, threshold_size,
+                                    &do_greedy)) {
       goto Error;
     }
-    if (do_greedy && !HistogramCombineGreedy(image_histo)) {
-      goto Error;
+    if (do_greedy) {
+      RemoveEmptyHistograms(image_histo);
+      if (!HistogramCombineGreedy(image_histo, &num_used)) {
+        goto Error;
+      }
     }
   }
 
-  // TODO(vrabaud): Optimize HistogramRemap for low-effort compression mode.
   // Find the optimal map from original histograms to the final ones.
+  RemoveEmptyHistograms(image_histo);
   HistogramRemap(orig_histo, image_histo, histogram_symbols);
 
   ok = 1;
 
  Error:
   VP8LFreeHistogramSet(orig_histo);
+  WebPSafeFree(map_tmp);
   return ok;
 }
diff --git a/third_party/libwebp/src/enc/predictor_enc.c b/third_party/libwebp/src/enc/predictor_enc.c
index f3715f5..802e896 100644
--- a/third_party/libwebp/src/enc/predictor_enc.c
+++ b/third_party/libwebp/src/enc/predictor_enc.c
@@ -177,12 +177,15 @@
   }
 }
 
+static WEBP_INLINE uint8_t NearLosslessDiff(uint8_t a, uint8_t b) {
+  return (uint8_t)((((int)(a) - (int)(b))) & 0xff);
+}
+
 // Quantize every component of the difference between the actual pixel value and
 // its prediction to a multiple of a quantization (a power of 2, not larger than
 // max_quantization which is a power of 2, smaller than max_diff). Take care if
 // value and predict have undergone subtract green, which means that red and
 // blue are represented as offsets from green.
-#define NEAR_LOSSLESS_DIFF(a, b) (uint8_t)((((int)(a) - (int)(b))) & 0xff)
 static uint32_t NearLossless(uint32_t value, uint32_t predict,
                              int max_quantization, int max_diff,
                              int used_subtract_green) {
@@ -199,7 +202,7 @@
   }
   if ((value >> 24) == 0 || (value >> 24) == 0xff) {
     // Preserve transparency of fully transparent or fully opaque pixels.
-    a = NEAR_LOSSLESS_DIFF(value >> 24, predict >> 24);
+    a = NearLosslessDiff(value >> 24, predict >> 24);
   } else {
     a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization);
   }
@@ -212,16 +215,15 @@
     // The amount by which green has been adjusted during quantization. It is
     // subtracted from red and blue for compensation, to avoid accumulating two
     // quantization errors in them.
-    green_diff = NEAR_LOSSLESS_DIFF(new_green, value >> 8);
+    green_diff = NearLosslessDiff(new_green, value >> 8);
   }
-  r = NearLosslessComponent(NEAR_LOSSLESS_DIFF(value >> 16, green_diff),
+  r = NearLosslessComponent(NearLosslessDiff(value >> 16, green_diff),
                             (predict >> 16) & 0xff, 0xff - new_green,
                             quantization);
-  b = NearLosslessComponent(NEAR_LOSSLESS_DIFF(value, green_diff),
+  b = NearLosslessComponent(NearLosslessDiff(value, green_diff),
                             predict & 0xff, 0xff - new_green, quantization);
   return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
 }
-#undef NEAR_LOSSLESS_DIFF
 #endif  // (WEBP_NEAR_LOSSLESS == 1)
 
 // Stores the difference between the pixel and its prediction in "out".
diff --git a/third_party/libwebp/src/enc/quant_enc.c b/third_party/libwebp/src/enc/quant_enc.c
index 35bfaf2..03c682e 100644
--- a/third_party/libwebp/src/enc/quant_enc.c
+++ b/third_party/libwebp/src/enc/quant_enc.c
@@ -15,6 +15,7 @@
 #include <math.h>
 #include <stdlib.h>  // for abs()
 
+#include "src/dsp/quant.h"
 #include "src/enc/vp8i_enc.h"
 #include "src/enc/cost_enc.h"
 
@@ -977,19 +978,6 @@
   SwapPtr(&it->yuv_out_, &it->yuv_out2_);
 }
 
-static score_t IsFlat(const int16_t* levels, int num_blocks, score_t thresh) {
-  score_t score = 0;
-  while (num_blocks-- > 0) {      // TODO(skal): refine positional scoring?
-    int i;
-    for (i = 1; i < 16; ++i) {    // omit DC, we're only interested in AC
-      score += (levels[i] != 0);
-      if (score > thresh) return 0;
-    }
-    levels += 16;
-  }
-  return 1;
-}
-
 static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* rd) {
   const int kNumBlocks = 16;
   VP8SegmentInfo* const dqm = &it->enc_->dqm_[it->mb_->segment_];
diff --git a/third_party/libwebp/src/enc/vp8i_enc.h b/third_party/libwebp/src/enc/vp8i_enc.h
index 92439fe..3a1967da 100644
--- a/third_party/libwebp/src/enc/vp8i_enc.h
+++ b/third_party/libwebp/src/enc/vp8i_enc.h
@@ -32,7 +32,7 @@
 // version numbers
 #define ENC_MAJ_VERSION 1
 #define ENC_MIN_VERSION 0
-#define ENC_REV_VERSION 1
+#define ENC_REV_VERSION 2
 
 enum { MAX_LF_LEVELS = 64,       // Maximum loop filter level
        MAX_VARIABLE_LEVEL = 67,  // last (inclusive) level with variable cost
diff --git a/third_party/libwebp/src/enc/vp8l_enc.c b/third_party/libwebp/src/enc/vp8l_enc.c
index 2713edc..2efd403 100644
--- a/third_party/libwebp/src/enc/vp8l_enc.c
+++ b/third_party/libwebp/src/enc/vp8l_enc.c
@@ -462,6 +462,7 @@
   for (i = 0; i < histogram_image_size; ++i) {
     const VP8LHistogram* const histo = histogram_image->histograms[i];
     HuffmanTreeCode* const codes = &huffman_codes[5 * i];
+    assert(histo != NULL);
     for (k = 0; k < 5; ++k) {
       const int num_symbols =
           (k == 0) ? VP8LHistogramNumCodes(histo->palette_code_bits_) :
diff --git a/third_party/libwebp/src/mux/muxi.h b/third_party/libwebp/src/mux/muxi.h
index df9f74c..3e9d8c4 100644
--- a/third_party/libwebp/src/mux/muxi.h
+++ b/third_party/libwebp/src/mux/muxi.h
@@ -29,7 +29,7 @@
 
 #define MUX_MAJ_VERSION 1
 #define MUX_MIN_VERSION 0
-#define MUX_REV_VERSION 1
+#define MUX_REV_VERSION 2
 
 // Chunk object.
 typedef struct WebPChunk WebPChunk;
diff --git a/third_party/libwebp/src/utils/utils.h b/third_party/libwebp/src/utils/utils.h
index da97b5d..c7620f91 100644
--- a/third_party/libwebp/src/utils/utils.h
+++ b/third_party/libwebp/src/utils/utils.h
@@ -107,19 +107,6 @@
   PutLE16(data + 2, (int)(val >> 16));
 }
 
-// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
-// based on table or not. Can be used as fallback if clz() is not available.
-#define WEBP_NEED_LOG_TABLE_8BIT
-extern const uint8_t WebPLogTable8bit[256];
-static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
-  int log_value = 0;
-  while (n >= 256) {
-    log_value += 8;
-    n >>= 8;
-  }
-  return log_value + WebPLogTable8bit[n];
-}
-
 // Returns (int)floor(log2(n)). n must be > 0.
 // use GNU builtins where available.
 #if defined(__GNUC__) && \
@@ -138,6 +125,19 @@
   return first_set_bit;
 }
 #else   // default: use the C-version.
+// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either
+// based on table or not. Can be used as fallback if clz() is not available.
+#define WEBP_NEED_LOG_TABLE_8BIT
+extern const uint8_t WebPLogTable8bit[256];
+static WEBP_INLINE int WebPLog2FloorC(uint32_t n) {
+  int log_value = 0;
+  while (n >= 256) {
+    log_value += 8;
+    n >>= 8;
+  }
+  return log_value + WebPLogTable8bit[n];
+}
+
 static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); }
 #endif
 
diff --git a/third_party/libwebp/src/webp/decode.h b/third_party/libwebp/src/webp/decode.h
index 95d31e76..ae8bfe840 100644
--- a/third_party/libwebp/src/webp/decode.h
+++ b/third_party/libwebp/src/webp/decode.h
@@ -42,6 +42,12 @@
 // This function will also validate the header, returning true on success,
 // false otherwise. '*width' and '*height' are only valid on successful return.
 // Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.
+// Note: The following chunk sequences (before the raw VP8/VP8L data) are
+// considered valid by this function:
+// RIFF + VP8(L)
+// RIFF + VP8X + (optional chunks) + VP8(L)
+// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.
+// VP8(L)     <-- Not a valid WebP format: only allowed for internal purpose.
 WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size,
                             int* width, int* height);
 
@@ -425,6 +431,12 @@
 // Returns VP8_STATUS_OK when the features are successfully retrieved. Returns
 // VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the
 // features from headers. Returns error in other cases.
+// Note: The following chunk sequences (before the raw VP8/VP8L data) are
+// considered valid by this function:
+// RIFF + VP8(L)
+// RIFF + VP8X + (optional chunks) + VP8(L)
+// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.
+// VP8(L)     <-- Not a valid WebP format: only allowed for internal purpose.
 static WEBP_INLINE VP8StatusCode WebPGetFeatures(
     const uint8_t* data, size_t data_size,
     WebPBitstreamFeatures* features) {
diff --git a/third_party/win_build_output/midl/google_update/arm64/google_update_idl.dlldata.c b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.dlldata.c
new file mode 100644
index 0000000..e2d4c4a
--- /dev/null
+++ b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.dlldata.c
@@ -0,0 +1,38 @@
+/*********************************************************

+   DllData file -- generated by MIDL compiler 

+

+        DO NOT ALTER THIS FILE

+

+   This file is regenerated by MIDL on every IDL file compile.

+

+   To completely reconstruct this file, delete it and rerun MIDL

+   on all the IDL files in this DLL, specifying this file for the

+   /dlldata command line option

+

+*********************************************************/

+

+#define PROXY_DELEGATION

+

+#include <rpcproxy.h>

+

+#ifdef __cplusplus

+extern "C"   {

+#endif

+

+EXTERN_PROXY_FILE( google_update_idl )

+

+

+PROXYFILE_LIST_START

+/* Start of list */

+  REFERENCE_PROXY_FILE( google_update_idl ),

+/* End of list */

+PROXYFILE_LIST_END

+

+

+DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )

+

+#ifdef __cplusplus

+}  /*extern "C" */

+#endif

+

+/* end of generated dlldata file */

diff --git a/third_party/win_build_output/midl/google_update/arm64/google_update_idl.h b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.h
new file mode 100644
index 0000000..719f6d6
--- /dev/null
+++ b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.h
@@ -0,0 +1,5578 @@
+

+

+/* this ALWAYS GENERATED file contains the definitions for the interfaces */

+

+

+ /* File created by MIDL compiler version 8.xx.xxxx */

+/* at a redacted point in time

+ */

+/* Compiler settings for ../../google_update/google_update_idl.idl:

+    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=ARM64 8.01.0622 

+    protocol : dce , ms_ext, c_ext, robust

+    error checks: allocation ref bounds_check enum stub_data 

+    VC __declspec() decoration level: 

+         __declspec(uuid()), __declspec(selectany), __declspec(novtable)

+         DECLSPEC_UUID(), MIDL_INTERFACE()

+*/

+/* @@MIDL_FILE_HEADING(  ) */

+

+#pragma warning( disable: 4049 )  /* more than 64k source lines */

+

+

+/* verify that the <rpcndr.h> version is high enough to compile this file*/

+#ifndef __REQUIRED_RPCNDR_H_VERSION__

+#define __REQUIRED_RPCNDR_H_VERSION__ 475

+#endif

+

+#include "rpc.h"

+#include "rpcndr.h"

+

+#ifndef __RPCNDR_H_VERSION__

+#error this stub requires an updated version of <rpcndr.h>

+#endif /* __RPCNDR_H_VERSION__ */

+

+#ifndef COM_NO_WINDOWS_H

+#include "windows.h"

+#include "ole2.h"

+#endif /*COM_NO_WINDOWS_H*/

+

+#ifndef __google_update_idl_h__

+#define __google_update_idl_h__

+

+#if defined(_MSC_VER) && (_MSC_VER >= 1020)

+#pragma once

+#endif

+

+/* Forward Declarations */ 

+

+#ifndef __IGoogleUpdate3_FWD_DEFINED__

+#define __IGoogleUpdate3_FWD_DEFINED__

+typedef interface IGoogleUpdate3 IGoogleUpdate3;

+

+#endif 	/* __IGoogleUpdate3_FWD_DEFINED__ */

+

+

+#ifndef __IAppBundle_FWD_DEFINED__

+#define __IAppBundle_FWD_DEFINED__

+typedef interface IAppBundle IAppBundle;

+

+#endif 	/* __IAppBundle_FWD_DEFINED__ */

+

+

+#ifndef __IApp_FWD_DEFINED__

+#define __IApp_FWD_DEFINED__

+typedef interface IApp IApp;

+

+#endif 	/* __IApp_FWD_DEFINED__ */

+

+

+#ifndef __IApp2_FWD_DEFINED__

+#define __IApp2_FWD_DEFINED__

+typedef interface IApp2 IApp2;

+

+#endif 	/* __IApp2_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommand_FWD_DEFINED__

+#define __IAppCommand_FWD_DEFINED__

+typedef interface IAppCommand IAppCommand;

+

+#endif 	/* __IAppCommand_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommand2_FWD_DEFINED__

+#define __IAppCommand2_FWD_DEFINED__

+typedef interface IAppCommand2 IAppCommand2;

+

+#endif 	/* __IAppCommand2_FWD_DEFINED__ */

+

+

+#ifndef __IAppVersion_FWD_DEFINED__

+#define __IAppVersion_FWD_DEFINED__

+typedef interface IAppVersion IAppVersion;

+

+#endif 	/* __IAppVersion_FWD_DEFINED__ */

+

+

+#ifndef __IPackage_FWD_DEFINED__

+#define __IPackage_FWD_DEFINED__

+typedef interface IPackage IPackage;

+

+#endif 	/* __IPackage_FWD_DEFINED__ */

+

+

+#ifndef __ICurrentState_FWD_DEFINED__

+#define __ICurrentState_FWD_DEFINED__

+typedef interface ICurrentState ICurrentState;

+

+#endif 	/* __ICurrentState_FWD_DEFINED__ */

+

+

+#ifndef __IRegistrationUpdateHook_FWD_DEFINED__

+#define __IRegistrationUpdateHook_FWD_DEFINED__

+typedef interface IRegistrationUpdateHook IRegistrationUpdateHook;

+

+#endif 	/* __IRegistrationUpdateHook_FWD_DEFINED__ */

+

+

+#ifndef __ICredentialDialog_FWD_DEFINED__

+#define __ICredentialDialog_FWD_DEFINED__

+typedef interface ICredentialDialog ICredentialDialog;

+

+#endif 	/* __ICredentialDialog_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3Web_FWD_DEFINED__

+#define __IGoogleUpdate3Web_FWD_DEFINED__

+typedef interface IGoogleUpdate3Web IGoogleUpdate3Web;

+

+#endif 	/* __IGoogleUpdate3Web_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3WebSecurity_FWD_DEFINED__

+#define __IGoogleUpdate3WebSecurity_FWD_DEFINED__

+typedef interface IGoogleUpdate3WebSecurity IGoogleUpdate3WebSecurity;

+

+#endif 	/* __IGoogleUpdate3WebSecurity_FWD_DEFINED__ */

+

+

+#ifndef __IAppBundleWeb_FWD_DEFINED__

+#define __IAppBundleWeb_FWD_DEFINED__

+typedef interface IAppBundleWeb IAppBundleWeb;

+

+#endif 	/* __IAppBundleWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppWeb_FWD_DEFINED__

+#define __IAppWeb_FWD_DEFINED__

+typedef interface IAppWeb IAppWeb;

+

+#endif 	/* __IAppWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommandWeb_FWD_DEFINED__

+#define __IAppCommandWeb_FWD_DEFINED__

+typedef interface IAppCommandWeb IAppCommandWeb;

+

+#endif 	/* __IAppCommandWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppVersionWeb_FWD_DEFINED__

+#define __IAppVersionWeb_FWD_DEFINED__

+typedef interface IAppVersionWeb IAppVersionWeb;

+

+#endif 	/* __IAppVersionWeb_FWD_DEFINED__ */

+

+

+#ifndef __ICoCreateAsyncStatus_FWD_DEFINED__

+#define __ICoCreateAsyncStatus_FWD_DEFINED__

+typedef interface ICoCreateAsyncStatus ICoCreateAsyncStatus;

+

+#endif 	/* __ICoCreateAsyncStatus_FWD_DEFINED__ */

+

+

+#ifndef __ICoCreateAsync_FWD_DEFINED__

+#define __ICoCreateAsync_FWD_DEFINED__

+typedef interface ICoCreateAsync ICoCreateAsync;

+

+#endif 	/* __ICoCreateAsync_FWD_DEFINED__ */

+

+

+#ifndef __IBrowserHttpRequest2_FWD_DEFINED__

+#define __IBrowserHttpRequest2_FWD_DEFINED__

+typedef interface IBrowserHttpRequest2 IBrowserHttpRequest2;

+

+#endif 	/* __IBrowserHttpRequest2_FWD_DEFINED__ */

+

+

+#ifndef __IProcessLauncher_FWD_DEFINED__

+#define __IProcessLauncher_FWD_DEFINED__

+typedef interface IProcessLauncher IProcessLauncher;

+

+#endif 	/* __IProcessLauncher_FWD_DEFINED__ */

+

+

+#ifndef __IProcessLauncher2_FWD_DEFINED__

+#define __IProcessLauncher2_FWD_DEFINED__

+typedef interface IProcessLauncher2 IProcessLauncher2;

+

+#endif 	/* __IProcessLauncher2_FWD_DEFINED__ */

+

+

+#ifndef __IProgressWndEvents_FWD_DEFINED__

+#define __IProgressWndEvents_FWD_DEFINED__

+typedef interface IProgressWndEvents IProgressWndEvents;

+

+#endif 	/* __IProgressWndEvents_FWD_DEFINED__ */

+

+

+#ifndef __IJobObserver_FWD_DEFINED__

+#define __IJobObserver_FWD_DEFINED__

+typedef interface IJobObserver IJobObserver;

+

+#endif 	/* __IJobObserver_FWD_DEFINED__ */

+

+

+#ifndef __IJobObserver2_FWD_DEFINED__

+#define __IJobObserver2_FWD_DEFINED__

+typedef interface IJobObserver2 IJobObserver2;

+

+#endif 	/* __IJobObserver2_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate_FWD_DEFINED__

+#define __IGoogleUpdate_FWD_DEFINED__

+typedef interface IGoogleUpdate IGoogleUpdate;

+

+#endif 	/* __IGoogleUpdate_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdateCore_FWD_DEFINED__

+#define __IGoogleUpdateCore_FWD_DEFINED__

+typedef interface IGoogleUpdateCore IGoogleUpdateCore;

+

+#endif 	/* __IGoogleUpdateCore_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3_FWD_DEFINED__

+#define __IGoogleUpdate3_FWD_DEFINED__

+typedef interface IGoogleUpdate3 IGoogleUpdate3;

+

+#endif 	/* __IGoogleUpdate3_FWD_DEFINED__ */

+

+

+#ifndef __IAppBundle_FWD_DEFINED__

+#define __IAppBundle_FWD_DEFINED__

+typedef interface IAppBundle IAppBundle;

+

+#endif 	/* __IAppBundle_FWD_DEFINED__ */

+

+

+#ifndef __IApp_FWD_DEFINED__

+#define __IApp_FWD_DEFINED__

+typedef interface IApp IApp;

+

+#endif 	/* __IApp_FWD_DEFINED__ */

+

+

+#ifndef __IApp2_FWD_DEFINED__

+#define __IApp2_FWD_DEFINED__

+typedef interface IApp2 IApp2;

+

+#endif 	/* __IApp2_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommand_FWD_DEFINED__

+#define __IAppCommand_FWD_DEFINED__

+typedef interface IAppCommand IAppCommand;

+

+#endif 	/* __IAppCommand_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommand2_FWD_DEFINED__

+#define __IAppCommand2_FWD_DEFINED__

+typedef interface IAppCommand2 IAppCommand2;

+

+#endif 	/* __IAppCommand2_FWD_DEFINED__ */

+

+

+#ifndef __IAppVersion_FWD_DEFINED__

+#define __IAppVersion_FWD_DEFINED__

+typedef interface IAppVersion IAppVersion;

+

+#endif 	/* __IAppVersion_FWD_DEFINED__ */

+

+

+#ifndef __IPackage_FWD_DEFINED__

+#define __IPackage_FWD_DEFINED__

+typedef interface IPackage IPackage;

+

+#endif 	/* __IPackage_FWD_DEFINED__ */

+

+

+#ifndef __ICurrentState_FWD_DEFINED__

+#define __ICurrentState_FWD_DEFINED__

+typedef interface ICurrentState ICurrentState;

+

+#endif 	/* __ICurrentState_FWD_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3Web_FWD_DEFINED__

+#define __IGoogleUpdate3Web_FWD_DEFINED__

+typedef interface IGoogleUpdate3Web IGoogleUpdate3Web;

+

+#endif 	/* __IGoogleUpdate3Web_FWD_DEFINED__ */

+

+

+#ifndef __IAppBundleWeb_FWD_DEFINED__

+#define __IAppBundleWeb_FWD_DEFINED__

+typedef interface IAppBundleWeb IAppBundleWeb;

+

+#endif 	/* __IAppBundleWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppWeb_FWD_DEFINED__

+#define __IAppWeb_FWD_DEFINED__

+typedef interface IAppWeb IAppWeb;

+

+#endif 	/* __IAppWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppCommandWeb_FWD_DEFINED__

+#define __IAppCommandWeb_FWD_DEFINED__

+typedef interface IAppCommandWeb IAppCommandWeb;

+

+#endif 	/* __IAppCommandWeb_FWD_DEFINED__ */

+

+

+#ifndef __IAppVersionWeb_FWD_DEFINED__

+#define __IAppVersionWeb_FWD_DEFINED__

+typedef interface IAppVersionWeb IAppVersionWeb;

+

+#endif 	/* __IAppVersionWeb_FWD_DEFINED__ */

+

+

+#ifndef __ICoCreateAsyncStatus_FWD_DEFINED__

+#define __ICoCreateAsyncStatus_FWD_DEFINED__

+typedef interface ICoCreateAsyncStatus ICoCreateAsyncStatus;

+

+#endif 	/* __ICoCreateAsyncStatus_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3UserClass_FWD_DEFINED__

+#define __GoogleUpdate3UserClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3UserClass GoogleUpdate3UserClass;

+#else

+typedef struct GoogleUpdate3UserClass GoogleUpdate3UserClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3UserClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3ServiceClass_FWD_DEFINED__

+#define __GoogleUpdate3ServiceClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3ServiceClass GoogleUpdate3ServiceClass;

+#else

+typedef struct GoogleUpdate3ServiceClass GoogleUpdate3ServiceClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3ServiceClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3WebUserClass_FWD_DEFINED__

+#define __GoogleUpdate3WebUserClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3WebUserClass GoogleUpdate3WebUserClass;

+#else

+typedef struct GoogleUpdate3WebUserClass GoogleUpdate3WebUserClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3WebUserClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3WebMachineClass_FWD_DEFINED__

+#define __GoogleUpdate3WebMachineClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3WebMachineClass GoogleUpdate3WebMachineClass;

+#else

+typedef struct GoogleUpdate3WebMachineClass GoogleUpdate3WebMachineClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3WebMachineClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3WebServiceClass_FWD_DEFINED__

+#define __GoogleUpdate3WebServiceClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3WebServiceClass GoogleUpdate3WebServiceClass;

+#else

+typedef struct GoogleUpdate3WebServiceClass GoogleUpdate3WebServiceClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3WebServiceClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdate3WebMachineFallbackClass_FWD_DEFINED__

+#define __GoogleUpdate3WebMachineFallbackClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdate3WebMachineFallbackClass GoogleUpdate3WebMachineFallbackClass;

+#else

+typedef struct GoogleUpdate3WebMachineFallbackClass GoogleUpdate3WebMachineFallbackClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdate3WebMachineFallbackClass_FWD_DEFINED__ */

+

+

+#ifndef __CurrentStateUserClass_FWD_DEFINED__

+#define __CurrentStateUserClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class CurrentStateUserClass CurrentStateUserClass;

+#else

+typedef struct CurrentStateUserClass CurrentStateUserClass;

+#endif /* __cplusplus */

+

+#endif 	/* __CurrentStateUserClass_FWD_DEFINED__ */

+

+

+#ifndef __CurrentStateMachineClass_FWD_DEFINED__

+#define __CurrentStateMachineClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class CurrentStateMachineClass CurrentStateMachineClass;

+#else

+typedef struct CurrentStateMachineClass CurrentStateMachineClass;

+#endif /* __cplusplus */

+

+#endif 	/* __CurrentStateMachineClass_FWD_DEFINED__ */

+

+

+#ifndef __CoCreateAsyncClass_FWD_DEFINED__

+#define __CoCreateAsyncClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class CoCreateAsyncClass CoCreateAsyncClass;

+#else

+typedef struct CoCreateAsyncClass CoCreateAsyncClass;

+#endif /* __cplusplus */

+

+#endif 	/* __CoCreateAsyncClass_FWD_DEFINED__ */

+

+

+#ifndef __CredentialDialogUserClass_FWD_DEFINED__

+#define __CredentialDialogUserClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class CredentialDialogUserClass CredentialDialogUserClass;

+#else

+typedef struct CredentialDialogUserClass CredentialDialogUserClass;

+#endif /* __cplusplus */

+

+#endif 	/* __CredentialDialogUserClass_FWD_DEFINED__ */

+

+

+#ifndef __CredentialDialogMachineClass_FWD_DEFINED__

+#define __CredentialDialogMachineClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class CredentialDialogMachineClass CredentialDialogMachineClass;

+#else

+typedef struct CredentialDialogMachineClass CredentialDialogMachineClass;

+#endif /* __cplusplus */

+

+#endif 	/* __CredentialDialogMachineClass_FWD_DEFINED__ */

+

+

+#ifndef __ProcessLauncherClass_FWD_DEFINED__

+#define __ProcessLauncherClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class ProcessLauncherClass ProcessLauncherClass;

+#else

+typedef struct ProcessLauncherClass ProcessLauncherClass;

+#endif /* __cplusplus */

+

+#endif 	/* __ProcessLauncherClass_FWD_DEFINED__ */

+

+

+#ifndef __OnDemandUserAppsClass_FWD_DEFINED__

+#define __OnDemandUserAppsClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class OnDemandUserAppsClass OnDemandUserAppsClass;

+#else

+typedef struct OnDemandUserAppsClass OnDemandUserAppsClass;

+#endif /* __cplusplus */

+

+#endif 	/* __OnDemandUserAppsClass_FWD_DEFINED__ */

+

+

+#ifndef __OnDemandMachineAppsClass_FWD_DEFINED__

+#define __OnDemandMachineAppsClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class OnDemandMachineAppsClass OnDemandMachineAppsClass;

+#else

+typedef struct OnDemandMachineAppsClass OnDemandMachineAppsClass;

+#endif /* __cplusplus */

+

+#endif 	/* __OnDemandMachineAppsClass_FWD_DEFINED__ */

+

+

+#ifndef __OnDemandMachineAppsServiceClass_FWD_DEFINED__

+#define __OnDemandMachineAppsServiceClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class OnDemandMachineAppsServiceClass OnDemandMachineAppsServiceClass;

+#else

+typedef struct OnDemandMachineAppsServiceClass OnDemandMachineAppsServiceClass;

+#endif /* __cplusplus */

+

+#endif 	/* __OnDemandMachineAppsServiceClass_FWD_DEFINED__ */

+

+

+#ifndef __OnDemandMachineAppsFallbackClass_FWD_DEFINED__

+#define __OnDemandMachineAppsFallbackClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class OnDemandMachineAppsFallbackClass OnDemandMachineAppsFallbackClass;

+#else

+typedef struct OnDemandMachineAppsFallbackClass OnDemandMachineAppsFallbackClass;

+#endif /* __cplusplus */

+

+#endif 	/* __OnDemandMachineAppsFallbackClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdateCoreClass_FWD_DEFINED__

+#define __GoogleUpdateCoreClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdateCoreClass GoogleUpdateCoreClass;

+#else

+typedef struct GoogleUpdateCoreClass GoogleUpdateCoreClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdateCoreClass_FWD_DEFINED__ */

+

+

+#ifndef __GoogleUpdateCoreMachineClass_FWD_DEFINED__

+#define __GoogleUpdateCoreMachineClass_FWD_DEFINED__

+

+#ifdef __cplusplus

+typedef class GoogleUpdateCoreMachineClass GoogleUpdateCoreMachineClass;

+#else

+typedef struct GoogleUpdateCoreMachineClass GoogleUpdateCoreMachineClass;

+#endif /* __cplusplus */

+

+#endif 	/* __GoogleUpdateCoreMachineClass_FWD_DEFINED__ */

+

+

+/* header files for imported files */

+#include "oaidl.h"

+#include "ocidl.h"

+

+#ifdef __cplusplus

+extern "C"{

+#endif 

+

+

+/* interface __MIDL_itf_google_update_idl_0000_0000 */

+/* [local] */ 

+

+typedef 

+enum BrowserType

+    {

+        BROWSER_UNKNOWN	= 0,

+        BROWSER_DEFAULT	= 1,

+        BROWSER_INTERNET_EXPLORER	= 2,

+        BROWSER_FIREFOX	= 3,

+        BROWSER_CHROME	= 4

+    } 	BrowserType;

+

+typedef 

+enum CurrentState

+    {

+        STATE_INIT	= 1,

+        STATE_WAITING_TO_CHECK_FOR_UPDATE	= 2,

+        STATE_CHECKING_FOR_UPDATE	= 3,

+        STATE_UPDATE_AVAILABLE	= 4,

+        STATE_WAITING_TO_DOWNLOAD	= 5,

+        STATE_RETRYING_DOWNLOAD	= 6,

+        STATE_DOWNLOADING	= 7,

+        STATE_DOWNLOAD_COMPLETE	= 8,

+        STATE_EXTRACTING	= 9,

+        STATE_APPLYING_DIFFERENTIAL_PATCH	= 10,

+        STATE_READY_TO_INSTALL	= 11,

+        STATE_WAITING_TO_INSTALL	= 12,

+        STATE_INSTALLING	= 13,

+        STATE_INSTALL_COMPLETE	= 14,

+        STATE_PAUSED	= 15,

+        STATE_NO_UPDATE	= 16,

+        STATE_ERROR	= 17

+    } 	CurrentState;

+

+typedef 

+enum InstallPriority

+    {

+        INSTALL_PRIORITY_LOW	= 0,

+        INSTALL_PRIORITY_HIGH	= 10

+    } 	InstallPriority;

+

+typedef 

+enum PostInstallAction

+    {

+        POST_INSTALL_ACTION_DEFAULT	= 0,

+        POST_INSTALL_ACTION_EXIT_SILENTLY	= 1,

+        POST_INSTALL_ACTION_LAUNCH_COMMAND	= 2,

+        POST_INSTALL_ACTION_EXIT_SILENTLY_ON_LAUNCH_COMMAND	= 3,

+        POST_INSTALL_ACTION_RESTART_BROWSER	= 4,

+        POST_INSTALL_ACTION_RESTART_ALL_BROWSERS	= 5,

+        POST_INSTALL_ACTION_REBOOT	= 6

+    } 	PostInstallAction;

+

+

+enum AppCommandStatus

+    {

+        COMMAND_STATUS_INIT	= 1,

+        COMMAND_STATUS_RUNNING	= 2,

+        COMMAND_STATUS_ERROR	= 3,

+        COMMAND_STATUS_COMPLETE	= 4

+    } ;

+

+

+extern RPC_IF_HANDLE __MIDL_itf_google_update_idl_0000_0000_v0_0_c_ifspec;

+extern RPC_IF_HANDLE __MIDL_itf_google_update_idl_0000_0000_v0_0_s_ifspec;

+

+#ifndef __IGoogleUpdate3_INTERFACE_DEFINED__

+#define __IGoogleUpdate3_INTERFACE_DEFINED__

+

+/* interface IGoogleUpdate3 */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IGoogleUpdate3;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("ddd4b5d4-fd54-497c-8789-0830f29a60ee")

+    IGoogleUpdate3 : public IDispatch

+    {

+    public:

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Count( 

+            /* [retval][out] */ long *count) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( 

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **bundle) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createAppBundle( 

+            /* [retval][out] */ IDispatch **app_bundle) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IGoogleUpdate3Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IGoogleUpdate3 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IGoogleUpdate3 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IGoogleUpdate3 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IGoogleUpdate3 * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IGoogleUpdate3 * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IGoogleUpdate3 * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IGoogleUpdate3 * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( 

+            IGoogleUpdate3 * This,

+            /* [retval][out] */ long *count);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( 

+            IGoogleUpdate3 * This,

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **bundle);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createAppBundle )( 

+            IGoogleUpdate3 * This,

+            /* [retval][out] */ IDispatch **app_bundle);

+        

+        END_INTERFACE

+    } IGoogleUpdate3Vtbl;

+

+    interface IGoogleUpdate3

+    {

+        CONST_VTBL struct IGoogleUpdate3Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IGoogleUpdate3_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IGoogleUpdate3_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IGoogleUpdate3_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IGoogleUpdate3_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IGoogleUpdate3_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IGoogleUpdate3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IGoogleUpdate3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IGoogleUpdate3_get_Count(This,count)	\

+    ( (This)->lpVtbl -> get_Count(This,count) ) 

+

+#define IGoogleUpdate3_get_Item(This,index,bundle)	\

+    ( (This)->lpVtbl -> get_Item(This,index,bundle) ) 

+

+#define IGoogleUpdate3_createAppBundle(This,app_bundle)	\

+    ( (This)->lpVtbl -> createAppBundle(This,app_bundle) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IGoogleUpdate3_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppBundle_INTERFACE_DEFINED__

+#define __IAppBundle_INTERFACE_DEFINED__

+

+/* interface IAppBundle */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppBundle;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("ab4f4a7e-977c-4e23-ad8f-626a491715df")

+    IAppBundle : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_displayName( 

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0000) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_displayName( 

+            /* [in] */ BSTR __MIDL__IAppBundle0001) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_displayLanguage( 

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0002) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_displayLanguage( 

+            /* [in] */ BSTR __MIDL__IAppBundle0003) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installSource( 

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0004) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_installSource( 

+            /* [in] */ BSTR __MIDL__IAppBundle0005) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_originURL( 

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0006) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_originURL( 

+            /* [in] */ BSTR __MIDL__IAppBundle0007) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_offlineDirectory( 

+            /* [retval][out] */ BSTR *offline_dir) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_offlineDirectory( 

+            /* [in] */ BSTR offline_dir) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_sessionId( 

+            /* [retval][out] */ BSTR *session_id) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_sessionId( 

+            /* [in] */ BSTR session_id) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_sendPings( 

+            /* [retval][out] */ VARIANT_BOOL *send_pings) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_sendPings( 

+            /* [in] */ VARIANT_BOOL send_pings) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_priority( 

+            /* [retval][out] */ long *priority) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_priority( 

+            /* [in] */ long priority) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Count( 

+            /* [retval][out] */ long *count) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Item( 

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **app) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_altTokens( 

+            /* [in] */ ULONG_PTR impersonation_token,

+            /* [in] */ ULONG_PTR primary_token,

+            /* [in] */ DWORD caller_proc_id) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_parentHWND( 

+            /* [in] */ ULONG_PTR hwnd) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE initialize( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createApp( 

+            /* [in] */ BSTR app_id,

+            /* [retval][out] */ IDispatch **app) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createInstalledApp( 

+            /* [in] */ BSTR app_id,

+            /* [retval][out] */ IDispatch **app) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createAllInstalledApps( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE checkForUpdate( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE download( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE install( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE updateAllApps( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE stop( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE pause( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE resume( void) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE isBusy( 

+            /* [retval][out] */ VARIANT_BOOL *is_busy) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE downloadPackage( 

+            /* [in] */ BSTR app_id,

+            /* [in] */ BSTR package_name) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_currentState( 

+            /* [retval][out] */ VARIANT *current_state) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppBundleVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppBundle * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppBundle * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppBundle * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppBundle * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppBundle * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppBundle * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppBundle * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_displayName )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0000);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_displayName )( 

+            IAppBundle * This,

+            /* [in] */ BSTR __MIDL__IAppBundle0001);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_displayLanguage )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0002);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_displayLanguage )( 

+            IAppBundle * This,

+            /* [in] */ BSTR __MIDL__IAppBundle0003);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installSource )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0004);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_installSource )( 

+            IAppBundle * This,

+            /* [in] */ BSTR __MIDL__IAppBundle0005);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_originURL )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppBundle0006);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_originURL )( 

+            IAppBundle * This,

+            /* [in] */ BSTR __MIDL__IAppBundle0007);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_offlineDirectory )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *offline_dir);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_offlineDirectory )( 

+            IAppBundle * This,

+            /* [in] */ BSTR offline_dir);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_sessionId )( 

+            IAppBundle * This,

+            /* [retval][out] */ BSTR *session_id);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_sessionId )( 

+            IAppBundle * This,

+            /* [in] */ BSTR session_id);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_sendPings )( 

+            IAppBundle * This,

+            /* [retval][out] */ VARIANT_BOOL *send_pings);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_sendPings )( 

+            IAppBundle * This,

+            /* [in] */ VARIANT_BOOL send_pings);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_priority )( 

+            IAppBundle * This,

+            /* [retval][out] */ long *priority);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_priority )( 

+            IAppBundle * This,

+            /* [in] */ long priority);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Count )( 

+            IAppBundle * This,

+            /* [retval][out] */ long *count);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Item )( 

+            IAppBundle * This,

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **app);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_altTokens )( 

+            IAppBundle * This,

+            /* [in] */ ULONG_PTR impersonation_token,

+            /* [in] */ ULONG_PTR primary_token,

+            /* [in] */ DWORD caller_proc_id);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_parentHWND )( 

+            IAppBundle * This,

+            /* [in] */ ULONG_PTR hwnd);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *initialize )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createApp )( 

+            IAppBundle * This,

+            /* [in] */ BSTR app_id,

+            /* [retval][out] */ IDispatch **app);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createInstalledApp )( 

+            IAppBundle * This,

+            /* [in] */ BSTR app_id,

+            /* [retval][out] */ IDispatch **app);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createAllInstalledApps )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *checkForUpdate )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *download )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *install )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *updateAllApps )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *stop )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *pause )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *resume )( 

+            IAppBundle * This);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *isBusy )( 

+            IAppBundle * This,

+            /* [retval][out] */ VARIANT_BOOL *is_busy);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *downloadPackage )( 

+            IAppBundle * This,

+            /* [in] */ BSTR app_id,

+            /* [in] */ BSTR package_name);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_currentState )( 

+            IAppBundle * This,

+            /* [retval][out] */ VARIANT *current_state);

+        

+        END_INTERFACE

+    } IAppBundleVtbl;

+

+    interface IAppBundle

+    {

+        CONST_VTBL struct IAppBundleVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppBundle_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppBundle_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppBundle_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppBundle_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppBundle_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppBundle_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppBundle_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppBundle_get_displayName(This,__MIDL__IAppBundle0000)	\

+    ( (This)->lpVtbl -> get_displayName(This,__MIDL__IAppBundle0000) ) 

+

+#define IAppBundle_put_displayName(This,__MIDL__IAppBundle0001)	\

+    ( (This)->lpVtbl -> put_displayName(This,__MIDL__IAppBundle0001) ) 

+

+#define IAppBundle_get_displayLanguage(This,__MIDL__IAppBundle0002)	\

+    ( (This)->lpVtbl -> get_displayLanguage(This,__MIDL__IAppBundle0002) ) 

+

+#define IAppBundle_put_displayLanguage(This,__MIDL__IAppBundle0003)	\

+    ( (This)->lpVtbl -> put_displayLanguage(This,__MIDL__IAppBundle0003) ) 

+

+#define IAppBundle_get_installSource(This,__MIDL__IAppBundle0004)	\

+    ( (This)->lpVtbl -> get_installSource(This,__MIDL__IAppBundle0004) ) 

+

+#define IAppBundle_put_installSource(This,__MIDL__IAppBundle0005)	\

+    ( (This)->lpVtbl -> put_installSource(This,__MIDL__IAppBundle0005) ) 

+

+#define IAppBundle_get_originURL(This,__MIDL__IAppBundle0006)	\

+    ( (This)->lpVtbl -> get_originURL(This,__MIDL__IAppBundle0006) ) 

+

+#define IAppBundle_put_originURL(This,__MIDL__IAppBundle0007)	\

+    ( (This)->lpVtbl -> put_originURL(This,__MIDL__IAppBundle0007) ) 

+

+#define IAppBundle_get_offlineDirectory(This,offline_dir)	\

+    ( (This)->lpVtbl -> get_offlineDirectory(This,offline_dir) ) 

+

+#define IAppBundle_put_offlineDirectory(This,offline_dir)	\

+    ( (This)->lpVtbl -> put_offlineDirectory(This,offline_dir) ) 

+

+#define IAppBundle_get_sessionId(This,session_id)	\

+    ( (This)->lpVtbl -> get_sessionId(This,session_id) ) 

+

+#define IAppBundle_put_sessionId(This,session_id)	\

+    ( (This)->lpVtbl -> put_sessionId(This,session_id) ) 

+

+#define IAppBundle_get_sendPings(This,send_pings)	\

+    ( (This)->lpVtbl -> get_sendPings(This,send_pings) ) 

+

+#define IAppBundle_put_sendPings(This,send_pings)	\

+    ( (This)->lpVtbl -> put_sendPings(This,send_pings) ) 

+

+#define IAppBundle_get_priority(This,priority)	\

+    ( (This)->lpVtbl -> get_priority(This,priority) ) 

+

+#define IAppBundle_put_priority(This,priority)	\

+    ( (This)->lpVtbl -> put_priority(This,priority) ) 

+

+#define IAppBundle_get_Count(This,count)	\

+    ( (This)->lpVtbl -> get_Count(This,count) ) 

+

+#define IAppBundle_get_Item(This,index,app)	\

+    ( (This)->lpVtbl -> get_Item(This,index,app) ) 

+

+#define IAppBundle_put_altTokens(This,impersonation_token,primary_token,caller_proc_id)	\

+    ( (This)->lpVtbl -> put_altTokens(This,impersonation_token,primary_token,caller_proc_id) ) 

+

+#define IAppBundle_put_parentHWND(This,hwnd)	\

+    ( (This)->lpVtbl -> put_parentHWND(This,hwnd) ) 

+

+#define IAppBundle_initialize(This)	\

+    ( (This)->lpVtbl -> initialize(This) ) 

+

+#define IAppBundle_createApp(This,app_id,app)	\

+    ( (This)->lpVtbl -> createApp(This,app_id,app) ) 

+

+#define IAppBundle_createInstalledApp(This,app_id,app)	\

+    ( (This)->lpVtbl -> createInstalledApp(This,app_id,app) ) 

+

+#define IAppBundle_createAllInstalledApps(This)	\

+    ( (This)->lpVtbl -> createAllInstalledApps(This) ) 

+

+#define IAppBundle_checkForUpdate(This)	\

+    ( (This)->lpVtbl -> checkForUpdate(This) ) 

+

+#define IAppBundle_download(This)	\

+    ( (This)->lpVtbl -> download(This) ) 

+

+#define IAppBundle_install(This)	\

+    ( (This)->lpVtbl -> install(This) ) 

+

+#define IAppBundle_updateAllApps(This)	\

+    ( (This)->lpVtbl -> updateAllApps(This) ) 

+

+#define IAppBundle_stop(This)	\

+    ( (This)->lpVtbl -> stop(This) ) 

+

+#define IAppBundle_pause(This)	\

+    ( (This)->lpVtbl -> pause(This) ) 

+

+#define IAppBundle_resume(This)	\

+    ( (This)->lpVtbl -> resume(This) ) 

+

+#define IAppBundle_isBusy(This,is_busy)	\

+    ( (This)->lpVtbl -> isBusy(This,is_busy) ) 

+

+#define IAppBundle_downloadPackage(This,app_id,package_name)	\

+    ( (This)->lpVtbl -> downloadPackage(This,app_id,package_name) ) 

+

+#define IAppBundle_get_currentState(This,current_state)	\

+    ( (This)->lpVtbl -> get_currentState(This,current_state) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppBundle_INTERFACE_DEFINED__ */

+

+

+#ifndef __IApp_INTERFACE_DEFINED__

+#define __IApp_INTERFACE_DEFINED__

+

+/* interface IApp */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IApp;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("195a2eb3-21ee-43ca-9f23-93c2c9934e2e")

+    IApp : public IDispatch

+    {

+    public:

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_currentVersion( 

+            /* [retval][out] */ IDispatch **current) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_nextVersion( 

+            /* [retval][out] */ IDispatch **next) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_appId( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_displayName( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0001) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_displayName( 

+            /* [in] */ BSTR __MIDL__IApp0002) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0003) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_language( 

+            /* [in] */ BSTR __MIDL__IApp0004) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ap( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0005) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ap( 

+            /* [in] */ BSTR __MIDL__IApp0006) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ttToken( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0007) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ttToken( 

+            /* [in] */ BSTR __MIDL__IApp0008) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_iid( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0009) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_iid( 

+            /* [in] */ BSTR __MIDL__IApp0010) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_brandCode( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0011) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_brandCode( 

+            /* [in] */ BSTR __MIDL__IApp0012) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_clientId( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0013) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_clientId( 

+            /* [in] */ BSTR __MIDL__IApp0014) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_labels( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0015) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_labels( 

+            /* [in] */ BSTR __MIDL__IApp0016) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_referralId( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0017) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_referralId( 

+            /* [in] */ BSTR __MIDL__IApp0018) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_command( 

+            /* [in] */ BSTR command_id,

+            /* [retval][out] */ IDispatch **command) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_browserType( 

+            /* [retval][out] */ UINT *__MIDL__IApp0019) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_browserType( 

+            /* [in] */ UINT __MIDL__IApp0020) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_clientInstallData( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0021) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_clientInstallData( 

+            /* [in] */ BSTR __MIDL__IApp0022) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_serverInstallDataIndex( 

+            /* [retval][out] */ BSTR *__MIDL__IApp0023) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_serverInstallDataIndex( 

+            /* [in] */ BSTR __MIDL__IApp0024) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isEulaAccepted( 

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IApp0025) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_isEulaAccepted( 

+            /* [in] */ VARIANT_BOOL __MIDL__IApp0026) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_usageStatsEnable( 

+            /* [retval][out] */ UINT *__MIDL__IApp0027) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_usageStatsEnable( 

+            /* [in] */ UINT __MIDL__IApp0028) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installTimeDiffSec( 

+            /* [retval][out] */ UINT *__MIDL__IApp0029) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_currentState( 

+            /* [retval][out] */ IDispatch **__MIDL__IApp0030) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IApp * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IApp * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IApp * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IApp * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IApp * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IApp * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IApp * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_currentVersion )( 

+            IApp * This,

+            /* [retval][out] */ IDispatch **current);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_nextVersion )( 

+            IApp * This,

+            /* [retval][out] */ IDispatch **next);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_appId )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_displayName )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0001);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_displayName )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0002);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_language )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0003);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_language )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0004);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ap )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0005);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ap )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0006);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ttToken )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0007);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ttToken )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0008);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_iid )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0009);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_iid )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0010);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_brandCode )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0011);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_brandCode )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0012);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_clientId )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0013);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_clientId )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0014);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_labels )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0015);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_labels )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0016);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_referralId )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0017);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_referralId )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0018);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_command )( 

+            IApp * This,

+            /* [in] */ BSTR command_id,

+            /* [retval][out] */ IDispatch **command);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_browserType )( 

+            IApp * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0019);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_browserType )( 

+            IApp * This,

+            /* [in] */ UINT __MIDL__IApp0020);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_clientInstallData )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0021);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_clientInstallData )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0022);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_serverInstallDataIndex )( 

+            IApp * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0023);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_serverInstallDataIndex )( 

+            IApp * This,

+            /* [in] */ BSTR __MIDL__IApp0024);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isEulaAccepted )( 

+            IApp * This,

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IApp0025);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_isEulaAccepted )( 

+            IApp * This,

+            /* [in] */ VARIANT_BOOL __MIDL__IApp0026);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_usageStatsEnable )( 

+            IApp * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0027);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_usageStatsEnable )( 

+            IApp * This,

+            /* [in] */ UINT __MIDL__IApp0028);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installTimeDiffSec )( 

+            IApp * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0029);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_currentState )( 

+            IApp * This,

+            /* [retval][out] */ IDispatch **__MIDL__IApp0030);

+        

+        END_INTERFACE

+    } IAppVtbl;

+

+    interface IApp

+    {

+        CONST_VTBL struct IAppVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IApp_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IApp_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IApp_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IApp_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IApp_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IApp_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IApp_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IApp_get_currentVersion(This,current)	\

+    ( (This)->lpVtbl -> get_currentVersion(This,current) ) 

+

+#define IApp_get_nextVersion(This,next)	\

+    ( (This)->lpVtbl -> get_nextVersion(This,next) ) 

+

+#define IApp_get_appId(This,__MIDL__IApp0000)	\

+    ( (This)->lpVtbl -> get_appId(This,__MIDL__IApp0000) ) 

+

+#define IApp_get_displayName(This,__MIDL__IApp0001)	\

+    ( (This)->lpVtbl -> get_displayName(This,__MIDL__IApp0001) ) 

+

+#define IApp_put_displayName(This,__MIDL__IApp0002)	\

+    ( (This)->lpVtbl -> put_displayName(This,__MIDL__IApp0002) ) 

+

+#define IApp_get_language(This,__MIDL__IApp0003)	\

+    ( (This)->lpVtbl -> get_language(This,__MIDL__IApp0003) ) 

+

+#define IApp_put_language(This,__MIDL__IApp0004)	\

+    ( (This)->lpVtbl -> put_language(This,__MIDL__IApp0004) ) 

+

+#define IApp_get_ap(This,__MIDL__IApp0005)	\

+    ( (This)->lpVtbl -> get_ap(This,__MIDL__IApp0005) ) 

+

+#define IApp_put_ap(This,__MIDL__IApp0006)	\

+    ( (This)->lpVtbl -> put_ap(This,__MIDL__IApp0006) ) 

+

+#define IApp_get_ttToken(This,__MIDL__IApp0007)	\

+    ( (This)->lpVtbl -> get_ttToken(This,__MIDL__IApp0007) ) 

+

+#define IApp_put_ttToken(This,__MIDL__IApp0008)	\

+    ( (This)->lpVtbl -> put_ttToken(This,__MIDL__IApp0008) ) 

+

+#define IApp_get_iid(This,__MIDL__IApp0009)	\

+    ( (This)->lpVtbl -> get_iid(This,__MIDL__IApp0009) ) 

+

+#define IApp_put_iid(This,__MIDL__IApp0010)	\

+    ( (This)->lpVtbl -> put_iid(This,__MIDL__IApp0010) ) 

+

+#define IApp_get_brandCode(This,__MIDL__IApp0011)	\

+    ( (This)->lpVtbl -> get_brandCode(This,__MIDL__IApp0011) ) 

+

+#define IApp_put_brandCode(This,__MIDL__IApp0012)	\

+    ( (This)->lpVtbl -> put_brandCode(This,__MIDL__IApp0012) ) 

+

+#define IApp_get_clientId(This,__MIDL__IApp0013)	\

+    ( (This)->lpVtbl -> get_clientId(This,__MIDL__IApp0013) ) 

+

+#define IApp_put_clientId(This,__MIDL__IApp0014)	\

+    ( (This)->lpVtbl -> put_clientId(This,__MIDL__IApp0014) ) 

+

+#define IApp_get_labels(This,__MIDL__IApp0015)	\

+    ( (This)->lpVtbl -> get_labels(This,__MIDL__IApp0015) ) 

+

+#define IApp_put_labels(This,__MIDL__IApp0016)	\

+    ( (This)->lpVtbl -> put_labels(This,__MIDL__IApp0016) ) 

+

+#define IApp_get_referralId(This,__MIDL__IApp0017)	\

+    ( (This)->lpVtbl -> get_referralId(This,__MIDL__IApp0017) ) 

+

+#define IApp_put_referralId(This,__MIDL__IApp0018)	\

+    ( (This)->lpVtbl -> put_referralId(This,__MIDL__IApp0018) ) 

+

+#define IApp_get_command(This,command_id,command)	\

+    ( (This)->lpVtbl -> get_command(This,command_id,command) ) 

+

+#define IApp_get_browserType(This,__MIDL__IApp0019)	\

+    ( (This)->lpVtbl -> get_browserType(This,__MIDL__IApp0019) ) 

+

+#define IApp_put_browserType(This,__MIDL__IApp0020)	\

+    ( (This)->lpVtbl -> put_browserType(This,__MIDL__IApp0020) ) 

+

+#define IApp_get_clientInstallData(This,__MIDL__IApp0021)	\

+    ( (This)->lpVtbl -> get_clientInstallData(This,__MIDL__IApp0021) ) 

+

+#define IApp_put_clientInstallData(This,__MIDL__IApp0022)	\

+    ( (This)->lpVtbl -> put_clientInstallData(This,__MIDL__IApp0022) ) 

+

+#define IApp_get_serverInstallDataIndex(This,__MIDL__IApp0023)	\

+    ( (This)->lpVtbl -> get_serverInstallDataIndex(This,__MIDL__IApp0023) ) 

+

+#define IApp_put_serverInstallDataIndex(This,__MIDL__IApp0024)	\

+    ( (This)->lpVtbl -> put_serverInstallDataIndex(This,__MIDL__IApp0024) ) 

+

+#define IApp_get_isEulaAccepted(This,__MIDL__IApp0025)	\

+    ( (This)->lpVtbl -> get_isEulaAccepted(This,__MIDL__IApp0025) ) 

+

+#define IApp_put_isEulaAccepted(This,__MIDL__IApp0026)	\

+    ( (This)->lpVtbl -> put_isEulaAccepted(This,__MIDL__IApp0026) ) 

+

+#define IApp_get_usageStatsEnable(This,__MIDL__IApp0027)	\

+    ( (This)->lpVtbl -> get_usageStatsEnable(This,__MIDL__IApp0027) ) 

+

+#define IApp_put_usageStatsEnable(This,__MIDL__IApp0028)	\

+    ( (This)->lpVtbl -> put_usageStatsEnable(This,__MIDL__IApp0028) ) 

+

+#define IApp_get_installTimeDiffSec(This,__MIDL__IApp0029)	\

+    ( (This)->lpVtbl -> get_installTimeDiffSec(This,__MIDL__IApp0029) ) 

+

+#define IApp_get_currentState(This,__MIDL__IApp0030)	\

+    ( (This)->lpVtbl -> get_currentState(This,__MIDL__IApp0030) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IApp_INTERFACE_DEFINED__ */

+

+

+#ifndef __IApp2_INTERFACE_DEFINED__

+#define __IApp2_INTERFACE_DEFINED__

+

+/* interface IApp2 */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IApp2;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("c06ee550-7248-488e-971e-b60c0ab3a6e4")

+    IApp2 : public IApp

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_untrustedData( 

+            /* [retval][out] */ BSTR *__MIDL__IApp20000) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_untrustedData( 

+            /* [in] */ BSTR __MIDL__IApp20001) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IApp2Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IApp2 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IApp2 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IApp2 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IApp2 * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IApp2 * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IApp2 * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IApp2 * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_currentVersion )( 

+            IApp2 * This,

+            /* [retval][out] */ IDispatch **current);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_nextVersion )( 

+            IApp2 * This,

+            /* [retval][out] */ IDispatch **next);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_appId )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_displayName )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0001);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_displayName )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0002);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_language )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0003);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_language )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0004);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ap )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0005);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ap )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0006);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ttToken )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0007);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ttToken )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0008);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_iid )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0009);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_iid )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0010);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_brandCode )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0011);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_brandCode )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0012);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_clientId )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0013);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_clientId )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0014);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_labels )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0015);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_labels )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0016);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_referralId )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0017);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_referralId )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0018);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_command )( 

+            IApp2 * This,

+            /* [in] */ BSTR command_id,

+            /* [retval][out] */ IDispatch **command);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_browserType )( 

+            IApp2 * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0019);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_browserType )( 

+            IApp2 * This,

+            /* [in] */ UINT __MIDL__IApp0020);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_clientInstallData )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0021);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_clientInstallData )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0022);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_serverInstallDataIndex )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp0023);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_serverInstallDataIndex )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp0024);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isEulaAccepted )( 

+            IApp2 * This,

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IApp0025);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_isEulaAccepted )( 

+            IApp2 * This,

+            /* [in] */ VARIANT_BOOL __MIDL__IApp0026);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_usageStatsEnable )( 

+            IApp2 * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0027);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_usageStatsEnable )( 

+            IApp2 * This,

+            /* [in] */ UINT __MIDL__IApp0028);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installTimeDiffSec )( 

+            IApp2 * This,

+            /* [retval][out] */ UINT *__MIDL__IApp0029);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_currentState )( 

+            IApp2 * This,

+            /* [retval][out] */ IDispatch **__MIDL__IApp0030);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_untrustedData )( 

+            IApp2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IApp20000);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_untrustedData )( 

+            IApp2 * This,

+            /* [in] */ BSTR __MIDL__IApp20001);

+        

+        END_INTERFACE

+    } IApp2Vtbl;

+

+    interface IApp2

+    {

+        CONST_VTBL struct IApp2Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IApp2_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IApp2_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IApp2_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IApp2_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IApp2_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IApp2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IApp2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IApp2_get_currentVersion(This,current)	\

+    ( (This)->lpVtbl -> get_currentVersion(This,current) ) 

+

+#define IApp2_get_nextVersion(This,next)	\

+    ( (This)->lpVtbl -> get_nextVersion(This,next) ) 

+

+#define IApp2_get_appId(This,__MIDL__IApp0000)	\

+    ( (This)->lpVtbl -> get_appId(This,__MIDL__IApp0000) ) 

+

+#define IApp2_get_displayName(This,__MIDL__IApp0001)	\

+    ( (This)->lpVtbl -> get_displayName(This,__MIDL__IApp0001) ) 

+

+#define IApp2_put_displayName(This,__MIDL__IApp0002)	\

+    ( (This)->lpVtbl -> put_displayName(This,__MIDL__IApp0002) ) 

+

+#define IApp2_get_language(This,__MIDL__IApp0003)	\

+    ( (This)->lpVtbl -> get_language(This,__MIDL__IApp0003) ) 

+

+#define IApp2_put_language(This,__MIDL__IApp0004)	\

+    ( (This)->lpVtbl -> put_language(This,__MIDL__IApp0004) ) 

+

+#define IApp2_get_ap(This,__MIDL__IApp0005)	\

+    ( (This)->lpVtbl -> get_ap(This,__MIDL__IApp0005) ) 

+

+#define IApp2_put_ap(This,__MIDL__IApp0006)	\

+    ( (This)->lpVtbl -> put_ap(This,__MIDL__IApp0006) ) 

+

+#define IApp2_get_ttToken(This,__MIDL__IApp0007)	\

+    ( (This)->lpVtbl -> get_ttToken(This,__MIDL__IApp0007) ) 

+

+#define IApp2_put_ttToken(This,__MIDL__IApp0008)	\

+    ( (This)->lpVtbl -> put_ttToken(This,__MIDL__IApp0008) ) 

+

+#define IApp2_get_iid(This,__MIDL__IApp0009)	\

+    ( (This)->lpVtbl -> get_iid(This,__MIDL__IApp0009) ) 

+

+#define IApp2_put_iid(This,__MIDL__IApp0010)	\

+    ( (This)->lpVtbl -> put_iid(This,__MIDL__IApp0010) ) 

+

+#define IApp2_get_brandCode(This,__MIDL__IApp0011)	\

+    ( (This)->lpVtbl -> get_brandCode(This,__MIDL__IApp0011) ) 

+

+#define IApp2_put_brandCode(This,__MIDL__IApp0012)	\

+    ( (This)->lpVtbl -> put_brandCode(This,__MIDL__IApp0012) ) 

+

+#define IApp2_get_clientId(This,__MIDL__IApp0013)	\

+    ( (This)->lpVtbl -> get_clientId(This,__MIDL__IApp0013) ) 

+

+#define IApp2_put_clientId(This,__MIDL__IApp0014)	\

+    ( (This)->lpVtbl -> put_clientId(This,__MIDL__IApp0014) ) 

+

+#define IApp2_get_labels(This,__MIDL__IApp0015)	\

+    ( (This)->lpVtbl -> get_labels(This,__MIDL__IApp0015) ) 

+

+#define IApp2_put_labels(This,__MIDL__IApp0016)	\

+    ( (This)->lpVtbl -> put_labels(This,__MIDL__IApp0016) ) 

+

+#define IApp2_get_referralId(This,__MIDL__IApp0017)	\

+    ( (This)->lpVtbl -> get_referralId(This,__MIDL__IApp0017) ) 

+

+#define IApp2_put_referralId(This,__MIDL__IApp0018)	\

+    ( (This)->lpVtbl -> put_referralId(This,__MIDL__IApp0018) ) 

+

+#define IApp2_get_command(This,command_id,command)	\

+    ( (This)->lpVtbl -> get_command(This,command_id,command) ) 

+

+#define IApp2_get_browserType(This,__MIDL__IApp0019)	\

+    ( (This)->lpVtbl -> get_browserType(This,__MIDL__IApp0019) ) 

+

+#define IApp2_put_browserType(This,__MIDL__IApp0020)	\

+    ( (This)->lpVtbl -> put_browserType(This,__MIDL__IApp0020) ) 

+

+#define IApp2_get_clientInstallData(This,__MIDL__IApp0021)	\

+    ( (This)->lpVtbl -> get_clientInstallData(This,__MIDL__IApp0021) ) 

+

+#define IApp2_put_clientInstallData(This,__MIDL__IApp0022)	\

+    ( (This)->lpVtbl -> put_clientInstallData(This,__MIDL__IApp0022) ) 

+

+#define IApp2_get_serverInstallDataIndex(This,__MIDL__IApp0023)	\

+    ( (This)->lpVtbl -> get_serverInstallDataIndex(This,__MIDL__IApp0023) ) 

+

+#define IApp2_put_serverInstallDataIndex(This,__MIDL__IApp0024)	\

+    ( (This)->lpVtbl -> put_serverInstallDataIndex(This,__MIDL__IApp0024) ) 

+

+#define IApp2_get_isEulaAccepted(This,__MIDL__IApp0025)	\

+    ( (This)->lpVtbl -> get_isEulaAccepted(This,__MIDL__IApp0025) ) 

+

+#define IApp2_put_isEulaAccepted(This,__MIDL__IApp0026)	\

+    ( (This)->lpVtbl -> put_isEulaAccepted(This,__MIDL__IApp0026) ) 

+

+#define IApp2_get_usageStatsEnable(This,__MIDL__IApp0027)	\

+    ( (This)->lpVtbl -> get_usageStatsEnable(This,__MIDL__IApp0027) ) 

+

+#define IApp2_put_usageStatsEnable(This,__MIDL__IApp0028)	\

+    ( (This)->lpVtbl -> put_usageStatsEnable(This,__MIDL__IApp0028) ) 

+

+#define IApp2_get_installTimeDiffSec(This,__MIDL__IApp0029)	\

+    ( (This)->lpVtbl -> get_installTimeDiffSec(This,__MIDL__IApp0029) ) 

+

+#define IApp2_get_currentState(This,__MIDL__IApp0030)	\

+    ( (This)->lpVtbl -> get_currentState(This,__MIDL__IApp0030) ) 

+

+

+#define IApp2_get_untrustedData(This,__MIDL__IApp20000)	\

+    ( (This)->lpVtbl -> get_untrustedData(This,__MIDL__IApp20000) ) 

+

+#define IApp2_put_untrustedData(This,__MIDL__IApp20001)	\

+    ( (This)->lpVtbl -> put_untrustedData(This,__MIDL__IApp20001) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IApp2_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppCommand_INTERFACE_DEFINED__

+#define __IAppCommand_INTERFACE_DEFINED__

+

+/* interface IAppCommand */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppCommand;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("5f9c80b5-9e50-43c9-887c-7c6412e110df")

+    IAppCommand : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isWebAccessible( 

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IAppCommand0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_status( 

+            /* [retval][out] */ UINT *__MIDL__IAppCommand0001) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_exitCode( 

+            /* [retval][out] */ DWORD *__MIDL__IAppCommand0002) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE execute( 

+            /* [optional][in] */ VARIANT arg1,

+            /* [optional][in] */ VARIANT arg2,

+            /* [optional][in] */ VARIANT arg3,

+            /* [optional][in] */ VARIANT arg4,

+            /* [optional][in] */ VARIANT arg5,

+            /* [optional][in] */ VARIANT arg6,

+            /* [optional][in] */ VARIANT arg7,

+            /* [optional][in] */ VARIANT arg8,

+            /* [optional][in] */ VARIANT arg9) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppCommandVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppCommand * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppCommand * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppCommand * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppCommand * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppCommand * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppCommand * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppCommand * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isWebAccessible )( 

+            IAppCommand * This,

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IAppCommand0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( 

+            IAppCommand * This,

+            /* [retval][out] */ UINT *__MIDL__IAppCommand0001);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_exitCode )( 

+            IAppCommand * This,

+            /* [retval][out] */ DWORD *__MIDL__IAppCommand0002);

+        

+        HRESULT ( STDMETHODCALLTYPE *execute )( 

+            IAppCommand * This,

+            /* [optional][in] */ VARIANT arg1,

+            /* [optional][in] */ VARIANT arg2,

+            /* [optional][in] */ VARIANT arg3,

+            /* [optional][in] */ VARIANT arg4,

+            /* [optional][in] */ VARIANT arg5,

+            /* [optional][in] */ VARIANT arg6,

+            /* [optional][in] */ VARIANT arg7,

+            /* [optional][in] */ VARIANT arg8,

+            /* [optional][in] */ VARIANT arg9);

+        

+        END_INTERFACE

+    } IAppCommandVtbl;

+

+    interface IAppCommand

+    {

+        CONST_VTBL struct IAppCommandVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppCommand_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppCommand_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppCommand_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppCommand_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppCommand_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppCommand_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppCommand_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppCommand_get_isWebAccessible(This,__MIDL__IAppCommand0000)	\

+    ( (This)->lpVtbl -> get_isWebAccessible(This,__MIDL__IAppCommand0000) ) 

+

+#define IAppCommand_get_status(This,__MIDL__IAppCommand0001)	\

+    ( (This)->lpVtbl -> get_status(This,__MIDL__IAppCommand0001) ) 

+

+#define IAppCommand_get_exitCode(This,__MIDL__IAppCommand0002)	\

+    ( (This)->lpVtbl -> get_exitCode(This,__MIDL__IAppCommand0002) ) 

+

+#define IAppCommand_execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)	\

+    ( (This)->lpVtbl -> execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppCommand_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppCommand2_INTERFACE_DEFINED__

+#define __IAppCommand2_INTERFACE_DEFINED__

+

+/* interface IAppCommand2 */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppCommand2;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("7e29be61-5809-443f-9b5d-cf22156694eb")

+    IAppCommand2 : public IAppCommand

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_output( 

+            /* [retval][out] */ BSTR *__MIDL__IAppCommand20000) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppCommand2Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppCommand2 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppCommand2 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppCommand2 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppCommand2 * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppCommand2 * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppCommand2 * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppCommand2 * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isWebAccessible )( 

+            IAppCommand2 * This,

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IAppCommand0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( 

+            IAppCommand2 * This,

+            /* [retval][out] */ UINT *__MIDL__IAppCommand0001);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_exitCode )( 

+            IAppCommand2 * This,

+            /* [retval][out] */ DWORD *__MIDL__IAppCommand0002);

+        

+        HRESULT ( STDMETHODCALLTYPE *execute )( 

+            IAppCommand2 * This,

+            /* [optional][in] */ VARIANT arg1,

+            /* [optional][in] */ VARIANT arg2,

+            /* [optional][in] */ VARIANT arg3,

+            /* [optional][in] */ VARIANT arg4,

+            /* [optional][in] */ VARIANT arg5,

+            /* [optional][in] */ VARIANT arg6,

+            /* [optional][in] */ VARIANT arg7,

+            /* [optional][in] */ VARIANT arg8,

+            /* [optional][in] */ VARIANT arg9);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( 

+            IAppCommand2 * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppCommand20000);

+        

+        END_INTERFACE

+    } IAppCommand2Vtbl;

+

+    interface IAppCommand2

+    {

+        CONST_VTBL struct IAppCommand2Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppCommand2_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppCommand2_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppCommand2_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppCommand2_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppCommand2_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppCommand2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppCommand2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppCommand2_get_isWebAccessible(This,__MIDL__IAppCommand0000)	\

+    ( (This)->lpVtbl -> get_isWebAccessible(This,__MIDL__IAppCommand0000) ) 

+

+#define IAppCommand2_get_status(This,__MIDL__IAppCommand0001)	\

+    ( (This)->lpVtbl -> get_status(This,__MIDL__IAppCommand0001) ) 

+

+#define IAppCommand2_get_exitCode(This,__MIDL__IAppCommand0002)	\

+    ( (This)->lpVtbl -> get_exitCode(This,__MIDL__IAppCommand0002) ) 

+

+#define IAppCommand2_execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)	\

+    ( (This)->lpVtbl -> execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) ) 

+

+

+#define IAppCommand2_get_output(This,__MIDL__IAppCommand20000)	\

+    ( (This)->lpVtbl -> get_output(This,__MIDL__IAppCommand20000) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppCommand2_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppVersion_INTERFACE_DEFINED__

+#define __IAppVersion_INTERFACE_DEFINED__

+

+/* interface IAppVersion */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppVersion;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("7b3b7a69-7d88-4847-a6bc-90e246a41f69")

+    IAppVersion : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_version( 

+            /* [retval][out] */ BSTR *__MIDL__IAppVersion0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_packageCount( 

+            /* [retval][out] */ long *count) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_package( 

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **package) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppVersionVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppVersion * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppVersion * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppVersion * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppVersion * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppVersion * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppVersion * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppVersion * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_version )( 

+            IAppVersion * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppVersion0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCount )( 

+            IAppVersion * This,

+            /* [retval][out] */ long *count);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_package )( 

+            IAppVersion * This,

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **package);

+        

+        END_INTERFACE

+    } IAppVersionVtbl;

+

+    interface IAppVersion

+    {

+        CONST_VTBL struct IAppVersionVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppVersion_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppVersion_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppVersion_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppVersion_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppVersion_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppVersion_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppVersion_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppVersion_get_version(This,__MIDL__IAppVersion0000)	\

+    ( (This)->lpVtbl -> get_version(This,__MIDL__IAppVersion0000) ) 

+

+#define IAppVersion_get_packageCount(This,count)	\

+    ( (This)->lpVtbl -> get_packageCount(This,count) ) 

+

+#define IAppVersion_get_package(This,index,package)	\

+    ( (This)->lpVtbl -> get_package(This,index,package) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppVersion_INTERFACE_DEFINED__ */

+

+

+#ifndef __IPackage_INTERFACE_DEFINED__

+#define __IPackage_INTERFACE_DEFINED__

+

+/* interface IPackage */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IPackage;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("c853632e-36ca-4999-b992-ec0d408cf5ab")

+    IPackage : public IDispatch

+    {

+    public:

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE get( 

+            /* [in] */ BSTR dir) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isAvailable( 

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IPackage0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_filename( 

+            /* [retval][out] */ BSTR *__MIDL__IPackage0001) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IPackageVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IPackage * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IPackage * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IPackage * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IPackage * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IPackage * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IPackage * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IPackage * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *get )( 

+            IPackage * This,

+            /* [in] */ BSTR dir);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isAvailable )( 

+            IPackage * This,

+            /* [retval][out] */ VARIANT_BOOL *__MIDL__IPackage0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_filename )( 

+            IPackage * This,

+            /* [retval][out] */ BSTR *__MIDL__IPackage0001);

+        

+        END_INTERFACE

+    } IPackageVtbl;

+

+    interface IPackage

+    {

+        CONST_VTBL struct IPackageVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IPackage_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IPackage_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IPackage_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IPackage_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IPackage_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IPackage_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IPackage_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IPackage_get(This,dir)	\

+    ( (This)->lpVtbl -> get(This,dir) ) 

+

+#define IPackage_get_isAvailable(This,__MIDL__IPackage0000)	\

+    ( (This)->lpVtbl -> get_isAvailable(This,__MIDL__IPackage0000) ) 

+

+#define IPackage_get_filename(This,__MIDL__IPackage0001)	\

+    ( (This)->lpVtbl -> get_filename(This,__MIDL__IPackage0001) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IPackage_INTERFACE_DEFINED__ */

+

+

+#ifndef __ICurrentState_INTERFACE_DEFINED__

+#define __ICurrentState_INTERFACE_DEFINED__

+

+/* interface ICurrentState */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_ICurrentState;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("177cae89-4ad6-42f4-a458-00ec3389e3fe")

+    ICurrentState : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_stateValue( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_availableVersion( 

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0001) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_bytesDownloaded( 

+            /* [retval][out] */ ULONG *__MIDL__ICurrentState0002) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_totalBytesToDownload( 

+            /* [retval][out] */ ULONG *__MIDL__ICurrentState0003) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_downloadTimeRemainingMs( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0004) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextRetryTime( 

+            /* [retval][out] */ ULONGLONG *__MIDL__ICurrentState0005) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installProgress( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0006) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installTimeRemainingMs( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0007) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isCanceled( 

+            /* [retval][out] */ VARIANT_BOOL *is_canceled) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_errorCode( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0008) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_extraCode1( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0009) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_completionMessage( 

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0010) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installerResultCode( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0011) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_installerResultExtraCode1( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0012) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_postInstallLaunchCommandLine( 

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0013) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_postInstallUrl( 

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0014) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_postInstallAction( 

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0015) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct ICurrentStateVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            ICurrentState * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            ICurrentState * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            ICurrentState * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            ICurrentState * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            ICurrentState * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            ICurrentState * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            ICurrentState * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_stateValue )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_availableVersion )( 

+            ICurrentState * This,

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0001);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_bytesDownloaded )( 

+            ICurrentState * This,

+            /* [retval][out] */ ULONG *__MIDL__ICurrentState0002);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_totalBytesToDownload )( 

+            ICurrentState * This,

+            /* [retval][out] */ ULONG *__MIDL__ICurrentState0003);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadTimeRemainingMs )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0004);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextRetryTime )( 

+            ICurrentState * This,

+            /* [retval][out] */ ULONGLONG *__MIDL__ICurrentState0005);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installProgress )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0006);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installTimeRemainingMs )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0007);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isCanceled )( 

+            ICurrentState * This,

+            /* [retval][out] */ VARIANT_BOOL *is_canceled);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorCode )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0008);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_extraCode1 )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0009);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_completionMessage )( 

+            ICurrentState * This,

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0010);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installerResultCode )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0011);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_installerResultExtraCode1 )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0012);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_postInstallLaunchCommandLine )( 

+            ICurrentState * This,

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0013);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_postInstallUrl )( 

+            ICurrentState * This,

+            /* [retval][out] */ BSTR *__MIDL__ICurrentState0014);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_postInstallAction )( 

+            ICurrentState * This,

+            /* [retval][out] */ LONG *__MIDL__ICurrentState0015);

+        

+        END_INTERFACE

+    } ICurrentStateVtbl;

+

+    interface ICurrentState

+    {

+        CONST_VTBL struct ICurrentStateVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define ICurrentState_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define ICurrentState_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define ICurrentState_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define ICurrentState_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define ICurrentState_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define ICurrentState_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define ICurrentState_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define ICurrentState_get_stateValue(This,__MIDL__ICurrentState0000)	\

+    ( (This)->lpVtbl -> get_stateValue(This,__MIDL__ICurrentState0000) ) 

+

+#define ICurrentState_get_availableVersion(This,__MIDL__ICurrentState0001)	\

+    ( (This)->lpVtbl -> get_availableVersion(This,__MIDL__ICurrentState0001) ) 

+

+#define ICurrentState_get_bytesDownloaded(This,__MIDL__ICurrentState0002)	\

+    ( (This)->lpVtbl -> get_bytesDownloaded(This,__MIDL__ICurrentState0002) ) 

+

+#define ICurrentState_get_totalBytesToDownload(This,__MIDL__ICurrentState0003)	\

+    ( (This)->lpVtbl -> get_totalBytesToDownload(This,__MIDL__ICurrentState0003) ) 

+

+#define ICurrentState_get_downloadTimeRemainingMs(This,__MIDL__ICurrentState0004)	\

+    ( (This)->lpVtbl -> get_downloadTimeRemainingMs(This,__MIDL__ICurrentState0004) ) 

+

+#define ICurrentState_get_nextRetryTime(This,__MIDL__ICurrentState0005)	\

+    ( (This)->lpVtbl -> get_nextRetryTime(This,__MIDL__ICurrentState0005) ) 

+

+#define ICurrentState_get_installProgress(This,__MIDL__ICurrentState0006)	\

+    ( (This)->lpVtbl -> get_installProgress(This,__MIDL__ICurrentState0006) ) 

+

+#define ICurrentState_get_installTimeRemainingMs(This,__MIDL__ICurrentState0007)	\

+    ( (This)->lpVtbl -> get_installTimeRemainingMs(This,__MIDL__ICurrentState0007) ) 

+

+#define ICurrentState_get_isCanceled(This,is_canceled)	\

+    ( (This)->lpVtbl -> get_isCanceled(This,is_canceled) ) 

+

+#define ICurrentState_get_errorCode(This,__MIDL__ICurrentState0008)	\

+    ( (This)->lpVtbl -> get_errorCode(This,__MIDL__ICurrentState0008) ) 

+

+#define ICurrentState_get_extraCode1(This,__MIDL__ICurrentState0009)	\

+    ( (This)->lpVtbl -> get_extraCode1(This,__MIDL__ICurrentState0009) ) 

+

+#define ICurrentState_get_completionMessage(This,__MIDL__ICurrentState0010)	\

+    ( (This)->lpVtbl -> get_completionMessage(This,__MIDL__ICurrentState0010) ) 

+

+#define ICurrentState_get_installerResultCode(This,__MIDL__ICurrentState0011)	\

+    ( (This)->lpVtbl -> get_installerResultCode(This,__MIDL__ICurrentState0011) ) 

+

+#define ICurrentState_get_installerResultExtraCode1(This,__MIDL__ICurrentState0012)	\

+    ( (This)->lpVtbl -> get_installerResultExtraCode1(This,__MIDL__ICurrentState0012) ) 

+

+#define ICurrentState_get_postInstallLaunchCommandLine(This,__MIDL__ICurrentState0013)	\

+    ( (This)->lpVtbl -> get_postInstallLaunchCommandLine(This,__MIDL__ICurrentState0013) ) 

+

+#define ICurrentState_get_postInstallUrl(This,__MIDL__ICurrentState0014)	\

+    ( (This)->lpVtbl -> get_postInstallUrl(This,__MIDL__ICurrentState0014) ) 

+

+#define ICurrentState_get_postInstallAction(This,__MIDL__ICurrentState0015)	\

+    ( (This)->lpVtbl -> get_postInstallAction(This,__MIDL__ICurrentState0015) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __ICurrentState_INTERFACE_DEFINED__ */

+

+

+#ifndef __IRegistrationUpdateHook_INTERFACE_DEFINED__

+#define __IRegistrationUpdateHook_INTERFACE_DEFINED__

+

+/* interface IRegistrationUpdateHook */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IRegistrationUpdateHook;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("3e102dc6-1edb-46a1-8488-61f71b35ed5f")

+    IRegistrationUpdateHook : public IDispatch

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE UpdateRegistry( 

+            /* [in] */ BSTR app_id,

+            /* [in] */ VARIANT_BOOL is_machine) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IRegistrationUpdateHookVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IRegistrationUpdateHook * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IRegistrationUpdateHook * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IRegistrationUpdateHook * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IRegistrationUpdateHook * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IRegistrationUpdateHook * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IRegistrationUpdateHook * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IRegistrationUpdateHook * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        HRESULT ( STDMETHODCALLTYPE *UpdateRegistry )( 

+            IRegistrationUpdateHook * This,

+            /* [in] */ BSTR app_id,

+            /* [in] */ VARIANT_BOOL is_machine);

+        

+        END_INTERFACE

+    } IRegistrationUpdateHookVtbl;

+

+    interface IRegistrationUpdateHook

+    {

+        CONST_VTBL struct IRegistrationUpdateHookVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IRegistrationUpdateHook_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IRegistrationUpdateHook_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IRegistrationUpdateHook_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IRegistrationUpdateHook_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IRegistrationUpdateHook_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IRegistrationUpdateHook_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IRegistrationUpdateHook_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IRegistrationUpdateHook_UpdateRegistry(This,app_id,is_machine)	\

+    ( (This)->lpVtbl -> UpdateRegistry(This,app_id,is_machine) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IRegistrationUpdateHook_INTERFACE_DEFINED__ */

+

+

+#ifndef __ICredentialDialog_INTERFACE_DEFINED__

+#define __ICredentialDialog_INTERFACE_DEFINED__

+

+/* interface ICredentialDialog */

+/* [unique][helpstring][uuid][object] */ 

+

+

+EXTERN_C const IID IID_ICredentialDialog;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("2603c88b-f971-4167-9de1-871ee4a3dc84")

+    ICredentialDialog : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE QueryUserForCredentials( 

+            /* [in] */ ULONG_PTR owner_hwnd,

+            /* [in] */ BSTR server,

+            /* [in] */ BSTR message,

+            /* [out] */ BSTR *username,

+            /* [out] */ BSTR *password) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct ICredentialDialogVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            ICredentialDialog * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            ICredentialDialog * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            ICredentialDialog * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryUserForCredentials )( 

+            ICredentialDialog * This,

+            /* [in] */ ULONG_PTR owner_hwnd,

+            /* [in] */ BSTR server,

+            /* [in] */ BSTR message,

+            /* [out] */ BSTR *username,

+            /* [out] */ BSTR *password);

+        

+        END_INTERFACE

+    } ICredentialDialogVtbl;

+

+    interface ICredentialDialog

+    {

+        CONST_VTBL struct ICredentialDialogVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define ICredentialDialog_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define ICredentialDialog_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define ICredentialDialog_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define ICredentialDialog_QueryUserForCredentials(This,owner_hwnd,server,message,username,password)	\

+    ( (This)->lpVtbl -> QueryUserForCredentials(This,owner_hwnd,server,message,username,password) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __ICredentialDialog_INTERFACE_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3Web_INTERFACE_DEFINED__

+#define __IGoogleUpdate3Web_INTERFACE_DEFINED__

+

+/* interface IGoogleUpdate3Web */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IGoogleUpdate3Web;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("6dffe7fe-3153-4af1-95d8-f8fcca97e56b")

+    IGoogleUpdate3Web : public IDispatch

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE createAppBundleWeb( 

+            /* [retval][out] */ IDispatch **app_bundle_web) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IGoogleUpdate3WebVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IGoogleUpdate3Web * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IGoogleUpdate3Web * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IGoogleUpdate3Web * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IGoogleUpdate3Web * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IGoogleUpdate3Web * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IGoogleUpdate3Web * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IGoogleUpdate3Web * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        HRESULT ( STDMETHODCALLTYPE *createAppBundleWeb )( 

+            IGoogleUpdate3Web * This,

+            /* [retval][out] */ IDispatch **app_bundle_web);

+        

+        END_INTERFACE

+    } IGoogleUpdate3WebVtbl;

+

+    interface IGoogleUpdate3Web

+    {

+        CONST_VTBL struct IGoogleUpdate3WebVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IGoogleUpdate3Web_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IGoogleUpdate3Web_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IGoogleUpdate3Web_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IGoogleUpdate3Web_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IGoogleUpdate3Web_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IGoogleUpdate3Web_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IGoogleUpdate3Web_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IGoogleUpdate3Web_createAppBundleWeb(This,app_bundle_web)	\

+    ( (This)->lpVtbl -> createAppBundleWeb(This,app_bundle_web) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IGoogleUpdate3Web_INTERFACE_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate3WebSecurity_INTERFACE_DEFINED__

+#define __IGoogleUpdate3WebSecurity_INTERFACE_DEFINED__

+

+/* interface IGoogleUpdate3WebSecurity */

+/* [unique][helpstring][uuid][object] */ 

+

+

+EXTERN_C const IID IID_IGoogleUpdate3WebSecurity;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("1b9063e4-3882-485e-8797-f28a0240782f")

+    IGoogleUpdate3WebSecurity : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE setOriginURL( 

+            /* [in] */ BSTR origin_url) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IGoogleUpdate3WebSecurityVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IGoogleUpdate3WebSecurity * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IGoogleUpdate3WebSecurity * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IGoogleUpdate3WebSecurity * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *setOriginURL )( 

+            IGoogleUpdate3WebSecurity * This,

+            /* [in] */ BSTR origin_url);

+        

+        END_INTERFACE

+    } IGoogleUpdate3WebSecurityVtbl;

+

+    interface IGoogleUpdate3WebSecurity

+    {

+        CONST_VTBL struct IGoogleUpdate3WebSecurityVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IGoogleUpdate3WebSecurity_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IGoogleUpdate3WebSecurity_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IGoogleUpdate3WebSecurity_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IGoogleUpdate3WebSecurity_setOriginURL(This,origin_url)	\

+    ( (This)->lpVtbl -> setOriginURL(This,origin_url) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IGoogleUpdate3WebSecurity_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppBundleWeb_INTERFACE_DEFINED__

+#define __IAppBundleWeb_INTERFACE_DEFINED__

+

+/* interface IAppBundleWeb */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppBundleWeb;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("837e40da-eb1b-440c-8623-0f14df158dc0")

+    IAppBundleWeb : public IDispatch

+    {

+    public:

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createApp( 

+            /* [in] */ BSTR app_guid,

+            /* [in] */ BSTR brand_code,

+            /* [in] */ BSTR language,

+            /* [in] */ BSTR ap) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createInstalledApp( 

+            /* [in] */ BSTR app_id) = 0;

+        

+        virtual /* [id] */ HRESULT STDMETHODCALLTYPE createAllInstalledApps( void) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_displayLanguage( 

+            /* [retval][out] */ BSTR *__MIDL__IAppBundleWeb0000) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_displayLanguage( 

+            /* [in] */ BSTR __MIDL__IAppBundleWeb0001) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_parentHWND( 

+            /* [in] */ ULONG_PTR hwnd) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_length( 

+            /* [retval][out] */ int *index) = 0;

+        

+        virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_appWeb( 

+            /* [in] */ int index,

+            /* [retval][out] */ IDispatch **app_web) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE initialize( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE checkForUpdate( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE download( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE install( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE pause( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE resume( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE cancel( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE downloadPackage( 

+            /* [in] */ BSTR app_id,

+            /* [in] */ BSTR package_name) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_currentState( 

+            /* [retval][out] */ VARIANT *current_state) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppBundleWebVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppBundleWeb * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppBundleWeb * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppBundleWeb * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppBundleWeb * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppBundleWeb * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppBundleWeb * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createApp )( 

+            IAppBundleWeb * This,

+            /* [in] */ BSTR app_guid,

+            /* [in] */ BSTR brand_code,

+            /* [in] */ BSTR language,

+            /* [in] */ BSTR ap);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createInstalledApp )( 

+            IAppBundleWeb * This,

+            /* [in] */ BSTR app_id);

+        

+        /* [id] */ HRESULT ( STDMETHODCALLTYPE *createAllInstalledApps )( 

+            IAppBundleWeb * This);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_displayLanguage )( 

+            IAppBundleWeb * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppBundleWeb0000);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_displayLanguage )( 

+            IAppBundleWeb * This,

+            /* [in] */ BSTR __MIDL__IAppBundleWeb0001);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_parentHWND )( 

+            IAppBundleWeb * This,

+            /* [in] */ ULONG_PTR hwnd);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( 

+            IAppBundleWeb * This,

+            /* [retval][out] */ int *index);

+        

+        /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_appWeb )( 

+            IAppBundleWeb * This,

+            /* [in] */ int index,

+            /* [retval][out] */ IDispatch **app_web);

+        

+        HRESULT ( STDMETHODCALLTYPE *initialize )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *checkForUpdate )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *download )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *install )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *pause )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *resume )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *cancel )( 

+            IAppBundleWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *downloadPackage )( 

+            IAppBundleWeb * This,

+            /* [in] */ BSTR app_id,

+            /* [in] */ BSTR package_name);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_currentState )( 

+            IAppBundleWeb * This,

+            /* [retval][out] */ VARIANT *current_state);

+        

+        END_INTERFACE

+    } IAppBundleWebVtbl;

+

+    interface IAppBundleWeb

+    {

+        CONST_VTBL struct IAppBundleWebVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppBundleWeb_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppBundleWeb_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppBundleWeb_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppBundleWeb_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppBundleWeb_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppBundleWeb_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppBundleWeb_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppBundleWeb_createApp(This,app_guid,brand_code,language,ap)	\

+    ( (This)->lpVtbl -> createApp(This,app_guid,brand_code,language,ap) ) 

+

+#define IAppBundleWeb_createInstalledApp(This,app_id)	\

+    ( (This)->lpVtbl -> createInstalledApp(This,app_id) ) 

+

+#define IAppBundleWeb_createAllInstalledApps(This)	\

+    ( (This)->lpVtbl -> createAllInstalledApps(This) ) 

+

+#define IAppBundleWeb_get_displayLanguage(This,__MIDL__IAppBundleWeb0000)	\

+    ( (This)->lpVtbl -> get_displayLanguage(This,__MIDL__IAppBundleWeb0000) ) 

+

+#define IAppBundleWeb_put_displayLanguage(This,__MIDL__IAppBundleWeb0001)	\

+    ( (This)->lpVtbl -> put_displayLanguage(This,__MIDL__IAppBundleWeb0001) ) 

+

+#define IAppBundleWeb_put_parentHWND(This,hwnd)	\

+    ( (This)->lpVtbl -> put_parentHWND(This,hwnd) ) 

+

+#define IAppBundleWeb_get_length(This,index)	\

+    ( (This)->lpVtbl -> get_length(This,index) ) 

+

+#define IAppBundleWeb_get_appWeb(This,index,app_web)	\

+    ( (This)->lpVtbl -> get_appWeb(This,index,app_web) ) 

+

+#define IAppBundleWeb_initialize(This)	\

+    ( (This)->lpVtbl -> initialize(This) ) 

+

+#define IAppBundleWeb_checkForUpdate(This)	\

+    ( (This)->lpVtbl -> checkForUpdate(This) ) 

+

+#define IAppBundleWeb_download(This)	\

+    ( (This)->lpVtbl -> download(This) ) 

+

+#define IAppBundleWeb_install(This)	\

+    ( (This)->lpVtbl -> install(This) ) 

+

+#define IAppBundleWeb_pause(This)	\

+    ( (This)->lpVtbl -> pause(This) ) 

+

+#define IAppBundleWeb_resume(This)	\

+    ( (This)->lpVtbl -> resume(This) ) 

+

+#define IAppBundleWeb_cancel(This)	\

+    ( (This)->lpVtbl -> cancel(This) ) 

+

+#define IAppBundleWeb_downloadPackage(This,app_id,package_name)	\

+    ( (This)->lpVtbl -> downloadPackage(This,app_id,package_name) ) 

+

+#define IAppBundleWeb_get_currentState(This,current_state)	\

+    ( (This)->lpVtbl -> get_currentState(This,current_state) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppBundleWeb_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppWeb_INTERFACE_DEFINED__

+#define __IAppWeb_INTERFACE_DEFINED__

+

+/* interface IAppWeb */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppWeb;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("3a49f783-1c7d-4d35-8f63-5c1c206b9b6e")

+    IAppWeb : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_appId( 

+            /* [retval][out] */ BSTR *__MIDL__IAppWeb0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_currentVersionWeb( 

+            /* [retval][out] */ IDispatch **current) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextVersionWeb( 

+            /* [retval][out] */ IDispatch **next) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_command( 

+            /* [in] */ BSTR command_id,

+            /* [retval][out] */ IDispatch **command) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE cancel( void) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_currentState( 

+            /* [retval][out] */ IDispatch **current_state) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE launch( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE uninstall( void) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_serverInstallDataIndex( 

+            /* [retval][out] */ BSTR *__MIDL__IAppWeb0001) = 0;

+        

+        virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_serverInstallDataIndex( 

+            /* [in] */ BSTR __MIDL__IAppWeb0002) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppWebVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppWeb * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppWeb * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppWeb * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppWeb * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppWeb * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppWeb * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_appId )( 

+            IAppWeb * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppWeb0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_currentVersionWeb )( 

+            IAppWeb * This,

+            /* [retval][out] */ IDispatch **current);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextVersionWeb )( 

+            IAppWeb * This,

+            /* [retval][out] */ IDispatch **next);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_command )( 

+            IAppWeb * This,

+            /* [in] */ BSTR command_id,

+            /* [retval][out] */ IDispatch **command);

+        

+        HRESULT ( STDMETHODCALLTYPE *cancel )( 

+            IAppWeb * This);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_currentState )( 

+            IAppWeb * This,

+            /* [retval][out] */ IDispatch **current_state);

+        

+        HRESULT ( STDMETHODCALLTYPE *launch )( 

+            IAppWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *uninstall )( 

+            IAppWeb * This);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_serverInstallDataIndex )( 

+            IAppWeb * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppWeb0001);

+        

+        /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_serverInstallDataIndex )( 

+            IAppWeb * This,

+            /* [in] */ BSTR __MIDL__IAppWeb0002);

+        

+        END_INTERFACE

+    } IAppWebVtbl;

+

+    interface IAppWeb

+    {

+        CONST_VTBL struct IAppWebVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppWeb_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppWeb_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppWeb_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppWeb_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppWeb_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppWeb_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppWeb_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppWeb_get_appId(This,__MIDL__IAppWeb0000)	\

+    ( (This)->lpVtbl -> get_appId(This,__MIDL__IAppWeb0000) ) 

+

+#define IAppWeb_get_currentVersionWeb(This,current)	\

+    ( (This)->lpVtbl -> get_currentVersionWeb(This,current) ) 

+

+#define IAppWeb_get_nextVersionWeb(This,next)	\

+    ( (This)->lpVtbl -> get_nextVersionWeb(This,next) ) 

+

+#define IAppWeb_get_command(This,command_id,command)	\

+    ( (This)->lpVtbl -> get_command(This,command_id,command) ) 

+

+#define IAppWeb_cancel(This)	\

+    ( (This)->lpVtbl -> cancel(This) ) 

+

+#define IAppWeb_get_currentState(This,current_state)	\

+    ( (This)->lpVtbl -> get_currentState(This,current_state) ) 

+

+#define IAppWeb_launch(This)	\

+    ( (This)->lpVtbl -> launch(This) ) 

+

+#define IAppWeb_uninstall(This)	\

+    ( (This)->lpVtbl -> uninstall(This) ) 

+

+#define IAppWeb_get_serverInstallDataIndex(This,__MIDL__IAppWeb0001)	\

+    ( (This)->lpVtbl -> get_serverInstallDataIndex(This,__MIDL__IAppWeb0001) ) 

+

+#define IAppWeb_put_serverInstallDataIndex(This,__MIDL__IAppWeb0002)	\

+    ( (This)->lpVtbl -> put_serverInstallDataIndex(This,__MIDL__IAppWeb0002) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppWeb_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppCommandWeb_INTERFACE_DEFINED__

+#define __IAppCommandWeb_INTERFACE_DEFINED__

+

+/* interface IAppCommandWeb */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppCommandWeb;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("2ec826cb-5478-4533-9015-7580b3b5e03a")

+    IAppCommandWeb : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_status( 

+            /* [retval][out] */ UINT *__MIDL__IAppCommandWeb0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_exitCode( 

+            /* [retval][out] */ DWORD *__MIDL__IAppCommandWeb0001) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_output( 

+            /* [retval][out] */ BSTR *__MIDL__IAppCommandWeb0002) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE execute( 

+            /* [optional][in] */ VARIANT arg1,

+            /* [optional][in] */ VARIANT arg2,

+            /* [optional][in] */ VARIANT arg3,

+            /* [optional][in] */ VARIANT arg4,

+            /* [optional][in] */ VARIANT arg5,

+            /* [optional][in] */ VARIANT arg6,

+            /* [optional][in] */ VARIANT arg7,

+            /* [optional][in] */ VARIANT arg8,

+            /* [optional][in] */ VARIANT arg9) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppCommandWebVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppCommandWeb * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppCommandWeb * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppCommandWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppCommandWeb * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppCommandWeb * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppCommandWeb * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppCommandWeb * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( 

+            IAppCommandWeb * This,

+            /* [retval][out] */ UINT *__MIDL__IAppCommandWeb0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_exitCode )( 

+            IAppCommandWeb * This,

+            /* [retval][out] */ DWORD *__MIDL__IAppCommandWeb0001);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( 

+            IAppCommandWeb * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppCommandWeb0002);

+        

+        HRESULT ( STDMETHODCALLTYPE *execute )( 

+            IAppCommandWeb * This,

+            /* [optional][in] */ VARIANT arg1,

+            /* [optional][in] */ VARIANT arg2,

+            /* [optional][in] */ VARIANT arg3,

+            /* [optional][in] */ VARIANT arg4,

+            /* [optional][in] */ VARIANT arg5,

+            /* [optional][in] */ VARIANT arg6,

+            /* [optional][in] */ VARIANT arg7,

+            /* [optional][in] */ VARIANT arg8,

+            /* [optional][in] */ VARIANT arg9);

+        

+        END_INTERFACE

+    } IAppCommandWebVtbl;

+

+    interface IAppCommandWeb

+    {

+        CONST_VTBL struct IAppCommandWebVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppCommandWeb_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppCommandWeb_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppCommandWeb_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppCommandWeb_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppCommandWeb_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppCommandWeb_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppCommandWeb_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppCommandWeb_get_status(This,__MIDL__IAppCommandWeb0000)	\

+    ( (This)->lpVtbl -> get_status(This,__MIDL__IAppCommandWeb0000) ) 

+

+#define IAppCommandWeb_get_exitCode(This,__MIDL__IAppCommandWeb0001)	\

+    ( (This)->lpVtbl -> get_exitCode(This,__MIDL__IAppCommandWeb0001) ) 

+

+#define IAppCommandWeb_get_output(This,__MIDL__IAppCommandWeb0002)	\

+    ( (This)->lpVtbl -> get_output(This,__MIDL__IAppCommandWeb0002) ) 

+

+#define IAppCommandWeb_execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)	\

+    ( (This)->lpVtbl -> execute(This,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppCommandWeb_INTERFACE_DEFINED__ */

+

+

+#ifndef __IAppVersionWeb_INTERFACE_DEFINED__

+#define __IAppVersionWeb_INTERFACE_DEFINED__

+

+/* interface IAppVersionWeb */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_IAppVersionWeb;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("450cf5ff-95c4-4679-beca-22680389ecb9")

+    IAppVersionWeb : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_version( 

+            /* [retval][out] */ BSTR *__MIDL__IAppVersionWeb0000) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_packageCount( 

+            /* [retval][out] */ long *count) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_packageWeb( 

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **package) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IAppVersionWebVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IAppVersionWeb * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IAppVersionWeb * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IAppVersionWeb * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            IAppVersionWeb * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            IAppVersionWeb * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            IAppVersionWeb * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            IAppVersionWeb * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_version )( 

+            IAppVersionWeb * This,

+            /* [retval][out] */ BSTR *__MIDL__IAppVersionWeb0000);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCount )( 

+            IAppVersionWeb * This,

+            /* [retval][out] */ long *count);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageWeb )( 

+            IAppVersionWeb * This,

+            /* [in] */ long index,

+            /* [retval][out] */ IDispatch **package);

+        

+        END_INTERFACE

+    } IAppVersionWebVtbl;

+

+    interface IAppVersionWeb

+    {

+        CONST_VTBL struct IAppVersionWebVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IAppVersionWeb_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IAppVersionWeb_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IAppVersionWeb_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IAppVersionWeb_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define IAppVersionWeb_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define IAppVersionWeb_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define IAppVersionWeb_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define IAppVersionWeb_get_version(This,__MIDL__IAppVersionWeb0000)	\

+    ( (This)->lpVtbl -> get_version(This,__MIDL__IAppVersionWeb0000) ) 

+

+#define IAppVersionWeb_get_packageCount(This,count)	\

+    ( (This)->lpVtbl -> get_packageCount(This,count) ) 

+

+#define IAppVersionWeb_get_packageWeb(This,index,package)	\

+    ( (This)->lpVtbl -> get_packageWeb(This,index,package) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IAppVersionWeb_INTERFACE_DEFINED__ */

+

+

+#ifndef __ICoCreateAsyncStatus_INTERFACE_DEFINED__

+#define __ICoCreateAsyncStatus_INTERFACE_DEFINED__

+

+/* interface ICoCreateAsyncStatus */

+/* [unique][helpstring][uuid][dual][object] */ 

+

+

+EXTERN_C const IID IID_ICoCreateAsyncStatus;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("9a6b447a-35e2-4f6b-a87b-5deebbfdad17")

+    ICoCreateAsyncStatus : public IDispatch

+    {

+    public:

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isDone( 

+            /* [retval][out] */ VARIANT_BOOL *is_done) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_completionHResult( 

+            /* [retval][out] */ LONG *hr) = 0;

+        

+        virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_createdInstance( 

+            /* [retval][out] */ IDispatch **instance) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct ICoCreateAsyncStatusVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            ICoCreateAsyncStatus * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            ICoCreateAsyncStatus * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            ICoCreateAsyncStatus * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( 

+            ICoCreateAsyncStatus * This,

+            /* [out] */ UINT *pctinfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( 

+            ICoCreateAsyncStatus * This,

+            /* [in] */ UINT iTInfo,

+            /* [in] */ LCID lcid,

+            /* [out] */ ITypeInfo **ppTInfo);

+        

+        HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( 

+            ICoCreateAsyncStatus * This,

+            /* [in] */ REFIID riid,

+            /* [size_is][in] */ LPOLESTR *rgszNames,

+            /* [range][in] */ UINT cNames,

+            /* [in] */ LCID lcid,

+            /* [size_is][out] */ DISPID *rgDispId);

+        

+        /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( 

+            ICoCreateAsyncStatus * This,

+            /* [annotation][in] */ 

+            _In_  DISPID dispIdMember,

+            /* [annotation][in] */ 

+            _In_  REFIID riid,

+            /* [annotation][in] */ 

+            _In_  LCID lcid,

+            /* [annotation][in] */ 

+            _In_  WORD wFlags,

+            /* [annotation][out][in] */ 

+            _In_  DISPPARAMS *pDispParams,

+            /* [annotation][out] */ 

+            _Out_opt_  VARIANT *pVarResult,

+            /* [annotation][out] */ 

+            _Out_opt_  EXCEPINFO *pExcepInfo,

+            /* [annotation][out] */ 

+            _Out_opt_  UINT *puArgErr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isDone )( 

+            ICoCreateAsyncStatus * This,

+            /* [retval][out] */ VARIANT_BOOL *is_done);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_completionHResult )( 

+            ICoCreateAsyncStatus * This,

+            /* [retval][out] */ LONG *hr);

+        

+        /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_createdInstance )( 

+            ICoCreateAsyncStatus * This,

+            /* [retval][out] */ IDispatch **instance);

+        

+        END_INTERFACE

+    } ICoCreateAsyncStatusVtbl;

+

+    interface ICoCreateAsyncStatus

+    {

+        CONST_VTBL struct ICoCreateAsyncStatusVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define ICoCreateAsyncStatus_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define ICoCreateAsyncStatus_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define ICoCreateAsyncStatus_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define ICoCreateAsyncStatus_GetTypeInfoCount(This,pctinfo)	\

+    ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) 

+

+#define ICoCreateAsyncStatus_GetTypeInfo(This,iTInfo,lcid,ppTInfo)	\

+    ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) 

+

+#define ICoCreateAsyncStatus_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)	\

+    ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) 

+

+#define ICoCreateAsyncStatus_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)	\

+    ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) 

+

+

+#define ICoCreateAsyncStatus_get_isDone(This,is_done)	\

+    ( (This)->lpVtbl -> get_isDone(This,is_done) ) 

+

+#define ICoCreateAsyncStatus_get_completionHResult(This,hr)	\

+    ( (This)->lpVtbl -> get_completionHResult(This,hr) ) 

+

+#define ICoCreateAsyncStatus_get_createdInstance(This,instance)	\

+    ( (This)->lpVtbl -> get_createdInstance(This,instance) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __ICoCreateAsyncStatus_INTERFACE_DEFINED__ */

+

+

+#ifndef __ICoCreateAsync_INTERFACE_DEFINED__

+#define __ICoCreateAsync_INTERFACE_DEFINED__

+

+/* interface ICoCreateAsync */

+/* [unique][helpstring][uuid][object] */ 

+

+

+EXTERN_C const IID IID_ICoCreateAsync;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("c20433b3-0d4b-49f6-9b6c-6ee0fae07837")

+    ICoCreateAsync : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE createOmahaMachineServerAsync( 

+            /* [in] */ BSTR origin_url,

+            /* [in] */ BOOL create_elevated,

+            /* [retval][out] */ ICoCreateAsyncStatus **status) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct ICoCreateAsyncVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            ICoCreateAsync * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            ICoCreateAsync * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            ICoCreateAsync * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *createOmahaMachineServerAsync )( 

+            ICoCreateAsync * This,

+            /* [in] */ BSTR origin_url,

+            /* [in] */ BOOL create_elevated,

+            /* [retval][out] */ ICoCreateAsyncStatus **status);

+        

+        END_INTERFACE

+    } ICoCreateAsyncVtbl;

+

+    interface ICoCreateAsync

+    {

+        CONST_VTBL struct ICoCreateAsyncVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define ICoCreateAsync_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define ICoCreateAsync_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define ICoCreateAsync_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define ICoCreateAsync_createOmahaMachineServerAsync(This,origin_url,create_elevated,status)	\

+    ( (This)->lpVtbl -> createOmahaMachineServerAsync(This,origin_url,create_elevated,status) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __ICoCreateAsync_INTERFACE_DEFINED__ */

+

+

+#ifndef __IBrowserHttpRequest2_INTERFACE_DEFINED__

+#define __IBrowserHttpRequest2_INTERFACE_DEFINED__

+

+/* interface IBrowserHttpRequest2 */

+/* [unique][nonextensible][oleautomation][uuid][object] */ 

+

+

+EXTERN_C const IID IID_IBrowserHttpRequest2;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("e4518371-7326-4865-87f8-d9d3f3b287a3")

+    IBrowserHttpRequest2 : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE Send( 

+            /* [in] */ BSTR url,

+            /* [in] */ BSTR post_data,

+            /* [in] */ BSTR request_headers,

+            /* [in] */ VARIANT response_headers_needed,

+            /* [out] */ VARIANT *response_headers,

+            /* [out] */ DWORD *response_code,

+            /* [out] */ BSTR *cache_filename) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IBrowserHttpRequest2Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IBrowserHttpRequest2 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IBrowserHttpRequest2 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IBrowserHttpRequest2 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *Send )( 

+            IBrowserHttpRequest2 * This,

+            /* [in] */ BSTR url,

+            /* [in] */ BSTR post_data,

+            /* [in] */ BSTR request_headers,

+            /* [in] */ VARIANT response_headers_needed,

+            /* [out] */ VARIANT *response_headers,

+            /* [out] */ DWORD *response_code,

+            /* [out] */ BSTR *cache_filename);

+        

+        END_INTERFACE

+    } IBrowserHttpRequest2Vtbl;

+

+    interface IBrowserHttpRequest2

+    {

+        CONST_VTBL struct IBrowserHttpRequest2Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IBrowserHttpRequest2_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IBrowserHttpRequest2_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IBrowserHttpRequest2_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IBrowserHttpRequest2_Send(This,url,post_data,request_headers,response_headers_needed,response_headers,response_code,cache_filename)	\

+    ( (This)->lpVtbl -> Send(This,url,post_data,request_headers,response_headers_needed,response_headers,response_code,cache_filename) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IBrowserHttpRequest2_INTERFACE_DEFINED__ */

+

+

+#ifndef __IProcessLauncher_INTERFACE_DEFINED__

+#define __IProcessLauncher_INTERFACE_DEFINED__

+

+/* interface IProcessLauncher */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IProcessLauncher;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("a5135e58-384f-4244-9a5f-30fa9259413c")

+    IProcessLauncher : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE LaunchCmdLine( 

+            /* [string][in] */ const WCHAR *cmd_line) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE LaunchBrowser( 

+            /* [in] */ DWORD browser_type,

+            /* [string][in] */ const WCHAR *url) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE LaunchCmdElevated( 

+            /* [string][in] */ const WCHAR *app_guid,

+            /* [string][in] */ const WCHAR *cmd_id,

+            /* [in] */ DWORD caller_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IProcessLauncherVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IProcessLauncher * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IProcessLauncher * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IProcessLauncher * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdLine )( 

+            IProcessLauncher * This,

+            /* [string][in] */ const WCHAR *cmd_line);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchBrowser )( 

+            IProcessLauncher * This,

+            /* [in] */ DWORD browser_type,

+            /* [string][in] */ const WCHAR *url);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdElevated )( 

+            IProcessLauncher * This,

+            /* [string][in] */ const WCHAR *app_guid,

+            /* [string][in] */ const WCHAR *cmd_id,

+            /* [in] */ DWORD caller_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle);

+        

+        END_INTERFACE

+    } IProcessLauncherVtbl;

+

+    interface IProcessLauncher

+    {

+        CONST_VTBL struct IProcessLauncherVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IProcessLauncher_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IProcessLauncher_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IProcessLauncher_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IProcessLauncher_LaunchCmdLine(This,cmd_line)	\

+    ( (This)->lpVtbl -> LaunchCmdLine(This,cmd_line) ) 

+

+#define IProcessLauncher_LaunchBrowser(This,browser_type,url)	\

+    ( (This)->lpVtbl -> LaunchBrowser(This,browser_type,url) ) 

+

+#define IProcessLauncher_LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle)	\

+    ( (This)->lpVtbl -> LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IProcessLauncher_INTERFACE_DEFINED__ */

+

+

+#ifndef __IProcessLauncher2_INTERFACE_DEFINED__

+#define __IProcessLauncher2_INTERFACE_DEFINED__

+

+/* interface IProcessLauncher2 */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IProcessLauncher2;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("a6556dff-ab15-4dc3-a890-ab54120beaec")

+    IProcessLauncher2 : public IProcessLauncher

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE LaunchCmdLineEx( 

+            /* [string][in] */ const WCHAR *cmd_line,

+            /* [out] */ DWORD *server_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle,

+            /* [out] */ ULONG_PTR *stdout_handle) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IProcessLauncher2Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IProcessLauncher2 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IProcessLauncher2 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IProcessLauncher2 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdLine )( 

+            IProcessLauncher2 * This,

+            /* [string][in] */ const WCHAR *cmd_line);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchBrowser )( 

+            IProcessLauncher2 * This,

+            /* [in] */ DWORD browser_type,

+            /* [string][in] */ const WCHAR *url);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdElevated )( 

+            IProcessLauncher2 * This,

+            /* [string][in] */ const WCHAR *app_guid,

+            /* [string][in] */ const WCHAR *cmd_id,

+            /* [in] */ DWORD caller_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdLineEx )( 

+            IProcessLauncher2 * This,

+            /* [string][in] */ const WCHAR *cmd_line,

+            /* [out] */ DWORD *server_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle,

+            /* [out] */ ULONG_PTR *stdout_handle);

+        

+        END_INTERFACE

+    } IProcessLauncher2Vtbl;

+

+    interface IProcessLauncher2

+    {

+        CONST_VTBL struct IProcessLauncher2Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IProcessLauncher2_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IProcessLauncher2_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IProcessLauncher2_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IProcessLauncher2_LaunchCmdLine(This,cmd_line)	\

+    ( (This)->lpVtbl -> LaunchCmdLine(This,cmd_line) ) 

+

+#define IProcessLauncher2_LaunchBrowser(This,browser_type,url)	\

+    ( (This)->lpVtbl -> LaunchBrowser(This,browser_type,url) ) 

+

+#define IProcessLauncher2_LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle)	\

+    ( (This)->lpVtbl -> LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle) ) 

+

+

+#define IProcessLauncher2_LaunchCmdLineEx(This,cmd_line,server_proc_id,proc_handle,stdout_handle)	\

+    ( (This)->lpVtbl -> LaunchCmdLineEx(This,cmd_line,server_proc_id,proc_handle,stdout_handle) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IProcessLauncher2_INTERFACE_DEFINED__ */

+

+

+/* interface __MIDL_itf_google_update_idl_0000_0022 */

+/* [local] */ 

+

+typedef /* [public][public] */ 

+enum __MIDL___MIDL_itf_google_update_idl_0000_0022_0001

+    {

+        COMPLETION_CODE_SUCCESS	= 1,

+        COMPLETION_CODE_SUCCESS_CLOSE_UI	= ( COMPLETION_CODE_SUCCESS + 1 ) ,

+        COMPLETION_CODE_ERROR	= ( COMPLETION_CODE_SUCCESS_CLOSE_UI + 1 ) ,

+        COMPLETION_CODE_RESTART_ALL_BROWSERS	= ( COMPLETION_CODE_ERROR + 1 ) ,

+        COMPLETION_CODE_REBOOT	= ( COMPLETION_CODE_RESTART_ALL_BROWSERS + 1 ) ,

+        COMPLETION_CODE_RESTART_BROWSER	= ( COMPLETION_CODE_REBOOT + 1 ) ,

+        COMPLETION_CODE_RESTART_ALL_BROWSERS_NOTICE_ONLY	= ( COMPLETION_CODE_RESTART_BROWSER + 1 ) ,

+        COMPLETION_CODE_REBOOT_NOTICE_ONLY	= ( COMPLETION_CODE_RESTART_ALL_BROWSERS_NOTICE_ONLY + 1 ) ,

+        COMPLETION_CODE_RESTART_BROWSER_NOTICE_ONLY	= ( COMPLETION_CODE_REBOOT_NOTICE_ONLY + 1 ) ,

+        COMPLETION_CODE_RUN_COMMAND	= ( COMPLETION_CODE_RESTART_BROWSER_NOTICE_ONLY + 1 ) 

+    } 	LegacyCompletionCodes;

+

+

+

+extern RPC_IF_HANDLE __MIDL_itf_google_update_idl_0000_0022_v0_0_c_ifspec;

+extern RPC_IF_HANDLE __MIDL_itf_google_update_idl_0000_0022_v0_0_s_ifspec;

+

+#ifndef __IProgressWndEvents_INTERFACE_DEFINED__

+#define __IProgressWndEvents_INTERFACE_DEFINED__

+

+/* interface IProgressWndEvents */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IProgressWndEvents;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("e55b90f1-da33-400b-b09e-3aff7d46bd83")

+    IProgressWndEvents : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE DoClose( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE DoPause( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE DoResume( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE DoRestartBrowsers( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE DoReboot( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE DoLaunchBrowser( 

+            /* [string][in] */ const WCHAR *url) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IProgressWndEventsVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IProgressWndEvents * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IProgressWndEvents * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoClose )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoPause )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoResume )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoRestartBrowsers )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoReboot )( 

+            IProgressWndEvents * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *DoLaunchBrowser )( 

+            IProgressWndEvents * This,

+            /* [string][in] */ const WCHAR *url);

+        

+        END_INTERFACE

+    } IProgressWndEventsVtbl;

+

+    interface IProgressWndEvents

+    {

+        CONST_VTBL struct IProgressWndEventsVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IProgressWndEvents_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IProgressWndEvents_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IProgressWndEvents_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IProgressWndEvents_DoClose(This)	\

+    ( (This)->lpVtbl -> DoClose(This) ) 

+

+#define IProgressWndEvents_DoPause(This)	\

+    ( (This)->lpVtbl -> DoPause(This) ) 

+

+#define IProgressWndEvents_DoResume(This)	\

+    ( (This)->lpVtbl -> DoResume(This) ) 

+

+#define IProgressWndEvents_DoRestartBrowsers(This)	\

+    ( (This)->lpVtbl -> DoRestartBrowsers(This) ) 

+

+#define IProgressWndEvents_DoReboot(This)	\

+    ( (This)->lpVtbl -> DoReboot(This) ) 

+

+#define IProgressWndEvents_DoLaunchBrowser(This,url)	\

+    ( (This)->lpVtbl -> DoLaunchBrowser(This,url) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IProgressWndEvents_INTERFACE_DEFINED__ */

+

+

+#ifndef __IJobObserver_INTERFACE_DEFINED__

+#define __IJobObserver_INTERFACE_DEFINED__

+

+/* interface IJobObserver */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IJobObserver;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("99f8e195-1042-4f89-a28c-89cdb74a14ae")

+    IJobObserver : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE OnShow( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnCheckingForUpdate( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnUpdateAvailable( 

+            /* [string][in] */ const WCHAR *version_string) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnWaitingToDownload( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnDownloading( 

+            /* [in] */ int time_remaining_ms,

+            /* [in] */ int pos) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnWaitingToInstall( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnInstalling( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnPause( void) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE OnComplete( 

+            /* [in] */ LegacyCompletionCodes code,

+            /* [string][in] */ const WCHAR *completion_text) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE SetEventSink( 

+            /* [in] */ IProgressWndEvents *ui_sink) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IJobObserverVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IJobObserver * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IJobObserver * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnShow )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnCheckingForUpdate )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnUpdateAvailable )( 

+            IJobObserver * This,

+            /* [string][in] */ const WCHAR *version_string);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnWaitingToDownload )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnDownloading )( 

+            IJobObserver * This,

+            /* [in] */ int time_remaining_ms,

+            /* [in] */ int pos);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnWaitingToInstall )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnInstalling )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnPause )( 

+            IJobObserver * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnComplete )( 

+            IJobObserver * This,

+            /* [in] */ LegacyCompletionCodes code,

+            /* [string][in] */ const WCHAR *completion_text);

+        

+        HRESULT ( STDMETHODCALLTYPE *SetEventSink )( 

+            IJobObserver * This,

+            /* [in] */ IProgressWndEvents *ui_sink);

+        

+        END_INTERFACE

+    } IJobObserverVtbl;

+

+    interface IJobObserver

+    {

+        CONST_VTBL struct IJobObserverVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IJobObserver_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IJobObserver_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IJobObserver_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IJobObserver_OnShow(This)	\

+    ( (This)->lpVtbl -> OnShow(This) ) 

+

+#define IJobObserver_OnCheckingForUpdate(This)	\

+    ( (This)->lpVtbl -> OnCheckingForUpdate(This) ) 

+

+#define IJobObserver_OnUpdateAvailable(This,version_string)	\

+    ( (This)->lpVtbl -> OnUpdateAvailable(This,version_string) ) 

+

+#define IJobObserver_OnWaitingToDownload(This)	\

+    ( (This)->lpVtbl -> OnWaitingToDownload(This) ) 

+

+#define IJobObserver_OnDownloading(This,time_remaining_ms,pos)	\

+    ( (This)->lpVtbl -> OnDownloading(This,time_remaining_ms,pos) ) 

+

+#define IJobObserver_OnWaitingToInstall(This)	\

+    ( (This)->lpVtbl -> OnWaitingToInstall(This) ) 

+

+#define IJobObserver_OnInstalling(This)	\

+    ( (This)->lpVtbl -> OnInstalling(This) ) 

+

+#define IJobObserver_OnPause(This)	\

+    ( (This)->lpVtbl -> OnPause(This) ) 

+

+#define IJobObserver_OnComplete(This,code,completion_text)	\

+    ( (This)->lpVtbl -> OnComplete(This,code,completion_text) ) 

+

+#define IJobObserver_SetEventSink(This,ui_sink)	\

+    ( (This)->lpVtbl -> SetEventSink(This,ui_sink) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IJobObserver_INTERFACE_DEFINED__ */

+

+

+#ifndef __IJobObserver2_INTERFACE_DEFINED__

+#define __IJobObserver2_INTERFACE_DEFINED__

+

+/* interface IJobObserver2 */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IJobObserver2;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("d9aa3288-4ea7-4e67-ae60-d18eadcb923d")

+    IJobObserver2 : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE OnInstalling2( 

+            /* [in] */ int time_remaining_ms,

+            /* [in] */ int pos) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IJobObserver2Vtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IJobObserver2 * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IJobObserver2 * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IJobObserver2 * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *OnInstalling2 )( 

+            IJobObserver2 * This,

+            /* [in] */ int time_remaining_ms,

+            /* [in] */ int pos);

+        

+        END_INTERFACE

+    } IJobObserver2Vtbl;

+

+    interface IJobObserver2

+    {

+        CONST_VTBL struct IJobObserver2Vtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IJobObserver2_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IJobObserver2_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IJobObserver2_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IJobObserver2_OnInstalling2(This,time_remaining_ms,pos)	\

+    ( (This)->lpVtbl -> OnInstalling2(This,time_remaining_ms,pos) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IJobObserver2_INTERFACE_DEFINED__ */

+

+

+#ifndef __IGoogleUpdate_INTERFACE_DEFINED__

+#define __IGoogleUpdate_INTERFACE_DEFINED__

+

+/* interface IGoogleUpdate */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IGoogleUpdate;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("79e0c401-b7bc-4de5-8104-71350f3a9b67")

+    IGoogleUpdate : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE CheckForUpdate( 

+            /* [string][in] */ const WCHAR *guid,

+            /* [in] */ IJobObserver *observer) = 0;

+        

+        virtual HRESULT STDMETHODCALLTYPE Update( 

+            /* [string][in] */ const WCHAR *guid,

+            /* [in] */ IJobObserver *observer) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IGoogleUpdateVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IGoogleUpdate * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IGoogleUpdate * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IGoogleUpdate * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *CheckForUpdate )( 

+            IGoogleUpdate * This,

+            /* [string][in] */ const WCHAR *guid,

+            /* [in] */ IJobObserver *observer);

+        

+        HRESULT ( STDMETHODCALLTYPE *Update )( 

+            IGoogleUpdate * This,

+            /* [string][in] */ const WCHAR *guid,

+            /* [in] */ IJobObserver *observer);

+        

+        END_INTERFACE

+    } IGoogleUpdateVtbl;

+

+    interface IGoogleUpdate

+    {

+        CONST_VTBL struct IGoogleUpdateVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IGoogleUpdate_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IGoogleUpdate_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IGoogleUpdate_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IGoogleUpdate_CheckForUpdate(This,guid,observer)	\

+    ( (This)->lpVtbl -> CheckForUpdate(This,guid,observer) ) 

+

+#define IGoogleUpdate_Update(This,guid,observer)	\

+    ( (This)->lpVtbl -> Update(This,guid,observer) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IGoogleUpdate_INTERFACE_DEFINED__ */

+

+

+#ifndef __IGoogleUpdateCore_INTERFACE_DEFINED__

+#define __IGoogleUpdateCore_INTERFACE_DEFINED__

+

+/* interface IGoogleUpdateCore */

+/* [unique][helpstring][uuid][oleautomation][object] */ 

+

+

+EXTERN_C const IID IID_IGoogleUpdateCore;

+

+#if defined(__cplusplus) && !defined(CINTERFACE)

+    

+    MIDL_INTERFACE("fce48f77-c677-4012-8a1a-54d2e2bc07bd")

+    IGoogleUpdateCore : public IUnknown

+    {

+    public:

+        virtual HRESULT STDMETHODCALLTYPE LaunchCmdElevated( 

+            /* [string][in] */ const WCHAR *app_guid,

+            /* [string][in] */ const WCHAR *cmd_id,

+            /* [in] */ DWORD caller_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle) = 0;

+        

+    };

+    

+    

+#else 	/* C style interface */

+

+    typedef struct IGoogleUpdateCoreVtbl

+    {

+        BEGIN_INTERFACE

+        

+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 

+            IGoogleUpdateCore * This,

+            /* [in] */ REFIID riid,

+            /* [annotation][iid_is][out] */ 

+            _COM_Outptr_  void **ppvObject);

+        

+        ULONG ( STDMETHODCALLTYPE *AddRef )( 

+            IGoogleUpdateCore * This);

+        

+        ULONG ( STDMETHODCALLTYPE *Release )( 

+            IGoogleUpdateCore * This);

+        

+        HRESULT ( STDMETHODCALLTYPE *LaunchCmdElevated )( 

+            IGoogleUpdateCore * This,

+            /* [string][in] */ const WCHAR *app_guid,

+            /* [string][in] */ const WCHAR *cmd_id,

+            /* [in] */ DWORD caller_proc_id,

+            /* [out] */ ULONG_PTR *proc_handle);

+        

+        END_INTERFACE

+    } IGoogleUpdateCoreVtbl;

+

+    interface IGoogleUpdateCore

+    {

+        CONST_VTBL struct IGoogleUpdateCoreVtbl *lpVtbl;

+    };

+

+    

+

+#ifdef COBJMACROS

+

+

+#define IGoogleUpdateCore_QueryInterface(This,riid,ppvObject)	\

+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

+

+#define IGoogleUpdateCore_AddRef(This)	\

+    ( (This)->lpVtbl -> AddRef(This) ) 

+

+#define IGoogleUpdateCore_Release(This)	\

+    ( (This)->lpVtbl -> Release(This) ) 

+

+

+#define IGoogleUpdateCore_LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle)	\

+    ( (This)->lpVtbl -> LaunchCmdElevated(This,app_guid,cmd_id,caller_proc_id,proc_handle) ) 

+

+#endif /* COBJMACROS */

+

+

+#endif 	/* C style interface */

+

+

+

+

+#endif 	/* __IGoogleUpdateCore_INTERFACE_DEFINED__ */

+

+

+

+#ifndef __GoogleUpdate3Lib_LIBRARY_DEFINED__

+#define __GoogleUpdate3Lib_LIBRARY_DEFINED__

+

+/* library GoogleUpdate3Lib */

+/* [helpstring][version][uuid] */ 

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+EXTERN_C const IID LIBID_GoogleUpdate3Lib;

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3UserClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("59e5039b-6524-481c-a78c-e680d7bf086c")

+GoogleUpdate3UserClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3ServiceClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("cecddd22-2e72-4832-9606-a9b0e5e344b2")

+GoogleUpdate3ServiceClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("02fcf358-fc8a-4ce4-ad4f-e29cd2d17a58")

+GoogleUpdate3WebUserClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3WebMachineClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("492e1c30-a1a2-4695-87c8-7a8cad6f936f")

+GoogleUpdate3WebMachineClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3WebServiceClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("ea92a799-267e-4df5-a6ed-6a7e0684bb8a")

+GoogleUpdate3WebServiceClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdate3WebMachineFallbackClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("e421557c-0628-43fb-bf2b-7c9f8a4d067c")

+GoogleUpdate3WebMachineFallbackClass;

+#endif

+

+EXTERN_C const CLSID CLSID_CurrentStateUserClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("5ea43877-c6d8-4885-b77a-c0bb27e94372")

+CurrentStateUserClass;

+#endif

+

+EXTERN_C const CLSID CLSID_CurrentStateMachineClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("a2f5cb38-265f-4a02-9d1e-f25b664968ab")

+CurrentStateMachineClass;

+#endif

+

+EXTERN_C const CLSID CLSID_CoCreateAsyncClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("5e2e78d4-43e7-4a98-b609-6089768f87f2")

+CoCreateAsyncClass;

+#endif

+

+EXTERN_C const CLSID CLSID_CredentialDialogUserClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("2f49c178-f8bf-43fd-b8f2-1a5b9d6bad8e")

+CredentialDialogUserClass;

+#endif

+

+EXTERN_C const CLSID CLSID_CredentialDialogMachineClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("5f6a18bb-6231-424b-8242-19e5bb94f8ed")

+CredentialDialogMachineClass;

+#endif

+

+EXTERN_C const CLSID CLSID_ProcessLauncherClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("08d832b9-d2fd-481f-98cf-904d00df63cc")

+ProcessLauncherClass;

+#endif

+

+EXTERN_C const CLSID CLSID_OnDemandUserAppsClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("e0dcae7c-1d0a-4ad0-b92c-2ffdaee1562b")

+OnDemandUserAppsClass;

+#endif

+

+EXTERN_C const CLSID CLSID_OnDemandMachineAppsClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("d1e8b1a6-32ce-443c-8e2e-eba90c481353")

+OnDemandMachineAppsClass;

+#endif

+

+EXTERN_C const CLSID CLSID_OnDemandMachineAppsServiceClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("a6b716cb-028b-404d-b72c-50e153dd68da")

+OnDemandMachineAppsServiceClass;

+#endif

+

+EXTERN_C const CLSID CLSID_OnDemandMachineAppsFallbackClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("ff419ff9-90be-4d9f-b410-a789f90e5a7c")

+OnDemandMachineAppsFallbackClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdateCoreClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("8f09cd6c-5964-4573-82e3-ebff7702865b")

+GoogleUpdateCoreClass;

+#endif

+

+EXTERN_C const CLSID CLSID_GoogleUpdateCoreMachineClass;

+

+#ifdef __cplusplus

+

+class DECLSPEC_UUID("2e1dd7ef-c12d-4f8e-8ad8-cf8cc265bad0")

+GoogleUpdateCoreMachineClass;

+#endif

+#endif /* __GoogleUpdate3Lib_LIBRARY_DEFINED__ */

+

+/* Additional Prototypes for ALL interfaces */

+

+unsigned long             __RPC_USER  BSTR_UserSize(     unsigned long *, unsigned long            , BSTR * ); 

+unsigned char * __RPC_USER  BSTR_UserMarshal(  unsigned long *, unsigned char *, BSTR * ); 

+unsigned char * __RPC_USER  BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); 

+void                      __RPC_USER  BSTR_UserFree(     unsigned long *, BSTR * ); 

+

+unsigned long             __RPC_USER  VARIANT_UserSize(     unsigned long *, unsigned long            , VARIANT * ); 

+unsigned char * __RPC_USER  VARIANT_UserMarshal(  unsigned long *, unsigned char *, VARIANT * ); 

+unsigned char * __RPC_USER  VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); 

+void                      __RPC_USER  VARIANT_UserFree(     unsigned long *, VARIANT * ); 

+

+/* end of Additional Prototypes */

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif

+

+

diff --git a/third_party/win_build_output/midl/google_update/arm64/google_update_idl.tlb b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.tlb
new file mode 100644
index 0000000..f755405
--- /dev/null
+++ b/third_party/win_build_output/midl/google_update/arm64/google_update_idl.tlb
Binary files differ
diff --git a/third_party/win_build_output/midl/google_update/arm64/google_update_idl_i.c b/third_party/win_build_output/midl/google_update/arm64/google_update_idl_i.c
new file mode 100644
index 0000000..56edce10
--- /dev/null
+++ b/third_party/win_build_output/midl/google_update/arm64/google_update_idl_i.c
@@ -0,0 +1,214 @@
+

+

+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */

+

+/* link this file in with the server and any clients */

+

+

+ /* File created by MIDL compiler version 8.xx.xxxx */

+/* at a redacted point in time

+ */

+/* Compiler settings for ../../google_update/google_update_idl.idl:

+    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=ARM64 8.01.0622 

+    protocol : dce , ms_ext, c_ext, robust

+    error checks: allocation ref bounds_check enum stub_data 

+    VC __declspec() decoration level: 

+         __declspec(uuid()), __declspec(selectany), __declspec(novtable)

+         DECLSPEC_UUID(), MIDL_INTERFACE()

+*/

+/* @@MIDL_FILE_HEADING(  ) */

+

+#pragma warning( disable: 4049 )  /* more than 64k source lines */

+

+

+#ifdef __cplusplus

+extern "C"{

+#endif 

+

+

+#include <rpc.h>

+#include <rpcndr.h>

+

+#ifdef _MIDL_USE_GUIDDEF_

+

+#ifndef INITGUID

+#define INITGUID

+#include <guiddef.h>

+#undef INITGUID

+#else

+#include <guiddef.h>

+#endif

+

+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \

+        DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)

+

+#else // !_MIDL_USE_GUIDDEF_

+

+#ifndef __IID_DEFINED__

+#define __IID_DEFINED__

+

+typedef struct _IID

+{

+    unsigned long x;

+    unsigned short s1;

+    unsigned short s2;

+    unsigned char  c[8];

+} IID;

+

+#endif // __IID_DEFINED__

+

+#ifndef CLSID_DEFINED

+#define CLSID_DEFINED

+typedef IID CLSID;

+#endif // CLSID_DEFINED

+

+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \

+        EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

+

+#endif // !_MIDL_USE_GUIDDEF_

+

+MIDL_DEFINE_GUID(IID, IID_IGoogleUpdate3,0xddd4b5d4,0xfd54,0x497c,0x87,0x89,0x08,0x30,0xf2,0x9a,0x60,0xee);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppBundle,0xab4f4a7e,0x977c,0x4e23,0xad,0x8f,0x62,0x6a,0x49,0x17,0x15,0xdf);

+

+

+MIDL_DEFINE_GUID(IID, IID_IApp,0x195a2eb3,0x21ee,0x43ca,0x9f,0x23,0x93,0xc2,0xc9,0x93,0x4e,0x2e);

+

+

+MIDL_DEFINE_GUID(IID, IID_IApp2,0xc06ee550,0x7248,0x488e,0x97,0x1e,0xb6,0x0c,0x0a,0xb3,0xa6,0xe4);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppCommand,0x5f9c80b5,0x9e50,0x43c9,0x88,0x7c,0x7c,0x64,0x12,0xe1,0x10,0xdf);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppCommand2,0x7e29be61,0x5809,0x443f,0x9b,0x5d,0xcf,0x22,0x15,0x66,0x94,0xeb);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppVersion,0x7b3b7a69,0x7d88,0x4847,0xa6,0xbc,0x90,0xe2,0x46,0xa4,0x1f,0x69);

+

+

+MIDL_DEFINE_GUID(IID, IID_IPackage,0xc853632e,0x36ca,0x4999,0xb9,0x92,0xec,0x0d,0x40,0x8c,0xf5,0xab);

+

+

+MIDL_DEFINE_GUID(IID, IID_ICurrentState,0x177cae89,0x4ad6,0x42f4,0xa4,0x58,0x00,0xec,0x33,0x89,0xe3,0xfe);

+

+

+MIDL_DEFINE_GUID(IID, IID_IRegistrationUpdateHook,0x3e102dc6,0x1edb,0x46a1,0x84,0x88,0x61,0xf7,0x1b,0x35,0xed,0x5f);

+

+

+MIDL_DEFINE_GUID(IID, IID_ICredentialDialog,0x2603c88b,0xf971,0x4167,0x9d,0xe1,0x87,0x1e,0xe4,0xa3,0xdc,0x84);

+

+

+MIDL_DEFINE_GUID(IID, IID_IGoogleUpdate3Web,0x6dffe7fe,0x3153,0x4af1,0x95,0xd8,0xf8,0xfc,0xca,0x97,0xe5,0x6b);

+

+

+MIDL_DEFINE_GUID(IID, IID_IGoogleUpdate3WebSecurity,0x1b9063e4,0x3882,0x485e,0x87,0x97,0xf2,0x8a,0x02,0x40,0x78,0x2f);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppBundleWeb,0x837e40da,0xeb1b,0x440c,0x86,0x23,0x0f,0x14,0xdf,0x15,0x8d,0xc0);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppWeb,0x3a49f783,0x1c7d,0x4d35,0x8f,0x63,0x5c,0x1c,0x20,0x6b,0x9b,0x6e);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppCommandWeb,0x2ec826cb,0x5478,0x4533,0x90,0x15,0x75,0x80,0xb3,0xb5,0xe0,0x3a);

+

+

+MIDL_DEFINE_GUID(IID, IID_IAppVersionWeb,0x450cf5ff,0x95c4,0x4679,0xbe,0xca,0x22,0x68,0x03,0x89,0xec,0xb9);

+

+

+MIDL_DEFINE_GUID(IID, IID_ICoCreateAsyncStatus,0x9a6b447a,0x35e2,0x4f6b,0xa8,0x7b,0x5d,0xee,0xbb,0xfd,0xad,0x17);

+

+

+MIDL_DEFINE_GUID(IID, IID_ICoCreateAsync,0xc20433b3,0x0d4b,0x49f6,0x9b,0x6c,0x6e,0xe0,0xfa,0xe0,0x78,0x37);

+

+

+MIDL_DEFINE_GUID(IID, IID_IBrowserHttpRequest2,0xe4518371,0x7326,0x4865,0x87,0xf8,0xd9,0xd3,0xf3,0xb2,0x87,0xa3);

+

+

+MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0xa5135e58,0x384f,0x4244,0x9a,0x5f,0x30,0xfa,0x92,0x59,0x41,0x3c);

+

+

+MIDL_DEFINE_GUID(IID, IID_IProcessLauncher2,0xa6556dff,0xab15,0x4dc3,0xa8,0x90,0xab,0x54,0x12,0x0b,0xea,0xec);

+

+

+MIDL_DEFINE_GUID(IID, IID_IProgressWndEvents,0xe55b90f1,0xda33,0x400b,0xb0,0x9e,0x3a,0xff,0x7d,0x46,0xbd,0x83);

+

+

+MIDL_DEFINE_GUID(IID, IID_IJobObserver,0x99f8e195,0x1042,0x4f89,0xa2,0x8c,0x89,0xcd,0xb7,0x4a,0x14,0xae);

+

+

+MIDL_DEFINE_GUID(IID, IID_IJobObserver2,0xd9aa3288,0x4ea7,0x4e67,0xae,0x60,0xd1,0x8e,0xad,0xcb,0x92,0x3d);

+

+

+MIDL_DEFINE_GUID(IID, IID_IGoogleUpdate,0x79e0c401,0xb7bc,0x4de5,0x81,0x04,0x71,0x35,0x0f,0x3a,0x9b,0x67);

+

+

+MIDL_DEFINE_GUID(IID, IID_IGoogleUpdateCore,0xfce48f77,0xc677,0x4012,0x8a,0x1a,0x54,0xd2,0xe2,0xbc,0x07,0xbd);

+

+

+MIDL_DEFINE_GUID(IID, LIBID_GoogleUpdate3Lib,0xf27928c7,0xea56,0x4faf,0x8a,0xfa,0x1c,0x3c,0x73,0x48,0xc7,0x4d);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3UserClass,0x59e5039b,0x6524,0x481c,0xa7,0x8c,0xe6,0x80,0xd7,0xbf,0x08,0x6c);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3ServiceClass,0xcecddd22,0x2e72,0x4832,0x96,0x06,0xa9,0xb0,0xe5,0xe3,0x44,0xb2);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3WebUserClass,0x02fcf358,0xfc8a,0x4ce4,0xad,0x4f,0xe2,0x9c,0xd2,0xd1,0x7a,0x58);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3WebMachineClass,0x492e1c30,0xa1a2,0x4695,0x87,0xc8,0x7a,0x8c,0xad,0x6f,0x93,0x6f);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3WebServiceClass,0xea92a799,0x267e,0x4df5,0xa6,0xed,0x6a,0x7e,0x06,0x84,0xbb,0x8a);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdate3WebMachineFallbackClass,0xe421557c,0x0628,0x43fb,0xbf,0x2b,0x7c,0x9f,0x8a,0x4d,0x06,0x7c);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_CurrentStateUserClass,0x5ea43877,0xc6d8,0x4885,0xb7,0x7a,0xc0,0xbb,0x27,0xe9,0x43,0x72);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_CurrentStateMachineClass,0xa2f5cb38,0x265f,0x4a02,0x9d,0x1e,0xf2,0x5b,0x66,0x49,0x68,0xab);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_CoCreateAsyncClass,0x5e2e78d4,0x43e7,0x4a98,0xb6,0x09,0x60,0x89,0x76,0x8f,0x87,0xf2);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_CredentialDialogUserClass,0x2f49c178,0xf8bf,0x43fd,0xb8,0xf2,0x1a,0x5b,0x9d,0x6b,0xad,0x8e);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_CredentialDialogMachineClass,0x5f6a18bb,0x6231,0x424b,0x82,0x42,0x19,0xe5,0xbb,0x94,0xf8,0xed);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_ProcessLauncherClass,0x08d832b9,0xd2fd,0x481f,0x98,0xcf,0x90,0x4d,0x00,0xdf,0x63,0xcc);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_OnDemandUserAppsClass,0xe0dcae7c,0x1d0a,0x4ad0,0xb9,0x2c,0x2f,0xfd,0xae,0xe1,0x56,0x2b);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_OnDemandMachineAppsClass,0xd1e8b1a6,0x32ce,0x443c,0x8e,0x2e,0xeb,0xa9,0x0c,0x48,0x13,0x53);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_OnDemandMachineAppsServiceClass,0xa6b716cb,0x028b,0x404d,0xb7,0x2c,0x50,0xe1,0x53,0xdd,0x68,0xda);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_OnDemandMachineAppsFallbackClass,0xff419ff9,0x90be,0x4d9f,0xb4,0x10,0xa7,0x89,0xf9,0x0e,0x5a,0x7c);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdateCoreClass,0x8f09cd6c,0x5964,0x4573,0x82,0xe3,0xeb,0xff,0x77,0x02,0x86,0x5b);

+

+

+MIDL_DEFINE_GUID(CLSID, CLSID_GoogleUpdateCoreMachineClass,0x2e1dd7ef,0xc12d,0x4f8e,0x8a,0xd8,0xcf,0x8c,0xc2,0x65,0xba,0xd0);

+

+#undef MIDL_DEFINE_GUID

+

+#ifdef __cplusplus

+}

+#endif

+

+

+

diff --git a/third_party/win_build_output/midl/google_update/arm64/google_update_idl_p.c b/third_party/win_build_output/midl/google_update/arm64/google_update_idl_p.c
new file mode 100644
index 0000000..5329b66
--- /dev/null
+++ b/third_party/win_build_output/midl/google_update/arm64/google_update_idl_p.c
@@ -0,0 +1,8567 @@
+

+

+/* this ALWAYS GENERATED file contains the proxy stub code */

+

+

+ /* File created by MIDL compiler version 8.xx.xxxx */

+/* at a redacted point in time

+ */

+/* Compiler settings for ../../google_update/google_update_idl.idl:

+    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=ARM64 8.01.0622 

+    protocol : dce , ms_ext, c_ext, robust

+    error checks: allocation ref bounds_check enum stub_data 

+    VC __declspec() decoration level: 

+         __declspec(uuid()), __declspec(selectany), __declspec(novtable)

+         DECLSPEC_UUID(), MIDL_INTERFACE()

+*/

+/* @@MIDL_FILE_HEADING(  ) */

+

+#if defined(_M_ARM64)

+

+

+#pragma warning( disable: 4049 )  /* more than 64k source lines */

+#if _MSC_VER >= 1200

+#pragma warning(push)

+#endif

+

+#pragma warning( disable: 4211 )  /* redefine extern to static */

+#pragma warning( disable: 4232 )  /* dllimport identity*/

+#pragma warning( disable: 4024 )  /* array to pointer mapping*/

+#pragma warning( disable: 4152 )  /* function/data pointer conversion in expression */

+

+#define USE_STUBLESS_PROXY

+

+

+/* verify that the <rpcproxy.h> version is high enough to compile this file*/

+#ifndef __REDQ_RPCPROXY_H_VERSION__

+#define __REQUIRED_RPCPROXY_H_VERSION__ 475

+#endif

+

+

+#include "rpcproxy.h"

+#ifndef __RPCPROXY_H_VERSION__

+#error this stub requires an updated version of <rpcproxy.h>

+#endif /* __RPCPROXY_H_VERSION__ */

+

+

+#include "google_update_idl.h"

+

+#define TYPE_FORMAT_STRING_SIZE   1117                              

+#define PROC_FORMAT_STRING_SIZE   5701                              

+#define EXPR_FORMAT_STRING_SIZE   1                                 

+#define TRANSMIT_AS_TABLE_SIZE    0            

+#define WIRE_MARSHAL_TABLE_SIZE   2            

+

+typedef struct _google_update_idl_MIDL_TYPE_FORMAT_STRING

+    {

+    short          Pad;

+    unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];

+    } google_update_idl_MIDL_TYPE_FORMAT_STRING;

+

+typedef struct _google_update_idl_MIDL_PROC_FORMAT_STRING

+    {

+    short          Pad;

+    unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];

+    } google_update_idl_MIDL_PROC_FORMAT_STRING;

+

+typedef struct _google_update_idl_MIDL_EXPR_FORMAT_STRING

+    {

+    long          Pad;

+    unsigned char  Format[ EXPR_FORMAT_STRING_SIZE ];

+    } google_update_idl_MIDL_EXPR_FORMAT_STRING;

+

+

+static const RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax = 

+{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};

+

+

+extern const google_update_idl_MIDL_TYPE_FORMAT_STRING google_update_idl__MIDL_TypeFormatString;

+extern const google_update_idl_MIDL_PROC_FORMAT_STRING google_update_idl__MIDL_ProcFormatString;

+extern const google_update_idl_MIDL_EXPR_FORMAT_STRING google_update_idl__MIDL_ExprFormatString;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IGoogleUpdate3_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppBundle_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppBundle_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IApp_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IApp_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IApp2_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IApp2_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppCommand_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppCommand_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppCommand2_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppCommand2_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppVersion_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppVersion_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IPackage_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IPackage_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO ICurrentState_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO ICurrentState_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IRegistrationUpdateHook_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IRegistrationUpdateHook_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO ICredentialDialog_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO ICredentialDialog_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IGoogleUpdate3Web_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3Web_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IGoogleUpdate3WebSecurity_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3WebSecurity_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppBundleWeb_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppBundleWeb_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppWeb_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppWeb_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppCommandWeb_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppCommandWeb_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IAppVersionWeb_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IAppVersionWeb_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO ICoCreateAsyncStatus_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO ICoCreateAsyncStatus_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO ICoCreateAsync_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO ICoCreateAsync_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IBrowserHttpRequest2_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IBrowserHttpRequest2_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IProcessLauncher2_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IProgressWndEvents_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IProgressWndEvents_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IJobObserver_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IJobObserver_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IJobObserver2_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IJobObserver2_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IGoogleUpdate_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate_ProxyInfo;

+

+

+extern const MIDL_STUB_DESC Object_StubDesc;

+

+

+extern const MIDL_SERVER_INFO IGoogleUpdateCore_ServerInfo;

+extern const MIDL_STUBLESS_PROXY_INFO IGoogleUpdateCore_ProxyInfo;

+

+

+extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[ WIRE_MARSHAL_TABLE_SIZE ];

+

+#if !defined(__RPC_ARM64__)

+#error  Invalid build platform for this stub.

+#endif

+

+static const google_update_idl_MIDL_PROC_FORMAT_STRING google_update_idl__MIDL_ProcFormatString =

+    {

+        0,

+        {

+

+	/* Procedure get_status */

+

+

+	/* Procedure get_stateValue */

+

+

+	/* Procedure get_Count */

+

+			0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/*  2 */	NdrFcLong( 0x0 ),	/* 0 */

+/*  6 */	NdrFcShort( 0x7 ),	/* 7 */

+/*  8 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 10 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 12 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 14 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 16 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 18 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 20 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 22 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 24 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 26 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 28 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppCommandWeb0000 */

+

+

+	/* Parameter __MIDL__ICurrentState0000 */

+

+

+	/* Parameter count */

+

+/* 30 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 32 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 34 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 36 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 38 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 40 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_Item */

+

+/* 42 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 44 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 48 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 50 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 52 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 54 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 56 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 58 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 60 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 62 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 64 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 66 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 68 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 70 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter index */

+

+/* 72 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 74 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 76 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter bundle */

+

+/* 78 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 80 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 82 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 84 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 86 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 88 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_createdInstance */

+

+

+	/* Procedure get_nextVersionWeb */

+

+

+	/* Procedure createAppBundle */

+

+/* 90 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 92 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 96 */	NdrFcShort( 0x9 ),	/* 9 */

+/* 98 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 100 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 102 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 104 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 106 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 108 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 110 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 112 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 114 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 116 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 118 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter instance */

+

+

+	/* Parameter next */

+

+

+	/* Parameter app_bundle */

+

+/* 120 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 122 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 124 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 126 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 128 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 130 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_version */

+

+

+	/* Procedure get_appId */

+

+

+	/* Procedure get_version */

+

+

+	/* Procedure get_displayName */

+

+/* 132 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 134 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 138 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 140 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 142 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 144 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 146 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 148 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 150 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 152 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 154 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 156 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 158 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 160 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppVersionWeb0000 */

+

+

+	/* Parameter __MIDL__IAppWeb0000 */

+

+

+	/* Parameter __MIDL__IAppVersion0000 */

+

+

+	/* Parameter __MIDL__IAppBundle0000 */

+

+/* 162 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 164 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 166 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 168 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 170 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 172 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createInstalledApp */

+

+

+	/* Procedure put_displayName */

+

+/* 174 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 176 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 180 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 182 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 184 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 186 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 188 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 190 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 192 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 194 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 196 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 198 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 200 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 202 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter app_id */

+

+

+	/* Parameter __MIDL__IAppBundle0001 */

+

+/* 204 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 206 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 208 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 210 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 212 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 214 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_output */

+

+

+	/* Procedure get_filename */

+

+

+	/* Procedure get_appId */

+

+

+	/* Procedure get_displayLanguage */

+

+/* 216 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 218 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 222 */	NdrFcShort( 0x9 ),	/* 9 */

+/* 224 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 226 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 228 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 230 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 232 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 234 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 236 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 238 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 240 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 242 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 244 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppCommandWeb0002 */

+

+

+	/* Parameter __MIDL__IPackage0001 */

+

+

+	/* Parameter __MIDL__IApp0000 */

+

+

+	/* Parameter __MIDL__IAppBundle0002 */

+

+/* 246 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 248 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 250 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 252 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 254 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 256 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_displayLanguage */

+

+/* 258 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 260 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 264 */	NdrFcShort( 0xa ),	/* 10 */

+/* 266 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 268 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 270 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 272 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 274 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 276 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 278 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 280 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 282 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 284 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 286 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundle0003 */

+

+/* 288 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 290 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 292 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 294 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 296 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 298 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_output */

+

+

+	/* Procedure get_installSource */

+

+/* 300 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 302 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 306 */	NdrFcShort( 0xb ),	/* 11 */

+/* 308 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 310 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 312 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 314 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 316 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 318 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 320 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 322 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 324 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 326 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 328 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppCommand20000 */

+

+

+	/* Parameter __MIDL__IAppBundle0004 */

+

+/* 330 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 332 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 334 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 336 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 338 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 340 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_installSource */

+

+/* 342 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 344 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 348 */	NdrFcShort( 0xc ),	/* 12 */

+/* 350 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 352 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 354 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 356 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 358 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 360 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 362 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 364 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 366 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 368 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 370 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundle0005 */

+

+/* 372 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 374 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 376 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 378 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 380 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 382 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_originURL */

+

+/* 384 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 386 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 390 */	NdrFcShort( 0xd ),	/* 13 */

+/* 392 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 394 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 396 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 398 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 400 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 402 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 404 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 406 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 408 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 410 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 412 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundle0006 */

+

+/* 414 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 416 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 418 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 420 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 422 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 424 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_originURL */

+

+/* 426 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 428 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 432 */	NdrFcShort( 0xe ),	/* 14 */

+/* 434 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 436 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 438 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 440 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 442 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 444 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 446 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 448 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 450 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 452 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 454 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundle0007 */

+

+/* 456 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 458 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 460 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 462 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 464 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 466 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_serverInstallDataIndex */

+

+

+	/* Procedure get_offlineDirectory */

+

+/* 468 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 470 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 474 */	NdrFcShort( 0xf ),	/* 15 */

+/* 476 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 478 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 480 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 482 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 484 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 486 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 488 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 490 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 492 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 494 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 496 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppWeb0001 */

+

+

+	/* Parameter offline_dir */

+

+/* 498 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 500 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 502 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 504 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 506 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 508 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_serverInstallDataIndex */

+

+

+	/* Procedure put_offlineDirectory */

+

+/* 510 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 512 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 516 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 518 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 520 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 522 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 524 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 526 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 528 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 530 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 532 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 534 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 536 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 538 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppWeb0002 */

+

+

+	/* Parameter offline_dir */

+

+/* 540 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 542 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 544 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 546 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 548 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 550 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_sessionId */

+

+/* 552 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 554 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 558 */	NdrFcShort( 0x11 ),	/* 17 */

+/* 560 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 562 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 564 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 566 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 568 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 570 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 572 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 574 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 576 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 578 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 580 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter session_id */

+

+/* 582 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 584 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 586 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 588 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 590 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 592 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_sessionId */

+

+/* 594 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 596 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 600 */	NdrFcShort( 0x12 ),	/* 18 */

+/* 602 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 604 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 606 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 608 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 610 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 612 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 614 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 616 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 618 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 620 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 622 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter session_id */

+

+/* 624 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 626 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 628 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 630 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 632 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 634 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_sendPings */

+

+/* 636 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 638 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 642 */	NdrFcShort( 0x13 ),	/* 19 */

+/* 644 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 646 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 648 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 650 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 652 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 654 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 656 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 658 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 660 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 662 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 664 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter send_pings */

+

+/* 666 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 668 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 670 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 672 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 674 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 676 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_sendPings */

+

+/* 678 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 680 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 684 */	NdrFcShort( 0x14 ),	/* 20 */

+/* 686 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 688 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 690 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 692 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 694 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 696 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 698 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 700 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 702 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 704 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 706 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter send_pings */

+

+/* 708 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 710 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 712 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 714 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 716 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 718 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_priority */

+

+/* 720 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 722 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 726 */	NdrFcShort( 0x15 ),	/* 21 */

+/* 728 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 730 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 732 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 734 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 736 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 738 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 740 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 742 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 744 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 746 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 748 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter priority */

+

+/* 750 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 752 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 754 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 756 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 758 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 760 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_priority */

+

+/* 762 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 764 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 768 */	NdrFcShort( 0x16 ),	/* 22 */

+/* 770 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 772 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 774 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 776 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 778 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 780 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 782 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 784 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 786 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 788 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 790 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter priority */

+

+/* 792 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 794 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 796 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 798 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 800 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 802 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_postInstallAction */

+

+

+	/* Procedure get_Count */

+

+/* 804 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 806 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 810 */	NdrFcShort( 0x17 ),	/* 23 */

+/* 812 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 814 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 816 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 818 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 820 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 822 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 824 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 826 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 828 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 830 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 832 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0015 */

+

+

+	/* Parameter count */

+

+/* 834 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 836 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 838 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 840 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 842 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 844 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_Item */

+

+/* 846 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 848 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 852 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 854 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 856 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 858 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 860 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 862 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 864 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 866 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 868 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 870 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 872 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 874 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter index */

+

+/* 876 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 878 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 880 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter app */

+

+/* 882 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 884 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 886 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 888 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 890 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 892 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_altTokens */

+

+/* 894 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 896 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 900 */	NdrFcShort( 0x19 ),	/* 25 */

+/* 902 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 904 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 906 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 908 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x4,		/* 4 */

+/* 910 */	0x10,		/* 16 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 912 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 914 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 916 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 918 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 920 */	0x4,		/* 4 */

+			0x80,		/* 128 */

+/* 922 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 924 */	0x83,		/* 131 */

+			0x0,		/* 0 */

+

+	/* Parameter impersonation_token */

+

+/* 926 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 928 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 930 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Parameter primary_token */

+

+/* 932 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 934 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 936 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Parameter caller_proc_id */

+

+/* 938 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 940 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 942 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 944 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 946 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 948 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_parentHWND */

+

+/* 950 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 952 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 956 */	NdrFcShort( 0x1a ),	/* 26 */

+/* 958 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 960 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 962 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 964 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 966 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 968 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 970 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 972 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 974 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 976 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 978 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter hwnd */

+

+/* 980 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 982 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 984 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 986 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 988 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 990 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure initialize */

+

+/* 992 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 994 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 998 */	NdrFcShort( 0x1b ),	/* 27 */

+/* 1000 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1002 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1004 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1006 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1008 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1010 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1012 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1014 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1016 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1018 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1020 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1022 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1024 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_command */

+

+

+	/* Procedure createApp */

+

+/* 1026 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1028 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1032 */	NdrFcShort( 0x1c ),	/* 28 */

+/* 1034 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 1036 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1038 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1040 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 1042 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1044 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1046 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1048 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1050 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 1052 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 1054 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter command_id */

+

+

+	/* Parameter app_id */

+

+/* 1056 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1058 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1060 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter command */

+

+

+	/* Parameter app */

+

+/* 1062 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 1064 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1066 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1068 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1070 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1072 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createInstalledApp */

+

+/* 1074 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1076 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1080 */	NdrFcShort( 0x1d ),	/* 29 */

+/* 1082 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 1084 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1086 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1088 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 1090 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1092 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1094 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1096 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1098 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 1100 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 1102 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter app_id */

+

+/* 1104 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1106 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1108 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter app */

+

+/* 1110 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 1112 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1114 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 1116 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1118 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1120 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createAllInstalledApps */

+

+/* 1122 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1124 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1128 */	NdrFcShort( 0x1e ),	/* 30 */

+/* 1130 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1132 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1134 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1136 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1138 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1140 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1142 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1144 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1146 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1148 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1150 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1152 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1154 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure checkForUpdate */

+

+/* 1156 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1158 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1162 */	NdrFcShort( 0x1f ),	/* 31 */

+/* 1164 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1166 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1168 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1170 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1172 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1174 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1176 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1178 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1180 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1182 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1184 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1186 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1188 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure download */

+

+/* 1190 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1192 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1196 */	NdrFcShort( 0x20 ),	/* 32 */

+/* 1198 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1200 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1202 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1204 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1206 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1208 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1210 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1212 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1214 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1216 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1218 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1220 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1222 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure install */

+

+/* 1224 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1226 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1230 */	NdrFcShort( 0x21 ),	/* 33 */

+/* 1232 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1234 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1236 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1238 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1240 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1242 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1244 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1246 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1248 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1250 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1252 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1254 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1256 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure updateAllApps */

+

+/* 1258 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1260 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1264 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 1266 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1268 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1270 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1272 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1274 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1276 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1278 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1280 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1282 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1284 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1286 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1288 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1290 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure stop */

+

+/* 1292 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1294 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1298 */	NdrFcShort( 0x23 ),	/* 35 */

+/* 1300 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1302 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1304 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1306 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1308 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1310 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1312 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1314 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1316 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1318 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1320 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1322 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1324 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure pause */

+

+/* 1326 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1328 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1332 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 1334 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1336 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1338 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1340 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1342 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1344 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1346 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1348 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1350 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1352 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1354 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1356 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1358 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure resume */

+

+/* 1360 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1362 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1366 */	NdrFcShort( 0x25 ),	/* 37 */

+/* 1368 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1370 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1372 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1374 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 1376 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1378 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1380 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1382 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1384 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1386 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 1388 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1390 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1392 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure isBusy */

+

+/* 1394 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1396 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1400 */	NdrFcShort( 0x26 ),	/* 38 */

+/* 1402 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1404 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1406 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 1408 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 1410 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1412 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1414 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1416 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1418 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1420 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1422 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter is_busy */

+

+/* 1424 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 1426 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1428 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 1430 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1432 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1434 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure downloadPackage */

+

+/* 1436 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1438 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1442 */	NdrFcShort( 0x27 ),	/* 39 */

+/* 1444 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 1446 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1448 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1450 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 1452 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1454 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1456 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1458 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1460 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 1462 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 1464 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter app_id */

+

+/* 1466 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1468 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1470 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter package_name */

+

+/* 1472 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1474 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1476 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 1478 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1480 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1482 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_currentState */

+

+/* 1484 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1486 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1490 */	NdrFcShort( 0x28 ),	/* 40 */

+/* 1492 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1494 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1496 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1498 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1500 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1502 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1504 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1506 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1508 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1510 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1512 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter current_state */

+

+/* 1514 */	NdrFcShort( 0x6113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=24 */

+/* 1516 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1518 */	NdrFcShort( 0x3fa ),	/* Type Offset=1018 */

+

+	/* Return value */

+

+/* 1520 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1522 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1524 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createAppBundleWeb */

+

+

+	/* Procedure get_currentVersion */

+

+/* 1526 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1528 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1532 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 1534 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1536 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1538 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1540 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1542 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1544 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1546 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1548 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1550 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1552 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1554 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter app_bundle_web */

+

+

+	/* Parameter current */

+

+/* 1556 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 1558 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1560 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1562 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1564 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1566 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_currentVersionWeb */

+

+

+	/* Procedure get_nextVersion */

+

+/* 1568 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1570 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1574 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1576 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1578 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1580 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1582 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1584 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 1586 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1588 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1590 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1592 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1594 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1596 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter current */

+

+

+	/* Parameter next */

+

+/* 1598 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 1600 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1602 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1604 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1606 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1608 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_displayLanguage */

+

+

+	/* Procedure get_displayName */

+

+/* 1610 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1612 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1616 */	NdrFcShort( 0xa ),	/* 10 */

+/* 1618 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1620 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1622 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1624 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1626 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1628 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1630 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1632 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1634 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1636 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1638 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundleWeb0000 */

+

+

+	/* Parameter __MIDL__IApp0001 */

+

+/* 1640 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 1642 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1644 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1646 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1648 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1650 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_displayLanguage */

+

+

+	/* Procedure put_displayName */

+

+/* 1652 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1654 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1658 */	NdrFcShort( 0xb ),	/* 11 */

+/* 1660 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1662 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1664 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1666 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1668 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1670 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1672 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1674 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1676 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1678 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1680 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IAppBundleWeb0001 */

+

+

+	/* Parameter __MIDL__IApp0002 */

+

+/* 1682 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1684 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1686 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1688 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1690 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1692 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_language */

+

+/* 1694 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1696 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1700 */	NdrFcShort( 0xc ),	/* 12 */

+/* 1702 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1704 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1706 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1708 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1710 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1712 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1714 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1716 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1718 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1720 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1722 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0003 */

+

+/* 1724 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 1726 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1728 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 1730 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1732 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1734 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_language */

+

+/* 1736 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1738 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1742 */	NdrFcShort( 0xd ),	/* 13 */

+/* 1744 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1746 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1748 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1750 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1752 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1754 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1756 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1758 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1760 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1762 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1764 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0004 */

+

+/* 1766 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1768 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1770 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 1772 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1774 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1776 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_ap */

+

+/* 1778 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1780 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1784 */	NdrFcShort( 0xe ),	/* 14 */

+/* 1786 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1788 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1790 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1792 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1794 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1796 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1798 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1800 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1802 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1804 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1806 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0005 */

+

+/* 1808 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 1810 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1812 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 1814 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1816 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1818 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_ap */

+

+/* 1820 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1822 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1826 */	NdrFcShort( 0xf ),	/* 15 */

+/* 1828 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1830 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1832 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1834 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1836 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1838 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1840 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1842 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1844 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1846 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1848 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0006 */

+

+/* 1850 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1852 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1854 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 1856 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1858 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1860 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_ttToken */

+

+/* 1862 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1864 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1868 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 1870 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1872 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1874 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1876 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1878 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1880 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1882 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1884 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1886 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1888 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1890 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0007 */

+

+/* 1892 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 1894 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1896 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 1898 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1900 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1902 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_ttToken */

+

+/* 1904 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1906 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1910 */	NdrFcShort( 0x11 ),	/* 17 */

+/* 1912 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1914 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1916 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1918 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1920 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 1922 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1924 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1926 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1928 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1930 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1932 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0008 */

+

+/* 1934 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 1936 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1938 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 1940 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1942 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1944 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_completionMessage */

+

+

+	/* Procedure get_iid */

+

+/* 1946 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1948 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1952 */	NdrFcShort( 0x12 ),	/* 18 */

+/* 1954 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1956 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1958 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 1960 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 1962 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 1964 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1966 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1968 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1970 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 1972 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 1974 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0010 */

+

+

+	/* Parameter __MIDL__IApp0009 */

+

+/* 1976 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 1978 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 1980 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 1982 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 1984 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 1986 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_iid */

+

+/* 1988 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 1990 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 1994 */	NdrFcShort( 0x13 ),	/* 19 */

+/* 1996 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 1998 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2000 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2002 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2004 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2006 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2008 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2010 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2012 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2014 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2016 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0010 */

+

+/* 2018 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2020 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2022 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2024 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2026 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2028 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_brandCode */

+

+/* 2030 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2032 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2036 */	NdrFcShort( 0x14 ),	/* 20 */

+/* 2038 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2040 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2042 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2044 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2046 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2048 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2050 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2052 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2054 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2056 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2058 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0011 */

+

+/* 2060 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2062 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2064 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2066 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2068 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2070 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_brandCode */

+

+/* 2072 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2074 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2078 */	NdrFcShort( 0x15 ),	/* 21 */

+/* 2080 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2082 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2084 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2086 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2088 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2090 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2092 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2094 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2096 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2098 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2100 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0012 */

+

+/* 2102 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2104 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2106 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2108 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2110 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2112 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_postInstallUrl */

+

+

+	/* Procedure get_clientId */

+

+/* 2114 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2116 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2120 */	NdrFcShort( 0x16 ),	/* 22 */

+/* 2122 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2124 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2126 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2128 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2130 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2132 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2134 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2136 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2138 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2140 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2142 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0014 */

+

+

+	/* Parameter __MIDL__IApp0013 */

+

+/* 2144 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2146 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2148 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 2150 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2152 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2154 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_clientId */

+

+/* 2156 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2158 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2162 */	NdrFcShort( 0x17 ),	/* 23 */

+/* 2164 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2166 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2168 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2170 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2172 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2174 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2176 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2178 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2180 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2182 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2184 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0014 */

+

+/* 2186 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2188 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2190 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2192 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2194 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2196 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_labels */

+

+/* 2198 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2200 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2204 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 2206 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2208 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2210 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2212 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2214 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2216 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2218 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2220 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2222 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2224 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2226 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0015 */

+

+/* 2228 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2230 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2232 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2234 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2236 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2238 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_labels */

+

+/* 2240 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2242 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2246 */	NdrFcShort( 0x19 ),	/* 25 */

+/* 2248 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2250 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2252 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2254 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2256 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2258 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2260 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2262 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2264 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2266 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2268 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0016 */

+

+/* 2270 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2272 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2274 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2276 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2278 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2280 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_referralId */

+

+/* 2282 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2284 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2288 */	NdrFcShort( 0x1a ),	/* 26 */

+/* 2290 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2292 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2294 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2296 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2298 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2300 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2302 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2304 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2306 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2308 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2310 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0017 */

+

+/* 2312 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2314 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2316 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2318 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2320 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2322 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_referralId */

+

+/* 2324 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2326 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2330 */	NdrFcShort( 0x1b ),	/* 27 */

+/* 2332 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2334 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2336 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2338 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2340 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2342 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2344 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2346 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2348 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2350 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2352 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0018 */

+

+/* 2354 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2356 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2358 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2360 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2362 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2364 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_browserType */

+

+/* 2366 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2368 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2372 */	NdrFcShort( 0x1d ),	/* 29 */

+/* 2374 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2376 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2378 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 2380 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2382 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2384 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2386 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2388 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2390 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2392 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2394 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0019 */

+

+/* 2396 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 2398 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2400 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2402 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2404 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2406 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_browserType */

+

+/* 2408 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2410 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2414 */	NdrFcShort( 0x1e ),	/* 30 */

+/* 2416 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2418 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2420 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2422 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2424 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2426 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2428 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2430 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2432 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2434 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2436 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0020 */

+

+/* 2438 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 2440 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2442 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2444 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2446 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2448 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_clientInstallData */

+

+/* 2450 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2452 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2456 */	NdrFcShort( 0x1f ),	/* 31 */

+/* 2458 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2460 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2462 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2464 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2466 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2468 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2470 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2472 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2474 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2476 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2478 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0021 */

+

+/* 2480 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2482 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2484 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2486 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2488 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2490 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_clientInstallData */

+

+/* 2492 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2494 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2498 */	NdrFcShort( 0x20 ),	/* 32 */

+/* 2500 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2502 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2504 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2506 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2508 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2510 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2512 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2514 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2516 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2518 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2520 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0022 */

+

+/* 2522 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2524 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2526 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2528 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2530 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2532 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_serverInstallDataIndex */

+

+/* 2534 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2536 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2540 */	NdrFcShort( 0x21 ),	/* 33 */

+/* 2542 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2544 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2546 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2548 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2550 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2552 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2554 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2556 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2558 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2560 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2562 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0023 */

+

+/* 2564 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2566 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2568 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2570 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2572 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2574 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_serverInstallDataIndex */

+

+/* 2576 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2578 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2582 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 2584 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2586 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2588 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2590 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2592 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2594 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2596 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2598 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2600 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2602 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2604 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0024 */

+

+/* 2606 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2608 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2610 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2612 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2614 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2616 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_isEulaAccepted */

+

+/* 2618 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2620 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2624 */	NdrFcShort( 0x23 ),	/* 35 */

+/* 2626 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2628 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2630 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 2632 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2634 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2636 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2638 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2640 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2642 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2644 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2646 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0025 */

+

+/* 2648 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 2650 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2652 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2654 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2656 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2658 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_isEulaAccepted */

+

+/* 2660 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2662 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2666 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 2668 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2670 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 2672 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2674 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2676 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2678 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2680 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2682 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2684 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2686 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2688 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0026 */

+

+/* 2690 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 2692 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2694 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2696 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2698 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2700 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_usageStatsEnable */

+

+/* 2702 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2704 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2708 */	NdrFcShort( 0x25 ),	/* 37 */

+/* 2710 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2712 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2714 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 2716 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2718 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2720 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2722 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2724 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2726 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2728 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2730 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0027 */

+

+/* 2732 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 2734 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2736 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2738 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2740 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2742 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_usageStatsEnable */

+

+/* 2744 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2746 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2750 */	NdrFcShort( 0x26 ),	/* 38 */

+/* 2752 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2754 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2756 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2758 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2760 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2762 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2764 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2766 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2768 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2770 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2772 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0028 */

+

+/* 2774 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 2776 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2778 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2780 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2782 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2784 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_installTimeDiffSec */

+

+/* 2786 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2788 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2792 */	NdrFcShort( 0x27 ),	/* 39 */

+/* 2794 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2796 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2798 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 2800 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2802 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2804 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2806 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2808 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2810 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2812 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2814 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0029 */

+

+/* 2816 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 2818 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2820 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 2822 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2824 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2826 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_currentState */

+

+/* 2828 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2830 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2834 */	NdrFcShort( 0x28 ),	/* 40 */

+/* 2836 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2838 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2840 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2842 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2844 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2846 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2848 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2850 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2852 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2854 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2856 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp0030 */

+

+/* 2858 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 2860 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2862 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 2864 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2866 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2868 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_untrustedData */

+

+/* 2870 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2872 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2876 */	NdrFcShort( 0x29 ),	/* 41 */

+/* 2878 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2880 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2882 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2884 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2886 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 2888 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2890 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2892 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2894 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2896 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2898 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp20000 */

+

+/* 2900 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 2902 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2904 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 2906 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2908 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2910 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_untrustedData */

+

+/* 2912 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2914 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2918 */	NdrFcShort( 0x2a ),	/* 42 */

+/* 2920 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2922 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2924 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 2926 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 2928 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 2930 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2932 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 2934 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2936 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2938 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2940 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IApp20001 */

+

+/* 2942 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 2944 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2946 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 2948 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2950 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2952 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_isDone */

+

+

+	/* Procedure get_isWebAccessible */

+

+/* 2954 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2956 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 2960 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 2962 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 2964 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2966 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 2968 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 2970 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 2972 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2974 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2976 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 2978 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 2980 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 2982 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter is_done */

+

+

+	/* Parameter __MIDL__IAppCommand0000 */

+

+/* 2984 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 2986 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 2988 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 2990 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 2992 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 2994 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_completionHResult */

+

+

+	/* Procedure get_packageCount */

+

+

+	/* Procedure get_exitCode */

+

+

+	/* Procedure get_packageCount */

+

+

+	/* Procedure get_status */

+

+/* 2996 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 2998 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3002 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3004 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3006 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3008 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3010 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3012 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3014 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3016 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3018 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3020 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3022 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3024 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter hr */

+

+

+	/* Parameter count */

+

+

+	/* Parameter __MIDL__IAppCommandWeb0001 */

+

+

+	/* Parameter count */

+

+

+	/* Parameter __MIDL__IAppCommand0001 */

+

+/* 3026 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3028 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3030 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 3032 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3034 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3036 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_bytesDownloaded */

+

+

+	/* Procedure get_exitCode */

+

+/* 3038 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3040 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3044 */	NdrFcShort( 0x9 ),	/* 9 */

+/* 3046 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3048 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3050 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3052 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3054 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3056 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3058 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3060 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3062 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3064 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3066 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0002 */

+

+

+	/* Parameter __MIDL__IAppCommand0002 */

+

+/* 3068 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3070 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3072 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 3074 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3076 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3078 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure execute */

+

+

+	/* Procedure execute */

+

+/* 3080 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3082 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3086 */	NdrFcShort( 0xa ),	/* 10 */

+/* 3088 */	NdrFcShort( 0x58 ),	/* ARM64 Stack size/offset = 88 */

+/* 3090 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3092 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3094 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0xa,		/* 10 */

+/* 3096 */	0x16,		/* 22 */

+			0x85,		/* Ext Flags:  new corr desc, srv corr check, has big byval param */

+/* 3098 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3100 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3102 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3104 */	NdrFcShort( 0xa ),	/* 10 */

+/* 3106 */	0xa,		/* 10 */

+			0x80,		/* 128 */

+/* 3108 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 3110 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+/* 3112 */	0x85,		/* 133 */

+			0x86,		/* 134 */

+/* 3114 */	0x87,		/* 135 */

+			0xf8,		/* 248 */

+/* 3116 */	0xf8,		/* 248 */

+			0x0,		/* 0 */

+

+	/* Parameter arg1 */

+

+

+	/* Parameter arg1 */

+

+/* 3118 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3120 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3122 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg2 */

+

+

+	/* Parameter arg2 */

+

+/* 3124 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3126 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3128 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg3 */

+

+

+	/* Parameter arg3 */

+

+/* 3130 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3132 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3134 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg4 */

+

+

+	/* Parameter arg4 */

+

+/* 3136 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3138 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 3140 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg5 */

+

+

+	/* Parameter arg5 */

+

+/* 3142 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3144 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 3146 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg6 */

+

+

+	/* Parameter arg6 */

+

+/* 3148 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3150 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 3152 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg7 */

+

+

+	/* Parameter arg7 */

+

+/* 3154 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3156 */	NdrFcShort( 0x38 ),	/* ARM64 Stack size/offset = 56 */

+/* 3158 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg8 */

+

+

+	/* Parameter arg8 */

+

+/* 3160 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3162 */	NdrFcShort( 0x40 ),	/* ARM64 Stack size/offset = 64 */

+/* 3164 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter arg9 */

+

+

+	/* Parameter arg9 */

+

+/* 3166 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 3168 */	NdrFcShort( 0x48 ),	/* ARM64 Stack size/offset = 72 */

+/* 3170 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 3172 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3174 */	NdrFcShort( 0x50 ),	/* ARM64 Stack size/offset = 80 */

+/* 3176 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_packageWeb */

+

+

+	/* Procedure get_package */

+

+/* 3178 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3180 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3184 */	NdrFcShort( 0x9 ),	/* 9 */

+/* 3186 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 3188 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3190 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3192 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 3194 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3196 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3198 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3200 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3202 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 3204 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 3206 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter index */

+

+

+	/* Parameter index */

+

+/* 3208 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 3210 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3212 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter package */

+

+

+	/* Parameter package */

+

+/* 3214 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 3216 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3218 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 3220 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3222 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3224 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get */

+

+/* 3226 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3228 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3232 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 3234 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3236 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3238 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3240 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 3242 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 3244 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3246 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3248 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3250 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3252 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3254 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter dir */

+

+/* 3256 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 3258 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3260 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 3262 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3264 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3266 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_isAvailable */

+

+/* 3268 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3270 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3274 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3276 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3278 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3280 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 3282 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3284 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3286 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3288 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3290 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3292 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3294 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3296 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__IPackage0000 */

+

+/* 3298 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3300 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3302 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3304 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3306 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3308 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_availableVersion */

+

+/* 3310 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3312 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3316 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3318 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3320 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3322 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3324 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 3326 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 3328 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3330 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3332 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3334 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3336 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3338 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0001 */

+

+/* 3340 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 3342 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3344 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 3346 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3348 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3350 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_totalBytesToDownload */

+

+/* 3352 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3354 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3358 */	NdrFcShort( 0xa ),	/* 10 */

+/* 3360 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3362 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3364 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3366 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3368 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3370 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3372 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3374 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3376 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3378 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3380 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0003 */

+

+/* 3382 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3384 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3386 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3388 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3390 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3392 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_downloadTimeRemainingMs */

+

+/* 3394 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3396 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3400 */	NdrFcShort( 0xb ),	/* 11 */

+/* 3402 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3404 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3406 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3408 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3410 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3412 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3414 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3416 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3418 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3420 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3422 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0004 */

+

+/* 3424 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3426 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3428 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3430 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3432 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3434 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_nextRetryTime */

+

+/* 3436 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3438 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3442 */	NdrFcShort( 0xc ),	/* 12 */

+/* 3444 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3446 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3448 */	NdrFcShort( 0x2c ),	/* 44 */

+/* 3450 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3452 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3454 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3456 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3458 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3460 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3462 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3464 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0005 */

+

+/* 3466 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3468 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3470 */	0xb,		/* FC_HYPER */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3472 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3474 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3476 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_length */

+

+

+	/* Procedure get_installProgress */

+

+/* 3478 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3480 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3484 */	NdrFcShort( 0xd ),	/* 13 */

+/* 3486 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3488 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3490 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3492 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3494 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3496 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3498 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3500 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3502 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3504 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3506 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter index */

+

+

+	/* Parameter __MIDL__ICurrentState0006 */

+

+/* 3508 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3510 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3512 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 3514 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3516 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3518 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_installTimeRemainingMs */

+

+/* 3520 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3522 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3526 */	NdrFcShort( 0xe ),	/* 14 */

+/* 3528 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3530 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3532 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3534 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3536 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3538 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3540 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3542 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3544 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3546 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3548 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0007 */

+

+/* 3550 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3552 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3554 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3556 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3558 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3560 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_isCanceled */

+

+/* 3562 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3564 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3568 */	NdrFcShort( 0xf ),	/* 15 */

+/* 3570 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3572 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3574 */	NdrFcShort( 0x22 ),	/* 34 */

+/* 3576 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3578 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3580 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3582 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3584 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3586 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3588 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3590 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter is_canceled */

+

+/* 3592 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3594 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3596 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3598 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3600 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3602 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_errorCode */

+

+/* 3604 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3606 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3610 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 3612 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3614 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3616 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3618 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3620 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3622 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3624 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3626 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3628 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3630 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3632 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0008 */

+

+/* 3634 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3636 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3638 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3640 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3642 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3644 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_extraCode1 */

+

+/* 3646 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3648 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3652 */	NdrFcShort( 0x11 ),	/* 17 */

+/* 3654 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3656 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3658 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3660 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3662 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3664 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3666 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3668 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3670 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3672 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3674 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0009 */

+

+/* 3676 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3678 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3680 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3682 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3684 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3686 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_installerResultCode */

+

+/* 3688 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3690 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3694 */	NdrFcShort( 0x13 ),	/* 19 */

+/* 3696 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3698 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3700 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3702 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3704 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3706 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3708 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3710 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3712 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3714 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3716 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0011 */

+

+/* 3718 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3720 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3722 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3724 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3726 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3728 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_installerResultExtraCode1 */

+

+/* 3730 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3732 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3736 */	NdrFcShort( 0x14 ),	/* 20 */

+/* 3738 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3740 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3742 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 3744 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 3746 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 3748 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3750 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3752 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3754 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3756 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3758 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0012 */

+

+/* 3760 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 3762 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3764 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3766 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3768 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3770 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_postInstallLaunchCommandLine */

+

+/* 3772 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3774 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3778 */	NdrFcShort( 0x15 ),	/* 21 */

+/* 3780 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3782 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3784 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3786 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 3788 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 3790 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3792 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3794 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3796 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3798 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3800 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter __MIDL__ICurrentState0013 */

+

+/* 3802 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 3804 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3806 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 3808 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3810 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3812 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure UpdateRegistry */

+

+/* 3814 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3816 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3820 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 3822 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 3824 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 3826 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3828 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 3830 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 3832 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3834 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3836 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3838 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 3840 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 3842 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter app_id */

+

+/* 3844 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 3846 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3848 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter is_machine */

+

+/* 3850 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 3852 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3854 */	0x6,		/* FC_SHORT */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 3856 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3858 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3860 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure QueryUserForCredentials */

+

+/* 3862 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3864 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3868 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 3870 */	NdrFcShort( 0x38 ),	/* ARM64 Stack size/offset = 56 */

+/* 3872 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3874 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3876 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x6,		/* 6 */

+/* 3878 */	0x12,		/* 18 */

+			0x7,		/* Ext Flags:  new corr desc, clt corr check, srv corr check, */

+/* 3880 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3882 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3884 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3886 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 3888 */	0x6,		/* 6 */

+			0x80,		/* 128 */

+/* 3890 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 3892 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+/* 3894 */	0x85,		/* 133 */

+			0x0,		/* 0 */

+

+	/* Parameter owner_hwnd */

+

+/* 3896 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 3898 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3900 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Parameter server */

+

+/* 3902 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 3904 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3906 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter message */

+

+/* 3908 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 3910 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3912 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter username */

+

+/* 3914 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 3916 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 3918 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Parameter password */

+

+/* 3920 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 3922 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 3924 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 3926 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3928 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 3930 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure setOriginURL */

+

+/* 3932 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3934 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3938 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 3940 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 3942 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3944 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3946 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 3948 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 3950 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3952 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3954 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3956 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 3958 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 3960 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter origin_url */

+

+/* 3962 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 3964 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 3966 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 3968 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 3970 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 3972 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createApp */

+

+/* 3974 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 3976 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 3980 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 3982 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 3984 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3986 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 3988 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x5,		/* 5 */

+/* 3990 */	0x10,		/* 16 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 3992 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3994 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 3996 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 3998 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 4000 */	0x5,		/* 5 */

+			0x80,		/* 128 */

+/* 4002 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 4004 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+

+	/* Parameter app_guid */

+

+/* 4006 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4008 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4010 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter brand_code */

+

+/* 4012 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4014 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4016 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter language */

+

+/* 4018 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4020 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4022 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter ap */

+

+/* 4024 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4026 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4028 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 4030 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4032 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 4034 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnInstalling */

+

+

+	/* Procedure createAllInstalledApps */

+

+/* 4036 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4038 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4042 */	NdrFcShort( 0x9 ),	/* 9 */

+/* 4044 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4046 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4048 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4050 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4052 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4054 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4056 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4058 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4060 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4062 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 4064 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4066 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4068 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure put_parentHWND */

+

+/* 4070 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4072 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4076 */	NdrFcShort( 0xc ),	/* 12 */

+/* 4078 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4080 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4082 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4084 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x2,		/* 2 */

+/* 4086 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4088 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4090 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4092 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4094 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 4096 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 4098 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter hwnd */

+

+/* 4100 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 4102 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4104 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 4106 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4108 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4110 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_appWeb */

+

+/* 4112 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4114 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4118 */	NdrFcShort( 0xe ),	/* 14 */

+/* 4120 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4122 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4124 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4126 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 4128 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4130 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4132 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4134 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4136 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4138 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 4140 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter index */

+

+/* 4142 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 4144 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4146 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter app_web */

+

+/* 4148 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 4150 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4152 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 4154 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4156 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4158 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure initialize */

+

+/* 4160 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4162 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4166 */	NdrFcShort( 0xf ),	/* 15 */

+/* 4168 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4170 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4172 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4174 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4176 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4178 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4180 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4182 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4184 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4186 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4188 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4190 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4192 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure checkForUpdate */

+

+/* 4194 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4196 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4200 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 4202 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4204 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4206 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4208 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4210 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4212 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4214 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4216 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4218 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4220 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4222 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4224 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4226 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure download */

+

+/* 4228 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4230 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4234 */	NdrFcShort( 0x11 ),	/* 17 */

+/* 4236 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4238 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4240 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4242 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4244 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4246 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4248 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4250 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4252 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4254 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4256 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4258 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4260 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure install */

+

+/* 4262 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4264 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4268 */	NdrFcShort( 0x12 ),	/* 18 */

+/* 4270 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4272 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4274 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4276 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4278 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4280 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4282 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4284 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4286 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4288 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4290 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4292 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4294 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure pause */

+

+/* 4296 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4298 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4302 */	NdrFcShort( 0x13 ),	/* 19 */

+/* 4304 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4306 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4308 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4310 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4312 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4314 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4316 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4318 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4320 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4322 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4324 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4326 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4328 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure resume */

+

+/* 4330 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4332 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4336 */	NdrFcShort( 0x14 ),	/* 20 */

+/* 4338 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4340 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4342 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4344 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4346 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4348 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4350 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4352 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4354 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4356 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4358 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4360 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4362 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure cancel */

+

+/* 4364 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4366 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4370 */	NdrFcShort( 0x15 ),	/* 21 */

+/* 4372 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4374 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4376 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4378 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4380 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4382 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4384 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4386 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4388 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4390 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4392 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4394 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4396 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure downloadPackage */

+

+/* 4398 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4400 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4404 */	NdrFcShort( 0x16 ),	/* 22 */

+/* 4406 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4408 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4410 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4412 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 4414 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 4416 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4418 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4420 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4422 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4424 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 4426 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter app_id */

+

+/* 4428 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4430 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4432 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter package_name */

+

+/* 4434 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4436 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4438 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Return value */

+

+/* 4440 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4442 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4444 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_currentState */

+

+/* 4446 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4448 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4452 */	NdrFcShort( 0x17 ),	/* 23 */

+/* 4454 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4456 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4458 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4460 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 4462 */	0xe,		/* 14 */

+			0x3,		/* Ext Flags:  new corr desc, clt corr check, */

+/* 4464 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4466 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4468 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4470 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 4472 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 4474 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter current_state */

+

+/* 4476 */	NdrFcShort( 0x6113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=24 */

+/* 4478 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4480 */	NdrFcShort( 0x3fa ),	/* Type Offset=1018 */

+

+	/* Return value */

+

+/* 4482 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4484 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4486 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_command */

+

+/* 4488 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4490 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4494 */	NdrFcShort( 0xa ),	/* 10 */

+/* 4496 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4498 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4500 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4502 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 4504 */	0xe,		/* 14 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 4506 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4508 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4510 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4512 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4514 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 4516 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter command_id */

+

+/* 4518 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4520 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4522 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter command */

+

+/* 4524 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 4526 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4528 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 4530 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4532 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4534 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure cancel */

+

+/* 4536 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4538 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4542 */	NdrFcShort( 0xb ),	/* 11 */

+/* 4544 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4546 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4548 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4550 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4552 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4554 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4556 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4558 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4560 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4562 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4564 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4566 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4568 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure get_currentState */

+

+/* 4570 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4572 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4576 */	NdrFcShort( 0xc ),	/* 12 */

+/* 4578 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4580 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4582 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4584 */	0x45,		/* Oi2 Flags:  srv must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 4586 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4588 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4590 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4592 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4594 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 4596 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 4598 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter current_state */

+

+/* 4600 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 4602 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4604 */	NdrFcShort( 0x6 ),	/* Type Offset=6 */

+

+	/* Return value */

+

+/* 4606 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4608 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4610 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure launch */

+

+/* 4612 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4614 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4618 */	NdrFcShort( 0xd ),	/* 13 */

+/* 4620 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4622 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4624 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4626 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4628 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4630 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4632 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4634 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4636 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4638 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4640 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4642 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4644 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure uninstall */

+

+/* 4646 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4648 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4652 */	NdrFcShort( 0xe ),	/* 14 */

+/* 4654 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4656 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4658 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4660 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 4662 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4664 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4666 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4668 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4670 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4672 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 4674 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4676 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4678 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure createOmahaMachineServerAsync */

+

+/* 4680 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4682 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4686 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4688 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 4690 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4692 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4694 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x4,		/* 4 */

+/* 4696 */	0x10,		/* 16 */

+			0x5,		/* Ext Flags:  new corr desc, srv corr check, */

+/* 4698 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4700 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4702 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4704 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 4706 */	0x4,		/* 4 */

+			0x80,		/* 128 */

+/* 4708 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 4710 */	0x83,		/* 131 */

+			0x0,		/* 0 */

+

+	/* Parameter origin_url */

+

+/* 4712 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4714 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4716 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter create_elevated */

+

+/* 4718 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 4720 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4722 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter status */

+

+/* 4724 */	NdrFcShort( 0x13 ),	/* Flags:  must size, must free, out, */

+/* 4726 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4728 */	NdrFcShort( 0x41a ),	/* Type Offset=1050 */

+

+	/* Return value */

+

+/* 4730 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4732 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4734 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure Send */

+

+/* 4736 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4738 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4742 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4744 */	NdrFcShort( 0x48 ),	/* ARM64 Stack size/offset = 72 */

+/* 4746 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4748 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 4750 */	0x47,		/* Oi2 Flags:  srv must size, clt must size, has return, has ext, */

+			0x8,		/* 8 */

+/* 4752 */	0x14,		/* 20 */

+			0x87,		/* Ext Flags:  new corr desc, clt corr check, srv corr check, has big byval param */

+/* 4754 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4756 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 4758 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4760 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4762 */	0x8,		/* 8 */

+			0x80,		/* 128 */

+/* 4764 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 4766 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+/* 4768 */	0x85,		/* 133 */

+			0x86,		/* 134 */

+/* 4770 */	0x87,		/* 135 */

+			0x0,		/* 0 */

+

+	/* Parameter url */

+

+/* 4772 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4774 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4776 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter post_data */

+

+/* 4778 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4780 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4782 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter request_headers */

+

+/* 4784 */	NdrFcShort( 0x8b ),	/* Flags:  must size, must free, in, by val, */

+/* 4786 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4788 */	NdrFcShort( 0x48 ),	/* Type Offset=72 */

+

+	/* Parameter response_headers_needed */

+

+/* 4790 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 4792 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4794 */	NdrFcShort( 0x40c ),	/* Type Offset=1036 */

+

+	/* Parameter response_headers */

+

+/* 4796 */	NdrFcShort( 0x6113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=24 */

+/* 4798 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 4800 */	NdrFcShort( 0x3fa ),	/* Type Offset=1018 */

+

+	/* Parameter response_code */

+

+/* 4802 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 4804 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 4806 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter cache_filename */

+

+/* 4808 */	NdrFcShort( 0x2113 ),	/* Flags:  must size, must free, out, simple ref, srv alloc size=8 */

+/* 4810 */	NdrFcShort( 0x38 ),	/* ARM64 Stack size/offset = 56 */

+/* 4812 */	NdrFcShort( 0x3a ),	/* Type Offset=58 */

+

+	/* Return value */

+

+/* 4814 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4816 */	NdrFcShort( 0x40 ),	/* ARM64 Stack size/offset = 64 */

+/* 4818 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure LaunchCmdLine */

+

+/* 4820 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4822 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4826 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4828 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4830 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4832 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4834 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 4836 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4838 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4840 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4842 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4844 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 4846 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 4848 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter cmd_line */

+

+/* 4850 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 4852 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4854 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Return value */

+

+/* 4856 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4858 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4860 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure LaunchBrowser */

+

+/* 4862 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4864 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4868 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 4870 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4872 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4874 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4876 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 4878 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4880 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4882 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4884 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4886 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 4888 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 4890 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter browser_type */

+

+/* 4892 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 4894 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4896 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter url */

+

+/* 4898 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 4900 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4902 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Return value */

+

+/* 4904 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4906 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4908 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure LaunchCmdElevated */

+

+/* 4910 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4912 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4916 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 4918 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 4920 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 4922 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 4924 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x5,		/* 5 */

+/* 4926 */	0x10,		/* 16 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4928 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4930 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4932 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4934 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 4936 */	0x5,		/* 5 */

+			0x80,		/* 128 */

+/* 4938 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 4940 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+

+	/* Parameter app_guid */

+

+/* 4942 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 4944 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 4946 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter cmd_id */

+

+/* 4948 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 4950 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 4952 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter caller_proc_id */

+

+/* 4954 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 4956 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 4958 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter proc_handle */

+

+/* 4960 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 4962 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 4964 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 4966 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 4968 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 4970 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure LaunchCmdLineEx */

+

+/* 4972 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 4974 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 4978 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 4980 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 4982 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4984 */	NdrFcShort( 0x5c ),	/* 92 */

+/* 4986 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x5,		/* 5 */

+/* 4988 */	0x10,		/* 16 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 4990 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4992 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4994 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 4996 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 4998 */	0x5,		/* 5 */

+			0x80,		/* 128 */

+/* 5000 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 5002 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+

+	/* Parameter cmd_line */

+

+/* 5004 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5006 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5008 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter server_proc_id */

+

+/* 5010 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 5012 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5014 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter proc_handle */

+

+/* 5016 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 5018 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5020 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Parameter stdout_handle */

+

+/* 5022 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 5024 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5026 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 5028 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5030 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 5032 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnShow */

+

+

+	/* Procedure DoClose */

+

+/* 5034 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5036 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5040 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5042 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5044 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5046 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5048 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5050 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5052 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5054 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5056 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5058 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5060 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 5062 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5064 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5066 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnCheckingForUpdate */

+

+

+	/* Procedure DoPause */

+

+/* 5068 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5070 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5074 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 5076 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5078 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5080 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5082 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5084 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5086 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5088 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5090 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5092 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5094 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 5096 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5098 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5100 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure DoResume */

+

+/* 5102 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5104 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5108 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 5110 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5112 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5114 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5116 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5118 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5120 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5122 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5124 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5126 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5128 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 5130 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5132 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5134 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnWaitingToDownload */

+

+

+	/* Procedure DoRestartBrowsers */

+

+/* 5136 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5138 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5142 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 5144 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5146 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5148 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5150 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5152 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5154 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5156 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5158 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5160 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5162 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+

+	/* Return value */

+

+/* 5164 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5166 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5168 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure DoReboot */

+

+/* 5170 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5172 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5176 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 5178 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5180 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5182 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5184 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5186 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5188 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5190 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5192 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5194 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5196 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 5198 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5200 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5202 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure DoLaunchBrowser */

+

+/* 5204 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5206 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5210 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5212 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5214 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5216 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5218 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 5220 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5222 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5224 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5226 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5228 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 5230 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 5232 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter url */

+

+/* 5234 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5236 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5238 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Return value */

+

+/* 5240 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5242 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5244 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnUpdateAvailable */

+

+/* 5246 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5248 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5252 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 5254 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5256 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5258 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5260 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 5262 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5264 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5266 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5268 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5270 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 5272 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 5274 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter version_string */

+

+/* 5276 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5278 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5280 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Return value */

+

+/* 5282 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5284 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5286 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnDownloading */

+

+/* 5288 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5290 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5294 */	NdrFcShort( 0x7 ),	/* 7 */

+/* 5296 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5298 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 5300 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5302 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x3,		/* 3 */

+/* 5304 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5306 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5308 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5310 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5312 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5314 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 5316 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter time_remaining_ms */

+

+/* 5318 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5320 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5322 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter pos */

+

+/* 5324 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5326 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5328 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 5330 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5332 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5334 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnWaitingToInstall */

+

+/* 5336 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5338 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5342 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5344 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5346 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5348 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5350 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5352 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5354 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5356 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5358 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5360 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5362 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 5364 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5366 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5368 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnPause */

+

+/* 5370 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5372 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5376 */	NdrFcShort( 0xa ),	/* 10 */

+/* 5378 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5380 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5382 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5384 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x1,		/* 1 */

+/* 5386 */	0xc,		/* 12 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5388 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5390 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5392 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5394 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 5396 */	0x1,		/* 1 */

+			0x80,		/* 128 */

+

+	/* Return value */

+

+/* 5398 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5400 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5402 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnComplete */

+

+/* 5404 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5406 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5410 */	NdrFcShort( 0xb ),	/* 11 */

+/* 5412 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5414 */	NdrFcShort( 0x6 ),	/* 6 */

+/* 5416 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5418 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 5420 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5422 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5424 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5426 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5428 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5430 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 5432 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter code */

+

+/* 5434 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5436 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5438 */	0xd,		/* FC_ENUM16 */

+			0x0,		/* 0 */

+

+	/* Parameter completion_text */

+

+/* 5440 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5442 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5444 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Return value */

+

+/* 5446 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5448 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5450 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure SetEventSink */

+

+/* 5452 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5454 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5458 */	NdrFcShort( 0xc ),	/* 12 */

+/* 5460 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5462 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5464 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5466 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x2,		/* 2 */

+/* 5468 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5470 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5472 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5474 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5476 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 5478 */	0x2,		/* 2 */

+			0x80,		/* 128 */

+/* 5480 */	0x81,		/* 129 */

+			0x0,		/* 0 */

+

+	/* Parameter ui_sink */

+

+/* 5482 */	NdrFcShort( 0xb ),	/* Flags:  must size, must free, in, */

+/* 5484 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5486 */	NdrFcShort( 0x438 ),	/* Type Offset=1080 */

+

+	/* Return value */

+

+/* 5488 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5490 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5492 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure OnInstalling2 */

+

+/* 5494 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5496 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5500 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5502 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5504 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 5506 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5508 */	0x44,		/* Oi2 Flags:  has return, has ext, */

+			0x3,		/* 3 */

+/* 5510 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5512 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5514 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5516 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5518 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5520 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 5522 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter time_remaining_ms */

+

+/* 5524 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5526 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5528 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter pos */

+

+/* 5530 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5532 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5534 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 5536 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5538 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5540 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure CheckForUpdate */

+

+/* 5542 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5544 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5548 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5550 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5552 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5554 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5556 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 5558 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5560 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5562 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5564 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5566 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5568 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 5570 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter guid */

+

+/* 5572 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5574 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5576 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter observer */

+

+/* 5578 */	NdrFcShort( 0xb ),	/* Flags:  must size, must free, in, */

+/* 5580 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5582 */	NdrFcShort( 0x44a ),	/* Type Offset=1098 */

+

+	/* Return value */

+

+/* 5584 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5586 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5588 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure Update */

+

+/* 5590 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5592 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5596 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 5598 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5600 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5602 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5604 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x3,		/* 3 */

+/* 5606 */	0xe,		/* 14 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5608 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5610 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5612 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5614 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5616 */	0x3,		/* 3 */

+			0x80,		/* 128 */

+/* 5618 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+

+	/* Parameter guid */

+

+/* 5620 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5622 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5624 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter observer */

+

+/* 5626 */	NdrFcShort( 0xb ),	/* Flags:  must size, must free, in, */

+/* 5628 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5630 */	NdrFcShort( 0x44a ),	/* Type Offset=1098 */

+

+	/* Return value */

+

+/* 5632 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5634 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5636 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Procedure LaunchCmdElevated */

+

+/* 5638 */	0x33,		/* FC_AUTO_HANDLE */

+			0x6c,		/* Old Flags:  object, Oi2 */

+/* 5640 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 5644 */	NdrFcShort( 0x3 ),	/* 3 */

+/* 5646 */	NdrFcShort( 0x30 ),	/* ARM64 Stack size/offset = 48 */

+/* 5648 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 5650 */	NdrFcShort( 0x24 ),	/* 36 */

+/* 5652 */	0x46,		/* Oi2 Flags:  clt must size, has return, has ext, */

+			0x5,		/* 5 */

+/* 5654 */	0x10,		/* 16 */

+			0x1,		/* Ext Flags:  new corr desc, */

+/* 5656 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5658 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5660 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 5662 */	NdrFcShort( 0x5 ),	/* 5 */

+/* 5664 */	0x5,		/* 5 */

+			0x80,		/* 128 */

+/* 5666 */	0x81,		/* 129 */

+			0x82,		/* 130 */

+/* 5668 */	0x83,		/* 131 */

+			0x84,		/* 132 */

+

+	/* Parameter app_guid */

+

+/* 5670 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5672 */	NdrFcShort( 0x8 ),	/* ARM64 Stack size/offset = 8 */

+/* 5674 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter cmd_id */

+

+/* 5676 */	NdrFcShort( 0x10b ),	/* Flags:  must size, must free, in, simple ref, */

+/* 5678 */	NdrFcShort( 0x10 ),	/* ARM64 Stack size/offset = 16 */

+/* 5680 */	NdrFcShort( 0x432 ),	/* Type Offset=1074 */

+

+	/* Parameter caller_proc_id */

+

+/* 5682 */	NdrFcShort( 0x48 ),	/* Flags:  in, base type, */

+/* 5684 */	NdrFcShort( 0x18 ),	/* ARM64 Stack size/offset = 24 */

+/* 5686 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+	/* Parameter proc_handle */

+

+/* 5688 */	NdrFcShort( 0x2150 ),	/* Flags:  out, base type, simple ref, srv alloc size=8 */

+/* 5690 */	NdrFcShort( 0x20 ),	/* ARM64 Stack size/offset = 32 */

+/* 5692 */	0xb9,		/* FC_UINT3264 */

+			0x0,		/* 0 */

+

+	/* Return value */

+

+/* 5694 */	NdrFcShort( 0x70 ),	/* Flags:  out, return, base type, */

+/* 5696 */	NdrFcShort( 0x28 ),	/* ARM64 Stack size/offset = 40 */

+/* 5698 */	0x8,		/* FC_LONG */

+			0x0,		/* 0 */

+

+			0x0

+        }

+    };

+

+static const google_update_idl_MIDL_TYPE_FORMAT_STRING google_update_idl__MIDL_TypeFormatString =

+    {

+        0,

+        {

+			NdrFcShort( 0x0 ),	/* 0 */

+/*  2 */	

+			0x11, 0xc,	/* FC_RP [alloced_on_stack] [simple_pointer] */

+/*  4 */	0x8,		/* FC_LONG */

+			0x5c,		/* FC_PAD */

+/*  6 */	

+			0x11, 0x10,	/* FC_RP [pointer_deref] */

+/*  8 */	NdrFcShort( 0x2 ),	/* Offset= 2 (10) */

+/* 10 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 12 */	NdrFcLong( 0x20400 ),	/* 132096 */

+/* 16 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 18 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 20 */	0xc0,		/* 192 */

+			0x0,		/* 0 */

+/* 22 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 24 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 26 */	0x0,		/* 0 */

+			0x46,		/* 70 */

+/* 28 */	

+			0x11, 0x4,	/* FC_RP [alloced_on_stack] */

+/* 30 */	NdrFcShort( 0x1c ),	/* Offset= 28 (58) */

+/* 32 */	

+			0x13, 0x0,	/* FC_OP */

+/* 34 */	NdrFcShort( 0xe ),	/* Offset= 14 (48) */

+/* 36 */	

+			0x1b,		/* FC_CARRAY */

+			0x1,		/* 1 */

+/* 38 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 40 */	0x9,		/* Corr desc: FC_ULONG */

+			0x0,		/*  */

+/* 42 */	NdrFcShort( 0xfffc ),	/* -4 */

+/* 44 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 46 */	0x6,		/* FC_SHORT */

+			0x5b,		/* FC_END */

+/* 48 */	

+			0x17,		/* FC_CSTRUCT */

+			0x3,		/* 3 */

+/* 50 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 52 */	NdrFcShort( 0xfff0 ),	/* Offset= -16 (36) */

+/* 54 */	0x8,		/* FC_LONG */

+			0x8,		/* FC_LONG */

+/* 56 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 58 */	0xb4,		/* FC_USER_MARSHAL */

+			0x83,		/* 131 */

+/* 60 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 62 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 64 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 66 */	NdrFcShort( 0xffde ),	/* Offset= -34 (32) */

+/* 68 */	

+			0x12, 0x0,	/* FC_UP */

+/* 70 */	NdrFcShort( 0xffea ),	/* Offset= -22 (48) */

+/* 72 */	0xb4,		/* FC_USER_MARSHAL */

+			0x83,		/* 131 */

+/* 74 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 76 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 78 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 80 */	NdrFcShort( 0xfff4 ),	/* Offset= -12 (68) */

+/* 82 */	

+			0x11, 0xc,	/* FC_RP [alloced_on_stack] [simple_pointer] */

+/* 84 */	0x6,		/* FC_SHORT */

+			0x5c,		/* FC_PAD */

+/* 86 */	

+			0x11, 0x4,	/* FC_RP [alloced_on_stack] */

+/* 88 */	NdrFcShort( 0x3a2 ),	/* Offset= 930 (1018) */

+/* 90 */	

+			0x13, 0x0,	/* FC_OP */

+/* 92 */	NdrFcShort( 0x38a ),	/* Offset= 906 (998) */

+/* 94 */	

+			0x2b,		/* FC_NON_ENCAPSULATED_UNION */

+			0x9,		/* FC_ULONG */

+/* 96 */	0x7,		/* Corr desc: FC_USHORT */

+			0x0,		/*  */

+/* 98 */	NdrFcShort( 0xfff8 ),	/* -8 */

+/* 100 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 102 */	NdrFcShort( 0x2 ),	/* Offset= 2 (104) */

+/* 104 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 106 */	NdrFcShort( 0x2f ),	/* 47 */

+/* 108 */	NdrFcLong( 0x14 ),	/* 20 */

+/* 112 */	NdrFcShort( 0x800b ),	/* Simple arm type: FC_HYPER */

+/* 114 */	NdrFcLong( 0x3 ),	/* 3 */

+/* 118 */	NdrFcShort( 0x8008 ),	/* Simple arm type: FC_LONG */

+/* 120 */	NdrFcLong( 0x11 ),	/* 17 */

+/* 124 */	NdrFcShort( 0x8001 ),	/* Simple arm type: FC_BYTE */

+/* 126 */	NdrFcLong( 0x2 ),	/* 2 */

+/* 130 */	NdrFcShort( 0x8006 ),	/* Simple arm type: FC_SHORT */

+/* 132 */	NdrFcLong( 0x4 ),	/* 4 */

+/* 136 */	NdrFcShort( 0x800a ),	/* Simple arm type: FC_FLOAT */

+/* 138 */	NdrFcLong( 0x5 ),	/* 5 */

+/* 142 */	NdrFcShort( 0x800c ),	/* Simple arm type: FC_DOUBLE */

+/* 144 */	NdrFcLong( 0xb ),	/* 11 */

+/* 148 */	NdrFcShort( 0x8006 ),	/* Simple arm type: FC_SHORT */

+/* 150 */	NdrFcLong( 0xa ),	/* 10 */

+/* 154 */	NdrFcShort( 0x8008 ),	/* Simple arm type: FC_LONG */

+/* 156 */	NdrFcLong( 0x6 ),	/* 6 */

+/* 160 */	NdrFcShort( 0xe8 ),	/* Offset= 232 (392) */

+/* 162 */	NdrFcLong( 0x7 ),	/* 7 */

+/* 166 */	NdrFcShort( 0x800c ),	/* Simple arm type: FC_DOUBLE */

+/* 168 */	NdrFcLong( 0x8 ),	/* 8 */

+/* 172 */	NdrFcShort( 0xff74 ),	/* Offset= -140 (32) */

+/* 174 */	NdrFcLong( 0xd ),	/* 13 */

+/* 178 */	NdrFcShort( 0xdc ),	/* Offset= 220 (398) */

+/* 180 */	NdrFcLong( 0x9 ),	/* 9 */

+/* 184 */	NdrFcShort( 0xff52 ),	/* Offset= -174 (10) */

+/* 186 */	NdrFcLong( 0x2000 ),	/* 8192 */

+/* 190 */	NdrFcShort( 0xe2 ),	/* Offset= 226 (416) */

+/* 192 */	NdrFcLong( 0x24 ),	/* 36 */

+/* 196 */	NdrFcShort( 0x2d8 ),	/* Offset= 728 (924) */

+/* 198 */	NdrFcLong( 0x4024 ),	/* 16420 */

+/* 202 */	NdrFcShort( 0x2d2 ),	/* Offset= 722 (924) */

+/* 204 */	NdrFcLong( 0x4011 ),	/* 16401 */

+/* 208 */	NdrFcShort( 0x2d0 ),	/* Offset= 720 (928) */

+/* 210 */	NdrFcLong( 0x4002 ),	/* 16386 */

+/* 214 */	NdrFcShort( 0x2ce ),	/* Offset= 718 (932) */

+/* 216 */	NdrFcLong( 0x4003 ),	/* 16387 */

+/* 220 */	NdrFcShort( 0x2cc ),	/* Offset= 716 (936) */

+/* 222 */	NdrFcLong( 0x4014 ),	/* 16404 */

+/* 226 */	NdrFcShort( 0x2ca ),	/* Offset= 714 (940) */

+/* 228 */	NdrFcLong( 0x4004 ),	/* 16388 */

+/* 232 */	NdrFcShort( 0x2c8 ),	/* Offset= 712 (944) */

+/* 234 */	NdrFcLong( 0x4005 ),	/* 16389 */

+/* 238 */	NdrFcShort( 0x2c6 ),	/* Offset= 710 (948) */

+/* 240 */	NdrFcLong( 0x400b ),	/* 16395 */

+/* 244 */	NdrFcShort( 0x2b0 ),	/* Offset= 688 (932) */

+/* 246 */	NdrFcLong( 0x400a ),	/* 16394 */

+/* 250 */	NdrFcShort( 0x2ae ),	/* Offset= 686 (936) */

+/* 252 */	NdrFcLong( 0x4006 ),	/* 16390 */

+/* 256 */	NdrFcShort( 0x2b8 ),	/* Offset= 696 (952) */

+/* 258 */	NdrFcLong( 0x4007 ),	/* 16391 */

+/* 262 */	NdrFcShort( 0x2ae ),	/* Offset= 686 (948) */

+/* 264 */	NdrFcLong( 0x4008 ),	/* 16392 */

+/* 268 */	NdrFcShort( 0x2b0 ),	/* Offset= 688 (956) */

+/* 270 */	NdrFcLong( 0x400d ),	/* 16397 */

+/* 274 */	NdrFcShort( 0x2ae ),	/* Offset= 686 (960) */

+/* 276 */	NdrFcLong( 0x4009 ),	/* 16393 */

+/* 280 */	NdrFcShort( 0x2ac ),	/* Offset= 684 (964) */

+/* 282 */	NdrFcLong( 0x6000 ),	/* 24576 */

+/* 286 */	NdrFcShort( 0x2aa ),	/* Offset= 682 (968) */

+/* 288 */	NdrFcLong( 0x400c ),	/* 16396 */

+/* 292 */	NdrFcShort( 0x2a8 ),	/* Offset= 680 (972) */

+/* 294 */	NdrFcLong( 0x10 ),	/* 16 */

+/* 298 */	NdrFcShort( 0x8002 ),	/* Simple arm type: FC_CHAR */

+/* 300 */	NdrFcLong( 0x12 ),	/* 18 */

+/* 304 */	NdrFcShort( 0x8006 ),	/* Simple arm type: FC_SHORT */

+/* 306 */	NdrFcLong( 0x13 ),	/* 19 */

+/* 310 */	NdrFcShort( 0x8008 ),	/* Simple arm type: FC_LONG */

+/* 312 */	NdrFcLong( 0x15 ),	/* 21 */

+/* 316 */	NdrFcShort( 0x800b ),	/* Simple arm type: FC_HYPER */

+/* 318 */	NdrFcLong( 0x16 ),	/* 22 */

+/* 322 */	NdrFcShort( 0x8008 ),	/* Simple arm type: FC_LONG */

+/* 324 */	NdrFcLong( 0x17 ),	/* 23 */

+/* 328 */	NdrFcShort( 0x8008 ),	/* Simple arm type: FC_LONG */

+/* 330 */	NdrFcLong( 0xe ),	/* 14 */

+/* 334 */	NdrFcShort( 0x286 ),	/* Offset= 646 (980) */

+/* 336 */	NdrFcLong( 0x400e ),	/* 16398 */

+/* 340 */	NdrFcShort( 0x28a ),	/* Offset= 650 (990) */

+/* 342 */	NdrFcLong( 0x4010 ),	/* 16400 */

+/* 346 */	NdrFcShort( 0x288 ),	/* Offset= 648 (994) */

+/* 348 */	NdrFcLong( 0x4012 ),	/* 16402 */

+/* 352 */	NdrFcShort( 0x244 ),	/* Offset= 580 (932) */

+/* 354 */	NdrFcLong( 0x4013 ),	/* 16403 */

+/* 358 */	NdrFcShort( 0x242 ),	/* Offset= 578 (936) */

+/* 360 */	NdrFcLong( 0x4015 ),	/* 16405 */

+/* 364 */	NdrFcShort( 0x240 ),	/* Offset= 576 (940) */

+/* 366 */	NdrFcLong( 0x4016 ),	/* 16406 */

+/* 370 */	NdrFcShort( 0x236 ),	/* Offset= 566 (936) */

+/* 372 */	NdrFcLong( 0x4017 ),	/* 16407 */

+/* 376 */	NdrFcShort( 0x230 ),	/* Offset= 560 (936) */

+/* 378 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 382 */	NdrFcShort( 0x0 ),	/* Offset= 0 (382) */

+/* 384 */	NdrFcLong( 0x1 ),	/* 1 */

+/* 388 */	NdrFcShort( 0x0 ),	/* Offset= 0 (388) */

+/* 390 */	NdrFcShort( 0xffff ),	/* Offset= -1 (389) */

+/* 392 */	

+			0x15,		/* FC_STRUCT */

+			0x7,		/* 7 */

+/* 394 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 396 */	0xb,		/* FC_HYPER */

+			0x5b,		/* FC_END */

+/* 398 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 400 */	NdrFcLong( 0x0 ),	/* 0 */

+/* 404 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 406 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 408 */	0xc0,		/* 192 */

+			0x0,		/* 0 */

+/* 410 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 412 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 414 */	0x0,		/* 0 */

+			0x46,		/* 70 */

+/* 416 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 418 */	NdrFcShort( 0x2 ),	/* Offset= 2 (420) */

+/* 420 */	

+			0x13, 0x0,	/* FC_OP */

+/* 422 */	NdrFcShort( 0x1e4 ),	/* Offset= 484 (906) */

+/* 424 */	

+			0x2a,		/* FC_ENCAPSULATED_UNION */

+			0x89,		/* 137 */

+/* 426 */	NdrFcShort( 0x20 ),	/* 32 */

+/* 428 */	NdrFcShort( 0xa ),	/* 10 */

+/* 430 */	NdrFcLong( 0x8 ),	/* 8 */

+/* 434 */	NdrFcShort( 0x50 ),	/* Offset= 80 (514) */

+/* 436 */	NdrFcLong( 0xd ),	/* 13 */

+/* 440 */	NdrFcShort( 0x70 ),	/* Offset= 112 (552) */

+/* 442 */	NdrFcLong( 0x9 ),	/* 9 */

+/* 446 */	NdrFcShort( 0x90 ),	/* Offset= 144 (590) */

+/* 448 */	NdrFcLong( 0xc ),	/* 12 */

+/* 452 */	NdrFcShort( 0xb0 ),	/* Offset= 176 (628) */

+/* 454 */	NdrFcLong( 0x24 ),	/* 36 */

+/* 458 */	NdrFcShort( 0x102 ),	/* Offset= 258 (716) */

+/* 460 */	NdrFcLong( 0x800d ),	/* 32781 */

+/* 464 */	NdrFcShort( 0x11e ),	/* Offset= 286 (750) */

+/* 466 */	NdrFcLong( 0x10 ),	/* 16 */

+/* 470 */	NdrFcShort( 0x138 ),	/* Offset= 312 (782) */

+/* 472 */	NdrFcLong( 0x2 ),	/* 2 */

+/* 476 */	NdrFcShort( 0x14e ),	/* Offset= 334 (810) */

+/* 478 */	NdrFcLong( 0x3 ),	/* 3 */

+/* 482 */	NdrFcShort( 0x164 ),	/* Offset= 356 (838) */

+/* 484 */	NdrFcLong( 0x14 ),	/* 20 */

+/* 488 */	NdrFcShort( 0x17a ),	/* Offset= 378 (866) */

+/* 490 */	NdrFcShort( 0xffff ),	/* Offset= -1 (489) */

+/* 492 */	

+			0x21,		/* FC_BOGUS_ARRAY */

+			0x3,		/* 3 */

+/* 494 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 496 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 498 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 500 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 502 */	NdrFcLong( 0xffffffff ),	/* -1 */

+/* 506 */	NdrFcShort( 0x0 ),	/* Corr flags:  */

+/* 508 */	

+			0x13, 0x0,	/* FC_OP */

+/* 510 */	NdrFcShort( 0xfe32 ),	/* Offset= -462 (48) */

+/* 512 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 514 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 516 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 518 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 520 */	NdrFcShort( 0x6 ),	/* Offset= 6 (526) */

+/* 522 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 524 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 526 */	

+			0x11, 0x0,	/* FC_RP */

+/* 528 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (492) */

+/* 530 */	

+			0x21,		/* FC_BOGUS_ARRAY */

+			0x3,		/* 3 */

+/* 532 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 534 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 536 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 538 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 540 */	NdrFcLong( 0xffffffff ),	/* -1 */

+/* 544 */	NdrFcShort( 0x0 ),	/* Corr flags:  */

+/* 546 */	0x4c,		/* FC_EMBEDDED_COMPLEX */

+			0x0,		/* 0 */

+/* 548 */	NdrFcShort( 0xff6a ),	/* Offset= -150 (398) */

+/* 550 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 552 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 554 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 556 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 558 */	NdrFcShort( 0x6 ),	/* Offset= 6 (564) */

+/* 560 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 562 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 564 */	

+			0x11, 0x0,	/* FC_RP */

+/* 566 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (530) */

+/* 568 */	

+			0x21,		/* FC_BOGUS_ARRAY */

+			0x3,		/* 3 */

+/* 570 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 572 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 574 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 576 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 578 */	NdrFcLong( 0xffffffff ),	/* -1 */

+/* 582 */	NdrFcShort( 0x0 ),	/* Corr flags:  */

+/* 584 */	0x4c,		/* FC_EMBEDDED_COMPLEX */

+			0x0,		/* 0 */

+/* 586 */	NdrFcShort( 0xfdc0 ),	/* Offset= -576 (10) */

+/* 588 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 590 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 592 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 594 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 596 */	NdrFcShort( 0x6 ),	/* Offset= 6 (602) */

+/* 598 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 600 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 602 */	

+			0x11, 0x0,	/* FC_RP */

+/* 604 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (568) */

+/* 606 */	

+			0x21,		/* FC_BOGUS_ARRAY */

+			0x3,		/* 3 */

+/* 608 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 610 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 612 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 614 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 616 */	NdrFcLong( 0xffffffff ),	/* -1 */

+/* 620 */	NdrFcShort( 0x0 ),	/* Corr flags:  */

+/* 622 */	

+			0x13, 0x0,	/* FC_OP */

+/* 624 */	NdrFcShort( 0x176 ),	/* Offset= 374 (998) */

+/* 626 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 628 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 630 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 632 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 634 */	NdrFcShort( 0x6 ),	/* Offset= 6 (640) */

+/* 636 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 638 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 640 */	

+			0x11, 0x0,	/* FC_RP */

+/* 642 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (606) */

+/* 644 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 646 */	NdrFcLong( 0x2f ),	/* 47 */

+/* 650 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 652 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 654 */	0xc0,		/* 192 */

+			0x0,		/* 0 */

+/* 656 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 658 */	0x0,		/* 0 */

+			0x0,		/* 0 */

+/* 660 */	0x0,		/* 0 */

+			0x46,		/* 70 */

+/* 662 */	

+			0x1b,		/* FC_CARRAY */

+			0x0,		/* 0 */

+/* 664 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 666 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 668 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 670 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 672 */	0x1,		/* FC_BYTE */

+			0x5b,		/* FC_END */

+/* 674 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 676 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 678 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 680 */	NdrFcShort( 0xa ),	/* Offset= 10 (690) */

+/* 682 */	0x8,		/* FC_LONG */

+			0x8,		/* FC_LONG */

+/* 684 */	0x4c,		/* FC_EMBEDDED_COMPLEX */

+			0x0,		/* 0 */

+/* 686 */	NdrFcShort( 0xffd6 ),	/* Offset= -42 (644) */

+/* 688 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 690 */	

+			0x13, 0x0,	/* FC_OP */

+/* 692 */	NdrFcShort( 0xffe2 ),	/* Offset= -30 (662) */

+/* 694 */	

+			0x21,		/* FC_BOGUS_ARRAY */

+			0x3,		/* 3 */

+/* 696 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 698 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 700 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 702 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 704 */	NdrFcLong( 0xffffffff ),	/* -1 */

+/* 708 */	NdrFcShort( 0x0 ),	/* Corr flags:  */

+/* 710 */	

+			0x13, 0x0,	/* FC_OP */

+/* 712 */	NdrFcShort( 0xffda ),	/* Offset= -38 (674) */

+/* 714 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 716 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 718 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 720 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 722 */	NdrFcShort( 0x6 ),	/* Offset= 6 (728) */

+/* 724 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 726 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 728 */	

+			0x11, 0x0,	/* FC_RP */

+/* 730 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (694) */

+/* 732 */	

+			0x1d,		/* FC_SMFARRAY */

+			0x0,		/* 0 */

+/* 734 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 736 */	0x1,		/* FC_BYTE */

+			0x5b,		/* FC_END */

+/* 738 */	

+			0x15,		/* FC_STRUCT */

+			0x3,		/* 3 */

+/* 740 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 742 */	0x8,		/* FC_LONG */

+			0x6,		/* FC_SHORT */

+/* 744 */	0x6,		/* FC_SHORT */

+			0x4c,		/* FC_EMBEDDED_COMPLEX */

+/* 746 */	0x0,		/* 0 */

+			NdrFcShort( 0xfff1 ),	/* Offset= -15 (732) */

+			0x5b,		/* FC_END */

+/* 750 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 752 */	NdrFcShort( 0x20 ),	/* 32 */

+/* 754 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 756 */	NdrFcShort( 0xa ),	/* Offset= 10 (766) */

+/* 758 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 760 */	0x36,		/* FC_POINTER */

+			0x4c,		/* FC_EMBEDDED_COMPLEX */

+/* 762 */	0x0,		/* 0 */

+			NdrFcShort( 0xffe7 ),	/* Offset= -25 (738) */

+			0x5b,		/* FC_END */

+/* 766 */	

+			0x11, 0x0,	/* FC_RP */

+/* 768 */	NdrFcShort( 0xff12 ),	/* Offset= -238 (530) */

+/* 770 */	

+			0x1b,		/* FC_CARRAY */

+			0x0,		/* 0 */

+/* 772 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 774 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 776 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 778 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 780 */	0x1,		/* FC_BYTE */

+			0x5b,		/* FC_END */

+/* 782 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 784 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 786 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 788 */	NdrFcShort( 0x6 ),	/* Offset= 6 (794) */

+/* 790 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 792 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 794 */	

+			0x13, 0x0,	/* FC_OP */

+/* 796 */	NdrFcShort( 0xffe6 ),	/* Offset= -26 (770) */

+/* 798 */	

+			0x1b,		/* FC_CARRAY */

+			0x1,		/* 1 */

+/* 800 */	NdrFcShort( 0x2 ),	/* 2 */

+/* 802 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 804 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 806 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 808 */	0x6,		/* FC_SHORT */

+			0x5b,		/* FC_END */

+/* 810 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 812 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 814 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 816 */	NdrFcShort( 0x6 ),	/* Offset= 6 (822) */

+/* 818 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 820 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 822 */	

+			0x13, 0x0,	/* FC_OP */

+/* 824 */	NdrFcShort( 0xffe6 ),	/* Offset= -26 (798) */

+/* 826 */	

+			0x1b,		/* FC_CARRAY */

+			0x3,		/* 3 */

+/* 828 */	NdrFcShort( 0x4 ),	/* 4 */

+/* 830 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 832 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 834 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 836 */	0x8,		/* FC_LONG */

+			0x5b,		/* FC_END */

+/* 838 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 840 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 842 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 844 */	NdrFcShort( 0x6 ),	/* Offset= 6 (850) */

+/* 846 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 848 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 850 */	

+			0x13, 0x0,	/* FC_OP */

+/* 852 */	NdrFcShort( 0xffe6 ),	/* Offset= -26 (826) */

+/* 854 */	

+			0x1b,		/* FC_CARRAY */

+			0x7,		/* 7 */

+/* 856 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 858 */	0x19,		/* Corr desc:  field pointer, FC_ULONG */

+			0x0,		/*  */

+/* 860 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 862 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 864 */	0xb,		/* FC_HYPER */

+			0x5b,		/* FC_END */

+/* 866 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 868 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 870 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 872 */	NdrFcShort( 0x6 ),	/* Offset= 6 (878) */

+/* 874 */	0x8,		/* FC_LONG */

+			0x40,		/* FC_STRUCTPAD4 */

+/* 876 */	0x36,		/* FC_POINTER */

+			0x5b,		/* FC_END */

+/* 878 */	

+			0x13, 0x0,	/* FC_OP */

+/* 880 */	NdrFcShort( 0xffe6 ),	/* Offset= -26 (854) */

+/* 882 */	

+			0x15,		/* FC_STRUCT */

+			0x3,		/* 3 */

+/* 884 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 886 */	0x8,		/* FC_LONG */

+			0x8,		/* FC_LONG */

+/* 888 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 890 */	

+			0x1b,		/* FC_CARRAY */

+			0x3,		/* 3 */

+/* 892 */	NdrFcShort( 0x8 ),	/* 8 */

+/* 894 */	0x7,		/* Corr desc: FC_USHORT */

+			0x0,		/*  */

+/* 896 */	NdrFcShort( 0xffc8 ),	/* -56 */

+/* 898 */	NdrFcShort( 0x1 ),	/* Corr flags:  early, */

+/* 900 */	0x4c,		/* FC_EMBEDDED_COMPLEX */

+			0x0,		/* 0 */

+/* 902 */	NdrFcShort( 0xffec ),	/* Offset= -20 (882) */

+/* 904 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 906 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x3,		/* 3 */

+/* 908 */	NdrFcShort( 0x38 ),	/* 56 */

+/* 910 */	NdrFcShort( 0xffec ),	/* Offset= -20 (890) */

+/* 912 */	NdrFcShort( 0x0 ),	/* Offset= 0 (912) */

+/* 914 */	0x6,		/* FC_SHORT */

+			0x6,		/* FC_SHORT */

+/* 916 */	0x8,		/* FC_LONG */

+			0x8,		/* FC_LONG */

+/* 918 */	0x40,		/* FC_STRUCTPAD4 */

+			0x4c,		/* FC_EMBEDDED_COMPLEX */

+/* 920 */	0x0,		/* 0 */

+			NdrFcShort( 0xfe0f ),	/* Offset= -497 (424) */

+			0x5b,		/* FC_END */

+/* 924 */	

+			0x13, 0x0,	/* FC_OP */

+/* 926 */	NdrFcShort( 0xff04 ),	/* Offset= -252 (674) */

+/* 928 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 930 */	0x1,		/* FC_BYTE */

+			0x5c,		/* FC_PAD */

+/* 932 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 934 */	0x6,		/* FC_SHORT */

+			0x5c,		/* FC_PAD */

+/* 936 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 938 */	0x8,		/* FC_LONG */

+			0x5c,		/* FC_PAD */

+/* 940 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 942 */	0xb,		/* FC_HYPER */

+			0x5c,		/* FC_PAD */

+/* 944 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 946 */	0xa,		/* FC_FLOAT */

+			0x5c,		/* FC_PAD */

+/* 948 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 950 */	0xc,		/* FC_DOUBLE */

+			0x5c,		/* FC_PAD */

+/* 952 */	

+			0x13, 0x0,	/* FC_OP */

+/* 954 */	NdrFcShort( 0xfdce ),	/* Offset= -562 (392) */

+/* 956 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 958 */	NdrFcShort( 0xfc62 ),	/* Offset= -926 (32) */

+/* 960 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 962 */	NdrFcShort( 0xfdcc ),	/* Offset= -564 (398) */

+/* 964 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 966 */	NdrFcShort( 0xfc44 ),	/* Offset= -956 (10) */

+/* 968 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 970 */	NdrFcShort( 0xfdd6 ),	/* Offset= -554 (416) */

+/* 972 */	

+			0x13, 0x10,	/* FC_OP [pointer_deref] */

+/* 974 */	NdrFcShort( 0x2 ),	/* Offset= 2 (976) */

+/* 976 */	

+			0x13, 0x0,	/* FC_OP */

+/* 978 */	NdrFcShort( 0x14 ),	/* Offset= 20 (998) */

+/* 980 */	

+			0x15,		/* FC_STRUCT */

+			0x7,		/* 7 */

+/* 982 */	NdrFcShort( 0x10 ),	/* 16 */

+/* 984 */	0x6,		/* FC_SHORT */

+			0x1,		/* FC_BYTE */

+/* 986 */	0x1,		/* FC_BYTE */

+			0x8,		/* FC_LONG */

+/* 988 */	0xb,		/* FC_HYPER */

+			0x5b,		/* FC_END */

+/* 990 */	

+			0x13, 0x0,	/* FC_OP */

+/* 992 */	NdrFcShort( 0xfff4 ),	/* Offset= -12 (980) */

+/* 994 */	

+			0x13, 0x8,	/* FC_OP [simple_pointer] */

+/* 996 */	0x2,		/* FC_CHAR */

+			0x5c,		/* FC_PAD */

+/* 998 */	

+			0x1a,		/* FC_BOGUS_STRUCT */

+			0x7,		/* 7 */

+/* 1000 */	NdrFcShort( 0x20 ),	/* 32 */

+/* 1002 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1004 */	NdrFcShort( 0x0 ),	/* Offset= 0 (1004) */

+/* 1006 */	0x8,		/* FC_LONG */

+			0x8,		/* FC_LONG */

+/* 1008 */	0x6,		/* FC_SHORT */

+			0x6,		/* FC_SHORT */

+/* 1010 */	0x6,		/* FC_SHORT */

+			0x6,		/* FC_SHORT */

+/* 1012 */	0x4c,		/* FC_EMBEDDED_COMPLEX */

+			0x0,		/* 0 */

+/* 1014 */	NdrFcShort( 0xfc68 ),	/* Offset= -920 (94) */

+/* 1016 */	0x5c,		/* FC_PAD */

+			0x5b,		/* FC_END */

+/* 1018 */	0xb4,		/* FC_USER_MARSHAL */

+			0x83,		/* 131 */

+/* 1020 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1022 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 1024 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1026 */	NdrFcShort( 0xfc58 ),	/* Offset= -936 (90) */

+/* 1028 */	

+			0x11, 0x0,	/* FC_RP */

+/* 1030 */	NdrFcShort( 0x6 ),	/* Offset= 6 (1036) */

+/* 1032 */	

+			0x12, 0x0,	/* FC_UP */

+/* 1034 */	NdrFcShort( 0xffdc ),	/* Offset= -36 (998) */

+/* 1036 */	0xb4,		/* FC_USER_MARSHAL */

+			0x83,		/* 131 */

+/* 1038 */	NdrFcShort( 0x1 ),	/* 1 */

+/* 1040 */	NdrFcShort( 0x18 ),	/* 24 */

+/* 1042 */	NdrFcShort( 0x0 ),	/* 0 */

+/* 1044 */	NdrFcShort( 0xfff4 ),	/* Offset= -12 (1032) */

+/* 1046 */	

+			0x11, 0xc,	/* FC_RP [alloced_on_stack] [simple_pointer] */

+/* 1048 */	0xb,		/* FC_HYPER */

+			0x5c,		/* FC_PAD */

+/* 1050 */	

+			0x11, 0x10,	/* FC_RP [pointer_deref] */

+/* 1052 */	NdrFcShort( 0x2 ),	/* Offset= 2 (1054) */

+/* 1054 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 1056 */	NdrFcLong( 0x9a6b447a ),	/* -1704246150 */

+/* 1060 */	NdrFcShort( 0x35e2 ),	/* 13794 */

+/* 1062 */	NdrFcShort( 0x4f6b ),	/* 20331 */

+/* 1064 */	0xa8,		/* 168 */

+			0x7b,		/* 123 */

+/* 1066 */	0x5d,		/* 93 */

+			0xee,		/* 238 */

+/* 1068 */	0xbb,		/* 187 */

+			0xfd,		/* 253 */

+/* 1070 */	0xad,		/* 173 */

+			0x17,		/* 23 */

+/* 1072 */	

+			0x11, 0x8,	/* FC_RP [simple_pointer] */

+/* 1074 */	

+			0x25,		/* FC_C_WSTRING */

+			0x5c,		/* FC_PAD */

+/* 1076 */	

+			0x11, 0xc,	/* FC_RP [alloced_on_stack] [simple_pointer] */

+/* 1078 */	0xb9,		/* FC_UINT3264 */

+			0x5c,		/* FC_PAD */

+/* 1080 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 1082 */	NdrFcLong( 0xe55b90f1 ),	/* -446983951 */

+/* 1086 */	NdrFcShort( 0xda33 ),	/* -9677 */

+/* 1088 */	NdrFcShort( 0x400b ),	/* 16395 */

+/* 1090 */	0xb0,		/* 176 */

+			0x9e,		/* 158 */

+/* 1092 */	0x3a,		/* 58 */

+			0xff,		/* 255 */

+/* 1094 */	0x7d,		/* 125 */

+			0x46,		/* 70 */

+/* 1096 */	0xbd,		/* 189 */

+			0x83,		/* 131 */

+/* 1098 */	

+			0x2f,		/* FC_IP */

+			0x5a,		/* FC_CONSTANT_IID */

+/* 1100 */	NdrFcLong( 0x99f8e195 ),	/* -1711742571 */

+/* 1104 */	NdrFcShort( 0x1042 ),	/* 4162 */

+/* 1106 */	NdrFcShort( 0x4f89 ),	/* 20361 */

+/* 1108 */	0xa2,		/* 162 */

+			0x8c,		/* 140 */

+/* 1110 */	0x89,		/* 137 */

+			0xcd,		/* 205 */

+/* 1112 */	0xb7,		/* 183 */

+			0x4a,		/* 74 */

+/* 1114 */	0x14,		/* 20 */

+			0xae,		/* 174 */

+

+			0x0

+        }

+    };

+

+static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[ WIRE_MARSHAL_TABLE_SIZE ] = 

+        {

+            

+            {

+            BSTR_UserSize

+            ,BSTR_UserMarshal

+            ,BSTR_UserUnmarshal

+            ,BSTR_UserFree

+            },

+            {

+            VARIANT_UserSize

+            ,VARIANT_UserMarshal

+            ,VARIANT_UserUnmarshal

+            ,VARIANT_UserFree

+            }

+

+        };

+

+

+

+/* Standard interface: __MIDL_itf_google_update_idl_0000_0000, ver. 0.0,

+   GUID={0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} */

+

+

+/* Object interface: IUnknown, ver. 0.0,

+   GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */

+

+

+/* Object interface: IDispatch, ver. 0.0,

+   GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */

+

+

+/* Object interface: IGoogleUpdate3, ver. 0.0,

+   GUID={0xddd4b5d4,0xfd54,0x497c,{0x87,0x89,0x08,0x30,0xf2,0x9a,0x60,0xee}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IGoogleUpdate3_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    0,

+    42,

+    90

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IGoogleUpdate3_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(10) _IGoogleUpdate3ProxyVtbl = 

+{

+    &IGoogleUpdate3_ProxyInfo,

+    &IID_IGoogleUpdate3,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate3::get_Count */ ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate3::get_Item */ ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate3::createAppBundle */

+};

+

+

+static const PRPC_STUB_FUNCTION IGoogleUpdate3_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IGoogleUpdate3StubVtbl =

+{

+    &IID_IGoogleUpdate3,

+    &IGoogleUpdate3_ServerInfo,

+    10,

+    &IGoogleUpdate3_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppBundle, ver. 0.0,

+   GUID={0xab4f4a7e,0x977c,0x4e23,{0xad,0x8f,0x62,0x6a,0x49,0x17,0x15,0xdf}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppBundle_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    132,

+    174,

+    216,

+    258,

+    300,

+    342,

+    384,

+    426,

+    468,

+    510,

+    552,

+    594,

+    636,

+    678,

+    720,

+    762,

+    804,

+    846,

+    894,

+    950,

+    992,

+    1026,

+    1074,

+    1122,

+    1156,

+    1190,

+    1224,

+    1258,

+    1292,

+    1326,

+    1360,

+    1394,

+    1436,

+    1484

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppBundle_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppBundle_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppBundle_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppBundle_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(41) _IAppBundleProxyVtbl = 

+{

+    &IAppBundle_ProxyInfo,

+    &IID_IAppBundle,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_displayName */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_displayName */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_displayLanguage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_displayLanguage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_installSource */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_installSource */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_originURL */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_originURL */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_offlineDirectory */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_offlineDirectory */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_sessionId */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_sessionId */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_sendPings */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_sendPings */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_priority */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_priority */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_Count */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_Item */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_altTokens */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::put_parentHWND */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::initialize */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::createApp */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::createInstalledApp */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::createAllInstalledApps */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::checkForUpdate */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::download */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::install */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::updateAllApps */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::stop */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::pause */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::resume */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::isBusy */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::downloadPackage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundle::get_currentState */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppBundle_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppBundleStubVtbl =

+{

+    &IID_IAppBundle,

+    &IAppBundle_ServerInfo,

+    41,

+    &IAppBundle_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IApp, ver. 0.0,

+   GUID={0x195a2eb3,0x21ee,0x43ca,{0x9f,0x23,0x93,0xc2,0xc9,0x93,0x4e,0x2e}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IApp_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    1526,

+    1568,

+    216,

+    1610,

+    1652,

+    1694,

+    1736,

+    1778,

+    1820,

+    1862,

+    1904,

+    1946,

+    1988,

+    2030,

+    2072,

+    2114,

+    2156,

+    2198,

+    2240,

+    2282,

+    2324,

+    1026,

+    2366,

+    2408,

+    2450,

+    2492,

+    2534,

+    2576,

+    2618,

+    2660,

+    2702,

+    2744,

+    2786,

+    2828

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IApp_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IApp_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IApp_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IApp_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(41) _IAppProxyVtbl = 

+{

+    &IApp_ProxyInfo,

+    &IID_IApp,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_currentVersion */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_nextVersion */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_appId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_displayName */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_displayName */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_language */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_language */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_ap */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_ap */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_ttToken */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_ttToken */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_iid */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_iid */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_brandCode */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_brandCode */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_clientId */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_clientId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_labels */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_labels */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_referralId */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_referralId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_command */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_browserType */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_browserType */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_clientInstallData */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_clientInstallData */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_serverInstallDataIndex */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_serverInstallDataIndex */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_isEulaAccepted */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_isEulaAccepted */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_usageStatsEnable */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_usageStatsEnable */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_installTimeDiffSec */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_currentState */

+};

+

+

+static const PRPC_STUB_FUNCTION IApp_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppStubVtbl =

+{

+    &IID_IApp,

+    &IApp_ServerInfo,

+    41,

+    &IApp_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IApp2, ver. 0.0,

+   GUID={0xc06ee550,0x7248,0x488e,{0x97,0x1e,0xb6,0x0c,0x0a,0xb3,0xa6,0xe4}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IApp2_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    1526,

+    1568,

+    216,

+    1610,

+    1652,

+    1694,

+    1736,

+    1778,

+    1820,

+    1862,

+    1904,

+    1946,

+    1988,

+    2030,

+    2072,

+    2114,

+    2156,

+    2198,

+    2240,

+    2282,

+    2324,

+    1026,

+    2366,

+    2408,

+    2450,

+    2492,

+    2534,

+    2576,

+    2618,

+    2660,

+    2702,

+    2744,

+    2786,

+    2828,

+    2870,

+    2912

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IApp2_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IApp2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IApp2_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IApp2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(43) _IApp2ProxyVtbl = 

+{

+    &IApp2_ProxyInfo,

+    &IID_IApp2,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_currentVersion */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_nextVersion */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_appId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_displayName */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_displayName */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_language */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_language */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_ap */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_ap */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_ttToken */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_ttToken */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_iid */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_iid */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_brandCode */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_brandCode */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_clientId */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_clientId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_labels */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_labels */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_referralId */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_referralId */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_command */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_browserType */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_browserType */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_clientInstallData */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_clientInstallData */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_serverInstallDataIndex */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_serverInstallDataIndex */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_isEulaAccepted */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_isEulaAccepted */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_usageStatsEnable */ ,

+    (void *) (INT_PTR) -1 /* IApp::put_usageStatsEnable */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_installTimeDiffSec */ ,

+    (void *) (INT_PTR) -1 /* IApp::get_currentState */ ,

+    (void *) (INT_PTR) -1 /* IApp2::get_untrustedData */ ,

+    (void *) (INT_PTR) -1 /* IApp2::put_untrustedData */

+};

+

+

+static const PRPC_STUB_FUNCTION IApp2_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IApp2StubVtbl =

+{

+    &IID_IApp2,

+    &IApp2_ServerInfo,

+    43,

+    &IApp2_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppCommand, ver. 0.0,

+   GUID={0x5f9c80b5,0x9e50,0x43c9,{0x88,0x7c,0x7c,0x64,0x12,0xe1,0x10,0xdf}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppCommand_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    2954,

+    2996,

+    3038,

+    3080

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppCommand_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommand_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppCommand_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommand_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(11) _IAppCommandProxyVtbl = 

+{

+    &IAppCommand_ProxyInfo,

+    &IID_IAppCommand,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_isWebAccessible */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_status */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_exitCode */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::execute */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppCommand_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppCommandStubVtbl =

+{

+    &IID_IAppCommand,

+    &IAppCommand_ServerInfo,

+    11,

+    &IAppCommand_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppCommand2, ver. 0.0,

+   GUID={0x7e29be61,0x5809,0x443f,{0x9b,0x5d,0xcf,0x22,0x15,0x66,0x94,0xeb}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppCommand2_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    2954,

+    2996,

+    3038,

+    3080,

+    300

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppCommand2_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommand2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppCommand2_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommand2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(12) _IAppCommand2ProxyVtbl = 

+{

+    &IAppCommand2_ProxyInfo,

+    &IID_IAppCommand2,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_isWebAccessible */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_status */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::get_exitCode */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand::execute */ ,

+    (void *) (INT_PTR) -1 /* IAppCommand2::get_output */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppCommand2_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppCommand2StubVtbl =

+{

+    &IID_IAppCommand2,

+    &IAppCommand2_ServerInfo,

+    12,

+    &IAppCommand2_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppVersion, ver. 0.0,

+   GUID={0x7b3b7a69,0x7d88,0x4847,{0xa6,0xbc,0x90,0xe2,0x46,0xa4,0x1f,0x69}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppVersion_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    132,

+    2996,

+    3178

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppVersion_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppVersion_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppVersion_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppVersion_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(10) _IAppVersionProxyVtbl = 

+{

+    &IAppVersion_ProxyInfo,

+    &IID_IAppVersion,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppVersion::get_version */ ,

+    (void *) (INT_PTR) -1 /* IAppVersion::get_packageCount */ ,

+    (void *) (INT_PTR) -1 /* IAppVersion::get_package */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppVersion_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppVersionStubVtbl =

+{

+    &IID_IAppVersion,

+    &IAppVersion_ServerInfo,

+    10,

+    &IAppVersion_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IPackage, ver. 0.0,

+   GUID={0xc853632e,0x36ca,0x4999,{0xb9,0x92,0xec,0x0d,0x40,0x8c,0xf5,0xab}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IPackage_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    3226,

+    3268,

+    216

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IPackage_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IPackage_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IPackage_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IPackage_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(10) _IPackageProxyVtbl = 

+{

+    &IPackage_ProxyInfo,

+    &IID_IPackage,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IPackage::get */ ,

+    (void *) (INT_PTR) -1 /* IPackage::get_isAvailable */ ,

+    (void *) (INT_PTR) -1 /* IPackage::get_filename */

+};

+

+

+static const PRPC_STUB_FUNCTION IPackage_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IPackageStubVtbl =

+{

+    &IID_IPackage,

+    &IPackage_ServerInfo,

+    10,

+    &IPackage_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: ICurrentState, ver. 0.0,

+   GUID={0x177cae89,0x4ad6,0x42f4,{0xa4,0x58,0x00,0xec,0x33,0x89,0xe3,0xfe}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short ICurrentState_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    0,

+    3310,

+    3038,

+    3352,

+    3394,

+    3436,

+    3478,

+    3520,

+    3562,

+    3604,

+    3646,

+    1946,

+    3688,

+    3730,

+    3772,

+    2114,

+    804

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO ICurrentState_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICurrentState_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO ICurrentState_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICurrentState_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(24) _ICurrentStateProxyVtbl = 

+{

+    &ICurrentState_ProxyInfo,

+    &IID_ICurrentState,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_stateValue */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_availableVersion */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_bytesDownloaded */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_totalBytesToDownload */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_downloadTimeRemainingMs */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_nextRetryTime */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_installProgress */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_installTimeRemainingMs */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_isCanceled */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_errorCode */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_extraCode1 */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_completionMessage */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_installerResultCode */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_installerResultExtraCode1 */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_postInstallLaunchCommandLine */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_postInstallUrl */ ,

+    (void *) (INT_PTR) -1 /* ICurrentState::get_postInstallAction */

+};

+

+

+static const PRPC_STUB_FUNCTION ICurrentState_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _ICurrentStateStubVtbl =

+{

+    &IID_ICurrentState,

+    &ICurrentState_ServerInfo,

+    24,

+    &ICurrentState_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IRegistrationUpdateHook, ver. 0.0,

+   GUID={0x3e102dc6,0x1edb,0x46a1,{0x84,0x88,0x61,0xf7,0x1b,0x35,0xed,0x5f}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IRegistrationUpdateHook_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    3814

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IRegistrationUpdateHook_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IRegistrationUpdateHook_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IRegistrationUpdateHook_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IRegistrationUpdateHook_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(8) _IRegistrationUpdateHookProxyVtbl = 

+{

+    &IRegistrationUpdateHook_ProxyInfo,

+    &IID_IRegistrationUpdateHook,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IRegistrationUpdateHook::UpdateRegistry */

+};

+

+

+static const PRPC_STUB_FUNCTION IRegistrationUpdateHook_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IRegistrationUpdateHookStubVtbl =

+{

+    &IID_IRegistrationUpdateHook,

+    &IRegistrationUpdateHook_ServerInfo,

+    8,

+    &IRegistrationUpdateHook_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: ICredentialDialog, ver. 0.0,

+   GUID={0x2603c88b,0xf971,0x4167,{0x9d,0xe1,0x87,0x1e,0xe4,0xa3,0xdc,0x84}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short ICredentialDialog_FormatStringOffsetTable[] =

+    {

+    3862

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO ICredentialDialog_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICredentialDialog_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO ICredentialDialog_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICredentialDialog_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _ICredentialDialogProxyVtbl = 

+{

+    &ICredentialDialog_ProxyInfo,

+    &IID_ICredentialDialog,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* ICredentialDialog::QueryUserForCredentials */

+};

+

+const CInterfaceStubVtbl _ICredentialDialogStubVtbl =

+{

+    &IID_ICredentialDialog,

+    &ICredentialDialog_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IGoogleUpdate3Web, ver. 0.0,

+   GUID={0x6dffe7fe,0x3153,0x4af1,{0x95,0xd8,0xf8,0xfc,0xca,0x97,0xe5,0x6b}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IGoogleUpdate3Web_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    1526

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3Web_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3Web_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IGoogleUpdate3Web_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3Web_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(8) _IGoogleUpdate3WebProxyVtbl = 

+{

+    &IGoogleUpdate3Web_ProxyInfo,

+    &IID_IGoogleUpdate3Web,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate3Web::createAppBundleWeb */

+};

+

+

+static const PRPC_STUB_FUNCTION IGoogleUpdate3Web_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IGoogleUpdate3WebStubVtbl =

+{

+    &IID_IGoogleUpdate3Web,

+    &IGoogleUpdate3Web_ServerInfo,

+    8,

+    &IGoogleUpdate3Web_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IGoogleUpdate3WebSecurity, ver. 0.0,

+   GUID={0x1b9063e4,0x3882,0x485e,{0x87,0x97,0xf2,0x8a,0x02,0x40,0x78,0x2f}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IGoogleUpdate3WebSecurity_FormatStringOffsetTable[] =

+    {

+    3932

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate3WebSecurity_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3WebSecurity_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IGoogleUpdate3WebSecurity_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate3WebSecurity_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _IGoogleUpdate3WebSecurityProxyVtbl = 

+{

+    &IGoogleUpdate3WebSecurity_ProxyInfo,

+    &IID_IGoogleUpdate3WebSecurity,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate3WebSecurity::setOriginURL */

+};

+

+const CInterfaceStubVtbl _IGoogleUpdate3WebSecurityStubVtbl =

+{

+    &IID_IGoogleUpdate3WebSecurity,

+    &IGoogleUpdate3WebSecurity_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IAppBundleWeb, ver. 0.0,

+   GUID={0x837e40da,0xeb1b,0x440c,{0x86,0x23,0x0f,0x14,0xdf,0x15,0x8d,0xc0}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppBundleWeb_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    3974,

+    174,

+    4036,

+    1610,

+    1652,

+    4070,

+    3478,

+    4112,

+    4160,

+    4194,

+    4228,

+    4262,

+    4296,

+    4330,

+    4364,

+    4398,

+    4446

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppBundleWeb_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppBundleWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppBundleWeb_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppBundleWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(24) _IAppBundleWebProxyVtbl = 

+{

+    &IAppBundleWeb_ProxyInfo,

+    &IID_IAppBundleWeb,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::createApp */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::createInstalledApp */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::createAllInstalledApps */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::get_displayLanguage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::put_displayLanguage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::put_parentHWND */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::get_length */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::get_appWeb */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::initialize */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::checkForUpdate */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::download */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::install */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::pause */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::resume */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::cancel */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::downloadPackage */ ,

+    (void *) (INT_PTR) -1 /* IAppBundleWeb::get_currentState */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppBundleWeb_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppBundleWebStubVtbl =

+{

+    &IID_IAppBundleWeb,

+    &IAppBundleWeb_ServerInfo,

+    24,

+    &IAppBundleWeb_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppWeb, ver. 0.0,

+   GUID={0x3a49f783,0x1c7d,0x4d35,{0x8f,0x63,0x5c,0x1c,0x20,0x6b,0x9b,0x6e}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppWeb_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    132,

+    1568,

+    90,

+    4488,

+    4536,

+    4570,

+    4612,

+    4646,

+    468,

+    510

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppWeb_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppWeb_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(17) _IAppWebProxyVtbl = 

+{

+    &IAppWeb_ProxyInfo,

+    &IID_IAppWeb,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_appId */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_currentVersionWeb */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_nextVersionWeb */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_command */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::cancel */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_currentState */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::launch */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::uninstall */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::get_serverInstallDataIndex */ ,

+    (void *) (INT_PTR) -1 /* IAppWeb::put_serverInstallDataIndex */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppWeb_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppWebStubVtbl =

+{

+    &IID_IAppWeb,

+    &IAppWeb_ServerInfo,

+    17,

+    &IAppWeb_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppCommandWeb, ver. 0.0,

+   GUID={0x2ec826cb,0x5478,0x4533,{0x90,0x15,0x75,0x80,0xb3,0xb5,0xe0,0x3a}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppCommandWeb_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    0,

+    2996,

+    216,

+    3080

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppCommandWeb_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommandWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppCommandWeb_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppCommandWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(11) _IAppCommandWebProxyVtbl = 

+{

+    &IAppCommandWeb_ProxyInfo,

+    &IID_IAppCommandWeb,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppCommandWeb::get_status */ ,

+    (void *) (INT_PTR) -1 /* IAppCommandWeb::get_exitCode */ ,

+    (void *) (INT_PTR) -1 /* IAppCommandWeb::get_output */ ,

+    (void *) (INT_PTR) -1 /* IAppCommandWeb::execute */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppCommandWeb_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppCommandWebStubVtbl =

+{

+    &IID_IAppCommandWeb,

+    &IAppCommandWeb_ServerInfo,

+    11,

+    &IAppCommandWeb_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: IAppVersionWeb, ver. 0.0,

+   GUID={0x450cf5ff,0x95c4,0x4679,{0xbe,0xca,0x22,0x68,0x03,0x89,0xec,0xb9}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IAppVersionWeb_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    132,

+    2996,

+    3178

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IAppVersionWeb_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppVersionWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IAppVersionWeb_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IAppVersionWeb_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(10) _IAppVersionWebProxyVtbl = 

+{

+    &IAppVersionWeb_ProxyInfo,

+    &IID_IAppVersionWeb,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* IAppVersionWeb::get_version */ ,

+    (void *) (INT_PTR) -1 /* IAppVersionWeb::get_packageCount */ ,

+    (void *) (INT_PTR) -1 /* IAppVersionWeb::get_packageWeb */

+};

+

+

+static const PRPC_STUB_FUNCTION IAppVersionWeb_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _IAppVersionWebStubVtbl =

+{

+    &IID_IAppVersionWeb,

+    &IAppVersionWeb_ServerInfo,

+    10,

+    &IAppVersionWeb_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: ICoCreateAsyncStatus, ver. 0.0,

+   GUID={0x9a6b447a,0x35e2,0x4f6b,{0xa8,0x7b,0x5d,0xee,0xbb,0xfd,0xad,0x17}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short ICoCreateAsyncStatus_FormatStringOffsetTable[] =

+    {

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    (unsigned short) -1,

+    2954,

+    2996,

+    90

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO ICoCreateAsyncStatus_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICoCreateAsyncStatus_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO ICoCreateAsyncStatus_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICoCreateAsyncStatus_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(10) _ICoCreateAsyncStatusProxyVtbl = 

+{

+    &ICoCreateAsyncStatus_ProxyInfo,

+    &IID_ICoCreateAsyncStatus,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    0 /* IDispatch::GetTypeInfoCount */ ,

+    0 /* IDispatch::GetTypeInfo */ ,

+    0 /* IDispatch::GetIDsOfNames */ ,

+    0 /* IDispatch_Invoke_Proxy */ ,

+    (void *) (INT_PTR) -1 /* ICoCreateAsyncStatus::get_isDone */ ,

+    (void *) (INT_PTR) -1 /* ICoCreateAsyncStatus::get_completionHResult */ ,

+    (void *) (INT_PTR) -1 /* ICoCreateAsyncStatus::get_createdInstance */

+};

+

+

+static const PRPC_STUB_FUNCTION ICoCreateAsyncStatus_table[] =

+{

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    STUB_FORWARDING_FUNCTION,

+    NdrStubCall2,

+    NdrStubCall2,

+    NdrStubCall2

+};

+

+CInterfaceStubVtbl _ICoCreateAsyncStatusStubVtbl =

+{

+    &IID_ICoCreateAsyncStatus,

+    &ICoCreateAsyncStatus_ServerInfo,

+    10,

+    &ICoCreateAsyncStatus_table[-3],

+    CStdStubBuffer_DELEGATING_METHODS

+};

+

+

+/* Object interface: ICoCreateAsync, ver. 0.0,

+   GUID={0xc20433b3,0x0d4b,0x49f6,{0x9b,0x6c,0x6e,0xe0,0xfa,0xe0,0x78,0x37}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short ICoCreateAsync_FormatStringOffsetTable[] =

+    {

+    4680

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO ICoCreateAsync_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICoCreateAsync_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO ICoCreateAsync_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &ICoCreateAsync_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _ICoCreateAsyncProxyVtbl = 

+{

+    &ICoCreateAsync_ProxyInfo,

+    &IID_ICoCreateAsync,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* ICoCreateAsync::createOmahaMachineServerAsync */

+};

+

+const CInterfaceStubVtbl _ICoCreateAsyncStubVtbl =

+{

+    &IID_ICoCreateAsync,

+    &ICoCreateAsync_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IBrowserHttpRequest2, ver. 0.0,

+   GUID={0xe4518371,0x7326,0x4865,{0x87,0xf8,0xd9,0xd3,0xf3,0xb2,0x87,0xa3}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IBrowserHttpRequest2_FormatStringOffsetTable[] =

+    {

+    4736

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IBrowserHttpRequest2_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IBrowserHttpRequest2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IBrowserHttpRequest2_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IBrowserHttpRequest2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _IBrowserHttpRequest2ProxyVtbl = 

+{

+    &IBrowserHttpRequest2_ProxyInfo,

+    &IID_IBrowserHttpRequest2,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IBrowserHttpRequest2::Send */

+};

+

+const CInterfaceStubVtbl _IBrowserHttpRequest2StubVtbl =

+{

+    &IID_IBrowserHttpRequest2,

+    &IBrowserHttpRequest2_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IProcessLauncher, ver. 0.0,

+   GUID={0xa5135e58,0x384f,0x4244,{0x9a,0x5f,0x30,0xfa,0x92,0x59,0x41,0x3c}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IProcessLauncher_FormatStringOffsetTable[] =

+    {

+    4820,

+    4862,

+    4910

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProcessLauncher_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IProcessLauncher_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProcessLauncher_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(6) _IProcessLauncherProxyVtbl = 

+{

+    &IProcessLauncher_ProxyInfo,

+    &IID_IProcessLauncher,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchCmdLine */ ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchBrowser */ ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchCmdElevated */

+};

+

+const CInterfaceStubVtbl _IProcessLauncherStubVtbl =

+{

+    &IID_IProcessLauncher,

+    &IProcessLauncher_ServerInfo,

+    6,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IProcessLauncher2, ver. 0.0,

+   GUID={0xa6556dff,0xab15,0x4dc3,{0xa8,0x90,0xab,0x54,0x12,0x0b,0xea,0xec}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] =

+    {

+    4820,

+    4862,

+    4910,

+    4972

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProcessLauncher2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IProcessLauncher2_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProcessLauncher2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(7) _IProcessLauncher2ProxyVtbl = 

+{

+    &IProcessLauncher2_ProxyInfo,

+    &IID_IProcessLauncher2,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchCmdLine */ ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchBrowser */ ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher::LaunchCmdElevated */ ,

+    (void *) (INT_PTR) -1 /* IProcessLauncher2::LaunchCmdLineEx */

+};

+

+const CInterfaceStubVtbl _IProcessLauncher2StubVtbl =

+{

+    &IID_IProcessLauncher2,

+    &IProcessLauncher2_ServerInfo,

+    7,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Standard interface: __MIDL_itf_google_update_idl_0000_0022, ver. 0.0,

+   GUID={0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} */

+

+

+/* Object interface: IProgressWndEvents, ver. 0.0,

+   GUID={0xe55b90f1,0xda33,0x400b,{0xb0,0x9e,0x3a,0xff,0x7d,0x46,0xbd,0x83}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IProgressWndEvents_FormatStringOffsetTable[] =

+    {

+    5034,

+    5068,

+    5102,

+    5136,

+    5170,

+    5204

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IProgressWndEvents_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProgressWndEvents_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IProgressWndEvents_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IProgressWndEvents_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(9) _IProgressWndEventsProxyVtbl = 

+{

+    &IProgressWndEvents_ProxyInfo,

+    &IID_IProgressWndEvents,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoClose */ ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoPause */ ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoResume */ ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoRestartBrowsers */ ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoReboot */ ,

+    (void *) (INT_PTR) -1 /* IProgressWndEvents::DoLaunchBrowser */

+};

+

+const CInterfaceStubVtbl _IProgressWndEventsStubVtbl =

+{

+    &IID_IProgressWndEvents,

+    &IProgressWndEvents_ServerInfo,

+    9,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IJobObserver, ver. 0.0,

+   GUID={0x99f8e195,0x1042,0x4f89,{0xa2,0x8c,0x89,0xcd,0xb7,0x4a,0x14,0xae}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IJobObserver_FormatStringOffsetTable[] =

+    {

+    5034,

+    5068,

+    5246,

+    5136,

+    5288,

+    5336,

+    4036,

+    5370,

+    5404,

+    5452

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IJobObserver_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IJobObserver_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IJobObserver_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IJobObserver_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(13) _IJobObserverProxyVtbl = 

+{

+    &IJobObserver_ProxyInfo,

+    &IID_IJobObserver,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnShow */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnCheckingForUpdate */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnUpdateAvailable */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnWaitingToDownload */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnDownloading */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnWaitingToInstall */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnInstalling */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnPause */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::OnComplete */ ,

+    (void *) (INT_PTR) -1 /* IJobObserver::SetEventSink */

+};

+

+const CInterfaceStubVtbl _IJobObserverStubVtbl =

+{

+    &IID_IJobObserver,

+    &IJobObserver_ServerInfo,

+    13,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IJobObserver2, ver. 0.0,

+   GUID={0xd9aa3288,0x4ea7,0x4e67,{0xae,0x60,0xd1,0x8e,0xad,0xcb,0x92,0x3d}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IJobObserver2_FormatStringOffsetTable[] =

+    {

+    5494

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IJobObserver2_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IJobObserver2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IJobObserver2_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IJobObserver2_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _IJobObserver2ProxyVtbl = 

+{

+    &IJobObserver2_ProxyInfo,

+    &IID_IJobObserver2,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IJobObserver2::OnInstalling2 */

+};

+

+const CInterfaceStubVtbl _IJobObserver2StubVtbl =

+{

+    &IID_IJobObserver2,

+    &IJobObserver2_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IGoogleUpdate, ver. 0.0,

+   GUID={0x79e0c401,0xb7bc,0x4de5,{0x81,0x04,0x71,0x35,0x0f,0x3a,0x9b,0x67}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IGoogleUpdate_FormatStringOffsetTable[] =

+    {

+    5542,

+    5590

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IGoogleUpdate_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IGoogleUpdate_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdate_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(5) _IGoogleUpdateProxyVtbl = 

+{

+    &IGoogleUpdate_ProxyInfo,

+    &IID_IGoogleUpdate,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate::CheckForUpdate */ ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdate::Update */

+};

+

+const CInterfaceStubVtbl _IGoogleUpdateStubVtbl =

+{

+    &IID_IGoogleUpdate,

+    &IGoogleUpdate_ServerInfo,

+    5,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+

+/* Object interface: IGoogleUpdateCore, ver. 0.0,

+   GUID={0xfce48f77,0xc677,0x4012,{0x8a,0x1a,0x54,0xd2,0xe2,0xbc,0x07,0xbd}} */

+

+#pragma code_seg(".orpc")

+static const unsigned short IGoogleUpdateCore_FormatStringOffsetTable[] =

+    {

+    5638

+    };

+

+static const MIDL_STUBLESS_PROXY_INFO IGoogleUpdateCore_ProxyInfo =

+    {

+    &Object_StubDesc,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdateCore_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0

+    };

+

+

+static const MIDL_SERVER_INFO IGoogleUpdateCore_ServerInfo = 

+    {

+    &Object_StubDesc,

+    0,

+    google_update_idl__MIDL_ProcFormatString.Format,

+    &IGoogleUpdateCore_FormatStringOffsetTable[-3],

+    0,

+    0,

+    0,

+    0};

+CINTERFACE_PROXY_VTABLE(4) _IGoogleUpdateCoreProxyVtbl = 

+{

+    &IGoogleUpdateCore_ProxyInfo,

+    &IID_IGoogleUpdateCore,

+    IUnknown_QueryInterface_Proxy,

+    IUnknown_AddRef_Proxy,

+    IUnknown_Release_Proxy ,

+    (void *) (INT_PTR) -1 /* IGoogleUpdateCore::LaunchCmdElevated */

+};

+

+const CInterfaceStubVtbl _IGoogleUpdateCoreStubVtbl =

+{

+    &IID_IGoogleUpdateCore,

+    &IGoogleUpdateCore_ServerInfo,

+    4,

+    0, /* pure interpreted */

+    CStdStubBuffer_METHODS

+};

+

+static const MIDL_STUB_DESC Object_StubDesc = 

+    {

+    0,

+    NdrOleAllocate,

+    NdrOleFree,

+    0,

+    0,

+    0,

+    0,

+    0,

+    google_update_idl__MIDL_TypeFormatString.Format,

+    1, /* -error bounds_check flag */

+    0x50002, /* Ndr library version */

+    0,

+    0x801026e, /* MIDL Version 8.1.622 */

+    0,

+    UserMarshalRoutines,

+    0,  /* notify & notify_flag routine table */

+    0x1, /* MIDL flag */

+    0, /* cs routines */

+    0,   /* proxy/server info */

+    0

+    };

+

+const CInterfaceProxyVtbl * const _google_update_idl_ProxyVtblList[] = 

+{

+    ( CInterfaceProxyVtbl *) &_IGoogleUpdateProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IPackageProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IApp2ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppCommand2ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppVersionProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IBrowserHttpRequest2ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IGoogleUpdateCoreProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_ICoCreateAsyncStatusProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppBundleProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IJobObserver2ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_ICurrentStateProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_ICredentialDialogProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IJobObserverProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_ICoCreateAsyncProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppCommandProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IRegistrationUpdateHookProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IGoogleUpdate3ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebSecurityProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IProgressWndEventsProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl,

+    ( CInterfaceProxyVtbl *) &_IAppVersionWebProxyVtbl,

+    0

+};

+

+const CInterfaceStubVtbl * const _google_update_idl_StubVtblList[] = 

+{

+    ( CInterfaceStubVtbl *) &_IGoogleUpdateStubVtbl,

+    ( CInterfaceStubVtbl *) &_IPackageStubVtbl,

+    ( CInterfaceStubVtbl *) &_IApp2StubVtbl,

+    ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppCommand2StubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppVersionStubVtbl,

+    ( CInterfaceStubVtbl *) &_IBrowserHttpRequest2StubVtbl,

+    ( CInterfaceStubVtbl *) &_IGoogleUpdateCoreStubVtbl,

+    ( CInterfaceStubVtbl *) &_ICoCreateAsyncStatusStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppBundleStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppWebStubVtbl,

+    ( CInterfaceStubVtbl *) &_IJobObserver2StubVtbl,

+    ( CInterfaceStubVtbl *) &_ICurrentStateStubVtbl,

+    ( CInterfaceStubVtbl *) &_ICredentialDialogStubVtbl,

+    ( CInterfaceStubVtbl *) &_IJobObserverStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppStubVtbl,

+    ( CInterfaceStubVtbl *) &_ICoCreateAsyncStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppCommandStubVtbl,

+    ( CInterfaceStubVtbl *) &_IRegistrationUpdateHookStubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl,

+    ( CInterfaceStubVtbl *) &_IGoogleUpdate3StubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl,

+    ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebSecurityStubVtbl,

+    ( CInterfaceStubVtbl *) &_IProgressWndEventsStubVtbl,

+    ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl,

+    ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl,

+    ( CInterfaceStubVtbl *) &_IAppVersionWebStubVtbl,

+    0

+};

+

+PCInterfaceName const _google_update_idl_InterfaceNamesList[] = 

+{

+    "IGoogleUpdate",

+    "IPackage",

+    "IApp2",

+    "IProcessLauncher",

+    "IAppCommand2",

+    "IAppVersion",

+    "IBrowserHttpRequest2",

+    "IGoogleUpdateCore",

+    "ICoCreateAsyncStatus",

+    "IAppBundle",

+    "IAppWeb",

+    "IJobObserver2",

+    "ICurrentState",

+    "ICredentialDialog",

+    "IJobObserver",

+    "IApp",

+    "ICoCreateAsync",

+    "IAppCommand",

+    "IRegistrationUpdateHook",

+    "IAppCommandWeb",

+    "IGoogleUpdate3",

+    "IAppBundleWeb",

+    "IGoogleUpdate3WebSecurity",

+    "IProgressWndEvents",

+    "IGoogleUpdate3Web",

+    "IProcessLauncher2",

+    "IAppVersionWeb",

+    0

+};

+

+const IID *  const _google_update_idl_BaseIIDList[] = 

+{

+    0,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    0,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    0,

+    0,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    0,

+    &IID_IDispatch,

+    0,

+    0,

+    &IID_IDispatch,

+    0,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    &IID_IDispatch,

+    0,

+    0,

+    &IID_IDispatch,

+    0,

+    &IID_IDispatch,

+    0

+};

+

+

+#define _google_update_idl_CHECK_IID(n)	IID_GENERIC_CHECK_IID( _google_update_idl, pIID, n)

+

+int __stdcall _google_update_idl_IID_Lookup( const IID * pIID, int * pIndex )

+{

+    IID_BS_LOOKUP_SETUP

+

+    IID_BS_LOOKUP_INITIAL_TEST( _google_update_idl, 27, 16 )

+    IID_BS_LOOKUP_NEXT_TEST( _google_update_idl, 8 )

+    IID_BS_LOOKUP_NEXT_TEST( _google_update_idl, 4 )

+    IID_BS_LOOKUP_NEXT_TEST( _google_update_idl, 2 )

+    IID_BS_LOOKUP_NEXT_TEST( _google_update_idl, 1 )

+    IID_BS_LOOKUP_RETURN_RESULT( _google_update_idl, 27, *pIndex )

+    

+}

+

+const ExtendedProxyFileInfo google_update_idl_ProxyFileInfo = 

+{

+    (PCInterfaceProxyVtblList *) & _google_update_idl_ProxyVtblList,

+    (PCInterfaceStubVtblList *) & _google_update_idl_StubVtblList,

+    (const PCInterfaceName * ) & _google_update_idl_InterfaceNamesList,

+    (const IID ** ) & _google_update_idl_BaseIIDList,

+    & _google_update_idl_IID_Lookup, 

+    27,

+    2,

+    0, /* table of [async_uuid] interfaces */

+    0, /* Filler1 */

+    0, /* Filler2 */

+    0  /* Filler3 */

+};

+#if _MSC_VER >= 1200

+#pragma warning(pop)

+#endif

+

+

+#endif /* defined(_M_ARM64)*/

+

diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 4847be1..fa6e69d 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -10967,7 +10967,7 @@
 
 <enum name="DemoModeResourcesRemovalResult">
   <int value="0" label="Successfully removed"/>
-  <int value="1" label="Not found on disk"/>
+  <int value="1" label="Not found on disk (deprecated)"/>
   <int value="2" label="Removal not allowed (should not be reported)"/>
   <int value="3" label="Resources already removed (should not be reported)"/>
   <int value="4" label="Removal failed"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 3f9e971..481725c0 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -35766,6 +35766,14 @@
   </summary>
 </histogram>
 
+<histogram name="FCMInvalidations.InitialTokenRetrievalStatus"
+    enum="InstanceIDResult" expires_after="M75">
+  <owner>melandory@chromium.org</owner>
+  <summary>
+    Status of the initial attempt to retrieve the instance id token.
+  </summary>
+</histogram>
+
 <histogram name="FCMInvalidations.SubscriptionRequestStatus"
     enum="FCMInvalidationSubscriptionStatus" expires_after="M75">
   <owner>melandory@chromium.org</owner>
@@ -77433,8 +77441,8 @@
 
 <histogram name="PageLoad.InteractiveTiming.FirstInputDelay" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.FirstInputDelay2, which correctly excludes some
+    Removed on January 2019 in favor of
+    PageLoad.InteractiveTiming.FirstInputDelay2 which correctly excludes some
     scrolling cases that were previously not excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
@@ -77457,8 +77465,8 @@
   <summary>
     Measures First Input Delay, the duration between the hardware timestamp and
     the start of event processing on the main thread for the first meaningful
-    input per navigation. See https://goo.gl/tr1oTZ for a detailed explanation.
-    Excludes scrolls. In ms.
+    input per navigation. Recorded on first page interaction. See
+    https://goo.gl/tr1oTZ for a detailed explanation. Excludes scrolls.
 
     Do not modify this metric in any way without contacting
     speed-metrics-dev@chromium.org.
@@ -77467,8 +77475,8 @@
 
 <histogram name="PageLoad.InteractiveTiming.FirstInputTimestamp" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.FirstInputTimestamp2, which correctly excludes
+    Removed on January 2019 in favor of
+    PageLoad.InteractiveTiming.FirstInputTimestamp2 which correctly excludes
     some scrolling cases that were previously not excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
@@ -77485,16 +77493,16 @@
   <owner>speed-metrics-dev@chromium.org</owner>
   <summary>
     The duration between navigation start and the hardware timestamp of the
-    first meaningful input per navigation. See https://goo.gl/tr1oTZ for a
-    detailed explanation. Excludes scrolls. In ms.
+    first meaningful input per navigation. Recorded on first page interaction.
+    See https://goo.gl/tr1oTZ for a detailed explanation. Excludes scrolls.
   </summary>
 </histogram>
 
 <histogram name="PageLoad.InteractiveTiming.InputDelay" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.InputDelay2, which correctly excludes some
-    scrolling cases that were previously not excluded from this metric.
+    Removed on January 2019 in favor of PageLoad.InteractiveTiming.InputDelay2
+    which correctly excludes some scrolling cases that were previously not
+    excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
   <owner>speed-metrics-dev@chromium.org</owner>
@@ -77513,8 +77521,7 @@
   <owner>speed-metrics-dev@chromium.org</owner>
   <summary>
     The duration between the hardware timestamp and the start of event
-    processing on the main thread for a meaningful input. Excludes scrolls. In
-    ms.
+    processing on the main thread for a meaningful input. Excludes scrolls.
 
     Do not modify this metric in any way without contacting
     speed-metrics-dev@chromium.org.
@@ -77523,8 +77530,8 @@
 
 <histogram name="PageLoad.InteractiveTiming.InputTimestamp" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.InputTimestamp2, which correctly excludes some
+    Removed on January 2019 in favor of
+    PageLoad.InteractiveTiming.InputTimestamp2 which correctly excludes some
     scrolling cases that were previously not excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
@@ -77540,14 +77547,14 @@
   <owner>speed-metrics-dev@chromium.org</owner>
   <summary>
     The duration between navigation start and the hardware timestamp of a
-    meaningful input. Excludes scrolls. In ms.
+    meaningful input. Excludes scrolls.
   </summary>
 </histogram>
 
 <histogram name="PageLoad.InteractiveTiming.LongestInputDelay" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.LongestInputDelay2, which correctly excludes some
+    Removed on January 2019 in favor of
+    PageLoad.InteractiveTiming.LongestInputDelay2 which correctly excludes some
     scrolling cases that were previously not excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
@@ -77565,14 +77572,14 @@
   <summary>
     Measures longest Input Delay, the longest duration between the hardware
     timestamp and the start of event processing on the main thread for the
-    meaningful input per navigation. Excludes scrolls. In ms.
+    meaningful input per navigation. Excludes scrolls.
   </summary>
 </histogram>
 
 <histogram name="PageLoad.InteractiveTiming.LongestInputTimestamp" units="ms">
   <obsolete>
-    Deprecated on January 2019 in favor of
-    PageLoad.InteractiveTiming.LongestInputTimestamp2, which correctly excludes
+    Removed on January 2019 in favor of
+    PageLoad.InteractiveTiming.LongestInputTimestamp2 which correctly excludes
     some scrolling cases that were previously not excluded from this metric.
   </obsolete>
   <owner>tdresser@chromium.org</owner>
@@ -77589,7 +77596,7 @@
   <summary>
     The duration between navigation start and the hardware timestamp of the
     meaningful input with longest queuing delay per navigation. Excludes
-    scrolls. In ms.
+    scrolls.
   </summary>
 </histogram>
 
@@ -106499,6 +106506,19 @@
   </summary>
 </histogram>
 
+<histogram base="true"
+    name="SimpleCache.ConsistencyResultAfterIndexFilesDeleted"
+    enum="SimpleCacheConsistencyResult">
+  <owner>wanderview@chromium.org</owner>
+  <summary>
+    Record the final consistency check value after index files have been deleted
+    from an empty simple DiskCache. This histogram will tell us how often the
+    index deletion code results in a functioning cache. It will also tell us
+    what kind of consistency failures cannot be recovered due to index file
+    deletion.
+  </summary>
+</histogram>
+
 <histogram base="true" name="SimpleCache.CreationToIndex" units="ms">
   <owner>morlovich@chromium.org</owner>
   <summary>
@@ -106515,6 +106535,17 @@
   </summary>
 </histogram>
 
+<histogram base="true"
+    name="SimpleCache.DidDeleteIndexFilesAfterFailedConsistency" enum="Boolean">
+  <owner>wanderview@chromium.org</owner>
+  <summary>
+    Record if any simple DiskCache index files were deleted from an otherwise
+    empty cache after the cache failed the initialization consistency check.
+    This histogram will tell us how often the deletion code is triggering and
+    modifying the disk.
+  </summary>
+</histogram>
+
 <histogram base="true" name="SimpleCache.DiskCloseLatency" units="ms">
   <owner>morlovich@chromium.org</owner>
   <summary>
@@ -107052,6 +107083,17 @@
   </summary>
 </histogram>
 
+<histogram base="true"
+    name="SimpleCache.OriginalConsistencyResultBeforeSuccessfulRetry"
+    enum="SimpleCacheConsistencyResult">
+  <owner>wanderview@chromium.org</owner>
+  <summary>
+    Record the original consistency error produced by a simple DiskCache before
+    a retry was attempted and succeeded. This histogram will tell us what kind
+    consistency errors can be recovered from in practice.
+  </summary>
+</histogram>
+
 <histogram base="true" name="SimpleCache.PercentFullOnInit" units="%">
   <owner>jkarlin@chromium.org</owner>
   <summary>
@@ -107123,6 +107165,19 @@
   </summary>
 </histogram>
 
+<histogram base="true" name="SimpleCache.RetryConsistencyResult"
+    enum="SimpleCacheConsistencyResult">
+  <owner>wanderview@chromium.org</owner>
+  <summary>
+    Record the outcome of the simple DiskCache consistency check after retrying
+    initialization on an empty cache directory. The retry may occur after
+    corrupt index files were deleted from an empty cache. The retry may also
+    occur if the original failed initialization left an empty directory without
+    any index files. This histogram will tell us how often the retry succeeds in
+    recovering caches and also which consistency checks cannot be recovered.
+  </summary>
+</histogram>
+
 <histogram base="true" name="SimpleCache.StaleIndexExtraEntryCount"
     units="entries">
   <owner>morlovich@chromium.org</owner>
@@ -117047,6 +117102,16 @@
   </summary>
 </histogram>
 
+<histogram base="true" name="TaskScheduler.NumActiveWorkers" units="workers">
+  <owner>etiennep@chromium.org</owner>
+  <owner>fdoray@chromium.org</owner>
+  <owner>gab@chromium.org</owner>
+  <summary>
+    Number of workers running a task in a given SchedulerWorkerPool. Recorded
+    every 59 minutes (sampling rate is not expected to affect the distribution).
+  </summary>
+</histogram>
+
 <histogram base="true" name="TaskScheduler.NumTasksBeforeDetach" units="tasks">
   <owner>fdoray@chromium.org</owner>
   <owner>gab@chromium.org</owner>
@@ -117085,8 +117150,8 @@
   <owner>fdoray@chromium.org</owner>
   <owner>gab@chromium.org</owner>
   <summary>
-    Number of workers that run in a given SchedulerWorkerPool. Recorded every 59
-    minutes (sampling rate is not expected to affect the distribution).
+    Number of workers that live in a given SchedulerWorkerPool. Recorded every
+    59 minutes (sampling rate is not expected to affect the distribution).
   </summary>
 </histogram>
 
@@ -123112,6 +123177,18 @@
   </summary>
 </histogram>
 
+<histogram name="VR.EnterVrBrowserWithoutFeatureModule" enum="BooleanSuccess"
+    expires_after="M74">
+  <owner>samdrazin@chromium.org</owner>
+  <owner>tiborg@chromium.org</owner>
+  <summary>
+    Recorded every time a user tries to enter the VR browser without the VR
+    feature module installed. Is success if the user could enter the VR browser
+    nonetheless. Is failure if entering the VR browser was blocked (on
+    smartphone VR) or started in 2D-in-VR mode (on standalones).
+  </summary>
+</histogram>
+
 <histogram base="true" name="VR.NetworkConnectionType.OnEnter"
     enum="NetworkConnectionType">
   <owner>tiborg@chromium.org</owner>
@@ -130820,6 +130897,7 @@
   <suffix name="GetInitializationDataTask"
       label="GetInitializationData DatabaseTask"/>
   <suffix name="GetRegistrationTask" label="GetRegistration DatabaseTask"/>
+  <suffix name="GetRequestBlobTask" label="GetRequestBlob DatabaseTask"/>
   <suffix name="GetSettledFetchesTask" label="GetSettledFetches DatabaseTask"/>
   <suffix name="MarkRegistrationForDeletionTask"
       label="MarkRegistrationForDeletion DatabaseTask"/>
@@ -131108,8 +131186,12 @@
   <affected-histogram name="SimpleCache.CacheSizeOnInit"/>
   <affected-histogram name="SimpleCache.CheckCRCResult"/>
   <affected-histogram name="SimpleCache.ConsistencyResult"/>
+  <affected-histogram
+      name="SimpleCache.ConsistencyResultAfterIndexFilesDeleted"/>
   <affected-histogram name="SimpleCache.CreationToIndex"/>
   <affected-histogram name="SimpleCache.CreationToIndexFail"/>
+  <affected-histogram
+      name="SimpleCache.DidDeleteIndexFilesAfterFailedConsistency"/>
   <affected-histogram name="SimpleCache.DiskCloseLatency"/>
   <affected-histogram name="SimpleCache.DiskCreateLatency"/>
   <affected-histogram name="SimpleCache.DiskDoomLatency"/>
@@ -131182,6 +131264,8 @@
   <affected-histogram name="SimpleCache.MaxCacheSizeOnInit"/>
   <affected-histogram name="SimpleCache.NumOpsBlockedByPendingDoom"/>
   <affected-histogram name="SimpleCache.OpenEntryIndexState"/>
+  <affected-histogram
+      name="SimpleCache.OriginalConsistencyResultBeforeSuccessfulRetry"/>
   <affected-histogram name="SimpleCache.PercentFullOnInit"/>
   <affected-histogram name="SimpleCache.QueueLatency.CreateEntry"/>
   <affected-histogram name="SimpleCache.QueueLatency.OpenEntry"/>
@@ -131190,6 +131274,7 @@
   <affected-histogram name="SimpleCache.ReadIsParallelizable"/>
   <affected-histogram name="SimpleCache.ReadResult"/>
   <affected-histogram name="SimpleCache.ReadStream1FromPrefetched"/>
+  <affected-histogram name="SimpleCache.RetryConsistencyResult"/>
   <affected-histogram name="SimpleCache.StaleIndexExtraEntryCount"/>
   <affected-histogram name="SimpleCache.StaleIndexMissedEntryCount"/>
   <affected-histogram name="SimpleCache.StaleIndexQuality"/>
@@ -142629,6 +142714,7 @@
       label="TaskSchedulers for renderer processes."/>
   <affected-histogram name="TaskScheduler.DetachDuration"/>
   <affected-histogram name="TaskScheduler.HeartbeatLatencyMicroseconds"/>
+  <affected-histogram name="TaskScheduler.NumActiveWorkers"/>
   <affected-histogram name="TaskScheduler.NumTasksBeforeDetach"/>
   <affected-histogram name="TaskScheduler.NumTasksBetweenWaits"/>
   <affected-histogram name="TaskScheduler.NumTasksRunWhileQueuing"/>
@@ -142761,6 +142847,9 @@
   <affected-histogram name="TaskScheduler.DetachDuration.Browser"/>
   <affected-histogram name="TaskScheduler.DetachDuration.ContentChild"/>
   <affected-histogram name="TaskScheduler.DetachDuration.Renderer"/>
+  <affected-histogram name="TaskScheduler.NumActiveWorkers.Browser"/>
+  <affected-histogram name="TaskScheduler.NumActiveWorkers.ContentChild"/>
+  <affected-histogram name="TaskScheduler.NumActiveWorkers.Renderer"/>
   <affected-histogram name="TaskScheduler.NumTasksBeforeDetach">
     <obsolete>
       Deprecated 01/2018. In favor of explicit .Browser suffix.
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml
index 79230c4c..99e79e0 100644
--- a/tools/metrics/ukm/ukm.xml
+++ b/tools/metrics/ukm/ukm.xml
@@ -1604,6 +1604,7 @@
     </summary>
     <aggregation>
       <history>
+        <index fields="profile.country"/>
         <statistics>
           <quantiles type="std-percentiles"/>
         </statistics>
@@ -1641,6 +1642,7 @@
     </summary>
     <aggregation>
       <history>
+        <index fields="profile.country"/>
         <statistics>
           <quantiles type="std-percentiles"/>
         </statistics>
@@ -3464,6 +3466,7 @@
     </summary>
     <aggregation>
       <history>
+        <index fields="profile.country"/>
         <statistics>
           <quantiles type="std-percentiles"/>
         </statistics>
@@ -3507,6 +3510,14 @@
       timestamp and the start of event processing on the main thread for the
       meaningful input per navigation. In ms.
     </summary>
+    <aggregation>
+      <history>
+        <index fields="profile.country"/>
+        <statistics>
+          <quantiles type="std-percentiles"/>
+        </statistics>
+      </history>
+    </aggregation>
   </metric>
   <metric name="InteractiveTiming.LongestInputTimestamp">
     <obsolete>
@@ -3682,6 +3693,7 @@
     </summary>
     <aggregation>
       <history>
+        <index fields="profile.country"/>
         <statistics>
           <quantiles type="std-percentiles"/>
         </statistics>
@@ -3695,6 +3707,7 @@
     </summary>
     <aggregation>
       <history>
+        <index fields="profile.country"/>
         <statistics>
           <quantiles type="std-percentiles"/>
         </statistics>
@@ -6138,4 +6151,13 @@
   </metric>
 </event>
 
+<event name="HistoryManipulationIntervention">
+  <owner>shivanisha@chromium.org</owner>
+  <summary>
+    Logged when an entry in the back-forward list is marked to be skipped on
+    subsequent back/forward button clicks as part of the history manipulation
+    intervention. This is logged when the entry is navigated away from.
+  </summary>
+</event>
+
 </ukm-configuration>
diff --git a/ui/accessibility/ax_event_generator.cc b/ui/accessibility/ax_event_generator.cc
index f887b02..ffc70534 100644
--- a/ui/accessibility/ax_event_generator.cc
+++ b/ui/accessibility/ax_event_generator.cc
@@ -437,8 +437,16 @@
 
   std::for_each(tree->int_reverse_relations().begin(),
                 tree->int_reverse_relations().end(), callback);
-  std::for_each(tree->intlist_reverse_relations().begin(),
-                tree->intlist_reverse_relations().end(), callback);
+  std::for_each(
+      tree->intlist_reverse_relations().begin(),
+      tree->intlist_reverse_relations().end(), [&](auto& entry) {
+        // Explicitly exclude relationships for which an additional event on the
+        // source node would cause extra noise. For example, kRadioGroupIds
+        // forms relations among all radio buttons and serves little value for
+        // AT to get events on the previous radio button in the group.
+        if (entry.first != ax::mojom::IntListAttribute::kRadioGroupIds)
+          callback(entry);
+      });
 }
 
 // Attempts to suppress load-related events that we presume no AT will be
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index c7ff98a..5250b58 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -191,6 +191,7 @@
     "//services/ws/public/mojom",
     "//skia",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/display",
     "//ui/events",
@@ -426,6 +427,7 @@
     "//ui/aura_extra",
     "//ui/aura_extra:tests",
     "//ui/base:test_support",
+    "//ui/base/clipboard:clipboard_types",
     "//ui/compositor:test_support",
     "//ui/compositor_extra",
     "//ui/display:test_support",
diff --git a/ui/aura/mus/os_exchange_data_provider_mus.cc b/ui/aura/mus/os_exchange_data_provider_mus.cc
index f8e327c..587516a 100644
--- a/ui/aura/mus/os_exchange_data_provider_mus.cc
+++ b/ui/aura/mus/os_exchange_data_provider_mus.cc
@@ -15,6 +15,8 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "net/base/filename_util.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/mojo/clipboard.mojom.h"
 #include "url/gurl.h"
@@ -87,8 +89,7 @@
   if (HasString())
     return;
 
-  mime_data_[ui::Clipboard::kMimeTypeText] =
-      FromString(base::UTF16ToUTF8(data));
+  mime_data_[ui::kMimeTypeText] = FromString(base::UTF16ToUTF8(data));
 }
 
 void OSExchangeDataProviderMus::SetURL(const GURL& url,
@@ -98,10 +99,10 @@
   AddString16ToVector(spec, &data);
   AddString16ToVector(base::ASCIIToUTF16("\n"), &data);
   AddString16ToVector(title, &data);
-  mime_data_[ui::Clipboard::kMimeTypeMozillaURL] = std::move(data);
+  mime_data_[ui::kMimeTypeMozillaURL] = std::move(data);
 
-  if (!base::ContainsKey(mime_data_, ui::Clipboard::kMimeTypeText))
-    mime_data_[ui::Clipboard::kMimeTypeText] = FromString(url.spec());
+  if (!base::ContainsKey(mime_data_, ui::kMimeTypeText))
+    mime_data_[ui::kMimeTypeText] = FromString(url.spec());
 }
 
 void OSExchangeDataProviderMus::SetFilename(const base::FilePath& path) {
@@ -120,11 +121,11 @@
   }
 
   std::string joined_data = base::JoinString(paths, "\n");
-  mime_data_[ui::Clipboard::kMimeTypeURIList] = FromString(joined_data);
+  mime_data_[ui::kMimeTypeURIList] = FromString(joined_data);
 }
 
 void OSExchangeDataProviderMus::SetPickledData(
-    const ui::Clipboard::FormatType& format,
+    const ui::ClipboardFormatType& format,
     const base::Pickle& pickle) {
   const unsigned char* bytes =
       reinterpret_cast<const unsigned char*>(pickle.data());
@@ -134,7 +135,7 @@
 }
 
 bool OSExchangeDataProviderMus::GetString(base::string16* data) const {
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeText);
+  auto it = mime_data_.find(ui::kMimeTypeText);
   if (it != mime_data_.end())
     *data = base::UTF8ToUTF16(ToString(it->second));
   return it != mime_data_.end();
@@ -144,7 +145,7 @@
     ui::OSExchangeData::FilenameToURLPolicy policy,
     GURL* url,
     base::string16* title) const {
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeMozillaURL);
+  auto it = mime_data_.find(ui::kMimeTypeMozillaURL);
   if (it == mime_data_.end()) {
     title->clear();
     return GetPlainTextURL(url) ||
@@ -177,7 +178,7 @@
 
 bool OSExchangeDataProviderMus::GetFilenames(
     std::vector<ui::FileInfo>* file_names) const {
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeURIList);
+  auto it = mime_data_.find(ui::kMimeTypeURIList);
   if (it == mime_data_.end())
     return false;
 
@@ -193,7 +194,7 @@
 }
 
 bool OSExchangeDataProviderMus::GetPickledData(
-    const ui::Clipboard::FormatType& format,
+    const ui::ClipboardFormatType& format,
     base::Pickle* data) const {
   auto it = mime_data_.find(format.Serialize());
   if (it == mime_data_.end())
@@ -207,15 +208,15 @@
 }
 
 bool OSExchangeDataProviderMus::HasString() const {
-  return base::ContainsKey(mime_data_, ui::Clipboard::kMimeTypeText);
+  return base::ContainsKey(mime_data_, ui::kMimeTypeText);
 }
 
 bool OSExchangeDataProviderMus::HasURL(
     ui::OSExchangeData::FilenameToURLPolicy policy) const {
-  if (base::ContainsKey(mime_data_, ui::Clipboard::kMimeTypeMozillaURL))
+  if (base::ContainsKey(mime_data_, ui::kMimeTypeMozillaURL))
     return true;
 
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeURIList);
+  auto it = mime_data_.find(ui::kMimeTypeURIList);
   if (it == mime_data_.end())
     return false;
 
@@ -230,7 +231,7 @@
 }
 
 bool OSExchangeDataProviderMus::HasFile() const {
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeURIList);
+  auto it = mime_data_.find(ui::kMimeTypeURIList);
   if (it == mime_data_.end())
     return false;
 
@@ -245,7 +246,7 @@
 }
 
 bool OSExchangeDataProviderMus::HasCustomFormat(
-    const ui::Clipboard::FormatType& format) const {
+    const ui::ClipboardFormatType& format) const {
   return base::ContainsKey(mime_data_, format.Serialize());
 }
 
@@ -281,12 +282,12 @@
   bytes.push_back(0xFF);
   bytes.push_back(0xFE);
   AddString16ToVector(html, &bytes);
-  mime_data_[ui::Clipboard::kMimeTypeHTML] = bytes;
+  mime_data_[ui::kMimeTypeHTML] = bytes;
 }
 
 bool OSExchangeDataProviderMus::GetHtml(base::string16* html,
                                         GURL* base_url) const {
-  auto it = mime_data_.find(ui::Clipboard::kMimeTypeHTML);
+  auto it = mime_data_.find(ui::kMimeTypeHTML);
   if (it == mime_data_.end())
     return false;
 
@@ -313,7 +314,7 @@
 }
 
 bool OSExchangeDataProviderMus::HasHtml() const {
-  return base::ContainsKey(mime_data_, ui::Clipboard::kMimeTypeHTML);
+  return base::ContainsKey(mime_data_, ui::kMimeTypeHTML);
 }
 #endif
 
diff --git a/ui/aura/mus/os_exchange_data_provider_mus.h b/ui/aura/mus/os_exchange_data_provider_mus.h
index 27a541950..ce1b44a0 100644
--- a/ui/aura/mus/os_exchange_data_provider_mus.h
+++ b/ui/aura/mus/os_exchange_data_provider_mus.h
@@ -46,7 +46,7 @@
   void SetURL(const GURL& url, const base::string16& title) override;
   void SetFilename(const base::FilePath& path) override;
   void SetFilenames(const std::vector<ui::FileInfo>& file_names) override;
-  void SetPickledData(const ui::Clipboard::FormatType& format,
+  void SetPickledData(const ui::ClipboardFormatType& format,
                       const base::Pickle& data) override;
 
   bool GetString(base::string16* data) const override;
@@ -55,13 +55,13 @@
                       base::string16* title) const override;
   bool GetFilename(base::FilePath* path) const override;
   bool GetFilenames(std::vector<ui::FileInfo>* file_names) const override;
-  bool GetPickledData(const ui::Clipboard::FormatType& format,
+  bool GetPickledData(const ui::ClipboardFormatType& format,
                       base::Pickle* data) const override;
 
   bool HasString() const override;
   bool HasURL(ui::OSExchangeData::FilenameToURLPolicy policy) const override;
   bool HasFile() const override;
-  bool HasCustomFormat(const ui::Clipboard::FormatType& format) const override;
+  bool HasCustomFormat(const ui::ClipboardFormatType& format) const override;
 
 // Provider doesn't have a consistent interface between operating systems;
 // this wasn't seen as a problem when there was a single Provider subclass
diff --git a/ui/aura/mus/os_exchange_data_provider_mus_unittest.cc b/ui/aura/mus/os_exchange_data_provider_mus_unittest.cc
index 225a515..4eea746 100644
--- a/ui/aura/mus/os_exchange_data_provider_mus_unittest.cc
+++ b/ui/aura/mus/os_exchange_data_provider_mus_unittest.cc
@@ -14,12 +14,12 @@
 #include "net/base/filename_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/platform_test.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
 #include "ui/events/platform/platform_event_source.h"
 #include "url/gurl.h"
 
-using ui::Clipboard;
 using ui::OSExchangeData;
 
 namespace aura {
@@ -171,8 +171,8 @@
 }
 
 TEST_F(OSExchangeDataProviderMusTest, TestPickledData) {
-  const Clipboard::FormatType kTestFormat =
-      Clipboard::GetFormatType("application/vnd.chromium.test");
+  const ui::ClipboardFormatType kTestFormat =
+      ui::ClipboardFormatType::GetType("application/vnd.chromium.test");
 
   base::Pickle saved_pickle;
   saved_pickle.WriteInt(1);
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 812fa96..195435b5 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -76,18 +76,6 @@
     "accelerators/platform_accelerator_cocoa.mm",
     "class_property.cc",
     "class_property.h",
-    "clipboard/clipboard_android.cc",
-    "clipboard/clipboard_android.h",
-    "clipboard/clipboard_mac.h",
-    "clipboard/clipboard_mac.mm",
-    "clipboard/clipboard_types.h",
-    "clipboard/clipboard_util_mac.h",
-    "clipboard/clipboard_util_mac.mm",
-    "clipboard/clipboard_util_win.cc",
-    "clipboard/clipboard_util_win.h",
-    "clipboard/clipboard_win.cc",
-    "clipboard/clipboard_win.h",
-    "clipboard/custom_data_helper_mac.mm",
     "cocoa/accessibility_focus_overrider.h",
     "cocoa/accessibility_focus_overrider.mm",
     "cocoa/animation_utils.h",
@@ -319,16 +307,6 @@
       "accelerators/accelerator_manager.h",
       "base_window.cc",
       "base_window.h",
-      "clipboard/clipboard.cc",
-      "clipboard/clipboard.h",
-      "clipboard/clipboard_constants.cc",
-      "clipboard/clipboard_monitor.cc",
-      "clipboard/clipboard_monitor.h",
-      "clipboard/clipboard_observer.h",
-      "clipboard/custom_data_helper.cc",
-      "clipboard/custom_data_helper.h",
-      "clipboard/scoped_clipboard_writer.cc",
-      "clipboard/scoped_clipboard_writer.h",
       "cocoa/bubble_closer.h",
       "cocoa/bubble_closer.mm",
       "cursor/cursor_util.cc",
@@ -420,6 +398,7 @@
     "//net",
     "//third_party/icu",
     "//third_party/zlib:zlib",
+    "//ui/base/clipboard:clipboard_types",
     "//ui/display",
     "//ui/events",
     "//ui/events/devices",
@@ -530,6 +509,10 @@
     ]
   }
 
+  if (is_mac || is_win) {
+    deps += [ "//ui/base/clipboard" ]
+  }
+
   libs = []
   if (is_win) {
     sources += [
@@ -627,20 +610,6 @@
   }
 
   if (use_aura) {
-    # Aura clipboard.
-    if (use_x11 && is_desktop_linux) {
-      sources += [
-        "clipboard/clipboard_aurax11.cc",
-        "clipboard/clipboard_aurax11.h",
-      ]
-    } else if (!is_win) {
-      # This file is used for all non-X11, non-Windows aura Builds.
-      sources += [
-        "clipboard/clipboard_aura.cc",
-        "clipboard/clipboard_aura.h",
-      ]
-    }
-
     # Cursor
     sources += [
       "cursor/cursors_aura.cc",
@@ -687,8 +656,6 @@
       "test/scoped_fake_nswindow_fullscreen.mm",
       "test/scoped_preferred_scroller_style_mac.h",
       "test/scoped_preferred_scroller_style_mac.mm",
-      "test/test_clipboard.cc",
-      "test/test_clipboard.h",
       "test/view_tree_validator.h",
       "test/view_tree_validator.mm",
       "test/windowed_nsnotification_observer.h",
@@ -840,8 +807,6 @@
 test("ui_base_unittests") {
   sources = [
     "class_property_unittest.cc",
-    "clipboard/clipboard_mac_unittest.mm",
-    "clipboard/clipboard_util_mac_unittest.mm",
     "l10n/l10n_util_mac_unittest.mm",
     "l10n/l10n_util_unittest.cc",
     "l10n/time_format_unittest.cc",
@@ -863,7 +828,6 @@
   if (!is_ios) {
     sources += [
       "test/scoped_fake_nswindow_fullscreen_unittest.mm",
-      "test/test_clipboard_unittest.cc",
       "test/view_tree_validator_unittest.mm",
     ]
   }
@@ -891,7 +855,6 @@
       "accelerators/menu_label_accelerator_util_linux_unittest.cc",
       "accelerators/menu_label_accelerator_util_unittest.cc",
       "accelerators/platform_accelerator_cocoa_unittest.mm",
-      "clipboard/custom_data_helper_unittest.cc",
       "cocoa/base_view_unittest.mm",
       "cocoa/bubble_closer_unittest.mm",
       "cocoa/cocoa_base_utils_unittest.mm",
@@ -952,6 +915,8 @@
     "//ui/base",
     "//ui/base:test_support",
     "//ui/base:ui_data_pack",
+    "//ui/base/clipboard:clipboard_test",
+    "//ui/base/clipboard:clipboard_types",
     "//ui/display",
     "//ui/events:events_base",
     "//ui/events:test_support",
diff --git a/ui/base/clipboard/BUILD.gn b/ui/base/clipboard/BUILD.gn
new file mode 100644
index 0000000..e18f111
--- /dev/null
+++ b/ui/base/clipboard/BUILD.gn
@@ -0,0 +1,165 @@
+# Copyright 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/jumbo.gni")
+import("//build/config/ui.gni")
+
+jumbo_component("clipboard_types") {
+  output_name = "ui_base_clipboard_types"
+  sources = [
+    "clipboard_constants.cc",
+    "clipboard_constants.h",
+    "clipboard_constants_mac.mm",
+    "clipboard_format_type_android.cc",
+    "clipboard_format_type_mac.mm",
+    "clipboard_format_type_win.cc",
+    "clipboard_types.h",
+  ]
+
+  if (!is_ios) {
+    if (use_aura) {
+      if ((use_x11 && is_desktop_linux) || !is_win) {
+        sources += [ "clipboard_format_type_aura.cc" ]
+      }
+    }
+
+    sources += [ "clipboard_format_type.h" ]
+  }
+
+  defines = [ "IS_BASE_CLIPBOARD_TYPES_IMPL" ]
+
+  deps = [
+    "//base",
+  ]
+
+  libs = []
+  if (is_mac) {
+    libs += [
+      "AppKit.framework",
+      "CoreFoundation.framework",
+    ]
+  }
+}
+
+jumbo_component("clipboard") {
+  output_name = "ui_base_clipboard"
+
+  sources = [
+    "clipboard.cc",
+    "clipboard.h",
+    "clipboard_android.cc",
+    "clipboard_android.h",
+    "clipboard_mac.h",
+    "clipboard_mac.mm",
+    "clipboard_monitor.cc",
+    "clipboard_monitor.h",
+    "clipboard_observer.h",
+    "clipboard_util_mac.h",
+    "clipboard_util_mac.mm",
+    "clipboard_util_win.cc",
+    "clipboard_util_win.h",
+    "clipboard_win.cc",
+    "clipboard_win.h",
+    "custom_data_helper.cc",
+    "custom_data_helper.h",
+    "scoped_clipboard_writer.cc",
+    "scoped_clipboard_writer.h",
+  ]
+
+  defines = [ "IS_BASE_CLIPBOARD_IMPL" ]
+
+  deps = [
+    "//base",
+    "//net",
+    "//skia",
+    "//ui/events/platform",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+  ]
+
+  public_deps = [
+    ":clipboard_types",
+  ]
+
+  if (use_aura) {
+    # Aura clipboard.
+    if (use_x11 && is_desktop_linux) {
+      sources += [
+        "clipboard_aurax11.cc",
+        "clipboard_aurax11.h",
+      ]
+      configs += [ "//build/config/linux:x11" ]
+      deps += [
+        "//ui/base",
+        "//ui/base/x",
+        "//ui/gfx/x",
+      ]
+    } else if (!is_win) {
+      # This file is used for all non-X11, non-Windows aura Builds.
+      sources += [
+        "clipboard_aura.cc",
+        "clipboard_aura.h",
+      ]
+    }
+  }
+
+  if (is_android) {
+    deps += [ "//ui/base:ui_base_jni_headers" ]
+  }
+
+  if (is_mac) {
+    deps += [ "//third_party/mozilla" ]
+    libs = [
+      "AppKit.framework",
+      "CoreFoundation.framework",
+    ]
+  }
+}
+
+jumbo_source_set("clipboard_test_support") {
+  testonly = true
+
+  if (!is_ios) {
+    sources = [
+      "test/test_clipboard.cc",
+      "test/test_clipboard.h",
+    ]
+  }
+
+  public_deps = [
+    ":clipboard",
+    "//base",
+    "//skia",
+  ]
+}
+
+source_set("clipboard_test") {
+  testonly = true
+
+  output_name = "ui_base_clipboard_test"
+  sources = [
+    "clipboard_mac_unittest.mm",
+    "clipboard_util_mac_unittest.mm",
+  ]
+
+  if (!is_ios) {
+    sources += [
+      "custom_data_helper_unittest.cc",
+      "test/test_clipboard_unittest.cc",
+    ]
+  }
+
+  deps = [
+    ":clipboard_test_support",
+    "//base/test:test_support",
+    "//testing/gmock",
+    "//testing/gtest",
+    "//ui/events/platform",
+    "//ui/gfx:test_support",
+  ]
+
+  if (is_mac) {
+    deps += [ "//third_party/mozilla" ]
+  }
+}
diff --git a/ui/base/clipboard/clipboard.cc b/ui/base/clipboard/clipboard.cc
index a621d64..2634410 100644
--- a/ui/base/clipboard/clipboard.cc
+++ b/ui/base/clipboard/clipboard.cc
@@ -156,11 +156,9 @@
     }
 
     case CBF_DATA:
-      WriteData(
-          FormatType::Deserialize(
-              std::string(&(params[0].front()), params[0].size())),
-          &(params[1].front()),
-          params[1].size());
+      WriteData(ClipboardFormatType::Deserialize(
+                    std::string(&(params[0].front()), params[0].size())),
+                &(params[1].front()), params[1].size());
       break;
 
     default:
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
index 60410973..913149d 100644
--- a/ui/base/clipboard/clipboard.h
+++ b/ui/base/clipboard/clipboard.h
@@ -13,6 +13,7 @@
 #include <vector>
 
 #include "base/compiler_specific.h"
+#include "base/component_export.h"
 #include "base/containers/flat_map.h"
 #include "base/lazy_instance.h"
 #include "base/macros.h"
@@ -24,93 +25,17 @@
 #include "base/threading/thread_checker.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/clipboard/clipboard_types.h"
-#include "ui/base/ui_base_export.h"
-
-#if defined(OS_WIN)
-#include <objidl.h>
-#endif
 
 class SkBitmap;
 
-#ifdef __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
-
 namespace ui {
 class TestClipboard;
 class ScopedClipboardWriter;
 
-class UI_BASE_EXPORT Clipboard : public base::ThreadChecker {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) Clipboard : public base::ThreadChecker {
  public:
-  // MIME type constants.
-  static const char kMimeTypeText[];
-  static const char kMimeTypeURIList[];
-  static const char kMimeTypeDownloadURL[];
-  static const char kMimeTypeMozillaURL[];
-  static const char kMimeTypeHTML[];
-  static const char kMimeTypeRTF[];
-  static const char kMimeTypePNG[];
-  static const char kMimeTypeWebCustomData[];
-  static const char kMimeTypeWebkitSmartPaste[];
-  static const char kMimeTypePepperCustomData[];
-
-  // Platform neutral holder for native data representation of a clipboard type.
-  struct UI_BASE_EXPORT FormatType {
-    FormatType();
-    ~FormatType();
-
-    // Serializes and deserializes a FormatType for use in IPC messages.
-    std::string Serialize() const;
-    static FormatType Deserialize(const std::string& serialization);
-
-    // FormatType can be used in a set on some platforms.
-    bool operator<(const FormatType& other) const;
-
-#if defined(OS_WIN)
-    const FORMATETC& ToFormatEtc() const { return data_; }
-#elif defined(USE_AURA) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
-    const std::string& ToString() const { return data_; }
-#elif defined(OS_MACOSX)
-    NSString* ToNSString() const { return data_; }
-    // Custom copy and assignment constructor to handle NSString.
-    FormatType(const FormatType& other);
-    FormatType& operator=(const FormatType& other);
-#endif
-
-    bool Equals(const FormatType& other) const;
-
-   private:
-    friend class base::NoDestructor<FormatType>;
-    friend class Clipboard;
-
-    // Platform-specific glue used internally by the Clipboard class. Each
-    // plaform should define,at least one of each of the following:
-    // 1. A constructor that wraps that native clipboard format descriptor.
-    // 2. An accessor to retrieve the wrapped descriptor.
-    // 3. A data member to hold the wrapped descriptor.
-    //
-    // Note that in some cases, the accessor for the wrapped descriptor may be
-    // public, as these format types can be used by drag and drop code as well.
-#if defined(OS_WIN)
-    explicit FormatType(UINT native_format);
-    FormatType(UINT native_format, LONG index);
-    FORMATETC data_;
-#elif defined(USE_AURA) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
-    explicit FormatType(const std::string& native_format);
-    std::string data_;
-#elif defined(OS_MACOSX)
-    explicit FormatType(NSString* native_format);
-    NSString* data_;
-#else
-#error No FormatType definition.
-#endif
-
-    // Copyable and assignable, since this is essentially an opaque value type.
-  };
-
   static bool IsSupportedClipboardType(int32_t type) {
     switch (type) {
       case CLIPBOARD_TYPE_COPY_PASTE:
@@ -166,7 +91,7 @@
   virtual uint64_t GetSequenceNumber(ClipboardType type) const = 0;
 
   // Tests whether the clipboard contains a certain format
-  virtual bool IsFormatAvailable(const FormatType& format,
+  virtual bool IsFormatAvailable(const ClipboardFormatType& format,
                                  ClipboardType type) const = 0;
 
   // Clear the clipboard data.
@@ -208,7 +133,7 @@
 
   // Reads raw data from the clipboard with the given format type. Stores result
   // as a byte vector.
-  virtual void ReadData(const FormatType& format,
+  virtual void ReadData(const ClipboardFormatType& format,
                         std::string* result) const = 0;
 
   // Returns an estimate of the time the clipboard was last updated.  If the
@@ -218,38 +143,6 @@
   // Resets the clipboard last modified time to Time::Time().
   virtual void ClearLastModifiedTime();
 
-  // Gets the FormatType corresponding to an arbitrary format string,
-  // registering it with the system if needed. Due to Windows/Linux
-  // limitiations, |format_string| must never be controlled by the user.
-  static FormatType GetFormatType(const std::string& format_string);
-
-  // Get format identifiers for various types.
-  static const FormatType& GetUrlFormatType();
-  static const FormatType& GetUrlWFormatType();
-  static const FormatType& GetMozUrlFormatType();
-  static const FormatType& GetPlainTextFormatType();
-  static const FormatType& GetPlainTextWFormatType();
-  static const FormatType& GetFilenameFormatType();
-  static const FormatType& GetFilenameWFormatType();
-  static const FormatType& GetWebKitSmartPasteFormatType();
-  // Win: MS HTML Format, Other: Generic HTML format
-  static const FormatType& GetHtmlFormatType();
-  static const FormatType& GetRtfFormatType();
-  static const FormatType& GetBitmapFormatType();
-  // TODO(raymes): Unify web custom data and pepper custom data:
-  // crbug.com/158399.
-  static const FormatType& GetWebCustomDataFormatType();
-  static const FormatType& GetPepperCustomDataFormatType();
-
-#if defined(OS_WIN)
-  // Firefox text/html
-  static const FormatType& GetTextHtmlFormatType();
-  static const FormatType& GetCFHDropFormatType();
-  static const FormatType& GetFileDescriptorFormatType();
-  static const FormatType& GetFileContentZeroFormatType();
-  static const FormatType& GetIDListFormatType();
-#endif
-
  protected:
   static Clipboard* Create();
 
@@ -258,10 +151,10 @@
 
   // ObjectType designates the type of data to be stored in the clipboard. This
   // designation is shared across all OSes. The system-specific designation
-  // is defined by FormatType. A single ObjectType might be represented by
-  // several system-specific FormatTypes. For example, on Linux the CBF_TEXT
-  // ObjectType maps to "text/plain", "STRING", and several other formats. On
-  // windows it maps to CF_UNICODETEXT.
+  // is defined by ClipboardFormatType. A single ObjectType might be represented
+  // by several system-specific ClipboardFormatTypes. For example, on Linux the
+  // CBF_TEXT ObjectType maps to "text/plain", "STRING", and several other
+  // formats. On windows it maps to CF_UNICODETEXT.
   //
   // The order below is the order in which data will be written to the
   // clipboard, so more specific types must be listed before less specific
@@ -326,7 +219,7 @@
 
   virtual void WriteBitmap(const SkBitmap& bitmap) = 0;
 
-  virtual void WriteData(const FormatType& format,
+  virtual void WriteData(const ClipboardFormatType& format,
                          const char* data_data,
                          size_t data_len) = 0;
 
diff --git a/ui/base/clipboard/clipboard_android.cc b/ui/base/clipboard/clipboard_android.cc
index 6fe49405..40730c1 100644
--- a/ui/base/clipboard/clipboard_android.cc
+++ b/ui/base/clipboard/clipboard_android.cc
@@ -18,6 +18,7 @@
 #include "base/time/time.h"
 #include "jni/Clipboard_jni.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/gfx/geometry/size.h"
 
 // TODO:(andrewhayden) Support additional formats in Android: Bitmap, URI, HTML,
@@ -42,15 +43,6 @@
 
 namespace {
 
-// Various formats we support.
-const char kURLFormat[] = "url";
-const char kPlainTextFormat[] = "text";
-const char kHTMLFormat[] = "html";
-const char kRTFFormat[] = "rtf";
-const char kBitmapFormat[] = "bitmap";
-const char kWebKitSmartPasteFormat[] = "webkit_smart";
-const char kBookmarkFormat[] = "bookmark";
-
 class ClipboardMap {
  public:
   ClipboardMap();
@@ -144,22 +136,24 @@
 void ClipboardMap::CommitToAndroidClipboard() {
   JNIEnv* env = AttachCurrentThread();
   base::AutoLock lock(lock_);
-  if (base::ContainsKey(map_, kHTMLFormat)) {
+  if (base::ContainsKey(map_, ClipboardFormatType::GetHtmlType().ToString())) {
     // Android's API for storing HTML content on the clipboard requires a plain-
     // text representation to be available as well.
-    if (!base::ContainsKey(map_, kPlainTextFormat))
+    if (!base::ContainsKey(map_,
+                           ClipboardFormatType::GetPlainTextType().ToString()))
       return;
 
-    ScopedJavaLocalRef<jstring> html =
-        ConvertUTF8ToJavaString(env, map_[kHTMLFormat]);
-    ScopedJavaLocalRef<jstring> text =
-        ConvertUTF8ToJavaString(env, map_[kPlainTextFormat]);
+    ScopedJavaLocalRef<jstring> html = ConvertUTF8ToJavaString(
+        env, map_[ClipboardFormatType::GetHtmlType().ToString()]);
+    ScopedJavaLocalRef<jstring> text = ConvertUTF8ToJavaString(
+        env, map_[ClipboardFormatType::GetPlainTextType().ToString()]);
 
     DCHECK(html.obj() && text.obj());
     Java_Clipboard_setHTMLText(env, clipboard_manager_, html, text);
-  } else if (base::ContainsKey(map_, kPlainTextFormat)) {
-    ScopedJavaLocalRef<jstring> str =
-        ConvertUTF8ToJavaString(env, map_[kPlainTextFormat]);
+  } else if (base::ContainsKey(
+                 map_, ClipboardFormatType::GetPlainTextType().ToString())) {
+    ScopedJavaLocalRef<jstring> str = ConvertUTF8ToJavaString(
+        env, map_[ClipboardFormatType::GetPlainTextType().ToString()]);
     DCHECK(str.obj());
     Java_Clipboard_setText(env, clipboard_manager_, str);
   } else {
@@ -224,104 +218,17 @@
   ScopedJavaLocalRef<jstring> jhtml =
       Java_Clipboard_getHTMLText(env, clipboard_manager_);
 
-  JNI_Clipboard_AddMapEntry(env, &map_, kPlainTextFormat, jtext);
-  JNI_Clipboard_AddMapEntry(env, &map_, kHTMLFormat, jhtml);
+  JNI_Clipboard_AddMapEntry(
+      env, &map_, ClipboardFormatType::GetPlainTextType().ToString().c_str(),
+      jtext);
+  JNI_Clipboard_AddMapEntry(
+      env, &map_, ClipboardFormatType::GetHtmlType().ToString().c_str(), jhtml);
 
   map_state_ = MapState::kUpToDate;
 }
 
 }  // namespace
 
-// Clipboard::FormatType implementation.
-Clipboard::FormatType::FormatType() {
-}
-
-Clipboard::FormatType::FormatType(const std::string& native_format)
-    : data_(native_format) {
-}
-
-Clipboard::FormatType::~FormatType() {
-}
-
-std::string Clipboard::FormatType::Serialize() const {
-  return data_;
-}
-
-// static
-Clipboard::FormatType Clipboard::FormatType::Deserialize(
-    const std::string& serialization) {
-  return FormatType(serialization);
-}
-
-bool Clipboard::FormatType::operator<(const FormatType& other) const {
-  return data_ < other.data_;
-}
-
-bool Clipboard::FormatType::Equals(const FormatType& other) const {
-  return data_ == other.data_;
-}
-
-// Various predefined FormatTypes.
-// static
-Clipboard::FormatType Clipboard::GetFormatType(
-    const std::string& format_string) {
-  return FormatType::Deserialize(format_string);
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
-  static base::NoDestructor<FormatType> type(kURLFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
-  static base::NoDestructor<FormatType> type(kPlainTextFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
-  static base::NoDestructor<FormatType> type(kPlainTextFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
-  static base::NoDestructor<FormatType> type(kWebKitSmartPasteFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetHtmlFormatType() {
-  static base::NoDestructor<FormatType> type(kHTMLFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetRtfFormatType() {
-  static base::NoDestructor<FormatType> type(kRTFFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetBitmapFormatType() {
-  static base::NoDestructor<FormatType> type(kBitmapFormat);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeWebCustomData);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypePepperCustomData);
-  return *type;
-}
-
 // Clipboard factory method.
 // static
 Clipboard* Clipboard::Create() {
@@ -360,7 +267,7 @@
   return g_map.Get().GetSequenceNumber();
 }
 
-bool ClipboardAndroid::IsFormatAvailable(const Clipboard::FormatType& format,
+bool ClipboardAndroid::IsFormatAvailable(const ClipboardFormatType& format,
                                          ClipboardType type) const {
   DCHECK(CalledOnValidThread());
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
@@ -388,16 +295,16 @@
 
   // would be nice to ask the ClipboardMap to enumerate the types it supports,
   // rather than hardcode the list here.
-  if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetPlainTextType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (IsFormatAvailable(Clipboard::GetHtmlFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetHtmlType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
 
   // these formats aren't supported by the ClipboardMap currently, but might
   // be one day?
-  if (IsFormatAvailable(Clipboard::GetRtfFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetRtfType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
-  if (IsFormatAvailable(Clipboard::GetBitmapFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetBitmapType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
   *contains_filenames = false;
 }
@@ -415,7 +322,7 @@
                                      std::string* result) const {
   DCHECK(CalledOnValidThread());
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
-  *result = g_map.Get().Get(kPlainTextFormat);
+  *result = g_map.Get().Get(ClipboardFormatType::GetPlainTextType().ToString());
 }
 
 // Note: |src_url| isn't really used. It is only implemented in Windows
@@ -429,7 +336,8 @@
   if (src_url)
     src_url->clear();
 
-  std::string input = g_map.Get().Get(kHTMLFormat);
+  std::string input =
+      g_map.Get().Get(ClipboardFormatType::GetHtmlType().ToString());
   *markup = base::UTF8ToUTF16(input);
 
   *fragment_start = 0;
@@ -444,7 +352,8 @@
 SkBitmap ClipboardAndroid::ReadImage(ClipboardType type) const {
   DCHECK(CalledOnValidThread());
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
-  std::string input = g_map.Get().Get(kBitmapFormat);
+  std::string input =
+      g_map.Get().Get(ClipboardFormatType::GetBitmapType().ToString());
 
   SkBitmap bmp;
   if (!input.empty()) {
@@ -474,7 +383,7 @@
   NOTIMPLEMENTED();
 }
 
-void ClipboardAndroid::ReadData(const Clipboard::FormatType& format,
+void ClipboardAndroid::ReadData(const ClipboardFormatType& format,
                                 std::string* result) const {
   DCHECK(CalledOnValidThread());
   *result = g_map.Get().Get(format.ToString());
@@ -504,14 +413,16 @@
 }
 
 void ClipboardAndroid::WriteText(const char* text_data, size_t text_len) {
-  g_map.Get().Set(kPlainTextFormat, std::string(text_data, text_len));
+  g_map.Get().Set(ClipboardFormatType::GetPlainTextType().ToString(),
+                  std::string(text_data, text_len));
 }
 
 void ClipboardAndroid::WriteHTML(const char* markup_data,
                                  size_t markup_len,
                                  const char* url_data,
                                  size_t url_len) {
-  g_map.Get().Set(kHTMLFormat, std::string(markup_data, markup_len));
+  g_map.Get().Set(ClipboardFormatType::GetHtmlType().ToString(),
+                  std::string(markup_data, markup_len));
 }
 
 void ClipboardAndroid::WriteRTF(const char* rtf_data, size_t data_len) {
@@ -524,13 +435,15 @@
                                      size_t title_len,
                                      const char* url_data,
                                      size_t url_len) {
-  g_map.Get().Set(kBookmarkFormat, std::string(url_data, url_len));
+  g_map.Get().Set(ClipboardFormatType::GetBookmarkType().ToString(),
+                  std::string(url_data, url_len));
 }
 
 // Write an extra flavor that signifies WebKit was the last to modify the
 // pasteboard. This flavor has no data.
 void ClipboardAndroid::WriteWebSmartPaste() {
-  g_map.Get().Set(kWebKitSmartPasteFormat, std::string());
+  g_map.Get().Set(ClipboardFormatType::GetWebKitSmartPasteType().ToString(),
+                  std::string());
 }
 
 // Note: we implement this to pass all unit tests but it is currently unclear
@@ -541,10 +454,10 @@
   std::string packed(reinterpret_cast<const char*>(&size), sizeof(size));
   packed += std::string(static_cast<const char*>(bitmap.getPixels()),
                         bitmap.computeByteSize());
-  g_map.Get().Set(kBitmapFormat, packed);
+  g_map.Get().Set(ClipboardFormatType::GetBitmapType().ToString(), packed);
 }
 
-void ClipboardAndroid::WriteData(const Clipboard::FormatType& format,
+void ClipboardAndroid::WriteData(const ClipboardFormatType& format,
                                  const char* data_data,
                                  size_t data_len) {
   g_map.Get().Set(format.ToString(), std::string(data_data, data_len));
diff --git a/ui/base/clipboard/clipboard_android.h b/ui/base/clipboard/clipboard_android.h
index 1ef1bee9..aaa1019 100644
--- a/ui/base/clipboard/clipboard_android.h
+++ b/ui/base/clipboard/clipboard_android.h
@@ -13,6 +13,7 @@
 
 #include "base/android/scoped_java_ref.h"
 #include "base/callback_forward.h"
+#include "base/component_export.h"
 #include "base/macros.h"
 #include "base/time/time.h"
 
@@ -30,11 +31,12 @@
                             const base::android::JavaParamRef<jobject>& obj);
 
   // Sets the callback called whenever the clipboard is modified.
-  UI_BASE_EXPORT void SetModifiedCallback(ModifiedCallback cb);
+  COMPONENT_EXPORT(BASE_CLIPBOARD)
+  void SetModifiedCallback(ModifiedCallback cb);
 
   // Sets the last modified time without calling the above callback.
-  UI_BASE_EXPORT void SetLastModifiedTimeWithoutRunningCallback(
-      base::Time time);
+  COMPONENT_EXPORT(BASE_CLIPBOARD)
+  void SetLastModifiedTimeWithoutRunningCallback(base::Time time);
 
  private:
   friend class Clipboard;
@@ -45,7 +47,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -64,7 +66,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   base::Time GetLastModifiedTime() const override;
   void ClearLastModifiedTime() override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
@@ -80,7 +83,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/clipboard/clipboard_aura.cc b/ui/base/clipboard/clipboard_aura.cc
index 202a196..653b3ac1 100644
--- a/ui/base/clipboard/clipboard_aura.cc
+++ b/ui/base/clipboard/clipboard_aura.cc
@@ -19,6 +19,8 @@
 #include "base/strings/utf_string_conversions.h"
 #include "skia/ext/skia_utils_base.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/clipboard/clipboard_monitor.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/gfx/geometry/size.h"
@@ -27,8 +29,6 @@
 
 namespace {
 
-const char kMimeTypeFilename[] = "chromium/filename";
-const char kMimeTypeBitmap[] = "image/bmp";
 const size_t kMaxClipboardSize = 1;
 
 // Clipboard data format used by AuraClipboard.
@@ -404,117 +404,6 @@
 
 ClipboardData* ClipboardDataBuilder::current_data_ = nullptr;
 
-// Clipboard::FormatType implementation.
-Clipboard::FormatType::FormatType() {
-}
-
-Clipboard::FormatType::FormatType(const std::string& native_format)
-    : data_(native_format) {
-}
-
-Clipboard::FormatType::~FormatType() {
-}
-
-std::string Clipboard::FormatType::Serialize() const {
-  return data_;
-}
-
-// static
-Clipboard::FormatType Clipboard::FormatType::Deserialize(
-    const std::string& serialization) {
-  return FormatType(serialization);
-}
-
-bool Clipboard::FormatType::operator<(const FormatType& other) const {
-  return data_ < other.data_;
-}
-
-bool Clipboard::FormatType::Equals(const FormatType& other) const {
-  return data_ == other.data_;
-}
-
-// Various predefined FormatTypes.
-// static
-Clipboard::FormatType Clipboard::GetFormatType(
-    const std::string& format_string) {
-  return FormatType::Deserialize(format_string);
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeURIList);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
-  return GetUrlFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetMozUrlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeMozillaURL);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeText);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
-  return GetPlainTextFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeFilename);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameWFormatType() {
-  return Clipboard::GetFilenameFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetHtmlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeHTML);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetRtfFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeRTF);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetBitmapFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeBitmap);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeWebkitSmartPaste);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeWebCustomData);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypePepperCustomData);
-  return *type;
-}
-
 // Clipboard factory method.
 Clipboard* Clipboard::Create() {
   return new ClipboardAura;
@@ -537,20 +426,20 @@
   return clipboard_internal_->sequence_number();
 }
 
-bool ClipboardAura::IsFormatAvailable(const FormatType& format,
+bool ClipboardAura::IsFormatAvailable(const ClipboardFormatType& format,
                                       ClipboardType type) const {
   DCHECK(CalledOnValidThread());
   DCHECK(IsSupportedClipboardType(type));
-  if (GetPlainTextFormatType().Equals(format) ||
-      GetUrlFormatType().Equals(format))
+  if (ClipboardFormatType::GetPlainTextType().Equals(format) ||
+      ClipboardFormatType::GetUrlType().Equals(format))
     return clipboard_internal_->IsFormatAvailable(TEXT);
-  if (GetHtmlFormatType().Equals(format))
+  if (ClipboardFormatType::GetHtmlType().Equals(format))
     return clipboard_internal_->IsFormatAvailable(HTML);
-  if (GetRtfFormatType().Equals(format))
+  if (ClipboardFormatType::GetRtfType().Equals(format))
     return clipboard_internal_->IsFormatAvailable(RTF);
-  if (GetBitmapFormatType().Equals(format))
+  if (ClipboardFormatType::GetBitmapType().Equals(format))
     return clipboard_internal_->IsFormatAvailable(BITMAP);
-  if (GetWebKitSmartPasteFormatType().Equals(format))
+  if (ClipboardFormatType::GetWebKitSmartPasteType().Equals(format))
     return clipboard_internal_->IsFormatAvailable(WEB);
   const ClipboardData* data = clipboard_internal_->GetData();
   return data && data->custom_data_format() == format.ToString();
@@ -573,13 +462,16 @@
 
   types->clear();
   *contains_filenames = false;
-  if (IsFormatAvailable(GetPlainTextFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(GetPlainTextFormatType().ToString()));
-  if (IsFormatAvailable(GetHtmlFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(GetHtmlFormatType().ToString()));
-  if (IsFormatAvailable(GetRtfFormatType(), type))
-    types->push_back(base::UTF8ToUTF16(GetRtfFormatType().ToString()));
-  if (IsFormatAvailable(GetBitmapFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetPlainTextType(), type))
+    types->push_back(
+        base::UTF8ToUTF16(ClipboardFormatType::GetPlainTextType().ToString()));
+  if (IsFormatAvailable(ClipboardFormatType::GetHtmlType(), type))
+    types->push_back(
+        base::UTF8ToUTF16(ClipboardFormatType::GetHtmlType().ToString()));
+  if (IsFormatAvailable(ClipboardFormatType::GetRtfType(), type))
+    types->push_back(
+        base::UTF8ToUTF16(ClipboardFormatType::GetRtfType().ToString()));
+  if (IsFormatAvailable(ClipboardFormatType::GetBitmapType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
 
   if (clipboard_internal_->IsFormatAvailable(CUSTOM) &&
@@ -633,7 +525,7 @@
   clipboard_internal_->ReadBookmark(title, url);
 }
 
-void ClipboardAura::ReadData(const FormatType& format,
+void ClipboardAura::ReadData(const ClipboardFormatType& format,
                              std::string* result) const {
   DCHECK(CalledOnValidThread());
   clipboard_internal_->ReadData(format.ToString(), result);
@@ -677,7 +569,7 @@
   ClipboardDataBuilder::WriteBitmap(bitmap);
 }
 
-void ClipboardAura::WriteData(const FormatType& format,
+void ClipboardAura::WriteData(const ClipboardFormatType& format,
                               const char* data_data,
                               size_t data_len) {
   ClipboardDataBuilder::WriteData(format.ToString(), data_data, data_len);
diff --git a/ui/base/clipboard/clipboard_aura.h b/ui/base/clipboard/clipboard_aura.h
index 1d3b208..16fbfe06 100644
--- a/ui/base/clipboard/clipboard_aura.h
+++ b/ui/base/clipboard/clipboard_aura.h
@@ -24,7 +24,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -43,7 +43,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -57,7 +58,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc
index 447beb5..50426b06 100644
--- a/ui/base/clipboard/clipboard_aurax11.cc
+++ b/ui/base/clipboard/clipboard_aurax11.cc
@@ -21,6 +21,7 @@
 #include "base/stl_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_monitor.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/base/x/selection_owner.h"
@@ -42,7 +43,6 @@
 
 const char kClipboard[] = "CLIPBOARD";
 const char kClipboardManager[] = "CLIPBOARD_MANAGER";
-const char kMimeTypeFilename[] = "chromium/filename";
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -135,7 +135,7 @@
   const AtomVector& target_list() { return target_list_; }
 
   bool ContainsText() const;
-  bool ContainsFormat(const Clipboard::FormatType& format_type) const;
+  bool ContainsFormat(const ClipboardFormatType& format_type) const;
   bool ContainsAtom(::Atom atom) const;
 
  private:
@@ -155,8 +155,7 @@
   return false;
 }
 
-bool TargetList::ContainsFormat(
-    const Clipboard::FormatType& format_type) const {
+bool TargetList::ContainsFormat(const ClipboardFormatType& format_type) const {
   ::Atom atom = gfx::GetAtom(format_type.ToString().c_str());
   return ContainsAtom(atom);
 }
@@ -169,41 +168,6 @@
 }  // namespace
 
 ///////////////////////////////////////////////////////////////////////////////
-
-// I would love for the FormatType to really be a wrapper around an X11 ::Atom,
-// but there are a few problems. Chromeos unit tests spawn a new X11 server for
-// each test, so Atom numeric values don't persist across tests. We could still
-// maybe deal with that if we didn't have static accessor methods everywhere.
-
-Clipboard::FormatType::FormatType() {
-}
-
-Clipboard::FormatType::FormatType(const std::string& native_format)
-    : data_(native_format) {
-}
-
-Clipboard::FormatType::~FormatType() {
-}
-
-std::string Clipboard::FormatType::Serialize() const {
-  return data_;
-}
-
-// static
-Clipboard::FormatType Clipboard::FormatType::Deserialize(
-    const std::string& serialization) {
-  return FormatType(serialization);
-}
-
-bool Clipboard::FormatType::operator<(const FormatType& other) const {
-  return data_ < other.data_;
-}
-
-bool Clipboard::FormatType::Equals(const FormatType& other) const {
-  return data_ == other.data_;
-}
-
-///////////////////////////////////////////////////////////////////////////////
 // ClipboardAuraX11::AuraX11Details
 
 // Private implementation of our X11 integration. Keeps X11 headers out of the
@@ -259,7 +223,7 @@
   std::vector< ::Atom> GetTextAtoms() const;
 
   // Returns a vector with a |format| converted to an X11 atom.
-  std::vector< ::Atom> GetAtomsForFormat(const Clipboard::FormatType& format);
+  std::vector<::Atom> GetAtomsForFormat(const ClipboardFormatType& format);
 
   // Clears a certain clipboard type, whether we own it or not.
   void Clear(ClipboardType type);
@@ -448,7 +412,7 @@
 }
 
 std::vector<::Atom> ClipboardAuraX11::AuraX11Details::GetAtomsForFormat(
-    const Clipboard::FormatType& format) {
+    const ClipboardFormatType& format) {
   std::vector< ::Atom> atoms;
   atoms.push_back(gfx::GetAtom(format.ToString().c_str()));
   return atoms;
@@ -541,89 +505,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-// Various predefined FormatTypes.
-// static
-Clipboard::FormatType Clipboard::GetFormatType(
-    const std::string& format_string) {
-  return FormatType::Deserialize(format_string);
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeURIList);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
-  return GetUrlFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetMozUrlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeMozillaURL);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeText);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
-  return GetPlainTextFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeFilename);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameWFormatType() {
-  return Clipboard::GetFilenameFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetHtmlFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeHTML);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetRtfFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeRTF);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetBitmapFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypePNG);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeWebkitSmartPaste);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypeWebCustomData);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kMimeTypePepperCustomData);
-  return *type;
-}
-
-///////////////////////////////////////////////////////////////////////////////
 // Clipboard factory method.
 Clipboard* Clipboard::Create() {
   return new ClipboardAuraX11;
@@ -653,14 +534,14 @@
     return SelectionChangeObserver::GetInstance()->primary_sequence_number();
 }
 
-bool ClipboardAuraX11::IsFormatAvailable(const FormatType& format,
+bool ClipboardAuraX11::IsFormatAvailable(const ClipboardFormatType& format,
                                          ClipboardType type) const {
   DCHECK(CalledOnValidThread());
   DCHECK(IsSupportedClipboardType(type));
 
   TargetList target_list = aurax11_details_->WaitAndGetTargetsList(type);
-  if (format.Equals(GetPlainTextFormatType()) ||
-      format.Equals(GetUrlFormatType())) {
+  if (format.Equals(ClipboardFormatType::GetPlainTextType()) ||
+      format.Equals(ClipboardFormatType::GetUrlType())) {
     return target_list.ContainsText();
   }
   return target_list.ContainsFormat(format);
@@ -687,16 +568,17 @@
 
   if (target_list.ContainsText())
     types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (target_list.ContainsFormat(GetHtmlFormatType()))
+  if (target_list.ContainsFormat(ClipboardFormatType::GetHtmlType()))
     types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
-  if (target_list.ContainsFormat(GetRtfFormatType()))
+  if (target_list.ContainsFormat(ClipboardFormatType::GetRtfType()))
     types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
-  if (target_list.ContainsFormat(GetBitmapFormatType()))
+  if (target_list.ContainsFormat(ClipboardFormatType::GetBitmapType()))
     types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
   *contains_filenames = false;
 
   SelectionData data(aurax11_details_->RequestAndWaitForTypes(
-      type, aurax11_details_->GetAtomsForFormat(GetWebCustomDataFormatType())));
+      type, aurax11_details_->GetAtomsForFormat(
+                ClipboardFormatType::GetWebCustomDataType())));
   if (data.IsValid())
     ReadCustomDataTypes(data.GetData(), data.GetSize(), types);
 }
@@ -738,7 +620,8 @@
   *fragment_end = 0;
 
   SelectionData data(aurax11_details_->RequestAndWaitForTypes(
-      type, aurax11_details_->GetAtomsForFormat(GetHtmlFormatType())));
+      type,
+      aurax11_details_->GetAtomsForFormat(ClipboardFormatType::GetHtmlType())));
   if (data.IsValid()) {
     *markup = data.GetHtml();
 
@@ -752,7 +635,8 @@
   DCHECK(CalledOnValidThread());
 
   SelectionData data(aurax11_details_->RequestAndWaitForTypes(
-      type, aurax11_details_->GetAtomsForFormat(GetRtfFormatType())));
+      type,
+      aurax11_details_->GetAtomsForFormat(ClipboardFormatType::GetRtfType())));
   if (data.IsValid())
     data.AssignTo(result);
 }
@@ -761,7 +645,8 @@
   DCHECK(CalledOnValidThread());
 
   SelectionData data(aurax11_details_->RequestAndWaitForTypes(
-      type, aurax11_details_->GetAtomsForFormat(GetBitmapFormatType())));
+      type, aurax11_details_->GetAtomsForFormat(
+                ClipboardFormatType::GetBitmapType())));
   if (data.IsValid()) {
     SkBitmap bitmap;
     if (gfx::PNGCodec::Decode(data.GetData(), data.GetSize(), &bitmap))
@@ -777,8 +662,8 @@
   DCHECK(CalledOnValidThread());
 
   SelectionData data(aurax11_details_->RequestAndWaitForTypes(
-      clipboard_type,
-      aurax11_details_->GetAtomsForFormat(GetWebCustomDataFormatType())));
+      clipboard_type, aurax11_details_->GetAtomsForFormat(
+                          ClipboardFormatType::GetWebCustomDataType())));
   if (data.IsValid())
     ReadCustomDataForType(data.GetData(), data.GetSize(), type, result);
 }
@@ -790,7 +675,7 @@
   NOTIMPLEMENTED();
 }
 
-void ClipboardAuraX11::ReadData(const FormatType& format,
+void ClipboardAuraX11::ReadData(const ClipboardFormatType& format,
                                 std::string* result) const {
   DCHECK(CalledOnValidThread());
 
@@ -854,7 +739,7 @@
 }
 
 void ClipboardAuraX11::WriteRTF(const char* rtf_data, size_t data_len) {
-  WriteData(GetRtfFormatType(), rtf_data, data_len);
+  WriteData(ClipboardFormatType::GetRtfType(), rtf_data, data_len);
 }
 
 void ClipboardAuraX11::WriteBookmark(const char* title_data,
@@ -895,12 +780,12 @@
   }
 }
 
-void ClipboardAuraX11::WriteData(const FormatType& format,
+void ClipboardAuraX11::WriteData(const ClipboardFormatType& format,
                                  const char* data_data,
                                  size_t data_len) {
   // We assume that certain mapping types are only written by trusted code.
   // Therefore we must upkeep their integrity.
-  if (format.Equals(GetBitmapFormatType()))
+  if (format.Equals(ClipboardFormatType::GetBitmapType()))
     return;
 
   std::vector<unsigned char> bytes(data_data, data_data + data_len);
diff --git a/ui/base/clipboard/clipboard_aurax11.h b/ui/base/clipboard/clipboard_aurax11.h
index ba063450..29d860c 100644
--- a/ui/base/clipboard/clipboard_aurax11.h
+++ b/ui/base/clipboard/clipboard_aurax11.h
@@ -25,7 +25,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -44,7 +44,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -58,7 +59,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/clipboard/clipboard_constants.cc b/ui/base/clipboard/clipboard_constants.cc
index 63723539..649a78c1 100644
--- a/ui/base/clipboard/clipboard_constants.cc
+++ b/ui/base/clipboard/clipboard_constants.cc
@@ -2,21 +2,20 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 
 namespace ui {
 
-const char Clipboard::kMimeTypeText[] = "text/plain";
-const char Clipboard::kMimeTypeURIList[] = "text/uri-list";
-const char Clipboard::kMimeTypeMozillaURL[] = "text/x-moz-url";
-const char Clipboard::kMimeTypeDownloadURL[] = "downloadurl";
-const char Clipboard::kMimeTypeHTML[] = "text/html";
-const char Clipboard::kMimeTypeRTF[] = "text/rtf";
-const char Clipboard::kMimeTypePNG[] = "image/png";
+const char kMimeTypeText[] = "text/plain";
+const char kMimeTypeURIList[] = "text/uri-list";
+const char kMimeTypeMozillaURL[] = "text/x-moz-url";
+const char kMimeTypeDownloadURL[] = "downloadurl";
+const char kMimeTypeHTML[] = "text/html";
+const char kMimeTypeRTF[] = "text/rtf";
+const char kMimeTypePNG[] = "image/png";
 // TODO(dcheng): This name is temporary. See crbug.com/106449.
-const char Clipboard::kMimeTypeWebCustomData[] = "chromium/x-web-custom-data";
-const char Clipboard::kMimeTypeWebkitSmartPaste[] = "chromium/x-webkit-paste";
-const char Clipboard::kMimeTypePepperCustomData[] =
-    "chromium/x-pepper-custom-data";
+const char kMimeTypeWebCustomData[] = "chromium/x-web-custom-data";
+const char kMimeTypeWebkitSmartPaste[] = "chromium/x-webkit-paste";
+const char kMimeTypePepperCustomData[] = "chromium/x-pepper-custom-data";
 
 }  // namespace ui
diff --git a/ui/base/clipboard/clipboard_constants.h b/ui/base/clipboard/clipboard_constants.h
new file mode 100644
index 0000000..8c499112
--- /dev/null
+++ b/ui/base/clipboard/clipboard_constants.h
@@ -0,0 +1,45 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_CLIPBOARD_CLIPBOARD_CONSTANTS_H_
+#define UI_BASE_CLIPBOARD_CLIPBOARD_CONSTANTS_H_
+
+#include <string>
+
+#include "base/component_export.h"
+#include "build/build_config.h"
+
+#if defined(OS_MACOSX)
+#ifdef __OBJC__
+@class NSString;
+#else
+class NSString;
+#endif
+#endif  // defined(OS_MACOSX)
+
+namespace ui {
+
+#if defined(OS_MACOSX) && !defined(USE_AURA)
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
+extern NSString* const kWebCustomDataPboardType;
+#endif
+
+// MIME type constants.
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeText[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeURIList[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeDownloadURL[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeMozillaURL[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeHTML[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeRTF[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypePNG[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
+extern const char kMimeTypeWebCustomData[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
+extern const char kMimeTypeWebkitSmartPaste[];
+COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
+extern const char kMimeTypePepperCustomData[];
+
+}  // namespace ui
+
+#endif  // UI_BASE_CLIPBOARD_CLIPBOARD_H_
diff --git a/ui/base/clipboard/custom_data_helper_mac.mm b/ui/base/clipboard/clipboard_constants_mac.mm
similarity index 74%
rename from ui/base/clipboard/custom_data_helper_mac.mm
rename to ui/base/clipboard/clipboard_constants_mac.mm
index 587d7b4..e415c44 100644
--- a/ui/base/clipboard/custom_data_helper_mac.mm
+++ b/ui/base/clipboard/clipboard_constants_mac.mm
@@ -1,8 +1,8 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "ui/base/clipboard/custom_data_helper.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 
 #import <Foundation/Foundation.h>
 
diff --git a/ui/base/clipboard/clipboard_format_type.h b/ui/base/clipboard/clipboard_format_type.h
new file mode 100644
index 0000000..eb5b91ff
--- /dev/null
+++ b/ui/base/clipboard/clipboard_format_type.h
@@ -0,0 +1,118 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_CLIPBOARD_CLIPBOARD_FORMAT_TYPE_H_
+#define UI_BASE_CLIPBOARD_CLIPBOARD_FORMAT_TYPE_H_
+
+#include <string>
+
+#include "base/component_export.h"
+#include "base/no_destructor.h"
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <objidl.h>
+#endif
+
+#ifdef __OBJC__
+@class NSString;
+#else
+class NSString;
+#endif
+
+namespace ui {
+
+// Platform neutral holder for native data representation of a clipboard type.
+struct COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) ClipboardFormatType {
+  ClipboardFormatType();
+  ~ClipboardFormatType();
+
+  // Serializes and deserializes a ClipboardFormatType for use in IPC messages.
+  std::string Serialize() const;
+  static ClipboardFormatType Deserialize(const std::string& serialization);
+
+  // Gets the ClipboardFormatType corresponding to an arbitrary format string,
+  // registering it with the system if needed. Due to Windows/Linux
+  // limitations, |format_string| must never be controlled by the user.
+  static ClipboardFormatType GetType(const std::string& format_string);
+
+  // Get format identifiers for various types.
+  static const ClipboardFormatType& GetUrlType();
+  static const ClipboardFormatType& GetUrlWType();
+  static const ClipboardFormatType& GetMozUrlType();
+  static const ClipboardFormatType& GetPlainTextType();
+  static const ClipboardFormatType& GetPlainTextWType();
+  static const ClipboardFormatType& GetFilenameType();
+  static const ClipboardFormatType& GetFilenameWType();
+  static const ClipboardFormatType& GetWebKitSmartPasteType();
+  // Win: MS HTML Format, Other: Generic HTML format
+  static const ClipboardFormatType& GetHtmlType();
+  static const ClipboardFormatType& GetRtfType();
+  static const ClipboardFormatType& GetBitmapType();
+  // TODO(raymes): Unify web custom data and pepper custom data:
+  // crbug.com/158399.
+  static const ClipboardFormatType& GetWebCustomDataType();
+  static const ClipboardFormatType& GetPepperCustomDataType();
+
+#if defined(OS_WIN)
+  // Firefox text/html
+  static const ClipboardFormatType& GetTextHtmlType();
+  static const ClipboardFormatType& GetCFHDropType();
+  static const ClipboardFormatType& GetFileDescriptorType();
+  static const ClipboardFormatType& GetFileContentZeroType();
+  static const ClipboardFormatType& GetIDListType();
+#endif
+
+#if defined(OS_ANDROID)
+  static const ClipboardFormatType& GetBookmarkType();
+#endif
+
+  // ClipboardFormatType can be used in a set on some platforms.
+  bool operator<(const ClipboardFormatType& other) const;
+
+#if defined(OS_WIN)
+  const FORMATETC& ToFormatEtc() const { return data_; }
+#elif defined(USE_AURA) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
+  const std::string& ToString() const { return data_; }
+#elif defined(OS_MACOSX)
+  NSString* ToNSString() const { return data_; }
+  // Custom copy and assignment constructor to handle NSString.
+  ClipboardFormatType(const ClipboardFormatType& other);
+  ClipboardFormatType& operator=(const ClipboardFormatType& other);
+#endif
+
+  bool Equals(const ClipboardFormatType& other) const;
+
+ private:
+  friend class base::NoDestructor<ClipboardFormatType>;
+  friend struct ClipboardFormatType;
+
+  // Platform-specific glue used internally by the ClipboardFormatType struct.
+  // Each platform should define,at least one of each of the following:
+  // 1. A constructor that wraps that native clipboard format descriptor.
+  // 2. An accessor to retrieve the wrapped descriptor.
+  // 3. A data member to hold the wrapped descriptor.
+  //
+  // Note that in some cases, the accessor for the wrapped descriptor may be
+  // public, as these format types can be used by drag and drop code as well.
+#if defined(OS_WIN)
+  explicit ClipboardFormatType(UINT native_format);
+  ClipboardFormatType(UINT native_format, LONG index);
+  FORMATETC data_;
+#elif defined(USE_AURA) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
+  explicit ClipboardFormatType(const std::string& native_format);
+  std::string data_;
+#elif defined(OS_MACOSX)
+  explicit ClipboardFormatType(NSString* native_format);
+  NSString* data_;
+#else
+#error No ClipboardFormatType definition.
+#endif
+
+  // Copyable and assignable, since this is essentially an opaque value type.
+};
+
+}  // namespace ui
+
+#endif  // UI_BASE_CLIPBOARD_CLIPBOARD_FORMAT_TYPE_H_
diff --git a/ui/base/clipboard/clipboard_format_type_android.cc b/ui/base/clipboard/clipboard_format_type_android.cc
new file mode 100644
index 0000000..74a6e3f
--- /dev/null
+++ b/ui/base/clipboard/clipboard_format_type_android.cc
@@ -0,0 +1,119 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/clipboard/clipboard_format_type.h"
+
+#include "ui/base/clipboard/clipboard_constants.h"
+
+namespace ui {
+
+namespace {
+
+// Various formats we support.
+const char kURLFormat[] = "url";
+const char kPlainTextFormat[] = "text";
+const char kHTMLFormat[] = "html";
+const char kRTFFormat[] = "rtf";
+const char kBitmapFormat[] = "bitmap";
+const char kWebKitSmartPasteFormat[] = "webkit_smart";
+const char kBookmarkFormat[] = "bookmark";
+
+}  // namespace
+
+// ClipboardFormatType implementation.
+ClipboardFormatType::ClipboardFormatType() {}
+
+ClipboardFormatType::ClipboardFormatType(const std::string& native_format)
+    : data_(native_format) {}
+
+ClipboardFormatType::~ClipboardFormatType() {}
+
+std::string ClipboardFormatType::Serialize() const {
+  return data_;
+}
+
+// static
+ClipboardFormatType ClipboardFormatType::Deserialize(
+    const std::string& serialization) {
+  return ClipboardFormatType(serialization);
+}
+
+bool ClipboardFormatType::operator<(const ClipboardFormatType& other) const {
+  return data_ < other.data_;
+}
+
+bool ClipboardFormatType::Equals(const ClipboardFormatType& other) const {
+  return data_ == other.data_;
+}
+
+// Various predefined ClipboardFormatTypes.
+
+// static
+ClipboardFormatType ClipboardFormatType::GetType(
+    const std::string& format_string) {
+  return ClipboardFormatType::Deserialize(format_string);
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlWType() {
+  static base::NoDestructor<ClipboardFormatType> type(kURLFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextType() {
+  static base::NoDestructor<ClipboardFormatType> type(kPlainTextFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextWType() {
+  static base::NoDestructor<ClipboardFormatType> type(kPlainTextFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebKitSmartPasteType() {
+  static base::NoDestructor<ClipboardFormatType> type(kWebKitSmartPasteFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetHtmlType() {
+  static base::NoDestructor<ClipboardFormatType> type(kHTMLFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetRtfType() {
+  static base::NoDestructor<ClipboardFormatType> type(kRTFFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetBitmapType() {
+  static base::NoDestructor<ClipboardFormatType> type(kBitmapFormat);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeWebCustomData);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPepperCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(
+      kMimeTypePepperCustomData);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetBookmarkType() {
+  static base::NoDestructor<ClipboardFormatType> type(kBookmarkFormat);
+  return *type;
+}
+
+}  // namespace ui
diff --git a/ui/base/clipboard/clipboard_format_type_aura.cc b/ui/base/clipboard/clipboard_format_type_aura.cc
new file mode 100644
index 0000000..e68dacd
--- /dev/null
+++ b/ui/base/clipboard/clipboard_format_type_aura.cc
@@ -0,0 +1,130 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/clipboard/clipboard_format_type.h"
+
+#include "ui/base/clipboard/clipboard_constants.h"
+
+namespace ui {
+
+namespace {
+constexpr char kMimeTypeFilename[] = "chromium/filename";
+}
+
+// I would love for the ClipboardFormatType to really be a wrapper around an X11
+// ::Atom, but there are a few problems. Chromeos unit tests spawn a new X11
+// server for each test, so Atom numeric values don't persist across tests. We
+// could still maybe deal with that if we didn't have static accessor methods
+// everywhere.
+ClipboardFormatType::ClipboardFormatType() = default;
+
+ClipboardFormatType::~ClipboardFormatType() = default;
+
+ClipboardFormatType::ClipboardFormatType(const std::string& native_format)
+    : data_(native_format) {}
+
+std::string ClipboardFormatType::Serialize() const {
+  return data_;
+}
+
+// static
+ClipboardFormatType ClipboardFormatType::Deserialize(
+    const std::string& serialization) {
+  return ClipboardFormatType(serialization);
+}
+
+bool ClipboardFormatType::operator<(const ClipboardFormatType& other) const {
+  return data_ < other.data_;
+}
+
+bool ClipboardFormatType::Equals(const ClipboardFormatType& other) const {
+  return data_ == other.data_;
+}
+
+// Various predefined ClipboardFormatTypes.
+
+// static
+ClipboardFormatType ClipboardFormatType::GetType(
+    const std::string& format_string) {
+  return ClipboardFormatType::Deserialize(format_string);
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeURIList);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlWType() {
+  return ClipboardFormatType::GetUrlType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetMozUrlType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeMozillaURL);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeText);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextWType() {
+  return ClipboardFormatType::GetPlainTextType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeFilename);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameWType() {
+  return ClipboardFormatType::GetFilenameType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetHtmlType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeHTML);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetRtfType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeRTF);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetBitmapType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypePNG);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebKitSmartPasteType() {
+  static base::NoDestructor<ClipboardFormatType> type(
+      kMimeTypeWebkitSmartPaste);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(kMimeTypeWebCustomData);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPepperCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(
+      kMimeTypePepperCustomData);
+  return *type;
+}
+
+}  // namespace ui
diff --git a/ui/base/clipboard/clipboard_format_type_mac.mm b/ui/base/clipboard/clipboard_format_type_mac.mm
new file mode 100644
index 0000000..6ee040c
--- /dev/null
+++ b/ui/base/clipboard/clipboard_format_type_mac.mm
@@ -0,0 +1,144 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/clipboard/clipboard_format_type.h"
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/strings/sys_string_conversions.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+
+namespace ui {
+
+namespace {
+
+// Tells us if WebKit was the last to write to the pasteboard. There's no
+// actual data associated with this type.
+NSString* const kWebSmartPastePboardType = @"NeXT smart paste pasteboard type";
+
+// Pepper custom data format type.
+NSString* const kPepperCustomDataPboardType =
+    @"org.chromium.pepper-custom-data";
+
+}  // namespace
+
+// ClipboardFormatType implementation.
+ClipboardFormatType::ClipboardFormatType() : data_(nil) {}
+
+ClipboardFormatType::ClipboardFormatType(NSString* native_format)
+    : data_([native_format retain]) {}
+
+ClipboardFormatType::ClipboardFormatType(const ClipboardFormatType& other)
+    : data_([other.data_ retain]) {}
+
+ClipboardFormatType& ClipboardFormatType::operator=(
+    const ClipboardFormatType& other) {
+  if (this != &other) {
+    [data_ release];
+    data_ = [other.data_ retain];
+  }
+  return *this;
+}
+
+bool ClipboardFormatType::Equals(const ClipboardFormatType& other) const {
+  return [data_ isEqualToString:other.data_];
+}
+
+ClipboardFormatType::~ClipboardFormatType() {
+  [data_ release];
+}
+
+std::string ClipboardFormatType::Serialize() const {
+  return base::SysNSStringToUTF8(data_);
+}
+
+// static
+ClipboardFormatType ClipboardFormatType::Deserialize(
+    const std::string& serialization) {
+  return ClipboardFormatType(base::SysUTF8ToNSString(serialization));
+}
+
+bool ClipboardFormatType::operator<(const ClipboardFormatType& other) const {
+  return [data_ compare:other.data_] == NSOrderedAscending;
+}
+
+// Various predefined ClipboardFormatTypes.
+
+// static
+ClipboardFormatType ClipboardFormatType::GetType(
+    const std::string& format_string) {
+  return ClipboardFormatType::Deserialize(format_string);
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSURLPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlWType() {
+  return ClipboardFormatType::GetUrlType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSPasteboardTypeString);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextWType() {
+  return ClipboardFormatType::GetPlainTextType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSFilenamesPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameWType() {
+  return ClipboardFormatType::GetFilenameType();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetHtmlType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSHTMLPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetRtfType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSRTFPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetBitmapType() {
+  static base::NoDestructor<ClipboardFormatType> type(NSTIFFPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebKitSmartPasteType() {
+  static base::NoDestructor<ClipboardFormatType> type(kWebSmartPastePboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(kWebCustomDataPboardType);
+  return *type;
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPepperCustomDataType() {
+  static base::NoDestructor<ClipboardFormatType> type(
+      kPepperCustomDataPboardType);
+  return *type;
+}
+
+}  // namespace ui
diff --git a/ui/base/clipboard/clipboard_format_type_win.cc b/ui/base/clipboard/clipboard_format_type_win.cc
new file mode 100644
index 0000000..ebb4ba85
--- /dev/null
+++ b/ui/base/clipboard/clipboard_format_type_win.cc
@@ -0,0 +1,214 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/clipboard/clipboard_format_type.h"
+
+#include <shlobj.h>
+
+#include "base/lazy_instance.h"
+#include "base/logging.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
+
+namespace ui {
+
+// ClipboardFormatType implementation.
+ClipboardFormatType::ClipboardFormatType() : data_() {}
+
+ClipboardFormatType::ClipboardFormatType(UINT native_format) : data_() {
+  // There's no good way to actually initialize this in the constructor in
+  // C++03.
+  data_.cfFormat = static_cast<CLIPFORMAT>(native_format);
+  data_.dwAspect = DVASPECT_CONTENT;
+  data_.lindex = -1;
+  data_.tymed = TYMED_HGLOBAL;
+}
+
+ClipboardFormatType::ClipboardFormatType(UINT native_format, LONG index)
+    : data_() {
+  // There's no good way to actually initialize this in the constructor in
+  // C++03.
+  data_.cfFormat = static_cast<CLIPFORMAT>(native_format);
+  data_.dwAspect = DVASPECT_CONTENT;
+  data_.lindex = index;
+  data_.tymed = TYMED_HGLOBAL;
+}
+
+ClipboardFormatType::~ClipboardFormatType() {}
+
+std::string ClipboardFormatType::Serialize() const {
+  return base::IntToString(data_.cfFormat);
+}
+
+// static
+ClipboardFormatType ClipboardFormatType::Deserialize(
+    const std::string& serialization) {
+  int clipboard_format = -1;
+  if (!base::StringToInt(serialization, &clipboard_format)) {
+    NOTREACHED();
+    return ClipboardFormatType();
+  }
+  return ClipboardFormatType(clipboard_format);
+}
+
+bool ClipboardFormatType::operator<(const ClipboardFormatType& other) const {
+  return data_.cfFormat < other.data_.cfFormat;
+}
+
+bool ClipboardFormatType::Equals(const ClipboardFormatType& other) const {
+  return data_.cfFormat == other.data_.cfFormat;
+}
+
+// Various predefined ClipboardFormatTypes.
+
+// static
+ClipboardFormatType ClipboardFormatType::GetType(
+    const std::string& format_string) {
+  return ClipboardFormatType(
+      ::RegisterClipboardFormat(base::ASCIIToUTF16(format_string).c_str()));
+}
+
+// The following formats can be referenced by ClipboardUtilWin::GetPlainText.
+// For reasons (COM), they must be initialized in a thread-safe manner.
+// TODO(dcheng): We probably need to make static initialization of "known"
+// ClipboardFormatTypes thread-safe on all platforms.
+#define CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(name, ...)                        \
+  struct ClipboardFormatTypeArgumentForwarder : public ClipboardFormatType { \
+    ClipboardFormatTypeArgumentForwarder()                                   \
+        : ClipboardFormatType(__VA_ARGS__) {}                                \
+  };                                                                         \
+  static base::LazyInstance<ClipboardFormatTypeArgumentForwarder>::Leaky     \
+      name = LAZY_INSTANCE_INITIALIZER
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type,
+                                     ::RegisterClipboardFormat(CFSTR_INETURLA));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetUrlWType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type,
+                                     ::RegisterClipboardFormat(CFSTR_INETURLW));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetMozUrlType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(L"text/x-moz-url"));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_TEXT);
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPlainTextWType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_UNICODETEXT);
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(CFSTR_FILENAMEA));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFilenameWType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(CFSTR_FILENAMEW));
+  return type.Get();
+}
+
+// MS HTML Format
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetHtmlType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type,
+                                     ::RegisterClipboardFormat(L"HTML Format"));
+  return type.Get();
+}
+
+// MS RTF Format
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetRtfType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(L"Rich Text Format"));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetBitmapType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_BITMAP);
+  return type.Get();
+}
+
+// Firefox text/html
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetTextHtmlType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type,
+                                     ::RegisterClipboardFormat(L"text/html"));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetCFHDropType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_HDROP);
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFileDescriptorType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetFileContentZeroType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(CFSTR_FILECONTENTS), 0);
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetIDListType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(CFSTR_SHELLIDLIST));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebKitSmartPasteType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(L"WebKit Smart Paste Format"));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetWebCustomDataType() {
+  // TODO(dcheng): This name is temporary. See http://crbug.com/106449.
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(L"Chromium Web Custom MIME Data Format"));
+  return type.Get();
+}
+
+// static
+const ClipboardFormatType& ClipboardFormatType::GetPepperCustomDataType() {
+  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
+      type, ::RegisterClipboardFormat(L"Chromium Pepper MIME Data Format"));
+  return type.Get();
+}
+#undef CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE
+
+}  // namespace ui
diff --git a/ui/base/clipboard/clipboard_mac.h b/ui/base/clipboard/clipboard_mac.h
index e902f614..65c377a 100644
--- a/ui/base/clipboard/clipboard_mac.h
+++ b/ui/base/clipboard/clipboard_mac.h
@@ -8,16 +8,16 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "base/component_export.h"
 #include "base/gtest_prod_util.h"
 #include "base/macros.h"
 #include "ui/base/clipboard/clipboard.h"
-#include "ui/base/ui_base_export.h"
 
 @class NSPasteboard;
 
 namespace ui {
 
-class UI_BASE_EXPORT ClipboardMac : public Clipboard {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardMac : public Clipboard {
  private:
   FRIEND_TEST_ALL_PREFIXES(ClipboardMacTest, ReadImageRetina);
   FRIEND_TEST_ALL_PREFIXES(ClipboardMacTest, ReadImageNonRetina);
@@ -31,7 +31,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -51,7 +51,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -65,7 +66,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index 2677438..7ec5c99c 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -11,6 +11,7 @@
 
 #include "base/files/file_path.h"
 #include "base/logging.h"
+#include "base/mac/foundation_util.h"
 #include "base/mac/mac_util.h"
 #include "base/mac/scoped_cftyperef.h"
 #include "base/mac/scoped_nsobject.h"
@@ -22,6 +23,7 @@
 #include "skia/ext/skia_utils_mac.h"
 #import "third_party/mozilla/NSPasteboard+Utils.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_util_mac.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/gfx/canvas.h"
@@ -32,14 +34,6 @@
 
 namespace {
 
-// Tells us if WebKit was the last to write to the pasteboard. There's no
-// actual data associated with this type.
-NSString* const kWebSmartPastePboardType = @"NeXT smart paste pasteboard type";
-
-// Pepper custom data format type.
-NSString* const kPepperCustomDataPboardType =
-    @"org.chromium.pepper-custom-data";
-
 NSPasteboard* GetPasteboard() {
   // The pasteboard can always be nil, since there is a finite amount of storage
   // that must be shared between all pasteboards.
@@ -49,125 +43,6 @@
 
 }  // namespace
 
-// Clipboard::FormatType implementation.
-Clipboard::FormatType::FormatType() : data_(nil) {
-}
-
-Clipboard::FormatType::FormatType(NSString* native_format)
-    : data_([native_format retain]) {
-}
-
-Clipboard::FormatType::FormatType(const FormatType& other)
-    : data_([other.data_ retain]) {
-}
-
-Clipboard::FormatType& Clipboard::FormatType::operator=(
-    const FormatType& other) {
-  if (this != &other) {
-    [data_ release];
-    data_ = [other.data_ retain];
-  }
-  return *this;
-}
-
-bool Clipboard::FormatType::Equals(const FormatType& other) const {
-  return [data_ isEqualToString:other.data_];
-}
-
-Clipboard::FormatType::~FormatType() {
-  [data_ release];
-}
-
-std::string Clipboard::FormatType::Serialize() const {
-  return base::SysNSStringToUTF8(data_);
-}
-
-// static
-Clipboard::FormatType Clipboard::FormatType::Deserialize(
-    const std::string& serialization) {
-  return FormatType(base::SysUTF8ToNSString(serialization));
-}
-
-bool Clipboard::FormatType::operator<(const FormatType& other) const {
-  return [data_ compare:other.data_] == NSOrderedAscending;
-}
-
-// Various predefined FormatTypes.
-// static
-Clipboard::FormatType Clipboard::GetFormatType(
-    const std::string& format_string) {
-  return FormatType::Deserialize(format_string);
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlFormatType() {
-  static base::NoDestructor<FormatType> type(NSURLPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
-  return GetUrlFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
-  static base::NoDestructor<FormatType> type(NSPasteboardTypeString);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
-  return GetPlainTextFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameFormatType() {
-  static base::NoDestructor<FormatType> type(NSFilenamesPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameWFormatType() {
-  return GetFilenameFormatType();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetHtmlFormatType() {
-  static base::NoDestructor<FormatType> type(NSHTMLPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetRtfFormatType() {
-  static base::NoDestructor<FormatType> type(NSRTFPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetBitmapFormatType() {
-  static base::NoDestructor<FormatType> type(NSTIFFPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
-  static base::NoDestructor<FormatType> type(kWebSmartPastePboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kWebCustomDataPboardType);
-  return *type;
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
-  static base::NoDestructor<FormatType> type(kPepperCustomDataPboardType);
-  return *type;
-}
-
 // Clipboard factory method.
 // static
 Clipboard* Clipboard::Create() {
@@ -193,7 +68,7 @@
   return [pb changeCount];
 }
 
-bool ClipboardMac::IsFormatAvailable(const FormatType& format,
+bool ClipboardMac::IsFormatAvailable(const ClipboardFormatType& format,
                                      ClipboardType type) const {
   DCHECK(CalledOnValidThread());
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
@@ -223,11 +98,11 @@
                                       bool* contains_filenames) const {
   DCHECK(CalledOnValidThread());
   types->clear();
-  if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetPlainTextType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (IsFormatAvailable(Clipboard::GetHtmlFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetHtmlType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
-  if (IsFormatAvailable(Clipboard::GetRtfFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetRtfType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
 
   NSPasteboard* pb = GetPasteboard();
@@ -299,7 +174,7 @@
   DCHECK(CalledOnValidThread());
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
 
-  return ReadData(GetRtfFormatType(), result);
+  return ReadData(ClipboardFormatType::GetRtfType(), result);
 }
 
 SkBitmap ClipboardMac::ReadImage(ClipboardType type, NSPasteboard* pb) const {
@@ -387,7 +262,7 @@
   }
 }
 
-void ClipboardMac::ReadData(const FormatType& format,
+void ClipboardMac::ReadData(const ClipboardFormatType& format,
                             std::string* result) const {
   DCHECK(CalledOnValidThread());
   NSPasteboard* pb = GetPasteboard();
@@ -433,7 +308,7 @@
 }
 
 void ClipboardMac::WriteRTF(const char* rtf_data, size_t data_len) {
-  WriteData(GetRtfFormatType(), rtf_data, data_len);
+  WriteData(ClipboardFormatType::GetRtfType(), rtf_data, data_len);
 }
 
 void ClipboardMac::WriteBookmark(const char* title_data,
@@ -475,7 +350,7 @@
   }
 }
 
-void ClipboardMac::WriteData(const FormatType& format,
+void ClipboardMac::WriteData(const ClipboardFormatType& format,
                              const char* data_data,
                              size_t data_len) {
   NSPasteboard* pb = GetPasteboard();
@@ -488,7 +363,8 @@
 // pasteboard. This flavor has no data.
 void ClipboardMac::WriteWebSmartPaste() {
   NSPasteboard* pb = GetPasteboard();
-  NSString* format = GetWebKitSmartPasteFormatType().ToNSString();
+  NSString* format =
+      ClipboardFormatType::GetWebKitSmartPasteType().ToNSString();
   [pb addTypes:@[ format ] owner:nil];
   [pb setData:nil forType:format];
 }
diff --git a/ui/base/clipboard/clipboard_monitor.h b/ui/base/clipboard/clipboard_monitor.h
index 448c0f76..bb03186 100644
--- a/ui/base/clipboard/clipboard_monitor.h
+++ b/ui/base/clipboard/clipboard_monitor.h
@@ -5,11 +5,11 @@
 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_MONITOR_H_
 #define UI_BASE_CLIPBOARD_CLIPBOARD_MONITOR_H_
 
+#include "base/component_export.h"
 #include "base/macros.h"
 #include "base/no_destructor.h"
 #include "base/observer_list.h"
 #include "base/threading/thread_checker.h"
-#include "ui/base/ui_base_export.h"
 
 namespace ui {
 
@@ -17,7 +17,7 @@
 
 // A singleton instance to monitor and notify ClipboardObservers for clipboard
 // changes.
-class UI_BASE_EXPORT ClipboardMonitor {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardMonitor {
  public:
   static ClipboardMonitor* GetInstance();
 
diff --git a/ui/base/clipboard/clipboard_observer.h b/ui/base/clipboard/clipboard_observer.h
index 82afdd38..1aa813d 100644
--- a/ui/base/clipboard/clipboard_observer.h
+++ b/ui/base/clipboard/clipboard_observer.h
@@ -5,13 +5,13 @@
 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_OBSERVER_H_
 #define UI_BASE_CLIPBOARD_CLIPBOARD_OBSERVER_H_
 
+#include "base/component_export.h"
 #include "base/macros.h"
-#include "ui/base/ui_base_export.h"
 
 namespace ui {
 
 // Observer that receives the notifications of clipboard change events.
-class UI_BASE_EXPORT ClipboardObserver {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardObserver {
  public:
   // Called when clipboard data is changed.
   virtual void OnClipboardDataChanged() = 0;
diff --git a/ui/base/clipboard/clipboard_test_template.h b/ui/base/clipboard/clipboard_test_template.h
index 1d8d3834..0dde00d 100644
--- a/ui/base/clipboard/clipboard_test_template.h
+++ b/ui/base/clipboard/clipboard_test_template.h
@@ -34,8 +34,9 @@
 #include "third_party/skia/include/core/SkScalar.h"
 #include "third_party/skia/include/core/SkUnPreMultiply.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/half_float.h"
 
@@ -112,9 +113,9 @@
 
   EXPECT_TRUE(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE).empty());
   EXPECT_FALSE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextWType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_FALSE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_COPY_PASTE));
 }
 
 TYPED_TEST(ClipboardTest, TextTest) {
@@ -127,11 +128,11 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeText)));
+              Contains(ASCIIToUTF16(kMimeTypeText)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextWType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_COPY_PASTE));
   this->clipboard().ReadText(CLIPBOARD_TYPE_COPY_PASTE, &text_result);
 
   EXPECT_EQ(text, text_result);
@@ -151,9 +152,9 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeHTML)));
+              Contains(ASCIIToUTF16(kMimeTypeHTML)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   uint32_t fragment_start;
   uint32_t fragment_end;
   this->clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &markup_result,
@@ -180,9 +181,9 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeRTF)));
-  EXPECT_TRUE(this->clipboard().IsFormatAvailable(Clipboard::GetRtfFormatType(),
-                                                  CLIPBOARD_TYPE_COPY_PASTE));
+              Contains(ASCIIToUTF16(kMimeTypeRTF)));
+  EXPECT_TRUE(this->clipboard().IsFormatAvailable(
+      ClipboardFormatType::GetRtfType(), CLIPBOARD_TYPE_COPY_PASTE));
   std::string result;
   this->clipboard().ReadRTF(CLIPBOARD_TYPE_COPY_PASTE, &result);
   EXPECT_EQ(rtf, result);
@@ -207,19 +208,19 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeText)));
+              Contains(ASCIIToUTF16(kMimeTypeText)));
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_SELECTION),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeHTML)));
+              Contains(ASCIIToUTF16(kMimeTypeHTML)));
 
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_FALSE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_SELECTION));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_SELECTION));
 
   EXPECT_FALSE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_SELECTION));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_SELECTION));
 
   this->clipboard().ReadText(CLIPBOARD_TYPE_COPY_PASTE, &text_result);
   EXPECT_EQ(text, text_result);
@@ -248,9 +249,9 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeHTML)));
+              Contains(ASCIIToUTF16(kMimeTypeHTML)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   uint32_t fragment_start;
   uint32_t fragment_end;
   this->clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &markup_result,
@@ -278,9 +279,9 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeHTML)));
+              Contains(ASCIIToUTF16(kMimeTypeHTML)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   uint32_t fragment_start;
   uint32_t fragment_end;
   this->clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &markup_result,
@@ -305,7 +306,7 @@
   }
 
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetUrlWFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetUrlWType(), CLIPBOARD_TYPE_COPY_PASTE));
   this->clipboard().ReadBookmark(&title_result, &url_result);
   EXPECT_EQ(title, title_result);
   EXPECT_EQ(url, url_result);
@@ -325,15 +326,15 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeHTML)));
+              Contains(ASCIIToUTF16(kMimeTypeHTML)));
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeText)));
+              Contains(ASCIIToUTF16(kMimeTypeText)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextWType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_COPY_PASTE));
   uint32_t fragment_start;
   uint32_t fragment_end;
   this->clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &markup_result,
@@ -361,11 +362,11 @@
   }
 
   EXPECT_THAT(this->GetAvailableTypes(CLIPBOARD_TYPE_COPY_PASTE),
-              Contains(ASCIIToUTF16(Clipboard::kMimeTypeText)));
+              Contains(ASCIIToUTF16(kMimeTypeText)));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextWType(), CLIPBOARD_TYPE_COPY_PASTE));
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetPlainTextType(), CLIPBOARD_TYPE_COPY_PASTE));
   base::string16 text_result;
   this->clipboard().ReadText(CLIPBOARD_TYPE_COPY_PASTE, &text_result);
 
@@ -402,7 +403,7 @@
     scw.WriteImage(bitmap);
   }
 
-  EXPECT_TRUE(clipboard->IsFormatAvailable(Clipboard::GetBitmapFormatType(),
+  EXPECT_TRUE(clipboard->IsFormatAvailable(ClipboardFormatType::GetBitmapType(),
                                            CLIPBOARD_TYPE_COPY_PASTE));
   const SkBitmap& image = clipboard->ReadImage(CLIPBOARD_TYPE_COPY_PASTE);
   ASSERT_EQ(image.info().colorType(), kN32_SkColorType);
@@ -520,8 +521,8 @@
 }  // namespace
 
 TYPED_TEST(ClipboardTest, DataTest) {
-  const ui::Clipboard::FormatType kFormat =
-      ui::Clipboard::GetFormatType("chromium/x-test-format");
+  const ui::ClipboardFormatType kFormat =
+      ui::ClipboardFormatType::GetType("chromium/x-test-format");
   std::string payload("test string");
   base::Pickle write_pickle;
   write_pickle.WriteString(payload);
@@ -545,14 +546,14 @@
 }
 
 TYPED_TEST(ClipboardTest, MultipleDataTest) {
-  const ui::Clipboard::FormatType kFormat1 =
-      ui::Clipboard::GetFormatType("chromium/x-test-format1");
+  const ui::ClipboardFormatType kFormat1 =
+      ui::ClipboardFormatType::GetType("chromium/x-test-format1");
   std::string payload1("test string1");
   base::Pickle write_pickle1;
   write_pickle1.WriteString(payload1);
 
-  const ui::Clipboard::FormatType kFormat2 =
-      ui::Clipboard::GetFormatType("chromium/x-test-format2");
+  const ui::ClipboardFormatType kFormat2 =
+      ui::ClipboardFormatType::GetType("chromium/x-test-format2");
   std::string payload2("test string2");
   base::Pickle write_pickle2;
   write_pickle2.WriteString(payload2);
@@ -616,7 +617,7 @@
   }
 
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetHtmlFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetHtmlType(), CLIPBOARD_TYPE_COPY_PASTE));
   uint32_t fragment_start;
   uint32_t fragment_end;
   this->clipboard().ReadHTML(CLIPBOARD_TYPE_COPY_PASTE, &html_result,
@@ -634,7 +635,8 @@
   }
 
   EXPECT_TRUE(this->clipboard().IsFormatAvailable(
-      Clipboard::GetWebKitSmartPasteFormatType(), CLIPBOARD_TYPE_COPY_PASTE));
+      ClipboardFormatType::GetWebKitSmartPasteType(),
+      CLIPBOARD_TYPE_COPY_PASTE));
 }
 
 #if defined(OS_WIN)  // Windows only tests.
@@ -755,7 +757,7 @@
 
 TYPED_TEST(ClipboardTest, WritePickledData) {
   ScopedClipboardWriter scw(CLIPBOARD_TYPE_COPY_PASTE);
-  scw.WritePickledData(base::Pickle(), Clipboard::GetPlainTextFormatType());
+  scw.WritePickledData(base::Pickle(), ClipboardFormatType::GetPlainTextType());
 }
 
 TYPED_TEST(ClipboardTest, WriteImageEmptyParams) {
diff --git a/ui/base/clipboard/clipboard_util_mac.h b/ui/base/clipboard/clipboard_util_mac.h
index 29f927c..d230ba82 100644
--- a/ui/base/clipboard/clipboard_util_mac.h
+++ b/ui/base/clipboard/clipboard_util_mac.h
@@ -7,18 +7,18 @@
 
 #import <AppKit/AppKit.h>
 
+#include "base/component_export.h"
 #include "base/mac/scoped_nsobject.h"
 #include "base/memory/ref_counted.h"
 #include "ui/base/clipboard/clipboard_types.h"
-#include "ui/base/ui_base_export.h"
 
 namespace ui {
 
 // A publicly-used UTI for the name of a URL. It really should be in a system
 // header but isn't.
-UI_BASE_EXPORT extern NSString* const kUTTypeURLName;
+COMPONENT_EXPORT(BASE_CLIPBOARD) extern NSString* const kUTTypeURLName;
 
-class UI_BASE_EXPORT UniquePasteboard
+class COMPONENT_EXPORT(BASE_CLIPBOARD) UniquePasteboard
     : public base::RefCounted<UniquePasteboard> {
  public:
   UniquePasteboard();
@@ -31,7 +31,7 @@
   base::scoped_nsobject<NSPasteboard> pasteboard_;
 };
 
-class UI_BASE_EXPORT ClipboardUtil {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardUtil {
  public:
   // Returns an NSPasteboardItem that represents the given |url|.
   // |url| must not be nil.
diff --git a/ui/base/clipboard/clipboard_util_win.cc b/ui/base/clipboard/clipboard_util_win.cc
index d589e1bc..077df5a6 100644
--- a/ui/base/clipboard/clipboard_util_win.cc
+++ b/ui/base/clipboard/clipboard_util_win.cc
@@ -17,7 +17,7 @@
 #include "base/win/scoped_hglobal.h"
 #include "base/win/shlwapi.h"
 #include "net/base/filename_util.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "url/gurl.h"
 
@@ -25,13 +25,13 @@
 
 namespace {
 
-bool HasData(IDataObject* data_object, const Clipboard::FormatType& format) {
+bool HasData(IDataObject* data_object, const ClipboardFormatType& format) {
   FORMATETC format_etc = format.ToFormatEtc();
   return SUCCEEDED(data_object->QueryGetData(&format_etc));
 }
 
 bool GetData(IDataObject* data_object,
-             const Clipboard::FormatType& format,
+             const ClipboardFormatType& format,
              STGMEDIUM* medium) {
   FORMATETC format_etc = format.ToFormatEtc();
   return SUCCEEDED(data_object->GetData(&format_etc, medium));
@@ -44,7 +44,7 @@
 
   bool success = false;
   STGMEDIUM medium;
-  if (!GetData(data_object, Clipboard::GetCFHDropFormatType(), &medium))
+  if (!GetData(data_object, ClipboardFormatType::GetCFHDropType(), &medium))
     return false;
 
   {
@@ -89,34 +89,34 @@
 
 bool ClipboardUtil::HasUrl(IDataObject* data_object, bool convert_filenames) {
   DCHECK(data_object);
-  return HasData(data_object, Clipboard::GetMozUrlFormatType()) ||
-         HasData(data_object, Clipboard::GetUrlWFormatType()) ||
-         HasData(data_object, Clipboard::GetUrlFormatType()) ||
+  return HasData(data_object, ClipboardFormatType::GetMozUrlType()) ||
+         HasData(data_object, ClipboardFormatType::GetUrlWType()) ||
+         HasData(data_object, ClipboardFormatType::GetUrlType()) ||
          (convert_filenames && HasFilenames(data_object));
 }
 
 bool ClipboardUtil::HasFilenames(IDataObject* data_object) {
   DCHECK(data_object);
-  return HasData(data_object, Clipboard::GetCFHDropFormatType()) ||
-         HasData(data_object, Clipboard::GetFilenameWFormatType()) ||
-         HasData(data_object, Clipboard::GetFilenameFormatType());
+  return HasData(data_object, ClipboardFormatType::GetCFHDropType()) ||
+         HasData(data_object, ClipboardFormatType::GetFilenameWType()) ||
+         HasData(data_object, ClipboardFormatType::GetFilenameType());
 }
 
 bool ClipboardUtil::HasFileContents(IDataObject* data_object) {
   DCHECK(data_object);
-  return HasData(data_object, Clipboard::GetFileContentZeroFormatType());
+  return HasData(data_object, ClipboardFormatType::GetFileContentZeroType());
 }
 
 bool ClipboardUtil::HasHtml(IDataObject* data_object) {
   DCHECK(data_object);
-  return HasData(data_object, Clipboard::GetHtmlFormatType()) ||
-         HasData(data_object, Clipboard::GetTextHtmlFormatType());
+  return HasData(data_object, ClipboardFormatType::GetHtmlType()) ||
+         HasData(data_object, ClipboardFormatType::GetTextHtmlType());
 }
 
 bool ClipboardUtil::HasPlainText(IDataObject* data_object) {
   DCHECK(data_object);
-  return HasData(data_object, Clipboard::GetPlainTextWFormatType()) ||
-         HasData(data_object, Clipboard::GetPlainTextFormatType());
+  return HasData(data_object, ClipboardFormatType::GetPlainTextWType()) ||
+         HasData(data_object, ClipboardFormatType::GetPlainTextType());
 }
 
 bool ClipboardUtil::GetUrl(IDataObject* data_object,
@@ -132,8 +132,8 @@
   if (GetUrlFromHDrop(data_object, url, title))
     return true;
 
-  if (GetData(data_object, Clipboard::GetMozUrlFormatType(), &store) ||
-      GetData(data_object, Clipboard::GetUrlWFormatType(), &store)) {
+  if (GetData(data_object, ClipboardFormatType::GetMozUrlType(), &store) ||
+      GetData(data_object, ClipboardFormatType::GetUrlWType(), &store)) {
     {
       // Mozilla URL format or unicode URL
       base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);
@@ -143,7 +143,7 @@
     return url->is_valid();
   }
 
-  if (GetData(data_object, Clipboard::GetUrlFormatType(), &store)) {
+  if (GetData(data_object, ClipboardFormatType::GetUrlType(), &store)) {
     {
       // URL using ascii
       base::win::ScopedHGlobal<char*> data(store.hGlobal);
@@ -172,7 +172,7 @@
     return false;
 
   STGMEDIUM medium;
-  if (GetData(data_object, Clipboard::GetCFHDropFormatType(), &medium)) {
+  if (GetData(data_object, ClipboardFormatType::GetCFHDropType(), &medium)) {
     {
       base::win::ScopedHGlobal<HDROP> hdrop(medium.hGlobal);
       if (!hdrop.get())
@@ -191,7 +191,7 @@
     return !filenames->empty();
   }
 
-  if (GetData(data_object, Clipboard::GetFilenameWFormatType(), &medium)) {
+  if (GetData(data_object, ClipboardFormatType::GetFilenameWType(), &medium)) {
     {
       // filename using unicode
       base::win::ScopedHGlobal<wchar_t*> data(medium.hGlobal);
@@ -202,7 +202,7 @@
     return true;
   }
 
-  if (GetData(data_object, Clipboard::GetFilenameFormatType(), &medium)) {
+  if (GetData(data_object, ClipboardFormatType::GetFilenameType(), &medium)) {
     {
       // filename using ascii
       base::win::ScopedHGlobal<char*> data(medium.hGlobal);
@@ -223,7 +223,7 @@
     return false;
 
   STGMEDIUM store;
-  if (GetData(data_object, Clipboard::GetPlainTextWFormatType(), &store)) {
+  if (GetData(data_object, ClipboardFormatType::GetPlainTextWType(), &store)) {
     {
       // Unicode text
       base::win::ScopedHGlobal<wchar_t*> data(store.hGlobal);
@@ -233,7 +233,7 @@
     return true;
   }
 
-  if (GetData(data_object, Clipboard::GetPlainTextFormatType(), &store)) {
+  if (GetData(data_object, ClipboardFormatType::GetPlainTextType(), &store)) {
     {
       // ascii text
       base::win::ScopedHGlobal<char*> data(store.hGlobal);
@@ -259,8 +259,8 @@
   DCHECK(data_object && html && base_url);
 
   STGMEDIUM store;
-  if (HasData(data_object, Clipboard::GetHtmlFormatType()) &&
-      GetData(data_object, Clipboard::GetHtmlFormatType(), &store)) {
+  if (HasData(data_object, ClipboardFormatType::GetHtmlType()) &&
+      GetData(data_object, ClipboardFormatType::GetHtmlType(), &store)) {
     {
       // MS CF html
       base::win::ScopedHGlobal<char*> data(store.hGlobal);
@@ -273,10 +273,10 @@
     return true;
   }
 
-  if (!HasData(data_object, Clipboard::GetTextHtmlFormatType()))
+  if (!HasData(data_object, ClipboardFormatType::GetTextHtmlType()))
     return false;
 
-  if (!GetData(data_object, Clipboard::GetTextHtmlFormatType(), &store))
+  if (!GetData(data_object, ClipboardFormatType::GetTextHtmlType(), &store))
     return false;
 
   {
@@ -291,15 +291,15 @@
 bool ClipboardUtil::GetFileContents(IDataObject* data_object,
     base::string16* filename, std::string* file_contents) {
   DCHECK(data_object && filename && file_contents);
-  if (!HasData(data_object, Clipboard::GetFileContentZeroFormatType()) &&
-      !HasData(data_object, Clipboard::GetFileDescriptorFormatType()))
+  if (!HasData(data_object, ClipboardFormatType::GetFileContentZeroType()) &&
+      !HasData(data_object, ClipboardFormatType::GetFileDescriptorType()))
     return false;
 
   STGMEDIUM content;
   // The call to GetData can be very slow depending on what is in
   // |data_object|.
-  if (GetData(
-          data_object, Clipboard::GetFileContentZeroFormatType(), &content)) {
+  if (GetData(data_object, ClipboardFormatType::GetFileContentZeroType(),
+              &content)) {
     if (TYMED_HGLOBAL == content.tymed) {
       base::win::ScopedHGlobal<char*> data(content.hGlobal);
       file_contents->assign(data.get(), data.Size());
@@ -308,8 +308,7 @@
   }
 
   STGMEDIUM description;
-  if (GetData(data_object,
-              Clipboard::GetFileDescriptorFormatType(),
+  if (GetData(data_object, ClipboardFormatType::GetFileDescriptorType(),
               &description)) {
     {
       base::win::ScopedHGlobal<FILEGROUPDESCRIPTOR*> fgd(description.hGlobal);
@@ -327,11 +326,12 @@
     std::unordered_map<base::string16, base::string16>* custom_data) {
   DCHECK(data_object && custom_data);
 
-  if (!HasData(data_object, Clipboard::GetWebCustomDataFormatType()))
+  if (!HasData(data_object, ClipboardFormatType::GetWebCustomDataType()))
     return false;
 
   STGMEDIUM store;
-  if (GetData(data_object, Clipboard::GetWebCustomDataFormatType(), &store)) {
+  if (GetData(data_object, ClipboardFormatType::GetWebCustomDataType(),
+              &store)) {
     {
       base::win::ScopedHGlobal<char*> data(store.hGlobal);
       ReadCustomDataIntoMap(data.get(), data.Size(), custom_data);
diff --git a/ui/base/clipboard/clipboard_util_win.h b/ui/base/clipboard/clipboard_util_win.h
index 0a48185..b4d0ae9 100644
--- a/ui/base/clipboard/clipboard_util_win.h
+++ b/ui/base/clipboard/clipboard_util_win.h
@@ -13,14 +13,14 @@
 #include <unordered_map>
 #include <vector>
 
+#include "base/component_export.h"
 #include "base/strings/string16.h"
-#include "ui/base/ui_base_export.h"
 
 class GURL;
 
 namespace ui {
 
-class UI_BASE_EXPORT ClipboardUtil {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardUtil {
  public:
   /////////////////////////////////////////////////////////////////////////////
   // These methods check to see if |data_object| has the requested type.
@@ -72,7 +72,6 @@
                                     size_t* fragment_start,
                                     size_t* fragment_end);
 };
-
 }
 
 #endif  // UI_BASE_CLIPBOARD_CLIPBOARD_UTIL_WIN_H_
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 1857bfa0..49654c9 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -28,6 +28,7 @@
 #include "skia/ext/skia_utils_base.h"
 #include "skia/ext/skia_utils_win.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_util_win.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #include "ui/gfx/canvas.h"
@@ -220,201 +221,6 @@
 
 }  // namespace
 
-// Clipboard::FormatType implementation.
-Clipboard::FormatType::FormatType() : data_() {}
-
-Clipboard::FormatType::FormatType(UINT native_format) : data_() {
-  // There's no good way to actually initialize this in the constructor in
-  // C++03.
-  data_.cfFormat = static_cast<CLIPFORMAT>(native_format);
-  data_.dwAspect = DVASPECT_CONTENT;
-  data_.lindex = -1;
-  data_.tymed = TYMED_HGLOBAL;
-}
-
-Clipboard::FormatType::FormatType(UINT native_format, LONG index) : data_() {
-  // There's no good way to actually initialize this in the constructor in
-  // C++03.
-  data_.cfFormat = static_cast<CLIPFORMAT>(native_format);
-  data_.dwAspect = DVASPECT_CONTENT;
-  data_.lindex = index;
-  data_.tymed = TYMED_HGLOBAL;
-}
-
-Clipboard::FormatType::~FormatType() {
-}
-
-std::string Clipboard::FormatType::Serialize() const {
-  return base::IntToString(data_.cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::FormatType::Deserialize(
-    const std::string& serialization) {
-  int clipboard_format = -1;
-  if (!base::StringToInt(serialization, &clipboard_format)) {
-    NOTREACHED();
-    return FormatType();
-  }
-  return FormatType(clipboard_format);
-}
-
-bool Clipboard::FormatType::operator<(const FormatType& other) const {
-  return data_.cfFormat < other.data_.cfFormat;
-}
-
-bool Clipboard::FormatType::Equals(const FormatType& other) const {
-  return data_.cfFormat == other.data_.cfFormat;
-}
-
-// Various predefined FormatTypes.
-// static
-Clipboard::FormatType Clipboard::GetFormatType(
-    const std::string& format_string) {
-  return FormatType(
-      ::RegisterClipboardFormat(base::ASCIIToUTF16(format_string).c_str()));
-}
-
-// The following formats can be referenced by ClipboardUtilWin::GetPlainText.
-// For reasons (COM), they must be initialized in a thread-safe manner.
-// TODO(dcheng): We probably need to make static initialization of "known"
-// FormatTypes thread-safe on all platforms.
-#define CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(name, ...) \
-  struct FormatTypeArgumentForwarder : public FormatType { \
-    FormatTypeArgumentForwarder() : FormatType(__VA_ARGS__) { } \
-  }; \
-  static base::LazyInstance<FormatTypeArgumentForwarder>::Leaky name = \
-      LAZY_INSTANCE_INITIALIZER
-// static
-const Clipboard::FormatType& Clipboard::GetUrlFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-    type, ::RegisterClipboardFormat(CFSTR_INETURLA));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_INETURLW));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetMozUrlFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(L"text/x-moz-url"));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_TEXT);
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_UNICODETEXT);
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_FILENAMEA));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFilenameWFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_FILENAMEW));
-  return type.Get();
-}
-
-// MS HTML Format
-// static
-const Clipboard::FormatType& Clipboard::GetHtmlFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(L"HTML Format"));
-  return type.Get();
-}
-
-// MS RTF Format
-// static
-const Clipboard::FormatType& Clipboard::GetRtfFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(L"Rich Text Format"));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetBitmapFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_BITMAP);
-  return type.Get();
-}
-
-// Firefox text/html
-// static
-const Clipboard::FormatType& Clipboard::GetTextHtmlFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(L"text/html"));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetCFHDropFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(type, CF_HDROP);
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFileDescriptorFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetFileContentZeroFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_FILECONTENTS), 0);
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetIDListFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type, ::RegisterClipboardFormat(CFSTR_SHELLIDLIST));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type,
-      ::RegisterClipboardFormat(L"WebKit Smart Paste Format"));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
-  // TODO(dcheng): This name is temporary. See http://crbug.com/106449.
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type,
-      ::RegisterClipboardFormat(L"Chromium Web Custom MIME Data Format"));
-  return type.Get();
-}
-
-// static
-const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
-  CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE(
-      type,
-      ::RegisterClipboardFormat(L"Chromium Pepper MIME Data Format"));
-  return type.Get();
-}
-#undef CR_STATIC_UI_CLIPBOARD_FORMAT_TYPE
-
 // Clipboard factory method.
 // static
 Clipboard* Clipboard::Create() {
@@ -437,7 +243,7 @@
   return ::GetClipboardSequenceNumber();
 }
 
-bool ClipboardWin::IsFormatAvailable(const Clipboard::FormatType& format,
+bool ClipboardWin::IsFormatAvailable(const ClipboardFormatType& format,
                                      ClipboardType type) const {
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
   return ::IsClipboardFormatAvailable(format.ToFormatEtc().cfFormat) != FALSE;
@@ -462,11 +268,13 @@
 
   types->clear();
   if (::IsClipboardFormatAvailable(
-          GetPlainTextFormatType().ToFormatEtc().cfFormat))
+          ClipboardFormatType::GetPlainTextType().ToFormatEtc().cfFormat))
     types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (::IsClipboardFormatAvailable(GetHtmlFormatType().ToFormatEtc().cfFormat))
+  if (::IsClipboardFormatAvailable(
+          ClipboardFormatType::GetHtmlType().ToFormatEtc().cfFormat))
     types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
-  if (::IsClipboardFormatAvailable(GetRtfFormatType().ToFormatEtc().cfFormat))
+  if (::IsClipboardFormatAvailable(
+          ClipboardFormatType::GetRtfType().ToFormatEtc().cfFormat))
     types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
   if (::IsClipboardFormatAvailable(CF_DIB))
     types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
@@ -477,8 +285,8 @@
   if (!clipboard.Acquire(GetClipboardWindow()))
     return;
 
-  HANDLE hdata =
-      ::GetClipboardData(GetWebCustomDataFormatType().ToFormatEtc().cfFormat);
+  HANDLE hdata = ::GetClipboardData(
+      ClipboardFormatType::GetWebCustomDataType().ToFormatEtc().cfFormat);
   if (!hdata)
     return;
 
@@ -555,7 +363,8 @@
   if (!clipboard.Acquire(GetClipboardWindow()))
     return;
 
-  HANDLE data = ::GetClipboardData(GetHtmlFormatType().ToFormatEtc().cfFormat);
+  HANDLE data = ::GetClipboardData(
+      ClipboardFormatType::GetHtmlType().ToFormatEtc().cfFormat);
   if (!data)
     return;
 
@@ -594,7 +403,7 @@
 void ClipboardWin::ReadRTF(ClipboardType type, std::string* result) const {
   DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
 
-  ReadData(GetRtfFormatType(), result);
+  ReadData(ClipboardFormatType::GetRtfType(), result);
   TrimAfterNull(result);
 }
 
@@ -690,8 +499,8 @@
   if (!clipboard.Acquire(GetClipboardWindow()))
     return;
 
-  HANDLE hdata =
-      ::GetClipboardData(GetWebCustomDataFormatType().ToFormatEtc().cfFormat);
+  HANDLE hdata = ::GetClipboardData(
+      ClipboardFormatType::GetWebCustomDataType().ToFormatEtc().cfFormat);
   if (!hdata)
     return;
 
@@ -711,7 +520,8 @@
   if (!clipboard.Acquire(GetClipboardWindow()))
     return;
 
-  HANDLE data = ::GetClipboardData(GetUrlWFormatType().ToFormatEtc().cfFormat);
+  HANDLE data = ::GetClipboardData(
+      ClipboardFormatType::GetUrlWType().ToFormatEtc().cfFormat);
   if (!data)
     return;
 
@@ -723,7 +533,7 @@
   ParseBookmarkClipboardFormat(bookmark, title, url);
 }
 
-void ClipboardWin::ReadData(const FormatType& format,
+void ClipboardWin::ReadData(const ClipboardFormatType& format,
                             std::string* result) const {
   if (!result) {
     NOTREACHED();
@@ -779,11 +589,12 @@
   std::string html_fragment = ClipboardUtil::HtmlToCFHtml(markup, url);
   HGLOBAL glob = CreateGlobalData(html_fragment);
 
-  WriteToClipboard(Clipboard::GetHtmlFormatType().ToFormatEtc().cfFormat, glob);
+  WriteToClipboard(ClipboardFormatType::GetHtmlType().ToFormatEtc().cfFormat,
+                   glob);
 }
 
 void ClipboardWin::WriteRTF(const char* rtf_data, size_t data_len) {
-  WriteData(GetRtfFormatType(), rtf_data, data_len);
+  WriteData(ClipboardFormatType::GetRtfType(), rtf_data, data_len);
 }
 
 void ClipboardWin::WriteBookmark(const char* title_data,
@@ -797,13 +608,15 @@
   base::string16 wide_bookmark = base::UTF8ToUTF16(bookmark);
   HGLOBAL glob = CreateGlobalData(wide_bookmark);
 
-  WriteToClipboard(GetUrlWFormatType().ToFormatEtc().cfFormat, glob);
+  WriteToClipboard(ClipboardFormatType::GetUrlWType().ToFormatEtc().cfFormat,
+                   glob);
 }
 
 void ClipboardWin::WriteWebSmartPaste() {
   DCHECK(clipboard_owner_->hwnd() != NULL);
-  ::SetClipboardData(GetWebKitSmartPasteFormatType().ToFormatEtc().cfFormat,
-                     NULL);
+  ::SetClipboardData(
+      ClipboardFormatType::GetWebKitSmartPasteType().ToFormatEtc().cfFormat,
+      NULL);
 }
 
 void ClipboardWin::WriteBitmap(const SkBitmap& in_bitmap) {
@@ -849,7 +662,7 @@
   ::ReleaseDC(NULL, dc);
 }
 
-void ClipboardWin::WriteData(const FormatType& format,
+void ClipboardWin::WriteData(const ClipboardFormatType& format,
                              const char* data_data,
                              size_t data_len) {
   HGLOBAL hdata = ::GlobalAlloc(GMEM_MOVEABLE, data_len);
diff --git a/ui/base/clipboard/clipboard_win.h b/ui/base/clipboard/clipboard_win.h
index 54e34d7..68e3ce8 100644
--- a/ui/base/clipboard/clipboard_win.h
+++ b/ui/base/clipboard/clipboard_win.h
@@ -35,7 +35,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -54,7 +54,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -68,7 +69,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/clipboard/custom_data_helper.h b/ui/base/clipboard/custom_data_helper.h
index 6da8234..7d980f0 100644
--- a/ui/base/clipboard/custom_data_helper.h
+++ b/ui/base/clipboard/custom_data_helper.h
@@ -15,46 +15,39 @@
 #include <unordered_map>
 #include <vector>
 
+#include "base/component_export.h"
 #include "base/containers/flat_map.h"
 #include "base/strings/string16.h"
 #include "build/build_config.h"
-#include "ui/base/ui_base_export.h"
 
 namespace base {
 class Pickle;
 }
 
-#if defined(OS_MACOSX)
-#ifdef __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
-#endif  // defined(OS_MACOSX)
-
 namespace ui {
 
-#if defined(OS_MACOSX) && !defined(USE_AURA)
-UI_BASE_EXPORT extern NSString* const kWebCustomDataPboardType;
-#endif
-
-UI_BASE_EXPORT void ReadCustomDataTypes(const void* data,
-                                        size_t data_length,
-                                        std::vector<base::string16>* types);
-UI_BASE_EXPORT void ReadCustomDataForType(const void* data,
-                                          size_t data_length,
-                                          const base::string16& type,
-                                          base::string16* result);
-UI_BASE_EXPORT void ReadCustomDataIntoMap(
+COMPONENT_EXPORT(BASE_CLIPBOARD)
+void ReadCustomDataTypes(const void* data,
+                         size_t data_length,
+                         std::vector<base::string16>* types);
+COMPONENT_EXPORT(BASE_CLIPBOARD)
+void ReadCustomDataForType(const void* data,
+                           size_t data_length,
+                           const base::string16& type,
+                           base::string16* result);
+COMPONENT_EXPORT(BASE_CLIPBOARD)
+void ReadCustomDataIntoMap(
     const void* data,
     size_t data_length,
     std::unordered_map<base::string16, base::string16>* result);
 
-UI_BASE_EXPORT void WriteCustomDataToPickle(
+COMPONENT_EXPORT(BASE_CLIPBOARD)
+void WriteCustomDataToPickle(
     const std::unordered_map<base::string16, base::string16>& data,
     base::Pickle* pickle);
 
-UI_BASE_EXPORT void WriteCustomDataToPickle(
+COMPONENT_EXPORT(BASE_CLIPBOARD)
+void WriteCustomDataToPickle(
     const base::flat_map<base::string16, base::string16>& data,
     base::Pickle* pickle);
 
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
index 3932401f..a2590645 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -11,6 +11,7 @@
 #include "base/pickle.h"
 #include "base/strings/utf_string_conversions.h"
 #include "net/base/escape.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/gfx/geometry/size.h"
 
 namespace ui {
@@ -107,7 +108,7 @@
 
 void ScopedClipboardWriter::WritePickledData(
     const base::Pickle& pickle,
-    const Clipboard::FormatType& format) {
+    const ClipboardFormatType& format) {
   std::string format_string = format.Serialize();
   Clipboard::ObjectMapParam format_parameter(format_string.begin(),
                                              format_string.end());
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
index 385900e..084d5fe1 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.h
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
@@ -13,11 +13,11 @@
 
 #include <string>
 
+#include "base/component_export.h"
 #include "base/macros.h"
 #include "base/strings/string16.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/clipboard/clipboard.h"
-#include "ui/base/ui_base_export.h"
 
 namespace base {
 class Pickle;
@@ -27,7 +27,7 @@
 
 // This class is a wrapper for |Clipboard| that handles packing data
 // into a Clipboard::ObjectMap.
-class UI_BASE_EXPORT ScopedClipboardWriter {
+class COMPONENT_EXPORT(BASE_CLIPBOARD) ScopedClipboardWriter {
  public:
   // Create an instance that is a simple wrapper around the clipboard of the
   // given type.
@@ -59,7 +59,7 @@
 
   // Adds arbitrary pickled data to clipboard.
   void WritePickledData(const base::Pickle& pickle,
-                        const Clipboard::FormatType& format);
+                        const ClipboardFormatType& format);
 
   // Adds custom data to clipboard.
   void WriteData(const std::string& type, const std::string& data);
diff --git a/ui/base/test/test_clipboard.cc b/ui/base/clipboard/test/test_clipboard.cc
similarity index 78%
rename from ui/base/test/test_clipboard.cc
rename to ui/base/clipboard/test/test_clipboard.cc
index eaf9d066..09c74bb4 100644
--- a/ui/base/test/test_clipboard.cc
+++ b/ui/base/clipboard/test/test_clipboard.cc
@@ -2,23 +2,22 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 
 #include <stddef.h>
 #include "base/memory/ptr_util.h"
 #include "base/numerics/safe_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "skia/ext/skia_utils_base.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/clipboard/clipboard_monitor.h"
 
 namespace ui {
 
 TestClipboard::TestClipboard()
-    : default_store_type_(CLIPBOARD_TYPE_COPY_PASTE) {
-}
+    : default_store_type_(CLIPBOARD_TYPE_COPY_PASTE) {}
 
-TestClipboard::~TestClipboard() {
-}
+TestClipboard::~TestClipboard() {}
 
 Clipboard* TestClipboard::CreateForCurrentThread() {
   base::AutoLock lock(Clipboard::clipboard_map_lock_.Get());
@@ -38,7 +37,7 @@
   return GetStore(type).sequence_number;
 }
 
-bool TestClipboard::IsFormatAvailable(const FormatType& format,
+bool TestClipboard::IsFormatAvailable(const ClipboardFormatType& format,
                                       ClipboardType type) const {
   const DataStore& store = GetStore(type);
   return store.data.find(format) != store.data.end();
@@ -53,14 +52,14 @@
                                        bool* contains_filenames) const {
   types->clear();
 
-  if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetPlainTextType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeText));
-  if (IsFormatAvailable(Clipboard::GetHtmlFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetHtmlType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeHTML));
 
-  if (IsFormatAvailable(Clipboard::GetRtfFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetRtfType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypeRTF));
-  if (IsFormatAvailable(Clipboard::GetBitmapFormatType(), type))
+  if (IsFormatAvailable(ClipboardFormatType::GetBitmapType(), type))
     types->push_back(base::UTF8ToUTF16(kMimeTypePNG));
 
   *contains_filenames = false;
@@ -76,7 +75,7 @@
                                   std::string* result) const {
   result->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetPlainTextFormatType());
+  auto it = store.data.find(ClipboardFormatType::GetPlainTextType());
   if (it != store.data.end())
     *result = it->second;
 }
@@ -89,7 +88,7 @@
   markup->clear();
   src_url->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetHtmlFormatType());
+  auto it = store.data.find(ClipboardFormatType::GetHtmlType());
   if (it != store.data.end())
     *markup = base::UTF8ToUTF16(it->second);
   *src_url = store.html_src_url;
@@ -100,7 +99,7 @@
 void TestClipboard::ReadRTF(ClipboardType type, std::string* result) const {
   result->clear();
   const DataStore& store = GetStore(type);
-  auto it = store.data.find(GetRtfFormatType());
+  auto it = store.data.find(ClipboardFormatType::GetRtfType());
   if (it != store.data.end())
     *result = it->second;
 }
@@ -111,19 +110,18 @@
 
 void TestClipboard::ReadCustomData(ClipboardType clipboard_type,
                                    const base::string16& type,
-                                   base::string16* result) const {
-}
+                                   base::string16* result) const {}
 
 void TestClipboard::ReadBookmark(base::string16* title,
                                  std::string* url) const {
   const DataStore& store = GetDefaultStore();
-  auto it = store.data.find(GetUrlWFormatType());
+  auto it = store.data.find(ClipboardFormatType::GetUrlWType());
   if (it != store.data.end())
     *url = it->second;
   *title = base::UTF8ToUTF16(store.url_title);
 }
 
-void TestClipboard::ReadData(const FormatType& format,
+void TestClipboard::ReadData(const ClipboardFormatType& format,
                              std::string* result) const {
   result->clear();
   const DataStore& store = GetDefaultStore();
@@ -150,11 +148,12 @@
 
 void TestClipboard::WriteText(const char* text_data, size_t text_len) {
   std::string text(text_data, text_len);
-  GetDefaultStore().data[GetPlainTextFormatType()] = text;
+  GetDefaultStore().data[ClipboardFormatType::GetPlainTextType()] = text;
   // Create a dummy entry.
-  GetDefaultStore().data[GetPlainTextWFormatType()];
+  GetDefaultStore().data[ClipboardFormatType::GetPlainTextWType()];
   if (IsSupportedClipboardType(CLIPBOARD_TYPE_SELECTION))
-    GetStore(CLIPBOARD_TYPE_SELECTION).data[GetPlainTextFormatType()] = text;
+    GetStore(CLIPBOARD_TYPE_SELECTION)
+        .data[ClipboardFormatType::GetPlainTextType()] = text;
   ui::ClipboardMonitor::GetInstance()->NotifyClipboardDataChanged();
 }
 
@@ -164,31 +163,33 @@
                               size_t url_len) {
   base::string16 markup;
   base::UTF8ToUTF16(markup_data, markup_len, &markup);
-  GetDefaultStore().data[GetHtmlFormatType()] = base::UTF16ToUTF8(markup);
+  GetDefaultStore().data[ClipboardFormatType::GetHtmlType()] =
+      base::UTF16ToUTF8(markup);
   GetDefaultStore().html_src_url = std::string(url_data, url_len);
 }
 
 void TestClipboard::WriteRTF(const char* rtf_data, size_t data_len) {
-  GetDefaultStore().data[GetRtfFormatType()] = std::string(rtf_data, data_len);
+  GetDefaultStore().data[ClipboardFormatType::GetRtfType()] =
+      std::string(rtf_data, data_len);
 }
 
 void TestClipboard::WriteBookmark(const char* title_data,
                                   size_t title_len,
                                   const char* url_data,
                                   size_t url_len) {
-  GetDefaultStore().data[GetUrlWFormatType()] = std::string(url_data, url_len);
+  GetDefaultStore().data[ClipboardFormatType::GetUrlWType()] =
+      std::string(url_data, url_len);
   GetDefaultStore().url_title = std::string(title_data, title_len);
 }
 
 void TestClipboard::WriteWebSmartPaste() {
   // Create a dummy entry.
-  GetDefaultStore().data[GetWebKitSmartPasteFormatType()];
+  GetDefaultStore().data[ClipboardFormatType::GetWebKitSmartPasteType()];
 }
 
 void TestClipboard::WriteBitmap(const SkBitmap& bitmap) {
   // Create a dummy entry.
-  GetDefaultStore().data[GetBitmapFormatType()];
-
+  GetDefaultStore().data[ClipboardFormatType::GetBitmapType()];
   SkBitmap& dst = GetDefaultStore().image;
   // Either points bitmap at in_bitmap, or allocates and converts pixels.
   if (!skia::SkBitmapToN32OpaqueOrPremul(bitmap, &dst)) {
@@ -197,19 +198,17 @@
   }
 }
 
-void TestClipboard::WriteData(const FormatType& format,
+void TestClipboard::WriteData(const ClipboardFormatType& format,
                               const char* data_data,
                               size_t data_len) {
   GetDefaultStore().data[format] = std::string(data_data, data_len);
 }
 
-TestClipboard::DataStore::DataStore() : sequence_number(0) {
-}
+TestClipboard::DataStore::DataStore() : sequence_number(0) {}
 
 TestClipboard::DataStore::DataStore(const DataStore& other) = default;
 
-TestClipboard::DataStore::~DataStore() {
-}
+TestClipboard::DataStore::~DataStore() {}
 
 void TestClipboard::DataStore::Clear() {
   data.clear();
diff --git a/ui/base/test/test_clipboard.h b/ui/base/clipboard/test/test_clipboard.h
similarity index 89%
rename from ui/base/test/test_clipboard.h
rename to ui/base/clipboard/test/test_clipboard.h
index ae1c3cb..9da9ac9 100644
--- a/ui/base/test/test_clipboard.h
+++ b/ui/base/clipboard/test/test_clipboard.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef UI_BASE_TEST_TEST_CLIPBOARD_H_
-#define UI_BASE_TEST_TEST_CLIPBOARD_H_
+#ifndef UI_BASE_CLIPBOARD_TEST_TEST_CLIPBOARD_H_
+#define UI_BASE_CLIPBOARD_TEST_TEST_CLIPBOARD_H_
 
 #include <stddef.h>
 #include <stdint.h>
@@ -34,7 +34,7 @@
   // Clipboard overrides.
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -53,7 +53,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   base::Time GetLastModifiedTime() const override;
   void ClearLastModifiedTime() override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
@@ -69,7 +70,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
@@ -80,7 +81,7 @@
     ~DataStore();
     void Clear();
     uint64_t sequence_number;
-    base::flat_map<FormatType, std::string> data;
+    base::flat_map<ClipboardFormatType, std::string> data;
     std::string url_title;
     std::string html_src_url;
     SkBitmap image;
@@ -101,4 +102,4 @@
 
 }  // namespace ui
 
-#endif  // UI_BASE_TEST_TEST_CLIPBOARD_H_
+#endif  // UI_BASE_CLIPBOARD_TEST_TEST_CLIPBOARD_H_
diff --git a/ui/base/test/test_clipboard_unittest.cc b/ui/base/clipboard/test/test_clipboard_unittest.cc
similarity index 96%
rename from ui/base/test/test_clipboard_unittest.cc
rename to ui/base/clipboard/test/test_clipboard_unittest.cc
index 57f39f7..021a85c 100644
--- a/ui/base/test/test_clipboard_unittest.cc
+++ b/ui/base/clipboard/test/test_clipboard_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "ui/base/test/test_clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 
 #include "base/test/scoped_task_environment.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ui/base/dragdrop/os_exchange_data.cc b/ui/base/dragdrop/os_exchange_data.cc
index bae9df1a..11cf7db 100644
--- a/ui/base/dragdrop/os_exchange_data.cc
+++ b/ui/base/dragdrop/os_exchange_data.cc
@@ -6,6 +6,7 @@
 
 #include "base/pickle.h"
 #include "build/build_config.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
 #include "url/gurl.h"
 
@@ -56,7 +57,7 @@
   provider_->SetFilenames(filenames);
 }
 
-void OSExchangeData::SetPickledData(const Clipboard::FormatType& format,
+void OSExchangeData::SetPickledData(const ClipboardFormatType& format,
                                     const base::Pickle& data) {
   provider_->SetPickledData(format, data);
 }
@@ -79,7 +80,7 @@
   return provider_->GetFilenames(filenames);
 }
 
-bool OSExchangeData::GetPickledData(const Clipboard::FormatType& format,
+bool OSExchangeData::GetPickledData(const ClipboardFormatType& format,
                                     base::Pickle* data) const {
   return provider_->GetPickledData(format, data);
 }
@@ -96,14 +97,13 @@
   return provider_->HasFile();
 }
 
-bool OSExchangeData::HasCustomFormat(
-    const Clipboard::FormatType& format) const {
+bool OSExchangeData::HasCustomFormat(const ClipboardFormatType& format) const {
   return provider_->HasCustomFormat(format);
 }
 
 bool OSExchangeData::HasAnyFormat(
     int formats,
-    const std::set<Clipboard::FormatType>& format_types) const {
+    const std::set<ClipboardFormatType>& format_types) const {
   if ((formats & STRING) != 0 && HasString())
     return true;
   if ((formats & URL) != 0 && HasURL(CONVERT_FILENAMES))
diff --git a/ui/base/dragdrop/os_exchange_data.h b/ui/base/dragdrop/os_exchange_data.h
index 3bb6fef..cd91515 100644
--- a/ui/base/dragdrop/os_exchange_data.h
+++ b/ui/base/dragdrop/os_exchange_data.h
@@ -17,7 +17,6 @@
 
 #include "base/files/file_path.h"
 #include "base/macros.h"
-#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/dragdrop/download_file_interface.h"
 #include "ui/base/ui_base_export.h"
 
@@ -34,6 +33,7 @@
 
 namespace ui {
 
+struct ClipboardFormatType;
 struct FileInfo;
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -96,7 +96,7 @@
     virtual void SetURL(const GURL& url, const base::string16& title) = 0;
     virtual void SetFilename(const base::FilePath& path) = 0;
     virtual void SetFilenames(const std::vector<FileInfo>& file_names) = 0;
-    virtual void SetPickledData(const Clipboard::FormatType& format,
+    virtual void SetPickledData(const ClipboardFormatType& format,
                                 const base::Pickle& data) = 0;
 
     virtual bool GetString(base::string16* data) const = 0;
@@ -105,13 +105,13 @@
                                 base::string16* title) const = 0;
     virtual bool GetFilename(base::FilePath* path) const = 0;
     virtual bool GetFilenames(std::vector<FileInfo>* file_names) const = 0;
-    virtual bool GetPickledData(const Clipboard::FormatType& format,
+    virtual bool GetPickledData(const ClipboardFormatType& format,
                                 base::Pickle* data) const = 0;
 
     virtual bool HasString() const = 0;
     virtual bool HasURL(FilenameToURLPolicy policy) const = 0;
     virtual bool HasFile() const = 0;
-    virtual bool HasCustomFormat(const Clipboard::FormatType& format) const = 0;
+    virtual bool HasCustomFormat(const ClipboardFormatType& format) const = 0;
 
 #if defined(USE_X11) || defined(OS_WIN)
     virtual void SetFileContents(const base::FilePath& filename,
@@ -174,7 +174,7 @@
   void SetFilenames(
       const std::vector<FileInfo>& file_names);
   // Adds pickled data of the specified format.
-  void SetPickledData(const Clipboard::FormatType& format,
+  void SetPickledData(const ClipboardFormatType& format,
                       const base::Pickle& data);
 
   // These functions retrieve data of the specified type. If data exists, the
@@ -190,7 +190,7 @@
   // Return the path of a file, if available.
   bool GetFilename(base::FilePath* path) const;
   bool GetFilenames(std::vector<FileInfo>* file_names) const;
-  bool GetPickledData(const Clipboard::FormatType& format,
+  bool GetPickledData(const ClipboardFormatType& format,
                       base::Pickle* data) const;
 
   // Test whether or not data of certain types is present, without actually
@@ -198,12 +198,12 @@
   bool HasString() const;
   bool HasURL(FilenameToURLPolicy policy) const;
   bool HasFile() const;
-  bool HasCustomFormat(const Clipboard::FormatType& format) const;
+  bool HasCustomFormat(const ClipboardFormatType& format) const;
 
   // Returns true if this OSExchangeData has data in any of the formats in
   // |formats| or any custom format in |custom_formats|.
   bool HasAnyFormat(int formats,
-                    const std::set<Clipboard::FormatType>& types) const;
+                    const std::set<ClipboardFormatType>& types) const;
 
 #if defined(OS_WIN)
   // Adds the bytes of a file (CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR on
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.cc b/ui/base/dragdrop/os_exchange_data_provider_aura.cc
index 200d0c8..40dbe89 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aura.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_aura.cc
@@ -8,8 +8,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "net/base/filename_util.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/clipboard/scoped_clipboard_writer.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/file_info.h"
 
 namespace ui {
@@ -75,7 +74,7 @@
 }
 
 void OSExchangeDataProviderAura::SetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     const base::Pickle& data) {
   pickle_data_[format] = data;
   formats_ |= OSExchangeData::PICKLED_DATA;
@@ -123,7 +122,7 @@
 }
 
 bool OSExchangeDataProviderAura::GetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     base::Pickle* data) const {
   PickleData::const_iterator i = pickle_data_.find(format);
   if (i == pickle_data_.end())
@@ -152,7 +151,7 @@
 }
 
 bool OSExchangeDataProviderAura::HasCustomFormat(
-    const Clipboard::FormatType& format) const {
+    const ClipboardFormatType& format) const {
   return pickle_data_.find(format) != pickle_data_.end();
 }
 
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.h b/ui/base/dragdrop/os_exchange_data_provider_aura.h
index fe752434..2b7cd149 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aura.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_aura.h
@@ -17,7 +17,7 @@
 
 namespace ui {
 
-class Clipboard;
+struct ClipboardFormatType;
 
 // OSExchangeData::Provider implementation for aura on linux.
 class UI_BASE_EXPORT OSExchangeDataProviderAura
@@ -34,7 +34,7 @@
   void SetURL(const GURL& url, const base::string16& title) override;
   void SetFilename(const base::FilePath& path) override;
   void SetFilenames(const std::vector<FileInfo>& filenames) override;
-  void SetPickledData(const Clipboard::FormatType& format,
+  void SetPickledData(const ClipboardFormatType& format,
                       const base::Pickle& data) override;
   bool GetString(base::string16* data) const override;
   bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
@@ -42,13 +42,12 @@
                       base::string16* title) const override;
   bool GetFilename(base::FilePath* path) const override;
   bool GetFilenames(std::vector<FileInfo>* filenames) const override;
-  bool GetPickledData(const Clipboard::FormatType& format,
+  bool GetPickledData(const ClipboardFormatType& format,
                       base::Pickle* data) const override;
   bool HasString() const override;
   bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override;
   bool HasFile() const override;
-  bool HasCustomFormat(const Clipboard::FormatType& format) const
-      override;
+  bool HasCustomFormat(const ClipboardFormatType& format) const override;
 
   void SetHtml(const base::string16& html, const GURL& base_url) override;
   bool GetHtml(base::string16* html, GURL* base_url) const override;
@@ -59,7 +58,7 @@
   gfx::Vector2d GetDragImageOffset() const override;
 
  private:
-  typedef std::map<Clipboard::FormatType, base::Pickle> PickleData;
+  typedef std::map<ClipboardFormatType, base::Pickle> PickleData;
 
   // Returns true if |formats_| contains a file format and the file name can be
   // parsed as a URL.
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
index 144c8ba..c923010 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc
@@ -12,8 +12,8 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "net/base/filename_util.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/clipboard/scoped_clipboard_writer.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/x/selection_utils.h"
 #include "ui/events/platform/platform_event_source.h"
@@ -117,7 +117,7 @@
   scoped_refptr<base::RefCountedMemory> mem(
       base::RefCountedString::TakeString(&utf8));
 
-  format_map_.Insert(gfx::GetAtom(Clipboard::kMimeTypeText), mem);
+  format_map_.Insert(gfx::GetAtom(kMimeTypeText), mem);
   format_map_.Insert(gfx::GetAtom(kText), mem);
   format_map_.Insert(gfx::GetAtom(kString), mem);
   format_map_.Insert(gfx::GetAtom(kUtf8String), mem);
@@ -138,7 +138,7 @@
     scoped_refptr<base::RefCountedMemory> mem(
         base::RefCountedBytes::TakeVector(&data));
 
-    format_map_.Insert(gfx::GetAtom(Clipboard::kMimeTypeMozillaURL), mem);
+    format_map_.Insert(gfx::GetAtom(kMimeTypeMozillaURL), mem);
 
     // Set a string fallback as well.
     SetString(spec);
@@ -182,11 +182,11 @@
   std::string joined_data = base::JoinString(paths, "\n");
   scoped_refptr<base::RefCountedMemory> mem(
       base::RefCountedString::TakeString(&joined_data));
-  format_map_.Insert(gfx::GetAtom(Clipboard::kMimeTypeURIList), mem);
+  format_map_.Insert(gfx::GetAtom(kMimeTypeURIList), mem);
 }
 
 void OSExchangeDataProviderAuraX11::SetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     const base::Pickle& pickle) {
   const unsigned char* data =
       reinterpret_cast<const unsigned char*>(pickle.data());
@@ -235,7 +235,7 @@
     // but that doesn't match the assumptions of the rest of the system which
     // expect single types.
 
-    if (data.GetType() == gfx::GetAtom(Clipboard::kMimeTypeMozillaURL)) {
+    if (data.GetType() == gfx::GetAtom(kMimeTypeMozillaURL)) {
       // Mozilla URLs are (UTF16: URL, newline, title).
       base::string16 unparsed;
       data.AssignTo(&unparsed);
@@ -252,7 +252,7 @@
         *url = GURL(tokens[0]);
         return true;
       }
-    } else if (data.GetType() == gfx::GetAtom(Clipboard::kMimeTypeURIList)) {
+    } else if (data.GetType() == gfx::GetAtom(kMimeTypeURIList)) {
       std::vector<std::string> tokens = ui::ParseURIList(data);
       for (const std::string& token : tokens) {
         GURL test_url(token);
@@ -302,7 +302,7 @@
 }
 
 bool OSExchangeDataProviderAuraX11::GetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     base::Pickle* pickle) const {
   std::vector< ::Atom> requested_types;
   requested_types.push_back(gfx::GetAtom(format.ToString().c_str()));
@@ -339,11 +339,10 @@
   // Windows does and stuffs all the data into one mime type.
   ui::SelectionData data(format_map_.GetFirstOf(requested_types));
   if (data.IsValid()) {
-    if (data.GetType() == gfx::GetAtom(Clipboard::kMimeTypeMozillaURL)) {
+    if (data.GetType() == gfx::GetAtom(kMimeTypeMozillaURL)) {
       // File managers shouldn't be using this type, so this is a URL.
       return true;
-    } else if (data.GetType() ==
-               gfx::GetAtom(ui::Clipboard::kMimeTypeURIList)) {
+    } else if (data.GetType() == gfx::GetAtom(ui::kMimeTypeURIList)) {
       std::vector<std::string> tokens = ui::ParseURIList(data);
       for (const std::string& token : tokens) {
         if (!GURL(token).SchemeIsFile() ||
@@ -384,7 +383,7 @@
 }
 
 bool OSExchangeDataProviderAuraX11::HasCustomFormat(
-    const Clipboard::FormatType& format) const {
+    const ClipboardFormatType& format) const {
   std::vector< ::Atom> url_atoms;
   url_atoms.push_back(gfx::GetAtom(format.ToString().c_str()));
   std::vector< ::Atom> requested_types;
@@ -398,7 +397,7 @@
     const std::string& file_contents) {
   DCHECK(!filename.empty());
   DCHECK(format_map_.end() ==
-         format_map_.find(gfx::GetAtom(Clipboard::kMimeTypeMozillaURL)));
+         format_map_.find(gfx::GetAtom(kMimeTypeMozillaURL)));
 
   file_contents_name_ = filename;
 
@@ -439,13 +438,13 @@
   scoped_refptr<base::RefCountedMemory> mem(
       base::RefCountedBytes::TakeVector(&bytes));
 
-  format_map_.Insert(gfx::GetAtom(Clipboard::kMimeTypeHTML), mem);
+  format_map_.Insert(gfx::GetAtom(kMimeTypeHTML), mem);
 }
 
 bool OSExchangeDataProviderAuraX11::GetHtml(base::string16* html,
                                             GURL* base_url) const {
   std::vector< ::Atom> url_atoms;
-  url_atoms.push_back(gfx::GetAtom(Clipboard::kMimeTypeHTML));
+  url_atoms.push_back(gfx::GetAtom(kMimeTypeHTML));
   std::vector< ::Atom> requested_types;
   GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
 
@@ -461,7 +460,7 @@
 
 bool OSExchangeDataProviderAuraX11::HasHtml() const {
   std::vector< ::Atom> url_atoms;
-  url_atoms.push_back(gfx::GetAtom(Clipboard::kMimeTypeHTML));
+  url_atoms.push_back(gfx::GetAtom(kMimeTypeHTML));
   std::vector< ::Atom> requested_types;
   GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
 
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
index f8e60b3..b1106d92 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.h
@@ -23,7 +23,6 @@
 
 namespace ui {
 
-class Clipboard;
 class OSExchangeDataProviderAuraX11Test;
 
 // OSExchangeData::Provider implementation for aura on linux.
@@ -65,7 +64,7 @@
   void SetURL(const GURL& url, const base::string16& title) override;
   void SetFilename(const base::FilePath& path) override;
   void SetFilenames(const std::vector<FileInfo>& filenames) override;
-  void SetPickledData(const Clipboard::FormatType& format,
+  void SetPickledData(const ClipboardFormatType& format,
                       const base::Pickle& pickle) override;
   bool GetString(base::string16* data) const override;
   bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
@@ -73,12 +72,12 @@
                       base::string16* title) const override;
   bool GetFilename(base::FilePath* path) const override;
   bool GetFilenames(std::vector<FileInfo>* filenames) const override;
-  bool GetPickledData(const Clipboard::FormatType& format,
+  bool GetPickledData(const ClipboardFormatType& format,
                       base::Pickle* pickle) const override;
   bool HasString() const override;
   bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override;
   bool HasFile() const override;
-  bool HasCustomFormat(const Clipboard::FormatType& format) const override;
+  bool HasCustomFormat(const ClipboardFormatType& format) const override;
 
   void SetFileContents(const base::FilePath& filename,
                        const std::string& file_contents) override;
@@ -97,7 +96,7 @@
 
  private:
   friend class OSExchangeDataProviderAuraX11Test;
-  typedef std::map<Clipboard::FormatType, base::Pickle> PickleData;
+  typedef std::map<ClipboardFormatType, base::Pickle> PickleData;
 
   // Returns true if |formats_| contains a string format and the string can be
   // parsed as a URL.
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
index 9403c2a6..ac42a4d 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/scoped_task_environment.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/events/platform/x11/x11_event_source_glib.h"
 #include "ui/gfx/x/x11_atom_cache.h"
@@ -32,8 +33,7 @@
     scoped_refptr<base::RefCountedMemory> mem(
         base::RefCountedString::TakeString(&contents_copy));
 
-    provider.format_map_.Insert(gfx::GetAtom(ui::Clipboard::kMimeTypeURIList),
-                                mem);
+    provider.format_map_.Insert(gfx::GetAtom(ui::kMimeTypeURIList), mem);
   }
 
  protected:
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.h b/ui/base/dragdrop/os_exchange_data_provider_mac.h
index edc52f4..5ba2a69 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.h
@@ -35,7 +35,7 @@
   void SetURL(const GURL& url, const base::string16& title) override;
   void SetFilename(const base::FilePath& path) override;
   void SetFilenames(const std::vector<FileInfo>& filenames) override;
-  void SetPickledData(const Clipboard::FormatType& format,
+  void SetPickledData(const ClipboardFormatType& format,
                       const base::Pickle& data) override;
   bool GetString(base::string16* data) const override;
   bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy,
@@ -43,12 +43,12 @@
                       base::string16* title) const override;
   bool GetFilename(base::FilePath* path) const override;
   bool GetFilenames(std::vector<FileInfo>* filenames) const override;
-  bool GetPickledData(const Clipboard::FormatType& format,
+  bool GetPickledData(const ClipboardFormatType& format,
                       base::Pickle* data) const override;
   bool HasString() const override;
   bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override;
   bool HasFile() const override;
-  bool HasCustomFormat(const Clipboard::FormatType& format) const override;
+  bool HasCustomFormat(const ClipboardFormatType& format) const override;
   void SetDragImage(const gfx::ImageSkia& image,
                     const gfx::Vector2d& cursor_offset) override;
   gfx::ImageSkia GetDragImage() const override;
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.mm b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
index 4a626b3..68e89f0 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.mm
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
@@ -12,6 +12,8 @@
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #import "third_party/mozilla/NSPasteboard+Utils.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #import "ui/base/clipboard/clipboard_util_mac.h"
 #include "ui/base/clipboard/custom_data_helper.h"
 #import "ui/base/dragdrop/cocoa_dnd_util.h"
@@ -78,7 +80,7 @@
 }
 
 void OSExchangeDataProviderMac::SetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     const base::Pickle& data) {
   NSData* ns_data = [NSData dataWithBytes:data.data() length:data.size()];
   [pasteboard_->get() setData:ns_data forType:format.ToNSString()];
@@ -160,7 +162,7 @@
 }
 
 bool OSExchangeDataProviderMac::GetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     base::Pickle* data) const {
   DCHECK(data);
   NSData* ns_data = [pasteboard_->get() dataForType:format.ToNSString()];
@@ -189,7 +191,7 @@
 }
 
 bool OSExchangeDataProviderMac::HasCustomFormat(
-    const Clipboard::FormatType& format) const {
+    const ClipboardFormatType& format) const {
   return [[pasteboard_->get() types] containsObject:format.ToNSString()];
 }
 
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc
index f843a65..db7425bb 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc
@@ -26,7 +26,7 @@
 #include "net/base/filename_util.h"
 #include "skia/ext/skia_utils_win.h"
 #include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/clipboard/clipboard_util_win.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -38,9 +38,9 @@
 
 namespace ui {
 
-static const Clipboard::FormatType& GetRendererTaintFormatType() {
-  static base::NoDestructor<Clipboard::FormatType> format(
-      ui::Clipboard::GetFormatType("chromium/x-renderer-taint"));
+static const ClipboardFormatType& GetRendererTaintFormatType() {
+  static base::NoDestructor<ClipboardFormatType> format(
+      ui::ClipboardFormatType::GetType("chromium/x-renderer-taint"));
   return *format;
 }
 
@@ -306,12 +306,12 @@
 void OSExchangeDataProviderWin::SetString(const base::string16& data) {
   STGMEDIUM* storage = GetStorageForString(data);
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetPlainTextWFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetPlainTextWType().ToFormatEtc(), storage));
 
   // Also add the UTF8-encoded version.
   storage = GetStorageForString(base::UTF16ToUTF8(data));
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetPlainTextFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetPlainTextType().ToFormatEtc(), storage));
 }
 
 void OSExchangeDataProviderWin::SetURL(const GURL& url,
@@ -328,7 +328,7 @@
   x_moz_url_str += title;
   STGMEDIUM* storage = GetStorageForString(x_moz_url_str);
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetMozUrlFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetMozUrlType().ToFormatEtc(), storage));
 
   // Add a .URL shortcut file for dragging to Explorer.
   base::string16 valid_file_name;
@@ -340,10 +340,10 @@
   // Add a UniformResourceLocator link for apps like IE and Word.
   storage = GetStorageForString(base::UTF8ToUTF16(url.spec()));
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetUrlWFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetUrlWType().ToFormatEtc(), storage));
   storage = GetStorageForString(url.spec());
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetUrlFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetUrlType().ToFormatEtc(), storage));
 
   // TODO(beng): add CF_HTML.
   // http://code.google.com/p/chromium/issues/detail?id=6767GetIDListStorageForFileName
@@ -360,7 +360,7 @@
   if (!storage)
     return;
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetIDListFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetIDListType().ToFormatEtc(), storage));
 }
 
 void OSExchangeDataProviderWin::SetFilenames(
@@ -370,11 +370,11 @@
     return;
 
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetCFHDropFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetCFHDropType().ToFormatEtc(), storage));
 }
 
 void OSExchangeDataProviderWin::SetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     const base::Pickle& data) {
   STGMEDIUM* storage = GetStorageForBytes(data.data(), data.size());
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
@@ -387,12 +387,12 @@
   // Add CFSTR_FILEDESCRIPTOR
   STGMEDIUM* storage = GetStorageForFileDescriptor(filename);
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetFileDescriptorFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetFileDescriptorType().ToFormatEtc(), storage));
 
   // Add CFSTR_FILECONTENTS
   storage = GetStorageForBytes(file_contents.data(), file_contents.length());
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetFileContentZeroFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetFileContentZeroType().ToFormatEtc(), storage));
 }
 
 void OSExchangeDataProviderWin::SetHtml(const base::string16& html,
@@ -404,12 +404,12 @@
   std::string cf_html = ClipboardUtil::HtmlToCFHtml(utf8_html, url);
   STGMEDIUM* storage = GetStorageForBytes(cf_html.c_str(), cf_html.size());
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetHtmlFormatType().ToFormatEtc(), storage));
+      ClipboardFormatType::GetHtmlType().ToFormatEtc(), storage));
 
   STGMEDIUM* storage_plain = GetStorageForBytes(utf8_html.c_str(),
                                                 utf8_html.size());
   data_->contents_.push_back(std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetTextHtmlFormatType().ToFormatEtc(), storage_plain));
+      ClipboardFormatType::GetTextHtmlType().ToFormatEtc(), storage_plain));
 }
 
 bool OSExchangeDataProviderWin::GetString(base::string16* data) const {
@@ -459,7 +459,7 @@
 }
 
 bool OSExchangeDataProviderWin::GetPickledData(
-    const Clipboard::FormatType& format,
+    const ClipboardFormatType& format,
     base::Pickle* data) const {
   DCHECK(data);
   bool success = false;
@@ -523,7 +523,7 @@
 }
 
 bool OSExchangeDataProviderWin::HasCustomFormat(
-    const Clipboard::FormatType& format) const {
+    const ClipboardFormatType& format) const {
   FORMATETC format_etc = format.ToFormatEtc();
   return (source_object_->QueryGetData(&format_etc) == S_OK);
 }
@@ -540,7 +540,7 @@
 
   // Add CF_HDROP.
   auto info = std::make_unique<DataObjectImpl::StoredDataInfo>(
-      Clipboard::GetCFHDropFormatType().ToFormatEtc(), storage);
+      ClipboardFormatType::GetCFHDropType().ToFormatEtc(), storage);
   info->downloader = download.downloader;
   data_->contents_.push_back(std::move(info));
 
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.h b/ui/base/dragdrop/os_exchange_data_provider_win.h
index a47c93b..96fa77ec 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.h
@@ -154,7 +154,7 @@
   void SetURL(const GURL& url, const base::string16& title) override;
   void SetFilename(const base::FilePath& path) override;
   void SetFilenames(const std::vector<FileInfo>& filenames) override;
-  void SetPickledData(const Clipboard::FormatType& format,
+  void SetPickledData(const ClipboardFormatType& format,
                       const base::Pickle& data) override;
   void SetFileContents(const base::FilePath& filename,
                        const std::string& file_contents) override;
@@ -166,7 +166,7 @@
                       base::string16* title) const override;
   bool GetFilename(base::FilePath* path) const override;
   bool GetFilenames(std::vector<FileInfo>* filenames) const override;
-  bool GetPickledData(const Clipboard::FormatType& format,
+  bool GetPickledData(const ClipboardFormatType& format,
                       base::Pickle* data) const override;
   bool GetFileContents(base::FilePath* filename,
                        std::string* file_contents) const override;
@@ -176,7 +176,7 @@
   bool HasFile() const override;
   bool HasFileContents() const override;
   bool HasHtml() const override;
-  bool HasCustomFormat(const Clipboard::FormatType& format) const override;
+  bool HasCustomFormat(const ClipboardFormatType& format) const override;
   void SetDownloadFileInfo(
       const OSExchangeData::DownloadFileInfo& download_info) override;
   void SetDragImage(const gfx::ImageSkia& image_skia,
diff --git a/ui/base/dragdrop/os_exchange_data_unittest.cc b/ui/base/dragdrop/os_exchange_data_unittest.cc
index 9291ca57..93e8ed6 100644
--- a/ui/base/dragdrop/os_exchange_data_unittest.cc
+++ b/ui/base/dragdrop/os_exchange_data_unittest.cc
@@ -12,6 +12,7 @@
 #include "net/base/filename_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/platform_test.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "ui/events/platform/platform_event_source.h"
@@ -142,8 +143,8 @@
 }
 
 TEST_F(OSExchangeDataTest, TestPickledData) {
-  const Clipboard::FormatType kTestFormat =
-      Clipboard::GetFormatType("application/vnd.chromium.test");
+  const ui::ClipboardFormatType kTestFormat =
+      ui::ClipboardFormatType::GetType("application/vnd.chromium.test");
 
   base::Pickle saved_pickle;
   saved_pickle.WriteInt(1);
diff --git a/ui/base/dragdrop/os_exchange_data_win_unittest.cc b/ui/base/dragdrop/os_exchange_data_win_unittest.cc
index 09bf9b0d..161c251 100644
--- a/ui/base/dragdrop/os_exchange_data_win_unittest.cc
+++ b/ui/base/dragdrop/os_exchange_data_win_unittest.cc
@@ -10,7 +10,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/scoped_hglobal.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/file_info.h"
 #include "ui/base/dragdrop/os_exchange_data_provider_win.h"
 #include "url/gurl.h"
@@ -322,7 +322,7 @@
   expected_cf_html += base::WideToUTF8(html);
   expected_cf_html.append("<!--EndFragment-->\r\n</body>\r\n</html>");
 
-  FORMATETC format = Clipboard::GetHtmlFormatType().ToFormatEtc();
+  FORMATETC format = ClipboardFormatType::GetHtmlType().ToFormatEtc();
   STGMEDIUM medium;
   IDataObject* data_object = OSExchangeDataProviderWin::GetIDataObject(data);
   EXPECT_EQ(S_OK, data_object->GetData(&format, &medium));
diff --git a/ui/base/mojo/BUILD.gn b/ui/base/mojo/BUILD.gn
index 04e7bed8..51bd3fb 100644
--- a/ui/base/mojo/BUILD.gn
+++ b/ui/base/mojo/BUILD.gn
@@ -34,6 +34,7 @@
     "//base",
     "//mojo/public/cpp/bindings",
     "//ui/base",
+    "//ui/base/clipboard",
   ]
 }
 
diff --git a/ui/base/mojo/clipboard_client.cc b/ui/base/mojo/clipboard_client.cc
index 0424a79..258ff49 100644
--- a/ui/base/mojo/clipboard_client.cc
+++ b/ui/base/mojo/clipboard_client.cc
@@ -30,7 +30,7 @@
   return sequence_number;
 }
 
-bool ClipboardClient::IsFormatAvailable(const FormatType& format,
+bool ClipboardClient::IsFormatAvailable(const ClipboardFormatType& format,
                                         ClipboardType type) const {
   mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call;
   bool result = false;
@@ -96,7 +96,7 @@
   clipboard_->ReadBookmark(title, url);
 }
 
-void ClipboardClient::ReadData(const FormatType& format,
+void ClipboardClient::ReadData(const ClipboardFormatType& format,
                                std::string* result) const {
   mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call;
   clipboard_->ReadData(format.Serialize(), result);
@@ -157,7 +157,7 @@
   clipboard_->WriteBitmap(out_bitmap);
 }
 
-void ClipboardClient::WriteData(const FormatType& format,
+void ClipboardClient::WriteData(const ClipboardFormatType& format,
                                 const char* data_data,
                                 size_t data_len) {
   mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call;
diff --git a/ui/base/mojo/clipboard_client.h b/ui/base/mojo/clipboard_client.h
index ac093c3..809804e 100644
--- a/ui/base/mojo/clipboard_client.h
+++ b/ui/base/mojo/clipboard_client.h
@@ -22,7 +22,7 @@
   // Clipboard overrides:
   void OnPreShutdown() override;
   uint64_t GetSequenceNumber(ClipboardType type) const override;
-  bool IsFormatAvailable(const FormatType& format,
+  bool IsFormatAvailable(const ClipboardFormatType& format,
                          ClipboardType type) const override;
   void Clear(ClipboardType type) override;
   void ReadAvailableTypes(ClipboardType type,
@@ -41,7 +41,8 @@
                       const base::string16& type,
                       base::string16* result) const override;
   void ReadBookmark(base::string16* title, std::string* url) const override;
-  void ReadData(const FormatType& format, std::string* result) const override;
+  void ReadData(const ClipboardFormatType& format,
+                std::string* result) const override;
   void WriteObjects(ClipboardType type, const ObjectMap& objects) override;
   void WriteText(const char* text_data, size_t text_len) override;
   void WriteHTML(const char* markup_data,
@@ -55,7 +56,7 @@
                      size_t url_len) override;
   void WriteWebSmartPaste() override;
   void WriteBitmap(const SkBitmap& bitmap) override;
-  void WriteData(const FormatType& format,
+  void WriteData(const ClipboardFormatType& format,
                  const char* data_data,
                  size_t data_len) override;
 
diff --git a/ui/base/mojo/clipboard_host.cc b/ui/base/mojo/clipboard_host.cc
index 410ea26..769dde85 100644
--- a/ui/base/mojo/clipboard_host.cc
+++ b/ui/base/mojo/clipboard_host.cc
@@ -33,7 +33,7 @@
 void ClipboardHost::IsFormatAvailable(const std::string& format,
                                       ClipboardType type,
                                       IsFormatAvailableCallback callback) {
-  auto format_type = Clipboard::FormatType::Deserialize(format);
+  auto format_type = ClipboardFormatType::Deserialize(format);
   bool result = clipboard_->IsFormatAvailable(format_type, type);
   std::move(callback).Run(result);
 }
@@ -52,11 +52,11 @@
 
 void ClipboardHost::ReadText(ClipboardType type, ReadTextCallback callback) {
   base::string16 result;
-  if (clipboard_->IsFormatAvailable(Clipboard::GetPlainTextWFormatType(),
+  if (clipboard_->IsFormatAvailable(ClipboardFormatType::GetPlainTextWType(),
                                     type)) {
     clipboard_->ReadText(type, &result);
-  } else if (clipboard_->IsFormatAvailable(Clipboard::GetPlainTextFormatType(),
-                                           type)) {
+  } else if (clipboard_->IsFormatAvailable(
+                 ClipboardFormatType::GetPlainTextType(), type)) {
     std::string ascii;
     clipboard_->ReadAsciiText(type, &ascii);
     result = base::ASCIIToUTF16(ascii);
@@ -111,7 +111,7 @@
 void ClipboardHost::ReadData(const std::string& format,
                              ReadDataCallback callback) {
   std::string result;
-  clipboard_->ReadData(Clipboard::FormatType::Deserialize(format), &result);
+  clipboard_->ReadData(ClipboardFormatType::Deserialize(format), &result);
   std::move(callback).Run(std::move(result));
 }
 
diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc
index 71bd2fb..07f73f8 100644
--- a/ui/base/ui_base_features.cc
+++ b/ui/base/ui_base_features.cc
@@ -176,7 +176,11 @@
          IsMultiProcessMash();
 }
 
+#if defined(OS_MACOSX)
+const base::Feature kDarkMode = {"DarkMode", base::FEATURE_ENABLED_BY_DEFAULT};
+#else
 const base::Feature kDarkMode = {"DarkMode", base::FEATURE_DISABLED_BY_DEFAULT};
+#endif
 
 #if defined(OS_CHROMEOS)
 const base::Feature kHandwritingGesture = {"HandwritingGesture",
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc
index 99cd8eac..c2d4f25 100644
--- a/ui/base/ui_base_switches.cc
+++ b/ui/base/ui_base_switches.cc
@@ -48,6 +48,9 @@
 const char kEnableTouchableAppContextMenu[] =
     "enable-touchable-app-context-menus";
 
+// Forces the caption style for WebVTT captions.
+const char kForceCaptionStyle[] = "force-caption-style";
+
 // Forces dark mode in UI for platforms that support it.
 const char kForceDarkMode[] = "force-dark-mode";
 
diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h
index 0ac60c1..2162f1e 100644
--- a/ui/base/ui_base_switches.h
+++ b/ui/base/ui_base_switches.h
@@ -27,6 +27,7 @@
 UI_BASE_EXPORT extern const char kDisableTouchDragDrop[];
 UI_BASE_EXPORT extern const char kEnableTouchDragDrop[];
 UI_BASE_EXPORT extern const char kEnableTouchableAppContextMenu[];
+UI_BASE_EXPORT extern const char kForceCaptionStyle[];
 UI_BASE_EXPORT extern const char kForceDarkMode[];
 UI_BASE_EXPORT extern const char kForceHighContrast[];
 UI_BASE_EXPORT extern const char kLang[];
diff --git a/ui/base/x/selection_owner.h b/ui/base/x/selection_owner.h
index e1c5a95..0eef264 100644
--- a/ui/base/x/selection_owner.h
+++ b/ui/base/x/selection_owner.h
@@ -22,9 +22,9 @@
 
 class XScopedEventSelector;
 
-extern const char kIncr[];
-extern const char kSaveTargets[];
-extern const char kTargets[];
+UI_BASE_EXPORT extern const char kIncr[];
+UI_BASE_EXPORT extern const char kSaveTargets[];
+UI_BASE_EXPORT extern const char kTargets[];
 
 // Owns a specific X11 selection on an X window.
 //
diff --git a/ui/base/x/selection_utils.cc b/ui/base/x/selection_utils.cc
index 1ff0c81..b107218 100644
--- a/ui/base/x/selection_utils.cc
+++ b/ui/base/x/selection_utils.cc
@@ -14,7 +14,7 @@
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/gfx/x/x11_atom_cache.h"
 
 namespace ui {
@@ -37,14 +37,14 @@
 
 std::vector<::Atom> GetURLAtomsFrom() {
   std::vector< ::Atom> atoms;
-  atoms.push_back(gfx::GetAtom(Clipboard::kMimeTypeURIList));
-  atoms.push_back(gfx::GetAtom(Clipboard::kMimeTypeMozillaURL));
+  atoms.push_back(gfx::GetAtom(kMimeTypeURIList));
+  atoms.push_back(gfx::GetAtom(kMimeTypeMozillaURL));
   return atoms;
 }
 
 std::vector<::Atom> GetURIListAtomsFrom() {
   std::vector< ::Atom> atoms;
-  atoms.push_back(gfx::GetAtom(Clipboard::kMimeTypeURIList));
+  atoms.push_back(gfx::GetAtom(kMimeTypeURIList));
   return atoms;
 }
 
@@ -198,7 +198,7 @@
 base::string16 SelectionData::GetHtml() const {
   base::string16 markup;
 
-  if (type_ == gfx::GetAtom(Clipboard::kMimeTypeHTML)) {
+  if (type_ == gfx::GetAtom(kMimeTypeHTML)) {
     const unsigned char* data = GetData();
     size_t size = GetSize();
 
diff --git a/ui/base/x/selection_utils.h b/ui/base/x/selection_utils.h
index 2d2e99b..6954294 100644
--- a/ui/base/x/selection_utils.h
+++ b/ui/base/x/selection_utils.h
@@ -9,16 +9,15 @@
 #include <map>
 
 #include "base/memory/ref_counted_memory.h"
-#include "ui/base/clipboard/clipboard.h"
 #include "ui/base/ui_base_export.h"
 #include "ui/gfx/x/x11.h"
 
 namespace ui {
 class SelectionData;
 
-extern const char kString[];
-extern const char kText[];
-extern const char kUtf8String[];
+UI_BASE_EXPORT extern const char kString[];
+UI_BASE_EXPORT extern const char kText[];
+UI_BASE_EXPORT extern const char kUtf8String[];
 
 // Returns a list of all text atoms that we handle.
 UI_BASE_EXPORT std::vector<::Atom> GetTextAtomsFrom();
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 14be637e..5465203a 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -378,7 +378,6 @@
 void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF& offset) {
   subpixel_position_offset_ = offset;
   RecomputePosition();
-  RecomputeBackdropBounds();
 }
 
 gfx::Rect Layer::GetTargetBounds() const {
@@ -540,7 +539,6 @@
         background_blur_sigma_, SkBlurImageFilter::kClamp_TileMode));
   }
   cc_layer_->SetBackdropFilters(filters);
-  RecomputeBackdropBounds();
 }
 
 float Layer::GetTargetOpacity() const {
@@ -1007,7 +1005,6 @@
   device_scale_factor_ = device_scale_factor;
   RecomputeDrawsContentAndUVRect();
   RecomputePosition();
-  RecomputeBackdropBounds();
   if (nine_patch_layer_) {
     if (!nine_patch_layer_image_.isNull())
       UpdateNinePatchLayerImage(nine_patch_layer_image_);
@@ -1175,7 +1172,6 @@
 
   RecomputeDrawsContentAndUVRect();
   RecomputePosition();
-  RecomputeBackdropBounds();
 
   if (delegate_)
     delegate_->OnLayerBoundsChanged(old_bounds, reason);
@@ -1323,7 +1319,6 @@
   cc_layer_->SetLayerClient(weak_ptr_factory_.GetWeakPtr());
   cc_layer_->SetElementId(cc::ElementId(cc_layer_->id()));
   RecomputePosition();
-  RecomputeBackdropBounds();
 }
 
 void Layer::RecomputeDrawsContentAndUVRect() {
@@ -1347,13 +1342,6 @@
                          subpixel_position_offset_);
 }
 
-void Layer::RecomputeBackdropBounds() {
-  gfx::RectF backdrop_filter_bounds =
-      gfx::RectF(bounds().width(), bounds().height());
-  backdrop_filter_bounds.Scale(GetDeviceScaleFactor());
-  cc_layer_->SetBackdropFilterBounds(backdrop_filter_bounds);
-}
-
 void Layer::SetCompositorForAnimatorsInTree(Compositor* compositor) {
   DCHECK(compositor);
   LayerAnimatorCollection* collection = compositor->layer_animator_collection();
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index e45f9a1..3e1771ff 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -512,7 +512,6 @@
   // Recomputes and sets to |cc_layer_|.
   void RecomputeDrawsContentAndUVRect();
   void RecomputePosition();
-  void RecomputeBackdropBounds();
 
   // Set all filters which got applied to the layer.
   void SetLayerFilters();
diff --git a/ui/events/event_rewriter.cc b/ui/events/event_rewriter.cc
index d9efe7e..55c20e21 100644
--- a/ui/events/event_rewriter.cc
+++ b/ui/events/event_rewriter.cc
@@ -4,13 +4,99 @@
 
 #include "ui/events/event_rewriter.h"
 
+#include <utility>
+
 #include "ui/events/event_source.h"
 
 namespace ui {
 
+namespace {
+
+ui::EventDispatchDetails DispatcherDestroyed() {
+  ui::EventDispatchDetails details;
+  details.dispatcher_destroyed = true;
+  return details;
+}
+
+}  // anonymous namespace
+
+// Temporary fallback implementation, in terms of the old API,
+// factored out of EventSource::SendEventToSinkFromRewriter().
+// TODO(kpschoedel): Remove along with old API.
+EventDispatchDetails EventRewriter::RewriteEvent(
+    const Event& event,
+    const base::WeakPtr<Continuation> continuation) {
+  std::unique_ptr<Event> rewritten_event;
+  EventRewriteStatus status = RewriteEvent(event, &rewritten_event);
+  if (status == EVENT_REWRITE_DISCARD) {
+    CHECK(!rewritten_event);
+    return continuation->DiscardEvent();
+  }
+  if (status == EVENT_REWRITE_CONTINUE) {
+    CHECK(!rewritten_event);
+    return continuation->SendEvent(&event);
+  }
+  CHECK(rewritten_event);
+  EventDispatchDetails details =
+      continuation->SendEventFinally(rewritten_event.get());
+  while (status == EVENT_REWRITE_DISPATCH_ANOTHER) {
+    if (details.dispatcher_destroyed)
+      return details;
+    std::unique_ptr<Event> new_event;
+    status = NextDispatchEvent(*rewritten_event, &new_event);
+    if (status == EVENT_REWRITE_DISCARD)
+      return continuation->DiscardEvent();
+    CHECK_NE(EVENT_REWRITE_CONTINUE, status);
+    CHECK(new_event);
+    details = continuation->SendEventFinally(new_event.get());
+    rewritten_event = std::move(new_event);
+  }
+  return details;
+}
+
+// Temporary default implementation of the old API, so that subclasses'
+// implementations can be removed.
+// TODO(kpschoedel): Remove old API.
+EventRewriteStatus EventRewriter::RewriteEvent(
+    const Event& event,
+    std::unique_ptr<Event>* rewritten_event) {
+  NOTREACHED();
+  return EVENT_REWRITE_DISCARD;
+}
+
+// Temporary default implementation of the old API, so that subclasses'
+// implementations can be removed.
+// TODO(kpschoedel): Remove old API.
+EventRewriteStatus EventRewriter::NextDispatchEvent(
+    const Event& last_event,
+    std::unique_ptr<Event>* new_event) {
+  NOTREACHED();
+  return EVENT_REWRITE_DISCARD;
+}
+
+// TODO(kpschoedel): Remove old API.
 EventDispatchDetails EventRewriter::SendEventToEventSource(EventSource* source,
                                                            Event* event) const {
   return source->SendEventToSinkFromRewriter(event, this);
 }
 
+EventDispatchDetails EventRewriter::SendEvent(
+    const base::WeakPtr<Continuation> continuation,
+    const Event* event) {
+  return continuation ? continuation->SendEvent(event) : DispatcherDestroyed();
+}
+
+EventDispatchDetails EventRewriter::SendEventFinally(
+    const base::WeakPtr<Continuation> continuation,
+    const Event* event) {
+  return continuation ? continuation->SendEventFinally(event)
+                      : DispatcherDestroyed();
+}
+
+EventDispatchDetails EventRewriter::DiscardEvent(
+    const base::WeakPtr<Continuation> continuation) {
+  return continuation ? continuation->DiscardEvent()
+                      : DispatcherDestroyed();
+}
+
 }  // namespace ui
diff --git a/ui/events/event_rewriter.h b/ui/events/event_rewriter.h
index a096aa9..baef82d 100644
--- a/ui/events/event_rewriter.h
+++ b/ui/events/event_rewriter.h
@@ -8,28 +8,46 @@
 #include <memory>
 
 #include "base/macros.h"
+#include "base/memory/weak_ptr.h"
 #include "ui/events/event_dispatcher.h"
 #include "ui/events/events_export.h"
 
 namespace ui {
 
 class Event;
-class EventSource;
+class EventSource;  // TODO(kpschoedel): Remove with old API.
 
 // Return status of EventRewriter operations; see that class below.
+// TODO(kpschoedel): Remove old API.
 enum EventRewriteStatus {
   // Nothing was done; no rewritten event returned. Pass the original
   // event to later rewriters, or send it to the EventSink if this
   // was the final rewriter.
+  //
+  // TODO(kpschoedel): Replace old API uses of
+  //    return EVENT_REWRITE_CONTINUE;
+  // with new API
+  //    return SendEvent(continuation, &incoming_event);
   EVENT_REWRITE_CONTINUE,
 
   // The event has been rewritten. Send the rewritten event to the
   // EventSink instead of the original event (without sending
   // either to any later rewriters).
+  //
+  // TODO(kpschoedel): Replace old API uses of
+  //    *rewritten_event = std::move(replacement_event);
+  //    return EVENT_REWRITE_REWRITTEN;
+  // with new API
+  //    return SendEventFinally(continuation, replacement_event);
   EVENT_REWRITE_REWRITTEN,
 
   // The event should be discarded, neither passing it to any later
   // rewriters nor sending it to the EventSink.
+  //
+  // TODO(kpschoedel): Replace old API uses of
+  //    return EVENT_REWRITE_DISCARD;
+  // with new API
+  //    return DiscardEvent(continuation);
   EVENT_REWRITE_DISCARD,
 
   // The event has been rewritten. As for EVENT_REWRITE_REWRITTEN,
@@ -38,6 +56,15 @@
   // In addition the rewriter has one or more additional new events
   // to be retrieved using |NextDispatchEvent()| and sent to the
   // EventSink.
+  //
+  // TODO(kpschoedel): Replace old API uses of
+  //    *rewritten_event = std::move(new_event_1);
+  //    // record new_event_2 … new_event_N
+  //    return EVENT_REWRITE_DISPATCH_ANOTHER;
+  // with new API
+  //    details = SendEventFinally(new_event_1);
+  //    â‹®
+  //    return SendEventFinally(new_event_N);
   EVENT_REWRITE_DISPATCH_ANOTHER,
 };
 
@@ -45,17 +72,78 @@
 // before being dispatched from EventSource to EventSink.
 class EVENTS_EXPORT EventRewriter {
  public:
+  // Used to return events from a rewriter, and expected to be called only
+  // within an EventRewriter, normally via the corresponding EventRewriter
+  // functions (because those first validate the continuation).
+  // See |RewriteEvent()| below for usage.
+  class Continuation {
+   public:
+    Continuation() = default;
+    virtual ~Continuation() = default;
+
+    // Send an event to the sink, via any later rewriters.
+    virtual EventDispatchDetails SendEvent(const Event* event)
+        WARN_UNUSED_RESULT = 0;
+
+    // Send an event directly to the sink, bypassing any later rewriters.
+    virtual EventDispatchDetails SendEventFinally(const Event* event)
+        WARN_UNUSED_RESULT = 0;
+
+    // Discard an event, bypassing any later rewriters.
+    virtual EventDispatchDetails DiscardEvent() WARN_UNUSED_RESULT = 0;
+  };
+
   EventRewriter() = default;
   virtual ~EventRewriter() = default;
 
+  // Potentially rewrites (replaces) an event, possibly with multiple events,
+  // or causes it to be discarded.
+  //
+  // To accept the supplied event without change,
+  //    return SendEvent(continuation, &event)
+  //
+  // To replace the supplied event with a new event, call either
+  //    return SendEvent(continuation, new_event)
+  // or
+  //    return SendEventFinally(continuation, new_event)
+  // depending on whether or not |new_event| should be provided to any
+  // later rewriters. These functions can be called more than once to
+  // replace an incoming event with multiple new events; when doing so,
+  // check |details.dispatcher_destroyed| after each call.
+  //
+  // To discard the incoming event without replacement,
+  //    return DiscardEvent()
+  //
+  // In the common case of one event at a time, the EventDispatchDetails
+  // from the above calls can and should be returned directly by RewriteEvent().
+  // When a rewriter generates multiple events synchronously, it should
+  // typically bail and return on a non-vacuous EventDispatchDetails.
+  // When a rewriter generates events asynchronously (e.g. from a timer)
+  // there is no opportunity to return the result directly, but a rewriter
+  // can consider retaining it for the next call.
+  //
+  // The supplied WeakPtr<Continuation> can be saved in order to respond
+  // asynchronously, e.g. after a double-click timeout. Normally, with
+  // EventRewriters subordinate to EventSources, the Continuation lives as
+  // long as the EventRewriter remains registered. If the continuation is not
+  // valid, the Send functions will return with |details.dispatcher_destroyed|.
+  //
+  // Design note: We need to pass the continuation state explicitly because
+  // Ash registers some EventRewriter instances with multiple EventSources.
+  //
+  virtual EventDispatchDetails RewriteEvent(
+      const Event& event,
+      const base::WeakPtr<Continuation> continuation);
+
   // Potentially rewrites (replaces) an event, or requests it be discarded.
   // or discards an event. If the rewriter wants to rewrite an event, and
   // dispatch another event once the rewritten event is dispatched, it should
   // return EVENT_REWRITE_DISPATCH_ANOTHER, and return the next event to
   // dispatch from |NextDispatchEvent()|.
+  // TODO(kpschoedel): Remove old API.
   virtual EventRewriteStatus RewriteEvent(
       const Event& event,
-      std::unique_ptr<Event>* rewritten_event) = 0;
+      std::unique_ptr<Event>* rewritten_event);
 
   // Supplies an additional event to be dispatched. It is only valid to
   // call this after the immediately previous call to |RewriteEvent()|
@@ -63,13 +151,26 @@
   // Should only return either EVENT_REWRITE_REWRITTEN or
   // EVENT_REWRITE_DISPATCH_ANOTHER; otherwise the previous call should not
   // have returned EVENT_REWRITE_DISPATCH_ANOTHER.
+  // TODO(kpschoedel): Remove old API.
   virtual EventRewriteStatus NextDispatchEvent(
       const Event& last_event,
-      std::unique_ptr<Event>* new_event) = 0;
+      std::unique_ptr<Event>* new_event);
 
  protected:
+  // Continuation helpers. These check the continuation and return
+  // with |details.target_destroyed| if it is invalid.
+  static EventDispatchDetails SendEvent(
+      const base::WeakPtr<Continuation> continuation,
+      const Event* event) WARN_UNUSED_RESULT;
+  static EventDispatchDetails SendEventFinally(
+      const base::WeakPtr<Continuation> continuation,
+      const Event* event) WARN_UNUSED_RESULT;
+  static EventDispatchDetails DiscardEvent(
+      const base::WeakPtr<Continuation> continuation) WARN_UNUSED_RESULT;
+
   // A helper that calls a protected EventSource function, which sends the event
   // to subsequent event rewriters on the source and onto its event sink.
+  // TODO(kpschoedel): Replace with SendEvent(continuation, event).
   EventDispatchDetails SendEventToEventSource(EventSource* source,
                                               Event* event) const;
 
diff --git a/ui/events/event_rewriter_unittest.cc b/ui/events/event_rewriter_unittest.cc
index 90c5d26..75ed3148 100644
--- a/ui/events/event_rewriter_unittest.cc
+++ b/ui/events/event_rewriter_unittest.cc
@@ -85,9 +85,9 @@
 // same event type; it is used to test simple rewriting, and rewriter addition,
 // removal, and sequencing. Consequently EVENT_REWRITE_DISPATCH_ANOTHER is not
 // supported here (calls to NextDispatchEvent() would continue indefinitely).
-class TestConstantEventRewriter : public EventRewriter {
+class TestConstantEventRewriterOld : public EventRewriter {
  public:
-  TestConstantEventRewriter(EventRewriteStatus status, EventType type)
+  TestConstantEventRewriterOld(EventRewriteStatus status, EventType type)
       : status_(status), type_(type) {
     CHECK_NE(EVENT_REWRITE_DISPATCH_ANOTHER, status);
   }
@@ -113,9 +113,9 @@
 
 // This EventRewriter runs a simple state machine; it is used to test
 // EVENT_REWRITE_DISPATCH_ANOTHER.
-class TestStateMachineEventRewriter : public EventRewriter {
+class TestStateMachineEventRewriterOld : public EventRewriter {
  public:
-  TestStateMachineEventRewriter() : last_rewritten_event_(0), state_(0) {}
+  TestStateMachineEventRewriterOld() : last_rewritten_event_(0), state_(0) {}
   void AddRule(int from_state, EventType from_type,
                int to_state, EventType to_type, EventRewriteStatus to_status) {
     RewriteResult r = {to_state, to_type, to_status};
@@ -160,27 +160,111 @@
   int state_;
 };
 
+// This EventRewriter always accepts the original event. It is used to test
+// simple rewriting, and rewriter addition, removal, and sequencing.
+class TestAlwaysAcceptEventRewriter : public EventRewriter {
+ public:
+  TestAlwaysAcceptEventRewriter() {}
+  EventDispatchDetails RewriteEvent(
+      const Event& event,
+      const base::WeakPtr<Continuation> continuation) override {
+    return SendEvent(continuation, &event);
+  }
+};
+
+// This EventRewriter always rewrites with the same event type; it is used
+// to test simple rewriting, and rewriter addition, removal, and sequencing.
+class TestConstantEventRewriter : public EventRewriter {
+ public:
+  explicit TestConstantEventRewriter(EventType type) : type_(type) {}
+  EventDispatchDetails RewriteEvent(
+      const Event& event,
+      const base::WeakPtr<Continuation> continuation) override {
+    std::unique_ptr<Event> replacement_event = CreateEventForType(type_);
+    return SendEventFinally(continuation, replacement_event.get());
+  }
+
+ private:
+  EventType type_;
+};
+
+// This EventRewriter runs a simple state machine; it is used to test
+// EVENT_REWRITE_DISPATCH_ANOTHER.
+class TestStateMachineEventRewriter : public EventRewriter {
+ public:
+  enum RewriteAction { ACCEPT, DISCARD, REPLACE };
+  enum StateAction { RETURN, PROCEED };
+  TestStateMachineEventRewriter() : state_(0) {}
+  void AddRule(int from_state,
+               EventType from_type,
+               int to_state,
+               EventType to_type,
+               RewriteAction rewrite_action,
+               StateAction state_action) {
+    RewriteResult r = {to_state, to_type, rewrite_action, state_action};
+    rules_.insert({RewriteCase(from_state, from_type), r});
+  }
+  EventDispatchDetails RewriteEvent(
+      const Event& event,
+      const base::WeakPtr<Continuation> continuation) override {
+    for (;;) {
+      RewriteRules::iterator find =
+          rules_.find(RewriteCase(state_, event.type()));
+      if (find == rules_.end())
+        return SendEvent(continuation, &event);
+      state_ = find->second.state;
+      EventDispatchDetails details;
+      switch (find->second.rewrite_action) {
+        case ACCEPT:
+          details = SendEvent(continuation, &event);
+          break;
+        case DISCARD:
+          break;
+        case REPLACE:
+          details = SendEventFinally(
+              continuation, CreateEventForType(find->second.type).get());
+          break;
+      }
+      if (details.dispatcher_destroyed || find->second.state_action == RETURN)
+        return details;
+    }
+    NOTREACHED();
+  }
+
+ private:
+  typedef std::pair<int, EventType> RewriteCase;
+  struct RewriteResult {
+    int state;
+    EventType type;
+    RewriteAction rewrite_action;
+    StateAction state_action;
+  };
+  typedef std::map<RewriteCase, RewriteResult> RewriteRules;
+  RewriteRules rules_;
+  int state_;
+};
+
 }  // namespace
 
-TEST(EventRewriterTest, EventRewriting) {
+TEST(EventRewriterTest, EventRewritingOld) {
   // TestEventRewriter r0 always rewrites events to ET_CANCEL_MODE;
   // it is placed at the beginning of the chain and later removed,
   // to verify that rewriter removal works.
-  TestConstantEventRewriter r0(EVENT_REWRITE_REWRITTEN, ET_CANCEL_MODE);
+  TestConstantEventRewriterOld r0(EVENT_REWRITE_REWRITTEN, ET_CANCEL_MODE);
 
   // TestEventRewriter r1 always returns EVENT_REWRITE_CONTINUE;
-  // it is placed at the beginning of the chain to verify that a
-  // later rewriter sees the events.
-  TestConstantEventRewriter r1(EVENT_REWRITE_CONTINUE, ET_UNKNOWN);
+  // it is at the beginning of the chain (once r0 is removed)
+  // to verify that a later rewriter sees the events.
+  TestConstantEventRewriterOld r1(EVENT_REWRITE_CONTINUE, ET_UNKNOWN);
 
   // TestEventRewriter r2 has a state machine, primarily to test
   // |EVENT_REWRITE_DISPATCH_ANOTHER|.
-  TestStateMachineEventRewriter r2;
+  TestStateMachineEventRewriterOld r2;
 
   // TestEventRewriter r3 always rewrites events to ET_CANCEL_MODE;
   // it is placed at the end of the chain to verify that previously
   // rewritten events are not passed further down the chain.
-  TestConstantEventRewriter r3(EVENT_REWRITE_REWRITTEN, ET_CANCEL_MODE);
+  TestConstantEventRewriterOld r3(EVENT_REWRITE_REWRITTEN, ET_CANCEL_MODE);
 
   TestEventRewriteProcessor p;
   TestEventRewriteSource s(&p);
@@ -196,6 +280,12 @@
   p.CheckAllReceived();
 
   // Remove r0, and verify that it's gone and that events make it through.
+  // - r0 is removed, so the resulting event should NOT be ET_CANCEL_MODE.
+  // - r2 should rewrite ET_SCROLL_FLING_START to ET_SCROLL_FLING_CANCEL,
+  //   and skip subsequent rewriters, so the resulting event should be
+  //   ET_SCROLL_FLING_CANCEL.
+  // - r3 should be skipped after r2 returns, so the resulting event
+  //   should NOT be ET_CANCEL_MODE.
   s.AddEventRewriter(&r3);
   s.RemoveEventRewriter(&r0);
   r2.AddRule(0, ET_SCROLL_FLING_START,
@@ -223,9 +313,8 @@
   p.AddExpectedEvent(ET_MOUSE_PRESSED);
   s.Send(ET_MOUSE_PRESSED);
 
-  // Removing rewriters r1 and r3 shouldn't affect r2.
+  // Removing rewriter r1 shouldn't affect r2.
   s.RemoveEventRewriter(&r1);
-  s.RemoveEventRewriter(&r3);
 
   // Continue with the state-based rewriting.
   p.AddExpectedEvent(ET_MOUSE_RELEASED);
@@ -234,4 +323,89 @@
   p.CheckAllReceived();
 }
 
+TEST(EventRewriterTest, EventRewriting) {
+  // TestEventRewriter r0 always rewrites events to ET_CANCEL_MODE;
+  // it is placed at the beginning of the chain and later removed,
+  // to verify that rewriter removal works.
+  TestConstantEventRewriter r0(ET_CANCEL_MODE);
+
+  // TestEventRewriter r1 always returns EVENT_REWRITE_CONTINUE;
+  // it is at the beginning of the chain (once r0 is removed)
+  // to verify that a later rewriter sees the events.
+  TestAlwaysAcceptEventRewriter r1;
+
+  // TestEventRewriter r2 has a state machine, primarily to test
+  // |EVENT_REWRITE_DISPATCH_ANOTHER|.
+  TestStateMachineEventRewriter r2;
+
+  // TestEventRewriter r3 always rewrites events to ET_CANCEL_MODE;
+  // it is placed at the end of the chain to verify that previously
+  // rewritten events are not passed further down the chain.
+  TestConstantEventRewriter r3(ET_CANCEL_MODE);
+
+  TestEventRewriteProcessor p;
+  TestEventRewriteSource s(&p);
+  s.AddEventRewriter(&r0);
+  s.AddEventRewriter(&r1);
+  s.AddEventRewriter(&r2);
+
+  // These events should be rewritten by r0 to ET_CANCEL_MODE.
+  p.AddExpectedEvent(ET_CANCEL_MODE);
+  s.Send(ET_MOUSE_DRAGGED);
+  p.AddExpectedEvent(ET_CANCEL_MODE);
+  s.Send(ET_MOUSE_PRESSED);
+  p.CheckAllReceived();
+
+  // Remove r0, and verify that it's gone and that events make it through.
+  // - r0 is removed, so the resulting event should NOT be ET_CANCEL_MODE.
+  // - r2 should rewrite ET_SCROLL_FLING_START to ET_SCROLL_FLING_CANCEL,
+  //   and skip subsequent rewriters, so the resulting event should be
+  //   ET_SCROLL_FLING_CANCEL.
+  // - r3 should be skipped after r2 returns, so the resulting event
+  //   should NOT be ET_CANCEL_MODE.
+  s.AddEventRewriter(&r3);
+  s.RemoveEventRewriter(&r0);
+  r2.AddRule(0, ET_SCROLL_FLING_START, 0, ET_SCROLL_FLING_CANCEL,
+             TestStateMachineEventRewriter::REPLACE,
+             TestStateMachineEventRewriter::RETURN);
+  p.AddExpectedEvent(ET_SCROLL_FLING_CANCEL);
+  s.Send(ET_SCROLL_FLING_START);
+  p.CheckAllReceived();
+  s.RemoveEventRewriter(&r3);
+
+  // Verify replacing an event with multiple events using a state machine
+  // (that happens to be analogous to sticky keys).
+  r2.AddRule(0, ET_KEY_PRESSED, 1, ET_UNKNOWN,
+             TestStateMachineEventRewriter::ACCEPT,
+             TestStateMachineEventRewriter::RETURN);
+  r2.AddRule(1, ET_MOUSE_PRESSED, 0, ET_UNKNOWN,
+             TestStateMachineEventRewriter::ACCEPT,
+             TestStateMachineEventRewriter::RETURN);
+  r2.AddRule(1, ET_KEY_RELEASED, 2, ET_UNKNOWN,
+             TestStateMachineEventRewriter::DISCARD,
+             TestStateMachineEventRewriter::RETURN);
+  r2.AddRule(2, ET_MOUSE_RELEASED, 3, ET_MOUSE_RELEASED,
+             TestStateMachineEventRewriter::REPLACE,
+             TestStateMachineEventRewriter::PROCEED);
+  r2.AddRule(3, ET_MOUSE_RELEASED, 0, ET_KEY_RELEASED,
+             TestStateMachineEventRewriter::REPLACE,
+             TestStateMachineEventRewriter::RETURN);
+  p.AddExpectedEvent(ET_KEY_PRESSED);
+  s.Send(ET_KEY_PRESSED);   // state 0 ET_KEY_PRESSED -> 1 ACCEPT ET_KEY_PRESSED
+  s.Send(ET_KEY_RELEASED);  // state 1 ET_KEY_RELEASED -> 2 DISCARD
+  p.AddExpectedEvent(ET_MOUSE_PRESSED);
+  s.Send(ET_MOUSE_PRESSED);  // no matching rule; pass event through.
+
+  // Removing rewriter r1 shouldn't affect r2.
+  s.RemoveEventRewriter(&r1);
+
+  // Continue with the state-based rewriting.
+  p.AddExpectedEvent(ET_MOUSE_RELEASED);
+  p.AddExpectedEvent(ET_KEY_RELEASED);
+  s.Send(
+      ET_MOUSE_RELEASED);  // 2 ET_MOUSE_RELEASED -> 3 PROCEED ET_MOUSE_RELEASED
+                           // 3 ET_MOUSE_RELEASED -> 0 REPLACE ET_KEY_RELEASED
+  p.CheckAllReceived();
+}
+
 }  // namespace ui
diff --git a/ui/events/event_source.cc b/ui/events/event_source.cc
index 85a6f40..41d6539 100644
--- a/ui/events/event_source.cc
+++ b/ui/events/event_source.cc
@@ -4,13 +4,12 @@
 
 #include "ui/events/event_source.h"
 
-#include <algorithm>
+#include <memory>
 
-#include "base/stl_util.h"
-#include "ui/events/event_rewriter.h"
 #include "ui/events/event_sink.h"
 
 namespace ui {
+
 namespace {
 
 bool IsLocatedEventWithDifferentLocations(const Event& event) {
@@ -23,23 +22,82 @@
 
 }  // namespace
 
+class EventSource::EventRewriterContinuation
+    : public EventRewriter::Continuation,
+      public base::LinkNode<EventRewriterContinuation> {
+ public:
+  EventRewriterContinuation(EventRewriter* rewriter,
+                            EventSource* const source,
+                            EventSource::EventRewriterList* const rewriter_list)
+      : rewriter_(rewriter),
+        source_(source),
+        rewriter_list_(rewriter_list),
+        weak_ptr_factory_(this) {}
+  ~EventRewriterContinuation() override {}
+
+  EventDispatchDetails SendEvent(const Event* event) override {
+    if (this == rewriter_list_->tail())
+      return SendEventFinally(event);
+    return next()->value()->rewriter_->RewriteEvent(
+        *event, next()->value()->GetWeakPtr());
+  }
+
+  EventDispatchDetails SendEventFinally(const Event* event) override {
+    return source_->DeliverEventToSink(const_cast<Event*>(event));
+  }
+
+  EventDispatchDetails DiscardEvent() override {
+    ui::EventDispatchDetails details;
+    details.event_discarded = true;
+    return details;
+  }
+
+  EventRewriter* rewriter() const { return rewriter_; }
+
+  base::WeakPtr<EventRewriterContinuation> GetWeakPtr() {
+    return weak_ptr_factory_.GetWeakPtr();
+  }
+
+ private:
+  EventRewriter* rewriter_;
+  EventSource* const source_;
+  EventSource::EventRewriterList* const rewriter_list_;
+
+  base::WeakPtrFactory<EventRewriterContinuation> weak_ptr_factory_;
+  DISALLOW_COPY_AND_ASSIGN(EventRewriterContinuation);
+};
+
 EventSource::EventSource() {}
 
-EventSource::~EventSource() {}
+EventSource::~EventSource() {
+  while (!rewriter_list_.empty())
+    RemoveEventRewriter(rewriter_list_.head()->value()->rewriter());
+}
 
 void EventSource::AddEventRewriter(EventRewriter* rewriter) {
   DCHECK(rewriter);
-  DCHECK(!base::ContainsValue(rewriter_list_, rewriter));
-  rewriter_list_.push_back(rewriter);
+  DCHECK(!GetContinuation(rewriter));
+  rewriter_list_.Append(
+      new EventRewriterContinuation(rewriter, this, &rewriter_list_));
 }
 
 void EventSource::RemoveEventRewriter(EventRewriter* rewriter) {
-  auto find = std::find(rewriter_list_.begin(), rewriter_list_.end(), rewriter);
-  if (find != rewriter_list_.end())
-    rewriter_list_.erase(find);
+  EventRewriterContinuation* continuation = GetContinuation(rewriter);
+  if (!continuation) {
+    // We need to tolerate attempting to remove an unregistered
+    // EventRewriter, because many unit tests currently do so:
+    // the rewriter gets added to the current root window source
+    // on construction, and removed from the current root window
+    // source on destruction, but the root window changes in
+    // between.
+    LOG(WARNING) << "EventRewriter not registered";
+    return;
+  }
+  continuation->RemoveFromList();
+  delete continuation;
 }
 
-EventDispatchDetails EventSource::SendEventToSink(Event* event) {
+EventDispatchDetails EventSource::SendEventToSink(const Event* event) {
   return SendEventToSinkFromRewriter(event, nullptr);
 }
 
@@ -50,62 +108,45 @@
 }
 
 EventDispatchDetails EventSource::SendEventToSinkFromRewriter(
-    Event* event,
+    const Event* event,
     const EventRewriter* rewriter) {
   std::unique_ptr<ui::Event> event_for_rewriting_ptr;
-  Event* event_for_rewriting = event;
+  const Event* event_for_rewriting = event;
   if (!rewriter_list_.empty() && IsLocatedEventWithDifferentLocations(*event)) {
     // EventRewriters don't expect an event with differing location and
     // root-location (because they don't honor the target). Provide such an
-    // event for rewriters.
+    // event.
     event_for_rewriting_ptr = ui::Event::Clone(*event);
     event_for_rewriting_ptr->AsLocatedEvent()->set_location_f(
         event_for_rewriting_ptr->AsLocatedEvent()->root_location_f());
     event_for_rewriting = event_for_rewriting_ptr.get();
   }
-  std::unique_ptr<Event> rewritten_event;
-  EventRewriteStatus status = EVENT_REWRITE_CONTINUE;
-  EventRewriterList::const_iterator it = rewriter_list_.begin(),
-                                    end = rewriter_list_.end();
-  // If a rewriter reposted |event|, only send it to subsequent rewriters.
-  bool send_to_rewriter = rewriter == nullptr;
-  for (; it != end; ++it) {
-    if (!send_to_rewriter) {
-      send_to_rewriter |= (*it == rewriter);
-      continue;
-    }
-    status = (*it)->RewriteEvent(*event_for_rewriting, &rewritten_event);
-    if (status == EVENT_REWRITE_DISCARD) {
-      CHECK(!rewritten_event);
-      EventDispatchDetails details;
-      details.event_discarded = true;
-      return details;
-    }
-    if (status == EVENT_REWRITE_CONTINUE) {
-      CHECK(!rewritten_event);
-      continue;
-    }
-    break;
+  EventRewriterContinuation* continuation = nullptr;
+  if (rewriter) {
+    // If a rewriter reposted |event|, only send it to subsequent rewriters.
+    continuation = GetContinuation(rewriter);
+    CHECK(continuation);
+    continuation = continuation->next()->value();
+  } else {
+    // Otherwise, start with the first rewriter.
+    // (If the list is empty, head() == end().)
+    continuation = rewriter_list_.head()->value();
   }
-  CHECK((it == end && !rewritten_event) || rewritten_event);
-  EventDispatchDetails details =
-      DeliverEventToSink(rewritten_event ? rewritten_event.get() : event);
-  if (details.dispatcher_destroyed)
-    return details;
+  if (continuation == rewriter_list_.end() || continuation == nullptr)
+    return DeliverEventToSink(const_cast<Event*>(event));
+  return continuation->rewriter()->RewriteEvent(*event_for_rewriting,
+                                                continuation->GetWeakPtr());
+}
 
-  while (status == EVENT_REWRITE_DISPATCH_ANOTHER) {
-    std::unique_ptr<Event> new_event;
-    status = (*it)->NextDispatchEvent(*rewritten_event, &new_event);
-    if (status == EVENT_REWRITE_DISCARD)
-      return EventDispatchDetails();
-    CHECK_NE(EVENT_REWRITE_CONTINUE, status);
-    CHECK(new_event);
-    details = DeliverEventToSink(new_event.get());
-    if (details.dispatcher_destroyed)
-      return details;
-    rewritten_event = std::move(new_event);
+EventSource::EventRewriterContinuation* EventSource::GetContinuation(
+    const EventRewriter* rewriter) const {
+  for (auto* it = rewriter_list_.head(); it != rewriter_list_.end();
+       it = it->next()) {
+    if (it->value()->rewriter() == rewriter) {
+      return it->value();
+    }
   }
-  return EventDispatchDetails();
+  return nullptr;
 }
 
 }  // namespace ui
diff --git a/ui/events/event_source.h b/ui/events/event_source.h
index ad84e60..e5e8294d 100644
--- a/ui/events/event_source.h
+++ b/ui/events/event_source.h
@@ -7,15 +7,16 @@
 
 #include <vector>
 
+#include "base/containers/linked_list.h"
 #include "base/macros.h"
 #include "ui/events/event_dispatcher.h"
+#include "ui/events/event_rewriter.h"
 #include "ui/events/events_export.h"
 
 namespace ui {
 
 class Event;
 class EventSink;
-class EventRewriter;
 
 // EventSource receives events from the native platform (e.g. X11, win32 etc.)
 // and sends the events to an EventSink.
@@ -34,7 +35,7 @@
   void RemoveEventRewriter(EventRewriter* rewriter);
 
   // Sends the event through all rewriters and onto the source's EventSink.
-  EventDispatchDetails SendEventToSink(Event* event);
+  EventDispatchDetails SendEventToSink(const Event* event);
 
   // Send the event to the sink after rewriting; subclass overrides may queue
   // events before delivery, i.e. for the WindowService.
@@ -44,20 +45,37 @@
   // Sends the event through the rewriters and onto the source's EventSink.
   // If |rewriter| is valid, |event| is only sent to the subsequent rewriters.
   // This is used for asynchronous reposting of events processed by |rewriter|.
+  // TODO(kpschoedel): Remove along with old EventRewriter API.
   EventDispatchDetails SendEventToSinkFromRewriter(
-      Event* event,
+      const Event* event,
       const EventRewriter* rewriter);
 
  private:
-  friend class EventRewriter;
-  friend class EventSourceTestApi;
+  // Implementation of EventRewriter::Continuation. No details need to be
+  // visible outside of event_source.cc.
+  class EventRewriterContinuation;
 
-  typedef std::vector<EventRewriter*> EventRewriterList;
+  // The role of an EventRewriter::Continuation is to propagate events
+  // out from one EventRewriter and (optionally) on to the next. Using
+  // the |base::LinkedList| container makes this simple, and also allows
+  // the container to hold the continuation directly without risk of
+  // invalidating WeakPtrs.
+  typedef base::LinkedList<EventRewriterContinuation> EventRewriterList;
+
+  // Returns the EventRewriterContinuation for a given EventRewriter,
+  // or nullptr if the rewriter is not registered with this EventSource.
+  EventRewriterContinuation* GetContinuation(
+      const EventRewriter* rewriter) const;
+
   EventRewriterList rewriter_list_;
 
+  friend class EventRewriter;  // TODO(kpschoedel): Remove along with old API.
+  friend class EventRewriterContinuation;
+  friend class EventSourceTestApi;
+
   DISALLOW_COPY_AND_ASSIGN(EventSource);
 };
 
 }  // namespace ui
 
-#endif // UI_EVENTS_EVENT_SOURCE_H_
+#endif  // UI_EVENTS_EVENT_SOURCE_H_
diff --git a/ui/events/keycodes/platform_key_map_win.cc b/ui/events/keycodes/platform_key_map_win.cc
index e58c529..3382d35 100644
--- a/ui/events/keycodes/platform_key_map_win.cc
+++ b/ui/events/keycodes/platform_key_map_win.cc
@@ -10,8 +10,9 @@
 #include "base/feature_list.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
+#include "base/memory/ptr_util.h"
 #include "base/stl_util.h"
-#include "base/threading/thread_local_storage.h"
+#include "base/threading/thread_local.h"
 
 #include "ui/events/event_constants.h"
 #include "ui/events/event_utils.h"
@@ -258,26 +259,6 @@
   return DomKey::NONE;
 }
 
-void CleanupKeyMapTls(void* data) {
-  PlatformKeyMap* key_map = reinterpret_cast<PlatformKeyMap*>(data);
-  delete key_map;
-}
-
-struct PlatformKeyMapInstanceTlsTraits
-    : public base::internal::DestructorAtExitLazyInstanceTraits<
-          base::ThreadLocalStorage::Slot> {
-  static base::ThreadLocalStorage::Slot* New(void* instance) {
-    // Use placement new to initialize our instance in our preallocated space.
-    // TODO(input-dev): Use std::default_delete instead of providing own
-    // function.
-    return new (instance) base::ThreadLocalStorage::Slot(CleanupKeyMapTls);
-  }
-};
-
-base::LazyInstance<base::ThreadLocalStorage::Slot,
-                   PlatformKeyMapInstanceTlsTraits>
-    g_platform_key_map_tls_lazy = LAZY_INSTANCE_INITIALIZER;
-
 }  // anonymous namespace
 
 PlatformKeyMap::PlatformKeyMap() {}
@@ -288,6 +269,25 @@
 
 PlatformKeyMap::~PlatformKeyMap() {}
 
+// static
+PlatformKeyMap* PlatformKeyMap::GetThreadLocalPlatformKeyMap() {
+  // DestructorAtExit so the main thread's instance is cleaned up between tests
+  // in the same process.
+  static base::LazyInstance<base::ThreadLocalOwnedPointer<PlatformKeyMap>>::
+      DestructorAtExit platform_key_map_tls_instance =
+          LAZY_INSTANCE_INITIALIZER;
+
+  auto& platform_key_map_tls = platform_key_map_tls_instance.Get();
+  PlatformKeyMap* platform_key_map = platform_key_map_tls.Get();
+  if (!platform_key_map) {
+    auto new_platform_key_map = base::WrapUnique(new PlatformKeyMap);
+    platform_key_map = new_platform_key_map.get();
+    platform_key_map_tls.Set(std::move(new_platform_key_map));
+  }
+
+  return platform_key_map;
+}
+
 DomKey PlatformKeyMap::DomKeyFromKeyboardCodeImpl(KeyboardCode key_code,
                                                   int* flags) const {
   // Windows expresses right-Alt as VKEY_MENU with the extended flag set.
@@ -338,14 +338,7 @@
   // Use TLS because KeyboardLayout is per thread.
   // However currently PlatformKeyMap will only be used by the host application,
   // which is just one process and one thread.
-  base::ThreadLocalStorage::Slot* platform_key_map_tls =
-      g_platform_key_map_tls_lazy.Pointer();
-  PlatformKeyMap* platform_key_map =
-      reinterpret_cast<PlatformKeyMap*>(platform_key_map_tls->Get());
-  if (!platform_key_map) {
-    platform_key_map = new PlatformKeyMap();
-    platform_key_map_tls->Set(platform_key_map);
-  }
+  PlatformKeyMap* platform_key_map = GetThreadLocalPlatformKeyMap();
 
   HKL current_layout = ::GetKeyboardLayout(0);
   platform_key_map->UpdateLayout(current_layout);
@@ -361,14 +354,7 @@
 
 // static
 bool PlatformKeyMap::UsesAltGraph() {
-  base::ThreadLocalStorage::Slot* platform_key_map_tls =
-      g_platform_key_map_tls_lazy.Pointer();
-  PlatformKeyMap* platform_key_map =
-      reinterpret_cast<PlatformKeyMap*>(platform_key_map_tls->Get());
-  if (!platform_key_map) {
-    platform_key_map = new PlatformKeyMap();
-    platform_key_map_tls->Set(platform_key_map);
-  }
+  PlatformKeyMap* platform_key_map = GetThreadLocalPlatformKeyMap();
 
   HKL current_layout = ::GetKeyboardLayout(0);
   platform_key_map->UpdateLayout(current_layout);
diff --git a/ui/events/keycodes/platform_key_map_win.h b/ui/events/keycodes/platform_key_map_win.h
index 2a8dc38..fe884c241 100644
--- a/ui/events/keycodes/platform_key_map_win.h
+++ b/ui/events/keycodes/platform_key_map_win.h
@@ -44,6 +44,9 @@
 
   PlatformKeyMap();
 
+  // Returns the PlatformKeyMap instance for the current thread.
+  static PlatformKeyMap* GetThreadLocalPlatformKeyMap();
+
   // TODO(input-dev): Expose this function when we need to access separate
   // layout. Returns the DomKey 'meaning' of |KeyboardCode| in the context of
   // specified |EventFlags| and stored keyboard layout.
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 813a8f33..b930ab44 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -228,6 +228,7 @@
 
   configs += [
     "//build/config:precompiled_headers",
+    "//build/config/compiler:noshadowing",
     "//build/config/compiler:wexit_time_destructors",
   ]
 
diff --git a/ui/gfx/color_analysis.cc b/ui/gfx/color_analysis.cc
index a23a9ad..087069e 100644
--- a/ui/gfx/color_analysis.cc
+++ b/ui/gfx/color_analysis.cc
@@ -541,8 +541,8 @@
     clusters.resize(kNumberOfClusters, KMeanCluster());
 
     // Pick a starting point for each cluster
-    auto cluster = clusters.begin();
-    while (cluster != clusters.end()) {
+    auto new_cluster = clusters.begin();
+    while (new_cluster != clusters.end()) {
       // Try up to 10 times to find a unique color. If no unique color can be
       // found, destroy this cluster.
       bool color_unique = false;
@@ -562,9 +562,9 @@
         // Loop through the previous clusters and check to see if we have seen
         // this color before.
         color_unique = true;
-        for (auto cluster_check = clusters.begin(); cluster_check != cluster;
-             ++cluster_check) {
-          if (cluster_check->IsAtCentroid(r, g, b)) {
+        for (auto cluster = clusters.begin(); cluster != new_cluster;
+             ++cluster) {
+          if (cluster->IsAtCentroid(r, g, b)) {
             color_unique = false;
             break;
           }
@@ -573,19 +573,19 @@
         // If we have a unique color set the center of the cluster to
         // that color.
         if (color_unique) {
-          cluster->SetCentroid(r, g, b);
+          new_cluster->SetCentroid(r, g, b);
           break;
         }
       }
 
       // If we don't have a unique color erase this cluster.
       if (!color_unique) {
-        cluster = clusters.erase(cluster);
+        new_cluster = clusters.erase(new_cluster);
       } else {
         // Have to increment the iterator here, otherwise the increment in the
         // for loop will skip a cluster due to the erase if the color wasn't
         // unique.
-        ++cluster;
+        ++new_cluster;
       }
     }
 
diff --git a/ui/gfx/font_fallback_mac.mm b/ui/gfx/font_fallback_mac.mm
index 6a4d66f1..071b59f 100644
--- a/ui/gfx/font_fallback_mac.mm
+++ b/ui/gfx/font_fallback_mac.mm
@@ -60,10 +60,10 @@
     CTFontDescriptorRef descriptor =
         base::mac::CFCastStrict<CTFontDescriptorRef>(
             CFArrayGetValueAtIndex(cascade_list, i));
-    base::ScopedCFTypeRef<CTFontRef> font(
+    base::ScopedCFTypeRef<CTFontRef> fallback_font(
         CTFontCreateWithFontDescriptor(descriptor, 0.0, nullptr));
-    if (font.get())
-      fallback_fonts.push_back(Font(static_cast<NSFont*>(font.get())));
+    if (fallback_font.get())
+      fallback_fonts.push_back(Font(static_cast<NSFont*>(fallback_font.get())));
   }
 
   if (fallback_fonts.empty())
diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc
index 3da6eee..6d6fe87 100644
--- a/ui/gfx/font_fallback_win.cc
+++ b/ui/gfx/font_fallback_win.cc
@@ -111,10 +111,10 @@
     if (!font_name.empty()) {
       AppendFont(font_name, font.GetFontSize(), linked_fonts);
     } else if (!filename.empty()) {
-      std::vector<std::string> font_names;
-      GetFontNamesFromFilename(filename, font_map, &font_names);
-      for (size_t i = 0; i < font_names.size(); ++i)
-        AppendFont(font_names[i], font.GetFontSize(), linked_fonts);
+      std::vector<std::string> filename_fonts;
+      GetFontNamesFromFilename(filename, font_map, &filename_fonts);
+      for (const std::string& filename_font : filename_fonts)
+        AppendFont(filename_font, font.GetFontSize(), linked_fonts);
     }
   }
 
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc
index 749ba772..d6b4b83 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -210,9 +210,6 @@
                int dip_size,
                SkColor color,
                const base::TimeDelta& elapsed_time) {
-  SkPath path;
-  path.setFillType(SkPath::kEvenOdd_FillType);
-
   int canvas_size = kReferenceSizeDip;
   std::vector<SkPath> paths;
   std::vector<cc::PaintFlags> flags_array;
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 94db79c..18e57f9 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -100,7 +100,7 @@
   SkColor color() const { return color_->second; }
   BaselineStyle baseline() const { return baseline_->second; }
   int font_size_override() const { return font_size_override_->second; }
-  bool style(TextStyle s) const { return style_[static_cast<int>(s)]->second; }
+  bool style(TextStyle s) const { return style_[s]->second; }
   Font::Weight weight() const { return weight_->second; }
 
   // Get the intersecting range of the current iterator set.
diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
index 25bd1816..3c016129 100644
--- a/ui/gfx/skbitmap_operations.cc
+++ b/ui/gfx/skbitmap_operations.cc
@@ -107,8 +107,8 @@
     uint32_t* dst_row = masked.getAddr32(0, y);
 
     for (int x = 0; x < masked.width(); ++x) {
-      unsigned alpha = SkGetPackedA32(alpha_row[x]);
-      unsigned scale = SkAlpha255To256(alpha);
+      unsigned alpha32 = SkGetPackedA32(alpha_row[x]);
+      unsigned scale = SkAlpha255To256(alpha32);
       dst_row[x] = SkAlphaMulQ(rgb_row[x], scale);
     }
   }
diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc
index 3dfeebc0..085fc3c8 100644
--- a/ui/gfx/text_elider.cc
+++ b/ui/gfx/text_elider.cc
@@ -651,9 +651,9 @@
         if (lines_added) {
           if (truncate) {
             // Trim trailing whitespace from the line that was added.
-            const size_t line = lines_->size() - lines_added;
-            base::TrimWhitespace(lines_->at(line), base::TRIM_TRAILING,
-                                 &lines_->at(line));
+            const size_t new_line = lines_->size() - lines_added;
+            base::TrimWhitespace(lines_->at(new_line), base::TRIM_TRAILING,
+                                 &lines_->at(new_line));
           }
           if (base::ContainsOnlyChars(word, base::kWhitespaceUTF16)) {
             // Skip the first space if the previous line was carried over.
diff --git a/ui/native_theme/BUILD.gn b/ui/native_theme/BUILD.gn
index 0b252567..a285421 100644
--- a/ui/native_theme/BUILD.gn
+++ b/ui/native_theme/BUILD.gn
@@ -8,6 +8,8 @@
 
 jumbo_component("native_theme") {
   sources = [
+    "caption_style.cc",
+    "caption_style.h",
     "common_theme.cc",
     "common_theme.h",
     "native_theme.cc",
diff --git a/ui/native_theme/caption_style.cc b/ui/native_theme/caption_style.cc
new file mode 100644
index 0000000..4a94a07
--- /dev/null
+++ b/ui/native_theme/caption_style.cc
@@ -0,0 +1,32 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/native_theme/caption_style.h"
+
+#include "base/json/json_reader.h"
+#include "base/values.h"
+
+namespace ui {
+
+CaptionStyle::CaptionStyle() = default;
+CaptionStyle::CaptionStyle(const CaptionStyle& other) = default;
+CaptionStyle::~CaptionStyle() = default;
+
+// static
+CaptionStyle CaptionStyle::FromSpec(const std::string& spec) {
+  CaptionStyle style;
+  std::unique_ptr<base::Value> dict = base::JSONReader::Read(spec);
+
+  if (!dict || !dict->is_dict())
+    return style;
+
+  if (const std::string* value = dict->FindStringKey("text-color"))
+    style.text_color = *value;
+  if (const std::string* value = dict->FindStringKey("background-color"))
+    style.background_color = *value;
+
+  return style;
+}
+
+}  // namespace ui
diff --git a/ui/native_theme/caption_style.h b/ui/native_theme/caption_style.h
new file mode 100644
index 0000000..3ae45b51
--- /dev/null
+++ b/ui/native_theme/caption_style.h
@@ -0,0 +1,34 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_NATIVE_THEME_CAPTION_STYLE_H_
+#define UI_NATIVE_THEME_CAPTION_STYLE_H_
+
+#include "third_party/skia/include/core/SkColor.h"
+#include "third_party/skia/include/core/SkScalar.h"
+#include "ui/native_theme/native_theme_export.h"
+
+#include <string>
+
+namespace ui {
+
+struct NATIVE_THEME_EXPORT CaptionStyle {
+  CaptionStyle();
+  CaptionStyle(const CaptionStyle& other);
+  ~CaptionStyle();
+
+  // Returns a CaptionStyle parsed from a specification string, which is a
+  // serialized JSON object whose keys are strings and whose values are of
+  // variable types. See the body of this method for details. This is used to
+  // parse the value of the "--force-caption-style" command-line argument and
+  // for testing.
+  static CaptionStyle FromSpec(const std::string& spec);
+
+  std::string text_color;
+  std::string background_color;
+};
+
+}  // namespace ui
+
+#endif
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index d14f805..57272fc 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -54,4 +54,12 @@
       switches::kForceDarkMode);
 }
 
+CaptionStyle NativeTheme::GetSystemCaptionStyle() const {
+  std::string style =
+      base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+          switches::kForceCaptionStyle);
+
+  return CaptionStyle::FromSpec(style);
+}
+
 }  // namespace ui
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 9c100762..796fe26 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -14,6 +14,7 @@
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/native_widget_types.h"
+#include "ui/native_theme/caption_style.h"
 #include "ui/native_theme/native_theme_export.h"
 
 namespace gfx {
@@ -413,6 +414,9 @@
   // Whether OS-level dark mode (as in macOS Mojave or Windows 10) is enabled.
   virtual bool SystemDarkModeEnabled() const;
 
+  // Returns the system's caption style.
+  virtual CaptionStyle GetSystemCaptionStyle() const;
+
  protected:
   NativeTheme();
   virtual ~NativeTheme();
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 043d59c..bfd26c4d 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -505,6 +505,7 @@
     "//skia",
     "//third_party/icu",
     "//ui/accessibility",
+    "//ui/base/clipboard",
     "//ui/display",
     "//ui/native_theme",
     "//ui/native_theme:native_theme_browser",
@@ -520,6 +521,7 @@
     "//components/vector_icons",
     "//ui/accessibility:ax_enums_mojo",
     "//ui/base",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/compositor",
     "//ui/display",
@@ -893,6 +895,7 @@
     "//testing/gtest",
     "//ui/base",
     "//ui/base:test_support",
+    "//ui/base/clipboard:clipboard_test_support",
     "//ui/base/ime",
     "//ui/compositor",
     "//ui/compositor:test_support",
@@ -1086,6 +1089,7 @@
     "//ui/accessibility",
     "//ui/base",
     "//ui/base:test_support",
+    "//ui/base/clipboard",
     "//ui/base/ime",
     "//ui/compositor:test_support",
     "//ui/events:dom_keycode_converter",
diff --git a/ui/views/cocoa/drag_drop_client_mac_unittest.mm b/ui/views/cocoa/drag_drop_client_mac_unittest.mm
index 4f49c8b..f78a6f0a 100644
--- a/ui/views/cocoa/drag_drop_client_mac_unittest.mm
+++ b/ui/views/cocoa/drag_drop_client_mac_unittest.mm
@@ -130,7 +130,7 @@
   // View:
   bool GetDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override {
+      std::set<ui::ClipboardFormatType>* format_types) override {
     *formats |= formats_;
     return true;
   }
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index d813c85..f30abb99 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -783,7 +783,7 @@
     ConvertLocatedEventForRootView(source, root_view, &event_for_root);
     View* view = root_view->GetEventHandlerForPoint(event_for_root.location());
     Button* button = Button::AsButton(view);
-    if (button && button->IsHotTracked())
+    if (button)
       SetHotTrackedButton(button);
   }
 
@@ -923,7 +923,7 @@
 bool MenuController::GetDropFormats(
     SubmenuView* source,
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   return source->GetMenuItem()->GetDelegate()->GetDropFormats(
       source->GetMenuItem(), formats, format_types);
 }
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index 7673855..5407ce2d 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -164,7 +164,7 @@
 
   bool GetDropFormats(SubmenuView* source,
                       int* formats,
-                      std::set<ui::Clipboard::FormatType>* format_types);
+                      std::set<ui::ClipboardFormatType>* format_types);
   bool AreDropTypesRequired(SubmenuView* source);
   bool CanDrop(SubmenuView* source, const ui::OSExchangeData& data);
   void OnDragEntered(SubmenuView* source, const ui::DropTargetEvent& event);
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc
index 5f402b7..e0a3886e 100644
--- a/ui/views/controls/menu/menu_controller_unittest.cc
+++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -965,6 +965,8 @@
   ui::MouseEvent event(ui::ET_MOUSE_MOVED, location, location,
                        ui::EventTimeForNow(), 0, 0);
   ProcessMouseMoved(sub_menu, event);
+  EXPECT_EQ(button1, GetHotButton());
+  EXPECT_TRUE(button1->IsHotTracked());
 
   // Incrementing selection should move hot tracking to the second button (next
   // after the first button).
diff --git a/ui/views/controls/menu/menu_delegate.cc b/ui/views/controls/menu/menu_delegate.cc
index f8a91bc..d6157d86 100644
--- a/ui/views/controls/menu/menu_delegate.cc
+++ b/ui/views/controls/menu/menu_delegate.cc
@@ -81,7 +81,7 @@
 bool MenuDelegate::GetDropFormats(
     MenuItemView* menu,
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   return false;
 }
 
diff --git a/ui/views/controls/menu/menu_delegate.h b/ui/views/controls/menu/menu_delegate.h
index 234ef7e..921aef2 100644
--- a/ui/views/controls/menu/menu_delegate.h
+++ b/ui/views/controls/menu/menu_delegate.h
@@ -150,10 +150,9 @@
   virtual bool CanDrop(MenuItemView* menu, const OSExchangeData& data);
 
   // See view for a description of this method.
-  virtual bool GetDropFormats(
-      MenuItemView* menu,
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types);
+  virtual bool GetDropFormats(MenuItemView* menu,
+                              int* formats,
+                              std::set<ui::ClipboardFormatType>* format_types);
 
   // See view for a description of this method.
   virtual bool AreDropTypesRequired(MenuItemView* menu);
diff --git a/ui/views/controls/menu/submenu_view.cc b/ui/views/controls/menu/submenu_view.cc
index 82cb3ee..0796aec6 100644
--- a/ui/views/controls/menu/submenu_view.cc
+++ b/ui/views/controls/menu/submenu_view.cc
@@ -241,7 +241,7 @@
 
 bool SubmenuView::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   DCHECK(GetMenuItem()->GetMenuController());
   return GetMenuItem()->GetMenuController()->GetDropFormats(this, formats,
                                                             format_types);
diff --git a/ui/views/controls/menu/submenu_view.h b/ui/views/controls/menu/submenu_view.h
index 3705657..23c26fc 100644
--- a/ui/views/controls/menu/submenu_view.h
+++ b/ui/views/controls/menu/submenu_view.h
@@ -78,9 +78,8 @@
   void PaintChildren(const PaintInfo& paint_info) override;
 
   // Drag and drop methods. These are forwarded to the MenuController.
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const OSExchangeData& data) override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index dfc6699..9bccf2bc 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -914,7 +914,7 @@
 
 bool Textfield::GetDropFormats(
     int* formats,
-    std::set<ui::Clipboard::FormatType>* format_types) {
+    std::set<ui::ClipboardFormatType>* format_types) {
   if (!enabled() || read_only())
     return false;
   // TODO(msw): Can we support URL, FILENAME, etc.?
@@ -926,7 +926,7 @@
 
 bool Textfield::CanDrop(const OSExchangeData& data) {
   int formats;
-  std::set<ui::Clipboard::FormatType> format_types;
+  std::set<ui::ClipboardFormatType> format_types;
   GetDropFormats(&formats, &format_types);
   return enabled() && !read_only() && data.HasAnyFormat(formats, format_types);
 }
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 38b5655..db72373b 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -264,9 +264,8 @@
   bool CanHandleAccelerators() const override;
   void AboutToRequestFocusFromTabTraversal(bool reverse) override;
   bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override;
-  bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override;
+  bool GetDropFormats(int* formats,
+                      std::set<ui::ClipboardFormatType>* format_types) override;
   bool CanDrop(const ui::OSExchangeData& data) override;
   int OnDragUpdated(const ui::DropTargetEvent& event) override;
   void OnDragExited() override;
diff --git a/ui/views/controls/textfield/textfield_controller.h b/ui/views/controls/textfield/textfield_controller.h
index 041abeb..f5ecb1d 100644
--- a/ui/views/controls/textfield/textfield_controller.h
+++ b/ui/views/controls/textfield/textfield_controller.h
@@ -8,6 +8,8 @@
 #include <set>
 
 #include "base/strings/string16.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
+#include "ui/base/clipboard/clipboard_types.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "ui/views/views_export.h"
 
@@ -76,7 +78,7 @@
   // Enables the controller to append to the accepted drop formats.
   virtual void AppendDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) {}
+      std::set<ui::ClipboardFormatType>* format_types) {}
 
   // Called when a drop of dragged data happens on the textfield. This method is
   // called before regular handling of the drop. If this returns a drag
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index f7490f2c..7ae4765 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -1709,7 +1709,7 @@
   base::string16 string(ASCIIToUTF16("string "));
   data.SetString(string);
   int formats = 0;
-  std::set<ui::Clipboard::FormatType> format_types;
+  std::set<ui::ClipboardFormatType> format_types;
 
   // Ensure that disabled textfields do not accept drops.
   textfield_->SetEnabled(false);
@@ -1743,7 +1743,7 @@
   // Ensure that textfields do not accept non-OSExchangeData::STRING types.
   ui::OSExchangeData bad_data;
   bad_data.SetFilename(base::FilePath(FILE_PATH_LITERAL("x")));
-  ui::Clipboard::FormatType fmt = ui::Clipboard::GetBitmapFormatType();
+  ui::ClipboardFormatType fmt = ui::ClipboardFormatType::GetBitmapType();
   bad_data.SetPickledData(fmt, base::Pickle());
   bad_data.SetFileContents(base::FilePath(L"x"), "x");
   bad_data.SetHtml(base::string16(ASCIIToUTF16("x")), GURL("x.org"));
@@ -1807,7 +1807,7 @@
   ui::OSExchangeData data;
   int formats = 0;
   int operations = 0;
-  std::set<ui::Clipboard::FormatType> format_types;
+  std::set<ui::ClipboardFormatType> format_types;
 
   // Start dragging "ello".
   textfield_->SelectRange(gfx::Range(1, 5));
@@ -1858,7 +1858,7 @@
   ui::OSExchangeData data;
   int formats = 0;
   int operations = 0;
-  std::set<ui::Clipboard::FormatType> format_types;
+  std::set<ui::ClipboardFormatType> format_types;
 
   // Start dragging " worl".
   textfield_->SelectRange(gfx::Range(5, 10));
diff --git a/ui/views/mus/drag_interactive_uitest.cc b/ui/views/mus/drag_interactive_uitest.cc
index b4d8e0c..822de29 100644
--- a/ui/views/mus/drag_interactive_uitest.cc
+++ b/ui/views/mus/drag_interactive_uitest.cc
@@ -60,7 +60,7 @@
   // views::View overrides:
   bool GetDropFormats(
       int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types) override {
+      std::set<ui::ClipboardFormatType>* format_types) override {
     *formats = ui::OSExchangeData::STRING;
     return true;
   }
diff --git a/ui/views/test/scoped_views_test_helper.cc b/ui/views/test/scoped_views_test_helper.cc
index 0539389..d67af1e8 100644
--- a/ui/views/test/scoped_views_test_helper.cc
+++ b/ui/views/test/scoped_views_test_helper.cc
@@ -8,8 +8,8 @@
 
 #include "base/memory/ptr_util.h"
 #include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/test/test_clipboard.h"
 #include "ui/base/ime/input_method_initializer.h"
-#include "ui/base/test/test_clipboard.h"
 #include "ui/views/test/platform_test_helper.h"
 #include "ui/views/test/test_views_delegate.h"
 #include "ui/views/test/views_test_helper.h"
diff --git a/ui/views/view.cc b/ui/views/view.cc
index d1bb3cca..36a82eb 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1286,7 +1286,7 @@
 // Drag and drop ---------------------------------------------------------------
 
 bool View::GetDropFormats(int* formats,
-                          std::set<ui::Clipboard::FormatType>* format_types) {
+                          std::set<ui::ClipboardFormatType>* format_types) {
   return false;
 }
 
diff --git a/ui/views/view.h b/ui/views/view.h
index a46a3b0f..2aa7df41 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -24,6 +24,7 @@
 #include "ui/accessibility/ax_enums.mojom.h"
 #include "ui/base/accelerators/accelerator.h"
 #include "ui/base/class_property.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
 #include "ui/base/dragdrop/drag_drop_types.h"
 #include "ui/base/dragdrop/drop_target_event.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
@@ -1091,9 +1092,8 @@
   // |formats| is a bitmask of the formats defined bye OSExchangeData::Format.
   // The default implementation returns false, which means the view doesn't
   // support dropping.
-  virtual bool GetDropFormats(
-      int* formats,
-      std::set<ui::Clipboard::FormatType>* format_types);
+  virtual bool GetDropFormats(int* formats,
+                              std::set<ui::ClipboardFormatType>* format_types);
 
   // Override and return true if the data must be available before any drop
   // methods should be invoked. The default is false.
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index e562b63..2ea5f107 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -17,7 +17,7 @@
 #include "ui/aura/client/drag_drop_delegate.h"
 #include "ui/aura/window.h"
 #include "ui/aura/window_tree_host.h"
-#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
 #include "ui/base/dragdrop/drop_target_event.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
@@ -774,7 +774,7 @@
     actions.push_back(gfx::GetAtom(kXdndActionDirectSave));
     ui::SetStringProperty(
         xwindow_, gfx::GetAtom(kXdndDirectSave0),
-        gfx::GetAtom(ui::Clipboard::kMimeTypeText),
+        gfx::GetAtom(ui::kMimeTypeText),
         source_provider_->file_contents_name().AsUTF8Unsafe());
   }
   ui::SetAtomArrayProperty(xwindow_, kXdndActionList, "ATOM", actions);
diff --git a/ui/views/widget/drop_helper.cc b/ui/views/widget/drop_helper.cc
index f201f73..62f39b69 100644
--- a/ui/views/widget/drop_helper.cc
+++ b/ui/views/widget/drop_helper.cc
@@ -102,7 +102,7 @@
   }
 #else
   int formats = 0;
-  std::set<ui::Clipboard::FormatType> format_types;
+  std::set<ui::ClipboardFormatType> format_types;
   while (view && view != target_view_) {
     if (view->enabled() &&
         view->GetDropFormats(&formats, &format_types) &&
diff --git a/ui/views_content_client/views_content_client_main_parts.cc b/ui/views_content_client/views_content_client_main_parts.cc
index 6b180f9..3f5be001 100644
--- a/ui/views_content_client/views_content_client_main_parts.cc
+++ b/ui/views_content_client/views_content_client_main_parts.cc
@@ -7,6 +7,7 @@
 #include <utility>
 
 #include "base/run_loop.h"
+#include "build/build_config.h"
 #include "content/public/browser/context_factory.h"
 #include "content/shell/browser/shell_browser_context.h"
 #include "ui/base/ime/input_method_initializer.h"
@@ -25,6 +26,10 @@
 ViewsContentClientMainParts::~ViewsContentClientMainParts() {
 }
 
+#if !defined(OS_MACOSX)
+void ViewsContentClientMainParts::PreCreateMainMessageLoop() {}
+#endif
+
 void ViewsContentClientMainParts::PreMainMessageLoopRun() {
   ui::MaterialDesignController::Initialize();
   ui::InitializeInputMethodForTesting();
diff --git a/ui/views_content_client/views_content_client_main_parts.h b/ui/views_content_client/views_content_client_main_parts.h
index fec1081d..346299b 100644
--- a/ui/views_content_client/views_content_client_main_parts.h
+++ b/ui/views_content_client/views_content_client_main_parts.h
@@ -34,6 +34,9 @@
       const content::MainFunctionParams& content_params,
       ViewsContentClient* views_content_client);
 
+  // Invoked before the BrowserMainLoop constructor.
+  static void PreCreateMainMessageLoop();
+
   ~ViewsContentClientMainParts() override;
 
   // content::BrowserMainParts:
diff --git a/ui/views_content_client/views_content_client_main_parts_mac.mm b/ui/views_content_client/views_content_client_main_parts_mac.mm
index bceaa9c..d574099 100644
--- a/ui/views_content_client/views_content_client_main_parts_mac.mm
+++ b/ui/views_content_client/views_content_client_main_parts_mac.mm
@@ -10,6 +10,7 @@
 #include "base/path_service.h"
 #include "content/public/browser/plugin_service.h"
 #include "content/public/common/content_paths.h"
+#include "content/shell/browser/shell_application_mac.h"
 #include "content/shell/browser/shell_browser_context.h"
 #include "ui/views_content_client/views_content_client.h"
 #include "ui/views_content_client/views_content_client_main_parts.h"
@@ -84,6 +85,15 @@
       new ViewsContentClientMainPartsMac(content_params, views_content_client);
 }
 
+// static
+void ViewsContentClientMainParts::PreCreateMainMessageLoop() {
+  // Simply instantiating an instance of ShellCrApplication serves to register
+  // it as the application class. Do make sure that no other code has done this
+  // first, though.
+  CHECK_EQ(NSApp, nil);
+  [ShellCrApplication sharedApplication];
+}
+
 }  // namespace ui
 
 @implementation ViewsContentClientAppController
@@ -114,6 +124,8 @@
               keyEquivalent:@"q"];
   [appMenuItem setSubmenu:appMenu];
 
+  CHECK([NSApp isKindOfClass:[ShellCrApplication class]]);
+
   task_.Run();
 }
 
diff --git a/ui/views_content_client/views_content_main_delegate.cc b/ui/views_content_client/views_content_main_delegate.cc
index fe8ddf17..f4588304 100644
--- a/ui/views_content_client/views_content_main_delegate.cc
+++ b/ui/views_content_client/views_content_main_delegate.cc
@@ -15,6 +15,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/base/ui_base_paths.h"
 #include "ui/views_content_client/views_content_browser_client.h"
+#include "ui/views_content_client/views_content_client_main_parts.h"
 
 #if defined(OS_WIN)
 #include "base/logging_win.h"
@@ -79,6 +80,11 @@
   }
 }
 
+void ViewsContentMainDelegate::PreCreateMainMessageLoop() {
+  content::ContentMainDelegate::PreCreateMainMessageLoop();
+  ViewsContentClientMainParts::PreCreateMainMessageLoop();
+}
+
 content::ContentBrowserClient*
     ViewsContentMainDelegate::CreateContentBrowserClient() {
   browser_client_.reset(new ViewsContentBrowserClient(views_content_client_));
diff --git a/ui/views_content_client/views_content_main_delegate.h b/ui/views_content_client/views_content_main_delegate.h
index 4655719..4ef4396ec 100644
--- a/ui/views_content_client/views_content_main_delegate.h
+++ b/ui/views_content_client/views_content_main_delegate.h
@@ -24,6 +24,7 @@
   // content::ContentMainDelegate implementation
   bool BasicStartupComplete(int* exit_code) override;
   void PreSandboxStartup() override;
+  void PreCreateMainMessageLoop() override;
   content::ContentBrowserClient* CreateContentBrowserClient() override;
 
  private: