diff --git a/.eslintrc.js b/.eslintrc.js
index f8d9de4..8bcbd17b0 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -28,6 +28,22 @@
             'from chrome://resources/js/util.js instead of ' +
             'document.getElementById(\'id\')',
       },
+      {
+        'property': '__lookupGetter__',
+        'message': 'Use Object.getOwnPropertyDescriptor',
+      },
+      {
+        'property': '__lookupSetter__',
+        'message': 'Use Object.getOwnPropertyDescriptor',
+      },
+      {
+        'property': '__defineGetter__',
+        'message': 'Use Object.defineProperty',
+      },
+      {
+        'property': '__defineSetter__',
+        'message': 'Use Object.defineProperty',
+      },
     ],
     'semi': ['error', 'always'],
 
diff --git a/DEPS b/DEPS
index 816ba2fa..13952a28 100644
--- a/DEPS
+++ b/DEPS
@@ -138,11 +138,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '712f0a7bd31d2e5a00a7bc813ebb060f9f9ee601',
+  'skia_revision': '6bbeb4ab722279aa20f1b4c793dbe5fbc0afadcc',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': '58dbd381eaf270a00624e5bce6d1e714825acb98',
+  'v8_revision': '46e13cfbf489c51c7dc5088a5a6d9f0dc91b39c0',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
@@ -150,7 +150,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling ANGLE
   # and whatever else without interference from each other.
-  'angle_revision': '067687f467dd07f75079592398efd559fdc50ec3',
+  'angle_revision': 'dfd760055152076509c59b23e1604d83a7435688',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling SwiftShader
   # and whatever else without interference from each other.
@@ -158,7 +158,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': '6caa1897fd2c681fdc720dfa92c2b93f8e2645aa',
+  'pdfium_revision': '9d1193b591c5ac53cf1680c80692911f7dd26607',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling BoringSSL
   # and whatever else without interference from each other.
@@ -201,7 +201,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': 'fd047540b0cd3b3d7eeaf3fbf4dacc47a4d8b5d4',
+  'catapult_revision': '24b441ff93e89b23a6ee39e76d25f224a44f3ce7',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
@@ -807,7 +807,7 @@
 
   # Build tools for Chrome OS. Note: This depends on third_party/pyelftools.
   'src/third_party/chromite': {
-      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '4c41a603c5366f918f02657d9a5cec8e045ecbd1',
+      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '385e9d4f27d34bf2d43030216041acce17f3519c',
       'condition': 'checkout_linux',
   },
 
@@ -832,7 +832,7 @@
   },
 
   'src/third_party/depot_tools':
-    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '125f7cc4d52d831830561ebfed0d26bfa074003f',
+    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'dd2737e2b5727d836f2442d9a6d960ad978fed66',
 
   'src/third_party/devtools-node-modules':
     Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'),
@@ -1081,7 +1081,7 @@
   },
 
   'src/third_party/libvpx/source/libvpx':
-    Var('chromium_git') + '/webm/libvpx.git' + '@' +  'bb9511684f70a735b3b909712666021e178c93e7',
+    Var('chromium_git') + '/webm/libvpx.git' + '@' +  '7d9288f5f86e1b0a03ae5a555dc034e7055845ca',
 
   'src/third_party/libwebm/source':
     Var('chromium_git') + '/webm/libwebm.git' + '@' + '51ca718c3adf0ddedacd7df25fe45f67dc5a9ce1',
@@ -1187,7 +1187,7 @@
   },
 
   'src/third_party/perfetto':
-    Var('android_git') + '/platform/external/perfetto.git' + '@' +  '11bc2d513286ac77852d4a7d85e44ee86831c3d7',
+    Var('android_git') + '/platform/external/perfetto.git' + '@' +  '7afb8a45a3894a2641f478fb2c69ee0721e3241a',
 
   'src/third_party/perl': {
       'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3',
@@ -1396,7 +1396,7 @@
     Var('chromium_git') + '/v8/v8.git' + '@' +  Var('v8_revision'),
 
   'src-internal': {
-    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@ce6b75e9ac476350942ee2a4092f4341cc84490b',
+    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@13820f2a7ac9d98d6fd070dd861d1354f06162ee',
     'condition': 'checkout_src_internal',
   },
 
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 6552d35..eac143b 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -3332,33 +3332,6 @@
   return results
 
 
-_DEPRECATED_JS = [
-  ( "__lookupGetter__", "Object.getOwnPropertyDescriptor" ),
-  ( "__defineGetter__", "Object.defineProperty" ),
-  ( "__lookupSetter__", "Object.getOwnPropertyDescriptor" ),
-  ( "__defineSetter__", "Object.defineProperty" ),
-]
-
-
-# TODO: add unit tests
-def _CheckNoDeprecatedJs(input_api, output_api):
-  """Make sure that we don't use deprecated JS in Chrome code."""
-  results = []
-  file_inclusion_pattern = [r".+\.js$"]  # TODO(dbeam): .html?
-  black_list = (_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS +
-                input_api.DEFAULT_BLACK_LIST)
-  file_filter = lambda f: input_api.FilterSourceFile(
-      f, white_list=file_inclusion_pattern, black_list=black_list)
-  for fpath in input_api.AffectedFiles(file_filter=file_filter):
-    for lnum, line in fpath.ChangedContents():
-      for (deprecated, replacement) in _DEPRECATED_JS:
-        if deprecated in line:
-          results.append(output_api.PresubmitError(
-              "%s:%d: Use of deprecated JS %s, use %s instead" %
-              (fpath.LocalPath(), lnum, deprecated, replacement)))
-  return results
-
-
 def _CheckForRelativeIncludes(input_api, output_api):
   bad_files = {}
   for f in input_api.AffectedFiles(include_deletes=False):
@@ -3789,7 +3762,6 @@
   results.extend(_CheckForAnonymousVariables(input_api, output_api))
   results.extend(_CheckUserActionUpdate(input_api, output_api))
   results.extend(_CheckNoDeprecatedCss(input_api, output_api))
-  results.extend(_CheckNoDeprecatedJs(input_api, output_api))
   results.extend(_CheckParseErrors(input_api, output_api))
   results.extend(_CheckForIPCRules(input_api, output_api))
   results.extend(_CheckForLongPathnames(input_api, output_api))
diff --git a/android_webview/BUILD.gn b/android_webview/BUILD.gn
index 701b9262..476a861 100644
--- a/android_webview/BUILD.gn
+++ b/android_webview/BUILD.gn
@@ -68,7 +68,6 @@
     "java/src/org/chromium/android_webview/gfx/JavaBrowserViewRendererHelper.java",
     "java/src/org/chromium/android_webview/permission/AwPermissionRequest.java",
   ]
-  jni_package = "android_webview"
 
   deps = [
     ":cancellation_signal_android_jar_jni_headers",
@@ -77,7 +76,6 @@
 
 generate_jar_jni("cancellation_signal_android_jar_jni_headers") {
   classes = [ "android/os/CancellationSignal.class" ]
-  jni_package = "android_webview"
 }
 
 java_cpp_enum("aw_permission_request_resource") {
diff --git a/android_webview/DEPS b/android_webview/DEPS
index e160059..9a1bae88 100644
--- a/android_webview/DEPS
+++ b/android_webview/DEPS
@@ -7,6 +7,7 @@
   # lib is the top-level target, and must remain a leaf in the dependency tree.
   "-android_webview/lib",
 
+  "+android_webview/native_jni",
   "+components/about_ui",
   "+components/content_capture",
   "+components/embedder_support/android/java",
@@ -23,7 +24,6 @@
   "+content/public/common",
   "+crypto",
   "+gpu",
-  "+jni",
   # Only this one header in media which doesn't depend on anything else.
   "+media/media_buildflags.h",
   "+mojo/public/cpp/bindings",
diff --git a/android_webview/apk/webview_apk_application.cc b/android_webview/apk/webview_apk_application.cc
index 9167db9..bb57289 100644
--- a/android_webview/apk/webview_apk_application.cc
+++ b/android_webview/apk/webview_apk_application.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 "jni/WebViewApkApplication_jni.h"
+#include "android_webview/native_jni/WebViewApkApplication_jni.h"
 
 #include "android_webview/common/aw_resource_bundle.h"
 #include "base/android/base_jni_onload.h"
diff --git a/android_webview/browser/DEPS b/android_webview/browser/DEPS
index 9659f87..a06250fc 100644
--- a/android_webview/browser/DEPS
+++ b/android_webview/browser/DEPS
@@ -3,7 +3,8 @@
   "+android_webview/browser",
   "+android_webview/common",
   "+android_webview/grit",
-  "+android_webview/jni",
+  "+android_webview/native_jni",
+  "+android_webview/test/android_webview_unittests_jni",
   "+cc",
   "+components/autofill/android",
   "+components/autofill/content/browser",
diff --git a/android_webview/browser/android_protocol_handler.cc b/android_webview/browser/android_protocol_handler.cc
index 8200ed4d..f26f8b3 100644
--- a/android_webview/browser/android_protocol_handler.cc
+++ b/android_webview/browser/android_protocol_handler.cc
@@ -11,11 +11,11 @@
 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
 #include "android_webview/browser/net/aw_url_request_job_factory.h"
 #include "android_webview/common/url_constants.h"
+#include "android_webview/native_jni/AndroidProtocolHandler_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/android/jni_weak_ref.h"
 #include "content/public/common/url_constants.h"
-#include "jni/AndroidProtocolHandler_jni.h"
 #include "net/base/io_buffer.h"
 #include "net/base/mime_util.h"
 #include "net/base/net_errors.h"
diff --git a/android_webview/browser/aw_autofill_client.cc b/android_webview/browser/aw_autofill_client.cc
index 5cbaa9c..489c517 100644
--- a/android_webview/browser/aw_autofill_client.cc
+++ b/android_webview/browser/aw_autofill_client.cc
@@ -8,6 +8,7 @@
 #include "android_webview/browser/aw_content_browser_client.h"
 #include "android_webview/browser/aw_contents.h"
 #include "android_webview/browser/aw_form_database_service.h"
+#include "android_webview/native_jni/AwAutofillClient_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
@@ -23,7 +24,6 @@
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/ssl_status.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AwAutofillClient_jni.h"
 #include "ui/android/view_android.h"
 #include "ui/gfx/geometry/rect_f.h"
 
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc
index d370330..9e17af6a 100644
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -260,11 +260,11 @@
   return autocomplete_history_manager_.get();
 }
 
-base::FilePath AwBrowserContext::GetPath() const {
+base::FilePath AwBrowserContext::GetPath() {
   return context_storage_path_;
 }
 
-bool AwBrowserContext::IsOffTheRecord() const {
+bool AwBrowserContext::IsOffTheRecord() {
   // Android WebView does not support off the record profile yet.
   return false;
 }
diff --git a/android_webview/browser/aw_browser_context.h b/android_webview/browser/aw_browser_context.h
index de221e40a..0b7c78b 100644
--- a/android_webview/browser/aw_browser_context.h
+++ b/android_webview/browser/aw_browser_context.h
@@ -110,8 +110,8 @@
   autofill::AutocompleteHistoryManager* GetAutocompleteHistoryManager();
 
   // content::BrowserContext implementation.
-  base::FilePath GetPath() const override;
-  bool IsOffTheRecord() const override;
+  base::FilePath GetPath() override;
+  bool IsOffTheRecord() override;
   content::ResourceContext* GetResourceContext() override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/android_webview/browser/aw_browser_main_parts.cc b/android_webview/browser/aw_browser_main_parts.cc
index 42b56e1e..ce2130d 100644
--- a/android_webview/browser/aw_browser_main_parts.cc
+++ b/android_webview/browser/aw_browser_main_parts.cc
@@ -117,7 +117,7 @@
 
 void AwBrowserMainParts::PreMainMessageLoopRun() {
   AwBrowserContext* context = browser_client_->InitBrowserContext();
-  context->PreMainMessageLoopRun(browser_client_->GetNetLog());
+  context->PreMainMessageLoopRun(browser_client_->GetNonNetworkServiceNetLog());
 
   content::RenderFrameHost::AllowInjectingJavaScript();
 }
diff --git a/android_webview/browser/aw_browser_terminator.cc b/android_webview/browser/aw_browser_terminator.cc
index 7ffdcdf..d1d6ca7 100644
--- a/android_webview/browser/aw_browser_terminator.cc
+++ b/android_webview/browser/aw_browser_terminator.cc
@@ -9,6 +9,7 @@
 
 #include "android_webview/browser/aw_render_process_gone_delegate.h"
 #include "android_webview/common/aw_descriptors.h"
+#include "android_webview/native_jni/AwBrowserProcess_jni.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/logging.h"
 #include "base/stl_util.h"
@@ -27,7 +28,6 @@
 #include "content/public/browser/render_widget_host.h"
 #include "content/public/browser/render_widget_host_iterator.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AwBrowserProcess_jni.h"
 
 using base::android::ScopedJavaGlobalRef;
 using content::BrowserThread;
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc
index 16f929a..4976a62e 100644
--- a/android_webview/browser/aw_content_browser_client.cc
+++ b/android_webview/browser/aw_content_browser_client.cc
@@ -312,8 +312,7 @@
 
 AwContentBrowserClient::AwContentBrowserClient(
     AwFeatureListCreator* aw_feature_list_creator)
-    : net_log_(new net::NetLog()),
-      aw_feature_list_creator_(aw_feature_list_creator) {
+    : aw_feature_list_creator_(aw_feature_list_creator) {
   // |aw_feature_list_creator| should not be null. The AwBrowserContext will
   // take the PrefService owned by the creator as the Local State instead
   // of loading the JSON file from disk.
@@ -326,6 +325,9 @@
   frame_interfaces_.AddInterface(
       base::BindRepeating(&DummyBindPasswordManagerDriver));
   sniff_file_urls_ = AwSettings::GetAllowSniffingFileUrls();
+
+  if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
+    non_network_service_net_log_.reset(new net::NetLog());
 }
 
 AwContentBrowserClient::~AwContentBrowserClient() {}
@@ -681,8 +683,8 @@
   AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
 }
 
-net::NetLog* AwContentBrowserClient::GetNetLog() {
-  return net_log_.get();
+net::NetLog* AwContentBrowserClient::GetNonNetworkServiceNetLog() {
+  return non_network_service_net_log_.get();
 }
 
 base::FilePath AwContentBrowserClient::GetDefaultDownloadDirectory() {
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h
index 612cff9c..abd9ca5 100644
--- a/android_webview/browser/aw_content_browser_client.h
+++ b/android_webview/browser/aw_content_browser_client.h
@@ -140,7 +140,6 @@
                        bool opener_suppressed,
                        bool* no_javascript_access) override;
   void ResourceDispatcherHostCreated() override;
-  net::NetLog* GetNetLog() override;
   base::FilePath GetDefaultDownloadDirectory() override;
   std::string GetDefaultDownloadName() override;
   void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
@@ -259,12 +258,15 @@
   content::SpeechRecognitionManagerDelegate*
   CreateSpeechRecognitionManagerDelegate() override;
 
+  net::NetLog* GetNonNetworkServiceNetLog();
+
   static void DisableCreatingThreadPool();
 
  private:
   safe_browsing::UrlCheckerDelegate* GetSafeBrowsingUrlCheckerDelegate();
 
-  std::unique_ptr<net::NetLog> net_log_;
+  // TODO(eroman): Remove once WebView has switched over to NetworkService.
+  std::unique_ptr<net::NetLog> non_network_service_net_log_;
 
   // Android WebView currently has a single global (non-off-the-record) browser
   // context.
diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc
index 98a3795..bbfb877b 100644
--- a/android_webview/browser/aw_contents.cc
+++ b/android_webview/browser/aw_contents.cc
@@ -36,6 +36,7 @@
 #include "android_webview/common/aw_hit_test_data.h"
 #include "android_webview/common/aw_switches.h"
 #include "android_webview/common/devtools_instrumentation.h"
+#include "android_webview/native_jni/AwContents_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
@@ -83,7 +84,6 @@
 #include "content/public/browser/web_contents.h"
 #include "content/public/common/mhtml_generation_params.h"
 #include "content/public/common/use_zoom_for_dsf_policy.h"
-#include "jni/AwContents_jni.h"
 #include "net/base/auth.h"
 #include "net/cert/x509_certificate.h"
 #include "net/cert/x509_util.h"
diff --git a/android_webview/browser/aw_contents_client_bridge.cc b/android_webview/browser/aw_contents_client_bridge.cc
index 2a8c90e..1fbcb210 100644
--- a/android_webview/browser/aw_contents_client_bridge.cc
+++ b/android_webview/browser/aw_contents_client_bridge.cc
@@ -9,6 +9,7 @@
 
 #include "android_webview/common/devtools_instrumentation.h"
 #include "android_webview/grit/components_strings.h"
+#include "android_webview/native_jni/AwContentsClientBridge_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
@@ -20,7 +21,6 @@
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AwContentsClientBridge_jni.h"
 #include "net/cert/x509_certificate.h"
 #include "net/cert/x509_util.h"
 #include "net/http/http_response_headers.h"
diff --git a/android_webview/browser/aw_contents_client_bridge_unittest.cc b/android_webview/browser/aw_contents_client_bridge_unittest.cc
index 203bcbea..8e6dce2d 100644
--- a/android_webview/browser/aw_contents_client_bridge_unittest.cc
+++ b/android_webview/browser/aw_contents_client_bridge_unittest.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 
+#include "android_webview/test/android_webview_unittests_jni/MockAwContentsClientBridge_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/scoped_java_ref.h"
@@ -15,7 +16,6 @@
 #include "base/run_loop.h"
 #include "content/public/browser/client_certificate_delegate.h"
 #include "content/public/test/test_browser_thread_bundle.h"
-#include "jni/MockAwContentsClientBridge_jni.h"
 #include "net/cert/x509_certificate.h"
 #include "net/ssl/ssl_cert_request_info.h"
 #include "net/ssl/ssl_private_key.h"
diff --git a/android_webview/browser/aw_contents_io_thread_client.cc b/android_webview/browser/aw_contents_io_thread_client.cc
index 5d4e3187..89a1785 100644
--- a/android_webview/browser/aw_contents_io_thread_client.cc
+++ b/android_webview/browser/aw_contents_io_thread_client.cc
@@ -11,6 +11,8 @@
 #include "android_webview/browser/net/aw_web_resource_request.h"
 #include "android_webview/browser/net/aw_web_resource_response.h"
 #include "android_webview/common/devtools_instrumentation.h"
+#include "android_webview/native_jni/AwContentsBackgroundThreadClient_jni.h"
+#include "android_webview/native_jni/AwContentsIoThreadClient_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/jni_weak_ref.h"
@@ -27,8 +29,6 @@
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_observer.h"
-#include "jni/AwContentsBackgroundThreadClient_jni.h"
-#include "jni/AwContentsIoThreadClient_jni.h"
 #include "net/base/data_url.h"
 #include "net/url_request/url_request.h"
 #include "services/network/public/cpp/resource_request.h"
diff --git a/android_webview/browser/aw_contents_lifecycle_notifier.cc b/android_webview/browser/aw_contents_lifecycle_notifier.cc
index 32f7f64..3621a3b 100644
--- a/android_webview/browser/aw_contents_lifecycle_notifier.cc
+++ b/android_webview/browser/aw_contents_lifecycle_notifier.cc
@@ -4,7 +4,7 @@
 
 #include "android_webview/browser/aw_contents_lifecycle_notifier.h"
 
-#include "jni/AwContentsLifecycleNotifier_jni.h"
+#include "android_webview/native_jni/AwContentsLifecycleNotifier_jni.h"
 
 using base::android::AttachCurrentThread;
 
diff --git a/android_webview/browser/aw_contents_statics.cc b/android_webview/browser/aw_contents_statics.cc
index b90408ae..efa56f11 100644
--- a/android_webview/browser/aw_contents_statics.cc
+++ b/android_webview/browser/aw_contents_statics.cc
@@ -8,6 +8,7 @@
 #include "android_webview/browser/aw_contents_io_thread_client.h"
 #include "android_webview/browser/net/aw_url_request_context_getter.h"
 #include "android_webview/browser/safe_browsing/aw_safe_browsing_whitelist_manager.h"
+#include "android_webview/native_jni/AwContentsStatics_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
@@ -23,7 +24,6 @@
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/storage_partition.h"
 #include "content/public/common/url_constants.h"
-#include "jni/AwContentsStatics_jni.h"
 #include "net/cert/cert_database.h"
 
 using base::android::AttachCurrentThread;
diff --git a/android_webview/browser/aw_debug.cc b/android_webview/browser/aw_debug.cc
index d56d87b..74a3e0e 100644
--- a/android_webview/browser/aw_debug.cc
+++ b/android_webview/browser/aw_debug.cc
@@ -8,6 +8,7 @@
 
 #include "android_webview/common/crash_reporter/aw_crash_reporter_client.h"
 #include "android_webview/common/crash_reporter/crash_keys.h"
+#include "android_webview/native_jni/AwDebug_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/android/path_utils.h"
@@ -23,7 +24,6 @@
 #include "components/version_info/android/channel_getter.h"
 #include "components/version_info/version_info.h"
 #include "components/version_info/version_info_values.h"
-#include "jni/AwDebug_jni.h"
 #include "third_party/crashpad/crashpad/client/crash_report_database.h"
 #include "third_party/crashpad/crashpad/util/net/http_body.h"
 #include "third_party/crashpad/crashpad/util/net/http_multipart_builder.h"
diff --git a/android_webview/browser/aw_devtools_server.cc b/android_webview/browser/aw_devtools_server.cc
index 8ab1b929..81bbf47 100644
--- a/android_webview/browser/aw_devtools_server.cc
+++ b/android_webview/browser/aw_devtools_server.cc
@@ -9,6 +9,7 @@
 #include "android_webview/browser/aw_contents.h"
 #include "android_webview/browser/gfx/browser_view_renderer.h"
 #include "android_webview/common/aw_content_client.h"
+#include "android_webview/native_jni/AwDevToolsServer_jni.h"
 #include "base/bind.h"
 #include "base/files/file_path.h"
 #include "base/json/json_writer.h"
@@ -21,7 +22,6 @@
 #include "content/public/browser/devtools_socket_factory.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/common/user_agent.h"
-#include "jni/AwDevToolsServer_jni.h"
 #include "net/base/net_errors.h"
 #include "net/socket/unix_domain_server_socket_posix.h"
 
diff --git a/android_webview/browser/aw_feature_list.cc b/android_webview/browser/aw_feature_list.cc
index 1b4247a1f..846a497 100644
--- a/android_webview/browser/aw_feature_list.cc
+++ b/android_webview/browser/aw_feature_list.cc
@@ -6,11 +6,11 @@
 
 #include <string>
 
+#include "android_webview/native_jni/AwFeatureList_jni.h"
 #include "base/android/jni_string.h"
 #include "base/feature_list.h"
 #include "base/macros.h"
 #include "base/stl_util.h"
-#include "jni/AwFeatureList_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::JavaParamRef;
diff --git a/android_webview/browser/aw_form_database.cc b/android_webview/browser/aw_form_database.cc
index c751fd2..ad5c714 100644
--- a/android_webview/browser/aw_form_database.cc
+++ b/android_webview/browser/aw_form_database.cc
@@ -5,10 +5,10 @@
 #include "android_webview/browser/aw_browser_context.h"
 #include "android_webview/browser/aw_content_browser_client.h"
 #include "android_webview/browser/aw_form_database_service.h"
+#include "android_webview/native_jni/AwFormDatabase_jni.h"
 #include "base/android/jni_android.h"
 #include "base/logging.h"
 #include "base/time/time.h"
-#include "jni/AwFormDatabase_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/android_webview/browser/aw_http_auth_handler.cc b/android_webview/browser/aw_http_auth_handler.cc
index 4fa2eb3..6c4418fe 100644
--- a/android_webview/browser/aw_http_auth_handler.cc
+++ b/android_webview/browser/aw_http_auth_handler.cc
@@ -7,6 +7,7 @@
 #include <utility>
 
 #include "android_webview/browser/aw_contents.h"
+#include "android_webview/native_jni/AwHttpAuthHandler_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/bind.h"
@@ -15,7 +16,6 @@
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AwHttpAuthHandler_jni.h"
 #include "net/base/auth.h"
 
 using base::android::ConvertJavaStringToUTF16;
diff --git a/android_webview/browser/aw_metrics_log_uploader.cc b/android_webview/browser/aw_metrics_log_uploader.cc
index cdd5ff5..bb9284b8 100644
--- a/android_webview/browser/aw_metrics_log_uploader.cc
+++ b/android_webview/browser/aw_metrics_log_uploader.cc
@@ -4,7 +4,7 @@
 
 #include "android_webview/browser/aw_metrics_log_uploader.h"
 
-#include "android_webview/jni/AwMetricsLogUploader_jni.h"
+#include "android_webview/native_jni/AwMetricsLogUploader_jni.h"
 #include "base/android/jni_array.h"
 #include "components/metrics/log_decoder.h"
 
diff --git a/android_webview/browser/aw_metrics_service_client.cc b/android_webview/browser/aw_metrics_service_client.cc
index d98a0a9c..5f6739c1 100644
--- a/android_webview/browser/aw_metrics_service_client.cc
+++ b/android_webview/browser/aw_metrics_service_client.cc
@@ -11,7 +11,7 @@
 #include "android_webview/browser/aw_feature_list.h"
 #include "android_webview/browser/aw_metrics_log_uploader.h"
 #include "android_webview/common/aw_switches.h"
-#include "android_webview/jni/AwMetricsServiceClient_jni.h"
+#include "android_webview/native_jni/AwMetricsServiceClient_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
diff --git a/android_webview/browser/aw_pdf_exporter.cc b/android_webview/browser/aw_pdf_exporter.cc
index e65040b..4900765 100644
--- a/android_webview/browser/aw_pdf_exporter.cc
+++ b/android_webview/browser/aw_pdf_exporter.cc
@@ -5,11 +5,11 @@
 #include "android_webview/browser/aw_pdf_exporter.h"
 
 #include "android_webview/browser/aw_print_manager.h"
+#include "android_webview/native_jni/AwPdfExporter_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/bind.h"
 #include "content/public/browser/browser_thread.h"
-#include "jni/AwPdfExporter_jni.h"
 #include "printing/print_settings.h"
 #include "printing/units.h"
 
diff --git a/android_webview/browser/aw_proxy_controller.cc b/android_webview/browser/aw_proxy_controller.cc
index bbf9e6c4..ba648c74 100644
--- a/android_webview/browser/aw_proxy_controller.cc
+++ b/android_webview/browser/aw_proxy_controller.cc
@@ -5,6 +5,7 @@
 #include "android_webview/browser/aw_browser_context.h"
 #include "android_webview/browser/net/aw_proxy_config_monitor.h"
 #include "android_webview/browser/net/aw_url_request_context_getter.h"
+#include "android_webview/native_jni/AwProxyController_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
@@ -13,7 +14,6 @@
 #include "base/feature_list.h"
 #include "base/message_loop/message_loop_current.h"
 #include "content/public/browser/browser_thread.h"
-#include "jni/AwProxyController_jni.h"
 #include "net/proxy_resolution/proxy_config_service_android.h"
 #include "services/network/public/cpp/features.h"
 
diff --git a/android_webview/browser/aw_quota_manager_bridge.cc b/android_webview/browser/aw_quota_manager_bridge.cc
index 9ea0175..89ebafdb 100644
--- a/android_webview/browser/aw_quota_manager_bridge.cc
+++ b/android_webview/browser/aw_quota_manager_bridge.cc
@@ -8,6 +8,7 @@
 
 #include "android_webview/browser/aw_browser_context.h"
 #include "android_webview/browser/aw_content_browser_client.h"
+#include "android_webview/native_jni/AwQuotaManagerBridge_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/bind.h"
@@ -19,7 +20,6 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
 #include "content/public/common/content_client.h"
-#include "jni/AwQuotaManagerBridge_jni.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "third_party/blink/public/mojom/quota/quota_types.mojom.h"
 #include "url/gurl.h"
diff --git a/android_webview/browser/aw_render_process.cc b/android_webview/browser/aw_render_process.cc
index 7e1a25e..5ab6af1 100644
--- a/android_webview/browser/aw_render_process.cc
+++ b/android_webview/browser/aw_render_process.cc
@@ -10,7 +10,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_process_host.h"
 
-#include "jni/AwRenderProcess_jni.h"
+#include "android_webview/native_jni/AwRenderProcess_jni.h"
 
 using base::android::AttachCurrentThread;
 using content::BrowserThread;
diff --git a/android_webview/browser/aw_settings.cc b/android_webview/browser/aw_settings.cc
index 62fbd981..799ffb2 100644
--- a/android_webview/browser/aw_settings.cc
+++ b/android_webview/browser/aw_settings.cc
@@ -11,6 +11,7 @@
 #include "android_webview/browser/aw_contents.h"
 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
 #include "android_webview/common/aw_content_client.h"
+#include "android_webview/native_jni/AwSettings_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/macros.h"
@@ -23,7 +24,6 @@
 #include "content/public/browser/storage_partition.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/common/web_preferences.h"
-#include "jni/AwSettings_jni.h"
 #include "net/http/http_util.h"
 #include "services/network/public/cpp/features.h"
 #include "third_party/blink/public/mojom/renderer_preferences.mojom.h"
diff --git a/android_webview/browser/aw_variations_seed_bridge.cc b/android_webview/browser/aw_variations_seed_bridge.cc
index 7102357..e178afa 100644
--- a/android_webview/browser/aw_variations_seed_bridge.cc
+++ b/android_webview/browser/aw_variations_seed_bridge.cc
@@ -10,11 +10,11 @@
 #include <string>
 #include <vector>
 
+#include "android_webview/native_jni/AwVariationsSeedBridge_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "components/variations/seed_response.h"
-#include "jni/AwVariationsSeedBridge_jni.h"
 
 namespace android_webview {
 
diff --git a/android_webview/browser/aw_web_contents_delegate.cc b/android_webview/browser/aw_web_contents_delegate.cc
index d898acdb..91961fa 100644
--- a/android_webview/browser/aw_web_contents_delegate.cc
+++ b/android_webview/browser/aw_web_contents_delegate.cc
@@ -12,6 +12,7 @@
 #include "android_webview/browser/find_helper.h"
 #include "android_webview/browser/permission/media_access_permission_request.h"
 #include "android_webview/browser/permission/permission_request_handler.h"
+#include "android_webview/native_jni/AwWebContentsDelegate_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
@@ -29,7 +30,6 @@
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AwWebContentsDelegate_jni.h"
 #include "net/base/filename_util.h"
 #include "third_party/blink/public/common/mediastream/media_stream_request.h"
 #include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h"
diff --git a/android_webview/browser/cookie_manager.cc b/android_webview/browser/cookie_manager.cc
index f2d89a9..86bd4d6 100644
--- a/android_webview/browser/cookie_manager.cc
+++ b/android_webview/browser/cookie_manager.cc
@@ -13,6 +13,7 @@
 #include "android_webview/browser/aw_browser_context.h"
 #include "android_webview/browser/aw_cookie_access_policy.h"
 #include "android_webview/browser/net/init_native_callback.h"
+#include "android_webview/native_jni/AwCookieManager_jni.h"
 #include "base/android/callback_android.h"
 #include "base/android/jni_string.h"
 #include "base/android/path_utils.h"
@@ -33,7 +34,6 @@
 #include "base/time/time.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/cookie_store_factory.h"
-#include "jni/AwCookieManager_jni.h"
 #include "net/cookies/canonical_cookie.h"
 #include "net/cookies/cookie_monster.h"
 #include "net/cookies/cookie_options.h"
diff --git a/android_webview/browser/gfx/DEPS b/android_webview/browser/gfx/DEPS
index ef91ac3..2f8f9a0 100644
--- a/android_webview/browser/gfx/DEPS
+++ b/android_webview/browser/gfx/DEPS
@@ -2,6 +2,7 @@
   "-android_webview",
   "-android_webview/browser",
   "+android_webview/browser/gfx",
+  "+android_webview/native_jni",
   "+android_webview/common/aw_switches.h",
   "+android_webview/public/browser",
 ]
diff --git a/android_webview/browser/gfx/aw_draw_fn_impl.cc b/android_webview/browser/gfx/aw_draw_fn_impl.cc
index 0b2410b8..6adeace1 100644
--- a/android_webview/browser/gfx/aw_draw_fn_impl.cc
+++ b/android_webview/browser/gfx/aw_draw_fn_impl.cc
@@ -8,6 +8,7 @@
 
 #include "android_webview/browser/gfx/aw_vulkan_context_provider.h"
 #include "android_webview/common/aw_switches.h"
+#include "android_webview/native_jni/AwDrawFnImpl_jni.h"
 #include "android_webview/public/browser/draw_gl.h"
 #include "base/android/android_hardware_buffer_compat.h"
 #include "base/android/scoped_hardware_buffer_fence_sync.h"
@@ -19,7 +20,6 @@
 #include "gpu/vulkan/vulkan_fence_helper.h"
 #include "gpu/vulkan/vulkan_function_pointers.h"
 #include "gpu/vulkan/vulkan_implementation.h"
-#include "jni/AwDrawFnImpl_jni.h"
 #include "third_party/skia/include/gpu/GrBackendSemaphore.h"
 #include "third_party/skia/include/gpu/GrContext.h"
 #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h"
diff --git a/android_webview/browser/gfx/aw_gl_functor.cc b/android_webview/browser/gfx/aw_gl_functor.cc
index bb26d8da..b9844f7 100644
--- a/android_webview/browser/gfx/aw_gl_functor.cc
+++ b/android_webview/browser/gfx/aw_gl_functor.cc
@@ -4,12 +4,12 @@
 
 #include "android_webview/browser/gfx/aw_gl_functor.h"
 
+#include "android_webview/native_jni/AwGLFunctor_jni.h"
 #include "android_webview/public/browser/draw_gl.h"
 #include "base/stl_util.h"
 #include "base/task/post_task.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
-#include "jni/AwGLFunctor_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::JavaParamRef;
diff --git a/android_webview/browser/gfx/aw_picture.cc b/android_webview/browser/gfx/aw_picture.cc
index 4fa249df..445ca1f 100644
--- a/android_webview/browser/gfx/aw_picture.cc
+++ b/android_webview/browser/gfx/aw_picture.cc
@@ -5,7 +5,7 @@
 #include "android_webview/browser/gfx/aw_picture.h"
 
 #include "android_webview/browser/gfx/java_browser_view_renderer_helper.h"
-#include "jni/AwPicture_jni.h"
+#include "android_webview/native_jni/AwPicture_jni.h"
 #include "third_party/skia/include/core/SkPicture.h"
 
 using base::android::JavaParamRef;
diff --git a/android_webview/browser/gfx/java_browser_view_renderer_helper.cc b/android_webview/browser/gfx/java_browser_view_renderer_helper.cc
index b0c5fda..d33340e 100644
--- a/android_webview/browser/gfx/java_browser_view_renderer_helper.cc
+++ b/android_webview/browser/gfx/java_browser_view_renderer_helper.cc
@@ -7,10 +7,10 @@
 #include <android/bitmap.h>
 #include <memory>
 
+#include "android_webview/native_jni/JavaBrowserViewRendererHelper_jni.h"
 #include "android_webview/public/browser/draw_sw.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/trace_event/trace_event.h"
-#include "jni/JavaBrowserViewRendererHelper_jni.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/skia/include/core/SkRefCnt.h"
 #include "third_party/skia/include/utils/SkCanvasStateUtils.h"
diff --git a/android_webview/browser/input_stream.cc b/android_webview/browser/input_stream.cc
index d0bbb11..63c7693 100644
--- a/android_webview/browser/input_stream.cc
+++ b/android_webview/browser/input_stream.cc
@@ -10,7 +10,7 @@
 // even if they're unused.
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
-#include "jni/InputStreamUtil_jni.h"
+#include "android_webview/native_jni/InputStreamUtil_jni.h"
 #pragma GCC diagnostic pop
 #include "net/base/io_buffer.h"
 
diff --git a/android_webview/browser/input_stream_unittest.cc b/android_webview/browser/input_stream_unittest.cc
index b41e6e4..bd099de 100644
--- a/android_webview/browser/input_stream_unittest.cc
+++ b/android_webview/browser/input_stream_unittest.cc
@@ -5,9 +5,9 @@
 #include <memory>
 
 #include "android_webview/browser/input_stream.h"
+#include "android_webview/test/android_webview_unittests_jni/InputStreamUnittest_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/scoped_java_ref.h"
-#include "jni/InputStreamUnittest_jni.h"
 #include "net/base/io_buffer.h"
 #include "net/base/net_errors.h"
 #include "net/http/http_byte_range.h"
diff --git a/android_webview/browser/net/aw_web_resource_response.cc b/android_webview/browser/net/aw_web_resource_response.cc
index c6568e7..82c6021 100644
--- a/android_webview/browser/net/aw_web_resource_response.cc
+++ b/android_webview/browser/net/aw_web_resource_response.cc
@@ -7,10 +7,10 @@
 #include <memory>
 
 #include "android_webview/browser/input_stream.h"
+#include "android_webview/native_jni/AwWebResourceResponse_jni.h"
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
-#include "jni/AwWebResourceResponse_jni.h"
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_request.h"
 #include "net/url_request/url_request_job.h"
diff --git a/android_webview/browser/permission/aw_permission_request.cc b/android_webview/browser/permission/aw_permission_request.cc
index b608a9f..343a82e0 100644
--- a/android_webview/browser/permission/aw_permission_request.cc
+++ b/android_webview/browser/permission/aw_permission_request.cc
@@ -7,8 +7,8 @@
 #include <utility>
 
 #include "android_webview/browser/permission/aw_permission_request_delegate.h"
+#include "android_webview/native_jni/AwPermissionRequest_jni.h"
 #include "base/android/jni_string.h"
-#include "jni/AwPermissionRequest_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertUTF8ToJavaString;
diff --git a/android_webview/browser/popup_touch_handle_drawable.cc b/android_webview/browser/popup_touch_handle_drawable.cc
index 665b7994..00bdca9 100644
--- a/android_webview/browser/popup_touch_handle_drawable.cc
+++ b/android_webview/browser/popup_touch_handle_drawable.cc
@@ -4,7 +4,7 @@
 
 #include "android_webview/browser/popup_touch_handle_drawable.h"
 
-#include "jni/PopupTouchHandleDrawable_jni.h"
+#include "android_webview/native_jni/PopupTouchHandleDrawable_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::ScopedJavaLocalRef;
diff --git a/android_webview/browser/tracing/aw_tracing_controller.cc b/android_webview/browser/tracing/aw_tracing_controller.cc
index ecf27c5..c81c5a2 100644
--- a/android_webview/browser/tracing/aw_tracing_controller.cc
+++ b/android_webview/browser/tracing/aw_tracing_controller.cc
@@ -15,7 +15,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/tracing_controller.h"
 
-#include "jni/AwTracingController_jni.h"
+#include "android_webview/native_jni/AwTracingController_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/android_webview/common/DEPS b/android_webview/common/DEPS
index 14a3dbc..d5b65ca7 100644
--- a/android_webview/common/DEPS
+++ b/android_webview/common/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "-android_webview",
   "+android_webview/common",
+  "+android_webview/native_jni",
   "+components/cdm/common",
   "+components/printing/common",
   "+media/base/android",
diff --git a/android_webview/common/aw_resource.cc b/android_webview/common/aw_resource.cc
index 77c92d3..f32e0e4 100644
--- a/android_webview/common/aw_resource.cc
+++ b/android_webview/common/aw_resource.cc
@@ -4,10 +4,10 @@
 
 #include "android_webview/common/aw_resource.h"
 
+#include "android_webview/native_jni/AwResource_jni.h"
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
-#include "jni/AwResource_jni.h"
 
 using base::android::ScopedJavaLocalRef;
 
diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn
index 8cc98d2..26a0179 100644
--- a/android_webview/test/BUILD.gn
+++ b/android_webview/test/BUILD.gn
@@ -375,7 +375,6 @@
 }
 
 generate_jni("android_webview_unittests_jni") {
-  jni_package = "android_webview_unittests"
   sources = [
     "../unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java",
     "../unittestjava/src/org/chromium/android_webview/unittest/MockAwContentsClientBridge.java",
diff --git a/android_webview/test/embedded_test_server/BUILD.gn b/android_webview/test/embedded_test_server/BUILD.gn
index c5d6540..297c3a8d 100644
--- a/android_webview/test/embedded_test_server/BUILD.gn
+++ b/android_webview/test/embedded_test_server/BUILD.gn
@@ -26,7 +26,6 @@
   sources = [
     "java/src/org/chromium/android_webview/test/AwEmbeddedTestServerImpl.java",
   ]
-  jni_package = "android_webview/test"
 }
 
 source_set("aw_java_test_native_support") {
diff --git a/android_webview/test/embedded_test_server/aw_embedded_test_server.cc b/android_webview/test/embedded_test_server/aw_embedded_test_server.cc
index 781384b8..a71bfe7 100644
--- a/android_webview/test/embedded_test_server/aw_embedded_test_server.cc
+++ b/android_webview/test/embedded_test_server/aw_embedded_test_server.cc
@@ -4,7 +4,7 @@
 
 #include <jni.h>
 
-#include "android_webview/test/jni/AwEmbeddedTestServerImpl_jni.h"
+#include "android_webview/test/embedded_test_server/aw_net_jni_headers/AwEmbeddedTestServerImpl_jni.h"
 #include "base/android/jni_array.h"
 #include "base/base64.h"
 #include "base/strings/stringprintf.h"
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc
index ba615ba..3c65f08 100644
--- a/ash/login/ui/lock_contents_view.cc
+++ b/ash/login/ui/lock_contents_view.cc
@@ -26,6 +26,7 @@
 #include "ash/login/ui/parent_access_view.h"
 #include "ash/login/ui/scrollable_users_list_view.h"
 #include "ash/login/ui/views_utils.h"
+#include "ash/media/media_controller_impl.h"
 #include "ash/public/cpp/ash_features.h"
 #include "ash/public/cpp/ash_switches.h"
 #include "ash/shelf/shelf.h"
@@ -322,7 +323,7 @@
 
 LockScreenMediaControlsView* LockContentsView::TestApi::media_controls_view()
     const {
-  return view_->media_controls_view_;
+  return view_->media_controls_view_.get();
 }
 
 views::View* LockContentsView::TestApi::note_action() const {
@@ -626,7 +627,7 @@
   primary_big_view_ = nullptr;
   opt_secondary_big_view_ = nullptr;
   users_list_ = nullptr;
-  media_controls_view_ = nullptr;
+  media_controls_view_.reset();
   layout_actions_.clear();
   // Removing child views can change focus, which may result in LockContentsView
   // getting focused. Make sure to clear internal references before that happens
@@ -1207,16 +1208,51 @@
                            std::min(available_width, desired_width));
 }
 
+bool LockContentsView::AreMediaControlsEnabled() const {
+  return Shell::Get()->media_controller()->AreLockScreenMediaKeysEnabled() &&
+         base::FeatureList::IsEnabled(features::kLockScreenMediaControls) &&
+         screen_type_ == LockScreen::ScreenType::kLock &&
+         !expanded_view_->GetVisible();
+}
+
+void LockContentsView::HideMediaControlsLayout() {
+  main_view_->RemoveChildView(media_controls_view_->GetMiddleSpacingView());
+  main_view_->RemoveChildView(media_controls_view_.get());
+
+  // Don't allow media keys to be used on lock screen since controls are hidden.
+  Shell::Get()->media_controller()->SetMediaControlsDismissed(true);
+
+  Layout();
+}
+
+void LockContentsView::CreateMediaControlsLayout() {
+  // |media_controls_view_| should not be attached to a parent.
+  DCHECK(!media_controls_view_->parent());
+
+  // Space between primary user and media controls.
+  main_view_->AddChildView(media_controls_view_->GetMiddleSpacingView());
+
+  // Media controls view.
+  main_view_->AddChildView(media_controls_view_.get());
+
+  // Set |spacing_middle|.
+  AddDisplayLayoutAction(base::BindRepeating(
+      &LockContentsView::SetLowDensitySpacing, base::Unretained(this),
+      media_controls_view_->GetMiddleSpacingView(), media_controls_view_.get(),
+      kDistanceBetweenAuthUserAndMediaControlsLandscapeDp,
+      kDistanceBetweenAuthUserAndMediaControlsPortraitDp));
+}
+
 void LockContentsView::CreateLowDensityLayout(
     const std::vector<LoginUserInfo>& users) {
   DCHECK_LE(users.size(), 2u);
 
   main_view_->AddChildView(primary_big_view_);
 
-  // If the lock screen media controls view should be shown.
-  const bool media_controls_enabled =
-      LockScreenMediaControlsView::AreMediaControlsEnabled(screen_type_,
-                                                           expanded_view_);
+  // Build media controls view.
+  media_controls_view_ = std::make_unique<LockScreenMediaControlsView>(
+      Shell::Get()->connector(), this);
+  media_controls_view_->set_owned_by_client();
 
   if (users.size() > 1) {
     // Space between primary user and secondary user.
@@ -1234,21 +1270,6 @@
         spacing_middle, opt_secondary_big_view_,
         kLowDensityDistanceBetweenUsersInLandscapeDp,
         kLowDensityDistanceBetweenUsersInPortraitDp));
-  } else if (media_controls_enabled) {
-    // Space between primary user and media controls.
-    auto* spacing_middle = new NonAccessibleView();
-    main_view_->AddChildView(spacing_middle);
-
-    // Build media controls view.
-    media_controls_view_ = new LockScreenMediaControlsView();
-    main_view_->AddChildView(media_controls_view_);
-
-    // Set |spacing_middle|.
-    AddDisplayLayoutAction(base::BindRepeating(
-        &LockContentsView::SetLowDensitySpacing, base::Unretained(this),
-        spacing_middle, media_controls_view_,
-        kDistanceBetweenAuthUserAndMediaControlsLandscapeDp,
-        kDistanceBetweenAuthUserAndMediaControlsPortraitDp));
   }
 }
 
diff --git a/ash/login/ui/lock_contents_view.h b/ash/login/ui/lock_contents_view.h
index 4419d12..bd828f1f 100644
--- a/ash/login/ui/lock_contents_view.h
+++ b/ash/login/ui/lock_contents_view.h
@@ -199,6 +199,11 @@
 
   void ShowAuthErrorMessageForDebug(int unlock_attempt);
 
+  // Called by LockScreenMediaControlsView.
+  void CreateMediaControlsLayout();
+  void HideMediaControlsLayout();
+  bool AreMediaControlsEnabled() const;
+
  private:
   class UserState {
    public:
@@ -355,7 +360,7 @@
   ScrollableUsersListView* users_list_ = nullptr;
 
   // View for media controls that appear on the lock screen if user enabled.
-  LockScreenMediaControlsView* media_controls_view_ = nullptr;
+  std::unique_ptr<LockScreenMediaControlsView> media_controls_view_;
 
   // View that contains the note action button and the system info labels,
   // placed on the top right corner of the screen without affecting layout of
diff --git a/ash/login/ui/lock_contents_view_unittest.cc b/ash/login/ui/lock_contents_view_unittest.cc
index da77730..fe8a5ec 100644
--- a/ash/login/ui/lock_contents_view_unittest.cc
+++ b/ash/login/ui/lock_contents_view_unittest.cc
@@ -15,6 +15,7 @@
 #include "ash/login/ui/arrow_button_view.h"
 #include "ash/login/ui/fake_login_detachable_base_model.h"
 #include "ash/login/ui/lock_screen.h"
+#include "ash/login/ui/lock_screen_media_controls_view.h"
 #include "ash/login/ui/login_auth_user_view.h"
 #include "ash/login/ui/login_big_user_view.h"
 #include "ash/login/ui/login_display_style.h"
@@ -41,9 +42,11 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/test/simple_test_tick_clock.h"
+#include "base/timer/mock_timer.h"
 #include "chromeos/dbus/power/fake_power_manager_client.h"
 #include "chromeos/dbus/power_manager/suspend.pb.h"
 #include "components/prefs/pref_service.h"
+#include "services/media_session/public/mojom/media_session.mojom.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/display/manager/display_manager.h"
 #include "ui/display/test/display_manager_test_api.h"
@@ -76,6 +79,18 @@
       PowerButtonController::kIgnoreRepeatedButtonUpDelay, false /*down*/);
 }
 
+void SimulateMediaSessionInfoChanged(
+    LockScreenMediaControlsView* media_controls,
+    media_session::mojom::MediaPlaybackState playback_state) {
+  // Create media session information.
+  media_session::mojom::MediaSessionInfoPtr session_info(
+      media_session::mojom::MediaSessionInfo::New());
+  session_info->playback_state = playback_state;
+
+  // Simulate media session information change.
+  media_controls->MediaSessionInfoChanged(std::move(session_info));
+}
+
 }  // namespace
 
 using LockContentsViewUnitTest = LoginTestBase;
@@ -2393,8 +2408,7 @@
             list_user_view->current_user().basic_user_info.account_id);
 }
 
-TEST_F(LockContentsViewUnitTest,
-       LockScreenMediaControlsShownIfFeaturesEnabled) {
+TEST_F(LockContentsViewUnitTest, LockScreenMediaControlsShownIfMediaPlaying) {
   // Enable media controls.
   base::test::ScopedFeatureList feature_list;
   feature_list.InitWithFeatures(
@@ -2409,15 +2423,20 @@
   std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
   LockContentsView::TestApi lock_contents(contents);
 
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
   // Verify media controls are shown.
-  EXPECT_TRUE(lock_contents.media_controls_view());
+  EXPECT_TRUE(lock_contents.media_controls_view()->IsDrawn());
 }
 
-TEST_F(LockContentsViewUnitTest,
-       LockScreenMediaControlsHiddenIfFeaturesDisabled) {
-  // Disable media controls.
+TEST_F(LockContentsViewUnitTest, LockScreenMediaControlsHiddenAfterDelay) {
+  // Enable media controls.
   base::test::ScopedFeatureList feature_list;
-  feature_list.InitWithFeatures({}, {features::kLockScreenMediaControls});
+  feature_list.InitWithFeatures(
+      {features::kLockScreenMediaKeys, features::kLockScreenMediaControls}, {});
 
   // Build lock screen with 1 user.
   auto* contents = new LockContentsView(
@@ -2428,8 +2447,137 @@
   std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
   LockContentsView::TestApi lock_contents(contents);
 
+  // Test timer
+  auto mock_timer_unique = std::make_unique<base::MockOneShotTimer>();
+  base::MockOneShotTimer* mock_timer = mock_timer_unique.get();
+  lock_contents.media_controls_view()->set_timer_for_testing(
+      std::move(mock_timer_unique));
+
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
+  // Simulate media session stopping and delay.
+  lock_contents.media_controls_view()->MediaSessionInfoChanged(nullptr);
+  mock_timer->Fire();
+  base::RunLoop().RunUntilIdle();
+
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
   // Verify media controls are hidden.
-  EXPECT_EQ(nullptr, lock_contents.media_controls_view());
+  EXPECT_FALSE(lock_contents.media_controls_view()->IsDrawn());
+}
+
+TEST_F(LockContentsViewUnitTest,
+       MediaControlsHiddenIfScreenLockedWhileMediaPaused) {
+  // Enable media controls.
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {features::kLockScreenMediaKeys, features::kLockScreenMediaControls}, {});
+
+  // Build lock screen with 1 user.
+  auto* contents = new LockContentsView(
+      mojom::TrayActionState::kNotAvailable, LockScreen::ScreenType::kLock,
+      DataDispatcher(),
+      std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher()));
+  SetUserCount(1);
+  std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
+  LockContentsView::TestApi lock_contents(contents);
+
+  // Simulate paused media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPaused);
+
+  // Verify media controls are hidden.
+  EXPECT_FALSE(lock_contents.media_controls_view()->IsDrawn());
+}
+
+TEST_F(LockContentsViewUnitTest, KeepMediaControlsShownWithinDelay) {
+  // Enable media controls.
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {features::kLockScreenMediaKeys, features::kLockScreenMediaControls}, {});
+
+  // Build lock screen with 1 user.
+  auto* contents = new LockContentsView(
+      mojom::TrayActionState::kNotAvailable, LockScreen::ScreenType::kLock,
+      DataDispatcher(),
+      std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher()));
+  SetUserCount(1);
+  std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
+  LockContentsView::TestApi lock_contents(contents);
+
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
+  // Simulate media session stopping.
+  lock_contents.media_controls_view()->MediaSessionInfoChanged(nullptr);
+
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
+  // Verify media controls are shown.
+  EXPECT_TRUE(lock_contents.media_controls_view()->IsDrawn());
+}
+
+TEST_F(LockContentsViewUnitTest, LockScreenMediaControlsHiddenNoMedia) {
+  // Enable media controls.
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {features::kLockScreenMediaKeys, features::kLockScreenMediaControls}, {});
+
+  // Build lock screen with 1 user.
+  auto* contents = new LockContentsView(
+      mojom::TrayActionState::kNotAvailable, LockScreen::ScreenType::kLock,
+      DataDispatcher(),
+      std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher()));
+  SetUserCount(1);
+  std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
+  LockContentsView::TestApi lock_contents(contents);
+
+  // Simulate no media session on lock screen.
+  lock_contents.media_controls_view()->MediaSessionInfoChanged(nullptr);
+
+  // Verify media controls are hidden.
+  EXPECT_FALSE(lock_contents.media_controls_view()->IsDrawn());
+}
+
+TEST_F(LockContentsViewUnitTest, ShowMediaControlsIfPausedAndAlreadyShowing) {
+  // Enable media controls.
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {features::kLockScreenMediaKeys, features::kLockScreenMediaControls}, {});
+
+  // Build lock screen with 1 user.
+  auto* contents = new LockContentsView(
+      mojom::TrayActionState::kNotAvailable, LockScreen::ScreenType::kLock,
+      DataDispatcher(),
+      std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher()));
+  SetUserCount(1);
+  std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
+  LockContentsView::TestApi lock_contents(contents);
+
+  // Simulate playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
+  // Simulate media session paused.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPaused);
+
+  // Verify media controls are shown.
+  EXPECT_TRUE(lock_contents.media_controls_view()->IsDrawn());
 }
 
 TEST_F(LockContentsViewUnitTest,
@@ -2453,8 +2601,13 @@
   std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
   LockContentsView::TestApi lock_contents(contents);
 
+  // Simulate active and playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
   // Verify media controls are hidden.
-  EXPECT_EQ(nullptr, lock_contents.media_controls_view());
+  EXPECT_FALSE(lock_contents.media_controls_view()->IsDrawn());
 }
 
 TEST_F(LockContentsViewUnitTest, MediaControlsHiddenOnLoginScreen) {
@@ -2472,12 +2625,17 @@
   std::unique_ptr<views::Widget> widget = CreateWidgetWithContent(contents);
   LockContentsView::TestApi lock_contents(contents);
 
+  // Simulate active and playing media session.
+  SimulateMediaSessionInfoChanged(
+      lock_contents.media_controls_view(),
+      media_session::mojom::MediaPlaybackState::kPlaying);
+
   // Verify media controls are hidden on login screen for one user.
-  EXPECT_EQ(nullptr, lock_contents.media_controls_view());
+  EXPECT_FALSE(lock_contents.media_controls_view()->IsDrawn());
 
   SetUserCount(5);
 
-  // Verify media controls are hidden on login screen for multiple users.
+  // Verify that media controls view isn't created for non low-density layouts.
   EXPECT_EQ(nullptr, lock_contents.media_controls_view());
 }
 
diff --git a/ash/login/ui/lock_screen_media_controls_view.cc b/ash/login/ui/lock_screen_media_controls_view.cc
index 4714290..cee939e 100644
--- a/ash/login/ui/lock_screen_media_controls_view.cc
+++ b/ash/login/ui/lock_screen_media_controls_view.cc
@@ -3,41 +3,64 @@
 // found in the LICENSE file.
 
 #include "ash/login/ui/lock_screen_media_controls_view.h"
-#include "ash/login/ui/login_expanded_public_account_view.h"
+#include "ash/login/ui/lock_contents_view.h"
 #include "ash/media/media_controller_impl.h"
-#include "ash/public/cpp/ash_features.h"
-#include "ui/base/ui_base_features.h"
+#include "ash/shell.h"
+#include "services/media_session/public/mojom/constants.mojom.h"
+#include "services/media_session/public/mojom/media_session.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
 #include "ui/views/background.h"
 
 namespace ash {
 
 namespace {
 // Total width of the media controls view.
-constexpr int kMediaControlsTotalWidthDp = 320;
+const int kMediaControlsTotalWidthDp = 320;
 
 // Total height of the media controls view.
-constexpr int kMediaControlsTotalHeightDp = 400;
+const int kMediaControlsTotalHeightDp = 400;
+
+// How long to wait (in milliseconds) for a new media session to begin.
+constexpr base::TimeDelta kNextMediaDelay =
+    base::TimeDelta::FromMilliseconds(2500);
 
 constexpr const char kLockScreenMediaControlsViewName[] =
     "LockScreenMediaControlsView";
 }  // namespace
 
-LockScreenMediaControlsView::LockScreenMediaControlsView() {
+LockScreenMediaControlsView::LockScreenMediaControlsView(
+    service_manager::Connector* connector,
+    LockContentsView* view)
+    : view_(view),
+      connector_(connector),
+      hide_controls_timer_(new base::OneShotTimer()) {
   SetBackground(views::CreateSolidBackground(SK_ColorBLACK));
+  middle_spacing_ = std::make_unique<NonAccessibleView>();
+  middle_spacing_->set_owned_by_client();
+
+  // Media controls have not been dismissed initially.
+  Shell::Get()->media_controller()->SetMediaControlsDismissed(false);
+
+  // |connector_| can be null in tests.
+  if (!connector_)
+    return;
+
+  // Connect to the MediaControllerManager and create a MediaController that
+  // controls the active session so we can observe it.
+  media_session::mojom::MediaControllerManagerPtr controller_manager_ptr;
+  connector_->BindInterface(media_session::mojom::kServiceName,
+                            mojo::MakeRequest(&controller_manager_ptr));
+  controller_manager_ptr->CreateActiveMediaController(
+      mojo::MakeRequest(&media_controller_ptr_));
+
+  // Observe the active media controller for changes.
+  media_session::mojom::MediaControllerObserverPtr media_controller_observer;
+  observer_binding_.Bind(mojo::MakeRequest(&media_controller_observer));
+  media_controller_ptr_->AddObserver(std::move(media_controller_observer));
 }
 
 LockScreenMediaControlsView::~LockScreenMediaControlsView() = default;
 
-// static
-bool LockScreenMediaControlsView::AreMediaControlsEnabled(
-    LockScreen::ScreenType screen_type,
-    LoginExpandedPublicAccountView* expanded_view) {
-  return MediaControllerImpl::AreLockScreenMediaKeysEnabled() &&
-         base::FeatureList::IsEnabled(features::kLockScreenMediaControls) &&
-         screen_type == LockScreen::ScreenType::kLock &&
-         !expanded_view->GetVisible();
-}
-
 // views::View:
 gfx::Size LockScreenMediaControlsView::CalculatePreferredSize() const {
   return gfx::Size(kMediaControlsTotalWidthDp, kMediaControlsTotalHeightDp);
@@ -47,4 +70,37 @@
   return kLockScreenMediaControlsViewName;
 }
 
+views::View* LockScreenMediaControlsView::GetMiddleSpacingView() {
+  return middle_spacing_.get();
+}
+
+void LockScreenMediaControlsView::MediaSessionInfoChanged(
+    media_session::mojom::MediaSessionInfoPtr session_info) {
+  // If a new media session began while waiting, keep showing the controls.
+  if (hide_controls_timer_->IsRunning() && session_info)
+    hide_controls_timer_->Stop();
+
+  // If controls aren't enabled or there is no session to show, don't show the
+  // controls.
+  if (!view_->AreMediaControlsEnabled() ||
+      (!session_info && !media_session_info_)) {
+    view_->HideMediaControlsLayout();
+  } else if (!session_info && media_session_info_) {
+    // If there is no current session but there was a previous one, wait to see
+    // if a new session starts before hiding the controls.
+    hide_controls_timer_->Start(
+        FROM_HERE, kNextMediaDelay,
+        base::BindOnce(&LockContentsView::HideMediaControlsLayout,
+                       base::Unretained(view_)));
+  } else if (!IsDrawn() &&
+             session_info->playback_state ==
+                 media_session::mojom::MediaPlaybackState::kPaused) {
+    // If the screen is locked while media is paused, don't show the controls.
+    view_->HideMediaControlsLayout();
+  } else if (!IsDrawn()) {
+    view_->CreateMediaControlsLayout();
+  }
+  media_session_info_ = std::move(session_info);
+}
+
 }  // namespace ash
diff --git a/ash/login/ui/lock_screen_media_controls_view.h b/ash/login/ui/lock_screen_media_controls_view.h
index ef55b56..2f971bf 100644
--- a/ash/login/ui/lock_screen_media_controls_view.h
+++ b/ash/login/ui/lock_screen_media_controls_view.h
@@ -6,27 +6,72 @@
 #define ASH_LOGIN_UI_LOCK_SCREEN_MEDIA_CONTROLS_VIEW_H_
 
 #include "ash/ash_export.h"
-#include "ash/login/ui/lock_screen.h"
+#include "base/timer/timer.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/media_session/public/mojom/media_controller.mojom.h"
 #include "ui/views/view.h"
 
+namespace service_manager {
+class Connector;
+}  // namespace service_manager
+
 namespace ash {
 
-class LoginExpandedPublicAccountView;
+class LockContentsView;
 
-class LockScreenMediaControlsView : public views::View {
+class LockScreenMediaControlsView
+    : public views::View,
+      public media_session::mojom::MediaControllerObserver {
  public:
-  LockScreenMediaControlsView();
+  LockScreenMediaControlsView(service_manager::Connector* connector,
+                              LockContentsView* view);
   ~LockScreenMediaControlsView() override;
 
-  static bool AreMediaControlsEnabled(
-      LockScreen::ScreenType screen_type,
-      LoginExpandedPublicAccountView* expanded_view);
-
   // views::View:
   gfx::Size CalculatePreferredSize() const override;
   const char* GetClassName() const override;
 
+  views::View* GetMiddleSpacingView();
+
+  // media_session::mojom::MediaControllerObserver:
+  void MediaSessionInfoChanged(
+      media_session::mojom::MediaSessionInfoPtr session_info) override;
+  void MediaSessionMetadataChanged(
+      const base::Optional<media_session::MediaMetadata>& metadata) override {}
+  void MediaSessionActionsChanged(
+      const std::vector<media_session::mojom::MediaSessionAction>& actions)
+      override {}
+  void MediaSessionChanged(
+      const base::Optional<base::UnguessableToken>& request_id) override {}
+
+  void set_timer_for_testing(std::unique_ptr<base::OneShotTimer> test_timer) {
+    hide_controls_timer_ = std::move(test_timer);
+  }
+
  private:
+  // Lock screen view which this view belongs to.
+  LockContentsView* const view_;
+
+  // Used to connect to the Media Session service.
+  service_manager::Connector* const connector_;
+
+  // Used to control the active session.
+  media_session::mojom::MediaControllerPtr media_controller_ptr_;
+
+  // Used to receive updates to the active media controller.
+  mojo::Binding<media_session::mojom::MediaControllerObserver>
+      observer_binding_{this};
+
+  // The info about the current media session. It will be null if there is not
+  // a current session.
+  media_session::mojom::MediaSessionInfoPtr media_session_info_;
+
+  // Spacing between controls and user.
+  std::unique_ptr<views::View> middle_spacing_;
+
+  // Automatically hides the controls a few seconds if no media playing.
+  std::unique_ptr<base::OneShotTimer> hide_controls_timer_;
+
   DISALLOW_COPY_AND_ASSIGN(LockScreenMediaControlsView);
 };
 
diff --git a/ash/media/media_controller_impl.cc b/ash/media/media_controller_impl.cc
index c4b989e..cf426db 100644
--- a/ash/media/media_controller_impl.cc
+++ b/ash/media/media_controller_impl.cc
@@ -50,12 +50,17 @@
                                 PrefRegistry::PUBLIC);
 }
 
-// static
-bool MediaControllerImpl::AreLockScreenMediaKeysEnabled() {
+bool MediaControllerImpl::AreLockScreenMediaKeysEnabled() const {
   PrefService* prefs =
       Shell::Get()->session_controller()->GetPrimaryUserPrefService();
   return base::FeatureList::IsEnabled(features::kLockScreenMediaKeys) &&
-         prefs->GetBoolean(prefs::kLockScreenMediaKeysEnabled);
+         prefs->GetBoolean(prefs::kLockScreenMediaKeysEnabled) &&
+         !media_controls_dismissed_;
+}
+
+void MediaControllerImpl::SetMediaControlsDismissed(
+    bool media_controls_dismissed) {
+  media_controls_dismissed_ = media_controls_dismissed;
 }
 
 void MediaControllerImpl::AddObserver(MediaCaptureObserver* observer) {
diff --git a/ash/media/media_controller_impl.h b/ash/media/media_controller_impl.h
index 97ba832..5ce9d2e7 100644
--- a/ash/media/media_controller_impl.h
+++ b/ash/media/media_controller_impl.h
@@ -47,9 +47,9 @@
 
   static void RegisterProfilePrefs(PrefRegistrySimple* registry);
 
-  // Determine if lock screen media keys are enabled based on feature flag and
-  // user preference.
-  static bool AreLockScreenMediaKeysEnabled();
+  // Determine if lock screen media keys are enabled.
+  bool AreLockScreenMediaKeysEnabled() const;
+  void SetMediaControlsDismissed(bool media_controls_dismissed);
 
   void AddObserver(MediaCaptureObserver* observer);
   void RemoveObserver(MediaCaptureObserver* observer);
@@ -130,6 +130,9 @@
   // being handled in ash.
   bool force_media_client_key_handling_ = false;
 
+  // Whether the lock screen media controls are dismissed.
+  bool media_controls_dismissed_ = false;
+
   // Mojo pointer to the active media session controller.
   media_session::mojom::MediaControllerPtr media_session_controller_ptr_;
 
diff --git a/ash/media/media_controller_unittest.cc b/ash/media/media_controller_unittest.cc
index 4548b3cdf..76ca79a8 100644
--- a/ash/media/media_controller_unittest.cc
+++ b/ash/media/media_controller_unittest.cc
@@ -104,7 +104,8 @@
       Shell::Get()->session_controller()->GetLastActiveUserPrefService();
   prefs->SetBoolean(prefs::kLockScreenMediaKeysEnabled, true);
 
-  EXPECT_TRUE(MediaControllerImpl::AreLockScreenMediaKeysEnabled());
+  EXPECT_TRUE(
+      Shell::Get()->media_controller()->AreLockScreenMediaKeysEnabled());
 }
 
 TEST_F(MediaControllerTest, DisableLockScreenMediaKeysIfFeatureDisabled) {
@@ -115,11 +116,13 @@
       Shell::Get()->session_controller()->GetPrimaryUserPrefService();
   prefs->SetBoolean(prefs::kLockScreenMediaKeysEnabled, true);
 
-  EXPECT_FALSE(MediaControllerImpl::AreLockScreenMediaKeysEnabled());
+  EXPECT_FALSE(
+      Shell::Get()->media_controller()->AreLockScreenMediaKeysEnabled());
 
   prefs->SetBoolean(prefs::kLockScreenMediaKeysEnabled, false);
 
-  EXPECT_FALSE(MediaControllerImpl::AreLockScreenMediaKeysEnabled());
+  EXPECT_FALSE(
+      Shell::Get()->media_controller()->AreLockScreenMediaKeysEnabled());
 }
 
 TEST_F(MediaControllerTest, DisableLockScreenMediaKeysIfPreferenceDisabled) {
@@ -130,7 +133,8 @@
       Shell::Get()->session_controller()->GetPrimaryUserPrefService();
   prefs->SetBoolean(prefs::kLockScreenMediaKeysEnabled, false);
 
-  EXPECT_FALSE(MediaControllerImpl::AreLockScreenMediaKeysEnabled());
+  EXPECT_FALSE(
+      Shell::Get()->media_controller()->AreLockScreenMediaKeysEnabled());
 }
 
 TEST_F(MediaControllerTest, EnableMediaKeysWhenLockedAndKeysEnabled) {
diff --git a/ash/shelf/back_button.h b/ash/shelf/back_button.h
index 8eab8f2..fdaaea01 100644
--- a/ash/shelf/back_button.h
+++ b/ash/shelf/back_button.h
@@ -23,7 +23,6 @@
   explicit BackButton(ShelfView* shelf_view);
   ~BackButton() override;
 
- protected:
   // views::Button:
   void NotifyClick(const ui::Event& event) override;
   void PaintButtonContents(gfx::Canvas* canvas) override;
diff --git a/ash/shelf/overflow_button.h b/ash/shelf/overflow_button.h
index bf9b6ed..04ba73c1 100644
--- a/ash/shelf/overflow_button.h
+++ b/ash/shelf/overflow_button.h
@@ -28,14 +28,14 @@
   OverflowButton(ShelfView* shelf_view, Shelf* shelf);
   ~OverflowButton() override;
 
- private:
-  friend class OverflowButtonTestApi;
-
-  // views::Button:
+  // views::Button
   bool ShouldEnterPushedState(const ui::Event& event) override;
   void NotifyClick(const ui::Event& event) override;
   const char* GetClassName() const override;
 
+ private:
+  friend class OverflowButtonTestApi;
+
   const gfx::ImageSkia horizontal_dots_image_;
   views::ImageView* horizontal_dots_image_view_;
 
diff --git a/ash/shelf/shelf_app_button.cc b/ash/shelf/shelf_app_button.cc
index 026b48d1..f10d762d 100644
--- a/ash/shelf/shelf_app_button.cc
+++ b/ash/shelf/shelf_app_button.cc
@@ -18,6 +18,7 @@
 #include "base/time/time.h"
 #include "chromeos/constants/chromeos_switches.h"
 #include "skia/ext/image_operations.h"
+#include "ui/accessibility/ax_node_data.h"
 #include "ui/base/ui_base_features.h"
 #include "ui/compositor/layer.h"
 #include "ui/compositor/scoped_layer_animation_settings.h"
@@ -454,6 +455,19 @@
   }
 }
 
+void ShelfAppButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
+  ShelfButton::GetAccessibleNodeData(node_data);
+  const base::string16 title = shelf_view()->GetTitleForView(this);
+  node_data->SetName(title.empty() ? GetAccessibleName() : title);
+}
+
+bool ShelfAppButton::ShouldEnterPushedState(const ui::Event& event) {
+  if (!shelf_view()->ShouldEventActivateButton(this, event))
+    return false;
+
+  return Button::ShouldEnterPushedState(event);
+}
+
 void ShelfAppButton::ReflectItemStatus(const ShelfItem& item) {
   ShelfID active_id = shelf_view()->model()->active_shelf_id();
   if (!active_id.IsNull() && item.id == active_id) {
@@ -504,6 +518,7 @@
   }
 
   ShelfButton::OnMousePressed(event);
+  shelf_view()->PointerPressedOnButton(this, ShelfView::MOUSE, event);
 
   if (shelf_view()->IsDraggedView(this)) {
     drag_timer_.Start(
@@ -517,14 +532,34 @@
   drag_timer_.Stop();
   ClearState(STATE_DRAGGING);
   ShelfButton::OnMouseReleased(event);
+  // PointerReleasedOnButton deletes the ShelfAppButton when user drags a pinned
+  // running app from shelf.
+  shelf_view()->PointerReleasedOnButton(this, ShelfView::MOUSE, false);
   // WARNING: we may have been deleted.
 }
 
 void ShelfAppButton::OnMouseCaptureLost() {
   ClearState(STATE_HOVERED);
+  shelf_view()->PointerReleasedOnButton(this, ShelfView::MOUSE, true);
   ShelfButton::OnMouseCaptureLost();
 }
 
+bool ShelfAppButton::OnMouseDragged(const ui::MouseEvent& event) {
+  ShelfButton::OnMouseDragged(event);
+  shelf_view()->PointerDraggedOnButton(this, ShelfView::MOUSE, event);
+  return true;
+}
+
+void ShelfAppButton::OnFocus() {
+  shelf_view()->set_focused_button(this);
+  Button::OnFocus();
+}
+
+void ShelfAppButton::OnBlur() {
+  shelf_view()->set_focused_button(nullptr);
+  Button::OnBlur();
+}
+
 void ShelfAppButton::Layout() {
   // TODO: Find out why there is an extra pixel of padding between each item
   // and the inner side of the shelf.
diff --git a/ash/shelf/shelf_app_button.h b/ash/shelf/shelf_app_button.h
index 4489900..3a49494b 100644
--- a/ash/shelf/shelf_app_button.h
+++ b/ash/shelf/shelf_app_button.h
@@ -70,24 +70,27 @@
   // Callback used when a menu for this ShelfAppButton is closed.
   void OnMenuClosed();
 
-  // Overrides to views::Button:
+  // views::Button overrides:
   void ShowContextMenu(const gfx::Point& p,
                        ui::MenuSourceType source_type) override;
+  void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
+  bool ShouldEnterPushedState(const ui::Event& event) override;
 
-  // View override - needed by unit test.
+  // views::View overrides:
+  const char* GetClassName() const override;
+  bool OnMousePressed(const ui::MouseEvent& event) override;
+  void OnMouseReleased(const ui::MouseEvent& event) override;
   void OnMouseCaptureLost() override;
+  bool OnMouseDragged(const ui::MouseEvent& event) override;
+  void OnFocus() override;
+  void OnBlur() override;
+  void Layout() override;
+  void ChildPreferredSizeChanged(views::View* child) override;
 
   // Update button state from ShelfItem.
   void ReflectItemStatus(const ShelfItem& item);
 
  protected:
-  // View overrides:
-  const char* GetClassName() const override;
-  bool OnMousePressed(const ui::MouseEvent& event) override;
-  void OnMouseReleased(const ui::MouseEvent& event) override;
-  void Layout() override;
-  void ChildPreferredSizeChanged(views::View* child) override;
-
   // ui::EventHandler overrides:
   void OnGestureEvent(ui::GestureEvent* event) override;
 
diff --git a/ash/shelf/shelf_button.cc b/ash/shelf/shelf_button.cc
index 20da3f0..4940cd9 100644
--- a/ash/shelf/shelf_button.cc
+++ b/ash/shelf/shelf_button.cc
@@ -34,31 +34,6 @@
   return "ash/ShelfButton";
 }
 
-bool ShelfButton::OnMousePressed(const ui::MouseEvent& event) {
-  Button::OnMousePressed(event);
-  shelf_view_->PointerPressedOnButton(this, ShelfView::MOUSE, event);
-  return true;
-}
-
-void ShelfButton::OnMouseReleased(const ui::MouseEvent& event) {
-  Button::OnMouseReleased(event);
-  // PointerReleasedOnButton deletes the ShelfAppButton when user drags a pinned
-  // running app from shelf.
-  shelf_view_->PointerReleasedOnButton(this, ShelfView::MOUSE, false);
-  // WARNING: we may have been deleted.
-}
-
-void ShelfButton::OnMouseCaptureLost() {
-  shelf_view_->PointerReleasedOnButton(this, ShelfView::MOUSE, true);
-  Button::OnMouseCaptureLost();
-}
-
-bool ShelfButton::OnMouseDragged(const ui::MouseEvent& event) {
-  Button::OnMouseDragged(event);
-  shelf_view_->PointerDraggedOnButton(this, ShelfView::MOUSE, event);
-  return true;
-}
-
 void ShelfButton::AboutToRequestFocusFromTabTraversal(bool reverse) {
   shelf_view_->OnShelfButtonAboutToRequestFocusFromTabTraversal(this, reverse);
 }
@@ -67,18 +42,6 @@
 // triggered by Button::GetAccessibleNodeData. (See https://crbug.com/932200)
 void ShelfButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
   node_data->role = ax::mojom::Role::kButton;
-  const base::string16 title = shelf_view_->GetTitleForView(this);
-  node_data->SetName(title.empty() ? GetAccessibleName() : title);
-}
-
-void ShelfButton::OnFocus() {
-  shelf_view_->set_focused_button(this);
-  Button::OnFocus();
-}
-
-void ShelfButton::OnBlur() {
-  shelf_view_->set_focused_button(nullptr);
-  Button::OnBlur();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -90,13 +53,6 @@
     listener_->ButtonPressed(this, event, GetInkDrop());
 }
 
-bool ShelfButton::ShouldEnterPushedState(const ui::Event& event) {
-  if (!shelf_view_->ShouldEventActivateButton(this, event))
-    return false;
-
-  return Button::ShouldEnterPushedState(event);
-}
-
 std::unique_ptr<views::InkDrop> ShelfButton::CreateInkDrop() {
   std::unique_ptr<views::InkDropImpl> ink_drop =
       Button::CreateDefaultInkDropImpl();
diff --git a/ash/shelf/shelf_button.h b/ash/shelf/shelf_button.h
index c3f76183..63f7803 100644
--- a/ash/shelf/shelf_button.h
+++ b/ash/shelf/shelf_button.h
@@ -18,25 +18,16 @@
   explicit ShelfButton(ShelfView* shelf_view);
   ~ShelfButton() override;
 
-  // views::View
+  // views::Button
   const char* GetClassName() const override;
-  bool OnMousePressed(const ui::MouseEvent& event) override;
-  void OnMouseReleased(const ui::MouseEvent& event) override;
-  void OnMouseCaptureLost() override;
-  bool OnMouseDragged(const ui::MouseEvent& event) override;
   void AboutToRequestFocusFromTabTraversal(bool reverse) override;
   void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
-  void OnFocus() override;
-  void OnBlur() override;
+  void NotifyClick(const ui::Event& event) override;
+  std::unique_ptr<views::InkDrop> CreateInkDrop() override;
 
  protected:
   ShelfView* shelf_view() { return shelf_view_; }
 
-  // views::Button
-  void NotifyClick(const ui::Event& event) override;
-  bool ShouldEnterPushedState(const ui::Event& event) override;
-  std::unique_ptr<views::InkDrop> CreateInkDrop() override;
-
  private:
   // The shelf view hosting this button.
   ShelfView* shelf_view_;
diff --git a/ash/shelf/shelf_control_button.cc b/ash/shelf/shelf_control_button.cc
index 76db7935..1cc0969 100644
--- a/ash/shelf/shelf_control_button.cc
+++ b/ash/shelf/shelf_control_button.cc
@@ -58,6 +58,11 @@
   return "ash/ShelfControlButton";
 }
 
+void ShelfControlButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
+  ShelfButton::GetAccessibleNodeData(node_data);
+  node_data->SetName(GetAccessibleName());
+}
+
 void ShelfControlButton::PaintButtonContents(gfx::Canvas* canvas) {
   PaintBackground(canvas, GetContentsBounds());
 }
diff --git a/ash/shelf/shelf_control_button.h b/ash/shelf/shelf_control_button.h
index 3dff299f..8f1f533 100644
--- a/ash/shelf/shelf_control_button.h
+++ b/ash/shelf/shelf_control_button.h
@@ -31,12 +31,13 @@
 
   void set_ideal_bounds(const gfx::Rect& bounds) { ideal_bounds_ = bounds; }
 
- protected:
   // views::Button:
   std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
   std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
   const char* GetClassName() const override;
+  void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
 
+ protected:
   // views::View
   void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
 
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 7177167..5089da9 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -481,6 +481,31 @@
   return item ? item->title : base::string16();
 }
 
+void ShelfView::ToggleOverflowBubble() {
+  if (IsShowingOverflowBubble()) {
+    overflow_bubble_->Hide();
+    return;
+  }
+
+  if (!overflow_bubble_)
+    overflow_bubble_.reset(new OverflowBubble(shelf_));
+
+  // TODO(agawronska): Move this to DefaultShelfView.
+  ShelfView* overflow_view =
+      new DefaultShelfView(model_, shelf_, shelf_widget_);
+  overflow_view->overflow_mode_ = true;
+  overflow_view->Init();
+  overflow_view->set_owner_overflow_bubble(overflow_bubble_.get());
+  overflow_view->OnShelfAlignmentChanged(
+      GetWidget()->GetNativeWindow()->GetRootWindow());
+  overflow_view->main_shelf_ = this;
+  UpdateOverflowRange(overflow_view);
+
+  overflow_bubble_->Show(overflow_button_, overflow_view);
+
+  shelf_->UpdateVisibilityState();
+}
+
 gfx::Rect ShelfView::GetVisibleItemsBoundsInScreen() {
   gfx::Size preferred_size = GetPreferredSize();
   gfx::Point origin(GetMirroredXWithWidthInView(0, preferred_size.width()), 0);
@@ -1088,8 +1113,8 @@
   if (index == -1 || view_model_->view_size() < 1)
     return;  // View is being deleted, ignore request.
 
-  if (view == GetAppListButton() || view == GetBackButton())
-    return;  // Views are not draggable, ignore request.
+  // The home and back buttons should be handled separately.
+  DCHECK(view != GetAppListButton() || view != GetBackButton());
 
   // Only when the repost event occurs on the same shelf item, we should ignore
   // the call in ShelfView::ButtonPressed(...).
@@ -1632,31 +1657,6 @@
   return std::pair<int, int>(min_index, max_index);
 }
 
-void ShelfView::ToggleOverflowBubble() {
-  if (IsShowingOverflowBubble()) {
-    overflow_bubble_->Hide();
-    return;
-  }
-
-  if (!overflow_bubble_)
-    overflow_bubble_.reset(new OverflowBubble(shelf_));
-
-  // TODO(agawronska): Move this to DefaultShelfView.
-  ShelfView* overflow_view =
-      new DefaultShelfView(model_, shelf_, shelf_widget_);
-  overflow_view->overflow_mode_ = true;
-  overflow_view->Init();
-  overflow_view->set_owner_overflow_bubble(overflow_bubble_.get());
-  overflow_view->OnShelfAlignmentChanged(
-      GetWidget()->GetNativeWindow()->GetRootWindow());
-  overflow_view->main_shelf_ = this;
-  UpdateOverflowRange(overflow_view);
-
-  overflow_bubble_->Show(overflow_button_, overflow_view);
-
-  shelf_->UpdateVisibilityState();
-}
-
 void ShelfView::OnFadeOutAnimationEnded() {
   AnimateToIdealBounds();
   StartFadeInLastVisibleItem();
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index a8d2283..f20e1f46a 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -172,6 +172,9 @@
   // Returns the title of the shelf item |view|.
   base::string16 GetTitleForView(const views::View* view) const;
 
+  // Toggles the overflow menu.
+  void ToggleOverflowBubble();
+
   // Returns rectangle bounding all visible launcher items. Used screen
   // coordinate system.
   gfx::Rect GetVisibleItemsBoundsInScreen();
@@ -437,9 +440,6 @@
   //  * In the overflow mode, returns only bubble's bounds.
   gfx::Rect GetBoundsForDragInsertInScreen();
 
-  // Toggles the overflow menu.
-  void ToggleOverflowBubble();
-
   // Invoked after the fading out animation for item deletion is ended.
   void OnFadeOutAnimationEnded();
 
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index bc51aad..a29bec4 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -405,10 +405,8 @@
     ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, gfx::Point(),
                                  button->GetBoundsInScreen().origin(),
                                  ui::EventTimeForNow(), 0, 0);
-    shelf_view_->ButtonPressed(
-        button, release_event,
-        views::test::InkDropHostViewTestApi(button).GetInkDrop());
-    shelf_view_->PointerReleasedOnButton(button, ShelfView::MOUSE, false);
+    button->NotifyClick(release_event);
+    button->OnMouseReleased(release_event);
   }
 
   // Simulates the second click of a double click.
@@ -419,10 +417,8 @@
                                  button->GetBoundsInScreen().origin(),
                                  ui::EventTimeForNow(), ui::EF_IS_DOUBLE_CLICK,
                                  0);
-    shelf_view_->ButtonPressed(
-        button, release_event,
-        views::test::InkDropHostViewTestApi(button).GetInkDrop());
-    shelf_view_->PointerReleasedOnButton(button, ShelfView::MOUSE, false);
+    button->NotifyClick(release_event);
+    button->OnMouseReleased(release_event);
   }
 
   void DoDrag(int dist_x,
diff --git a/build/config/fuchsia/testing_sandbox_policy b/build/config/fuchsia/testing_sandbox_policy
index 59796e8..060dbb4 100644
--- a/build/config/fuchsia/testing_sandbox_policy
+++ b/build/config/fuchsia/testing_sandbox_policy
@@ -6,6 +6,7 @@
       "vulkan" ],
   "dev": ["null", "zero"],
   "services": [
+      "fuchsia.device.NameProvider",
       "fuchsia.fonts.Provider",
       "fuchsia.logger.Log",
       "fuchsia.logger.LogSink",
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni
index 71c450d..6927cf94 100644
--- a/build/config/mac/rules.gni
+++ b/build/config/mac/rules.gni
@@ -351,6 +351,12 @@
       ":$_shared_library_bundle_data",
     ]
 
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.dSYM/",
+      ]
+    }
+
     bundle_root_dir = _framework_base_dir
     bundle_contents_dir = _framework_root_dir
     bundle_resources_dir = "$bundle_contents_dir/Resources"
@@ -551,6 +557,13 @@
     if (_write_pkg_info) {
       deps += [ ":$_pkg_info_bundle_data" ]
     }
+
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.dSYM/",
+      ]
+    }
+
     product_type = _product_type
     bundle_root_dir = "$root_out_dir/${_output_name}.${_output_extension}"
     bundle_contents_dir = "$bundle_root_dir/Contents"
@@ -617,6 +630,12 @@
     }
     deps += [ ":$_loadable_module_bundle_data" ]
 
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.dSYM/",
+      ]
+    }
+
     bundle_root_dir = "$root_out_dir/$_output_name.plugin"
     bundle_contents_dir = "$bundle_root_dir/Contents"
     bundle_executable_dir = "$bundle_contents_dir/MacOS"
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1
index b6020882..b52d9c8 100644
--- a/build/fuchsia/linux.sdk.sha1
+++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@
-8910045712989608480
\ No newline at end of file
+8910014653626698592
\ No newline at end of file
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1
index fb54e78..fe0ebe4 100644
--- a/build/fuchsia/mac.sdk.sha1
+++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@
-8910048030561267904
\ No newline at end of file
+8910019839789789120
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/explore_sites/ExploreSitesPage.java b/chrome/android/java/src/org/chromium/chrome/browser/explore_sites/ExploreSitesPage.java
index 5bb4d6eb..a9ad237 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/explore_sites/ExploreSitesPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/explore_sites/ExploreSitesPage.java
@@ -29,6 +29,7 @@
 import org.chromium.chrome.browser.tab.EmptyTabObserver;
 import org.chromium.chrome.browser.tab.Tab;
 import org.chromium.chrome.browser.tab.TabObserver;
+import org.chromium.chrome.browser.util.FeatureUtilities;
 import org.chromium.chrome.browser.util.UrlConstants;
 import org.chromium.chrome.browser.widget.RoundedIconGenerator;
 import org.chromium.content_public.browser.NavigationController;
@@ -180,10 +181,11 @@
         });
 
         // We don't want to scroll to the 4th category if personalized
-        // or integrated with Most Likely.
+        // or integrated with Most Likely, or if we're on a touchless device.
         int variation = ExploreSitesBridge.getVariation();
         mInitialScrollPosition = variation == ExploreSitesVariation.PERSONALIZED
                         || ExploreSitesBridge.isIntegratedWithMostLikely(variation)
+                        || FeatureUtilities.isNoTouchModeEnabled()
                 ? INITIAL_SCROLL_POSITION_PERSONALIZED
                 : INITIAL_SCROLL_POSITION;
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchTestBridge.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchTestBridge.java
index 40e1d03..7113bb4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchTestBridge.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchTestBridge.java
@@ -21,9 +21,15 @@
     public static void insertIntoCachedImageFetcher(String url, byte[] imageData) {
         nativeInsertIntoCachedImageFetcher(url, imageData);
     }
+    public static void addCandidatePrefetchURL(String url, String title, String thumbnailUrl,
+            String faviconUrl, String snippet, String attribution) {
+        nativeAddCandidatePrefetchURL(url, title, thumbnailUrl, faviconUrl, snippet, attribution);
+    }
 
     static native void nativeEnableLimitlessPrefetching(boolean enabled);
     static native boolean nativeIsLimitlessPrefetchingEnabled();
     static native void nativeSkipNTPSuggestionsAPIKeyCheck();
     static native void nativeInsertIntoCachedImageFetcher(String url, byte[] imageData);
+    static native void nativeAddCandidatePrefetchURL(String url, String title, String thumbnailUrl,
+            String faviconUrl, String snippet, String attribution);
 }
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
index 1d5ab8c4..2dee7b6 100644
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -77,10 +77,6 @@
 class MetricsServicesManager;
 }
 
-namespace net_log {
-class ChromeNetLog;
-}
-
 namespace network_time {
 class NetworkTimeTracker;
 }
@@ -159,7 +155,7 @@
   virtual NotificationUIManager* notification_ui_manager() = 0;
   virtual NotificationPlatformBridge* notification_platform_bridge() = 0;
 
-  // Replacement for IOThread (And ChromeNetLog). It owns and manages the
+  // Replacement for IOThread. It owns and manages the
   // NetworkContext which will use the network service when the network service
   // is enabled. When the network service is not enabled, its NetworkContext is
   // backed by the IOThread's URLRequestContext.
@@ -250,8 +246,6 @@
   virtual void StartAutoupdateTimer() = 0;
 #endif
 
-  virtual net_log::ChromeNetLog* net_log() = 0;
-
   virtual component_updater::ComponentUpdateService* component_updater() = 0;
 
   virtual component_updater::SupervisedUserWhitelistInstaller*
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 611a448..cf7baa3 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -98,7 +98,6 @@
 #include "components/metrics/metrics_service.h"
 #include "components/metrics_services_manager/metrics_services_manager.h"
 #include "components/metrics_services_manager/metrics_services_manager_client.h"
-#include "components/net_log/chrome_net_log.h"
 #include "components/network_time/network_time_tracker.h"
 #include "components/optimization_guide/optimization_guide_service.h"
 #include "components/policy/core/common/policy_service.h"
@@ -259,8 +258,6 @@
   print_job_manager_ = std::make_unique<printing::PrintJobManager>();
 #endif
 
-  net_log_ = std::make_unique<net_log::ChromeNetLog>();
-
   ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
       chrome::kChromeSearchScheme);
 
@@ -1009,10 +1006,6 @@
 }
 #endif
 
-net_log::ChromeNetLog* BrowserProcessImpl::net_log() {
-  return net_log_.get();
-}
-
 component_updater::ComponentUpdateService*
 BrowserProcessImpl::component_updater() {
   if (component_updater_)
@@ -1114,24 +1107,6 @@
   site_isolation_prefs_observer_ =
       std::make_unique<SiteIsolationPrefsObserver>(local_state());
 
-  if (command_line.HasSwitch(network::switches::kLogNetLog) &&
-      !base::FeatureList::IsEnabled(network::features::kNetworkService)) {
-    base::FilePath log_file =
-        command_line.GetSwitchValuePath(network::switches::kLogNetLog);
-    if (log_file.empty()) {
-      base::FilePath user_data_dir;
-      bool success =
-          base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
-      DCHECK(success);
-      log_file = user_data_dir.AppendASCII("netlog.json");
-    }
-    net_log_->StartWritingToFile(
-        log_file,
-        net::GetNetCaptureModeFromCommandLine(
-            command_line, network::switches::kNetLogCaptureMode),
-        command_line.GetCommandLineString(), chrome::GetChannelName());
-  }
-
   // TODO(mmenke): This can be created on first use.
   if (!SystemNetworkContextManager::GetInstance())
     SystemNetworkContextManager::CreateInstance(local_state());
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index 0285bbdb..81faf8dd91 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -63,10 +63,6 @@
 class GCMDriver;
 }
 
-namespace net_log {
-class ChromeNetLog;
-}
-
 namespace policy {
 class ChromeBrowserPolicyConnector;
 class PolicyService;
@@ -184,7 +180,6 @@
   void StartAutoupdateTimer() override;
 #endif
 
-  net_log::ChromeNetLog* net_log() override;
   component_updater::ComponentUpdateService* component_updater() override;
   component_updater::SupervisedUserWhitelistInstaller*
   supervised_user_whitelist_installer() override;
@@ -354,9 +349,6 @@
   // notifications are properly added and removed.
   PrefChangeRegistrar pref_change_registrar_;
 
-  // Lives here so can safely log events on shutdown.
-  std::unique_ptr<net_log::ChromeNetLog> net_log_;
-
   std::unique_ptr<BatteryMetrics> battery_metrics_;
 
 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4fd357b3..edac44a 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2392,6 +2392,7 @@
 bool ChromeContentBrowserClient::AllowServiceWorker(
     const GURL& scope,
     const GURL& first_party_url,
+    const GURL& script_url,
     content::ResourceContext* context,
     base::RepeatingCallback<content::WebContents*()> wc_getter) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -2404,7 +2405,7 @@
   // because of the extension, rather than because of the user's content
   // settings.
   if (!ChromeContentBrowserClientExtensionsPart::AllowServiceWorker(
-          scope, first_party_url, context)) {
+          scope, first_party_url, script_url, context)) {
     return false;
   }
 #endif
@@ -3142,10 +3143,6 @@
 #endif
 }
 
-net::NetLog* ChromeContentBrowserClient::GetNetLog() {
-  return g_browser_process->net_log();
-}
-
 base::Optional<ui::CaptionStyle> GetCaptionStyleFromPrefs(PrefService* prefs) {
   if (!prefs) {
     return base::nullopt;
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 89593fd8..1d4f95b 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -224,6 +224,7 @@
   bool AllowServiceWorker(
       const GURL& scope,
       const GURL& first_party,
+      const GURL& script_url,
       content::ResourceContext* context,
       base::RepeatingCallback<content::WebContents*()> wc_getter) override;
   bool AllowSharedWorker(const GURL& worker_url,
@@ -334,7 +335,6 @@
   CreateSpeechRecognitionManagerDelegate() override;
   content::TtsControllerDelegate* GetTtsControllerDelegate() override;
   content::TtsPlatform* GetTtsPlatform() override;
-  net::NetLog* GetNetLog() override;
   void OverrideWebkitPrefs(content::RenderViewHost* rvh,
                            content::WebPreferences* prefs) override;
   void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index d37847a..afc2129 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -1727,6 +1727,8 @@
     "policy/status_uploader.h",
     "policy/system_log_uploader.cc",
     "policy/system_log_uploader.h",
+    "policy/task_executor_with_retries.cc",
+    "policy/task_executor_with_retries.h",
     "policy/tpm_auto_update_mode_policy_handler.cc",
     "policy/tpm_auto_update_mode_policy_handler.h",
     "policy/upload_job.h",
diff --git a/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.cc b/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.cc
index 4949089..2028cce 100644
--- a/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.cc
+++ b/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.cc
@@ -35,12 +35,6 @@
   // Should be a no-op on ARC. This is managed on the Android side.
 }
 
-void ArcPictureInPictureWindowControllerImpl::EmbedSurface(
-    const viz::SurfaceId& surface_id,
-    const gfx::Size& natural_size) {
-  // Should be a no-op on ARC. This is managed on the Android side.
-}
-
 content::OverlayWindow*
 ArcPictureInPictureWindowControllerImpl::GetWindowForTesting() {
   // Should be a no-op on ARC. This is managed on the Android side.
diff --git a/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.h b/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.h
index e97e4b5..b3dc339 100644
--- a/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.h
+++ b/chrome/browser/chromeos/arc/pip/arc_picture_in_picture_window_controller_impl.h
@@ -34,8 +34,6 @@
   void Close(bool should_pause_video) override;
   void CloseAndFocusInitiator() override;
   void OnWindowDestroyed() override;
-  void EmbedSurface(const viz::SurfaceId& surface_id,
-                    const gfx::Size& natural_size) override;
   content::OverlayWindow* GetWindowForTesting() override;
   void UpdateLayerBounds() override;
   bool IsPlayerActive() override;
diff --git a/chrome/browser/chromeos/display/output_protection_controller_ash.cc b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
index 030391c..d6dcf0f3 100644
--- a/chrome/browser/chromeos/display/output_protection_controller_ash.cc
+++ b/chrome/browser/chromeos/display/output_protection_controller_ash.cc
@@ -27,20 +27,20 @@
   manager()->UnregisterClient(client_id_);
 }
 
-void OutputProtectionControllerAsh::QueryStatus(
-    int64_t display_id,
-    const OutputProtectionDelegate::QueryStatusCallback& callback) {
+void OutputProtectionControllerAsh::QueryStatus(int64_t display_id,
+                                                QueryStatusCallback callback) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  manager()->QueryContentProtection(client_id_, display_id, callback);
+  manager()->QueryContentProtection(client_id_, display_id,
+                                    std::move(callback));
 }
 
 void OutputProtectionControllerAsh::SetProtection(
     int64_t display_id,
-    uint32_t desired_method_mask,
-    const OutputProtectionDelegate::SetProtectionCallback& callback) {
+    uint32_t protection_mask,
+    SetProtectionCallback callback) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  manager()->ApplyContentProtection(client_id_, display_id, desired_method_mask,
-                                    callback);
+  manager()->ApplyContentProtection(client_id_, display_id, protection_mask,
+                                    std::move(callback));
 }
 
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/display/output_protection_controller_ash.h b/chrome/browser/chromeos/display/output_protection_controller_ash.h
index 0eca843..eca5c44 100644
--- a/chrome/browser/chromeos/display/output_protection_controller_ash.h
+++ b/chrome/browser/chromeos/display/output_protection_controller_ash.h
@@ -20,13 +20,10 @@
   ~OutputProtectionControllerAsh() override;
 
   // OutputProtectionDelegate::Controller:
-  void QueryStatus(
-      int64_t display_id,
-      const OutputProtectionDelegate::QueryStatusCallback& callback) override;
-  void SetProtection(
-      int64_t display_id,
-      uint32_t desired_method_mask,
-      const OutputProtectionDelegate::SetProtectionCallback& callback) override;
+  void QueryStatus(int64_t display_id, QueryStatusCallback callback) override;
+  void SetProtection(int64_t display_id,
+                     uint32_t protection_mask,
+                     SetProtectionCallback callback) override;
 
  private:
   const display::ContentProtectionManager::ClientId client_id_;
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.cc b/chrome/browser/chromeos/display/output_protection_delegate.cc
index dc8d8da1a..379e0d3d 100644
--- a/chrome/browser/chromeos/display/output_protection_delegate.cc
+++ b/chrome/browser/chromeos/display/output_protection_delegate.cc
@@ -34,17 +34,12 @@
 
 }  // namespace
 
-OutputProtectionDelegate::Controller::Controller() {}
-
-OutputProtectionDelegate::Controller::~Controller() {}
+OutputProtectionDelegate::Controller::Controller() = default;
+OutputProtectionDelegate::Controller::~Controller() = default;
 
 OutputProtectionDelegate::OutputProtectionDelegate(int render_process_id,
                                                    int render_frame_id)
-    : render_process_id_(render_process_id),
-      render_frame_id_(render_frame_id),
-      window_(nullptr),
-      display_id_(display::kInvalidDisplayId),
-      weak_ptr_factory_(this) {
+    : render_process_id_(render_process_id), render_frame_id_(render_frame_id) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
   display::Screen::GetScreen()->AddObserver(this);
 }
@@ -85,28 +80,31 @@
 }
 
 void OutputProtectionDelegate::QueryStatus(
-    const QueryStatusCallback& callback) {
+    Controller::QueryStatusCallback callback) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
   if (!InitializeControllerIfNecessary()) {
-    callback.Run(false, 0, 0);
+    std::move(callback).Run(/*success=*/false,
+                            display::DISPLAY_CONNECTION_TYPE_NONE,
+                            display::CONTENT_PROTECTION_METHOD_NONE);
     return;
   }
 
-  controller_->QueryStatus(display_id_, callback);
+  controller_->QueryStatus(display_id_, std::move(callback));
 }
 
 void OutputProtectionDelegate::SetProtection(
-    uint32_t desired_method_mask,
-    const SetProtectionCallback& callback) {
+    uint32_t protection_mask,
+    Controller::SetProtectionCallback callback) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
   if (!InitializeControllerIfNecessary()) {
-    callback.Run(false);
+    std::move(callback).Run(/*success=*/false);
     return;
   }
-  controller_->SetProtection(display_id_, desired_method_mask, callback);
-  desired_method_mask_ = desired_method_mask;
+
+  controller_->SetProtection(display_id_, protection_mask, std::move(callback));
+  protection_mask_ = protection_mask;
 }
 
 void OutputProtectionDelegate::OnWindowMayHaveMovedToAnotherDisplay() {
@@ -124,9 +122,9 @@
   if (display_id_ == new_display_id)
     return;
 
-  if (desired_method_mask_ != display::CONTENT_PROTECTION_METHOD_NONE) {
+  if (protection_mask_ != display::CONTENT_PROTECTION_METHOD_NONE) {
     DCHECK(controller_);
-    controller_->SetProtection(new_display_id, desired_method_mask_,
+    controller_->SetProtection(new_display_id, protection_mask_,
                                base::DoNothing());
     controller_->SetProtection(display_id_,
                                display::CONTENT_PROTECTION_METHOD_NONE,
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.h b/chrome/browser/chromeos/display/output_protection_delegate.h
index f28971a5..281eb226 100644
--- a/chrome/browser/chromeos/display/output_protection_delegate.h
+++ b/chrome/browser/chromeos/display/output_protection_delegate.h
@@ -14,6 +14,7 @@
 #include "ui/aura/window.h"
 #include "ui/aura/window_observer.h"
 #include "ui/display/display_observer.h"
+#include "ui/display/types/display_constants.h"
 
 namespace chromeos {
 
@@ -22,11 +23,23 @@
 class OutputProtectionDelegate : public aura::WindowObserver,
                                  public display::DisplayObserver {
  public:
-  typedef base::Callback<void(bool /* success */,
-                              uint32_t /* link_mask */,
-                              uint32_t /* protection_mask*/)>
-      QueryStatusCallback;
-  typedef base::Callback<void(bool /* success */)> SetProtectionCallback;
+  class Controller {
+   public:
+    using QueryStatusCallback = base::OnceCallback<
+        void(bool success, uint32_t connection_mask, uint32_t protection_mask)>;
+    using SetProtectionCallback = base::OnceCallback<void(bool success)>;
+
+    Controller();
+    virtual ~Controller();
+    virtual void QueryStatus(int64_t display_id,
+                             QueryStatusCallback callback) = 0;
+    virtual void SetProtection(int64_t display_id,
+                               uint32_t protection_mask,
+                               SetProtectionCallback callback) = 0;
+
+   private:
+    DISALLOW_COPY_AND_ASSIGN(Controller);
+  };
 
   OutputProtectionDelegate(int render_process_id, int render_frame_id);
   ~OutputProtectionDelegate() override;
@@ -40,24 +53,9 @@
       const aura::WindowObserver::HierarchyChangeParams& params) override;
   void OnWindowDestroying(aura::Window* window) override;
 
-  void QueryStatus(const QueryStatusCallback& callback);
-  void SetProtection(uint32_t desired_method_mask,
-                     const SetProtectionCallback& callback);
-
-  // Display content protection controller interface.
-  class Controller {
-   public:
-    Controller();
-    virtual ~Controller();
-    virtual void QueryStatus(int64_t display_id,
-                             const QueryStatusCallback& callback) = 0;
-    virtual void SetProtection(int64_t display_id,
-                               uint32_t desired_method_mask,
-                               const SetProtectionCallback& callback) = 0;
-
-   private:
-    DISALLOW_COPY_AND_ASSIGN(Controller);
-  };
+  void QueryStatus(Controller::QueryStatusCallback callback);
+  void SetProtection(uint32_t protection_mask,
+                     Controller::SetProtectionCallback callback);
 
  private:
   void OnWindowMayHaveMovedToAnotherDisplay();
@@ -65,23 +63,23 @@
   bool InitializeControllerIfNecessary();
 
   // Used to lookup the WebContents associated with the render frame.
-  int render_process_id_;
-  int render_frame_id_;
+  const int render_process_id_;
+  const int render_frame_id_;
 
   // Native window being observed.
-  aura::Window* window_;
+  aura::Window* window_ = nullptr;
 
-  // The display id which the renderer currently uses.
-  int64_t display_id_;
+  // Display ID of the observed window.
+  int64_t display_id_ = display::kInvalidDisplayId;
 
-  // The last desired method mask. Will enable this mask on new display if
-  // renderer changes display.
-  uint32_t desired_method_mask_;
+  // Last requested ContentProtectionMethod bitmask, applied when the observed
+  // window moves to another display.
+  uint32_t protection_mask_ = display::CONTENT_PROTECTION_METHOD_NONE;
 
   // The display content protection controller.
   std::unique_ptr<Controller> controller_;
 
-  base::WeakPtrFactory<OutputProtectionDelegate> weak_ptr_factory_;
+  base::WeakPtrFactory<OutputProtectionDelegate> weak_ptr_factory_{this};
 
   DISALLOW_COPY_AND_ASSIGN(OutputProtectionDelegate);
 };
diff --git a/chrome/browser/chromeos/policy/device_scheduled_update_checker.cc b/chrome/browser/chromeos/policy/device_scheduled_update_checker.cc
index 6fd27e5..e2591481 100644
--- a/chrome/browser/chromeos/policy/device_scheduled_update_checker.cc
+++ b/chrome/browser/chromeos/policy/device_scheduled_update_checker.cc
@@ -50,9 +50,9 @@
 // The tag associated to register |update_check_timer_|.
 constexpr char kUpdateCheckTimerTag[] = "DeviceScheduledUpdateChecker";
 
-// The tag associated to register |start_update_check_retry_timer_|.
-constexpr char kStartUpdateCheckRetryTimerTag[] =
-    "DeviceScheduledUpdateCheckerRetry";
+// The tag associated to register |start_update_check_timer_task_executor_|.
+constexpr char kStartUpdateCheckTimerTaskRunnerTag[] =
+    "StartUpdateCheckTimerTaskRunner";
 
 DeviceScheduledUpdateChecker::ScheduledUpdateCheckData::Frequency GetFrequency(
     const std::string& frequency) {
@@ -265,6 +265,8 @@
 // |cros_settings_observer_| will be destroyed as part of this object
 // guaranteeing to not run |OnScheduledUpdateCheckDataChanged| after its
 // destruction. Therefore, it's safe to use "this" while adding this observer.
+// Similarly, |start_update_check_timer_task_executor_| will be destroyed as
+// part of this object, so it's safe to use "this" with any callbacks.
 DeviceScheduledUpdateChecker::DeviceScheduledUpdateChecker(
     chromeos::CrosSettings* cros_settings)
     : cros_settings_(cros_settings),
@@ -272,7 +274,13 @@
           chromeos::kDeviceScheduledUpdateCheck,
           base::BindRepeating(
               &DeviceScheduledUpdateChecker::OnScheduledUpdateCheckDataChanged,
-              base::Unretained(this)))) {
+              base::Unretained(this)))),
+      start_update_check_timer_task_executor_(
+          kStartUpdateCheckTimerTaskRunnerTag,
+          base::BindRepeating(&DeviceScheduledUpdateChecker::GetTicksSinceBoot,
+                              base::Unretained(this)),
+          update_checker_internal::kMaxRetryUpdateCheckIterations,
+          update_checker_internal::kStartUpdateCheckTimerRetryTime) {
   // Check if policy already exists.
   OnScheduledUpdateCheckDataChanged();
 }
@@ -291,7 +299,15 @@
   // If a policy exists, schedule the next update check timer.
   if (!scheduled_update_check_data_)
     return;
-  StartUpdateCheckTimer();
+
+  // |start_update_check_timer_task_executor_| will be destroyed as part of this
+  // object, so it's safe to use "this" with any callbacks.
+  start_update_check_timer_task_executor_.Start(
+      base::BindRepeating(&DeviceScheduledUpdateChecker::StartUpdateCheckTimer,
+                          base::Unretained(this)),
+      base::BindOnce(
+          &DeviceScheduledUpdateChecker::OnStartUpdateCheckTimerRetryFailure,
+          base::Unretained(this)));
 }
 
 void DeviceScheduledUpdateChecker::OnScheduledUpdateCheckDataChanged() {
@@ -314,7 +330,12 @@
   scheduled_update_check_data_ = std::move(scheduled_update_check_data);
 
   // Policy has been updated, calculate and set |update_check_timer_| again.
-  StartUpdateCheckTimer();
+  start_update_check_timer_task_executor_.Start(
+      base::BindRepeating(&DeviceScheduledUpdateChecker::StartUpdateCheckTimer,
+                          base::Unretained(this)),
+      base::BindOnce(
+          &DeviceScheduledUpdateChecker::OnStartUpdateCheckTimerRetryFailure,
+          base::Unretained(this)));
 }
 
 base::Optional<base::Time>
@@ -392,12 +413,6 @@
 }
 
 void DeviceScheduledUpdateChecker::StartUpdateCheckTimer() {
-  // Cancel any pending calls to |StartUpdateCheckTimer| to avoid redundant
-  // work, one could be lingering due to a call to
-  // |RetryStartUpdateCheckTimer|. If an error occurs while starting the
-  // timer it will be retried again in this function.
-  start_update_check_retry_timer_.reset();
-
   // For accuracy of the next update check, capture current time as close to the
   // start of this function as possible.
   const base::TimeTicks cur_ticks = GetTicksSinceBoot();
@@ -410,7 +425,7 @@
   base::Optional<base::Time> update_check_time =
       CalculateNextUpdateCheckTime(cur_time);
   if (!update_check_time) {
-    RetryStartUpdateCheckTimer();
+    start_update_check_timer_task_executor_.ScheduleRetry();
     return;
   }
   scheduled_update_check_data_->next_update_check_time_ticks =
@@ -434,58 +449,26 @@
 }
 
 void DeviceScheduledUpdateChecker::OnTimerStartResult(bool result) {
+  // Schedule a retry if |update_check_timer_| failed to start.
   if (!result) {
     LOG(ERROR) << "Failed to start update check timer";
-    // This method runs either due to |update_check_timer_|'s start operation
-    // failing or |start_update_check_timer_|'s start operation failing. In both
-    // cases it's called by |NativeTimer| and it's best to schedule
-    // |RetryStartUpdateCheckTimer| as a separate task as it destroys the same
-    // |NativeTimer| object inside it.
-    base::SequencedTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::BindOnce(
-            &DeviceScheduledUpdateChecker::RetryStartUpdateCheckTimer,
-            weak_factory_.GetWeakPtr()));
+    start_update_check_timer_task_executor_.ScheduleRetry();
     return;
   }
 }
 
-void DeviceScheduledUpdateChecker::RetryStartUpdateCheckTimer() {
+void DeviceScheduledUpdateChecker::OnStartUpdateCheckTimerRetryFailure() {
   // Retrying has a limit. In the unlikely scenario this is met, reset all
   // state. Now an update check can only happen when a new policy comes in or
   // Chrome is restarted.
-  if (update_check_timer_start_attempts_ >=
-      update_checker_internal::kMaxRetryUpdateCheckIterations) {
-    LOG(ERROR) << "Aborting attempts to start update check timer";
-    ResetState();
-    return;
-  }
-
-  // There can only be one pending call to |StartUpdateCheckTimer| at any given
-  // time. For easier state maintenance, instantiate fresh timers for each
-  // retry attempt. The old timer must be destroyed before creating a new timer
-  // with the same tag as per the semantics of |NativeTimer|. That's why using
-  // std::make_unique with the assignment operator would not have worked here.
-  update_check_timer_.reset();
-  ++update_check_timer_start_attempts_;
-  start_update_check_retry_timer_.reset();
-  start_update_check_retry_timer_ =
-      std::make_unique<chromeos::NativeTimer>(kStartUpdateCheckRetryTimerTag);
-  start_update_check_retry_timer_->Start(
-      GetTicksSinceBoot() +
-          update_checker_internal::kStartUpdateCheckTimerRetryTime,
-      base::BindOnce(&DeviceScheduledUpdateChecker::StartUpdateCheckTimer,
-                     base::Unretained(this)),
-      base::BindOnce(&DeviceScheduledUpdateChecker::OnTimerStartResult,
-                     base::Unretained(this)));
+  LOG(ERROR) << "Failed to start update check timer after all retries";
+  ResetState();
 }
 
 void DeviceScheduledUpdateChecker::ResetState() {
-  weak_factory_.InvalidateWeakPtrs();
-  update_check_timer_start_attempts_ = 0;
-  start_update_check_retry_timer_.reset();
   update_check_timer_.reset();
   scheduled_update_check_data_ = base::nullopt;
+  start_update_check_timer_task_executor_.Stop();
 }
 
 base::Time DeviceScheduledUpdateChecker::GetCurrentTime() {
diff --git a/chrome/browser/chromeos/policy/device_scheduled_update_checker.h b/chrome/browser/chromeos/policy/device_scheduled_update_checker.h
index 869902ce..958af53 100644
--- a/chrome/browser/chromeos/policy/device_scheduled_update_checker.h
+++ b/chrome/browser/chromeos/policy/device_scheduled_update_checker.h
@@ -11,6 +11,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
 #include "base/time/time.h"
+#include "chrome/browser/chromeos/policy/task_executor_with_retries.h"
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #include "chromeos/dbus/power/native_timer.h"
 
@@ -90,20 +91,21 @@
   // Callback triggered when scheduled update check setting has changed.
   void OnScheduledUpdateCheckDataChanged();
 
-  // Sets |update_check_timer_| based on |scheduled_update_check_data_|. If the
+  // Must only be run via |start_update_check_timer_task_executor_|. Sets
+  // |update_check_timer_| based on |scheduled_update_check_data_|. If the
   // |update_check_timer_| can't be started due to an error in
-  // |CalculateNextUpdateCheckTime| then reschedules itself to try again.
-  // Requires |scheduled_update_check_data_| to be set.
+  // |CalculateNextUpdateCheckTime| then reschedules itself via
+  // |start_update_check_timer_task_executor_|. Requires
+  // |scheduled_update_check_data_| to be set.
   void StartUpdateCheckTimer();
 
-  // Called upon starting |update_check_timer_| or
-  // |start_update_check_retry_timer_|. Indicates whether or not the timer was
-  // started successfully.
+  // Called upon starting |update_check_timer_|. Indicates whether or not the
+  // timer was started successfully.
   void OnTimerStartResult(bool result);
 
-  // Cancels any pending |StartUpdateCheckTimer| calls and reschedules it after
-  // a delay.
-  void RetryStartUpdateCheckTimer();
+  // Called when |start_update_check_timer_task_executor_|'s retry limit has
+  // been reached.
+  void OnStartUpdateCheckTimerRetryFailure();
 
   // Reset all state and cancel all pending tasks.
   void ResetState();
@@ -114,32 +116,22 @@
   // Returns time ticks from boot including time ticks spent during sleeping.
   virtual base::TimeTicks GetTicksSinceBoot();
 
-  // The number of attempts for which |update_check_timer_| has tried to be
-  // started.
-  int update_check_timer_start_attempts_ = 0;
-
   // Used to retrieve Chrome OS settings. Not owned.
   chromeos::CrosSettings* const cros_settings_;
 
+  // Used to observe when settings change.
   std::unique_ptr<chromeos::CrosSettings::ObserverSubscription>
       cros_settings_observer_;
 
   // Currently active scheduled update check policy.
   base::Optional<ScheduledUpdateCheckData> scheduled_update_check_data_;
 
+  // Used to run and retry |StartUpdateCheckTimer| if it fails.
+  TaskExecutorWithRetries start_update_check_timer_task_executor_;
+
   // Timer that is scheduled to check for updates.
   std::unique_ptr<chromeos::NativeTimer> update_check_timer_;
 
-  // Timer that retries |StartUpdateCheckTimer| in case it fails to start
-  // |update_check_timer_|. This needs to be suspend aware as well because the
-  // retry needs to be done before the time for the next update check and
-  // between that time the device maybe suspended indefinitely. Consequently, if
-  // this timer doesn't run in suspend then there is a chance to miss the next
-  // update check.
-  std::unique_ptr<chromeos::NativeTimer> start_update_check_retry_timer_;
-
-  base::WeakPtrFactory<DeviceScheduledUpdateChecker> weak_factory_{this};
-
   DISALLOW_COPY_AND_ASSIGN(DeviceScheduledUpdateChecker);
 };
 
diff --git a/chrome/browser/chromeos/policy/task_executor_with_retries.cc b/chrome/browser/chromeos/policy/task_executor_with_retries.cc
new file mode 100644
index 0000000..183c369
--- /dev/null
+++ b/chrome/browser/chromeos/policy/task_executor_with_retries.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/chromeos/policy/task_executor_with_retries.h"
+
+#include <utility>
+
+namespace policy {
+
+TaskExecutorWithRetries::TaskExecutorWithRetries(
+    const std::string& description,
+    GetTicksSinceBootFn get_ticks_since_boot_fn,
+    int max_retries,
+    base::TimeDelta retry_time)
+    : description_(description),
+      get_ticks_since_boot_fn_(std::move(get_ticks_since_boot_fn)),
+      max_retries_(max_retries),
+      retry_time_(retry_time) {}
+
+TaskExecutorWithRetries::~TaskExecutorWithRetries() = default;
+
+void TaskExecutorWithRetries::Start(AsyncTask task,
+                                    RetryFailureCb retry_failure_cb) {
+  ResetState();
+  task_ = std::move(task);
+  retry_failure_cb_ = std::move(retry_failure_cb);
+  task_.Run();
+}
+
+void TaskExecutorWithRetries::Stop() {
+  ResetState();
+}
+
+void TaskExecutorWithRetries::ScheduleRetry() {
+  // This method may be called from |retry_timer_|'s |OnExpiration| method. It's
+  // best to schedule |RetryTask| as a separate task as it destroys the same
+  // |NativeTimer| object inside it. For easier state maintenance there can only
+  // be one retry task pending at a time.
+  weak_factory_.InvalidateWeakPtrs();
+  base::SequencedTaskRunnerHandle::Get()->PostTask(
+      FROM_HERE, base::BindOnce(&TaskExecutorWithRetries::RetryTask,
+                                weak_factory_.GetWeakPtr()));
+}
+
+void TaskExecutorWithRetries::OnRetryTimerStartResult(bool result) {
+  if (!result) {
+    LOG(ERROR) << "Failed to start retry timer";
+    ScheduleRetry();
+    return;
+  }
+}
+
+void TaskExecutorWithRetries::ResetState() {
+  num_retries_ = 0;
+  task_.Reset();
+  retry_failure_cb_.Reset();
+  retry_timer_.reset();
+  weak_factory_.InvalidateWeakPtrs();
+}
+
+void TaskExecutorWithRetries::RetryTask() {
+  // Retrying has a limit. In the unlikely scenario this is met, reset all
+  // state. Now an update check can only happen when a new policy comes in or
+  // Chrome is restarted.
+  if (num_retries_ >= max_retries_) {
+    LOG(ERROR) << "Task runner " << description_
+               << " aborting task after max retries";
+    std::move(retry_failure_cb_).Run();
+    ResetState();
+    return;
+  }
+
+  // There can only be one pending call to |task_| at any given time, delete any
+  // pending calls by resetting the timer. The old timer must be destroyed
+  // before creating a new timer with the same tag as per the semantics of
+  // |NativeTimer|. That's why using std::make_unique with the assignment
+  // operator would not have worked here. Safe to use "this" for the result
+  // callback as |retry_timer_| can't outlive its parent.
+  ++num_retries_;
+  retry_timer_.reset();
+  retry_timer_ = std::make_unique<chromeos::NativeTimer>(description_);
+  retry_timer_->Start(
+      get_ticks_since_boot_fn_.Run() + retry_time_, task_,
+      base::BindOnce(&TaskExecutorWithRetries::OnRetryTimerStartResult,
+                     base::Unretained(this)));
+}
+
+}  // namespace policy
diff --git a/chrome/browser/chromeos/policy/task_executor_with_retries.h b/chrome/browser/chromeos/policy/task_executor_with_retries.h
new file mode 100644
index 0000000..b9fc5fd
--- /dev/null
+++ b/chrome/browser/chromeos/policy/task_executor_with_retries.h
@@ -0,0 +1,97 @@
+// 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_CHROMEOS_POLICY_TASK_EXECUTOR_WITH_RETRIES_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_TASK_EXECUTOR_WITH_RETRIES_H_
+
+#include <memory>
+#include <string>
+
+#include "base/callback_forward.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
+#include "chromeos/dbus/power/native_timer.h"
+
+namespace policy {
+
+// This class runs a task that can fail. In case of failure it retries the task
+// using NativeTimer i.e. the retry can wake the device up from suspend and is
+// suspend aware. Any callbacks passed to its API will not be invoked if an
+// object of this class is destroyed.
+class TaskExecutorWithRetries {
+ public:
+  using AsyncTask = base::RepeatingClosure;
+  using RetryFailureCb = base::OnceClosure;
+  using GetTicksSinceBootFn = base::RepeatingCallback<base::TimeTicks(void)>;
+
+  // |description| - String identifying this object.
+  // |get_ticks_since_boot_fn| - Callback that returns current ticks from boot.
+  // Used for scheduling retry timer.
+  // |max_retries| - Maximum number of retries after which trying the task is
+  // given up.
+  // |retry_time| - Time between each retry.
+  TaskExecutorWithRetries(const std::string& description,
+                          GetTicksSinceBootFn get_ticks_since_boot_fn,
+                          int max_retries,
+                          base::TimeDelta retry_time);
+  ~TaskExecutorWithRetries();
+
+  // Runs |task| and caches |retry_failure_cb| which will be called when
+  // |max_retries_| is reached and |task_| couldn't be run successfully.
+  // Consecutive calls override any state and pending callbacks associated with
+  // the previous call.
+  void Start(AsyncTask task, RetryFailureCb retry_failure_cb);
+
+  // Resets state and stops all pending callbacks.
+  void Stop();
+
+  // Cancels all outstanding |RetryTask| calls and schedules a new |RetryTask|
+  // call on the calling sequence.
+  void ScheduleRetry();
+
+ private:
+  // Called upon starting |retry_timer_|. Indicates whether or not the timer was
+  // started successfully.
+  void OnRetryTimerStartResult(bool result);
+
+  // Resets state including stopping all pending callbacks.
+  void ResetState();
+
+  // Starts |retry_timer_| to schedule |task_| at |retry_time_| interval.
+  void RetryTask();
+
+  // String identifying this object. Used with the |retry_timer_| API.
+  const std::string description_;
+
+  // Used to get current time ticks from boot.
+  const GetTicksSinceBootFn get_ticks_since_boot_fn_;
+
+  // Maximum number of retries after which trying the task is given up.
+  const int max_retries_;
+
+  // Time between each retry.
+  const base::TimeDelta retry_time_;
+
+  // Current retry iteration. Capped at |max_retries_|.
+  int num_retries_ = 0;
+
+  // The task to run.
+  AsyncTask task_;
+
+  // Callback to call after |max_retries_| have been reached and |task_| wasn't
+  // successfully scheduled.
+  RetryFailureCb retry_failure_cb_;
+
+  // Timer used to retry |task_|.
+  std::unique_ptr<chromeos::NativeTimer> retry_timer_;
+
+  base::WeakPtrFactory<TaskExecutorWithRetries> weak_factory_{this};
+
+  DISALLOW_COPY_AND_ASSIGN(TaskExecutorWithRetries);
+};
+
+}  // namespace policy
+
+#endif  // CHROME_BROWSER_CHROMEOS_POLICY_TASK_EXECUTOR_WITH_RETRIES_H_
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
index 7ce6643..0ad6ab1 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
@@ -592,6 +592,7 @@
 bool ChromeContentBrowserClientExtensionsPart::AllowServiceWorker(
     const GURL& scope,
     const GURL& first_party_url,
+    const GURL& script_url,
     content::ResourceContext* context) {
   // We only care about extension urls.
   if (!first_party_url.SchemeIs(kExtensionScheme))
@@ -603,7 +604,30 @@
       extension_info_map->extensions().GetExtensionOrAppByURL(first_party_url);
   // Don't allow a service worker for an extension url with no extension (this
   // could happen in the case of, e.g., an unloaded extension).
-  return extension != nullptr;
+  if (!extension)
+    return false;
+
+  // If an extension doesn't have a service worker-based background script, it
+  // can register a service worker at any scope.
+  if (!extensions::BackgroundInfo::IsServiceWorkerBased(extension))
+    return true;
+
+  // If the script_url parameter is an empty string, allow it. The
+  // infrastructure will call this function at times when the script url is
+  // unknown, but it is always known at registration, so this is OK.
+  if (script_url.is_empty())
+    return true;
+
+  // An extension with a service worked-based background script can register a
+  // service worker at any scope other than the root scope.
+  if (scope != extension->url())
+    return true;
+
+  // If an extension is service-worker based, only the script specified in the
+  // manifest can be registered at the root scope.
+  const std::string& sw_script =
+      extensions::BackgroundInfo::GetBackgroundServiceWorkerScript(extension);
+  return script_url == extension->GetResourceURL(sw_script);
 }
 
 // static
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
index 6dd388b..9a35eab 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
@@ -70,6 +70,7 @@
       const GURL& new_url);
   static bool AllowServiceWorker(const GURL& scope,
                                  const GURL& first_party_url,
+                                 const GURL& script_url,
                                  content::ResourceContext* context);
   static void OverrideNavigationParams(
       content::SiteInstance* site_instance,
diff --git a/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc b/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc
index b555f46..3b55c6f 100644
--- a/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc
+++ b/chrome/browser/extensions/cross_origin_read_blocking_browsertest.cc
@@ -643,8 +643,6 @@
 
   // Verify that no blocking occurred.
   EXPECT_EQ("nosniff.xml - body\n", fetch_result);
-  EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-              testing::IsEmpty());
 }
 
 // Test that requests from a extension page hosted in a foreground tab use
@@ -670,8 +668,6 @@
 
     // Verify that no blocking occurred.
     EXPECT_EQ("nosniff.xml - body\n", fetch_result);
-    EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-                testing::IsEmpty());
   }
 
   // Test case #2: Fetch from an about:srcdoc subframe of a
@@ -686,8 +682,6 @@
 
     // Verify that no blocking occurred.
     EXPECT_EQ("nosniff.xml - body\n", fetch_result);
-    EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-                testing::IsEmpty());
   }
 }
 
@@ -763,8 +757,6 @@
     // through the service worker).
     EXPECT_EQ("SERVICE WORKER INTERCEPT: >>>nosniff.xml - body\n<<<",
               fetch_result);
-    EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-                testing::IsEmpty());
   }
 
   // Test case #2: Network fetch used as a fallback when service worker ignores
@@ -784,8 +776,6 @@
 
     // Verify that no blocking occurred.
     EXPECT_EQ("nosniff.xml - body\n", fetch_result);
-    EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-                testing::IsEmpty());
   }
 }
 
@@ -1048,8 +1038,6 @@
 
     // Verify that no CORB blocking occurred.
     EXPECT_EQ("nosniff.xml - body\n", fetch_result);
-    EXPECT_THAT(histograms.GetAllSamples("SiteIsolation.XSD.Browser.Blocked"),
-                testing::IsEmpty());
   }
 }
 
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc
index f134939..edce68d 100644
--- a/chrome/browser/extensions/service_worker_apitest.cc
+++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -1551,26 +1551,41 @@
   ASSERT_TRUE(RunExtensionTest("service_worker/mime_handler_view"));
 }
 
-// An observer to block on service worker registration stored.
-class RegistrationStoredObserver
-    : public content::ServiceWorkerContextObserver {
+// An observer for service worker registration events.
+class TestRegistrationObserver : public content::ServiceWorkerContextObserver {
  public:
-  RegistrationStoredObserver(content::ServiceWorkerContext* context,
-                             base::OnceClosure callback)
-      : context_(context), registered_callback_(std::move(callback)) {
+  using RegistrationsMap = std::map<GURL, int>;
+
+  explicit TestRegistrationObserver(content::ServiceWorkerContext* context)
+      : context_(context) {
     context_->AddObserver(this);
   }
 
-  ~RegistrationStoredObserver() override {
+  ~TestRegistrationObserver() override {
     if (context_) {
       context_->RemoveObserver(this);
     }
   }
 
+  // Wait for the first service worker registration with an extension scheme
+  // scope to be stored.
+  void WaitForRegistrationStored() { stored_run_loop_.Run(); }
+
+  int GetCompletedCount(const GURL& scope) const {
+    const auto it = registrations_completed_map_.find(scope);
+    return it == registrations_completed_map_.end() ? 0 : it->second;
+  }
+
+ private:
+  // ServiceWorkerContextObserver overrides.
+  void OnRegistrationCompleted(const GURL& scope) override {
+    ++registrations_completed_map_[scope];
+  }
+
   void OnRegistrationStored(int64_t registration_id,
                             const GURL& scope) override {
     if (scope.SchemeIs(kExtensionScheme)) {
-      std::move(registered_callback_).Run();
+      stored_run_loop_.Quit();
     }
   }
 
@@ -1578,9 +1593,9 @@
     context_ = nullptr;
   }
 
- private:
+  RegistrationsMap registrations_completed_map_;
+  base::RunLoop stored_run_loop_;
   content::ServiceWorkerContext* context_;
-  base::OnceClosure registered_callback_;
 };
 
 IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTest,
@@ -1591,8 +1606,7 @@
       storage_partition->GetServiceWorkerContext();
 
   // Set up an observer to wait for the registration to be stored.
-  base::RunLoop registration_loop;
-  RegistrationStoredObserver observer(context, registration_loop.QuitClosure());
+  TestRegistrationObserver observer(context);
 
   ExtensionTestMessageListener event_listener_added("ready", false);
   event_listener_added.set_failure_message("ERROR");
@@ -1602,8 +1616,7 @@
       kFlagNone);
   ASSERT_TRUE(extension);
 
-  // Wait for service worker registration to be stored.
-  registration_loop.Run();
+  observer.WaitForRegistrationStored();
   EXPECT_TRUE(event_listener_added.WaitUntilSatisfied());
 
   // Stop the service worker.
@@ -1622,6 +1635,33 @@
   EXPECT_TRUE(finished_listener.WaitUntilSatisfied());
 }
 
+// Tests the restriction on registering service worker scripts at root scope.
+IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTest,
+                       ServiceWorkerScriptRootScope) {
+  content::StoragePartition* storage_partition =
+      content::BrowserContext::GetDefaultStoragePartition(browser()->profile());
+  content::ServiceWorkerContext* context =
+      storage_partition->GetServiceWorkerContext();
+
+  // Set up an observer to track all SW registrations. We expect only
+  // one for the extension's root scope. This test attempts to register
+  // an additional service worker, which will fail.
+  TestRegistrationObserver observer(context);
+  ExtensionTestMessageListener registration_listener("REGISTRATION_FAILED",
+                                                     false);
+  registration_listener.set_failure_message("WORKER_STARTED");
+  const Extension* extension = LoadExtensionWithFlags(
+      test_data_dir_.AppendASCII(
+          "service_worker/worker_based_background/script_root_scope"),
+      kFlagNone);
+  ASSERT_TRUE(extension);
+
+  EXPECT_TRUE(registration_listener.WaitUntilSatisfied());
+  // We expect exactly one registration, which is the one specified in the
+  // manifest.
+  EXPECT_EQ(1, observer.GetCompletedCount(extension->url()));
+}
+
 IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTest,
                        ProcessManagerRegistrationOnShutdown) {
   // Note that StopServiceWorkerForScope call below expects the worker to be
diff --git a/chrome/browser/media/webrtc/webrtc_event_log_manager_unittest.cc b/chrome/browser/media/webrtc/webrtc_event_log_manager_unittest.cc
index 5675993..069a629e 100644
--- a/chrome/browser/media/webrtc/webrtc_event_log_manager_unittest.cc
+++ b/chrome/browser/media/webrtc/webrtc_event_log_manager_unittest.cc
@@ -637,8 +637,7 @@
     return browser_context;
   }
 
-  base::FilePath RemoteBoundLogsDir(
-      const BrowserContext* browser_context) const {
+  base::FilePath RemoteBoundLogsDir(BrowserContext* browser_context) const {
     return RemoteBoundLogsDir(browser_context->GetPath());
   }
 
diff --git a/chrome/browser/navigation_predictor/navigation_predictor.cc b/chrome/browser/navigation_predictor/navigation_predictor.cc
index 49320e2..52f3f35 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor.cc
@@ -272,13 +272,18 @@
   if (current_visibility_ == visibility)
     return;
 
-  // Check if the visibility changed from HIDDEN to VISIBLE. Since navigation
+  // Check if the visibility changed from VISIBLE to HIDDEN. Since navigation
   // predictor is currently restricted to Android, it is okay to disregard the
   // occluded state.
   if (current_visibility_ != content::Visibility::HIDDEN ||
       visibility != content::Visibility::VISIBLE) {
     current_visibility_ = visibility;
 
+    if (prerender_handle_) {
+      prerender_handle_->OnNavigateAway();
+      prerender_handle_.reset();
+    }
+
     // Stop any future preconnects while hidden.
     timer_.Stop();
     return;
@@ -289,6 +294,9 @@
   // Previously, the visibility was HIDDEN, and now it is VISIBLE implying that
   // the web contents that was fully hidden is now fully visible.
   MaybePreconnectNow(Action::kPreconnectOnVisibilityChange);
+  if (prefetch_url_.has_value()) {
+    MaybePrefetch();
+  }
 }
 
 void NavigationPredictor::MaybePreconnectNow(Action log_action) {
@@ -790,9 +798,7 @@
   if (prefetch_url_.has_value()) {
     DCHECK_EQ(document_origin.host(), prefetch_url_->host());
     MaybePreconnectNow(Action::kPrefetch);
-    if (prefetch_after_preconnect_) {
-      Prerender(prefetch_url_.value());
-    }
+    MaybePrefetch();
     return;
   }
 
@@ -808,26 +814,38 @@
   base::UmaHistogramEnumeration(action_histogram_name, Action::kNone);
 }
 
-void NavigationPredictor::Prerender(const GURL& url) {
+void NavigationPredictor::MaybePrefetch() {
+  // If prefetches aren't allowed here, this URL has already
+  // been prefetched, or the current tab is hidden,
+  // we shouldn't prefetch again.
+  if (!prefetch_after_preconnect_ || prefetch_url_prefetched_ ||
+      current_visibility_ == content::Visibility::HIDDEN) {
+    return;
+  }
+
   prerender::PrerenderManager* prerender_manager =
       prerender::PrerenderManagerFactory::GetForBrowserContext(
           browser_context_);
 
   if (prerender_manager) {
-    content::SessionStorageNamespace* session_storage_namespace =
-        web_contents()->GetController().GetDefaultSessionStorageNamespace();
-    gfx::Size size = web_contents()->GetContainerBounds().size();
-
-    if (prerender_handle_) {
-      prerender_handle_->OnCancel();
-    }
-    // TODO(sofiyase): Only prerender when the tab is in the foreground.
-    // https://crbug.com/976071
-    prerender_handle_ = prerender_manager->AddPrerenderFromNavigationPredictor(
-        url, session_storage_namespace, size);
+    Prefetch(prerender_manager);
+    prefetch_url_prefetched_ = true;
   }
 }
 
+void NavigationPredictor::Prefetch(
+    prerender::PrerenderManager* prerender_manager) {
+  DCHECK(!prefetch_url_prefetched_);
+  DCHECK(!prerender_handle_);
+
+  content::SessionStorageNamespace* session_storage_namespace =
+      web_contents()->GetController().GetDefaultSessionStorageNamespace();
+  gfx::Size size = web_contents()->GetContainerBounds().size();
+
+  prerender_handle_ = prerender_manager->AddPrerenderFromNavigationPredictor(
+      prefetch_url_.value(), session_storage_namespace, size);
+}
+
 base::Optional<GURL> NavigationPredictor::GetUrlToPrefetch(
     const url::Origin& document_origin,
     const std::vector<std::unique_ptr<NavigationScore>>&
diff --git a/chrome/browser/navigation_predictor/navigation_predictor.h b/chrome/browser/navigation_predictor/navigation_predictor.h
index 5293591..73ce4fc 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor.h
+++ b/chrome/browser/navigation_predictor/navigation_predictor.h
@@ -27,6 +27,7 @@
 
 namespace prerender {
 class PrerenderHandle;
+class PrerenderManager;
 }
 
 class SiteEngagementService;
@@ -100,6 +101,10 @@
   // URL that we decided to prefetch.
   base::Optional<GURL> prefetch_url_;
 
+  // True if a prefetch_url_ has already been prefetched, so we know
+  // whether to prefetch the url again when a tab becomes visible.
+  bool prefetch_url_prefetched_ = false;
+
  private:
   // Struct holding navigation score, rank and other info of the anchor element.
   // Used for look up when an anchor element is clicked.
@@ -149,8 +154,12 @@
       const std::vector<std::unique_ptr<NavigationScore>>&
           sorted_navigation_scores);
 
-  // Given a url to prerender, use PrerenderManager to prerender that page.
-  void Prerender(const GURL& url);
+  // Decides whether to prefetch a URL and, if yes, calls Prefetch.
+  void MaybePrefetch();
+
+  // Given a url to prefetch, uses PrerenderManager to start a NoStatePrefetch
+  // of that URL.
+  virtual void Prefetch(prerender::PrerenderManager* prerender_manager);
 
   base::Optional<GURL> GetUrlToPrefetch(
       const url::Origin& document_origin,
diff --git a/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc b/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
index 4f15816..8b7fb56 100644
--- a/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
+++ b/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
@@ -12,6 +12,7 @@
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "content/public/browser/web_contents.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -46,6 +47,10 @@
 
   const std::map<GURL, int>& GetAreaRankMap() const { return area_rank_map_; }
 
+  bool prefetch_url_prefetched() const { return prefetch_url_prefetched_; }
+
+  int calls_to_prefetch() const { return calls_to_prefetch_; }
+
  private:
   double CalculateAnchorNavigationScore(
       const blink::mojom::AnchorElementMetrics& metrics,
@@ -57,6 +62,10 @@
     return 100 * metrics.ratio_area;
   }
 
+  void Prefetch(prerender::PrerenderManager* prerender_manager) override {
+    calls_to_prefetch_ += 1;
+  }
+
   // Maps from target URL to area rank of the anchor element.
   mutable std::map<GURL, int> area_rank_map_;
 
@@ -64,6 +73,8 @@
 
   // Used to bind Mojo interface
   mojo::Binding<AnchorElementMetricsHost> binding_;
+
+  int calls_to_prefetch_ = 0;
 };
 
 class NavigationPredictorTest : public ChromeRenderViewHostTestHarness {
@@ -99,6 +110,10 @@
     return predictor_service_helper_->preconnect_origin();
   }
 
+  bool prefetch_url_prefetched() {
+    return predictor_service_helper_->prefetch_url_prefetched();
+  }
+
  protected:
   void SetUp() override {
     ChromeRenderViewHostTestHarness::SetUp();
@@ -108,7 +123,8 @@
   }
 
   void SetupFieldTrial(base::Optional<int> preconnect_origin_score_threshold,
-                       base::Optional<int> prefetch_url_score_threshold) {
+                       base::Optional<int> prefetch_url_score_threshold,
+                       base::Optional<bool> prefetch_after_preconnect) {
     if (field_trial_initiated_)
       return;
 
@@ -125,6 +141,10 @@
       params["prefetch_url_score_threshold"] =
           base::NumberToString(prefetch_url_score_threshold.value());
     }
+    if (prefetch_after_preconnect.has_value()) {
+      params["prefetch_after_preconnect"] =
+          prefetch_after_preconnect.value() ? "true" : "false";
+    }
     scoped_feature_list.InitAndEnableFeatureWithParameters(
         blink::features::kNavigationPredictor, params);
   }
@@ -481,13 +501,57 @@
   EXPECT_FALSE(prefetch_url().has_value());
 }
 
+class NavigationPredictorPrefetchAfterPreconnectEnabledTest
+    : public NavigationPredictorTest {
+ public:
+  NavigationPredictorPrefetchAfterPreconnectEnabledTest() {
+    SetupFieldTrial(base::nullopt, base::nullopt, true);
+  }
+
+  void SetUp() override {
+    ChromeRenderViewHostTestHarness::SetUp();
+    predictor_service_helper_ = std::make_unique<TestNavigationPredictor>(
+        mojo::MakeRequest(&predictor_service_), main_rfh(), false);
+  }
+};
+
+// Test that a prefetch after preconnect occurs only when the current tab is
+// in the foreground, and that it does not occur multiple times for the same
+// URL.
+TEST_F(NavigationPredictorPrefetchAfterPreconnectEnabledTest,
+       PrefetchWithTabs) {
+  const std::string source = "https://example.com";
+  const std::string same_origin_href_large = "https://example.com/large";
+  std::vector<blink::mojom::AnchorElementMetricsPtr> metrics;
+  metrics.push_back(CreateMetricsPtr(source, same_origin_href_large, 1));
+
+  // Hide the tab and load the page. The URL should not be prefetched.
+  web_contents()->WasHidden();
+  predictor_service()->ReportAnchorElementMetricsOnLoad(std::move(metrics));
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(prefetch_url_prefetched());
+  EXPECT_EQ(predictor_service_helper_->calls_to_prefetch(), 0);
+
+  // Making the tab visible should start a prefetch.
+  web_contents()->WasShown();
+  EXPECT_TRUE(prefetch_url_prefetched());
+  EXPECT_EQ(predictor_service_helper_->calls_to_prefetch(), 1);
+
+  // Switching a tab from HIDDEN to VISIBLE should not start a prefetch
+  // if a prefetch already occurred for that URL.
+  web_contents()->WasHidden();
+  web_contents()->WasShown();
+  EXPECT_TRUE(prefetch_url_prefetched());
+  EXPECT_EQ(predictor_service_helper_->calls_to_prefetch(), 1);
+}
+
 // Framework for testing cases where prefetch is effectively
 // disabled by setting |prefetch_url_score_threshold| to too high.
 class NavigationPredictorPrefetchDisabledTest : public NavigationPredictorTest {
  public:
   NavigationPredictorPrefetchDisabledTest() {
     SetupFieldTrial(0 /* preconnect_origin_score_threshold */,
-                    101 /* prefetch_url_score_threshold */);
+                    101 /* prefetch_url_score_threshold */, base::nullopt);
   }
 
   void SetUp() override {
@@ -583,7 +647,7 @@
  public:
   NavigationPredictorPreconnectPrefetchDisabledTest() {
     SetupFieldTrial(101 /* preconnect_origin_score_threshold */,
-                    101 /* prefetch_url_score_threshold */);
+                    101 /* prefetch_url_score_threshold */, base::nullopt);
   }
 
   void SetUp() override {
diff --git a/chrome/browser/offline_pages/android/prefetch_test_bridge.cc b/chrome/browser/offline_pages/android/prefetch_test_bridge.cc
index ad87463..fbdccb5 100644
--- a/chrome/browser/offline_pages/android/prefetch_test_bridge.cc
+++ b/chrome/browser/offline_pages/android/prefetch_test_bridge.cc
@@ -6,14 +6,20 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/jni_utils.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/android/profile_key_util.h"
 #include "chrome/browser/image_fetcher/image_fetcher_service_factory.h"
 #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "components/image_fetcher/core/cache/image_cache.h"
 #include "components/image_fetcher/core/image_fetcher_service.h"
 #include "components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h"
+#include "components/offline_pages/core/client_namespace_constants.h"
 #include "components/offline_pages/core/offline_page_feature.h"
+#include "components/offline_pages/core/prefetch/prefetch_dispatcher.h"
 #include "components/offline_pages/core/prefetch/prefetch_prefs.h"
+#include "components/offline_pages/core/prefetch/prefetch_service.h"
+#include "components/offline_pages/core/prefetch/prefetch_types.h"
 #include "jni/PrefetchTestBridge_jni.h"
 
 using base::android::JavaParamRef;
@@ -28,13 +34,13 @@
     JNIEnv* env,
     jboolean enable) {
   prefetch_prefs::SetLimitlessPrefetchingEnabled(
-      ProfileManager::GetLastUsedProfile()->GetPrefs(), enable != 0);
+      ::android::GetMainProfileKey()->GetPrefs(), enable != 0);
 }
 
 JNI_EXPORT jboolean
 JNI_PrefetchTestBridge_IsLimitlessPrefetchingEnabled(JNIEnv* env) {
   return static_cast<jboolean>(prefetch_prefs::IsLimitlessPrefetchingEnabled(
-      ProfileManager::GetLastUsedProfile()->GetPrefs()));
+      ::android::GetMainProfileKey()->GetPrefs()));
 }
 
 JNI_EXPORT void JNI_PrefetchTestBridge_SkipNTPSuggestionsAPIKeyCheck(
@@ -47,10 +53,8 @@
     JNIEnv* env,
     const JavaParamRef<jstring>& j_url,
     const JavaParamRef<jbyteArray>& j_image_data) {
-  Profile* profile = ProfileManager::GetLastUsedProfile();
-  DCHECK(profile);
   image_fetcher::ImageFetcherService* service =
-      ImageFetcherServiceFactory::GetForKey(profile->GetProfileKey());
+      ImageFetcherServiceFactory::GetForKey(::android::GetMainProfileKey());
   DCHECK(service);
   scoped_refptr<image_fetcher::ImageCache> cache =
       service->ImageCacheForTesting();
@@ -61,5 +65,32 @@
   cache->SaveImage(url, image_data);
 }
 
+JNI_EXPORT void JNI_PrefetchTestBridge_AddCandidatePrefetchURL(
+    JNIEnv* env,
+    const JavaParamRef<jstring>& j_url,
+    const JavaParamRef<jstring>& j_title,
+    const JavaParamRef<jstring>& j_thumbnail_url,
+    const JavaParamRef<jstring>& j_favicon_url,
+    const JavaParamRef<jstring>& j_snippet,
+    const JavaParamRef<jstring>& j_attribution) {
+  GURL url = GURL(base::android::ConvertJavaStringToUTF8(env, j_url));
+  base::string16 title = base::android::ConvertJavaStringToUTF16(env, j_title);
+  std::string thumbnail_url =
+      base::android::ConvertJavaStringToUTF8(env, j_thumbnail_url);
+  std::string favicon_url =
+      base::android::ConvertJavaStringToUTF8(env, j_favicon_url);
+  std::string snippet = base::android::ConvertJavaStringToUTF8(env, j_snippet);
+  std::string attribution =
+      base::android::ConvertJavaStringToUTF8(env, j_attribution);
+  std::vector<PrefetchURL> new_candidate_urls = {
+      PrefetchURL(url.spec(), url, title, GURL(thumbnail_url),
+                  GURL(favicon_url), snippet, attribution)};
+
+  PrefetchServiceFactory::GetForKey(::android::GetMainProfileKey())
+      ->GetPrefetchDispatcher()
+      ->AddCandidatePrefetchURLs(kSuggestedArticlesNamespace,
+                                 new_candidate_urls);
+}
+
 }  // namespace prefetch
 }  // namespace offline_pages
diff --git a/chrome/browser/offline_pages/offline_page_request_handler_unittest.cc b/chrome/browser/offline_pages/offline_page_request_handler_unittest.cc
index ba220125..00b370a2 100644
--- a/chrome/browser/offline_pages/offline_page_request_handler_unittest.cc
+++ b/chrome/browser/offline_pages/offline_page_request_handler_unittest.cc
@@ -49,12 +49,6 @@
 #include "mojo/public/cpp/system/wait.h"
 #include "net/base/filename_util.h"
 #include "net/http/http_request_headers.h"
-#include "net/url_request/url_request.h"
-#include "net/url_request/url_request_context.h"
-#include "net/url_request/url_request_context_builder.h"
-#include "net/url_request/url_request_intercepting_job_factory.h"
-#include "net/url_request/url_request_job_factory_impl.h"
-#include "net/url_request/url_request_test_util.h"
 #include "services/network/public/cpp/resource_request.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
@@ -94,7 +88,6 @@
     32);  // Wrong SHA256 Hash.
 
 const int kTabId = 1;
-const int kBufSize = 1024;
 
 const char kAggregatedRequestResultHistogram[] =
     "OfflinePages.AggregatedRequestResult2";
@@ -126,71 +119,6 @@
   std::string data_received;
 };
 
-class TestURLRequestDelegate : public net::URLRequest::Delegate {
- public:
-  typedef base::Callback<void(const ResponseInfo&)> ReadCompletedCallback;
-
-  explicit TestURLRequestDelegate(const ReadCompletedCallback& callback)
-      : read_completed_callback_(callback),
-        buffer_(base::MakeRefCounted<net::IOBuffer>(kBufSize)),
-        request_status_(net::ERR_IO_PENDING) {}
-
-  void OnResponseStarted(net::URLRequest* request, int net_error) override {
-    DCHECK_NE(net::ERR_IO_PENDING, net_error);
-    if (net_error != net::OK) {
-      OnReadCompleted(request, net_error);
-      return;
-    }
-    // Initiate the first read.
-    int bytes_read = request->Read(buffer_.get(), kBufSize);
-    if (bytes_read >= 0) {
-      OnReadCompleted(request, bytes_read);
-    } else if (bytes_read != net::ERR_IO_PENDING) {
-      request_status_ = bytes_read;
-      OnResponseCompleted(request);
-    }
-  }
-
-  void OnReadCompleted(net::URLRequest* request, int bytes_read) override {
-    if (bytes_read > 0)
-      data_received_.append(buffer_->data(), bytes_read);
-
-    // If it was not end of stream, request to read more.
-    while (bytes_read > 0) {
-      bytes_read = request->Read(buffer_.get(), kBufSize);
-      if (bytes_read > 0)
-        data_received_.append(buffer_->data(), bytes_read);
-    }
-
-    request_status_ = (bytes_read >= 0) ? net::OK : bytes_read;
-    if (bytes_read != net::ERR_IO_PENDING)
-      OnResponseCompleted(request);
-  }
-
- private:
-  void OnResponseCompleted(net::URLRequest* request) {
-    if (request_status_ != net::OK)
-      data_received_.clear();
-    if (read_completed_callback_.is_null())
-      return;
-    std::string mime_type;
-    request->GetMimeType(&mime_type);
-    read_completed_callback_.Run(
-        ResponseInfo(request_status_, mime_type, data_received_));
-  }
-
-  ReadCompletedCallback read_completed_callback_;
-  scoped_refptr<net::IOBuffer> buffer_;
-  std::string data_received_;
-  int request_status_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestURLRequestDelegate);
-};
-
-content::WebContents* GetWebContents(content::WebContents* web_contents) {
-  return web_contents;
-}
-
 bool GetTabId(int tab_id_value,
               content::WebContents* web_content,
               int* tab_id) {
@@ -198,41 +126,6 @@
   return true;
 }
 
-class TestURLRequestInterceptingJobFactory
-    : public net::URLRequestInterceptingJobFactory {
- public:
-  TestURLRequestInterceptingJobFactory(
-      std::unique_ptr<net::URLRequestJobFactory> job_factory,
-      std::unique_ptr<net::URLRequestInterceptor> interceptor,
-      content::WebContents* web_contents)
-      : net::URLRequestInterceptingJobFactory(std::move(job_factory),
-                                              std::move(interceptor)),
-        web_contents_(web_contents) {}
-  ~TestURLRequestInterceptingJobFactory() override { web_contents_ = nullptr; }
-
-  net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
-      const std::string& scheme,
-      net::URLRequest* request,
-      net::NetworkDelegate* network_delegate) const override {
-    net::URLRequestJob* job = net::URLRequestInterceptingJobFactory::
-        MaybeCreateJobWithProtocolHandler(scheme, request, network_delegate);
-    if (job) {
-      OfflinePageRequestJob* offline_page_request_job =
-          static_cast<OfflinePageRequestJob*>(job);
-      offline_page_request_job->SetWebContentsGetterForTesting(
-          base::BindRepeating(&GetWebContents, web_contents_));
-      offline_page_request_job->SetTabIdGetterForTesting(
-          base::BindRepeating(&GetTabId, kTabId));
-    }
-    return job;
-  }
-
- private:
-  content::WebContents* web_contents_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestURLRequestInterceptingJobFactory);
-};
-
 class TestNetworkChangeNotifier : public net::NetworkChangeNotifier {
  public:
   TestNetworkChangeNotifier() : online_(true) {}
@@ -399,19 +292,61 @@
 
 }  // namespace
 
-class OfflinePageRequestHandlerTestBase : public testing::Test {
- public:
-  OfflinePageRequestHandlerTestBase();
-  ~OfflinePageRequestHandlerTestBase() override {}
+class OfflinePageRequestHandlerTest;
 
-  virtual void InterceptRequest(const GURL& url,
-                                const std::string& method,
-                                const net::HttpRequestHeaders& extra_headers,
-                                bool is_main_frame) = 0;
+// Builds an OfflinePageURLLoader to test the request interception with network
+// service enabled.
+class OfflinePageURLLoaderBuilder : public TestURLLoaderClient::Observer {
+ public:
+  explicit OfflinePageURLLoaderBuilder(OfflinePageRequestHandlerTest* test);
+
+  void OnReceiveRedirect(const GURL& redirected_url) override;
+  void OnReceiveResponse(
+      const network::ResourceResponseHead& response_head) override;
+  void OnStartLoadingResponseBody() override;
+  void OnComplete() override;
+
+  void InterceptRequest(const GURL& url,
+                        const std::string& method,
+                        const net::HttpRequestHeaders& extra_headers,
+                        bool is_main_frame);
+
+  OfflinePageRequestHandlerTest* test() { return test_; }
+
+ private:
+  void OnHandleReady(MojoResult result, const mojo::HandleSignalsState& state);
+  void InterceptRequestOnIO(const GURL& url,
+                            const std::string& method,
+                            const net::HttpRequestHeaders& extra_headers,
+                            bool is_main_frame);
+  void MaybeStartLoader(
+      const network::ResourceRequest& request,
+      content::URLLoaderRequestInterceptor::RequestHandler request_handler);
+  void ReadBody();
+  void ReadCompletedOnIO(const ResponseInfo& response);
+
+  OfflinePageRequestHandlerTest* test_;
+  std::unique_ptr<ChromeNavigationUIData> navigation_ui_data_;
+  std::unique_ptr<OfflinePageURLLoader> url_loader_;
+  std::unique_ptr<TestURLLoaderClient> client_;
+  std::unique_ptr<mojo::SimpleWatcher> handle_watcher_;
+  network::mojom::URLLoaderPtr loader_;
+  std::string mime_type_;
+  std::string body_;
+};
+
+class OfflinePageRequestHandlerTest : public testing::Test {
+ public:
+  OfflinePageRequestHandlerTest();
+  ~OfflinePageRequestHandlerTest() override {}
 
   void SetUp() override;
   void TearDown() override;
 
+  void InterceptRequest(const GURL& url,
+                        const std::string& method,
+                        const net::HttpRequestHeaders& extra_headers,
+                        bool is_main_frame);
   void SimulateHasNetworkConnectivity(bool has_connectivity);
   void RunUntilIdle();
   void WaitForAsyncOperation();
@@ -581,18 +516,21 @@
   bool async_operation_completed_ = false;
   base::Closure async_operation_completed_callback_;
 
-  DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestHandlerTestBase);
+  OfflinePageURLLoaderBuilder interceptor_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestHandlerTest);
 };
 
-OfflinePageRequestHandlerTestBase::OfflinePageRequestHandlerTestBase()
+OfflinePageRequestHandlerTest::OfflinePageRequestHandlerTest()
     : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD),
       profile_manager_(TestingBrowserProcess::GetGlobal()),
       last_offline_id_(0),
       response_(net::ERR_IO_PENDING),
       is_offline_page_set_in_navigation_data_(false),
-      network_change_notifier_(new TestNetworkChangeNotifier) {}
+      network_change_notifier_(new TestNetworkChangeNotifier),
+      interceptor_factory_(this) {}
 
-void OfflinePageRequestHandlerTestBase::SetUp() {
+void OfflinePageRequestHandlerTest::SetUp() {
   // Create a test profile.
   ASSERT_TRUE(profile_manager_.SetUp());
   profile_ = profile_manager_.CreateTestingProfile("Profile 1");
@@ -622,7 +560,7 @@
   OfflinePageModelFactory::GetInstance()->SetTestingFactoryAndUse(
       profile()->GetProfileKey(),
       base::BindRepeating(
-          &OfflinePageRequestHandlerTestBase::BuildTestOfflinePageModel));
+          &OfflinePageRequestHandlerTest::BuildTestOfflinePageModel));
 
   // Initialize OfflinePageModel.
   OfflinePageModelTaskified* model = static_cast<OfflinePageModelTaskified*>(
@@ -654,7 +592,7 @@
   histogram_tester_ = std::make_unique<base::HistogramTester>();
 }
 
-void OfflinePageRequestHandlerTestBase::TearDown() {
+void OfflinePageRequestHandlerTest::TearDown() {
   EXPECT_TRUE(private_archives_temp_base_dir_.Delete());
   EXPECT_TRUE(public_archives_temp_base_dir_.Delete());
   // This check confirms that the model's maintenance tasks were not executed
@@ -663,16 +601,27 @@
                                       0);
 }
 
-void OfflinePageRequestHandlerTestBase::SimulateHasNetworkConnectivity(
+void OfflinePageRequestHandlerTest::InterceptRequest(
+    const GURL& url,
+    const std::string& method,
+    const net::HttpRequestHeaders& extra_headers,
+    bool is_main_frame) {
+  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+  interceptor_factory_.InterceptRequest(url, method, extra_headers,
+                                        is_main_frame);
+}
+
+void OfflinePageRequestHandlerTest::SimulateHasNetworkConnectivity(
     bool online) {
   network_change_notifier_->set_online(online);
 }
 
-void OfflinePageRequestHandlerTestBase::RunUntilIdle() {
+void OfflinePageRequestHandlerTest::RunUntilIdle() {
   base::RunLoop().RunUntilIdle();
 }
 
-void OfflinePageRequestHandlerTestBase::WaitForAsyncOperation() {
+void OfflinePageRequestHandlerTest::WaitForAsyncOperation() {
   // No need to wait if async operation is not needed.
   if (async_operation_completed_)
     return;
@@ -681,7 +630,7 @@
   run_loop.Run();
 }
 
-void OfflinePageRequestHandlerTestBase::CreateFileWithContentOnIO(
+void OfflinePageRequestHandlerTest::CreateFileWithContentOnIO(
     const std::string& content,
     const base::Closure& callback) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
@@ -698,28 +647,27 @@
   callback.Run();
 }
 
-base::FilePath OfflinePageRequestHandlerTestBase::CreateFileWithContent(
+base::FilePath OfflinePageRequestHandlerTest::CreateFileWithContent(
     const std::string& content) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
   base::RunLoop run_loop;
   base::PostTaskWithTraits(
       FROM_HERE, {content::BrowserThread::IO},
-      base::BindOnce(
-          &OfflinePageRequestHandlerTestBase::CreateFileWithContentOnIO,
-          base::Unretained(this), content, run_loop.QuitClosure()));
+      base::BindOnce(&OfflinePageRequestHandlerTest::CreateFileWithContentOnIO,
+                     base::Unretained(this), content, run_loop.QuitClosure()));
   run_loop.Run();
   return temp_file_path_;
 }
 
-void OfflinePageRequestHandlerTestBase::
+void OfflinePageRequestHandlerTest::
     ExpectOneUniqueSampleForAggregatedRequestResult(
         OfflinePageRequestHandler::AggregatedRequestResult result) {
   histogram_tester_->ExpectUniqueSample(kAggregatedRequestResultHistogram,
                                         static_cast<int>(result), 1);
 }
 
-void OfflinePageRequestHandlerTestBase::
+void OfflinePageRequestHandlerTest::
     ExpectMultiUniqueSampleForAggregatedRequestResult(
         OfflinePageRequestHandler::AggregatedRequestResult result,
         int count) {
@@ -727,42 +675,41 @@
                                         static_cast<int>(result), count);
 }
 
-void OfflinePageRequestHandlerTestBase::
+void OfflinePageRequestHandlerTest::
     ExpectOneNonuniqueSampleForAggregatedRequestResult(
         OfflinePageRequestHandler::AggregatedRequestResult result) {
   histogram_tester_->ExpectBucketCount(kAggregatedRequestResultHistogram,
                                        static_cast<int>(result), 1);
 }
 
-void OfflinePageRequestHandlerTestBase::
-    ExpectNoSamplesInAggregatedRequestResult() {
+void OfflinePageRequestHandlerTest::ExpectNoSamplesInAggregatedRequestResult() {
   histogram_tester_->ExpectTotalCount(kAggregatedRequestResultHistogram, 0);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOpenFileErrorCode(int result) {
+void OfflinePageRequestHandlerTest::ExpectOpenFileErrorCode(int result) {
   histogram_tester_->ExpectUniqueSample(kOpenFileErrorCodeHistogram, -result,
                                         1);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectSeekFileErrorCode(int result) {
+void OfflinePageRequestHandlerTest::ExpectSeekFileErrorCode(int result) {
   histogram_tester_->ExpectUniqueSample(kSeekFileErrorCodeHistogram, -result,
                                         1);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectAccessEntryPoint(
+void OfflinePageRequestHandlerTest::ExpectAccessEntryPoint(
     OfflinePageRequestHandler::AccessEntryPoint entry_point) {
   histogram_tester_->ExpectUniqueSample(
       std::string(kAccessEntryPointHistogram) + kDownloadNamespace,
       static_cast<int>(entry_point), 1);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectNoAccessEntryPoint() {
+void OfflinePageRequestHandlerTest::ExpectNoAccessEntryPoint() {
   EXPECT_TRUE(
       histogram_tester_->GetTotalCountsForPrefix(kAccessEntryPointHistogram)
           .empty());
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOfflinePageSizeUniqueSample(
+void OfflinePageRequestHandlerTest::ExpectOfflinePageSizeUniqueSample(
     int bucket,
     int count) {
   histogram_tester_->ExpectUniqueSample(
@@ -770,7 +717,7 @@
       bucket, count);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOfflinePageSizeTotalSuffixCount(
+void OfflinePageRequestHandlerTest::ExpectOfflinePageSizeTotalSuffixCount(
     int count) {
   int total_offline_count = 0;
   base::HistogramTester::CountsMap all_offline_counts =
@@ -785,7 +732,7 @@
       << kPageSizeAccessOfflineHistogramBase << "*";
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOnlinePageSizeUniqueSample(
+void OfflinePageRequestHandlerTest::ExpectOnlinePageSizeUniqueSample(
     int bucket,
     int count) {
   histogram_tester_->ExpectUniqueSample(
@@ -793,7 +740,7 @@
       bucket, count);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOnlinePageSizeTotalSuffixCount(
+void OfflinePageRequestHandlerTest::ExpectOnlinePageSizeTotalSuffixCount(
     int count) {
   int online_count = 0;
   base::HistogramTester::CountsMap all_online_counts =
@@ -808,14 +755,14 @@
       << kPageSizeAccessOnlineHistogramBase << "*";
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOfflinePageAccessCount(
+void OfflinePageRequestHandlerTest::ExpectOfflinePageAccessCount(
     int64_t offline_id,
     int count) {
   OfflinePageItem offline_page = GetPage(offline_id);
   EXPECT_EQ(count, offline_page.access_count);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectNoOfflinePageServed(
+void OfflinePageRequestHandlerTest::ExpectNoOfflinePageServed(
     int64_t offline_id,
     OfflinePageRequestHandler::AggregatedRequestResult
         expected_request_result) {
@@ -834,7 +781,7 @@
   ExpectOfflinePageAccessCount(offline_id, 0);
 }
 
-void OfflinePageRequestHandlerTestBase::ExpectOfflinePageServed(
+void OfflinePageRequestHandlerTest::ExpectOfflinePageServed(
     int64_t expected_offline_id,
     int expected_file_size,
     OfflinePageRequestHandler::AggregatedRequestResult
@@ -872,7 +819,7 @@
 }
 
 OfflinePageRequestHandler::AccessEntryPoint
-OfflinePageRequestHandlerTestBase::GetExpectedAccessEntryPoint() const {
+OfflinePageRequestHandlerTest::GetExpectedAccessEntryPoint() const {
   switch (offline_page_header_.reason) {
     case OfflinePageHeader::Reason::DOWNLOAD:
       return OfflinePageRequestHandler::AccessEntryPoint::DOWNLOADS;
@@ -889,7 +836,7 @@
   }
 }
 
-std::string OfflinePageRequestHandlerTestBase::UseOfflinePageHeader(
+std::string OfflinePageRequestHandlerTest::UseOfflinePageHeader(
     OfflinePageHeader::Reason reason,
     int64_t offline_id) {
   DCHECK_NE(OfflinePageHeader::Reason::NONE, reason);
@@ -899,7 +846,7 @@
   return offline_page_header_.GetCompleteHeaderString();
 }
 
-std::string OfflinePageRequestHandlerTestBase::UseOfflinePageHeaderForIntent(
+std::string OfflinePageRequestHandlerTest::UseOfflinePageHeaderForIntent(
     OfflinePageHeader::Reason reason,
     int64_t offline_id,
     const GURL& intent_url) {
@@ -911,7 +858,7 @@
   return offline_page_header_.GetCompleteHeaderString();
 }
 
-int64_t OfflinePageRequestHandlerTestBase::SavePublicPage(
+int64_t OfflinePageRequestHandlerTest::SavePublicPage(
     const GURL& url,
     const GURL& original_url,
     const base::FilePath& file_path,
@@ -927,7 +874,7 @@
   return SavePage(url, original_url, final_path, file_size, digest);
 }
 
-int64_t OfflinePageRequestHandlerTestBase::SaveInternalPage(
+int64_t OfflinePageRequestHandlerTest::SaveInternalPage(
     const GURL& url,
     const GURL& original_url,
     const base::FilePath& file_path,
@@ -943,12 +890,11 @@
   return SavePage(url, original_url, final_path, file_size, digest);
 }
 
-int64_t OfflinePageRequestHandlerTestBase::SavePage(
-    const GURL& url,
-    const GURL& original_url,
-    const base::FilePath& file_path,
-    int64_t file_size,
-    const std::string& digest) {
+int64_t OfflinePageRequestHandlerTest::SavePage(const GURL& url,
+                                                const GURL& original_url,
+                                                const base::FilePath& file_path,
+                                                int64_t file_size,
+                                                const std::string& digest) {
   DCHECK(file_path.IsAbsolute());
 
   static int item_counter = 0;
@@ -965,7 +911,7 @@
   save_page_params.original_url = original_url;
   OfflinePageModelFactory::GetForBrowserContext(profile())->SavePage(
       save_page_params, std::move(archiver), nullptr,
-      base::Bind(&OfflinePageRequestHandlerTestBase::OnSavePageDone,
+      base::Bind(&OfflinePageRequestHandlerTest::OnSavePageDone,
                  base::Unretained(this)));
   WaitForAsyncOperation();
   return last_offline_id_;
@@ -973,7 +919,7 @@
 
 // static
 std::unique_ptr<KeyedService>
-OfflinePageRequestHandlerTestBase::BuildTestOfflinePageModel(
+OfflinePageRequestHandlerTest::BuildTestOfflinePageModel(
     SimpleFactoryKey* key) {
   scoped_refptr<base::SingleThreadTaskRunner> task_runner =
       base::ThreadTaskRunnerHandle::Get();
@@ -997,11 +943,11 @@
 }
 
 // static
-base::FilePath OfflinePageRequestHandlerTestBase::private_archives_dir_;
-base::FilePath OfflinePageRequestHandlerTestBase::public_archives_dir_;
+base::FilePath OfflinePageRequestHandlerTest::private_archives_dir_;
+base::FilePath OfflinePageRequestHandlerTest::public_archives_dir_;
 
-void OfflinePageRequestHandlerTestBase::OnSavePageDone(SavePageResult result,
-                                                       int64_t offline_id) {
+void OfflinePageRequestHandlerTest::OnSavePageDone(SavePageResult result,
+                                                   int64_t offline_id) {
   ASSERT_EQ(SavePageResult::SUCCESS, result);
   last_offline_id_ = offline_id;
 
@@ -1010,33 +956,33 @@
     async_operation_completed_callback_.Run();
 }
 
-OfflinePageItem OfflinePageRequestHandlerTestBase::GetPage(int64_t offline_id) {
+OfflinePageItem OfflinePageRequestHandlerTest::GetPage(int64_t offline_id) {
   OfflinePageModelFactory::GetForBrowserContext(profile())->GetPageByOfflineId(
       offline_id,
-      base::Bind(&OfflinePageRequestHandlerTestBase::OnGetPageByOfflineIdDone,
+      base::Bind(&OfflinePageRequestHandlerTest::OnGetPageByOfflineIdDone,
                  base::Unretained(this)));
   RunUntilIdle();
   return page_;
 }
 
-void OfflinePageRequestHandlerTestBase::OnGetPageByOfflineIdDone(
+void OfflinePageRequestHandlerTest::OnGetPageByOfflineIdDone(
     const OfflinePageItem* page) {
   ASSERT_TRUE(page);
   page_ = *page;
 }
 
-void OfflinePageRequestHandlerTestBase::LoadPage(const GURL& url) {
+void OfflinePageRequestHandlerTest::LoadPage(const GURL& url) {
   InterceptRequest(url, "GET", net::HttpRequestHeaders(),
                    true /* is_main_frame */);
 }
 
-void OfflinePageRequestHandlerTestBase::LoadPageWithHeaders(
+void OfflinePageRequestHandlerTest::LoadPageWithHeaders(
     const GURL& url,
     const net::HttpRequestHeaders& extra_headers) {
   InterceptRequest(url, "GET", extra_headers, true /* is_main_frame */);
 }
 
-void OfflinePageRequestHandlerTestBase::ReadCompleted(
+void OfflinePageRequestHandlerTest::ReadCompleted(
     const ResponseInfo& response,
     bool is_offline_page_set_in_navigation_data) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -1048,245 +994,9 @@
       FROM_HERE, base::RunLoop::QuitCurrentWhenIdleClosureDeprecated());
 }
 
-template <typename T>
-class OfflinePageRequestHandlerTest : public OfflinePageRequestHandlerTestBase {
- public:
-  OfflinePageRequestHandlerTest() : interceptor_factory_(this) {}
-
-  void InterceptRequest(const GURL& url,
-                        const std::string& method,
-                        const net::HttpRequestHeaders& extra_headers,
-                        bool is_main_frame) override {
-    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
-    interceptor_factory_.InterceptRequest(url, method, extra_headers,
-                                          is_main_frame);
-  }
-
- private:
-  T interceptor_factory_;
-};
-
-// Builds an OfflinePageRequestJob to test the request interception without
-// network service enabled.
-class OfflinePageRequestJobBuilder {
- public:
-  explicit OfflinePageRequestJobBuilder(
-      OfflinePageRequestHandlerTestBase* test_base)
-      : test_base_(test_base) {}
-
-  void InterceptRequest(const GURL& url,
-                        const std::string& method,
-                        const net::HttpRequestHeaders& extra_headers,
-                        bool is_main_frame);
-
-  OfflinePageRequestHandlerTestBase* test_base() { return test_base_; }
-
- private:
-  std::unique_ptr<net::URLRequest> CreateRequest(const GURL& url,
-                                                 const std::string& method,
-                                                 bool is_main_frame);
-
-  // Runs on IO thread.
-  void SetUpNetworkObjectsOnIO();
-  void TearDownNetworkObjectsOnIO();
-  void InterceptRequestOnIO(const GURL& url,
-                            const std::string& method,
-                            const net::HttpRequestHeaders& extra_headers,
-                            bool is_main_frame);
-  void ReadCompletedOnIO(const ResponseInfo& response);
-  void TearDownOnReadCompletedOnIO(const ResponseInfo& response,
-                                   bool is_offline_page_set_in_navigation_data);
-
-  OfflinePageRequestHandlerTestBase* test_base_;
-
-  // These should only be accessed purely from IO thread.
-  std::unique_ptr<net::TestURLRequestContext> test_url_request_context_;
-  std::unique_ptr<net::URLRequestJobFactoryImpl> url_request_job_factory_;
-  std::unique_ptr<net::URLRequestInterceptingJobFactory>
-      intercepting_job_factory_;
-  std::unique_ptr<TestURLRequestDelegate> url_request_delegate_;
-  std::unique_ptr<net::URLRequest> request_;
-};
-
-void OfflinePageRequestJobBuilder::SetUpNetworkObjectsOnIO() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
-  if (test_url_request_context_.get())
-    return;
-
-  url_request_job_factory_.reset(new net::URLRequestJobFactoryImpl);
-
-  // Create a context with delayed initialization.
-  test_url_request_context_.reset(new net::TestURLRequestContext(true));
-
-  // Install the interceptor.
-  std::unique_ptr<net::URLRequestInterceptor> interceptor(
-      new OfflinePageRequestInterceptor());
-  std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory_impl(
-      new net::URLRequestJobFactoryImpl());
-  intercepting_job_factory_.reset(new TestURLRequestInterceptingJobFactory(
-      std::move(job_factory_impl), std::move(interceptor),
-      test_base_->web_contents()));
-
-  test_url_request_context_->set_job_factory(intercepting_job_factory_.get());
-  test_url_request_context_->Init();
-}
-
-void OfflinePageRequestJobBuilder::TearDownNetworkObjectsOnIO() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
-  request_.reset();
-  url_request_delegate_.reset();
-  intercepting_job_factory_.reset();
-  url_request_job_factory_.reset();
-  test_url_request_context_.reset();
-}
-
-std::unique_ptr<net::URLRequest> OfflinePageRequestJobBuilder::CreateRequest(
-    const GURL& url,
-    const std::string& method,
-    bool is_main_frame) {
-  url_request_delegate_ = std::make_unique<TestURLRequestDelegate>(
-      base::Bind(&OfflinePageRequestJobBuilder::ReadCompletedOnIO,
-                 base::Unretained(this)));
-
-  std::unique_ptr<net::URLRequest> request =
-      test_url_request_context_->CreateRequest(url, net::DEFAULT_PRIORITY,
-                                               url_request_delegate_.get());
-  request->set_method(method);
-
-  content::ResourceRequestInfo::AllocateForTesting(
-      request.get(),
-      is_main_frame ? content::ResourceType::kMainFrame
-                    : content::ResourceType::kSubFrame,
-      nullptr,
-      /*render_process_id=*/1,
-      /*render_view_id=*/-1,
-      /*render_frame_id=*/1,
-      /*is_main_frame=*/true, content::ResourceInterceptPolicy::kAllowAll,
-      /*is_async=*/true,
-      test_base_->allow_preview() ? content::OFFLINE_PAGE_ON
-                                  : content::PREVIEWS_OFF,
-      std::make_unique<ChromeNavigationUIData>());
-
-  return request;
-}
-
-void OfflinePageRequestJobBuilder::InterceptRequestOnIO(
-    const GURL& url,
-    const std::string& method,
-    const net::HttpRequestHeaders& extra_headers,
-    bool is_main_frame) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
-  SetUpNetworkObjectsOnIO();
-
-  request_ = CreateRequest(url, method, is_main_frame);
-  if (!extra_headers.IsEmpty())
-    request_->SetExtraRequestHeaders(extra_headers);
-  request_->Start();
-}
-
-void OfflinePageRequestJobBuilder::InterceptRequest(
-    const GURL& url,
-    const std::string& method,
-    const net::HttpRequestHeaders& extra_headers,
-    bool is_main_frame) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {content::BrowserThread::IO},
-      base::BindOnce(&OfflinePageRequestJobBuilder::InterceptRequestOnIO,
-                     base::Unretained(this), url, method, extra_headers,
-                     is_main_frame));
-  base::RunLoop().Run();
-}
-
-void OfflinePageRequestJobBuilder::ReadCompletedOnIO(
-    const ResponseInfo& response) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
-  bool is_offline_page_set_in_navigation_data = false;
-  content::ResourceRequestInfo* info =
-      content::ResourceRequestInfo::ForRequest(request_.get());
-  ChromeNavigationUIData* navigation_data =
-      static_cast<ChromeNavigationUIData*>(info->GetNavigationUIData());
-  if (navigation_data) {
-    offline_pages::OfflinePageNavigationUIData* offline_page_data =
-        navigation_data->GetOfflinePageNavigationUIData();
-    if (offline_page_data && offline_page_data->is_offline_page())
-      is_offline_page_set_in_navigation_data = true;
-  }
-
-  // Since the caller is still holding a request object which we want to dispose
-  // as part of tearing down on IO thread, we need to do it in a separate task.
-  base::PostTaskWithTraits(
-      FROM_HERE, {content::BrowserThread::IO},
-      base::BindOnce(&OfflinePageRequestJobBuilder::TearDownOnReadCompletedOnIO,
-                     base::Unretained(this), response,
-                     is_offline_page_set_in_navigation_data));
-}
-
-void OfflinePageRequestJobBuilder::TearDownOnReadCompletedOnIO(
-    const ResponseInfo& response,
-    bool is_offline_page_set_in_navigation_data) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
-  TearDownNetworkObjectsOnIO();
-
-  base::PostTaskWithTraits(
-      FROM_HERE, {content::BrowserThread::UI},
-      base::BindOnce(&OfflinePageRequestHandlerTestBase::ReadCompleted,
-                     base::Unretained(test_base()), response,
-                     is_offline_page_set_in_navigation_data));
-}
-
-// Builds an OfflinePageURLLoader to test the request interception with network
-// service enabled.
-class OfflinePageURLLoaderBuilder : public TestURLLoaderClient::Observer {
- public:
-  explicit OfflinePageURLLoaderBuilder(
-      OfflinePageRequestHandlerTestBase* test_base);
-
-  void OnReceiveRedirect(const GURL& redirected_url) override;
-  void OnReceiveResponse(
-      const network::ResourceResponseHead& response_head) override;
-  void OnStartLoadingResponseBody() override;
-  void OnComplete() override;
-
-  void InterceptRequest(const GURL& url,
-                        const std::string& method,
-                        const net::HttpRequestHeaders& extra_headers,
-                        bool is_main_frame);
-
-  OfflinePageRequestHandlerTestBase* test_base() { return test_base_; }
-
- private:
-  void OnHandleReady(MojoResult result, const mojo::HandleSignalsState& state);
-  void InterceptRequestOnIO(const GURL& url,
-                            const std::string& method,
-                            const net::HttpRequestHeaders& extra_headers,
-                            bool is_main_frame);
-  void MaybeStartLoader(
-      const network::ResourceRequest& request,
-      content::URLLoaderRequestInterceptor::RequestHandler request_handler);
-  void ReadBody();
-  void ReadCompletedOnIO(const ResponseInfo& response);
-
-  OfflinePageRequestHandlerTestBase* test_base_;
-  std::unique_ptr<ChromeNavigationUIData> navigation_ui_data_;
-  std::unique_ptr<OfflinePageURLLoader> url_loader_;
-  std::unique_ptr<TestURLLoaderClient> client_;
-  std::unique_ptr<mojo::SimpleWatcher> handle_watcher_;
-  network::mojom::URLLoaderPtr loader_;
-  std::string mime_type_;
-  std::string body_;
-};
-
 OfflinePageURLLoaderBuilder::OfflinePageURLLoaderBuilder(
-    OfflinePageRequestHandlerTestBase* test_base)
-    : test_base_(test_base) {
+    OfflinePageRequestHandlerTest* test)
+    : test_(test) {
   navigation_ui_data_ = std::make_unique<ChromeNavigationUIData>();
 }
 
@@ -1325,13 +1035,12 @@
   network::ResourceRequest request =
       CreateResourceRequest(url, method, extra_headers, is_main_frame);
 
-  request.previews_state = test_base_->allow_preview()
-                               ? content::OFFLINE_PAGE_ON
-                               : content::PREVIEWS_OFF;
+  request.previews_state =
+      test_->allow_preview() ? content::OFFLINE_PAGE_ON : content::PREVIEWS_OFF;
 
   url_loader_ = OfflinePageURLLoader::Create(
       navigation_ui_data_.get(),
-      test_base_->web_contents()->GetMainFrame()->GetFrameTreeNodeId(), request,
+      test_->web_contents()->GetMainFrame()->GetFrameTreeNodeId(), request,
       base::BindOnce(&OfflinePageURLLoaderBuilder::MaybeStartLoader,
                      base::Unretained(this), request));
 
@@ -1436,19 +1145,12 @@
 
   base::PostTaskWithTraits(
       FROM_HERE, {content::BrowserThread::UI},
-      base::BindOnce(&OfflinePageRequestHandlerTestBase::ReadCompleted,
-                     base::Unretained(test_base()), response,
+      base::BindOnce(&OfflinePageRequestHandlerTest::ReadCompleted,
+                     base::Unretained(test()), response,
                      is_offline_page_set_in_navigation_data));
 }
 
-// Lists all scenarios we want to test.
-typedef testing::Types<OfflinePageRequestJobBuilder,
-                       OfflinePageURLLoaderBuilder>
-    MyTypes;
-
-TYPED_TEST_SUITE(OfflinePageRequestHandlerTest, MyTypes);
-
-TYPED_TEST(OfflinePageRequestHandlerTest, FailedToCreateRequestJob) {
+TEST_F(OfflinePageRequestHandlerTest, FailedToCreateRequestJob) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Must be http/https URL.
@@ -1484,8 +1186,7 @@
   this->ExpectOnlinePageSizeTotalSuffixCount(0);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           LoadOfflinePageOnDisconnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, LoadOfflinePageOnDisconnectedNetwork) {
   this->SimulateHasNetworkConnectivity(false);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1499,7 +1200,7 @@
           SHOW_OFFLINE_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, PageNotFoundOnDisconnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, PageNotFoundOnDisconnectedNetwork) {
   this->SimulateHasNetworkConnectivity(false);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1512,8 +1213,8 @@
                       PAGE_NOT_FOUND_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           NetErrorPageSuggestionOnDisconnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest,
+       NetErrorPageSuggestionOnDisconnectedNetwork) {
   this->SimulateHasNetworkConnectivity(false);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1530,8 +1231,8 @@
           SHOW_OFFLINE_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           LoadOfflinePageOnProhibitivelySlowNetwork) {
+TEST_F(OfflinePageRequestHandlerTest,
+       LoadOfflinePageOnProhibitivelySlowNetwork) {
   this->SimulateHasNetworkConnectivity(true);
   this->set_allow_preview(true);
 
@@ -1546,8 +1247,8 @@
           SHOW_OFFLINE_ON_PROHIBITIVELY_SLOW_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           DontLoadReloadOfflinePageOnProhibitivelySlowNetwork) {
+TEST_F(OfflinePageRequestHandlerTest,
+       DontLoadReloadOfflinePageOnProhibitivelySlowNetwork) {
   this->SimulateHasNetworkConnectivity(true);
   this->set_allow_preview(true);
 
@@ -1570,8 +1271,7 @@
                       AGGREGATED_REQUEST_RESULT_MAX);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           PageNotFoundOnProhibitivelySlowNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, PageNotFoundOnProhibitivelySlowNetwork) {
   this->SimulateHasNetworkConnectivity(true);
   this->set_allow_preview(true);
 
@@ -1585,7 +1285,7 @@
                       PAGE_NOT_FOUND_ON_PROHIBITIVELY_SLOW_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, LoadOfflinePageOnFlakyNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, LoadOfflinePageOnFlakyNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1604,7 +1304,7 @@
           SHOW_OFFLINE_ON_FLAKY_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, PageNotFoundOnFlakyNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, PageNotFoundOnFlakyNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1622,8 +1322,7 @@
                       PAGE_NOT_FOUND_ON_FLAKY_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           ForceLoadOfflinePageOnConnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, ForceLoadOfflinePageOnConnectedNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1642,7 +1341,7 @@
           SHOW_OFFLINE_ON_CONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, PageNotFoundOnConnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, PageNotFoundOnConnectedNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save an offline page.
@@ -1661,8 +1360,7 @@
                       PAGE_NOT_FOUND_ON_CONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           DoNotLoadOfflinePageOnConnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, DoNotLoadOfflinePageOnConnectedNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1680,8 +1378,8 @@
 }
 
 // TODO(https://crbug.com/830282): Flaky on "Marshmallow Phone Tester (rel)".
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           DISABLED_LoadMostRecentlyCreatedOfflinePage) {
+TEST_F(OfflinePageRequestHandlerTest,
+       DISABLED_LoadMostRecentlyCreatedOfflinePage) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save 2 offline pages associated with same online URL, but pointing to
@@ -1702,7 +1400,7 @@
   this->ExpectOfflinePageAccessCount(offline_id1, 0);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, LoadOfflinePageByOfflineID) {
+TEST_F(OfflinePageRequestHandlerTest, LoadOfflinePageByOfflineID) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save 2 offline pages associated with same online URL, but pointing to
@@ -1726,7 +1424,7 @@
   this->ExpectOfflinePageAccessCount(offline_id2, 0);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, FailToLoadByOfflineIDOnUrlMismatch) {
+TEST_F(OfflinePageRequestHandlerTest, FailToLoadByOfflineIDOnUrlMismatch) {
   this->SimulateHasNetworkConnectivity(true);
 
   int64_t offline_id = this->SaveInternalPage(kUrl, GURL(), kFilename1,
@@ -1746,8 +1444,8 @@
 }
 
 // TODO(https://crbug.com/830282): Flaky on "Marshmallow Phone Tester (rel)".
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           DISABLED_LoadOfflinePageForUrlWithFragment) {
+TEST_F(OfflinePageRequestHandlerTest,
+       DISABLED_LoadOfflinePageForUrlWithFragment) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page associated with online URL without fragment.
@@ -1811,7 +1509,7 @@
   this->ExpectOfflinePageAccessCount(offline_id2, 2);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, LoadOfflinePageAfterRedirect) {
+TEST_F(OfflinePageRequestHandlerTest, LoadOfflinePageAfterRedirect) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page with same original URL and final URL.
@@ -1835,8 +1533,8 @@
           SHOW_OFFLINE_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           NoRedirectForOfflinePageWithSameOriginalURL) {
+TEST_F(OfflinePageRequestHandlerTest,
+       NoRedirectForOfflinePageWithSameOriginalURL) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Skip the logic to clear the original URL if it is same as final URL.
@@ -1864,8 +1562,8 @@
           SHOW_OFFLINE_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           LoadOfflinePageFromNonExistentInternalFile) {
+TEST_F(OfflinePageRequestHandlerTest,
+       LoadOfflinePageFromNonExistentInternalFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page pointing to non-existent internal archive file.
@@ -1879,8 +1577,8 @@
       OfflinePageRequestHandler::AggregatedRequestResult::FILE_NOT_FOUND);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           LoadOfflinePageFromNonExistentPublicFile) {
+TEST_F(OfflinePageRequestHandlerTest,
+       LoadOfflinePageFromNonExistentPublicFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page pointing to non-existent public archive file.
@@ -1894,8 +1592,7 @@
       OfflinePageRequestHandler::AggregatedRequestResult::FILE_NOT_FOUND);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           FileSizeMismatchOnDisconnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, FileSizeMismatchOnDisconnectedNetwork) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page in public location with mismatched file size.
@@ -1909,8 +1606,8 @@
                       DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           FileSizeMismatchOnProhibitivelySlowNetwork) {
+TEST_F(OfflinePageRequestHandlerTest,
+       FileSizeMismatchOnProhibitivelySlowNetwork) {
   this->SimulateHasNetworkConnectivity(true);
   this->set_allow_preview(true);
 
@@ -1925,7 +1622,7 @@
                       DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, FileSizeMismatchOnConnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, FileSizeMismatchOnConnectedNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save an offline page in public location with mismatched file size.
@@ -1944,7 +1641,7 @@
                       DIGEST_MISMATCH_ON_CONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, FileSizeMismatchOnFlakyNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, FileSizeMismatchOnFlakyNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save an offline page in public location with mismatched file size.
@@ -1963,7 +1660,7 @@
                       DIGEST_MISMATCH_ON_FLAKY_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, DigestMismatchOnDisconnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, DigestMismatchOnDisconnectedNetwork) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page in public location with mismatched digest.
@@ -1977,8 +1674,8 @@
                       DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           DigestMismatchOnProhibitivelySlowNetwork) {
+TEST_F(OfflinePageRequestHandlerTest,
+       DigestMismatchOnProhibitivelySlowNetwork) {
   this->SimulateHasNetworkConnectivity(true);
   this->set_allow_preview(true);
 
@@ -1993,7 +1690,7 @@
                       DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, DigestMismatchOnConnectedNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, DigestMismatchOnConnectedNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save an offline page in public location with mismatched digest.
@@ -2012,7 +1709,7 @@
                       DIGEST_MISMATCH_ON_CONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, DigestMismatchOnFlakyNetwork) {
+TEST_F(OfflinePageRequestHandlerTest, DigestMismatchOnFlakyNetwork) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save an offline page in public location with mismatched digest.
@@ -2031,7 +1728,7 @@
                       DIGEST_MISMATCH_ON_FLAKY_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, FailOnNoDigestForPublicArchiveFile) {
+TEST_F(OfflinePageRequestHandlerTest, FailOnNoDigestForPublicArchiveFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save an offline page in public location with no digest.
@@ -2045,8 +1742,7 @@
                       DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           FailToLoadByOfflineIDOnDigestMismatch) {
+TEST_F(OfflinePageRequestHandlerTest, FailToLoadByOfflineIDOnDigestMismatch) {
   this->SimulateHasNetworkConnectivity(true);
 
   // Save 2 offline pages associated with same online URL, one in internal
@@ -2070,7 +1766,7 @@
   this->ExpectOfflinePageAccessCount(offline_id2, 0);
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, LoadOtherPageOnDigestMismatch) {
+TEST_F(OfflinePageRequestHandlerTest, LoadOtherPageOnDigestMismatch) {
   this->SimulateHasNetworkConnectivity(false);
 
   // Save 2 offline pages associated with same online URL, one in internal
@@ -2095,7 +1791,7 @@
 }
 
 // Disabled due to https://crbug.com/917113.
-TYPED_TEST(OfflinePageRequestHandlerTest, DISABLED_EmptyFile) {
+TEST_F(OfflinePageRequestHandlerTest, DISABLED_EmptyFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   const std::string expected_data("");
@@ -2115,7 +1811,7 @@
   EXPECT_EQ(expected_data, this->data_received());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, TinyFile) {
+TEST_F(OfflinePageRequestHandlerTest, TinyFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   std::string expected_data("hello world");
@@ -2137,7 +1833,7 @@
   EXPECT_EQ(expected_data, this->data_received());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, SmallFile) {
+TEST_F(OfflinePageRequestHandlerTest, SmallFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   std::string expected_data(MakeContentOfSize(2 * 1024));
@@ -2159,7 +1855,7 @@
   EXPECT_EQ(expected_data, this->data_received());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, BigFile) {
+TEST_F(OfflinePageRequestHandlerTest, BigFile) {
   this->SimulateHasNetworkConnectivity(false);
 
   std::string expected_data(MakeContentOfSize(3 * 1024 * 1024));
@@ -2181,7 +1877,7 @@
   EXPECT_EQ(expected_data, this->data_received());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, LoadFromFileUrlIntent) {
+TEST_F(OfflinePageRequestHandlerTest, LoadFromFileUrlIntent) {
   this->SimulateHasNetworkConnectivity(true);
 
   std::string expected_data(MakeContentOfSize(2 * 1024));
@@ -2220,7 +1916,7 @@
   EXPECT_EQ(expected_data, this->data_received());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, IntentFileNotFound) {
+TEST_F(OfflinePageRequestHandlerTest, IntentFileNotFound) {
   this->SimulateHasNetworkConnectivity(true);
 
   std::string expected_data(MakeContentOfSize(2 * 1024));
@@ -2258,7 +1954,7 @@
   EXPECT_FALSE(this->offline_page_tab_helper()->GetOfflinePageForTest());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest, IntentFileModifiedInTheMiddle) {
+TEST_F(OfflinePageRequestHandlerTest, IntentFileModifiedInTheMiddle) {
   this->SimulateHasNetworkConnectivity(true);
 
   std::string expected_data(MakeContentOfSize(2 * 1024));
@@ -2296,8 +1992,7 @@
   EXPECT_FALSE(this->offline_page_tab_helper()->GetOfflinePageForTest());
 }
 
-TYPED_TEST(OfflinePageRequestHandlerTest,
-           IntentFileModifiedWithMoreDataAppended) {
+TEST_F(OfflinePageRequestHandlerTest, IntentFileModifiedWithMoreDataAppended) {
   this->SimulateHasNetworkConnectivity(true);
 
   std::string expected_data(MakeContentOfSize(2 * 1024));
diff --git a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.cc b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.cc
index d50957d..3ca86dc 100644
--- a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.cc
+++ b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.cc
@@ -68,7 +68,7 @@
 // static
 void SiteDataCacheFactory::OnBrowserContextCreatedOnUIThread(
     SiteDataCacheFactory* factory,
-    const content::BrowserContext* browser_context) {
+    content::BrowserContext* browser_context) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
   DCHECK(factory);
 
@@ -86,7 +86,7 @@
 // static
 void SiteDataCacheFactory::OnBrowserContextDestroyedOnUIThread(
     SiteDataCacheFactory* factory,
-    const content::BrowserContext* browser_context) {
+    content::BrowserContext* browser_context) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
   DCHECK(factory);
   // See OnBrowserContextCreatedOnUIThread for why it's safe to use a raw
diff --git a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.h b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.h
index 145c610c..88bdf8cc 100644
--- a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.h
+++ b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_factory.h
@@ -59,10 +59,10 @@
   // associated with this browser context.
   static void OnBrowserContextCreatedOnUIThread(
       SiteDataCacheFactory* factory,
-      const content::BrowserContext* browser_context);
+      content::BrowserContext* browser_context);
   static void OnBrowserContextDestroyedOnUIThread(
       SiteDataCacheFactory* factory,
-      const content::BrowserContext* browser_context);
+      content::BrowserContext* browser_context);
 
   // Returns a pointer to the data cache associated with |browser_context_id|,
   // or null if there's no cache for this context yet.
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
index 6a131f29..094be70 100644
--- a/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_controller_browsertest.cc
@@ -72,7 +72,6 @@
   MOCK_METHOD1(Close, void(bool));
   MOCK_METHOD0(CloseAndFocusInitiator, void());
   MOCK_METHOD0(OnWindowDestroyed, void());
-  MOCK_METHOD2(EmbedSurface, void(const viz::SurfaceId&, const gfx::Size&));
   MOCK_METHOD0(GetWindowForTesting, content::OverlayWindow*());
   MOCK_METHOD0(UpdateLayerBounds, void());
   MOCK_METHOD0(IsPlayerActive, bool());
@@ -1379,11 +1378,10 @@
   {
     WidgetBoundsChangeWaiter waiter(overlay_window);
 
-    window_controller()->EmbedSurface(
-        viz::SurfaceId(
-            viz::FrameSinkId(1, 1),
-            viz::LocalSurfaceId(9, base::UnguessableToken::Create())),
-        gfx::Size(200, 100));
+    overlay_window->SetSurfaceId(viz::SurfaceId(
+        viz::FrameSinkId(1, 1),
+        viz::LocalSurfaceId(9, base::UnguessableToken::Create())));
+    overlay_window->UpdateVideoSize(gfx::Size(200, 100));
 
     waiter.Wait();
   }
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
index 770697d..d1813f87 100644
--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -337,9 +337,6 @@
   { key::kDiskCacheSize,
     prefs::kDiskCacheSize,
     base::Value::Type::INTEGER },
-  { key::kMediaCacheSize,
-    prefs::kMediaCacheSize,
-    base::Value::Type::INTEGER },
   { key::kPolicyRefreshRate,
     policy_prefs::kUserPolicyRefreshRate,
     base::Value::Type::INTEGER },
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 1b1f7dc..516398a 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -455,6 +455,9 @@
 const char kBookmarkAppCreationLaunchType[] =
     "extensions.bookmark_app_creation_launch_type";
 
+// Deprecated 6/2019
+const char kMediaCacheSize[] = "browser.media_cache_size";
+
 // Register prefs used only for migration (clearing or moving to a new key).
 void RegisterProfilePrefsForMigration(
     user_prefs::PrefRegistrySyncable* registry) {
@@ -514,6 +517,8 @@
 #endif  // !defined(OS_ANDROID)
 
   registry->RegisterIntegerPref(kBookmarkAppCreationLaunchType, 0);
+
+  registry->RegisterIntegerPref(kMediaCacheSize, 0);
 }
 
 }  // namespace
@@ -1103,5 +1108,5 @@
   profile_prefs->ClearPref(kBookmarkAppCreationLaunchType);
 
   // Added 6/2019.
-  profile_prefs->ClearPref(prefs::kMediaCacheSize);
+  profile_prefs->ClearPref(kMediaCacheSize);
 }
diff --git a/chrome/browser/prefs/chrome_command_line_pref_store.cc b/chrome/browser/prefs/chrome_command_line_pref_store.cc
index 5f63a93..17550a01 100644
--- a/chrome/browser/prefs/chrome_command_line_pref_store.cc
+++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
@@ -92,9 +92,7 @@
 
 const CommandLinePrefStore::SwitchToPreferenceMapEntry
     ChromeCommandLinePrefStore::integer_switch_map_[] = {
-      { switches::kDiskCacheSize, prefs::kDiskCacheSize },
-      { switches::kMediaCacheSize, prefs::kMediaCacheSize },
-    };
+        {switches::kDiskCacheSize, prefs::kDiskCacheSize}};
 
 ChromeCommandLinePrefStore::ChromeCommandLinePrefStore(
     const base::CommandLine* command_line)
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index 3e465335..5622c69 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -297,6 +297,10 @@
 #endif
 }
 
+base::FilePath OffTheRecordProfileImpl::GetPath() {
+  return profile_->GetPath();
+}
+
 base::FilePath OffTheRecordProfileImpl::GetPath() const {
   return profile_->GetPath();
 }
@@ -315,6 +319,10 @@
   return profile_->GetIOTaskRunner();
 }
 
+bool OffTheRecordProfileImpl::IsOffTheRecord() {
+  return true;
+}
+
 bool OffTheRecordProfileImpl::IsOffTheRecord() const {
   return true;
 }
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.h b/chrome/browser/profiles/off_the_record_profile_impl.h
index 097b15e..3a07baba 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.h
+++ b/chrome/browser/profiles/off_the_record_profile_impl.h
@@ -99,12 +99,14 @@
   GURL GetHomePage() override;
 
   // content::BrowserContext implementation:
+  base::FilePath GetPath() override;
   base::FilePath GetPath() const override;
 #if !defined(OS_ANDROID)
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
 #endif  // !defined(OS_ANDROID)
   scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override;
+  bool IsOffTheRecord() override;
   bool IsOffTheRecord() const override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::ResourceContext* GetResourceContext() override;
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 3a70f5f..bc71f148 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -121,8 +121,7 @@
   content::CookieStoreConfig cookie_config;
   // Enable cookies for chrome-extension URLs.
   cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme);
-  extensions_cookie_store_ =
-      content::CreateCookieStore(cookie_config, g_browser_process->net_log());
+  extensions_cookie_store_ = content::CreateCookieStore(cookie_config, nullptr);
 }
 
 net::CookieStore* OffTheRecordProfileIOData::GetExtensionsCookieStore() const {
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 78eaf0a..2e25a78 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -137,6 +137,16 @@
 
   // content::BrowserContext implementation ------------------------------------
 
+  // Returns the path of the directory where this context's data is stored.
+  base::FilePath GetPath() override = 0;
+  virtual base::FilePath GetPath() const = 0;
+
+  // Return whether this context is off the record. Default is false.
+  // Note that for Chrome this does not imply Incognito as Guest sessions are
+  // also off the record.
+  bool IsOffTheRecord() override = 0;
+  virtual bool IsOffTheRecord() const = 0;
+
   // Typesafe upcast.
   virtual TestingProfile* AsTestingProfile();
 
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index c1cf9f94..3973bda5 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -442,7 +442,6 @@
   // Initialize the cache prefs.
   registry->RegisterFilePathPref(prefs::kDiskCacheDir, base::FilePath());
   registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0);
-  registry->RegisterIntegerPref(prefs::kMediaCacheSize, 0);
 }
 
 ProfileImpl::ProfileImpl(
@@ -849,6 +848,10 @@
 }
 #endif  // !defined(OS_ANDROID)
 
+base::FilePath ProfileImpl::GetPath() {
+  return path_;
+}
+
 base::FilePath ProfileImpl::GetPath() const {
   return path_;
 }
@@ -857,6 +860,10 @@
   return io_task_runner_;
 }
 
+bool ProfileImpl::IsOffTheRecord() {
+  return false;
+}
+
 bool ProfileImpl::IsOffTheRecord() const {
   return false;
 }
diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h
index 2662e1a..52a2d3c 100644
--- a/chrome/browser/profiles/profile_impl.h
+++ b/chrome/browser/profiles/profile_impl.h
@@ -77,7 +77,6 @@
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
 #endif
-  base::FilePath GetPath() const override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::ResourceContext* GetResourceContext() override;
   content::BrowserPluginGuestManager* GetGuestManager() override;
@@ -117,7 +116,10 @@
   // not the Chrome user's display name.
   std::string GetProfileUserName() const override;
   ProfileType GetProfileType() const override;
+  base::FilePath GetPath() override;
+  bool IsOffTheRecord() override;
   bool IsOffTheRecord() const override;
+  base::FilePath GetPath() const override;
   Profile* GetOffTheRecordProfile() override;
   void DestroyOffTheRecordProfile() override;
   bool HasOffTheRecordProfile() override;
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 6fe886e..84b9af03 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -225,8 +225,7 @@
   cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate();
   // Enable cookies for chrome-extension URLs.
   cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme);
-  extensions_cookie_store_ =
-      content::CreateCookieStore(cookie_config, g_browser_process->net_log());
+  extensions_cookie_store_ = content::CreateCookieStore(cookie_config, nullptr);
 }
 
 net::CookieStore* ProfileImplIOData::GetExtensionsCookieStore() const {
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css b/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css
index 918b02b..230e418 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css
@@ -398,12 +398,12 @@
 }
 
 #minimize-button {
-  background-image: url(../images/ui/button_minimize.png);
+  background-image: url(../images/ui/button_minimize.svg);
   right: 52px;
 }
 
 #close-button {
-  background-image: url(../images/ui/button_close.png);
+  background-image: url(../images/ui/button_close.svg);
   right: 12px;
 }
 
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.png b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.png
deleted file mode 100644
index b902560..0000000
--- a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.png
+++ /dev/null
Binary files differ
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.svg b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.svg
new file mode 100644
index 0000000..75f8113e
--- /dev/null
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_close.svg
@@ -0,0 +1,6 @@
+<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <defs>
+    <path id="a" d="M16 5.41L14.59 4 10 8.59 5.41 4 4 5.41 8.59 10 4 14.59 5.41 16 10 11.41 14.59 16 16 14.59 11.41 10z"/>
+  </defs>
+  <use fill="#5F6368" xlink:href="#a" transform="translate(6 6)" fill-rule="evenodd"/>
+</svg>
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.png b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.png
deleted file mode 100644
index 33b892df..0000000
--- a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.png
+++ /dev/null
Binary files differ
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.svg b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.svg
new file mode 100644
index 0000000..c6d2e72a
--- /dev/null
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/images/ui/button_minimize.svg
@@ -0,0 +1,3 @@
+<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
+  <path d="M10 22h12v-2H10z" fill="#5F6368" fill-rule="evenodd"/>
+</svg>
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
index c1d05ae..97039df 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js
@@ -391,6 +391,7 @@
         }
       }
 
+      // eslint-disable-next-line no-restricted-properties
       var parentSetter = cr.ui.Grid.prototype.__lookupSetter__('dataModel');
       parentSetter.call(this, dataModel);
     },
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
index c14a00e..026b458 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -317,6 +317,7 @@
 
       // TODO(crbug.com/425829): Remove above suppression once we no longer use
       // deprecated function defineGetter.
+      // eslint-disable-next-line no-restricted-properties
       this.appContents_.__defineGetter__('contextMenu', function() {
         return self.contextMenu;
       });
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
index bb0ac75..8d50621 100644
--- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
+++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
@@ -134,7 +134,7 @@
           </div>
         </div>
         <div class="settings-box two-line">
-          <cr-input placeholder="ipp/print" label="$i18n{printerQueue}"
+          <cr-input label="$i18n{printerQueue}"
               value="{{newPrinter.printerQueue}}" maxlength=64>
           </cr-input>
         </div>
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
index 87c522e4..4a53b53 100644
--- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
+++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
@@ -56,7 +56,7 @@
     },
     printerPpdReferenceResolved: false,
     printerProtocol: 'ipp',
-    printerQueue: '',
+    printerQueue: 'ipp/print',
     printerStatus: '',
   };
 }
@@ -258,10 +258,6 @@
   /** @private */
   addPressed_: function() {
     this.addPrinterInProgress_ = true;
-    // Set the default printer queue to be "ipp/print".
-    if (!this.newPrinter.printerQueue) {
-      this.set('newPrinter.printerQueue', 'ipp/print');
-    }
 
     if (this.newPrinter.printerProtocol == 'ipp' ||
         this.newPrinter.printerProtocol == 'ipps') {
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index d868903..42d58684 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -781,7 +781,7 @@
 }
 
 base::Optional<TabGroupId> TabStripModel::GetTabGroupForTab(int index) const {
-  return (index == kNoTab) ? base::nullopt : contents_data_[index]->group();
+  return ContainsIndex(index) ? contents_data_[index]->group() : base::nullopt;
 }
 
 std::vector<TabGroupId> TabStripModel::ListTabGroups() const {
@@ -1472,6 +1472,8 @@
     }
     data->set_opener(active_contents);
   }
+  if (group.has_value())
+    data->set_group(group);
 
   // TODO(gbillock): Ask the modal dialog manager whether the WebContents should
   // be blocked, or just let the modal dialog manager make the blocking call
@@ -1495,14 +1497,13 @@
                              /*triggered_by_other_operation=*/true);
   }
 
-  if (group.has_value())
-    contents_data_[index]->set_group(group);
-
   TabStripModelChange::Insert insert;
   insert.contents.push_back({raw_contents, index});
   TabStripModelChange change(std::move(insert));
   for (auto& observer : observers_)
     observer.OnTabStripModelChanged(this, change, selection);
+  if (group.has_value())
+    NotifyGroupChange(index, base::nullopt, group);
 
   return index;
 }
diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h
index 3b22c4cb..1299037 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.h
+++ b/chrome/browser/ui/tabs/tab_strip_model.h
@@ -319,9 +319,10 @@
   // Returns true if the tab at |index| is blocked by a tab modal dialog.
   bool IsTabBlocked(int index) const;
 
-  // Returns the group that contains the tab at |index|, or nullopt if it is not
-  // grouped. This feature is in development and gated behind a feature flag
-  // (see https://crbug.com/915956).
+  // Returns the group that contains the tab at |index|, or nullopt if the tab
+  // index is invalid or not grouped.
+  // This feature is in development and gated behind a feature flag (see
+  // https://crbug.com/915956).
   base::Optional<TabGroupId> GetTabGroupForTab(int index) const;
 
   // Returns the TabGroupData instance for the given |group|.
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index 7a10c67..1219a037 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -3230,6 +3230,29 @@
   EXPECT_EQ(num_group_changed_notifications, 1);
 }
 
+TEST_F(TabStripModelTest, InsertWebContentsAtWithGroupNotifiesObservers) {
+  TestTabStripModelDelegate delegate;
+  MockTabStripModelObserver observer;
+  TabStripModel strip(&delegate, profile());
+  strip.AddObserver(&observer);
+
+  strip.AppendWebContents(CreateWebContents(), true);
+  strip.AppendWebContents(CreateWebContents(), false);
+  auto group_id = strip.AddToNewGroup({0, 1});
+  observer.ClearStates();
+
+  strip.InsertWebContentsAt(1, CreateWebContents(), TabStripModel::ADD_NONE,
+                            group_id);
+
+  EXPECT_EQ(observer.GetStateCount(), 2);
+  EXPECT_EQ(MockTabStripModelObserver::GROUP_CHANGED,
+            observer.GetStateAt(1).action);
+  EXPECT_TRUE(observer.StateEquals(
+      1, ExpectedGroupChangeState(strip, 1, base::nullopt, group_id)));
+
+  strip.CloseAllTabs();
+}
+
 // When inserting a WebContents, if a group is not specified, the new tab
 // should be left ungrouped.
 TEST_F(TabStripModelTest, InsertWebContentsAtDoesNotGroupByDefault) {
@@ -3289,212 +3312,3 @@
   strip.CloseAllTabs();
 }
 
-namespace {
-
-// Checks whether a sequence of tabs have contiguous groups. |group_per_tab|
-// defines the group ID for each tab in the sequence.
-bool GroupsAreContiguous(
-    base::span<const base::Optional<TabGroupId>> group_per_tab) {
-  base::flat_set<TabGroupId> seen_groups;
-  base::Optional<TabGroupId> last_seen_group;
-  for (int tab_index = 0; tab_index < static_cast<int>(group_per_tab.size());
-       ++tab_index) {
-    // If the current tab is grouped and its group ID is not the same as the
-    // last seen tab, we have found a new or discontiguous group. Checking
-    // |seen_groups| tells us which.
-    if (group_per_tab[tab_index].has_value() &&
-        group_per_tab[tab_index] != last_seen_group) {
-      if (base::Contains(seen_groups, group_per_tab[tab_index].value()))
-        return false;
-      seen_groups.insert(group_per_tab[tab_index].value());
-    }
-
-    last_seen_group = group_per_tab[tab_index];
-  }
-
-  return true;
-}
-
-// Printing a base::Optional<TabGroupId> gives absolutely unreadable
-// results. For more readable output, this assigns successive integers to each
-// seen group, starting at 1. It prints those to the string, substituting "*"
-// for non-grouped tabs.  Sample output: "* 1 1 * * 2 2 2"
-std::string PrintGroupsToString(
-    base::span<const base::Optional<TabGroupId>> group_per_tab) {
-  if (group_per_tab.empty())
-    return "";
-
-  int next_group = 1;
-  base::flat_map<TabGroupId, int> group_to_output;
-  std::string result;
-  for (const base::Optional<TabGroupId>& cur : group_per_tab) {
-    if (!cur.has_value()) {
-      result += "* ";
-      continue;
-    }
-
-    if (!base::Contains(group_to_output, cur.value()))
-      group_to_output[cur.value()] = next_group++;
-
-    result += base::NumberToString(group_to_output[cur.value()]) + " ";
-  }
-
-  result.pop_back();
-  return result;
-}
-
-class TabStripGroupContiguityChecker : public TabStripModelObserver {
- public:
-  explicit TabStripGroupContiguityChecker(TabStripModel* model)
-      : model_(model) {
-    // This must be used on a TabStripModel with no tabs so we can accurately
-    // track the group of each tab at each observer update.
-    EXPECT_EQ(0, model_->count());
-    model_->AddObserver(this);
-  }
-  ~TabStripGroupContiguityChecker() override { model_->RemoveObserver(this); }
-
-  void OnTabStripModelChanged(
-      TabStripModel* model,
-      const TabStripModelChange& change,
-      const TabStripSelectionChange& selection) override {
-    ASSERT_EQ(model_, model);
-    // Update our list of tabs' groups, |group_of_tab_|, according to the
-    // observer notification.
-    switch (change.type()) {
-      case TabStripModelChange::kInserted: {
-        const TabStripModelChange::Insert* insert = change.GetInsert();
-        for (const TabStripModelChange::ContentsWithIndex& data :
-             insert->contents) {
-          ASSERT_LE(data.index, static_cast<int>(group_of_tab_.size()));
-          group_of_tab_.insert(group_of_tab_.begin() + data.index,
-                               model_->GetTabGroupForTab(data.index));
-        }
-        break;
-      }
-      case TabStripModelChange::kRemoved: {
-        const TabStripModelChange::Remove* remove = change.GetRemove();
-        for (const TabStripModelChange::ContentsWithIndex& data :
-             remove->contents) {
-          ASSERT_LT(data.index, static_cast<int>(group_of_tab_.size()));
-          group_of_tab_.erase(group_of_tab_.begin() + data.index);
-        }
-        break;
-      }
-      case TabStripModelChange::kMoved: {
-        const TabStripModelChange::Move* move = change.GetMove();
-        ASSERT_LT(move->from_index, static_cast<int>(group_of_tab_.size()));
-        ASSERT_LT(move->to_index, static_cast<int>(group_of_tab_.size()));
-        auto from_iter = group_of_tab_.begin() + move->from_index;
-        auto to_iter = group_of_tab_.begin() + move->to_index;
-        if (from_iter <= to_iter) {
-          std::rotate(from_iter, from_iter + 1, to_iter + 1);
-        } else {
-          std::rotate(to_iter, from_iter, from_iter + 1);
-        }
-        break;
-      }
-      case TabStripModelChange::kGroupChanged: {
-        const TabStripModelChange::GroupChange* group_change =
-            change.GetGroupChange();
-        ASSERT_LT(group_change->index, static_cast<int>(group_of_tab_.size()));
-        EXPECT_EQ(group_change->old_group, group_of_tab_[group_change->index]);
-        group_of_tab_[group_change->index] = group_change->new_group;
-        break;
-      }
-      case TabStripModelChange::kSelectionOnly:
-        break;
-      case TabStripModelChange::kReplaced:
-        break;
-      default:
-        NOTREACHED();
-        break;
-    }
-
-    EXPECT_TRUE(GroupsAreContiguous(group_of_tab_))
-        << "Groups: " << PrintGroupsToString(group_of_tab_);
-  }
-
- private:
-  TabStripModel* const model_;
-  std::vector<base::Optional<TabGroupId>> group_of_tab_;
-};
-
-}  // namespace
-
-// Group contiguity is an invariant of the TabStripModel. It should also send
-// observer updates in a way that preserves this invariant. Otherwise,
-// reconstructing the TabStripModel state from a sequence of observer
-// notifications could result in an invalid state. This is important for
-// sessions code.
-//
-// TODO(crbug.com/971491): this doesn't test all cases because some cases do
-// result in an inconsistent state. For example, removing a tab in the middle of
-// a group sends the ungroup update before the remove update. Once this is
-// fixed, this test should be updated for full coverage.
-TEST_F(TabStripModelTest, GroupsAreAlwaysContiguousForObservers) {
-  TestTabStripModelDelegate delegate;
-  TabStripModel strip(&delegate, profile());
-
-  // This observers |strip|. On each update it receives, it updates its internal
-  // model of the tab strip and checks that all groups are contiguous in it.
-  TabStripGroupContiguityChecker checker(&strip);
-
-  // Add a few tabs to start out.
-  for (int i = 0; i < 6; ++i)
-    strip.AppendWebContents(CreateWebContents(), true);
-
-  // Since failures will happen from inside |checker|, we use |SCOPED_TRACE()|
-  // to see where they come from.
-
-  base::Optional<TabGroupId> group1, group2;
-  {
-    SCOPED_TRACE("Creating initial groups");
-    // Do some grouping, getting some tab reordering along the way.
-    group1 = strip.AddToNewGroup({1, 2});
-    group2 = strip.AddToNewGroup({4, 5});
-    strip.AddToExistingGroup({3}, group1.value());
-    strip.AddToExistingGroup({0}, group2.value());
-  }
-  // Groups: 1 1 1 2 2 2
-
-  {
-    ASSERT_EQ(6, strip.count());
-    SCOPED_TRACE("Remove tab at group beginning");
-    strip.DetachWebContentsAt(3);
-  }
-  // Groups: 1 1 1 2 2
-
-  {
-    ASSERT_EQ(5, strip.count());
-    SCOPED_TRACE("Insert ungrouped tab between groups");
-    strip.InsertWebContentsAt(3, CreateWebContents(), TabStripModel::ADD_NONE);
-  }
-  // Groups: 1 1 1 * 2 2
-
-  {
-    ASSERT_EQ(6, strip.count());
-    SCOPED_TRACE("Move ungrouped tab from between groups to end of group");
-    strip.MoveWebContentsAt(3, 5, false);
-  }
-  // Groups: 1 1 1 2 2 *
-
-  {
-    ASSERT_EQ(6, strip.count());
-    SCOPED_TRACE("Insert grouped tab into middle of group");
-    strip.InsertWebContentsAt(4, CreateWebContents(), TabStripModel::ADD_NONE,
-                              group2);
-  }
-  // Groups: 1 1 1 2 2 2 *
-
-  // The following test currently fails, but at some point should pass:
-  //
-  // {
-  //   ASSERT_EQ(7, strip.count());
-  //   SCOPED_TRACE("Remove tab in middle of group");
-  //   strip.DetachWebContentsAt(1);
-  // }
-  // // Groups: 1 1 2 2 2 *
-
-  strip.CloseAllTabs();
-}
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 7d80c6c..4d09b88 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -219,23 +219,23 @@
   const gfx::Insets toast_label_vertical_margin(
       provider->GetDistanceMetric(DISTANCE_TOAST_LABEL_VERTICAL), 0);
   find_previous_button_->SetProperty(
-      views::kMarginsKey, new gfx::Insets(toast_control_vertical_margin +
-                                          vector_button_horizontal_margin));
-  find_next_button_->SetProperty(
-      views::kMarginsKey, new gfx::Insets(toast_control_vertical_margin +
-                                          vector_button_horizontal_margin));
-  close_button_->SetProperty(views::kMarginsKey,
-                             new gfx::Insets(toast_control_vertical_margin +
+      views::kMarginsKey, gfx::Insets(toast_control_vertical_margin +
+                                      vector_button_horizontal_margin));
+  find_next_button_->SetProperty(views::kMarginsKey,
+                                 gfx::Insets(toast_control_vertical_margin +
                                              vector_button_horizontal_margin));
+  close_button_->SetProperty(views::kMarginsKey,
+                             gfx::Insets(toast_control_vertical_margin +
+                                         vector_button_horizontal_margin));
   separator_->SetProperty(
       views::kMarginsKey,
-      new gfx::Insets(toast_control_vertical_margin + horizontal_margin));
+      gfx::Insets(toast_control_vertical_margin + horizontal_margin));
   find_text_->SetProperty(
       views::kMarginsKey,
-      new gfx::Insets(toast_control_vertical_margin + horizontal_margin));
+      gfx::Insets(toast_control_vertical_margin + horizontal_margin));
   match_count_text_->SetProperty(
       views::kMarginsKey,
-      new gfx::Insets(toast_label_vertical_margin + horizontal_margin));
+      gfx::Insets(toast_label_vertical_margin + horizontal_margin));
 
   find_text_->SetBorder(views::NullBorder());
 
diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.cc b/chrome/browser/ui/views/infobars/confirm_infobar.cc
index 7949bcc..1bc597c 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -132,9 +132,9 @@
       views::MdTextButton::Create(this, GetDelegate()->GetButtonLabel(type));
   button->SetProperty(
       views::kMarginsKey,
-      new gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
-                          DISTANCE_TOAST_CONTROL_VERTICAL),
-                      0));
+      gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
+                      DISTANCE_TOAST_CONTROL_VERTICAL),
+                  0));
   auto* button_ptr = AddChildView(std::move(button));
   button_ptr->SizeToPreferredSize();
   return button_ptr;
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 446d7a4..51f31f3 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -103,9 +103,9 @@
     icon_->SizeToPreferredSize();
     icon_->SetProperty(
         views::kMarginsKey,
-        new gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
-                            DISTANCE_TOAST_LABEL_VERTICAL),
-                        0));
+        gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
+                        DISTANCE_TOAST_LABEL_VERTICAL),
+                    0));
     AddChildView(icon_);
   }
 
@@ -120,9 +120,9 @@
         l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
     close_button->SetFocusForPlatform();
     gfx::Insets close_button_spacing = GetCloseButtonSpacing();
-    close_button->SetProperty(
-        views::kMarginsKey, new gfx::Insets(close_button_spacing.top(), 0,
-                                            close_button_spacing.bottom(), 0));
+    close_button->SetProperty(views::kMarginsKey,
+                              gfx::Insets(close_button_spacing.top(), 0,
+                                          close_button_spacing.bottom(), 0));
     close_button_ = AddChildView(std::move(close_button));
   }
 }
@@ -395,9 +395,8 @@
   label->SizeToPreferredSize();
   label->SetBackgroundColor(GetColor(kInfoBarLabelBackgroundColor));
   label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
-  label->SetProperty(
-      views::kMarginsKey,
-      new gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
-                          DISTANCE_TOAST_LABEL_VERTICAL),
-                      0));
+  label->SetProperty(views::kMarginsKey,
+                     gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric(
+                                     DISTANCE_TOAST_LABEL_VERTICAL),
+                                 0));
 }
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
index 30b977d55..85c0cf0d 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -422,8 +422,7 @@
   // Add zoom label with the new zoom percent.
   label_ = new ZoomValue(web_contents());
   UpdateZoomPercent();
-  label_->SetProperty(views::kMarginsKey,
-                      new gfx::Insets(label_vertical_margin));
+  label_->SetProperty(views::kMarginsKey, gfx::Insets(label_vertical_margin));
   AddChildView(label_);
 
   // Add extra padding between the zoom percent label and the buttons.
@@ -438,7 +437,7 @@
       CreateZoomButton(this, kRemoveIcon, IDS_ACCNAME_ZOOM_MINUS2);
   zoom_out_button_ = zoom_out_button.get();
   zoom_out_button_->SetProperty(views::kMarginsKey,
-                                new gfx::Insets(vector_button_margin));
+                                gfx::Insets(vector_button_margin));
   AddChildView(zoom_out_button.release());
 
   // Add Zoom In ("+") button.
@@ -446,7 +445,7 @@
       CreateZoomButton(this, kAddIcon, IDS_ACCNAME_ZOOM_PLUS2);
   zoom_in_button_ = zoom_in_button.get();
   zoom_in_button_->SetProperty(views::kMarginsKey,
-                               new gfx::Insets(vector_button_margin));
+                               gfx::Insets(vector_button_margin));
   AddChildView(zoom_in_button.release());
 
   // Add "Reset" button.
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_launcher_view.cc b/chrome/browser/ui/views/plugin_vm/plugin_vm_launcher_view.cc
index 40ee2e46..9193743a 100644
--- a/chrome/browser/ui/views/plugin_vm/plugin_vm_launcher_view.cc
+++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_launcher_view.cc
@@ -115,8 +115,7 @@
 
   big_message_label_ = new views::Label(GetBigMessage(), {kTitleFont});
   big_message_label_->SetProperty(
-      views::kMarginsKey,
-      new gfx::Insets(kTitleHeight - kTitleFontSize, 0, 0, 0));
+      views::kMarginsKey, gfx::Insets(kTitleHeight - kTitleFontSize, 0, 0, 0));
   big_message_label_->SetMultiLine(false);
   big_message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
   upper_container_view->AddChildView(big_message_label_);
@@ -144,16 +143,16 @@
   progress_bar_ = new views::ProgressBar(kProgressBarHeight);
   progress_bar_->SetProperty(
       views::kMarginsKey,
-      new gfx::Insets(kProgressBarTopMargin - kProgressBarHeight, 0, 0, 0));
+      gfx::Insets(kProgressBarTopMargin - kProgressBarHeight, 0, 0, 0));
   upper_container_view->AddChildView(progress_bar_);
 
   download_progress_message_label_ =
       new views::Label(base::string16(), {kDownloadProgressMessageFont});
   download_progress_message_label_->SetEnabledColor(gfx::kGoogleGrey700);
   download_progress_message_label_->SetProperty(
-      views::kMarginsKey, new gfx::Insets(kDownloadProgressMessageHeight -
-                                              kDownloadProgressMessageFontSize,
-                                          0, 0, 0));
+      views::kMarginsKey, gfx::Insets(kDownloadProgressMessageHeight -
+                                          kDownloadProgressMessageFontSize,
+                                      0, 0, 0));
   download_progress_message_label_->SetMultiLine(false);
   download_progress_message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
   upper_container_view->AddChildView(download_progress_message_label_);
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
index 9ea9985..6e5de1dd 100644
--- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
+++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -330,11 +330,11 @@
   constexpr int kVerticalMargin = 18;
   constexpr int kLineSpacing = 0;
   title_label_->SetProperty(views::kMarginsKey,
-                            new gfx::Insets(kHorizontalMargin, kVerticalMargin,
-                                            kLineSpacing, kVerticalMargin));
-  domain_label_->SetProperty(
-      views::kMarginsKey, new gfx::Insets(kLineSpacing, kVerticalMargin,
-                                          kHorizontalMargin, kVerticalMargin));
+                            gfx::Insets(kHorizontalMargin, kVerticalMargin,
+                                        kLineSpacing, kVerticalMargin));
+  domain_label_->SetProperty(views::kMarginsKey,
+                             gfx::Insets(kLineSpacing, kVerticalMargin,
+                                         kHorizontalMargin, kVerticalMargin));
 
   widget_ = views::BubbleDialogDelegateView::CreateBubble(this);
   set_adjust_if_offscreen(true);
diff --git a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc
index e76c5a2c..19957f7 100644
--- a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc
+++ b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.cc
@@ -119,7 +119,7 @@
 
 void ExtensionToolbarMenuView::UpdateMargins() {
   SetProperty(views::kMarginsKey,
-              new gfx::Insets(0, GetStartPadding(), 0, GetEndPadding()));
+              gfx::Insets(0, GetStartPadding(), 0, GetEndPadding()));
   menu_item_->Layout();
 }
 
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
index fc09406..807b651 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -726,7 +726,7 @@
 
   layout_manager_->SetFlexForView(location_bar_, location_bar_flex_rule);
   location_bar_->SetProperty(views::kMarginsKey,
-                             new gfx::Insets(0, location_bar_margin));
+                             gfx::Insets(0, location_bar_margin));
 
   if (browser_actions_) {
     layout_manager_->SetFlexForView(browser_actions_,
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index bef4165..f7a0a57c 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -53,11 +53,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 // NewTabUI
 
-NewTabUI::NewTabUI(content::WebUI* web_ui)
-    : content::WebUIController(web_ui),
-      dark_mode_observer_(ui::NativeTheme::GetInstanceForNativeUi(),
-                          base::BindRepeating(&NewTabUI::OnDarkModeChanged,
-                                              base::Unretained(this))) {
+NewTabUI::NewTabUI(content::WebUI* web_ui) : content::WebUIController(web_ui) {
   web_ui->OverrideTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
 
   Profile* profile = GetProfile();
@@ -76,8 +72,6 @@
   pref_change_registrar_.Add(
       prefs::kWebKitDefaultFontSize,
       base::Bind(&NewTabUI::OnDefaultFontSizeChanged, base::Unretained(this)));
-
-  dark_mode_observer_.Start();
 }
 
 NewTabUI::~NewTabUI() {}
@@ -91,16 +85,6 @@
                                          attached);
 }
 
-void NewTabUI::OnDarkModeChanged(bool /*dark_mode*/) {
-  if (!web_ui() || !web_ui()->CanCallJavascript())
-    return;
-
-  bool enabled = base::FeatureList::IsEnabled(features::kWebUIDarkMode);
-  web_ui()->CallJavascriptFunctionUnsafe(
-      "document.documentElement.toggleAttribute", base::Value("dark"),
-      base::Value(enabled && dark_mode_observer_.InDarkMode()));
-}
-
 void NewTabUI::OnDefaultFontSizeChanged() {
   web_ui()->CallJavascriptFunctionUnsafe("ntp.defaultFontSizeChanged");
 }
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.h b/chrome/browser/ui/webui/ntp/new_tab_ui.h
index 63d4d59..b654ce8 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.h
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.h
@@ -10,7 +10,6 @@
 #include "components/prefs/pref_change_registrar.h"
 #include "content/public/browser/url_data_source.h"
 #include "content/public/browser/web_ui_controller.h"
-#include "ui/native_theme/dark_mode_observer.h"
 
 class GURL;
 class Profile;
@@ -74,14 +73,11 @@
     DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource);
   };
 
-  void OnDarkModeChanged(bool dark_mode);
   void OnDefaultFontSizeChanged();
   void OnShowBookmarkBarChanged();
 
   Profile* GetProfile() const;
 
-  ui::DarkModeObserver dark_mode_observer_;
-
   PrefChangeRegistrar pref_change_registrar_;
 
   DISALLOW_COPY_AND_ASSIGN(NewTabUI);
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 08628d1..30278b76 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -347,8 +347,6 @@
       l10n_util::GetStringUTF16(guest_tab_link_ids));
   localized_strings.SetString("learnMoreLink", guest_tab_link);
 
-  SetDarkKey(&localized_strings);
-
   const std::string& app_locale = g_browser_process->GetApplicationLocale();
   webui::SetLoadTimeDataDefaults(app_locale, &localized_strings);
 
@@ -467,8 +465,6 @@
       "isUserSignedIn",
       IdentityManagerFactory::GetForProfile(profile_)->HasPrimaryAccount());
 
-  SetDarkKey(&load_time_data);
-
   // Load the new tab page appropriate for this build.
   base::StringPiece new_tab_html(
       ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
@@ -584,11 +580,3 @@
       ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions);
   new_tab_css_ = base::RefCountedString::TakeString(&css_string);
 }
-
-void NTPResourceCache::SetDarkKey(base::Value* dict) {
-  DCHECK(dict && dict->is_dict());
-  bool use_dark =
-      base::FeatureList::IsEnabled(features::kWebUIDarkMode) &&
-      ui::NativeTheme::GetInstanceForNativeUi()->SystemDarkModeEnabled();
-  dict->SetKey("dark", base::Value(use_dark ? "dark" : ""));
-}
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 1dfdbd0..c70139f 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -687,7 +687,7 @@
 }
 
 base::DictionaryValue ChromeContentClient::GetNetLogConstants() const {
-  auto platform_dict = net_log::ChromeNetLog::GetPlatformConstants(
+  auto platform_dict = net_log::GetPlatformConstantsForNetLog(
       base::CommandLine::ForCurrentProcess()->GetCommandLineString(),
       chrome::GetChannelName());
   if (platform_dict)
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index ed23bc4..1a473b18 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -395,9 +395,6 @@
 // Makes Chrome default browser
 const char kMakeDefaultBrowser[]            = "make-default-browser";
 
-// Forces the maximum disk space to be used by the media cache, in bytes.
-const char kMediaCacheSize[]                = "media-cache-size";
-
 // Allows setting a different destination ID for connection-monitoring GCM
 // messages. Useful when running against a non-prod management server.
 const char kMonitoringDestinationID[]       = "monitoring-destination-id";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index a4a52df..c7b4ed7 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -123,7 +123,6 @@
 extern const char kLaunchSimpleBrowserSwitch[];
 extern const char kLoadMediaRouterComponentExtension[];
 extern const char kMakeDefaultBrowser[];
-extern const char kMediaCacheSize[];
 extern const char kMonitoringDestinationID[];
 extern const char kNativeMessagingConnectHost[];
 extern const char kNativeMessagingConnectExtension[];
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 7a829eb..efd32ff 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -2076,8 +2076,6 @@
 const char kDiskCacheDir[] = "browser.disk_cache_dir";
 // Pref name for the policy specifying the maximal cache size.
 const char kDiskCacheSize[] = "browser.disk_cache_size";
-// Pref name for the policy specifying the maximal media cache size.
-const char kMediaCacheSize[] = "browser.media_cache_size";
 
 // Specifies the release channel that the device should be locked to.
 // Possible values: "stable-channel", "beta-channel", "dev-channel", or an
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index ba64105c..9a0c816e 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -682,7 +682,6 @@
 extern const char kPepperFlashSettingsEnabled[];
 extern const char kDiskCacheDir[];
 extern const char kDiskCacheSize[];
-extern const char kMediaCacheSize[];
 
 extern const char kChromeOsReleaseChannel[];
 
diff --git a/chrome/credential_provider/gaiacp/gaia_credential_base.cc b/chrome/credential_provider/gaiacp/gaia_credential_base.cc
index 89980bd..0c5128d9 100644
--- a/chrome/credential_provider/gaiacp/gaia_credential_base.cc
+++ b/chrome/credential_provider/gaiacp/gaia_credential_base.cc
@@ -23,8 +23,6 @@
 #include "base/path_service.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-#include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "base/win/current_module.h"
@@ -48,13 +46,11 @@
 #include "chrome/credential_provider/gaiacp/reg_utils.h"
 #include "chrome/credential_provider/gaiacp/scoped_lsa_policy.h"
 #include "chrome/credential_provider/gaiacp/scoped_user_profile.h"
-#include "chrome/credential_provider/gaiacp/win_http_url_fetcher.h"
 #include "chrome/installer/launcher_support/chrome_launcher_support.h"
 #include "content/public/common/content_switches.h"
 #include "google_apis/gaia/gaia_auth_util.h"
 #include "google_apis/gaia/gaia_switches.h"
 #include "google_apis/gaia/gaia_urls.h"
-#include "net/base/escape.h"
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 
 namespace credential_provider {
@@ -62,23 +58,6 @@
 namespace {
 
 constexpr wchar_t kEmailDomainsKey[] = L"ed";
-constexpr char kGetAccessTokenBodyWithScopeFormat[] =
-    "client_id=%s&"
-    "client_secret=%s&"
-    "grant_type=refresh_token&"
-    "refresh_token=%s&"
-    "scope=%s";
-constexpr wchar_t kRegEnableADAssociation[] = L"enable_ad_association";
-// The access scopes should be separated by single space.
-constexpr char kAccessScopes[] =
-    "https://www.googleapis.com/auth/admin.directory.user";
-constexpr int kHttpTimeout = 3000;  // in milliseconds
-
-// Names of keys used to fetch the custom attributes from google admin sdk
-// users directory api.
-constexpr char kKeyCustomSchemas[] = "customSchemas";
-constexpr char kKeyEmployeeData[] = "employeeData";
-constexpr char kKeyAdUpn[] = "ad_upn";
 
 base::string16 GetEmailDomains() {
   std::vector<wchar_t> email_domains(16);
@@ -96,178 +75,6 @@
   return base::string16(&email_domains[0]);
 }
 
-bool EnableAdToGoogleAssociation() {
-  DWORD enable_ad_association = 0;
-  HRESULT hr = GetGlobalFlag(kRegEnableADAssociation, &enable_ad_association);
-  return SUCCEEDED(hr) && enable_ad_association;
-}
-
-// Use WinHttpUrlFetcher to communicate with the admin sdk and fetch the active
-// directory UPN from the admin configured custom attributes.
-HRESULT GetAdUpnFromCloudDirectory(const base::string16& email,
-                                   const std::string& access_token,
-                                   std::string* ad_upn) {
-  DCHECK(email.size() > 0);
-  DCHECK(access_token.size() > 0);
-  DCHECK(ad_upn);
-
-  std::string escape_url_encoded_email =
-      net::EscapeUrlEncodedData(base::UTF16ToUTF8(email), true);
-  std::string get_cd_user_url = base::StringPrintf(
-      "https://www.googleapis.com/admin/directory/v1/users/"
-      "%s?projection=full&viewType=domain_public",
-      escape_url_encoded_email.c_str());
-  LOGFN(INFO) << "Encoded URL : " << get_cd_user_url;
-  auto fetcher = WinHttpUrlFetcher::Create(GURL(get_cd_user_url));
-  fetcher->SetRequestHeader("Accept", "application/json");
-  fetcher->SetHttpRequestTimeout(kHttpTimeout);
-
-  std::string access_token_header =
-      base::StringPrintf("Bearer %s", access_token.c_str());
-  fetcher->SetRequestHeader("Authorization", access_token_header.c_str());
-  std::vector<char> cd_user_response;
-  HRESULT hr = fetcher->Fetch(&cd_user_response);
-  std::string cd_user_response_json_string =
-      std::string(cd_user_response.begin(), cd_user_response.end());
-  if (FAILED(hr)) {
-    LOGFN(INFO) << "fetcher->Fetch hr=" << putHR(hr);
-    return hr;
-  }
-
-  *ad_upn = SearchForKeyInStringDictUTF8(
-      cd_user_response_json_string,
-      {kKeyCustomSchemas, kKeyEmployeeData, kKeyAdUpn});
-  return S_OK;
-}
-
-// Request a downscoped access token using the refresh token provided in the
-// input.
-HRESULT RequestDownscopedAccessToken(const std::string& refresh_token,
-                                     std::string* access_token) {
-  DCHECK(refresh_token.size() > 0);
-  DCHECK(access_token);
-
-  GaiaUrls* gaia_urls = GaiaUrls::GetInstance();
-  std::string enc_client_id =
-      net::EscapeUrlEncodedData(gaia_urls->oauth2_chrome_client_id(), true);
-  std::string enc_client_secret =
-      net::EscapeUrlEncodedData(gaia_urls->oauth2_chrome_client_secret(), true);
-  std::string enc_refresh_token =
-      net::EscapeUrlEncodedData(refresh_token, true);
-  std::string get_access_token_body = base::StringPrintf(
-      kGetAccessTokenBodyWithScopeFormat, enc_client_id.c_str(),
-      enc_client_secret.c_str(), enc_refresh_token.c_str(),
-      net::EscapeUrlEncodedData(kAccessScopes, true).c_str());
-  std::string get_oauth_token_url =
-      base::StringPrintf("%s", gaia_urls->oauth2_token_url().spec().c_str());
-
-  auto oauth_fetcher = WinHttpUrlFetcher::Create(GURL(get_oauth_token_url));
-  oauth_fetcher->SetRequestBody(get_access_token_body.c_str());
-  oauth_fetcher->SetRequestHeader("content-type",
-                                  "application/x-www-form-urlencoded");
-  oauth_fetcher->SetHttpRequestTimeout(kHttpTimeout);
-
-  std::vector<char> oauth_response;
-  HRESULT oauth_hr = oauth_fetcher->Fetch(&oauth_response);
-  if (FAILED(oauth_hr)) {
-    LOGFN(ERROR) << "oauth_fetcher.Fetch hr=" << putHR(oauth_hr);
-    return oauth_hr;
-  }
-
-  std::string oauth_response_json_string =
-      std::string(oauth_response.begin(), oauth_response.end());
-  *access_token = SearchForKeyInStringDictUTF8(oauth_response_json_string,
-                                               {kKeyAccessToken});
-  if (access_token->empty()) {
-    LOGFN(ERROR) << "Fetched access token with new scopes is empty.";
-    return E_FAIL;
-  }
-  return S_OK;
-}
-
-// Find an AD account associated with GCPW user if one exists.
-// (1) Verifies if the gaia user has a corresponding mapping in Google
-//   Admin SDK Users Directory and contains the custom_schema that contains
-//   the ad_upn or local_user_name for the corresponding user.
-// (2) If there is an entry in cloud directory, gcpw would search for the SID
-//   corresponding to that user entry on the device.
-// (3) If a SID is found, then it would log the user onto the device using
-//   username extracted from Google Admin SDK Users Directory and password
-//   being the same as the gaia entity.
-// (4) If there is no entry found in cloud directory, gcpw would fallback to
-//   attempting creation of a new user on the device.
-//
-// Below are the failure scenarios :
-// (1) If an invalid upn is set in the custom attributes, the login would fail.
-// (2) If an attempt to find SID from domain controller failed, then we fail
-//     the login.
-// Note that if an empty upn is found in the custom attribute, then the login
-// would try and attempt to create local user.
-HRESULT FindAdUserSidIfAvailable(const std::string& refresh_token,
-                                 const base::string16& email,
-                                 wchar_t* sid,
-                                 const DWORD sid_length) {
-  // Step 1: Get the downscoped access token with required admin sdk scopes.
-  std::string access_token;
-  HRESULT hr = RequestDownscopedAccessToken(refresh_token, &access_token);
-
-  if (FAILED(hr)) {
-    LOGFN(ERROR) << "RequestDownscopedAccessToken hr=" << putHR(hr);
-    return hr;
-  }
-
-  // Step 2: Make a get call to admin sdk using the fetched access_token and
-  // retrieve the ad_upn.
-  std::string ad_upn;
-  hr = GetAdUpnFromCloudDirectory(email, access_token, &ad_upn);
-  if (FAILED(hr)) {
-    LOGFN(ERROR) << "GetAdUpnFromCloudDirectory hr=" << putHR(hr);
-    return hr;
-  }
-
-  base::string16 ad_domain;
-  base::string16 ad_user;
-  if (ad_upn.empty()) {
-    LOGFN(INFO) << "Found empty ad_upn in cloud directory. Fall back to "
-                   "creating local account";
-    return S_FALSE;
-  }
-
-  // The format for ad_upn custom attribute is domainName/userName.
-  const base::char16 kSlashDelimiter[] = STRING16_LITERAL("/");
-  std::vector<base::string16> tokens =
-      base::SplitString(base::UTF8ToUTF16(ad_upn), kSlashDelimiter,
-                        base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
-
-  // Values fetched from custom attribute shouldn't be empty.
-  if (tokens.size() != 2) {
-    LOGFN(ERROR) << "Found unparseable ad_upn in cloud directory : " << ad_upn;
-    return E_FAIL;
-  }
-
-  ad_domain = tokens.at(0);
-  ad_user = tokens.at(1);
-
-  OSUserManager* os_user_manager = OSUserManager::Get();
-  DCHECK(os_user_manager);
-  base::string16 existing_sid = base::string16();
-
-  LOGFN(INFO) << "Get user sid for user " << ad_user << " and domain name "
-              << ad_domain;
-  hr = os_user_manager->GetUserSID(ad_domain.c_str(), ad_user.c_str(),
-                                   &existing_sid);
-  LOGFN(INFO) << "GetUserSID result=" << hr;
-
-  if (existing_sid.length() > 0) {
-    LOGFN(INFO) << "Found existing SID = " << existing_sid;
-    wcscpy_s(sid, sid_length, existing_sid.c_str());
-    return S_OK;
-  } else {
-    LOGFN(ERROR) << "No existing sid found with UPN : " << ad_upn;
-    return E_FAIL;
-  }
-}
-
 // Tries to find a user associated to the gaia_id stored in |result| under the
 // key |kKeyId|. If one exists, then this function will fill out |gaia_id|,
 // |username|, |domain| and |sid| with the user's information. If not this
@@ -301,44 +108,15 @@
   *is_consumer_account = consumer_domain_pos != base::string16::npos;
 
   *gaia_id = GetDictString(result, kKeyId);
-
   // First try to detect if this gaia account has been used to create an OS
   // user already.  If so, return the OS username of that user.
   HRESULT hr = GetSidFromId(*gaia_id, sid, sid_length);
-
-  bool has_existing_user_sid = false;
-  // Check if the machine is domain joined and get the domain name if domain
-  // joined.
   if (SUCCEEDED(hr)) {
-    // This makes sure that we don't invoke the network calls on every login
-    // attempt and instead fallback to the SID to gaia id mapping created by
-    // GCPW.
-    LOGFN(INFO) << "Found existing SID created in GCPW registry entry = "
-                << sid;
-    has_existing_user_sid = true;
-  } else if (EnableAdToGoogleAssociation() &&
-             OSUserManager::Get()->IsDeviceDomainJoined()) {
-    LOGFN(INFO) << "No existing SID found in the GCPW registry.";
-
-    std::string refresh_token = GetDictStringUTF8(result, kKeyRefreshToken);
-    hr = FindAdUserSidIfAvailable(refresh_token, email, sid, sid_length);
-    if (FAILED(hr)) {
-      LOGFN(ERROR) << "Failed finding AD user sid for GCPW user.";
-      return;
-    } else if (hr == S_OK) {
-      has_existing_user_sid = true;
-    }
-  } else {
-    LOGFN(INFO) << "Falling back to creation of new user";
-  }
-
-  if (has_existing_user_sid) {
-    HRESULT hr = OSUserManager::Get()->FindUserBySID(
-        sid, username, username_length, domain, domain_length);
+    hr = OSUserManager::Get()->FindUserBySID(sid, username, username_length,
+                                             domain, domain_length);
     if (SUCCEEDED(hr))
       return;
   }
-
   LOGFN(INFO) << "No existing user found associated to gaia id:" << *gaia_id;
   wcscpy_s(domain, domain_length, OSUserManager::GetLocalDomain().c_str());
   username[0] = 0;
@@ -386,7 +164,7 @@
   wcscpy_s(username, username_length, os_username.c_str());
 }
 
-// Waits for the login UI to complete and returns the result of the operation.
+// Waits for the login UI to completes and returns the result of the operation.
 // This function returns S_OK on success, E_UNEXPECTED on failure, and E_ABORT
 // if the user aborted or timed out (or was killed during cleanup).
 HRESULT WaitForLoginUIAndGetResult(
diff --git a/chrome/credential_provider/gaiacp/gaia_credential_base_unittests.cc b/chrome/credential_provider/gaiacp/gaia_credential_base_unittests.cc
index c0b5e3b..dbec687 100644
--- a/chrome/credential_provider/gaiacp/gaia_credential_base_unittests.cc
+++ b/chrome/credential_provider/gaiacp/gaia_credential_base_unittests.cc
@@ -6,7 +6,6 @@
 
 #include <sddl.h>  // For ConvertSidToStringSid()
 
-#include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/credential_provider/common/gcp_strings.h"
 #include "chrome/credential_provider/gaiacp/gaia_credential_base.h"
@@ -16,8 +15,6 @@
 #include "chrome/credential_provider/gaiacp/reg_utils.h"
 #include "chrome/credential_provider/test/gls_runner_test_base.h"
 #include "chrome/credential_provider/test/test_credential.h"
-#include "google_apis/gaia/gaia_urls.h"
-#include "net/base/escape.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace credential_provider {
@@ -825,287 +822,6 @@
   EXPECT_EQ(test->GetFinalEmail(), email);
 }
 
-/** Test various active directory sign in scenarios. */
-
-class GcpGaiaCredentialBaseAdScenariosTest : public GcpGaiaCredentialBaseTest {
- protected:
-  void SetUp() override;
-
-  // Create provider and start logon.
-  CComPtr<ICredentialProviderCredential> cred_;
-  // The admin sdk users directory get URL.
-  std::string get_cd_user_url_ = base::StringPrintf(
-      "https://www.googleapis.com/admin/directory/v1/users/"
-      "%s?projection=full&viewType=domain_public",
-      net::EscapeUrlEncodedData(kDefaultEmail, true).c_str());
-  GaiaUrls* gaia_urls_ = GaiaUrls::GetInstance();
-};
-
-void GcpGaiaCredentialBaseAdScenariosTest::SetUp() {
-  GcpGaiaCredentialBaseTest::SetUp();
-
-  // Set the device as a domain joined machine.
-  fake_os_user_manager()->SetIsDeviceDomainJoined(true);
-
-  // Override registry to enable AD association with google.
-  constexpr wchar_t kRegEnableADAssociation[] = L"enable_ad_association";
-  ASSERT_EQ(S_OK, SetGlobalFlagForTesting(kRegEnableADAssociation, 1));
-
-  ASSERT_EQ(S_OK, InitializeProviderAndGetCredential(0, &cred_));
-}
-
-// Fetching downscoped access token required for calling admin sdk failed.
-// The login attempt would fail in this scenario.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithAD_CallToFetchDownscopedAccessTokenFailed) {
-  // Attempt to fetch the token from gaia fails.
-  fake_http_url_fetcher_factory()->SetFakeFailedResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()), E_FAIL);
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure no user was created and the login attempt failed.
-  PSID sid = nullptr;
-  EXPECT_EQ(
-      HRESULT_FROM_WIN32(NERR_UserNotFound),
-      fake_os_user_manager()->GetUserSID(
-          OSUserManager::GetLocalDomain().c_str(), kDefaultUsername, &sid));
-  ASSERT_EQ(nullptr, sid);
-
-  // No new user is created.
-  EXPECT_EQ(1ul, fake_os_user_manager()->GetUserCount());
-
-  // TODO(crbug.com/976406): Set the error message appropriately for failure
-  // scenarios.
-  ASSERT_EQ(S_OK, FinishLogonProcess(
-                      /*expected_success=*/false,
-                      /*expected_credentials_change_fired=*/false,
-                      /*expected_error_message=*/0));
-}
-
-// Empty access token returned.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithAD_EmptyAccessTokenReturned) {
-  // Set token result to not contain any access token.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()),
-      FakeWinHttpUrlFetcher::Headers(), "{}");
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure no user was created and the login attempt failed.
-  PSID sid = nullptr;
-  EXPECT_EQ(
-      HRESULT_FROM_WIN32(NERR_UserNotFound),
-      fake_os_user_manager()->GetUserSID(
-          OSUserManager::GetLocalDomain().c_str(), kDefaultUsername, &sid));
-  ASSERT_EQ(nullptr, sid);
-
-  // No new user is created.
-  EXPECT_EQ(1ul, fake_os_user_manager()->GetUserCount());
-
-  ASSERT_EQ(S_OK, FinishLogonProcess(
-                      /*expected_success=*/false,
-                      /*expected_credentials_change_fired=*/false,
-                      /*expected_error_message=*/0));
-}
-
-// Empty AD UPN entry is returned via admin sdk.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithAD_NoAdUpnFoundFromAdminSdk) {
-  // Set token result a valid access token.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()),
-      FakeWinHttpUrlFetcher::Headers(), "{\"access_token\": \"dummy_token\"}");
-
-  // Set empty response from admin sdk.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(get_cd_user_url_.c_str()), FakeWinHttpUrlFetcher::Headers(), "{}");
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure a "foo" user was created.
-  PSID sid;
-  EXPECT_EQ(S_OK, fake_os_user_manager()->GetUserSID(
-                      OSUserManager::GetLocalDomain().c_str(), kDefaultUsername,
-                      &sid));
-  ::LocalFree(sid);
-
-  // New user should be created.
-  EXPECT_EQ(2ul, fake_os_user_manager()->GetUserCount());
-}
-
-// Call to the admin sdk to fetch the AD UPN failed.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithAD_CallToAdminSdkFailed) {
-  // Set token result a valid access token.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()),
-      FakeWinHttpUrlFetcher::Headers(), "{\"access_token\": \"dummy_token\"}");
-
-  // Fail the call from admin sdk.
-  fake_http_url_fetcher_factory()->SetFakeFailedResponse(
-      GURL(get_cd_user_url_.c_str()), E_FAIL);
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure no user was created and the login attempt failed.
-  PSID sid = nullptr;
-  EXPECT_EQ(
-      HRESULT_FROM_WIN32(NERR_UserNotFound),
-      fake_os_user_manager()->GetUserSID(
-          OSUserManager::GetLocalDomain().c_str(), kDefaultUsername, &sid));
-  ASSERT_EQ(nullptr, sid);
-
-  // No new user is created.
-  EXPECT_EQ(1ul, fake_os_user_manager()->GetUserCount());
-
-  ASSERT_EQ(S_OK, FinishLogonProcess(
-                      /*expected_success=*/false,
-                      /*expected_credentials_change_fired=*/false,
-                      /*expected_error_message=*/0));
-}
-
-// Customer configured invalid ad upn.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithAD_InvalidADUPNConfigured) {
-  // Add the user as a domain joined user.
-  const wchar_t user_name[] = L"ad_user";
-  const wchar_t domain_name[] = L"ad_domain";
-  const wchar_t password[] = L"password";
-
-  CComBSTR ad_sid;
-  DWORD error;
-  HRESULT add_domain_user_hr = fake_os_user_manager()->AddUser(
-      user_name, password, L"fullname", L"comment", true, domain_name, &ad_sid,
-      &error);
-  ASSERT_EQ(S_OK, add_domain_user_hr);
-  ASSERT_EQ(0u, error);
-
-  // Set token result a valid access token.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()),
-      FakeWinHttpUrlFetcher::Headers(), "{\"access_token\": \"dummy_token\"}");
-
-  // Invalid configuration in admin sdk. Don't set the username.
-  std::string admin_sdk_response = base::StringPrintf(
-      "{\"customSchemas\": {\"employeeData\": {\"ad_upn\":"
-      " \"%ls/\"}}}",
-      domain_name);
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(get_cd_user_url_.c_str()), FakeWinHttpUrlFetcher::Headers(),
-      admin_sdk_response);
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure no user was created and the login attempt failed.
-  PSID sid = nullptr;
-  EXPECT_EQ(
-      HRESULT_FROM_WIN32(NERR_UserNotFound),
-      fake_os_user_manager()->GetUserSID(
-          OSUserManager::GetLocalDomain().c_str(), kDefaultUsername, &sid));
-  ASSERT_EQ(nullptr, sid);
-
-  // No new user is created.
-  EXPECT_EQ(2ul, fake_os_user_manager()->GetUserCount());
-
-  ASSERT_EQ(S_OK, FinishLogonProcess(
-                      /*expected_success=*/false,
-                      /*expected_credentials_change_fired=*/false,
-                      /*expected_error_message=*/0));
-}
-
-// This is the success scenario where all preconditions are met in the
-// AD login scenario. The user is successfully logged in.
-TEST_F(GcpGaiaCredentialBaseAdScenariosTest,
-       GetSerialization_WithADSuccessScenario) {
-  // Add the user as a domain joined user.
-  const wchar_t user_name[] = L"ad_user";
-  const wchar_t domain_name[] = L"ad_domain";
-  const wchar_t password[] = L"password";
-
-  CComBSTR ad_sid;
-  DWORD error;
-  HRESULT add_domain_user_hr = fake_os_user_manager()->AddUser(
-      user_name, password, L"fullname", L"comment", true, domain_name, &ad_sid,
-      &error);
-  ASSERT_EQ(S_OK, add_domain_user_hr);
-  ASSERT_EQ(0u, error);
-
-  // Set token result as a valid access token.
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(gaia_urls_->oauth2_token_url().spec().c_str()),
-      FakeWinHttpUrlFetcher::Headers(), "{\"access_token\": \"dummy_token\"}");
-
-  // Set valid response from admin sdk.
-  std::string admin_sdk_response = base::StringPrintf(
-      "{\"customSchemas\": {\"employeeData\": {\"ad_upn\":"
-      " \"%ls/%ls\"}}}",
-      domain_name, user_name);
-  fake_http_url_fetcher_factory()->SetFakeResponse(
-      GURL(get_cd_user_url_.c_str()), FakeWinHttpUrlFetcher::Headers(),
-      admin_sdk_response);
-
-  CComPtr<ITestCredential> test;
-  ASSERT_EQ(S_OK, cred_.QueryInterface(&test));
-
-  ASSERT_EQ(S_OK, StartLogonProcessAndWait());
-
-  EXPECT_EQ(test->GetFinalEmail(), kDefaultEmail);
-
-  // Make sure no user was created and the login happens on the
-  // existing user instead.
-  PSID sid = nullptr;
-  EXPECT_EQ(
-      HRESULT_FROM_WIN32(NERR_UserNotFound),
-      fake_os_user_manager()->GetUserSID(
-          OSUserManager::GetLocalDomain().c_str(), kDefaultUsername, &sid));
-  ASSERT_EQ(nullptr, sid);
-
-  // Finishing logon process should trigger credential changed and trigger
-  // GetSerialization.
-  ASSERT_EQ(S_OK, FinishLogonProcess(true, true, 0));
-
-  // Verify that the registry entry for the user was created.
-  wchar_t gaia_id[256];
-  ULONG length = base::size(gaia_id);
-  std::wstring sid_str(ad_sid, SysStringLen(ad_sid));
-  ::SysFreeString(ad_sid);
-
-  HRESULT gaia_id_hr =
-      GetUserProperty(sid_str.c_str(), kUserId, gaia_id, &length);
-  ASSERT_EQ(S_OK, gaia_id_hr);
-  ASSERT_TRUE(gaia_id[0]);
-
-  // Verify that the authentication results dictionary is now empty.
-  ASSERT_TRUE(test->IsAuthenticationResultsEmpty());
-}
-
 // Tests various sign in scenarios with consumer and non-consumer domains.
 // Parameters are:
 // 1. Is mdm enrollment enabled.
diff --git a/chrome/credential_provider/gaiacp/gcp_utils.cc b/chrome/credential_provider/gaiacp/gcp_utils.cc
index c43b0ca..a5d0b618 100644
--- a/chrome/credential_provider/gaiacp/gcp_utils.cc
+++ b/chrome/credential_provider/gaiacp/gcp_utils.cc
@@ -29,12 +29,10 @@
 #include "base/files/file.h"
 #include "base/files/file_enumerator.h"
 #include "base/files/file_util.h"
-#include "base/json/json_reader.h"
 #include "base/macros.h"
 #include "base/no_destructor.h"
 #include "base/path_service.h"
 #include "base/stl_util.h"
-#include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/current_module.h"
@@ -729,22 +727,6 @@
     ::RtlSecureZeroMemory(buffer, length);
 }
 
-std::string SearchForKeyInStringDictUTF8(
-    const std::string& json_string,
-    const std::initializer_list<base::StringPiece>& path) {
-  DCHECK(path.size() > 0);
-
-  base::Optional<base::Value> json_obj =
-      base::JSONReader::Read(json_string, base::JSON_ALLOW_TRAILING_COMMAS);
-  if (!json_obj || !json_obj->is_dict()) {
-    LOGFN(ERROR) << "base::JSONReader::Read failed to translate to JSON";
-    return std::string();
-  }
-  const std::string* value =
-      json_obj->FindStringPath(base::JoinString(path, "."));
-  return value ? *value : std::string();
-}
-
 base::string16 GetDictString(const base::Value& dict, const char* name) {
   DCHECK(name);
   DCHECK(dict.is_dict());
diff --git a/chrome/credential_provider/gaiacp/gcp_utils.h b/chrome/credential_provider/gaiacp/gcp_utils.h
index 1958cbcc..8689f2c 100644
--- a/chrome/credential_provider/gaiacp/gcp_utils.h
+++ b/chrome/credential_provider/gaiacp/gcp_utils.h
@@ -232,18 +232,9 @@
 
 // Helpers to get strings from base::Values that are expected to be
 // DictionaryValues.
-
 base::string16 GetDictString(const base::Value& dict, const char* name);
 base::string16 GetDictString(const std::unique_ptr<base::Value>& dict,
                              const char* name);
-// Perform a recursive search on a nested dictionary object. Note that the
-// names provided in the input should be in order. Below is an example : Lets
-// say the json object is {"key1": {"key2": {"key3": "value1"}}, "key4":
-// "value2"}. Then to search for the key "key3", this method should be called
-// by providing the names vector as {"key1", "key2", "key3"}.
-std::string SearchForKeyInStringDictUTF8(
-    const std::string& json_string,
-    const std::initializer_list<base::StringPiece>& path);
 std::string GetDictStringUTF8(const base::Value& dict, const char* name);
 std::string GetDictStringUTF8(const std::unique_ptr<base::Value>& dict,
                               const char* name);
diff --git a/chrome/credential_provider/gaiacp/os_user_manager.cc b/chrome/credential_provider/gaiacp/os_user_manager.cc
index ed45672..80e0299 100644
--- a/chrome/credential_provider/gaiacp/os_user_manager.cc
+++ b/chrome/credential_provider/gaiacp/os_user_manager.cc
@@ -73,11 +73,6 @@
 }
 
 // static
-bool OSUserManager::IsDeviceDomainJoined() {
-  return base::win::IsEnrolledToDomain();
-}
-
-// static
 base::string16 OSUserManager::GetLocalDomain() {
   // If the domain is the current computer, then there is no domain controller.
   wchar_t computer_name[MAX_COMPUTERNAME_LENGTH + 1];
diff --git a/chrome/credential_provider/gaiacp/os_user_manager.h b/chrome/credential_provider/gaiacp/os_user_manager.h
index 4376cd8..ff982534 100644
--- a/chrome/credential_provider/gaiacp/os_user_manager.h
+++ b/chrome/credential_provider/gaiacp/os_user_manager.h
@@ -99,9 +99,6 @@
   // to another.
   static void SetInstanceForTesting(OSUserManager* instance);
 
-  // Checks if the device is domain joined.
-  virtual bool IsDeviceDomainJoined();
-
  protected:
   OSUserManager() {}
 
diff --git a/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc b/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc
index 26f6e22..d5eca95e 100644
--- a/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc
+++ b/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc
@@ -69,12 +69,6 @@
   return S_OK;
 }
 
-HRESULT WinHttpUrlFetcher::SetHttpRequestTimeout(const int timeout_in_millis) {
-  DCHECK(timeout_in_millis);
-  timeout_in_millis_ = timeout_in_millis;
-  return S_OK;
-}
-
 HRESULT WinHttpUrlFetcher::Fetch(std::vector<char>* response) {
   USES_CONVERSION;
   DCHECK(response);
@@ -100,19 +94,6 @@
   }
 
   {
-    // Set timeout if specified.
-    if (timeout_in_millis_ != 0) {
-      if (!::WinHttpSetTimeouts(session_.Get(), timeout_in_millis_,
-                                timeout_in_millis_, timeout_in_millis_,
-                                timeout_in_millis_)) {
-        HRESULT hr = HRESULT_FROM_WIN32(::GetLastError());
-        LOGFN(ERROR) << "WinHttpSetTimeouts hr=" << putHR(hr);
-        return hr;
-      }
-    }
-  }
-
-  {
     bool use_post = !body_.empty();
     ScopedWinHttpHandle::Handle request = ::WinHttpOpenRequest(
         connect.Get(), use_post ? L"POST" : L"GET",
diff --git a/chrome/credential_provider/gaiacp/win_http_url_fetcher.h b/chrome/credential_provider/gaiacp/win_http_url_fetcher.h
index 3295c2d..341f6c449 100644
--- a/chrome/credential_provider/gaiacp/win_http_url_fetcher.h
+++ b/chrome/credential_provider/gaiacp/win_http_url_fetcher.h
@@ -27,7 +27,6 @@
 
   virtual HRESULT SetRequestHeader(const char* name, const char* value);
   virtual HRESULT SetRequestBody(const char* body);
-  virtual HRESULT SetHttpRequestTimeout(const int timeout_in_millis);
   virtual HRESULT Fetch(std::vector<char>* response);
   virtual HRESULT Close();
 
@@ -49,7 +48,6 @@
   std::string body_;
   ScopedWinHttpHandle session_;
   ScopedWinHttpHandle request_;
-  int timeout_in_millis_ = 0;
 
   // Gets storage of the function pointer used to create instances of this
   // class for tests.
diff --git a/chrome/credential_provider/test/gcp_fakes.cc b/chrome/credential_provider/test/gcp_fakes.cc
index eac04e61..91094a33 100644
--- a/chrome/credential_provider/test/gcp_fakes.cc
+++ b/chrome/credential_provider/test/gcp_fakes.cc
@@ -141,7 +141,6 @@
   return AddUser(username, password, fullname, comment, add_to_users_group,
                  OSUserManager::GetLocalDomain().c_str(), sid, error);
 }
-
 HRESULT FakeOSUserManager::AddUser(const wchar_t* username,
                                    const wchar_t* password,
                                    const wchar_t* fullname,
@@ -272,10 +271,6 @@
   return token->IsValid() ? S_OK : HRESULT_FROM_WIN32(::GetLastError());
 }
 
-bool FakeOSUserManager::IsDeviceDomainJoined() {
-  return is_device_domain_joined_;
-}
-
 HRESULT FakeOSUserManager::GetUserSID(const wchar_t* domain,
                                       const wchar_t* username,
                                       PSID* sid) {
@@ -584,30 +579,17 @@
       Response(headers, response, send_response_event_handle);
 }
 
-void FakeWinHttpUrlFetcherFactory::SetFakeFailedResponse(const GURL& url,
-                                                         HRESULT failed_hr) {
-  // Make sure that the HRESULT set is a failed attempt.
-  DCHECK(FAILED(failed_hr));
-  failed_http_fetch_hr_[url] = failed_hr;
-}
-
 std::unique_ptr<WinHttpUrlFetcher> FakeWinHttpUrlFetcherFactory::Create(
     const GURL& url) {
-  if (fake_responses_.count(url) == 0 && failed_http_fetch_hr_.count(url) == 0)
+  if (fake_responses_.count(url) == 0)
     return nullptr;
 
+  const Response& response = fake_responses_[url];
+
   FakeWinHttpUrlFetcher* fetcher = new FakeWinHttpUrlFetcher(std::move(url));
-
-  if (fake_responses_.count(url) != 0) {
-    const Response& response = fake_responses_[url];
-
-    fetcher->response_headers_ = response.headers;
-    fetcher->response_ = response.response;
-    fetcher->send_response_event_handle_ = response.send_response_event_handle;
-  } else {
-    DCHECK(failed_http_fetch_hr_.count(url) > 0);
-    fetcher->response_hr_ = failed_http_fetch_hr_[url];
-  }
+  fetcher->response_headers_ = response.headers;
+  fetcher->response_ = response.response;
+  fetcher->send_response_event_handle_ = response.send_response_event_handle;
   ++requests_created_;
 
   return std::unique_ptr<WinHttpUrlFetcher>(fetcher);
@@ -623,9 +605,6 @@
 }
 
 HRESULT FakeWinHttpUrlFetcher::Fetch(std::vector<char>* response) {
-  if (FAILED(response_hr_))
-    return response_hr_;
-
   if (send_response_event_handle_ != INVALID_HANDLE_VALUE)
     ::WaitForSingleObject(send_response_event_handle_, INFINITE);
 
diff --git a/chrome/credential_provider/test/gcp_fakes.h b/chrome/credential_provider/test/gcp_fakes.h
index 088e98b1..368d5d7 100644
--- a/chrome/credential_provider/test/gcp_fakes.h
+++ b/chrome/credential_provider/test/gcp_fakes.h
@@ -69,15 +69,6 @@
                   bool add_to_users_group,
                   BSTR* sid,
                   DWORD* error) override;
-  // Add a user to the OS with domain associated with it.
-  HRESULT AddUser(const wchar_t* username,
-                  const wchar_t* password,
-                  const wchar_t* fullname,
-                  const wchar_t* comment,
-                  bool add_to_users_group,
-                  const wchar_t* domain,
-                  BSTR* sid,
-                  DWORD* error);
   HRESULT ChangeUserPassword(const wchar_t* domain,
                              const wchar_t* username,
                              const wchar_t* password,
@@ -112,16 +103,10 @@
                                          const wchar_t* username,
                                          bool allow) override;
 
-  bool IsDeviceDomainJoined() override;
-
   void SetShouldFailUserCreation(bool should_fail) {
     should_fail_user_creation_ = should_fail;
   }
 
-  void SetIsDeviceDomainJoined(bool is_device_domain_joined) {
-    is_device_domain_joined_ = is_device_domain_joined;
-  }
-
   struct UserInfo {
     UserInfo(const wchar_t* domain,
              const wchar_t* password,
@@ -180,7 +165,16 @@
   DWORD next_rid_ = 0;
   std::map<base::string16, UserInfo> username_to_info_;
   bool should_fail_user_creation_ = false;
-  bool is_device_domain_joined_ = false;
+
+  // Add a user to the OS with domain associated with it.
+  HRESULT AddUser(const wchar_t* username,
+                  const wchar_t* password,
+                  const wchar_t* fullname,
+                  const wchar_t* comment,
+                  bool add_to_users_group,
+                  const wchar_t* domain,
+                  BSTR* sid,
+                  DWORD* error);
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -279,12 +273,6 @@
       const WinHttpUrlFetcher::Headers& headers,
       const std::string& response,
       HANDLE send_response_event_handle = INVALID_HANDLE_VALUE);
-
-  // Sets the response as a failed http attempt. The return result
-  // from http_url_fetcher.Fetch() would be set as the input HRESULT
-  // to this method.
-  void SetFakeFailedResponse(const GURL& url, HRESULT failed_hr);
-
   size_t requests_created() const { return requests_created_; }
 
  private:
@@ -305,7 +293,6 @@
   };
 
   std::map<GURL, Response> fake_responses_;
-  std::map<GURL, HRESULT> failed_http_fetch_hr_;
   size_t requests_created_ = 0;
 };
 
@@ -329,7 +316,6 @@
   Headers response_headers_;
   std::string response_;
   HANDLE send_response_event_handle_;
-  HRESULT response_hr_ = S_OK;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/test/android/browsertests_apk/src/org/chromium/android_browsertests_apk/ChromeBrowserTestsApplication.java b/chrome/test/android/browsertests_apk/src/org/chromium/android_browsertests_apk/ChromeBrowserTestsApplication.java
index 72c60fc..31265cf 100644
--- a/chrome/test/android/browsertests_apk/src/org/chromium/android_browsertests_apk/ChromeBrowserTestsApplication.java
+++ b/chrome/test/android/browsertests_apk/src/org/chromium/android_browsertests_apk/ChromeBrowserTestsApplication.java
@@ -6,6 +6,7 @@
 
 import android.content.Context;
 
+import org.chromium.base.ApplicationStatus;
 import org.chromium.base.PathUtils;
 import org.chromium.chrome.browser.GlobalDiscardableReferencePool;
 import org.chromium.chrome.browser.metrics.UmaUtils;
@@ -34,6 +35,8 @@
         super.attachBaseContext(base);
 
         if (isBrowserProcess) {
+            ApplicationStatus.initialize(this);
+
             // Test-only stuff, see also NativeUnitTest.java.
             PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
         }
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc
index 6fe5698..6e020e9 100644
--- a/chrome/test/base/testing_browser_process.cc
+++ b/chrome/test/base/testing_browser_process.cc
@@ -365,10 +365,6 @@
   return download_request_limiter_.get();
 }
 
-net_log::ChromeNetLog* TestingBrowserProcess::net_log() {
-  return nullptr;
-}
-
 component_updater::ComponentUpdateService*
 TestingBrowserProcess::component_updater() {
   return nullptr;
diff --git a/chrome/test/base/testing_browser_process.h b/chrome/test/base/testing_browser_process.h
index 11595f4f..7cfbf01c 100644
--- a/chrome/test/base/testing_browser_process.h
+++ b/chrome/test/base/testing_browser_process.h
@@ -120,7 +120,6 @@
   void StartAutoupdateTimer() override {}
 #endif
 
-  net_log::ChromeNetLog* net_log() override;
   component_updater::ComponentUpdateService* component_updater() override;
   component_updater::SupervisedUserWhitelistInstaller*
   supervised_user_whitelist_installer() override;
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 845039f..08c65393 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -676,6 +676,10 @@
   is_new_profile_ = is_new_profile;
 }
 
+base::FilePath TestingProfile::GetPath() {
+  return profile_path_;
+}
+
 base::FilePath TestingProfile::GetPath() const {
   return profile_path_;
 }
@@ -714,6 +718,10 @@
   return REGULAR_PROFILE;
 }
 
+bool TestingProfile::IsOffTheRecord() {
+  return original_profile_;
+}
+
 bool TestingProfile::IsOffTheRecord() const {
   return original_profile_;
 }
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h
index 970d1c8..fd4f3ed 100644
--- a/chrome/test/base/testing_profile.h
+++ b/chrome/test/base/testing_profile.h
@@ -264,6 +264,7 @@
   void SetSupervisedUserId(const std::string& id);
 
   // content::BrowserContext
+  base::FilePath GetPath() override;
   base::FilePath GetPath() const override;
 #if !defined(OS_ANDROID)
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
@@ -272,6 +273,7 @@
   scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override;
   // Do not override IsOffTheRecord to turn a normal profile into an incognito
   // profile dynamically.
+  bool IsOffTheRecord() final;
   bool IsOffTheRecord() const final;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::ResourceContext* GetResourceContext() override;
diff --git a/chrome/test/chromedriver/test/test_expectations b/chrome/test/chromedriver/test/test_expectations
index c989d26..0cc3ae1c 100644
--- a/chrome/test/chromedriver/test/test_expectations
+++ b/chrome/test/chromedriver/test/test_expectations
@@ -43,7 +43,7 @@
     'ContentEditableTest.testShouldAppendToTinyMCE',
     'ContentEditableTest.testShouldBeAbleToTypeIntoContentEditableElementWithExistingValue',
     'ContentEditableTest.appendsTextToEndOfContentEditableWithMultipleTextNodes',
-    'WindowSwitchingTest.canOpenANewWindow,'
+    'WindowSwitchingTest.canOpenANewWindow',
 ]
 
 _OS_NEGATIVE_FILTER = {}
diff --git a/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.html b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.html
new file mode 100644
index 0000000..3e3bc92
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.html
@@ -0,0 +1,7 @@
+<!--
+  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.
+-->
+<!DOCTYPE html>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.js b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.js
new file mode 100644
index 0000000..dbaab76
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/a.js
@@ -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.
+
+navigator.serviceWorker.register('sw.js').then(function() {
+  return navigator.serviceWorker.ready;
+}).then(function(registration) {
+  chrome.test.sendMessage('WORKER_STARTED');
+}).catch(function(err) {
+  chrome.test.sendMessage('REGISTRATION_FAILED');
+});
diff --git a/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/manifest.json b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/manifest.json
new file mode 100644
index 0000000..7c69b5095
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/manifest.json
@@ -0,0 +1,7 @@
+{
+  "name": "Service Worker-based background script",
+  "version": "0.1",
+  "manifest_version": 2,
+  "description": "Test registering a service worker at the root scope.",
+  "background": {"service_worker": "service_worker_background.js"}
+}
diff --git a/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/service_worker_background.js b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/service_worker_background.js
new file mode 100644
index 0000000..a09727b5
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/service_worker_background.js
@@ -0,0 +1,7 @@
+// 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.
+
+// Open a tab to the doc that includes a script that will attempt to
+// register a service worker at the root scope.
+chrome.tabs.create({url: chrome.runtime.getURL('a.html')});
diff --git a/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/sw.js b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/sw.js
new file mode 100644
index 0000000..d5d13daf
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/worker_based_background/script_root_scope/sw.js
@@ -0,0 +1,6 @@
+// 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.
+
+// This should never be executed.
+console.log('SERVICE WORKER SCRIPT IS EXECUTING!!');
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json
index 2d65685f..8fa03ef 100644
--- a/chrome/test/data/policy/policy_test_cases.json
+++ b/chrome/test/data/policy/policy_test_cases.json
@@ -698,11 +698,7 @@
   },
 
   "MediaCacheSize": {
-    "os": ["win", "mac", "linux"],
-    "test_policy": { "MediaCacheSize": 200 },
-    "pref_mappings": [
-      { "pref": "browser.media_cache_size" }
-    ]
+    "note": "This policy has been removed, see https://crbug.com/974387."
   },
 
   "DownloadRestrictions": {
diff --git a/chromecast/browser/cast_browser_context.cc b/chromecast/browser/cast_browser_context.cc
index 03d1767..34ce087d 100644
--- a/chromecast/browser/cast_browser_context.cc
+++ b/chromecast/browser/cast_browser_context.cc
@@ -93,11 +93,11 @@
 }
 #endif  // !defined(OS_ANDROID)
 
-base::FilePath CastBrowserContext::GetPath() const {
+base::FilePath CastBrowserContext::GetPath() {
   return path_;
 }
 
-bool CastBrowserContext::IsOffTheRecord() const {
+bool CastBrowserContext::IsOffTheRecord() {
   return false;
 }
 
diff --git a/chromecast/browser/cast_browser_context.h b/chromecast/browser/cast_browser_context.h
index 9d304bc..55f97b5 100644
--- a/chromecast/browser/cast_browser_context.h
+++ b/chromecast/browser/cast_browser_context.h
@@ -32,8 +32,8 @@
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
 #endif  // !defined(OS_ANDROID)
-  base::FilePath GetPath() const override;
-  bool IsOffTheRecord() const override;
+  base::FilePath GetPath() override;
+  bool IsOffTheRecord() override;
   content::ResourceContext* GetResourceContext() override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/chromecast/cast_shell_sandbox_policy b/chromecast/cast_shell_sandbox_policy
index db22c8d..2f1fa46 100644
--- a/chromecast/cast_shell_sandbox_policy
+++ b/chromecast/cast_shell_sandbox_policy
@@ -8,6 +8,7 @@
   "services": [
       "fuchsia.bluetooth.gatt.Server",
       "fuchsia.bluetooth.le.Peripheral",
+      "fuchsia.device.NameProvider",
       "fuchsia.fonts.Provider",
       "fuchsia.media.Audio",
       "fuchsia.mediacodec.CodecFactory",
diff --git a/components/about_ui/DEPS b/components/about_ui/DEPS
index 72b42ddc..28fb498 100644
--- a/components/about_ui/DEPS
+++ b/components/about_ui/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
+  "+components/about_ui/android/about_ui_jni_headers",
   "+components/grit/components_resources.h",
-  "+jni",
   "+third_party/brotli",
   "+ui/base",
 ]
diff --git a/components/about_ui/android/BUILD.gn b/components/about_ui/android/BUILD.gn
index 7e825471..3c5d221 100644
--- a/components/about_ui/android/BUILD.gn
+++ b/components/about_ui/android/BUILD.gn
@@ -7,7 +7,6 @@
   sources = [
     "java/src/org/chromium/components/aboutui/CreditUtils.java",
   ]
-  jni_package = "components/about_ui"
 }
 
 android_library("aboutui_java") {
diff --git a/components/about_ui/credit_utils.cc b/components/about_ui/credit_utils.cc
index b560f30f..3ca6bb8 100644
--- a/components/about_ui/credit_utils.cc
+++ b/components/about_ui/credit_utils.cc
@@ -13,7 +13,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/files/file.h"
-#include "jni/CreditUtils_jni.h"
+#include "components/about_ui/android/about_ui_jni_headers/CreditUtils_jni.h"
 #endif
 
 namespace about_ui {
diff --git a/components/autofill/DEPS b/components/autofill/DEPS
index b6a1545..909ce7f 100644
--- a/components/autofill/DEPS
+++ b/components/autofill/DEPS
@@ -1,8 +1,8 @@
 include_rules = [
+  "+components/autofill/android/jni_headers",
   "+components/prefs",
   "+components/strings/grit/components_strings.h",
   "+google_apis/gaia/gaia_urls.h",
-  "+jni",
   "+net",
   "+third_party/skia",
   "+third_party/zlib/google",
diff --git a/components/autofill/android/BUILD.gn b/components/autofill/android/BUILD.gn
index 2c2b8a5e..88c3ffd4 100644
--- a/components/autofill/android/BUILD.gn
+++ b/components/autofill/android/BUILD.gn
@@ -117,7 +117,6 @@
     "java/src/org/chromium/components/autofill/FormData.java",
     "java/src/org/chromium/components/autofill/FormFieldData.java",
   ]
-  jni_package = "autofill"
 }
 
 static_library("provider") {
diff --git a/components/autofill/android/autofill_provider_android.cc b/components/autofill/android/autofill_provider_android.cc
index a16cceb..238de06 100644
--- a/components/autofill/android/autofill_provider_android.cc
+++ b/components/autofill/android/autofill_provider_android.cc
@@ -10,11 +10,11 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "components/autofill/android/form_data_android.h"
+#include "components/autofill/android/jni_headers/AutofillProvider_jni.h"
 #include "components/autofill/core/browser/autofill_handler_proxy.h"
 #include "components/autofill/core/common/autofill_constants.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/AutofillProvider_jni.h"
 #include "ui/gfx/geometry/rect_f.h"
 
 using base::android::AttachCurrentThread;
diff --git a/components/autofill/android/form_data_android.cc b/components/autofill/android/form_data_android.cc
index 0c716d99..7b344ea 100644
--- a/components/autofill/android/form_data_android.cc
+++ b/components/autofill/android/form_data_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_string.h"
 #include "components/autofill/android/form_field_data_android.h"
+#include "components/autofill/android/jni_headers/FormData_jni.h"
 #include "components/autofill/core/browser/form_structure.h"
-#include "jni/FormData_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF16;
diff --git a/components/autofill/android/form_field_data_android.cc b/components/autofill/android/form_field_data_android.cc
index 24c3eae..320ec22 100644
--- a/components/autofill/android/form_field_data_android.cc
+++ b/components/autofill/android/form_field_data_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
+#include "components/autofill/android/jni_headers/FormFieldData_jni.h"
 #include "components/autofill/core/common/autofill_util.h"
-#include "jni/FormFieldData_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF16;
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index 3537956..10c206f 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -1458,13 +1458,6 @@
 }
 
 // static
-void AutofillMetrics::LogHasModifiedProfileOnCreditCardFormSubmission(
-    bool has_modified_profile) {
-  UMA_HISTOGRAM_BOOLEAN("Autofill.HasModifiedProfile.CreditCardFormSubmission",
-                        has_modified_profile);
-}
-
-// static
 void AutofillMetrics::LogNumberOfAddressesSuppressedForDisuse(
     size_t num_profiles) {
   UMA_HISTOGRAM_COUNTS_1000("Autofill.AddressesSuppressedForDisuse",
diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h
index 722b1cae..7907c550 100644
--- a/components/autofill/core/browser/autofill_metrics.h
+++ b/components/autofill/core/browser/autofill_metrics.h
@@ -1142,11 +1142,6 @@
   static void LogNumberOfProfilesAtAutofillableFormSubmission(
       size_t num_profiles);
 
-  // Log whether user modified an address profile shortly before submitting
-  // credit card form.
-  static void LogHasModifiedProfileOnCreditCardFormSubmission(
-      bool has_modified_profile);
-
   // Log the number of autofill address suggestions suppressed because they have
   // not been used for a long time. Note that these addresses are only
   // suppressed when the user has not typed any data into the field from which
diff --git a/components/autofill/core/browser/payments/credit_card_save_manager.cc b/components/autofill/core/browser/payments/credit_card_save_manager.cc
index 05520d91..f915acd2 100644
--- a/components/autofill/core/browser/payments/credit_card_save_manager.cc
+++ b/components/autofill/core/browser/payments/credit_card_save_manager.cc
@@ -18,7 +18,6 @@
 #include "base/bind_helpers.h"
 #include "base/feature_list.h"
 #include "base/metrics/histogram_functions.h"
-#include "base/metrics/histogram_macros.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece.h"
@@ -543,22 +542,16 @@
   // Reset |upload_decision_metrics_| to begin logging detected problems.
   upload_decision_metrics_ = 0;
   bool has_profile = false;
-  bool has_modified_profile = false;
 
   // First, collect all of the addresses used or modified recently.
   for (AutofillProfile* profile : personal_data_manager_->GetProfiles()) {
     has_profile = true;
-    if ((now - profile->modification_date()) < fifteen_minutes) {
-      has_modified_profile = true;
-      candidate_profiles.push_back(*profile);
-    } else if ((now - profile->use_date()) < fifteen_minutes) {
+    if ((now - profile->use_date()) < fifteen_minutes ||
+        (now - profile->modification_date()) < fifteen_minutes) {
       candidate_profiles.push_back(*profile);
     }
   }
 
-  AutofillMetrics::LogHasModifiedProfileOnCreditCardFormSubmission(
-      has_modified_profile);
-
   if (candidate_profiles.empty()) {
     upload_decision_metrics_ |=
         has_profile
@@ -640,13 +633,6 @@
   // Set up |upload_request->profiles|.
   upload_request->profiles.assign(candidate_profiles.begin(),
                                   candidate_profiles.end());
-  if (!has_modified_profile) {
-    for (const AutofillProfile& profile : candidate_profiles) {
-      UMA_HISTOGRAM_COUNTS_1000(
-          "Autofill.DaysSincePreviousUseAtSubmission.Profile",
-          (profile.use_date() - profile.previous_use_date()).InDays());
-    }
-  }
 }
 
 int CreditCardSaveManager::GetDetectedValues() const {
diff --git a/components/autofill/core/browser/payments/credit_card_save_manager_unittest.cc b/components/autofill/core/browser/payments/credit_card_save_manager_unittest.cc
index 4397bd7..0730109 100644
--- a/components/autofill/core/browser/payments/credit_card_save_manager_unittest.cc
+++ b/components/autofill/core/browser/payments/credit_card_save_manager_unittest.cc
@@ -545,13 +545,6 @@
                                  AutofillMetrics::UPLOAD_OFFERED);
   // Verify that the correct UKM was logged.
   ExpectCardUploadDecisionUkm(AutofillMetrics::UPLOAD_OFFERED);
-  // Verify the histogram entry for recent profile modification.
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.HasModifiedProfile.CreditCardFormSubmission", true, 1);
-  // Verify that UMA for "DaysSincePreviousUse" was not logged because we
-  // modified the profile.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.DaysSincePreviousUseAtSubmission.Profile", 0);
 
   // Simulate that the user has accepted the upload from the prompt.
   UserHasAcceptedUpload({});
@@ -882,13 +875,7 @@
                                  AutofillMetrics::UPLOAD_OFFERED);
   // Verify that the correct UKM was logged.
   ExpectCardUploadDecisionUkm(AutofillMetrics::UPLOAD_OFFERED);
-  // Verify the histogram entry for recent profile modification.
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.HasModifiedProfile.CreditCardFormSubmission", true, 1);
-  // Verify that UMA for "DaysSincePreviousUse" was not logged because we
-  // modified the profile.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.DaysSincePreviousUseAtSubmission.Profile", 0);
+
   histogram_tester.ExpectTotalCount(
       "Autofill.SaveCardWithFirstAndLastNameOffered.Local", 0);
   histogram_tester.ExpectTotalCount(
@@ -962,13 +949,7 @@
                                  AutofillMetrics::UPLOAD_OFFERED);
   // Verify that the correct UKM was logged.
   ExpectCardUploadDecisionUkm(AutofillMetrics::UPLOAD_OFFERED);
-  // Verify the histogram entry for recent profile modification.
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.HasModifiedProfile.CreditCardFormSubmission", true, 1);
-  // Verify that UMA for "DaysSincePreviousUse" was not logged because we
-  // modified the profile.
-  histogram_tester.ExpectTotalCount(
-      "Autofill.DaysSincePreviousUseAtSubmission.Profile", 0);
+
   histogram_tester.ExpectTotalCount(
       "Autofill.SaveCardWithFirstAndLastNameOffered.Local", 0);
   histogram_tester.ExpectTotalCount(
@@ -1535,9 +1516,6 @@
   ExpectCardUploadDecisionUkm(
       AutofillMetrics::UPLOAD_OFFERED |
       AutofillMetrics::UPLOAD_NOT_OFFERED_NO_RECENTLY_USED_ADDRESS);
-  // Verify the histogram entry for recent profile modification.
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.HasModifiedProfile.CreditCardFormSubmission", false, 1);
 }
 
 TEST_F(CreditCardSaveManagerTest,
@@ -2972,51 +2950,6 @@
 }
 #endif
 
-TEST_F(CreditCardSaveManagerTest, UploadCreditCard_LogPreviousUseDate) {
-  // Create the test clock and set the time to a specific value.
-  TestAutofillClock test_clock;
-  test_clock.SetNow(kArbitraryTime);
-
-  // Create, fill and submit an address form in order to establish a recent
-  // profile which can be selected for the upload request.
-  FormData address_form;
-  test::CreateTestAddressFormData(&address_form);
-  FormsSeen({address_form});
-  ManuallyFillAddressForm("Flo", "Master", "77401", "US", &address_form);
-  FormSubmitted(address_form);
-  const std::vector<AutofillProfile*>& profiles =
-      personal_data_.GetProfilesToSuggest();
-  ASSERT_EQ(1U, profiles.size());
-
-  // Advance the current time and simulate use of the address profile.
-  test_clock.SetNow(kMuchLaterTime);
-  profiles[0]->RecordAndLogUse();
-
-  // Set up our credit card form data.
-  FormData credit_card_form;
-  CreateTestCreditCardFormData(&credit_card_form, CreditCardFormOptions());
-  FormsSeen({credit_card_form});
-
-  // Edit the credit card form and submit.
-  credit_card_form.fields[0].value = ASCIIToUTF16("Flo Master");
-  credit_card_form.fields[1].value = ASCIIToUTF16("4111111111111111");
-  credit_card_form.fields[2].value = ASCIIToUTF16(NextMonth());
-  credit_card_form.fields[3].value = ASCIIToUTF16(NextYear());
-  credit_card_form.fields[4].value = ASCIIToUTF16("123");
-
-  base::HistogramTester histogram_tester;
-
-  FormSubmitted(credit_card_form);
-  EXPECT_FALSE(autofill_client_.ConfirmSaveCardLocallyWasCalled());
-  EXPECT_TRUE(credit_card_save_manager_->CreditCardWasUploaded());
-
-  // Verify that UMA for "DaysSincePreviousUse" is logged.
-  histogram_tester.ExpectUniqueSample(
-      "Autofill.DaysSincePreviousUseAtSubmission.Profile",
-      (kMuchLaterTime - kArbitraryTime).InDays(),
-      /*expected_count=*/1);
-}
-
 TEST_F(CreditCardSaveManagerTest, UploadCreditCard_UploadDetailsFails) {
   // Anything other than "en-US" will cause GetUploadDetails to return a failure
   // response.
diff --git a/components/bookmarks/DEPS b/components/bookmarks/DEPS
index cbf7aee..a24156a 100644
--- a/components/bookmarks/DEPS
+++ b/components/bookmarks/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/bookmarks/common/android/bookmarks_jni_headers",
   "+components/favicon_base",
   "+components/keyed_service",
   "+components/pref_registry",
@@ -6,7 +7,6 @@
   "+components/query_parser",
   "+components/strings/grit/components_strings.h",
   "+components/url_formatter",
-  "+jni",
   "+net/base",
   "+ui",
 ]
diff --git a/components/bookmarks/common/android/BUILD.gn b/components/bookmarks/common/android/BUILD.gn
index 4ac9ad97..c7f6748 100644
--- a/components/bookmarks/common/android/BUILD.gn
+++ b/components/bookmarks/common/android/BUILD.gn
@@ -26,7 +26,6 @@
 }
 
 generate_jni("bookmarks_jni_headers") {
-  jni_package = "components/bookmarks"
   sources = [
     "java/src/org/chromium/components/bookmarks/BookmarkId.java",
   ]
diff --git a/components/bookmarks/common/android/bookmark_id.cc b/components/bookmarks/common/android/bookmark_id.cc
index 8595708..3f7615ec 100644
--- a/components/bookmarks/common/android/bookmark_id.cc
+++ b/components/bookmarks/common/android/bookmark_id.cc
@@ -4,7 +4,7 @@
 
 #include "components/bookmarks/common/android/bookmark_id.h"
 
-#include "jni/BookmarkId_jni.h"
+#include "components/bookmarks/common/android/bookmarks_jni_headers/BookmarkId_jni.h"
 
 namespace bookmarks {
 namespace android {
diff --git a/components/content_capture/android/BUILD.gn b/components/content_capture/android/BUILD.gn
index e231abd..a044b90 100644
--- a/components/content_capture/android/BUILD.gn
+++ b/components/content_capture/android/BUILD.gn
@@ -41,5 +41,4 @@
     "java/src/org/chromium/components/content_capture/ContentCaptureFeatures.java",
     "java/src/org/chromium/components/content_capture/ContentCaptureReceiverManager.java",
   ]
-  jni_package = "content_capture"
 }
diff --git a/components/content_capture/android/DEPS b/components/content_capture/android/DEPS
index e63745d..9e215817 100644
--- a/components/content_capture/android/DEPS
+++ b/components/content_capture/android/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
+  "+components/content_capture/android/jni_headers",
   "+content/public/android",
   "+content/public/browser",
-  "+jni",
   "+third_party/re2",
 ]
\ No newline at end of file
diff --git a/components/content_capture/android/content_capture_controller.cc b/components/content_capture/android/content_capture_controller.cc
index 01c725a..e3f27264 100644
--- a/components/content_capture/android/content_capture_controller.cc
+++ b/components/content_capture/android/content_capture_controller.cc
@@ -7,7 +7,7 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
 #include "base/no_destructor.h"
-#include "jni/ContentCaptureController_jni.h"
+#include "components/content_capture/android/jni_headers/ContentCaptureController_jni.h"
 #include "third_party/re2/src/re2/re2.h"
 
 using base::android::AppendJavaStringArrayToStringVector;
diff --git a/components/content_capture/android/content_capture_features_android.cc b/components/content_capture/android/content_capture_features_android.cc
index 49eb276..795069e 100644
--- a/components/content_capture/android/content_capture_features_android.cc
+++ b/components/content_capture/android/content_capture_features_android.cc
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "components/content_capture/android/jni_headers/ContentCaptureFeatures_jni.h"
 #include "components/content_capture/common/content_capture_features.h"
-#include "jni/ContentCaptureFeatures_jni.h"
 
 static jboolean JNI_ContentCaptureFeatures_IsEnabled(JNIEnv* env) {
   return content_capture::features::IsContentCaptureEnabled();
diff --git a/components/content_capture/android/content_capture_receiver_manager_android.cc b/components/content_capture/android/content_capture_receiver_manager_android.cc
index bd5c043..826a138 100644
--- a/components/content_capture/android/content_capture_receiver_manager_android.cc
+++ b/components/content_capture/android/content_capture_receiver_manager_android.cc
@@ -10,9 +10,9 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "components/content_capture/android/content_capture_controller.h"
+#include "components/content_capture/android/jni_headers/ContentCaptureData_jni.h"
+#include "components/content_capture/android/jni_headers/ContentCaptureReceiverManager_jni.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/ContentCaptureData_jni.h"
-#include "jni/ContentCaptureReceiverManager_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertUTF16ToJavaString;
diff --git a/components/crash/android/BUILD.gn b/components/crash/android/BUILD.gn
index c61e671..53c02f3 100644
--- a/components/crash/android/BUILD.gn
+++ b/components/crash/android/BUILD.gn
@@ -12,7 +12,6 @@
 
 generate_jni("jni_headers") {
   sources = _jni_sources
-  jni_package = "crash"
 }
 
 java_cpp_enum("java_enums_srcjar") {
@@ -58,7 +57,6 @@
 
 generate_jni("java_handler_jni_headers") {
   sources = _java_handler_jni_sources
-  jni_package = "crashpad"
 }
 
 android_library("handler_java") {
diff --git a/components/crash/android/DEPS b/components/crash/android/DEPS
index fb4880ea..56e7e235 100644
--- a/components/crash/android/DEPS
+++ b/components/crash/android/DEPS
@@ -1,4 +1,4 @@
 include_rules = [
-  "+jni",
+  "+components/crash/android/jni_headers",
   "+third_party/crashpad",
 ]
diff --git a/components/crash/android/crash_keys_android.cc b/components/crash/android/crash_keys_android.cc
index 64e5b5bd..26932a81 100644
--- a/components/crash/android/crash_keys_android.cc
+++ b/components/crash/android/crash_keys_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
+#include "components/crash/android/jni_headers/CrashKeys_jni.h"
 #include "components/crash/core/common/crash_key.h"
-#include "jni/CrashKeys_jni.h"
 
 namespace {
 
diff --git a/components/crash/android/crashpad_main.cc b/components/crash/android/crashpad_main.cc
index ce3d888..6747c27 100644
--- a/components/crash/android/crashpad_main.cc
+++ b/components/crash/android/crashpad_main.cc
@@ -4,7 +4,7 @@
 
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
-#include "jni/CrashpadMain_jni.h"
+#include "components/crash/android/java_handler_jni_headers/CrashpadMain_jni.h"
 #include "third_party/crashpad/crashpad/client/client_argv_handling.h"
 #include "third_party/crashpad/crashpad/handler/handler_main.h"
 
diff --git a/components/crash/content/app/DEPS b/components/crash/content/app/DEPS
index 63e5b6f..3a48be8 100644
--- a/components/crash/content/app/DEPS
+++ b/components/crash/content/app/DEPS
@@ -1,11 +1,11 @@
 include_rules = [
   "+sandbox",
 
+  "+components/crash/android/jni_headers",
   "+components/browser_watcher/stability_report_user_stream_data_source.h",
   "+components/gwp_asan/crash_handler/crash_handler.h",
   "+content/public/common/content_descriptors.h",
   "+content/public/common/result_codes.h",
-  "+jni",
   "+third_party/crashpad",
   "+third_party/lss/linux_syscall_support.h",
 ]
diff --git a/components/crash/content/app/crashpad_android.cc b/components/crash/content/app/crashpad_android.cc
index 9551b90b..991120a 100644
--- a/components/crash/content/app/crashpad_android.cc
+++ b/components/crash/content/app/crashpad_android.cc
@@ -31,9 +31,9 @@
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
+#include "components/crash/android/jni_headers/PackagePaths_jni.h"
 #include "components/crash/content/app/crash_reporter_client.h"
 #include "content/public/common/content_descriptors.h"
-#include "jni/PackagePaths_jni.h"
 #include "sandbox/linux/services/syscall_wrappers.h"
 #include "third_party/crashpad/crashpad/client/annotation.h"
 #include "third_party/crashpad/crashpad/client/client_argv_handling.h"
diff --git a/components/crash/content/browser/DEPS b/components/crash/content/browser/DEPS
index 7f2b333..77854b4 100644
--- a/components/crash/content/browser/DEPS
+++ b/components/crash/content/browser/DEPS
@@ -1,8 +1,8 @@
 include_rules = [
+  "+components/crash/android/jni_headers",
   "+content/public/browser",
   "+content/public/common",
   "+content/public/test",
-  "+jni",
   "+mojo/public/cpp/bindings",
   "+third_party/blink/public/mojom/crash/crash_memory_metrics_reporter.mojom.h",
   "+third_party/blink/public/common/oom_intervention"
diff --git a/components/crash/content/browser/child_process_crash_observer_android.cc b/components/crash/content/browser/child_process_crash_observer_android.cc
index 33451d4e..814f704 100644
--- a/components/crash/content/browser/child_process_crash_observer_android.cc
+++ b/components/crash/content/browser/child_process_crash_observer_android.cc
@@ -9,8 +9,8 @@
 #include "base/task/post_task.h"
 #include "base/task/task_traits.h"
 #include "base/threading/scoped_blocking_call.h"
+#include "components/crash/android/jni_headers/ChildProcessCrashObserver_jni.h"
 #include "components/crash/content/browser/crash_metrics_reporter_android.h"
-#include "jni/ChildProcessCrashObserver_jni.h"
 
 namespace crash_reporter {
 
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn
index 14bbc793..369127589 100644
--- a/components/cronet/android/BUILD.gn
+++ b/components/cronet/android/BUILD.gn
@@ -43,7 +43,6 @@
     "java/src/org/chromium/net/impl/CronetUrlRequest.java",
     "java/src/org/chromium/net/impl/CronetUrlRequestContext.java",
   ]
-  jni_package = "cronet"
 }
 
 generate_jni_registration("cronet_jni_registration") {
@@ -706,7 +705,6 @@
       "test/src/org/chromium/net/QuicTestServer.java",
       "test/src/org/chromium/net/TestUploadDataStreamHandler.java",
     ]
-    jni_package = "cronet_tests"
   }
 
   shared_library("cronet_tests") {
diff --git a/components/cronet/android/cronet_bidirectional_stream_adapter.cc b/components/cronet/android/cronet_bidirectional_stream_adapter.cc
index bebd65b..99d8c6b1 100644
--- a/components/cronet/android/cronet_bidirectional_stream_adapter.cc
+++ b/components/cronet/android/cronet_bidirectional_stream_adapter.cc
@@ -12,11 +12,11 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/strings/string_number_conversions.h"
+#include "components/cronet/android/cronet_jni_headers/CronetBidirectionalStream_jni.h"
 #include "components/cronet/android/cronet_url_request_context_adapter.h"
 #include "components/cronet/android/io_buffer_with_byte_buffer.h"
 #include "components/cronet/android/url_request_error.h"
 #include "components/cronet/metrics_util.h"
-#include "jni/CronetBidirectionalStream_jni.h"
 #include "net/base/http_user_agent_settings.h"
 #include "net/base/net_errors.h"
 #include "net/base/request_priority.h"
diff --git a/components/cronet/android/cronet_library_loader.cc b/components/cronet/android/cronet_library_loader.cc
index d4516d7..4eba05c 100644
--- a/components/cronet/android/cronet_library_loader.cc
+++ b/components/cronet/android/cronet_library_loader.cc
@@ -24,9 +24,9 @@
 #include "base/task/thread_pool/thread_pool.h"
 #include "build/build_config.h"
 #include "components/cronet/android/buildflags.h"
+#include "components/cronet/android/cronet_jni_headers/CronetLibraryLoader_jni.h"
 #include "components/cronet/cronet_global_state.h"
 #include "components/cronet/version.h"
-#include "jni/CronetLibraryLoader_jni.h"
 #include "net/android/network_change_notifier_factory_android.h"
 #include "net/base/network_change_notifier.h"
 #include "net/proxy_resolution/proxy_config_service_android.h"
diff --git a/components/cronet/android/cronet_upload_data_stream_adapter.cc b/components/cronet/android/cronet_upload_data_stream_adapter.cc
index 20ab4413..21a137e 100644
--- a/components/cronet/android/cronet_upload_data_stream_adapter.cc
+++ b/components/cronet/android/cronet_upload_data_stream_adapter.cc
@@ -14,9 +14,9 @@
 #include "base/logging.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
+#include "components/cronet/android/cronet_jni_headers/CronetUploadDataStream_jni.h"
 #include "components/cronet/android/cronet_url_request_adapter.h"
 #include "components/cronet/android/io_buffer_with_byte_buffer.h"
-#include "jni/CronetUploadDataStream_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/components/cronet/android/cronet_url_request_adapter.cc b/components/cronet/android/cronet_url_request_adapter.cc
index 543d58b..baceb916 100644
--- a/components/cronet/android/cronet_url_request_adapter.cc
+++ b/components/cronet/android/cronet_url_request_adapter.cc
@@ -11,11 +11,11 @@
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/logging.h"
+#include "components/cronet/android/cronet_jni_headers/CronetUrlRequest_jni.h"
 #include "components/cronet/android/cronet_url_request_context_adapter.h"
 #include "components/cronet/android/io_buffer_with_byte_buffer.h"
 #include "components/cronet/android/url_request_error.h"
 #include "components/cronet/metrics_util.h"
-#include "jni/CronetUrlRequest_jni.h"
 #include "net/base/load_flags.h"
 #include "net/base/load_states.h"
 #include "net/base/net_errors.h"
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc
index 5845e48..9c48aa9 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.cc
+++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -34,12 +34,12 @@
 #include "base/time/time.h"
 #include "base/values.h"
 #include "components/cronet/android/buildflags.h"
+#include "components/cronet/android/cronet_jni_headers/CronetUrlRequestContext_jni.h"
 #include "components/cronet/android/cronet_library_loader.h"
 #include "components/cronet/cronet_prefs_manager.h"
 #include "components/cronet/histogram_manager.h"
 #include "components/cronet/host_cache_persistence_manager.h"
 #include "components/cronet/url_request_context_config.h"
-#include "jni/CronetUrlRequestContext_jni.h"
 #include "net/base/load_flags.h"
 #include "net/base/logging_network_change_observer.h"
 #include "net/base/net_errors.h"
diff --git a/components/cronet/android/test/cronet_test_util.cc b/components/cronet/android/test/cronet_test_util.cc
index 09d2467a..693a4140 100644
--- a/components/cronet/android/test/cronet_test_util.cc
+++ b/components/cronet/android/test/cronet_test_util.cc
@@ -9,11 +9,11 @@
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
 #include "base/threading/thread_task_runner_handle.h"
+#include "components/cronet/android/cronet_tests_jni_headers/CronetTestUtil_jni.h"
 #include "components/cronet/android/cronet_url_request_adapter.h"
 #include "components/cronet/android/cronet_url_request_context_adapter.h"
 #include "components/cronet/cronet_url_request.h"
 #include "components/cronet/cronet_url_request_context.h"
-#include "jni/CronetTestUtil_jni.h"
 #include "net/socket/socket_test_util.h"
 #include "net/url_request/url_request.h"
 
diff --git a/components/cronet/android/test/cronet_url_request_context_config_test.cc b/components/cronet/android/test/cronet_url_request_context_config_test.cc
index 9ebb249..0c387d01 100644
--- a/components/cronet/android/test/cronet_url_request_context_config_test.cc
+++ b/components/cronet/android/test/cronet_url_request_context_config_test.cc
@@ -10,9 +10,9 @@
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/logging.h"
+#include "components/cronet/android/cronet_tests_jni_headers/CronetUrlRequestContextTest_jni.h"
 #include "components/cronet/url_request_context_config.h"
 #include "components/cronet/version.h"
-#include "jni/CronetUrlRequestContextTest_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/components/cronet/android/test/cronet_url_request_test.cc b/components/cronet/android/test/cronet_url_request_test.cc
index 0ac958c0..b4aa1b3 100644
--- a/components/cronet/android/test/cronet_url_request_test.cc
+++ b/components/cronet/android/test/cronet_url_request_test.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 "jni/CronetUrlRequestTest_jni.h"
+#include "components/cronet/android/cronet_tests_jni_headers/CronetUrlRequestTest_jni.h"
 #include "net/base/load_flags.h"
 
 using base::android::JavaParamRef;
diff --git a/components/cronet/android/test/experimental_options_test.cc b/components/cronet/android/test/experimental_options_test.cc
index 47afa2b6..2b5fd7f 100644
--- a/components/cronet/android/test/experimental_options_test.cc
+++ b/components/cronet/android/test/experimental_options_test.cc
@@ -9,8 +9,8 @@
 #include "base/android/scoped_java_ref.h"
 #include "base/bind.h"
 #include "base/time/time.h"
+#include "components/cronet/android/cronet_tests_jni_headers/ExperimentalOptionsTest_jni.h"
 #include "components/cronet/android/test/cronet_test_util.h"
-#include "jni/ExperimentalOptionsTest_jni.h"
 #include "net/base/address_family.h"
 #include "net/base/net_errors.h"
 #include "net/dns/host_cache.h"
diff --git a/components/cronet/android/test/mock_cert_verifier.cc b/components/cronet/android/test/mock_cert_verifier.cc
index 5200d85a..e66c531 100644
--- a/components/cronet/android/test/mock_cert_verifier.cc
+++ b/components/cronet/android/test/mock_cert_verifier.cc
@@ -9,8 +9,8 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/test/test_support_android.h"
+#include "components/cronet/android/cronet_tests_jni_headers/MockCertVerifier_jni.h"
 #include "crypto/sha2.h"
-#include "jni/MockCertVerifier_jni.h"
 #include "net/base/net_errors.h"
 #include "net/cert/asn1_util.h"
 #include "net/cert/cert_verifier.h"
diff --git a/components/cronet/android/test/mock_url_request_job_factory.cc b/components/cronet/android/test/mock_url_request_job_factory.cc
index 0890e2e..25eb3de8 100644
--- a/components/cronet/android/test/mock_url_request_job_factory.cc
+++ b/components/cronet/android/test/mock_url_request_job_factory.cc
@@ -5,8 +5,8 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/bind.h"
+#include "components/cronet/android/cronet_tests_jni_headers/MockUrlRequestJobFactory_jni.h"
 #include "components/cronet/android/test/cronet_test_util.h"
-#include "jni/MockUrlRequestJobFactory_jni.h"
 #include "net/test/url_request/ssl_certificate_error_job.h"
 #include "net/test/url_request/url_request_failed_job.h"
 #include "net/test/url_request/url_request_hanging_read_job.h"
diff --git a/components/cronet/android/test/native_test_server.cc b/components/cronet/android/test/native_test_server.cc
index 0095065..4ba2774 100644
--- a/components/cronet/android/test/native_test_server.cc
+++ b/components/cronet/android/test/native_test_server.cc
@@ -10,8 +10,8 @@
 #include "base/android/jni_string.h"
 #include "base/files/file_path.h"
 #include "base/test/test_support_android.h"
+#include "components/cronet/android/cronet_tests_jni_headers/NativeTestServer_jni.h"
 #include "components/cronet/test/test_server.h"
-#include "jni/NativeTestServer_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/cronet/android/test/quic_test_server.cc b/components/cronet/android/test/quic_test_server.cc
index 0a90567..09ad721 100644
--- a/components/cronet/android/test/quic_test_server.cc
+++ b/components/cronet/android/test/quic_test_server.cc
@@ -11,8 +11,8 @@
 #include "base/message_loop/message_loop.h"
 #include "base/test/test_support_android.h"
 #include "base/threading/thread.h"
+#include "components/cronet/android/cronet_tests_jni_headers/QuicTestServer_jni.h"
 #include "components/cronet/android/test/cronet_test_util.h"
-#include "jni/QuicTestServer_jni.h"
 #include "net/base/ip_address.h"
 #include "net/base/ip_endpoint.h"
 #include "net/quic/crypto/proof_source_chromium.h"
diff --git a/components/cronet/android/test/test_upload_data_stream_handler.cc b/components/cronet/android/test/test_upload_data_stream_handler.cc
index 39a3496..2b226257 100644
--- a/components/cronet/android/test/test_upload_data_stream_handler.cc
+++ b/components/cronet/android/test/test_upload_data_stream_handler.cc
@@ -11,8 +11,8 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/bind.h"
+#include "components/cronet/android/cronet_tests_jni_headers/TestUploadDataStreamHandler_jni.h"
 #include "components/cronet/android/test/cronet_test_util.h"
-#include "jni/TestUploadDataStreamHandler_jni.h"
 #include "net/base/net_errors.h"
 #include "net/log/net_log_with_source.h"
 
diff --git a/components/dom_distiller/DEPS b/components/dom_distiller/DEPS
index 53c2a23..ea653ead 100644
--- a/components/dom_distiller/DEPS
+++ b/components/dom_distiller/DEPS
@@ -9,7 +9,6 @@
   "+components/sync_preferences",
   "+components/variations",
   "+google", # For third_party/protobuf.
-  "+jni",
   "+third_party/dom_distiller_js",
   "+third_party/re2",
   "+net/base",
diff --git a/components/dom_distiller/content/browser/android/BUILD.gn b/components/dom_distiller/content/browser/android/BUILD.gn
index fb8d612..1cc66a9 100644
--- a/components/dom_distiller/content/browser/android/BUILD.gn
+++ b/components/dom_distiller/content/browser/android/BUILD.gn
@@ -17,5 +17,4 @@
   sources = [
     "java/src/org/chromium/components/dom_distiller/content/DistillablePageUtils.java",
   ]
-  jni_package = "dom_distiller_content"
 }
diff --git a/components/dom_distiller/content/browser/distillable_page_utils_android.cc b/components/dom_distiller/content/browser/distillable_page_utils_android.cc
index fe8f0da..51d246a 100644
--- a/components/dom_distiller/content/browser/distillable_page_utils_android.cc
+++ b/components/dom_distiller/content/browser/distillable_page_utils_android.cc
@@ -6,9 +6,9 @@
 #include "base/location.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
+#include "components/dom_distiller/content/browser/android/jni_headers/DistillablePageUtils_jni.h"
 #include "components/dom_distiller/content/browser/distillable_page_utils.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/DistillablePageUtils_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::JavaRef;
diff --git a/components/dom_distiller/core/BUILD.gn b/components/dom_distiller/core/BUILD.gn
index 38a5928..4f1315a5 100644
--- a/components/dom_distiller/core/BUILD.gn
+++ b/components/dom_distiller/core/BUILD.gn
@@ -170,7 +170,6 @@
       "android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java",
       "android/java/src/org/chromium/components/dom_distiller/core/DomDistillerUrlUtils.java",
     ]
-    jni_package = "dom_distiller_core"
   }
 
   java_cpp_enum("distiller_type_java") {
diff --git a/components/dom_distiller/core/distilled_page_prefs_android.cc b/components/dom_distiller/core/distilled_page_prefs_android.cc
index ebe2cab..22a597a4 100644
--- a/components/dom_distiller/core/distilled_page_prefs_android.cc
+++ b/components/dom_distiller/core/distilled_page_prefs_android.cc
@@ -6,7 +6,7 @@
 
 #include "components/dom_distiller/core/distilled_page_prefs.h"
 #include "components/dom_distiller/core/dom_distiller_service.h"
-#include "jni/DistilledPagePrefs_jni.h"
+#include "components/dom_distiller/core/jni_headers/DistilledPagePrefs_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/components/dom_distiller/core/dom_distiller_service_android.cc b/components/dom_distiller/core/dom_distiller_service_android.cc
index 37e7185..f8b1e8a 100644
--- a/components/dom_distiller/core/dom_distiller_service_android.cc
+++ b/components/dom_distiller/core/dom_distiller_service_android.cc
@@ -10,7 +10,7 @@
 #include "components/dom_distiller/core/distilled_page_prefs.h"
 #include "components/dom_distiller/core/distilled_page_prefs_android.h"
 #include "components/dom_distiller/core/dom_distiller_service.h"
-#include "jni/DomDistillerService_jni.h"
+#include "components/dom_distiller/core/jni_headers/DomDistillerService_jni.h"
 
 using base::android::ConvertUTF8ToJavaString;
 using base::android::JavaParamRef;
diff --git a/components/dom_distiller/core/url_utils_android.cc b/components/dom_distiller/core/url_utils_android.cc
index cadcd110..548fa8c 100644
--- a/components/dom_distiller/core/url_utils_android.cc
+++ b/components/dom_distiller/core/url_utils_android.cc
@@ -5,9 +5,9 @@
 #include <string>
 
 #include "base/android/jni_string.h"
+#include "components/dom_distiller/core/jni_headers/DomDistillerUrlUtils_jni.h"
 #include "components/dom_distiller/core/url_constants.h"
 #include "components/dom_distiller/core/url_utils.h"
-#include "jni/DomDistillerUrlUtils_jni.h"
 #include "net/base/url_util.h"
 #include "url/gurl.h"
 
diff --git a/components/download/internal/background_service/BUILD.gn b/components/download/internal/background_service/BUILD.gn
index 83b9120..6c1ade7 100644
--- a/components/download/internal/background_service/BUILD.gn
+++ b/components/download/internal/background_service/BUILD.gn
@@ -125,7 +125,6 @@
     sources = [
       "android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java",
     ]
-    jni_package = "components/download/internal/background_service"
   }
 }
 
diff --git a/components/download/internal/background_service/DEPS b/components/download/internal/background_service/DEPS
index 9500a4e..6cce219 100644
--- a/components/download/internal/background_service/DEPS
+++ b/components/download/internal/background_service/DEPS
@@ -1,9 +1,9 @@
 include_rules = [
   "-components/download/content",
   "-content",
+  "+components/download/internal/background_service/jni_headers",
   "+components/leveldb_proto",
   "+base",
-  "+jni",
   "+net",
   "+services/network/public",
   "+services/network/test",
diff --git a/components/download/internal/background_service/android/battery_status_listener_android.cc b/components/download/internal/background_service/android/battery_status_listener_android.cc
index 33e6641..25778aa 100644
--- a/components/download/internal/background_service/android/battery_status_listener_android.cc
+++ b/components/download/internal/background_service/android/battery_status_listener_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_android.h"
 #include "base/trace_event/trace_event.h"
-#include "jni/BatteryStatusListenerAndroid_jni.h"
+#include "components/download/internal/background_service/jni_headers/BatteryStatusListenerAndroid_jni.h"
 
 namespace download {
 
diff --git a/components/download/internal/common/BUILD.gn b/components/download/internal/common/BUILD.gn
index 285a7545..63db61a 100644
--- a/components/download/internal/common/BUILD.gn
+++ b/components/download/internal/common/BUILD.gn
@@ -112,7 +112,6 @@
     sources = [
       "android/java/src/org/chromium/components/download/DownloadCollectionBridge.java",
     ]
-    jni_package = "components/download/internal/common"
   }
 }
 
diff --git a/components/download/internal/common/DEPS b/components/download/internal/common/DEPS
index aa97c2f..6ad5fdf 100644
--- a/components/download/internal/common/DEPS
+++ b/components/download/internal/common/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "-content",
   "+components/download/downloader/in_progress",
+  "+components/download/internal/common/jni_headers",
   "+components/download/public/common",
   "+components/download/quarantine",
   "+components/filename_generation/filename_generation.h",
@@ -8,7 +9,6 @@
   "+components/services/quarantine/public/cpp/quarantine_features_win.h",
   "+components/ukm/test_ukm_recorder.h",
   "+crypto",
-  "+jni",
   "+mojo/public/c/system",
   "+mojo/public/cpp/bindings",
   "+net/base/filename_util.h",
diff --git a/components/download/internal/common/android/download_collection_bridge.cc b/components/download/internal/common/android/download_collection_bridge.cc
index ae075552..1b4c1e9 100644
--- a/components/download/internal/common/android/download_collection_bridge.cc
+++ b/components/download/internal/common/android/download_collection_bridge.cc
@@ -11,9 +11,9 @@
 #include "base/files/file_util.h"
 #include "base/metrics/field_trial_params.h"
 #include "base/strings/string_number_conversions.h"
+#include "components/download/internal/common/jni_headers/DownloadCollectionBridge_jni.h"
 #include "components/download/public/common/download_features.h"
 #include "components/download/public/common/download_interrupt_reasons.h"
-#include "jni/DownloadCollectionBridge_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::ConvertUTF16ToJavaString;
diff --git a/components/download/network/BUILD.gn b/components/download/network/BUILD.gn
index c3719e8..9b3e61bc 100644
--- a/components/download/network/BUILD.gn
+++ b/components/download/network/BUILD.gn
@@ -53,6 +53,5 @@
     sources = [
       "android/java/src/org/chromium/components/download/NetworkStatusListenerAndroid.java",
     ]
-    jni_package = "components/download/network"
   }
 }
diff --git a/components/download/network/DEPS b/components/download/network/DEPS
index b0597c63..e0d62f0f 100644
--- a/components/download/network/DEPS
+++ b/components/download/network/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "-content",
-  "+jni",
+  "+components/download/network/jni_headers",
   "+net",
   "+services/network/public",
 ]
diff --git a/components/download/network/android/network_status_listener_android.cc b/components/download/network/android/network_status_listener_android.cc
index 505d81b..7d13f07 100644
--- a/components/download/network/android/network_status_listener_android.cc
+++ b/components/download/network/android/network_status_listener_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_android.h"
 #include "base/trace_event/trace_event.h"
-#include "jni/NetworkStatusListenerAndroid_jni.h"
+#include "components/download/network/jni_headers/NetworkStatusListenerAndroid_jni.h"
 
 namespace download {
 
diff --git a/components/embedder_support/android/BUILD.gn b/components/embedder_support/android/BUILD.gn
index 5d300e8..56a6382 100644
--- a/components/embedder_support/android/BUILD.gn
+++ b/components/embedder_support/android/BUILD.gn
@@ -52,7 +52,6 @@
   sources = [
     "java/src/org/chromium/components/embedder_support/view/ContentViewRenderView.java",
   ]
-  jni_package = "view"
 }
 
 java_strings_grd("web_contents_delegate_strings_grd") {
@@ -171,5 +170,4 @@
     "java/src/org/chromium/components/embedder_support/delegate/ColorChooserAndroid.java",
     "java/src/org/chromium/components/embedder_support/delegate/WebContentsDelegateAndroid.java",
   ]
-  jni_package = "web_contents_delegate_android"
 }
diff --git a/components/embedder_support/android/DEPS b/components/embedder_support/android/DEPS
index 0e8e2ccd..e62abf7c 100644
--- a/components/embedder_support/android/DEPS
+++ b/components/embedder_support/android/DEPS
@@ -3,8 +3,8 @@
   "+content/public/android/java/src/org/chromium/content_public",
 
   "+cc",
+  "+components/embedder_support/android/web_contents_delegate_jni_headers",
   "+content/public/browser",
-  "+jni",
   "+ui/android",
   "+ui/base",
   "+ui/gfx"
diff --git a/components/embedder_support/android/delegate/DEPS b/components/embedder_support/android/delegate/DEPS
index 6de2a9d2..2d68883 100644
--- a/components/embedder_support/android/delegate/DEPS
+++ b/components/embedder_support/android/delegate/DEPS
@@ -1,7 +1,7 @@
 include_rules = [
+  "+components/embedder_support/android/web_contents_delegate_jni_headers",
   "+content/public/browser",
   "+content/public/common",
-  "+jni",
   "+third_party/blink/public/mojom",
   "+ui/android",
   "+ui/base",
diff --git a/components/embedder_support/android/delegate/color_chooser_android.cc b/components/embedder_support/android/delegate/color_chooser_android.cc
index c6cf78d4..d3e3a99 100644
--- a/components/embedder_support/android/delegate/color_chooser_android.cc
+++ b/components/embedder_support/android/delegate/color_chooser_android.cc
@@ -8,8 +8,8 @@
 
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
+#include "components/embedder_support/android/web_contents_delegate_jni_headers/ColorChooserAndroid_jni.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/ColorChooserAndroid_jni.h"
 #include "ui/android/window_android.h"
 
 using base::android::ConvertUTF8ToJavaString;
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
index 08a213b..3d791ce 100644
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
@@ -10,6 +10,7 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "components/embedder_support/android/delegate/color_chooser_android.h"
+#include "components/embedder_support/android/web_contents_delegate_jni_headers/WebContentsDelegateAndroid_jni.h"
 #include "content/public/browser/color_chooser.h"
 #include "content/public/browser/global_request_id.h"
 #include "content/public/browser/invalidate_type.h"
@@ -20,7 +21,6 @@
 #include "content/public/browser/web_contents.h"
 #include "content/public/common/referrer.h"
 #include "content/public/common/resource_request_body_android.h"
-#include "jni/WebContentsDelegateAndroid_jni.h"
 #include "ui/base/window_open_disposition.h"
 #include "ui/gfx/geometry/rect.h"
 #include "url/gurl.h"
diff --git a/components/embedder_support/android/view/content_view_render_view.cc b/components/embedder_support/android/view/content_view_render_view.cc
index 45439986..0f4a53c 100644
--- a/components/embedder_support/android/view/content_view_render_view.cc
+++ b/components/embedder_support/android/view/content_view_render_view.cc
@@ -14,9 +14,9 @@
 #include "base/bind.h"
 #include "base/lazy_instance.h"
 #include "cc/layers/layer.h"
+#include "components/embedder_support/android/view_jni_headers/ContentViewRenderView_jni.h"
 #include "content/public/browser/android/compositor.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/ContentViewRenderView_jni.h"
 #include "ui/android/view_android.h"
 #include "ui/android/window_android.h"
 #include "ui/gfx/android/java_bitmap.h"
diff --git a/components/feature_engagement/DEPS b/components/feature_engagement/DEPS
index 42e3380d..f25c147 100644
--- a/components/feature_engagement/DEPS
+++ b/components/feature_engagement/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "-content",
-  "+jni",
+  "+components/feature_engagement/internal/jni_headers",
   "+components/feature_engagement/features.h",
   "+components/flags_ui",
   "+components/keyed_service",
diff --git a/components/feature_engagement/internal/BUILD.gn b/components/feature_engagement/internal/BUILD.gn
index 65da056..e68d0fd2 100644
--- a/components/feature_engagement/internal/BUILD.gn
+++ b/components/feature_engagement/internal/BUILD.gn
@@ -148,6 +148,5 @@
     sources = [
       "android/java/src/org/chromium/components/feature_engagement/internal/TrackerImpl.java",
     ]
-    jni_package = "components/feature_engagement/internal"
   }
 }
diff --git a/components/feature_engagement/internal/android/tracker_impl_android.cc b/components/feature_engagement/internal/android/tracker_impl_android.cc
index b6e39d7..f44a5ac 100644
--- a/components/feature_engagement/internal/android/tracker_impl_android.cc
+++ b/components/feature_engagement/internal/android/tracker_impl_android.cc
@@ -15,9 +15,9 @@
 #include "base/bind.h"
 #include "base/feature_list.h"
 #include "base/memory/ptr_util.h"
+#include "components/feature_engagement/internal/jni_headers/TrackerImpl_jni.h"
 #include "components/feature_engagement/public/feature_list.h"
 #include "components/feature_engagement/public/tracker.h"
-#include "jni/TrackerImpl_jni.h"
 
 namespace feature_engagement {
 
diff --git a/components/gcm_driver/DEPS b/components/gcm_driver/DEPS
index 3c1f0ae..d89782b6 100644
--- a/components/gcm_driver/DEPS
+++ b/components/gcm_driver/DEPS
@@ -16,7 +16,6 @@
   "+google_apis/gaia/gaia_oauth_client.h",
   "+google_apis/gaia/google_service_auth_error.h",
   "+google_apis/gcm",
-  "+jni",
   "+net",
   "+services/identity/public",
   "+services/network/public/cpp",
diff --git a/components/gcm_driver/android/BUILD.gn b/components/gcm_driver/android/BUILD.gn
index 9617228b..81aa2f8 100644
--- a/components/gcm_driver/android/BUILD.gn
+++ b/components/gcm_driver/android/BUILD.gn
@@ -8,7 +8,6 @@
   sources = [
     "java/src/org/chromium/components/gcm_driver/GCMDriver.java",
   ]
-  jni_package = "components/gcm_driver"
 }
 
 android_library("gcm_driver_java") {
diff --git a/components/gcm_driver/gcm_driver_android.cc b/components/gcm_driver/gcm_driver_android.cc
index 39930ba6..93016ae 100644
--- a/components/gcm_driver/gcm_driver_android.cc
+++ b/components/gcm_driver/gcm_driver_android.cc
@@ -13,7 +13,7 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "jni/GCMDriver_jni.h"
+#include "components/gcm_driver/android/jni_headers/GCMDriver_jni.h"
 
 using base::android::AppendJavaStringArrayToStringVector;
 using base::android::AttachCurrentThread;
diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
index ca773e2f..e5b2483 100644
--- a/components/gcm_driver/instance_id/android/BUILD.gn
+++ b/components/gcm_driver/instance_id/android/BUILD.gn
@@ -8,14 +8,12 @@
   sources = [
     "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java",
   ]
-  jni_package = "components/gcm_driver/instance_id"
 }
 
 generate_jni("test_support_jni_headers") {
   sources = [
     "javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java",
   ]
-  jni_package = "components/gcm_driver/instance_id"
 }
 
 android_library("instance_id_driver_java") {
diff --git a/components/gcm_driver/instance_id/instance_id_android.cc b/components/gcm_driver/instance_id/instance_id_android.cc
index b2ba5857..65126a9 100644
--- a/components/gcm_driver/instance_id/instance_id_android.cc
+++ b/components/gcm_driver/instance_id/instance_id_android.cc
@@ -16,7 +16,7 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/time.h"
-#include "jni/InstanceIDBridge_jni.h"
+#include "components/gcm_driver/instance_id/android/jni_headers/InstanceIDBridge_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.cc b/components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.cc
index 8c5c51c..585e83d 100644
--- a/components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.cc
+++ b/components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.cc
@@ -5,7 +5,7 @@
 #include "components/gcm_driver/instance_id/scoped_use_fake_instance_id_android.h"
 
 #include "base/android/jni_android.h"
-#include "jni/FakeInstanceIDWithSubtype_jni.h"
+#include "components/gcm_driver/instance_id/android/test_support_jni_headers/FakeInstanceIDWithSubtype_jni.h"
 
 using base::android::AttachCurrentThread;
 
diff --git a/components/heap_profiling/BUILD.gn b/components/heap_profiling/BUILD.gn
index 892f5a6..7650cc81 100644
--- a/components/heap_profiling/BUILD.gn
+++ b/components/heap_profiling/BUILD.gn
@@ -27,7 +27,6 @@
     sources = [
       "javatests/src/org/chromium/components/heap_profiling/HeapProfilingTestShim.java",
     ]
-    jni_package = "components_heap_profiling"
   }
 
   # This library must be included by the apk_under_test in order for the JNI
diff --git a/components/heap_profiling/DEPS b/components/heap_profiling/DEPS
index 24fd5c3..8d9b92b 100644
--- a/components/heap_profiling/DEPS
+++ b/components/heap_profiling/DEPS
@@ -1,7 +1,6 @@
 include_rules = [
   "+components/services/heap_profiling/public",
   "+content/public",
-  "+jni",
   "+services/resource_coordinator/public/cpp",
   "+services/service_manager/public/cpp",
 ]
diff --git a/components/heap_profiling/heap_profiling_test_shim.cc b/components/heap_profiling/heap_profiling_test_shim.cc
index 5c952f0..a4ff7aff 100644
--- a/components/heap_profiling/heap_profiling_test_shim.cc
+++ b/components/heap_profiling/heap_profiling_test_shim.cc
@@ -5,9 +5,9 @@
 #include "components/heap_profiling/heap_profiling_test_shim.h"
 
 #include "base/android/jni_string.h"
+#include "components/heap_profiling/jni_headers/HeapProfilingTestShim_jni.h"
 #include "components/heap_profiling/test_driver.h"
 #include "components/services/heap_profiling/public/cpp/settings.h"
-#include "jni/HeapProfilingTestShim_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/image_fetcher/OWNERS b/components/image_fetcher/OWNERS
index 860cdf7..1626bf2 100644
--- a/components/image_fetcher/OWNERS
+++ b/components/image_fetcher/OWNERS
@@ -1,6 +1,7 @@
 fgorski@chromium.org
 markusheintz@chromium.org
 treib@chromium.org
+skym@chromium.org
 wylieb@chromium.org
 
 # COMPONENT: Internals>Images
diff --git a/components/invalidation/impl/BUILD.gn b/components/invalidation/impl/BUILD.gn
index 71acb09..25a26fb 100644
--- a/components/invalidation/impl/BUILD.gn
+++ b/components/invalidation/impl/BUILD.gn
@@ -302,6 +302,5 @@
     sources = [
       "android/java/src/org/chromium/components/invalidation/InvalidationService.java",
     ]
-    jni_package = "components/invalidation"
   }
 }
diff --git a/components/invalidation/impl/DEPS b/components/invalidation/impl/DEPS
index 63ce600..7a208ee 100644
--- a/components/invalidation/impl/DEPS
+++ b/components/invalidation/impl/DEPS
@@ -8,7 +8,6 @@
 
   "+google_apis/gaia",
   "+google_apis/gcm",
-  "+jni",
   "+jingle/glue/network_service_config_test_util.h",
   "+jingle/notifier",
   "+net/base/backoff_entry.h",
diff --git a/components/invalidation/impl/invalidation_service_android.cc b/components/invalidation/impl/invalidation_service_android.cc
index 4f63b2c..80a839c 100644
--- a/components/invalidation/impl/invalidation_service_android.cc
+++ b/components/invalidation/impl/invalidation_service_android.cc
@@ -8,9 +8,9 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/callback.h"
+#include "components/invalidation/impl/jni_headers/InvalidationService_jni.h"
 #include "components/invalidation/public/object_id_invalidation_map.h"
 #include "google/cacheinvalidation/types.pb.h"
-#include "jni/InvalidationService_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::ConvertUTF8ToJavaString;
diff --git a/components/keyed_service/content/browser_context_dependency_manager.cc b/components/keyed_service/content/browser_context_dependency_manager.cc
index e5a255e..d1599e38 100644
--- a/components/keyed_service/content/browser_context_dependency_manager.cc
+++ b/components/keyed_service/content/browser_context_dependency_manager.cc
@@ -90,9 +90,8 @@
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
           kDumpBrowserContextDependencyGraphFlag)) {
     base::FilePath dot_file =
-        static_cast<const content::BrowserContext*>(context)
-            ->GetPath()
-            .AppendASCII("browser-context-dependencies.dot");
+        static_cast<content::BrowserContext*>(context)->GetPath().AppendASCII(
+            "browser-context-dependencies.dot");
     DumpDependenciesAsGraphviz("BrowserContext", dot_file);
   }
 }
diff --git a/components/language/android/BUILD.gn b/components/language/android/BUILD.gn
index e92bf7a..40ccf58 100644
--- a/components/language/android/BUILD.gn
+++ b/components/language/android/BUILD.gn
@@ -10,7 +10,6 @@
     "java/src/org/chromium/components/language/AndroidLanguageMetricsBridge.java",
     "java/src/org/chromium/components/language/GeoLanguageProviderBridge.java",
   ]
-  jni_package = "components/language"
 }
 
 source_set("language_bridge") {
diff --git a/components/language/android/DEPS b/components/language/android/DEPS
index aa281cf..771bfcf2 100644
--- a/components/language/android/DEPS
+++ b/components/language/android/DEPS
@@ -1,4 +1,3 @@
 include_rules = [
   "+components/language/content",
-  "+jni",
 ]
diff --git a/components/language/android/android_language_metrics_bridge.cc b/components/language/android/android_language_metrics_bridge.cc
index d1aa8461..f3b6610e2 100644
--- a/components/language/android/android_language_metrics_bridge.cc
+++ b/components/language/android/android_language_metrics_bridge.cc
@@ -5,7 +5,7 @@
 #include "base/android/jni_string.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/metrics_hashes.h"
-#include "jni/AndroidLanguageMetricsBridge_jni.h"
+#include "components/language/android/jni_headers/AndroidLanguageMetricsBridge_jni.h"
 
 const char kTranslateExplicitLanguageAskLanguageAdded[] =
     "Translate.ExplicitLanguageAsk.LanguageAdded";
diff --git a/components/language/android/geo_language_provider_bridge.cc b/components/language/android/geo_language_provider_bridge.cc
index d25c7914..bd12c9d 100644
--- a/components/language/android/geo_language_provider_bridge.cc
+++ b/components/language/android/geo_language_provider_bridge.cc
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include "base/android/jni_string.h"
+#include "components/language/android/jni_headers/GeoLanguageProviderBridge_jni.h"
 #include "components/language/content/browser/geo_language_provider.h"
-#include "jni/GeoLanguageProviderBridge_jni.h"
 
 static void JNI_GeoLanguageProviderBridge_GetCurrentGeoLanguages(
     JNIEnv* env,
diff --git a/components/media_message_center/media_notification_view.cc b/components/media_message_center/media_notification_view.cc
index db27cbc..acc84ee 100644
--- a/components/media_message_center/media_notification_view.cc
+++ b/components/media_message_center/media_notification_view.cc
@@ -126,11 +126,11 @@
 
   header_row->SetAppName(default_app_name_);
   header_row->ClearAppIcon();
-  header_row->SetProperty(views::kMarginsKey,
-                          new gfx::Insets(kMediaNotificationHeaderTopInset,
-                                          kMediaNotificationHeaderInset,
-                                          kMediaNotificationHeaderInset,
-                                          kMediaNotificationHeaderRightInset));
+  header_row->SetProperty(
+      views::kMarginsKey,
+      gfx::Insets(kMediaNotificationHeaderTopInset,
+                  kMediaNotificationHeaderInset, kMediaNotificationHeaderInset,
+                  kMediaNotificationHeaderRightInset));
   header_row_ = AddChildView(std::move(header_row));
 
   // |main_row_| holds the main content of the notification.
diff --git a/components/minidump_uploader/BUILD.gn b/components/minidump_uploader/BUILD.gn
index 0d7b0ee..8589ab29 100644
--- a/components/minidump_uploader/BUILD.gn
+++ b/components/minidump_uploader/BUILD.gn
@@ -8,7 +8,6 @@
   sources = [
     "android/java/src/org/chromium/components/minidump_uploader/CrashReportMimeWriter.java",
   ]
-  jni_package = "components/minidump_uploader"
 }
 
 static_library("minidump_uploader") {
diff --git a/components/minidump_uploader/DEPS b/components/minidump_uploader/DEPS
index fb4880ea..b1646378 100644
--- a/components/minidump_uploader/DEPS
+++ b/components/minidump_uploader/DEPS
@@ -1,4 +1,4 @@
 include_rules = [
-  "+jni",
+  "+components/minidump_uploader/minidump_uploader_jni_headers",
   "+third_party/crashpad",
 ]
diff --git a/components/minidump_uploader/rewrite_minidumps_as_mimes.cc b/components/minidump_uploader/rewrite_minidumps_as_mimes.cc
index 937ea77..ba57a46 100644
--- a/components/minidump_uploader/rewrite_minidumps_as_mimes.cc
+++ b/components/minidump_uploader/rewrite_minidumps_as_mimes.cc
@@ -11,7 +11,7 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/strings/stringprintf.h"
 #include "build/build_config.h"
-#include "jni/CrashReportMimeWriter_jni.h"
+#include "components/minidump_uploader/minidump_uploader_jni_headers/CrashReportMimeWriter_jni.h"
 #include "third_party/crashpad/crashpad/handler/minidump_to_upload_parameters.h"
 #include "third_party/crashpad/crashpad/snapshot/exception_snapshot.h"
 #include "third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.h"
diff --git a/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
index 828c74c..00b1712 100644
--- a/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
+++ b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
@@ -77,8 +77,9 @@
     private static final int INSTALL_STATUS_INTERNAL_ERROR = 18;
     private static final int INSTALL_STATUS_UNKNOWN_SPLITINSTALL_ERROR = 19;
     private static final int INSTALL_STATUS_UNKNOWN_REQUEST_ERROR = 20;
+    private static final int INSTALL_STATUS_NO_SPLITCOMPAT = 21;
     // Keep this one at the end and increment appropriately when adding new status.
-    private static final int INSTALL_STATUS_COUNT = 21;
+    private static final int INSTALL_STATUS_COUNT = 22;
 
     // FeatureModuleAvailabilityStatus defined in //tools/metrics/histograms/enums.xml.
     // These values are persisted to logs. Entries should not be renumbered and numeric values
@@ -181,7 +182,6 @@
         Log.i(TAG, "Status for modules '%s' updated to %d", state.moduleNames(), state.status());
         switch (state.status()) {
             case SplitInstallSessionStatus.DOWNLOADING:
-            case SplitInstallSessionStatus.DOWNLOADED:
             case SplitInstallSessionStatus.INSTALLING:
             case SplitInstallSessionStatus.INSTALLED:
                 for (String name : state.moduleNames()) {
@@ -192,11 +192,19 @@
                     finish(true, state.moduleNames(), INSTALL_STATUS_SUCCESS);
                 }
                 break;
+            // DOWNLOADED only gets sent if SplitCompat is not enabled. That's an error.
+            // SplitCompat should always be enabled.
+            case SplitInstallSessionStatus.DOWNLOADED:
             case SplitInstallSessionStatus.CANCELED:
             case SplitInstallSessionStatus.FAILED:
-                int status = state.status() == SplitInstallSessionStatus.CANCELED
-                        ? INSTALL_STATUS_CANCELLATION
-                        : getHistogramCode(state.errorCode());
+                int status;
+                if (state.status() == SplitInstallSessionStatus.DOWNLOADED) {
+                    status = INSTALL_STATUS_NO_SPLITCOMPAT;
+                } else if (state.status() == SplitInstallSessionStatus.CANCELED) {
+                    status = INSTALL_STATUS_CANCELLATION;
+                } else {
+                    status = getHistogramCode(state.errorCode());
+                }
                 Log.e(TAG, "Failed to install modules '%s': error code %s", state.moduleNames(),
                         status);
                 finish(false, state.moduleNames(), status);
@@ -281,9 +289,7 @@
                 SplitInstallSessionStatus.INSTALLED);
         recordInstallTime(moduleName, ".PendingDownload", SplitInstallSessionStatus.UNKNOWN,
                 SplitInstallSessionStatus.DOWNLOADING);
-        recordInstallTime(moduleName, ".Downloading", SplitInstallSessionStatus.DOWNLOADING,
-                SplitInstallSessionStatus.DOWNLOADED);
-        recordInstallTime(moduleName, ".PendingInstall", SplitInstallSessionStatus.DOWNLOADED,
+        recordInstallTime(moduleName, ".Download", SplitInstallSessionStatus.DOWNLOADING,
                 SplitInstallSessionStatus.INSTALLING);
         recordInstallTime(moduleName, ".Installing", SplitInstallSessionStatus.INSTALLING,
                 SplitInstallSessionStatus.INSTALLED);
diff --git a/components/navigation_interception/BUILD.gn b/components/navigation_interception/BUILD.gn
index 16b17d6..1f2adab 100644
--- a/components/navigation_interception/BUILD.gn
+++ b/components/navigation_interception/BUILD.gn
@@ -39,7 +39,6 @@
       "android/java/src/org/chromium/components/navigation_interception/InterceptNavigationDelegate.java",
       "android/java/src/org/chromium/components/navigation_interception/NavigationParams.java",
     ]
-    jni_package = "navigation_interception"
   }
 }
 
diff --git a/components/navigation_interception/DEPS b/components/navigation_interception/DEPS
index b8335f2..536c8282 100644
--- a/components/navigation_interception/DEPS
+++ b/components/navigation_interception/DEPS
@@ -1,5 +1,5 @@
 include_rules = [
-  "+jni",
+  "+components/navigation_interception/jni_headers",
   "+ui/base",
 
   "+content/public/browser",
diff --git a/components/navigation_interception/intercept_navigation_delegate.cc b/components/navigation_interception/intercept_navigation_delegate.cc
index 3939a36..b5f0536 100644
--- a/components/navigation_interception/intercept_navigation_delegate.cc
+++ b/components/navigation_interception/intercept_navigation_delegate.cc
@@ -10,6 +10,7 @@
 #include "base/android/jni_string.h"
 #include "base/bind.h"
 #include "base/callback.h"
+#include "components/navigation_interception/jni_headers/InterceptNavigationDelegate_jni.h"
 #include "components/navigation_interception/navigation_params_android.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/navigation_throttle.h"
@@ -17,7 +18,6 @@
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/InterceptNavigationDelegate_jni.h"
 #include "url/gurl.h"
 
 using base::android::ConvertUTF8ToJavaString;
diff --git a/components/navigation_interception/navigation_params_android.cc b/components/navigation_interception/navigation_params_android.cc
index 39b7e3bc..6b6b6c5 100644
--- a/components/navigation_interception/navigation_params_android.cc
+++ b/components/navigation_interception/navigation_params_android.cc
@@ -5,7 +5,7 @@
 #include "components/navigation_interception/navigation_params_android.h"
 
 #include "base/android/jni_string.h"
-#include "jni/NavigationParams_jni.h"
+#include "components/navigation_interception/jni_headers/NavigationParams_jni.h"
 
 using base::android::ConvertUTF8ToJavaString;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/net_log/chrome_net_log.cc b/components/net_log/chrome_net_log.cc
index 661e1bd..ee4890ab 100644
--- a/components/net_log/chrome_net_log.cc
+++ b/components/net_log/chrome_net_log.cc
@@ -4,44 +4,16 @@
 
 #include "components/net_log/chrome_net_log.h"
 
-#include <memory>
-#include <utility>
-
-#include "base/callback.h"
 #include "base/command_line.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/system/sys_info.h"
 #include "base/values.h"
-#include "build/build_config.h"
 #include "components/version_info/version_info.h"
-#include "net/log/file_net_log_observer.h"
 #include "net/log/net_log_util.h"
 
 namespace net_log {
 
-ChromeNetLog::ChromeNetLog() {}
-
-ChromeNetLog::~ChromeNetLog() {
-  ClearFileNetLogObserver();
-}
-
-void ChromeNetLog::StartWritingToFile(
-    const base::FilePath& path,
-    net::NetLogCaptureMode capture_mode,
-    const base::CommandLine::StringType& command_line_string,
-    const std::string& channel_string) {
-  DCHECK(!path.empty());
-
-  // TODO(739485): The log file does not contain about:flags data.
-  file_net_log_observer_ = net::FileNetLogObserver::CreateUnbounded(
-      path, GetConstants(command_line_string, channel_string));
-
-  file_net_log_observer_->StartObserving(this, capture_mode);
-}
-
-// static
-std::unique_ptr<base::Value> ChromeNetLog::GetConstants(
+std::unique_ptr<base::Value> GetConstantsForNetLog(
     const base::CommandLine::StringType& command_line_string,
     const std::string& channel_string) {
   std::unique_ptr<base::DictionaryValue> constants_dict =
@@ -49,13 +21,13 @@
   DCHECK(constants_dict);
 
   auto platform_dict =
-      GetPlatformConstants(command_line_string, channel_string);
+      GetPlatformConstantsForNetLog(command_line_string, channel_string);
   if (platform_dict)
     constants_dict->MergeDictionary(platform_dict.get());
   return constants_dict;
 }
 
-std::unique_ptr<base::DictionaryValue> ChromeNetLog::GetPlatformConstants(
+std::unique_ptr<base::DictionaryValue> GetPlatformConstantsForNetLog(
     const base::CommandLine::StringType& command_line_string,
     const std::string& channel_string) {
   auto constants_dict = std::make_unique<base::DictionaryValue>();
@@ -83,29 +55,4 @@
   return constants_dict;
 }
 
-void ChromeNetLog::ShutDownBeforeThreadPool() {
-  // TODO(eroman): Stop in-progress net_export_file_writer_ or delete its files?
-
-  ClearFileNetLogObserver();
-}
-
-void ChromeNetLog::ClearFileNetLogObserver() {
-  if (!file_net_log_observer_)
-    return;
-
-  // TODO(739487): The log file does not contain any polled data.
-  //
-  // TODO(eroman): FileNetLogObserver::StopObserving() posts to the file task
-  // runner to finish writing the log file. Despite that sequenced task runner
-  // being marked BLOCK_SHUTDOWN, those tasks are not actually running.
-  //
-  // This isn't a big deal when using the unbounded logger since the log
-  // loading code can handle such truncated logs. But this will need fixing
-  // if switching to log formats that are not so versatile (also if adding
-  // polled data).
-  file_net_log_observer_->StopObserving(nullptr /*polled_data*/,
-                                        base::Closure());
-  file_net_log_observer_.reset();
-}
-
 }  // namespace net_log
diff --git a/components/net_log/chrome_net_log.h b/components/net_log/chrome_net_log.h
index 82cbd8f..8c1052ce2 100644
--- a/components/net_log/chrome_net_log.h
+++ b/components/net_log/chrome_net_log.h
@@ -10,76 +10,35 @@
 
 #include "base/command_line.h"
 #include "base/macros.h"
-#include "net/log/net_log.h"
 
 namespace base {
-class FilePath;
+class DictionaryValue;
 class Value;
 }
 
-namespace net {
-class FileNetLogObserver;
-}
-
 namespace net_log {
 
-// ChromeNetLog is an implementation of NetLog that manages common observers
-// (for --log-net-log, chrome://net-export/, tracing), as well as acting as the
-// entry point for other consumers.
+// Returns all the constants to include in NetLog files. This includes both
+// platform-specific details (GetPlatformConstantsForNetLog()) as well as the
+// basic src/net constants (net::GetNetConstants()) for things like symbolic
+// names of error codes.
 //
-// Threading:
-//   * The methods on net::NetLog are threadsafe
-//   * The methods defined by ChromeNetLog must be sequenced.
-class ChromeNetLog : public net::NetLog {
- public:
-  ChromeNetLog();
-  ~ChromeNetLog() override;
+// Safe to call on any thread.
+std::unique_ptr<base::Value> GetConstantsForNetLog(
+    const base::CommandLine::StringType& command_line_string,
+    const std::string& channel_string);
 
-  // Starts streaming the NetLog events to a file on disk. This will continue
-  // until the application shuts down.
-  // * |path| - destination file path of the log file.
-  // * |capture_mode| - capture mode for event granularity.
-  void StartWritingToFile(
-      const base::FilePath& path,
-      net::NetLogCaptureMode capture_mode,
-      const base::CommandLine::StringType& command_line_string,
-      const std::string& channel_string);
-
-  // Returns a Value containing constants needed to load a log file.
-  // Safe to call on any thread.
-  static std::unique_ptr<base::Value> GetConstants(
-      const base::CommandLine::StringType& command_line_string,
-      const std::string& channel_string);
-
-  // Returns only platform-specific constants. This doesn't include the net/
-  // baseline, only Chrome-specific platform information.
-  static std::unique_ptr<base::DictionaryValue> GetPlatformConstants(
-      const base::CommandLine::StringType& command_line_string,
-      const std::string& channel_string);
-
-  // Notify the ChromeNetLog that things are shutting-down.
-  //
-  // If ChromeNetLog does not outlive the ThreadPool, there is no need to
-  // call this.
-  //
-  // However, if it can outlive the ThreadPool, this should be called
-  // before the ThreadPool is shutdown. This allows for any file writers
-  // using BLOCK_SHUTDOWN to finish posting their writes.
-  //
-  // Not calling this is not a fatal error, however may result in an incomplete
-  // NetLog file being written to disk.
-  void ShutDownBeforeThreadPool();
-
- private:
-  // Deletes file_net_log_observer_.
-  void ClearFileNetLogObserver();
-
-  // This observer handles writing NetLogs specified via StartWritingToFile()
-  // (In Chrome this corresponds to the --log-net-log command line).
-  std::unique_ptr<net::FileNetLogObserver> file_net_log_observer_;
-
-  DISALLOW_COPY_AND_ASSIGN(ChromeNetLog);
-};
+// Returns constants to include in NetLog files for debugging purposes, which
+// includes information such as:
+//
+//  * The version and build of Chrome
+//  * The command line arguments Chrome was launched with
+//  * The operating system version
+//
+//  Safe to call on any thread.
+std::unique_ptr<base::DictionaryValue> GetPlatformConstantsForNetLog(
+    const base::CommandLine::StringType& command_line_string,
+    const std::string& channel_string);
 
 }  // namespace net_log
 
diff --git a/components/net_log/net_export_file_writer.cc b/components/net_log/net_export_file_writer.cc
index 462818e..81e0d164 100644
--- a/components/net_log/net_export_file_writer.cc
+++ b/components/net_log/net_export_file_writer.cc
@@ -150,7 +150,7 @@
 
   network_context->CreateNetLogExporter(mojo::MakeRequest(&net_log_exporter_));
   base::Value custom_constants = base::Value::FromUniquePtrValue(
-      ChromeNetLog::GetPlatformConstants(command_line_string, channel_string));
+      GetPlatformConstantsForNetLog(command_line_string, channel_string));
 
   net_log_exporter_.set_connection_error_handler(base::BindOnce(
       &NetExportFileWriter::OnConnectionError, base::Unretained(this)));
diff --git a/components/net_log/net_export_file_writer.h b/components/net_log/net_export_file_writer.h
index 925524b9..986d410 100644
--- a/components/net_log/net_export_file_writer.h
+++ b/components/net_log/net_export_file_writer.h
@@ -35,8 +35,6 @@
 
 namespace net_log {
 
-class ChromeNetLog;
-
 // NetExportFileWriter is used exclusively as a support class for
 // chrome://net-export/. There's a single instance created globally that acts as
 // the interface to all NetExportMessageHandlers which can tell it to start or
@@ -151,7 +149,6 @@
   void SetDefaultLogBaseDirectoryGetterForTest(const DirectoryGetter& getter);
 
  private:
-  friend class ChromeNetLog;
   friend class NetExportFileWriterTest;
 
   // The possible logging states of NetExportFileWriter.
diff --git a/components/offline_items_collection/core/BUILD.gn b/components/offline_items_collection/core/BUILD.gn
index b0dcbf6..ff894d59 100644
--- a/components/offline_items_collection/core/BUILD.gn
+++ b/components/offline_items_collection/core/BUILD.gn
@@ -109,8 +109,6 @@
       "android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemShareInfoBridge.java",
       "android/java/src/org/chromium/components/offline_items_collection/bridges/OfflineItemVisualsBridge.java",
     ]
-
-    jni_package = "components/offline_items_collection/core/android"
   }
 
   java_cpp_enum("jni_enums") {
diff --git a/components/offline_items_collection/core/DEPS b/components/offline_items_collection/core/DEPS
index 38d6d22e..f0950da 100644
--- a/components/offline_items_collection/core/DEPS
+++ b/components/offline_items_collection/core/DEPS
@@ -2,7 +2,6 @@
   "+base",
   "+components/keyed_service",
   "+components/offline_pages",
-  "+jni",
   "+testing",
   "+ui/gfx",
   "+url",
diff --git a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
index c27fed15..b19e2eeb 100644
--- a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
@@ -15,9 +15,9 @@
 #include "components/offline_items_collection/core/android/offline_item_bridge.h"
 #include "components/offline_items_collection/core/android/offline_item_share_info_bridge.h"
 #include "components/offline_items_collection/core/android/offline_item_visuals_bridge.h"
+#include "components/offline_items_collection/core/jni_headers/OfflineContentAggregatorBridge_jni.h"
 #include "components/offline_items_collection/core/offline_item.h"
 #include "components/offline_items_collection/core/throttled_offline_content_provider.h"
-#include "jni/OfflineContentAggregatorBridge_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/components/offline_items_collection/core/android/offline_item_bridge.cc b/components/offline_items_collection/core/android/offline_item_bridge.cc
index 8823e60..b2181622 100644
--- a/components/offline_items_collection/core/android/offline_item_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_item_bridge.cc
@@ -5,7 +5,7 @@
 #include "components/offline_items_collection/core/android/offline_item_bridge.h"
 
 #include "base/android/jni_string.h"
-#include "jni/OfflineItemBridge_jni.h"
+#include "components/offline_items_collection/core/jni_headers/OfflineItemBridge_jni.h"
 
 using base::android::ConvertUTF8ToJavaString;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/offline_items_collection/core/android/offline_item_share_info_bridge.cc b/components/offline_items_collection/core/android/offline_item_share_info_bridge.cc
index c46b4a4..8ae4eba 100644
--- a/components/offline_items_collection/core/android/offline_item_share_info_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_item_share_info_bridge.cc
@@ -5,8 +5,8 @@
 #include "components/offline_items_collection/core/android/offline_item_share_info_bridge.h"
 
 #include "base/android/jni_string.h"
+#include "components/offline_items_collection/core/jni_headers/OfflineItemShareInfoBridge_jni.h"
 #include "components/offline_items_collection/core/offline_item.h"
-#include "jni/OfflineItemShareInfoBridge_jni.h"
 
 using base::android::ConvertUTF8ToJavaString;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/offline_items_collection/core/android/offline_item_visuals_bridge.cc b/components/offline_items_collection/core/android/offline_item_visuals_bridge.cc
index 20d58080..36123b7a 100644
--- a/components/offline_items_collection/core/android/offline_item_visuals_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_item_visuals_bridge.cc
@@ -4,8 +4,8 @@
 
 #include "components/offline_items_collection/core/android/offline_item_visuals_bridge.h"
 
+#include "components/offline_items_collection/core/jni_headers/OfflineItemVisualsBridge_jni.h"
 #include "components/offline_items_collection/core/offline_item.h"
-#include "jni/OfflineItemVisualsBridge_jni.h"
 #include "ui/gfx/android/java_bitmap.h"
 #include "ui/gfx/image/image.h"
 
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn
index 923b7f5..bfa679a 100644
--- a/components/omnibox/browser/BUILD.gn
+++ b/components/omnibox/browser/BUILD.gn
@@ -287,7 +287,6 @@
     sources = [
       "android/java/src/org/chromium/components/omnibox/SuggestionAnswer.java",
     ]
-    jni_package = "components/omnibox/browser"
   }
 }
 
diff --git a/components/omnibox/browser/DEPS b/components/omnibox/browser/DEPS
index cbd5f470..1b73dd33 100644
--- a/components/omnibox/browser/DEPS
+++ b/components/omnibox/browser/DEPS
@@ -26,7 +26,6 @@
   "+components/vector_icons",
   "+content/public/browser",
   "+extensions/common/constants.h",
-  "+jni",
   "+net",
   "+services/network/public/cpp",
   "+services/network/test",
diff --git a/components/omnibox/browser/suggestion_answer.cc b/components/omnibox/browser/suggestion_answer.cc
index a0c9049a..7192e42e 100644
--- a/components/omnibox/browser/suggestion_answer.cc
+++ b/components/omnibox/browser/suggestion_answer.cc
@@ -21,7 +21,7 @@
 
 #ifdef OS_ANDROID
 #include "base/android/jni_string.h"
-#include "jni/SuggestionAnswer_jni.h"
+#include "components/omnibox/browser/jni_headers/SuggestionAnswer_jni.h"
 
 using base::android::ScopedJavaLocalRef;
 #endif
diff --git a/components/payments/content/android/BUILD.gn b/components/payments/content/android/BUILD.gn
index fdef5ff..fad769a 100644
--- a/components/payments/content/android/BUILD.gn
+++ b/components/payments/content/android/BUILD.gn
@@ -45,7 +45,6 @@
     "java/src/org/chromium/components/payments/PaymentValidator.java",
     "java/src/org/chromium/components/payments/UrlUtil.java",
   ]
-  jni_package = "payments"
 }
 
 android_library("java") {
diff --git a/components/payments/content/android/DEPS b/components/payments/content/android/DEPS
index 64dd245..c81c188 100644
--- a/components/payments/content/android/DEPS
+++ b/components/payments/content/android/DEPS
@@ -1,4 +1,4 @@
 include_rules = [
-  "+jni",
+  "+components/payments/content/android/jni_headers",
   "+services/network/public/cpp",
 ]
diff --git a/components/payments/content/android/currency_formatter_android.cc b/components/payments/content/android/currency_formatter_android.cc
index a1c4efa..4572f0c 100644
--- a/components/payments/content/android/currency_formatter_android.cc
+++ b/components/payments/content/android/currency_formatter_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_string.h"
 #include "base/strings/string16.h"
+#include "components/payments/content/android/jni_headers/CurrencyFormatter_jni.h"
 #include "components/payments/core/currency_formatter.h"
-#include "jni/CurrencyFormatter_jni.h"
 
 namespace payments {
 namespace {
diff --git a/components/payments/content/android/origin_security_checker_android.cc b/components/payments/content/android/origin_security_checker_android.cc
index a435fa8c..07487f20 100644
--- a/components/payments/content/android/origin_security_checker_android.cc
+++ b/components/payments/content/android/origin_security_checker_android.cc
@@ -4,8 +4,8 @@
 
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
+#include "components/payments/content/android/jni_headers/OriginSecurityChecker_jni.h"
 #include "content/public/common/origin_util.h"
-#include "jni/OriginSecurityChecker_jni.h"
 #include "url/gurl.h"
 
 namespace payments {
diff --git a/components/payments/content/android/payment_handler_host.cc b/components/payments/content/android/payment_handler_host.cc
index 60cec60..155ee61 100644
--- a/components/payments/content/android/payment_handler_host.cc
+++ b/components/payments/content/android/payment_handler_host.cc
@@ -7,7 +7,7 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "components/payments/content/android/byte_buffer_helper.h"
-#include "jni/PaymentHandlerHost_jni.h"
+#include "components/payments/content/android/jni_headers/PaymentHandlerHost_jni.h"
 #include "third_party/blink/public/mojom/payments/payment_handler_host.mojom.h"
 
 namespace payments {
diff --git a/components/payments/content/android/payment_manifest_downloader_android.cc b/components/payments/content/android/payment_manifest_downloader_android.cc
index 9c64a430..9aa99568 100644
--- a/components/payments/content/android/payment_manifest_downloader_android.cc
+++ b/components/payments/content/android/payment_manifest_downloader_android.cc
@@ -9,11 +9,11 @@
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/bind.h"
+#include "components/payments/content/android/jni_headers/PaymentManifestDownloader_jni.h"
 #include "components/payments/content/developer_console_logger.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/storage_partition.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/PaymentManifestDownloader_jni.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "url/gurl.h"
 
diff --git a/components/payments/content/android/payment_manifest_parser_android.cc b/components/payments/content/android/payment_manifest_parser_android.cc
index 790e879..63f7f935 100644
--- a/components/payments/content/android/payment_manifest_parser_android.cc
+++ b/components/payments/content/android/payment_manifest_parser_android.cc
@@ -15,10 +15,10 @@
 #include "base/callback.h"
 #include "base/logging.h"
 #include "base/numerics/safe_conversions.h"
+#include "components/payments/content/android/jni_headers/PaymentManifestParser_jni.h"
 #include "components/payments/content/developer_console_logger.h"
 #include "components/payments/core/error_logger.h"
 #include "content/public/browser/web_contents.h"
-#include "jni/PaymentManifestParser_jni.h"
 #include "url/gurl.h"
 
 namespace payments {
diff --git a/components/payments/content/android/payment_validator_android.cc b/components/payments/content/android/payment_validator_android.cc
index 2000801..1e2cef5 100644
--- a/components/payments/content/android/payment_validator_android.cc
+++ b/components/payments/content/android/payment_validator_android.cc
@@ -11,11 +11,11 @@
 
 #include "base/android/jni_android.h"
 #include "components/payments/content/android/byte_buffer_helper.h"
+#include "components/payments/content/android/jni_headers/PaymentValidator_jni.h"
 #include "components/payments/content/payment_request_converter.h"
 #include "components/payments/core/payment_details.h"
 #include "components/payments/core/payment_details_validation.h"
 #include "components/payments/core/payments_validators.h"
-#include "jni/PaymentValidator_jni.h"
 #include "third_party/blink/public/mojom/payments/payment_request.mojom.h"
 
 namespace payments {
diff --git a/components/payments/content/android/url_util.cc b/components/payments/content/android/url_util.cc
index 84b0e0c8..f0f56d99 100644
--- a/components/payments/content/android/url_util.cc
+++ b/components/payments/content/android/url_util.cc
@@ -5,7 +5,7 @@
 #include "components/payments/core/url_util.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
-#include "jni/UrlUtil_jni.h"
+#include "components/payments/content/android/jni_headers/UrlUtil_jni.h"
 #include "url/gurl.h"
 
 namespace payments {
diff --git a/components/policy/android/BUILD.gn b/components/policy/android/BUILD.gn
index 6042c4210..fc58cd7 100644
--- a/components/policy/android/BUILD.gn
+++ b/components/policy/android/BUILD.gn
@@ -38,7 +38,6 @@
 generate_jni("jni_headers") {
   visibility = [ "//components/policy/*" ]
   sources = _jni_sources
-  jni_package = "policy"
 }
 
 junit_binary("components_policy_junit_tests") {
diff --git a/components/policy/core/browser/android/DEPS b/components/policy/core/browser/android/DEPS
index c80012b5..8e5f7d57 100644
--- a/components/policy/core/browser/android/DEPS
+++ b/components/policy/core/browser/android/DEPS
@@ -1,3 +1,3 @@
 include_rules = [
-  "+jni",
+  "+components/policy/android/jni_headers",
 ]
diff --git a/components/policy/core/browser/android/android_combined_policy_provider.cc b/components/policy/core/browser/android/android_combined_policy_provider.cc
index 313f9a0..316a8ef5 100644
--- a/components/policy/core/browser/android/android_combined_policy_provider.cc
+++ b/components/policy/core/browser/android/android_combined_policy_provider.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
+#include "components/policy/android/jni_headers/CombinedPolicyProvider_jni.h"
 #include "components/policy/core/browser/android/policy_converter.h"
-#include "jni/CombinedPolicyProvider_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::JavaParamRef;
diff --git a/components/policy/core/browser/android/policy_converter.cc b/components/policy/core/browser/android/policy_converter.cc
index 63e5eb3c..d503d17 100644
--- a/components/policy/core/browser/android/policy_converter.cc
+++ b/components/policy/core/browser/android/policy_converter.cc
@@ -15,12 +15,12 @@
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
+#include "components/policy/android/jni_headers/PolicyConverter_jni.h"
 #include "components/policy/core/common/policy_bundle.h"
 #include "components/policy/core/common/policy_map.h"
 #include "components/policy/core/common/policy_namespace.h"
 #include "components/policy/core/common/policy_types.h"
 #include "components/policy/core/common/schema.h"
-#include "jni/PolicyConverter_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::JavaRef;
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json
index ae9af427..79305a6 100644
--- a/components/policy/resources/policy_templates.json
+++ b/components/policy/resources/policy_templates.json
@@ -1336,7 +1336,8 @@
       'name': 'Http09OnNonDefaultPortsEnabled',
       'type': 'main',
       'schema': { 'type': 'boolean' },
-      'supported_on': ['chrome.*:54-', 'chrome_os:54-'],
+      'supported_on': ['chrome.*:54-77', 'chrome_os:54-77'],
+      'deprecated': True,
       'features': {
         'dynamic_refresh': False,
         'per_profile': False,
@@ -1345,7 +1346,9 @@
       'id': 345,
       'caption': '''Enable HTTP/0.9 support on non-default ports''',
       'tags': [],
-      'desc': '''This policy enables HTTP/0.9 on ports other than 80 for HTTP and 443 for HTTPS.
+      'desc': '''This policy is deprecated, and slated for removal in Chrome 78, with no replacement.
+
+      This policy enables HTTP/0.9 on ports other than 80 for HTTP and 443 for HTTPS.
 
       This policy is disabled by default, and if enabled, leaves users open to the security issue https://crbug.com/600352.
 
@@ -2826,7 +2829,7 @@
       'name': 'MediaCacheSize',
       'type': 'int',
       'schema': { 'type': 'integer' },
-      'supported_on': ['chrome.*:17-'],
+      'supported_on': ['chrome.*:17-71'],
       'features': {
         'dynamic_refresh': False,
         'per_profile': False,
diff --git a/components/safe_browsing/android/BUILD.gn b/components/safe_browsing/android/BUILD.gn
index 6d51566..7dc7e8e 100644
--- a/components/safe_browsing/android/BUILD.gn
+++ b/components/safe_browsing/android/BUILD.gn
@@ -20,7 +20,6 @@
   sources = [
     "java/src/org/chromium/components/safe_browsing/SafeBrowsingApiBridge.java",
   ]
-  jni_package = "components/safe_browsing/android"
 }
 
 # This target is for the mobile version.
diff --git a/components/safe_browsing/android/DEPS b/components/safe_browsing/android/DEPS
index f56bb485..39a20c7 100644
--- a/components/safe_browsing/android/DEPS
+++ b/components/safe_browsing/android/DEPS
@@ -1,5 +1,4 @@
 include_rules = [
   "+components/variations",
   "+content/public/test",
-  "+jni",
 ]
diff --git a/components/safe_browsing/android/remote_database_manager.cc b/components/safe_browsing/android/remote_database_manager.cc
index 44c2ba5c..7b004773 100644
--- a/components/safe_browsing/android/remote_database_manager.cc
+++ b/components/safe_browsing/android/remote_database_manager.cc
@@ -236,6 +236,15 @@
   return true;
 }
 
+AsyncMatch
+RemoteSafeBrowsingDatabaseManager::CheckUrlForHighConfidenceAllowlist(
+    const GURL& url,
+    Client* client) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  NOTREACHED();
+  return AsyncMatch::NO_MATCH;
+}
+
 bool RemoteSafeBrowsingDatabaseManager::CheckUrlForSubresourceFilter(
     const GURL& url,
     Client* client) {
diff --git a/components/safe_browsing/android/remote_database_manager.h b/components/safe_browsing/android/remote_database_manager.h
index ce9948b..e499763 100644
--- a/components/safe_browsing/android/remote_database_manager.h
+++ b/components/safe_browsing/android/remote_database_manager.h
@@ -48,6 +48,8 @@
                          Client* client) override;
   AsyncMatch CheckCsdWhitelistUrl(const GURL& url, Client* client) override;
   bool CheckResourceUrl(const GURL& url, Client* client) override;
+  AsyncMatch CheckUrlForHighConfidenceAllowlist(const GURL& url,
+                                                Client* client) override;
   bool CheckUrlForSubresourceFilter(const GURL& url, Client* client) override;
   bool MatchDownloadWhitelistString(const std::string& str) override;
   bool MatchDownloadWhitelistUrl(const GURL& url) override;
diff --git a/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc b/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc
index be3da44..e0c5810 100644
--- a/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc
+++ b/components/safe_browsing/android/safe_browsing_api_handler_bridge.cc
@@ -16,12 +16,12 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/task/post_task.h"
 #include "base/trace_event/trace_event.h"
+#include "components/safe_browsing/android/jni_headers/SafeBrowsingApiBridge_jni.h"
 #include "components/safe_browsing/android/safe_browsing_api_handler_util.h"
 #include "components/safe_browsing/db/v4_protocol_manager_util.h"
 #include "components/safe_browsing/features.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
-#include "jni/SafeBrowsingApiBridge_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/components/safe_browsing/db/BUILD.gn b/components/safe_browsing/db/BUILD.gn
index 57beea1..96fe817 100644
--- a/components/safe_browsing/db/BUILD.gn
+++ b/components/safe_browsing/db/BUILD.gn
@@ -330,6 +330,7 @@
     ":v4_test_util",
     "//base",
     "//base/test:test_support",
+    "//components/safe_browsing:features",
     "//content/test:test_support",
     "//net",
     "//net:test_support",
@@ -412,6 +413,7 @@
     ":v4_update_protocol_manager",
     "//base",
     "//components/prefs:test_support",
+    "//components/safe_browsing:features",
     "//components/safe_browsing/common:safe_browsing_prefs",
     "//content/test:test_support",
     "//crypto",
diff --git a/components/safe_browsing/db/database_manager.h b/components/safe_browsing/db/database_manager.h
index 49f7a77..b53ee6f 100644
--- a/components/safe_browsing/db/database_manager.h
+++ b/components/safe_browsing/db/database_manager.h
@@ -30,12 +30,22 @@
 
 namespace safe_browsing {
 
-// Value returned by some Check*Whitelist() calls that may or may not have an
-// immediate answer.
+// Value returned by some functions that check an allowlist and may or may not
+// have an immediate answer.
 enum class AsyncMatch {
-  ASYNC,     // No answer yet -- Client will get a callback
-  MATCH,     // URL matches the list.  No callback.
-  NO_MATCH,  // URL doesn't match. No callback.
+  // If a hash prefix on the allowlist matches any of the computed hashes for
+  // the URL. In this case, the callback method on the client is called back
+  // later with the result.
+  ASYNC,
+
+  // If a full hash on the allowlist matches any of the computed hashes for the
+  // URL. The callback function isn't called.
+  MATCH,
+
+  // If Safe Browsing isn't enabled, or the allowlist hasn't been sync'd yet, or
+  // when no hash prefix or full hash in the allowlist matches the computed
+  // hashes of the URL. The callback function isn't called.
+  NO_MATCH,
 };
 
 struct V4ProtocolConfig;
@@ -79,6 +89,11 @@
     // Called when the result of checking a whitelist is known.
     // Currently only used for CSD whitelist.
     virtual void OnCheckWhitelistUrlResult(bool is_whitelisted) {}
+
+    // Called when the result of checking the high-confidence allowlist is
+    // known.
+    virtual void OnCheckUrlForHighConfidenceAllowlist(bool is_high_confidence) {
+    }
   };
 
   //
@@ -118,23 +133,23 @@
   //
 
   // Called on the IO thread to check if the given url has blacklisted APIs.
-  // "client" is called asynchronously with the result when it is ready. Callers
+  // |client| is called asynchronously with the result when it is ready. Callers
   // should wait for results before calling this method a second time with the
   // same client. This method has the same implementation for both the local and
   // remote database managers since it pings Safe Browsing servers directly
   // without accessing the database at all.  Returns true if we can
   // synchronously determine that the url is safe. Otherwise it returns false,
-  // and "client" is called asynchronously with the result when it is ready.
+  // and |client| is called asynchronously with the result when it is ready.
   virtual bool CheckApiBlacklistUrl(const GURL& url, Client* client);
 
   // Check if the |url| matches any of the full-length hashes from the client-
   // side phishing detection whitelist. The 3-state return value indicates
-  // the result or that the Client will get a callback later with the result.
+  // the result or that |client| will get a callback later with the result.
   virtual AsyncMatch CheckCsdWhitelistUrl(const GURL& url, Client* client) = 0;
 
   // Called on the IO thread to check if the given url is safe or not.  If we
   // can synchronously determine that the url is safe, CheckUrl returns true.
-  // Otherwise it returns false, and "client" is called asynchronously with the
+  // Otherwise it returns false, and |client| is called asynchronously with the
   // result when it is ready. The URL will only be checked for the threat types
   // in |threat_types|.
   virtual bool CheckBrowseUrl(const GURL& url,
@@ -160,11 +175,20 @@
   // Called on the IO thread to check if the given url belongs to a list the
   // subresource cares about. If the url doesn't belong to any such list and the
   // check can happen synchronously, returns true. Otherwise it returns false,
-  // and "client" is called asynchronously with the result when it is ready.
+  // and |client| is called asynchronously with the result when it is ready.
   // Returns true if the list is not yet available.
   virtual bool CheckUrlForSubresourceFilter(const GURL& url,
                                             Client* client) = 0;
 
+  // Called on the IO thread to check whether |url| is safe by checking if it
+  // appears on a high-confidence allowlist. The 3-state return value indicates
+  // the result or that |client| will get a callback later with the result.
+  // The high confidence allowlist is a list of partial or full hashes of URLs
+  // that are expected to be safe so in the case of a match on this list, the
+  // realtime full URL Safe Browsing lookup isn't performed.
+  virtual AsyncMatch CheckUrlForHighConfidenceAllowlist(const GURL& url,
+                                                        Client* client) = 0;
+
   //
   // Match*(): Methods to synchronously check if various types are safe.
   //
diff --git a/components/safe_browsing/db/test_database_manager.cc b/components/safe_browsing/db/test_database_manager.cc
index aa337107..33a91b4 100644
--- a/components/safe_browsing/db/test_database_manager.cc
+++ b/components/safe_browsing/db/test_database_manager.cc
@@ -61,6 +61,13 @@
   return true;
 }
 
+AsyncMatch TestSafeBrowsingDatabaseManager::CheckUrlForHighConfidenceAllowlist(
+    const GURL& url,
+    Client* client) {
+  NOTIMPLEMENTED();
+  return AsyncMatch::NO_MATCH;
+}
+
 bool TestSafeBrowsingDatabaseManager::CheckUrlForSubresourceFilter(
     const GURL& url,
     Client* client) {
diff --git a/components/safe_browsing/db/test_database_manager.h b/components/safe_browsing/db/test_database_manager.h
index 5f0ae5b..b5c6379 100644
--- a/components/safe_browsing/db/test_database_manager.h
+++ b/components/safe_browsing/db/test_database_manager.h
@@ -34,6 +34,8 @@
   bool CheckExtensionIDs(const std::set<std::string>& extension_ids,
                          Client* client) override;
   bool CheckResourceUrl(const GURL& url, Client* client) override;
+  AsyncMatch CheckUrlForHighConfidenceAllowlist(const GURL& url,
+                                                Client* client) override;
   bool CheckUrlForSubresourceFilter(const GURL& url, Client* client) override;
   bool MatchDownloadWhitelistString(const std::string& str) override;
   bool MatchDownloadWhitelistUrl(const GURL& url) override;
diff --git a/components/safe_browsing/db/v4_local_database_manager.cc b/components/safe_browsing/db/v4_local_database_manager.cc
index 7f59fbf..89c8308 100644
--- a/components/safe_browsing/db/v4_local_database_manager.cc
+++ b/components/safe_browsing/db/v4_local_database_manager.cc
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// This file should not be build on Android but is currently getting built.
-// TODO(vakh): Fix that: http://crbug.com/621647
-
 #include "components/safe_browsing/db/v4_local_database_manager.h"
 
 #include <utility>
@@ -128,6 +125,7 @@
     case SUBRESOURCE_FILTER:
       return 2;
     case CSD_WHITELIST:
+    case HIGH_CONFIDENCE_ALLOWLIST:
       return 3;
     case SUSPICIOUS:
       return 4;
@@ -395,6 +393,28 @@
   return HandleCheck(std::move(check));
 }
 
+AsyncMatch V4LocalDatabaseManager::CheckUrlForHighConfidenceAllowlist(
+    const GURL& url,
+    Client* client) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(RealTimePolicyEngine::CanPerformFullURLLookup());
+
+  StoresToCheck stores_to_check({GetUrlHighConfidenceAllowlistId()});
+  if (!enabled_ || !CanCheckUrl(url) ||
+      !AreAllStoresAvailableNow(stores_to_check)) {
+    // NOTE(vakh): If Safe Browsing isn't enabled yet, or if the URL isn't a
+    // navigation URL, or if the allowlist isn't ready yet, return NO_MATCH.
+    // This will lead to a full URL lookup, if other conditions are met.
+    return AsyncMatch::NO_MATCH;
+  }
+
+  std::unique_ptr<PendingCheck> check = std::make_unique<PendingCheck>(
+      client, ClientCallbackType::CHECK_HIGH_CONFIDENCE_ALLOWLIST,
+      stores_to_check, std::vector<GURL>(1, url));
+
+  return HandleWhitelistCheck(std::move(check));
+}
+
 bool V4LocalDatabaseManager::CheckUrlForSubresourceFilter(const GURL& url,
                                                           Client* client) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -914,6 +934,16 @@
                                               check->most_severe_threat_type);
       break;
 
+    case ClientCallbackType::CHECK_HIGH_CONFIDENCE_ALLOWLIST: {
+      DCHECK_EQ(1u, check->urls.size());
+      bool did_match_allowlist = check->most_severe_threat_type ==
+                                 SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST;
+      DCHECK(did_match_allowlist ||
+             check->most_severe_threat_type == SB_THREAT_TYPE_SAFE);
+      check->client->OnCheckUrlForHighConfidenceAllowlist(did_match_allowlist);
+      break;
+    }
+
     case ClientCallbackType::CHECK_RESOURCE_URL:
       DCHECK_EQ(1u, check->urls.size());
       check->client->OnCheckResourceUrlResult(check->urls[0],
@@ -923,11 +953,11 @@
 
     case ClientCallbackType::CHECK_CSD_WHITELIST: {
       DCHECK_EQ(1u, check->urls.size());
-      bool did_match_whitelist =
+      bool did_match_allowlist =
           check->most_severe_threat_type == SB_THREAT_TYPE_CSD_WHITELIST;
-      DCHECK(did_match_whitelist ||
+      DCHECK(did_match_allowlist ||
              check->most_severe_threat_type == SB_THREAT_TYPE_SAFE);
-      check->client->OnCheckWhitelistUrlResult(did_match_whitelist);
+      check->client->OnCheckWhitelistUrlResult(did_match_allowlist);
       break;
     }
 
diff --git a/components/safe_browsing/db/v4_local_database_manager.h b/components/safe_browsing/db/v4_local_database_manager.h
index 0431b519..73640242 100644
--- a/components/safe_browsing/db/v4_local_database_manager.h
+++ b/components/safe_browsing/db/v4_local_database_manager.h
@@ -67,6 +67,8 @@
   bool CheckExtensionIDs(const std::set<FullHash>& extension_ids,
                          Client* client) override;
   bool CheckResourceUrl(const GURL& url, Client* client) override;
+  AsyncMatch CheckUrlForHighConfidenceAllowlist(const GURL& url,
+                                                Client* client) override;
   bool CheckUrlForSubresourceFilter(const GURL& url, Client* client) override;
   bool MatchDownloadWhitelistString(const std::string& str) override;
   bool MatchDownloadWhitelistUrl(const GURL& url) override;
@@ -127,6 +129,9 @@
     // part of the CSD whitelist.
     CHECK_CSD_WHITELIST,
 
+    // TODO(vakh): Explain this.
+    CHECK_HIGH_CONFIDENCE_ALLOWLIST,
+
     // This represents the other cases when a check is being performed
     // synchronously so a client callback isn't required. For instance, when
     // trying to determing if an IP address is unsafe due to hosting Malware.
diff --git a/components/safe_browsing/db/v4_local_database_manager_unittest.cc b/components/safe_browsing/db/v4_local_database_manager_unittest.cc
index db22c68..f8f2ebe3 100644
--- a/components/safe_browsing/db/v4_local_database_manager_unittest.cc
+++ b/components/safe_browsing/db/v4_local_database_manager_unittest.cc
@@ -15,11 +15,13 @@
 #include "base/run_loop.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_tokenizer.h"
+#include "base/test/scoped_feature_list.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "components/safe_browsing/db/v4_database.h"
 #include "components/safe_browsing/db/v4_protocol_manager_util.h"
 #include "components/safe_browsing/db/v4_test_util.h"
+#include "components/safe_browsing/features.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "content/public/test/test_utils.h"
 #include "crypto/sha2.h"
@@ -179,18 +181,18 @@
   TestClient(SBThreatType sb_threat_type,
              const GURL& url,
              V4LocalDatabaseManager* manager_to_cancel = nullptr)
-      : expected_sb_threat_type(sb_threat_type),
-        expected_urls(1, url),
+      : expected_sb_threat_type_(sb_threat_type),
+        expected_urls_(1, url),
         manager_to_cancel_(manager_to_cancel) {}
 
   TestClient(SBThreatType sb_threat_type, const std::vector<GURL>& url_chain)
-      : expected_sb_threat_type(sb_threat_type), expected_urls(url_chain) {}
+      : expected_sb_threat_type_(sb_threat_type), expected_urls_(url_chain) {}
 
   void OnCheckBrowseUrlResult(const GURL& url,
                               SBThreatType threat_type,
                               const ThreatMetadata& metadata) override {
-    ASSERT_EQ(expected_urls[0], url);
-    ASSERT_EQ(expected_sb_threat_type, threat_type);
+    ASSERT_EQ(expected_urls_[0], url);
+    ASSERT_EQ(expected_sb_threat_type_, threat_type);
     on_check_browse_url_result_called_ = true;
     if (manager_to_cancel_) {
       manager_to_cancel_->CancelCheck(this);
@@ -200,53 +202,88 @@
   void OnCheckResourceUrlResult(const GURL& url,
                                 SBThreatType threat_type,
                                 const std::string& threat_hash) override {
-    ASSERT_EQ(expected_urls[0], url);
-    ASSERT_EQ(expected_sb_threat_type, threat_type);
+    ASSERT_EQ(expected_urls_[0], url);
+    ASSERT_EQ(expected_sb_threat_type_, threat_type);
     ASSERT_EQ(threat_type == SB_THREAT_TYPE_SAFE, threat_hash.empty());
     on_check_resource_url_result_called_ = true;
   }
 
   void OnCheckDownloadUrlResult(const std::vector<GURL>& url_chain,
                                 SBThreatType threat_type) override {
-    ASSERT_EQ(expected_urls, url_chain);
-    ASSERT_EQ(expected_sb_threat_type, threat_type);
+    ASSERT_EQ(expected_urls_, url_chain);
+    ASSERT_EQ(expected_sb_threat_type_, threat_type);
     on_check_download_urls_result_called_ = true;
   }
 
-  SBThreatType expected_sb_threat_type;
-  std::vector<GURL> expected_urls;
+  std::vector<GURL>* mutable_expected_urls() { return &expected_urls_; }
+
+  bool on_check_browse_url_result_called() {
+    return on_check_browse_url_result_called_;
+  }
+  bool on_check_download_urls_result_called() {
+    return on_check_download_urls_result_called_;
+  }
+  bool on_check_resource_url_result_called() {
+    return on_check_resource_url_result_called_;
+  }
+
+ private:
+  const SBThreatType expected_sb_threat_type_;
+  std::vector<GURL> expected_urls_;
   bool on_check_browse_url_result_called_ = false;
   bool on_check_download_urls_result_called_ = false;
   bool on_check_resource_url_result_called_ = false;
   V4LocalDatabaseManager* manager_to_cancel_;
 };
 
-class TestWhitelistClient : public SafeBrowsingDatabaseManager::Client {
+class TestAllowlistClient : public SafeBrowsingDatabaseManager::Client {
  public:
-  explicit TestWhitelistClient(bool whitelist_expected)
-      : whitelist_expected_(whitelist_expected) {}
+  // |match_expected| specifies whether a full hash match is expected.
+  // |expected_sb_threat_type| identifies which callback method to expect to get
+  // called.
+  explicit TestAllowlistClient(bool match_expected,
+                               SBThreatType expected_sb_threat_type)
+      : expected_sb_threat_type_(expected_sb_threat_type),
+        match_expected_(match_expected) {}
 
-  void OnCheckWhitelistUrlResult(bool is_whitelisted) override {
-    EXPECT_EQ(whitelist_expected_, is_whitelisted);
+  void OnCheckWhitelistUrlResult(bool is_allowlisted) override {
+    EXPECT_EQ(match_expected_, is_allowlisted);
+    EXPECT_EQ(SB_THREAT_TYPE_CSD_WHITELIST, expected_sb_threat_type_);
     callback_called_ = true;
   }
 
-  const bool whitelist_expected_;
+  void OnCheckUrlForHighConfidenceAllowlist(bool is_allowlisted) override {
+    EXPECT_EQ(match_expected_, is_allowlisted);
+    EXPECT_EQ(SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST,
+              expected_sb_threat_type_);
+    callback_called_ = true;
+  }
+
+  bool callback_called() { return callback_called_; }
+
+ private:
+  const SBThreatType expected_sb_threat_type_;
+  const bool match_expected_;
   bool callback_called_ = false;
 };
 
 class TestExtensionClient : public SafeBrowsingDatabaseManager::Client {
  public:
   TestExtensionClient(const std::set<FullHash>& expected_bad_crxs)
-      : expected_bad_crxs(expected_bad_crxs),
+      : expected_bad_crxs_(expected_bad_crxs),
         on_check_extensions_result_called_(false) {}
 
   void OnCheckExtensionsResult(const std::set<FullHash>& bad_crxs) override {
-    EXPECT_EQ(expected_bad_crxs, bad_crxs);
+    EXPECT_EQ(expected_bad_crxs_, bad_crxs);
     on_check_extensions_result_called_ = true;
   }
 
-  const std::set<FullHash> expected_bad_crxs;
+  bool on_check_extensions_result_called() {
+    return on_check_extensions_result_called_;
+  }
+
+ private:
+  const std::set<FullHash> expected_bad_crxs_;
   bool on_check_extensions_result_called_;
 };
 
@@ -467,56 +504,60 @@
   ResetLocalDatabaseManager();
   WaitForTasksOnTaskRunner();
 
-  std::string url_white_no_scheme("example.com/white/");
-  FullHash white_full_hash(crypto::SHA256HashString(url_white_no_scheme));
-  const HashPrefix white_hash_prefix(white_full_hash.substr(0, 5));
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
+  const HashPrefix safe_hash_prefix(safe_full_hash.substr(0, 5));
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetUrlCsdWhitelistId(),
-                                       white_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+                                       safe_hash_prefix);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
-  TestWhitelistClient client(false /* whitelist_expected */);
-  const GURL url_check("https://" + url_white_no_scheme);
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_CSD_WHITELIST);
+  const GURL url_check("https://" + url_safe_no_scheme);
   EXPECT_EQ(AsyncMatch::ASYNC, v4_local_database_manager_->CheckCsdWhitelistUrl(
                                    url_check, &client));
 
-  EXPECT_FALSE(client.callback_called_);
+  EXPECT_FALSE(client.callback_called());
 
   // Wait for PerformFullHashCheck to complete.
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.callback_called_);
+  EXPECT_TRUE(client.callback_called());
 }
 
 // This is like CsdWhitelistWithPrefixMatch, but we also verify the
 // full-hash-match results in an appropriate callback value.
 TEST_F(V4LocalDatabaseManagerTest,
        TestCheckCsdWhitelistWithPrefixTheFullMatch) {
-  std::string url_white_no_scheme("example.com/white/");
-  FullHash white_full_hash(crypto::SHA256HashString(url_white_no_scheme));
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
 
   // Setup to receive full-hash hit. We won't make URL requests.
   FullHashInfos infos(
-      {{white_full_hash, GetUrlCsdWhitelistId(), base::Time::Now()}});
+      {{safe_full_hash, GetUrlCsdWhitelistId(), base::Time::Now()}});
   ScopedFakeGetHashProtocolManagerFactory pin(infos);
   ResetLocalDatabaseManager();
   WaitForTasksOnTaskRunner();
 
-  const HashPrefix white_hash_prefix(white_full_hash.substr(0, 5));
+  const HashPrefix safe_hash_prefix(safe_full_hash.substr(0, 5));
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetUrlCsdWhitelistId(),
-                                       white_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+                                       safe_hash_prefix);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
-  TestWhitelistClient client(true /* whitelist_expected */);
-  const GURL url_check("https://" + url_white_no_scheme);
+  TestAllowlistClient client(
+      /* match_expected= */ true,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_CSD_WHITELIST);
+  const GURL url_check("https://" + url_safe_no_scheme);
   EXPECT_EQ(AsyncMatch::ASYNC, v4_local_database_manager_->CheckCsdWhitelistUrl(
                                    url_check, &client));
 
-  EXPECT_FALSE(client.callback_called_);
+  EXPECT_FALSE(client.callback_called());
 
   // Wait for PerformFullHashCheck to complete.
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.callback_called_);
+  EXPECT_TRUE(client.callback_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckCsdWhitelistWithFullMatch) {
@@ -525,19 +566,21 @@
   ResetLocalDatabaseManager();
   WaitForTasksOnTaskRunner();
 
-  std::string url_white_no_scheme("example.com/white/");
-  FullHash white_full_hash(crypto::SHA256HashString(url_white_no_scheme));
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
   StoreAndHashPrefixes store_and_hash_prefixes;
-  store_and_hash_prefixes.emplace_back(GetUrlCsdWhitelistId(), white_full_hash);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  store_and_hash_prefixes.emplace_back(GetUrlCsdWhitelistId(), safe_full_hash);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
-  TestWhitelistClient client(false /* whitelist_expected */);
-  const GURL url_check("https://" + url_white_no_scheme);
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_CSD_WHITELIST);
+  const GURL url_check("https://" + url_safe_no_scheme);
   EXPECT_EQ(AsyncMatch::MATCH, v4_local_database_manager_->CheckCsdWhitelistUrl(
                                    url_check, &client));
 
   WaitForTasksOnTaskRunner();
-  EXPECT_FALSE(client.callback_called_);
+  EXPECT_FALSE(client.callback_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckCsdWhitelistWithNoMatch) {
@@ -547,23 +590,25 @@
   WaitForTasksOnTaskRunner();
 
   // Add a full hash that won't match the URL we check.
-  std::string url_white_no_scheme("example.com/white/");
-  FullHash white_full_hash(crypto::SHA256HashString(url_white_no_scheme));
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
   StoreAndHashPrefixes store_and_hash_prefixes;
-  store_and_hash_prefixes.emplace_back(GetUrlMalwareId(), white_full_hash);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  store_and_hash_prefixes.emplace_back(GetUrlMalwareId(), safe_full_hash);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
-  TestWhitelistClient client(true /* whitelist_expected */);
+  TestAllowlistClient client(
+      /* match_expected= */ true,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_CSD_WHITELIST);
   const GURL url_check("https://other.com/");
   EXPECT_EQ(
       AsyncMatch::NO_MATCH,
       v4_local_database_manager_->CheckCsdWhitelistUrl(url_check, &client));
 
   WaitForTasksOnTaskRunner();
-  EXPECT_FALSE(client.callback_called_);
+  EXPECT_FALSE(client.callback_called());
 }
 
-// When whitelist is unavailable, all URLS should be whitelisted.
+// When allowlist is unavailable, all URLS should be allowed.
 TEST_F(V4LocalDatabaseManagerTest, TestCheckCsdWhitelistUnavailable) {
   // Setup to receive full-hash misses. We won't make URL requests.
   ScopedFakeGetHashProtocolManagerFactory pin(FullHashInfos({}));
@@ -571,15 +616,17 @@
   WaitForTasksOnTaskRunner();
 
   StoreAndHashPrefixes store_and_hash_prefixes;
-  ReplaceV4Database(store_and_hash_prefixes, false /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ false);
 
-  TestWhitelistClient client(false /* whitelist_expected */);
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_CSD_WHITELIST);
   const GURL url_check("https://other.com/");
   EXPECT_EQ(AsyncMatch::MATCH, v4_local_database_manager_->CheckCsdWhitelistUrl(
                                    url_check, &client));
 
   WaitForTasksOnTaskRunner();
-  EXPECT_FALSE(client.callback_called_);
+  EXPECT_FALSE(client.callback_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest,
@@ -594,6 +641,197 @@
       GURL("http://example.com/a/"), usual_threat_types_, nullptr));
 }
 
+// Hash prefix matches on the high confidence allowlist, but full hash match
+// fails.
+TEST_F(V4LocalDatabaseManagerTest,
+       TestCheckUrlForHCAllowlistWithPrefixMatchButNoFullHashMatch) {
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {safe_browsing::kRealTimeUrlLookupFetchAllowlist,
+       safe_browsing::kRealTimeUrlLookupEnabled},
+      {});
+
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
+
+  // Setup to receive full-hash misses. We won't make URL requests.
+  ScopedFakeGetHashProtocolManagerFactory pin(FullHashInfos({}));
+  ResetLocalDatabaseManager();
+  WaitForTasksOnTaskRunner();
+
+  // Setup to match hash prefix in the local database.
+  const HashPrefix safe_hash_prefix(safe_full_hash.substr(0, 5));
+  StoreAndHashPrefixes store_and_hash_prefixes;
+  store_and_hash_prefixes.emplace_back(GetUrlHighConfidenceAllowlistId(),
+                                       safe_hash_prefix);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
+
+  // Setup the allowlist client to verify the callback.
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST);
+
+  // Lookup the high confidence allowlist.
+  const GURL url_check("https://" + url_safe_no_scheme);
+  EXPECT_EQ(AsyncMatch::ASYNC,
+            v4_local_database_manager_->CheckUrlForHighConfidenceAllowlist(
+                url_check, &client));
+
+  EXPECT_FALSE(client.callback_called());
+
+  // Wait for PerformFullHashCheck to complete.
+  WaitForTasksOnTaskRunner();
+  EXPECT_TRUE(client.callback_called());
+}
+
+// Hash prefix matches on the high confidence allowlist, and subsequently the
+// full hash also matches.
+TEST_F(V4LocalDatabaseManagerTest,
+       TestCheckUrlForHCAllowlistWithPrefixMatchAndFullHashMatch) {
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {safe_browsing::kRealTimeUrlLookupFetchAllowlist,
+       safe_browsing::kRealTimeUrlLookupEnabled},
+      {});
+
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
+
+  // Setup to receive full-hash hit. We won't make URL requests.
+  FullHashInfos infos(
+      {{safe_full_hash, GetUrlHighConfidenceAllowlistId(), base::Time::Now()}});
+  ScopedFakeGetHashProtocolManagerFactory pin(infos);
+  ResetLocalDatabaseManager();
+  WaitForTasksOnTaskRunner();
+
+  // Setup to match hash prefix in the local database.
+  const HashPrefix safe_hash_prefix(safe_full_hash.substr(0, 5));
+  StoreAndHashPrefixes store_and_hash_prefixes;
+  store_and_hash_prefixes.emplace_back(GetUrlHighConfidenceAllowlistId(),
+                                       safe_hash_prefix);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
+
+  // Setup the allowlist client to verify the callback.
+  TestAllowlistClient client(
+      /* match_expected= */ true,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST);
+
+  // Lookup the high confidence allowlist.
+  const GURL url_check("https://" + url_safe_no_scheme);
+  EXPECT_EQ(AsyncMatch::ASYNC,
+            v4_local_database_manager_->CheckUrlForHighConfidenceAllowlist(
+                url_check, &client));
+
+  EXPECT_FALSE(client.callback_called());
+
+  // Wait for PerformFullHashCheck to complete.
+  WaitForTasksOnTaskRunner();
+  EXPECT_TRUE(client.callback_called());
+}
+
+// Full hash match on the high confidence allowlist. Returns |MATCH|
+// synchronously and callback isn't called.
+TEST_F(V4LocalDatabaseManagerTest,
+       TestCheckUrlForHCAllowlistWithLocalFullHashMatch) {
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {safe_browsing::kRealTimeUrlLookupFetchAllowlist,
+       safe_browsing::kRealTimeUrlLookupEnabled},
+      {});
+
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
+
+  // Setup to receive full-hash misses. We won't make URL requests.
+  ScopedFakeGetHashProtocolManagerFactory pin(FullHashInfos({}));
+  ResetLocalDatabaseManager();
+  WaitForTasksOnTaskRunner();
+
+  // Setup to match full hash in the local database.
+  StoreAndHashPrefixes store_and_hash_prefixes;
+  store_and_hash_prefixes.emplace_back(GetUrlHighConfidenceAllowlistId(),
+                                       safe_full_hash);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
+
+  // Setup the allowlist client to verify the callback isn't called.
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST);
+  const GURL url_check("https://" + url_safe_no_scheme);
+  EXPECT_EQ(AsyncMatch::MATCH,
+            v4_local_database_manager_->CheckUrlForHighConfidenceAllowlist(
+                url_check, &client));
+
+  WaitForTasksOnTaskRunner();
+  EXPECT_FALSE(client.callback_called());
+}
+
+// Hash prefix has no match on the high confidence allowlist. Returns |NO_MATCH|
+// synchronously and callback isn't called.
+TEST_F(V4LocalDatabaseManagerTest, TestCheckUrlForHCAllowlistWithNoMatch) {
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {safe_browsing::kRealTimeUrlLookupFetchAllowlist,
+       safe_browsing::kRealTimeUrlLookupEnabled},
+      {});
+
+  std::string url_safe_no_scheme("example.com/safe/");
+  FullHash safe_full_hash(crypto::SHA256HashString(url_safe_no_scheme));
+
+  // Setup to receive full-hash misses. We won't make URL requests.
+  ScopedFakeGetHashProtocolManagerFactory pin(FullHashInfos({}));
+  ResetLocalDatabaseManager();
+  WaitForTasksOnTaskRunner();
+
+  // Add a full hash that won't match the URL we check.
+  StoreAndHashPrefixes store_and_hash_prefixes;
+  store_and_hash_prefixes.emplace_back(GetUrlMalwareId(), safe_full_hash);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
+
+  // Setup the allowlist client to verify the callback isn't called.
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST);
+  const GURL url_check("https://example.com/other/");
+  EXPECT_EQ(AsyncMatch::NO_MATCH,
+            v4_local_database_manager_->CheckUrlForHighConfidenceAllowlist(
+                url_check, &client));
+
+  WaitForTasksOnTaskRunner();
+  EXPECT_FALSE(client.callback_called());
+}
+
+// When allowlist is unavailable, all URLS should be considered no-match.
+TEST_F(V4LocalDatabaseManagerTest, TestCheckUrlForHCAllowlistUnavailable) {
+  base::test::ScopedFeatureList feature_list;
+  feature_list.InitWithFeatures(
+      {safe_browsing::kRealTimeUrlLookupFetchAllowlist,
+       safe_browsing::kRealTimeUrlLookupEnabled},
+      {});
+
+  // Setup to receive full-hash misses. We won't make URL requests.
+  ScopedFakeGetHashProtocolManagerFactory pin(FullHashInfos({}));
+  ResetLocalDatabaseManager();
+  WaitForTasksOnTaskRunner();
+
+  // Setup local database as unavailable.
+  StoreAndHashPrefixes store_and_hash_prefixes;
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ false);
+
+  // Setup the allowlist client to verify the callback isn't called.
+  TestAllowlistClient client(
+      /* match_expected= */ false,
+      /* expected_sb_threat_type= */ SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST);
+
+  const GURL url_check("https://example.com/safe");
+  EXPECT_EQ(AsyncMatch::NO_MATCH,
+            v4_local_database_manager_->CheckUrlForHighConfidenceAllowlist(
+                url_check, &client));
+
+  WaitForTasksOnTaskRunner();
+  EXPECT_FALSE(client.callback_called());
+}
+
 TEST_F(V4LocalDatabaseManagerTest, TestGetSeverestThreatTypeAndMetadata) {
   WaitForTasksOnTaskRunner();
 
@@ -685,9 +923,9 @@
     TestClient client(SB_THREAT_TYPE_SAFE, url_bad);
     EXPECT_FALSE(v4_local_database_manager_->CheckBrowseUrl(
         url_bad, usual_threat_types_, &client));
-    EXPECT_FALSE(client.on_check_browse_url_result_called_);
+    EXPECT_FALSE(client.on_check_browse_url_result_called());
     WaitForTasksOnTaskRunner();
-    EXPECT_TRUE(client.on_check_browse_url_result_called_);
+    EXPECT_TRUE(client.on_check_browse_url_result_called());
   }
 
   // Test that cancel prevents the callback from being called.
@@ -696,9 +934,9 @@
     EXPECT_FALSE(v4_local_database_manager_->CheckBrowseUrl(
         url_bad, usual_threat_types_, &client));
     v4_local_database_manager_->CancelCheck(&client);
-    EXPECT_FALSE(client.on_check_browse_url_result_called_);
+    EXPECT_FALSE(client.on_check_browse_url_result_called());
     WaitForTasksOnTaskRunner();
-    EXPECT_FALSE(client.on_check_browse_url_result_called_);
+    EXPECT_FALSE(client.on_check_browse_url_result_called());
   }
 }
 
@@ -715,11 +953,11 @@
   EXPECT_FALSE(v4_local_database_manager_->CheckBrowseUrl(
       url, usual_threat_types_, &client2));
   EXPECT_EQ(2ul, GetQueuedChecks().size());
-  EXPECT_FALSE(client1.on_check_browse_url_result_called_);
-  EXPECT_FALSE(client2.on_check_browse_url_result_called_);
+  EXPECT_FALSE(client1.on_check_browse_url_result_called());
+  EXPECT_FALSE(client2.on_check_browse_url_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client1.on_check_browse_url_result_called_);
-  EXPECT_TRUE(client2.on_check_browse_url_result_called_);
+  EXPECT_TRUE(client1.on_check_browse_url_result_called());
+  EXPECT_TRUE(client2.on_check_browse_url_result_called());
 }
 
 // This test is somewhat similar to TestCheckBrowseUrlWithFakeDbReturnsMatch but
@@ -873,7 +1111,7 @@
   v4_local_database_manager_->CancelCheck(&client);
 
   // Now, re-use that client but for |second_url|.
-  client.expected_urls.assign(1, second_url);
+  client.mutable_expected_urls()->assign(1, second_url);
   EXPECT_FALSE(v4_local_database_manager_->CheckBrowseUrl(
       second_url, usual_threat_types_, &client));
 
@@ -883,7 +1121,7 @@
   // gets called with the |url| equal to |expected_url|, which is |second_url|
   // in
   // this test.
-  EXPECT_TRUE(client.on_check_browse_url_result_called_);
+  EXPECT_TRUE(client.on_check_browse_url_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckResourceUrl) {
@@ -900,14 +1138,14 @@
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetChromeUrlClientIncidentId(),
                                        bad_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const GURL url_bad("https://" + url_bad_no_scheme);
   TestClient client(SB_THREAT_TYPE_SAFE, url_bad);
   EXPECT_FALSE(v4_local_database_manager_->CheckResourceUrl(url_bad, &client));
-  EXPECT_FALSE(client.on_check_resource_url_result_called_);
+  EXPECT_FALSE(client.on_check_resource_url_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_resource_url_result_called_);
+  EXPECT_TRUE(client.on_check_resource_url_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestSubresourceFilterCallback) {
@@ -926,7 +1164,7 @@
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetUrlSubresourceFilterId(),
                                        bad_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const GURL url_bad("https://" + url_bad_no_scheme);
   // Test that a request flows through to the callback.
@@ -934,9 +1172,9 @@
     TestClient client(SB_THREAT_TYPE_SAFE, url_bad);
     EXPECT_FALSE(v4_local_database_manager_->CheckUrlForSubresourceFilter(
         url_bad, &client));
-    EXPECT_FALSE(client.on_check_browse_url_result_called_);
+    EXPECT_FALSE(client.on_check_browse_url_result_called());
     WaitForTasksOnTaskRunner();
-    EXPECT_TRUE(client.on_check_browse_url_result_called_);
+    EXPECT_TRUE(client.on_check_browse_url_result_called());
   }
 }
 
@@ -956,14 +1194,14 @@
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetChromeUrlClientIncidentId(),
                                        bad_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const GURL url_bad("https://" + url_bad_no_scheme);
   TestClient client(SB_THREAT_TYPE_BLACKLISTED_RESOURCE, url_bad);
   EXPECT_FALSE(v4_local_database_manager_->CheckResourceUrl(url_bad, &client));
-  EXPECT_FALSE(client.on_check_resource_url_result_called_);
+  EXPECT_FALSE(client.on_check_resource_url_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_resource_url_result_called_);
+  EXPECT_TRUE(client.on_check_resource_url_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckExtensionIDsNothingBlacklisted) {
@@ -982,16 +1220,16 @@
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetChromeExtMalwareId(),
                                        bad_extension_id);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const std::set<FullHash> expected_bad_crxs({});
   const std::set<FullHash> extension_ids({good_extension_id, bad_extension_id});
   TestExtensionClient client(expected_bad_crxs);
   EXPECT_FALSE(
       v4_local_database_manager_->CheckExtensionIDs(extension_ids, &client));
-  EXPECT_FALSE(client.on_check_extensions_result_called_);
+  EXPECT_FALSE(client.on_check_extensions_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_extensions_result_called_);
+  EXPECT_TRUE(client.on_check_extensions_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckExtensionIDsOneIsBlacklisted) {
@@ -1011,16 +1249,16 @@
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetChromeExtMalwareId(),
                                        bad_extension_id);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const std::set<FullHash> expected_bad_crxs({bad_extension_id});
   const std::set<FullHash> extension_ids({good_extension_id, bad_extension_id});
   TestExtensionClient client(expected_bad_crxs);
   EXPECT_FALSE(
       v4_local_database_manager_->CheckExtensionIDs(extension_ids, &client));
-  EXPECT_FALSE(client.on_check_extensions_result_called_);
+  EXPECT_FALSE(client.on_check_extensions_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_extensions_result_called_);
+  EXPECT_TRUE(client.on_check_extensions_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckDownloadUrlNothingBlacklisted) {
@@ -1037,7 +1275,7 @@
   const HashPrefix bad_hash_prefix(bad_full_hash.substr(0, 5));
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetUrlMalBinId(), bad_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   const GURL url_bad("https://" + url_bad_no_scheme),
       url_good("https://example.com/good/");
@@ -1046,9 +1284,9 @@
   TestClient client(SB_THREAT_TYPE_SAFE, url_chain);
   EXPECT_FALSE(
       v4_local_database_manager_->CheckDownloadUrl(url_chain, &client));
-  EXPECT_FALSE(client.on_check_download_urls_result_called_);
+  EXPECT_FALSE(client.on_check_download_urls_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_download_urls_result_called_);
+  EXPECT_TRUE(client.on_check_download_urls_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, TestCheckDownloadUrlWithOneBlacklisted) {
@@ -1070,14 +1308,14 @@
   const HashPrefix bad_hash_prefix(bad_full_hash.substr(0, 5));
   StoreAndHashPrefixes store_and_hash_prefixes;
   store_and_hash_prefixes.emplace_back(GetUrlMalBinId(), bad_hash_prefix);
-  ReplaceV4Database(store_and_hash_prefixes, true /* stores_available */);
+  ReplaceV4Database(store_and_hash_prefixes, /* stores_available= */ true);
 
   TestClient client(SB_THREAT_TYPE_URL_BINARY_MALWARE, url_chain);
   EXPECT_FALSE(
       v4_local_database_manager_->CheckDownloadUrl(url_chain, &client));
-  EXPECT_FALSE(client.on_check_download_urls_result_called_);
+  EXPECT_FALSE(client.on_check_download_urls_result_called());
   WaitForTasksOnTaskRunner();
-  EXPECT_TRUE(client.on_check_download_urls_result_called_);
+  EXPECT_TRUE(client.on_check_download_urls_result_called());
 }
 
 TEST_F(V4LocalDatabaseManagerTest, DeleteUnusedStoreFileDoesNotExist) {
diff --git a/components/safe_browsing/features.cc b/components/safe_browsing/features.cc
index a7f3e307..444fb4f 100644
--- a/components/safe_browsing/features.cc
+++ b/components/safe_browsing/features.cc
@@ -51,6 +51,9 @@
     "SafeBrowsingPasswordProtectionForSignedInUsers",
     base::FEATURE_DISABLED_BY_DEFAULT};
 
+const base::Feature kRealTimeUrlLookupEnabled{
+    "SafeBrowsingRealTimeUrlLookupEnabled", base::FEATURE_DISABLED_BY_DEFAULT};
+
 const base::Feature kRealTimeUrlLookupFetchAllowlist{
     "SafeBrowsingRealTimeUrlLookupFetchAllowlist",
     base::FEATURE_DISABLED_BY_DEFAULT};
@@ -91,6 +94,7 @@
     {&kCommittedSBInterstitials, true},
     {&kForceUseAPDownloadProtection, false},
     {&kPasswordProtectionForSignedInUsers, true},
+    {&kRealTimeUrlLookupEnabled, true},
     {&kRealTimeUrlLookupFetchAllowlist, true},
     {&kSuspiciousSiteTriggerQuotaFeature, true},
     {&kThreatDomDetailsTagAndAttributeFeature, false},
diff --git a/components/safe_browsing/features.h b/components/safe_browsing/features.h
index def545b..2d7549d9 100644
--- a/components/safe_browsing/features.h
+++ b/components/safe_browsing/features.h
@@ -49,6 +49,10 @@
 // Controls the daily quota for the suspicious site trigger.
 extern const base::Feature kSuspiciousSiteTriggerQuotaFeature;
 
+// Controls whether the real time URL lookup is enabled. Only works if
+// |kRealTimeUrlLookupFetchAllowlist| is also enabled.
+extern const base::Feature kRealTimeUrlLookupEnabled;
+
 // Controls whether the high confidence allowlist for real time URL lookup be
 // fetched.
 extern const base::Feature kRealTimeUrlLookupFetchAllowlist;
diff --git a/components/safe_browsing/realtime/policy_engine.cc b/components/safe_browsing/realtime/policy_engine.cc
index dd2c33d5..ee3f546b 100644
--- a/components/safe_browsing/realtime/policy_engine.cc
+++ b/components/safe_browsing/realtime/policy_engine.cc
@@ -14,4 +14,12 @@
   return base::FeatureList::IsEnabled(kRealTimeUrlLookupFetchAllowlist);
 }
 
+// static
+bool RealTimePolicyEngine::CanPerformFullURLLookup() {
+  // TODO(vakh): This should also take into account whether the user is eligible
+  // for this service (see "Target Users" in the design doc).
+  return CanFetchAllowlist() &&
+         base::FeatureList::IsEnabled(kRealTimeUrlLookupEnabled);
+}
+
 }  // namespace safe_browsing
diff --git a/components/safe_browsing/realtime/policy_engine.h b/components/safe_browsing/realtime/policy_engine.h
index 62c8b4ce..1d7d4e5 100644
--- a/components/safe_browsing/realtime/policy_engine.h
+++ b/components/safe_browsing/realtime/policy_engine.h
@@ -17,6 +17,10 @@
  public:
   // Can the high confidence allowlist be sync'd?
   static bool CanFetchAllowlist();
+
+  // Return true if the feature to enable full URL lookups is enabled and the
+  // allowlist fetch is enabled.
+  static bool CanPerformFullURLLookup();
 };  // class RealTimePolicyEngine
 
 }  // namespace safe_browsing
diff --git a/components/search_engines/android/BUILD.gn b/components/search_engines/android/BUILD.gn
index 474d8149..d6b37fc 100644
--- a/components/search_engines/android/BUILD.gn
+++ b/components/search_engines/android/BUILD.gn
@@ -21,5 +21,4 @@
     "java/src/org/chromium/components/search_engines/TemplateUrl.java",
     "java/src/org/chromium/components/search_engines/TemplateUrlService.java",
   ]
-  jni_package = "search_engines"
 }
diff --git a/components/search_engines/android/DEPS b/components/search_engines/android/DEPS
index 38f4bbd..f8116c0 100644
--- a/components/search_engines/android/DEPS
+++ b/components/search_engines/android/DEPS
@@ -3,5 +3,4 @@
   # Remove content dependencies: https://crbug.com/968156
   "-content/public/android/java",
   "+content/public/android/java/src/org/chromium/content_public",
-  "+jni"
 ]
diff --git a/components/search_engines/android/template_url_android.cc b/components/search_engines/android/template_url_android.cc
index dc04300..e6fd740f 100644
--- a/components/search_engines/android/template_url_android.cc
+++ b/components/search_engines/android/template_url_android.cc
@@ -8,7 +8,7 @@
 #include "base/android/jni_string.h"
 #include "components/search_engines/template_url.h"
 
-#include "jni/TemplateUrl_jni.h"
+#include "components/search_engines/android/jni_headers/TemplateUrl_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/search_engines/android/template_url_service_android.cc b/components/search_engines/android/template_url_service_android.cc
index da85964..0a251727 100644
--- a/components/search_engines/android/template_url_service_android.cc
+++ b/components/search_engines/android/template_url_service_android.cc
@@ -15,13 +15,13 @@
 #include "base/metrics/field_trial_params.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/google/core/common/google_util.h"
+#include "components/search_engines/android/jni_headers/TemplateUrlService_jni.h"
 #include "components/search_engines/android/template_url_android.h"
 #include "components/search_engines/search_terms_data.h"
 #include "components/search_engines/template_url.h"
 #include "components/search_engines/template_url_prepopulate_data.h"
 #include "components/search_engines/template_url_service.h"
 #include "components/search_engines/util.h"
-#include "jni/TemplateUrlService_jni.h"
 #include "net/base/url_util.h"
 
 using base::android::JavaParamRef;
diff --git a/components/signin/core/browser/DEPS b/components/signin/core/browser/DEPS
index 6aa48343a..702863d 100644
--- a/components/signin/core/browser/DEPS
+++ b/components/signin/core/browser/DEPS
@@ -6,7 +6,6 @@
   "+components/account_id",
   "+components/image_fetcher/core",
   "+components/metrics",
-  "+jni",
   "+mojo/public",
   "+services/identity/public",
   "+services/network/public",
diff --git a/components/signin/core/browser/account_tracker_service.cc b/components/signin/core/browser/account_tracker_service.cc
index 1659d9d3..d704a4b 100644
--- a/components/signin/core/browser/account_tracker_service.cc
+++ b/components/signin/core/browser/account_tracker_service.cc
@@ -28,7 +28,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_array.h"
-#include "jni/AccountTrackerService_jni.h"
+#include "components/signin/core/browser/android/jni_headers/AccountTrackerService_jni.h"
 #endif
 
 namespace {
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
index 52d54b2..faf5325 100644
--- a/components/signin/core/browser/android/BUILD.gn
+++ b/components/signin/core/browser/android/BUILD.gn
@@ -11,7 +11,6 @@
     "java/src/org/chromium/components/signin/ConsistencyCookieManager.java",
     "java/src/org/chromium/components/signin/OAuth2TokenService.java",
   ]
-  jni_package = "components/signin"
 }
 
 android_library("java") {
diff --git a/components/signin/core/browser/child_account_info_fetcher_android.cc b/components/signin/core/browser/child_account_info_fetcher_android.cc
index 02ad3d0..68ef034f 100644
--- a/components/signin/core/browser/child_account_info_fetcher_android.cc
+++ b/components/signin/core/browser/child_account_info_fetcher_android.cc
@@ -11,7 +11,7 @@
 #include "base/memory/ptr_util.h"
 #include "components/signin/core/browser/account_fetcher_service.h"
 #include "components/signin/core/browser/account_tracker_service.h"
-#include "jni/ChildAccountInfoFetcher_jni.h"
+#include "components/signin/core/browser/android/jni_headers/ChildAccountInfoFetcher_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/components/signin/core/browser/consistency_cookie_manager_android.cc b/components/signin/core/browser/consistency_cookie_manager_android.cc
index 97f4ae6f..2e4bdbc74 100644
--- a/components/signin/core/browser/consistency_cookie_manager_android.cc
+++ b/components/signin/core/browser/consistency_cookie_manager_android.cc
@@ -4,7 +4,7 @@
 
 #include "components/signin/core/browser/consistency_cookie_manager_android.h"
 
-#include "jni/ConsistencyCookieManager_jni.h"
+#include "components/signin/core/browser/android/jni_headers/ConsistencyCookieManager_jni.h"
 #include "services/identity/public/cpp/identity_manager.h"
 
 namespace signin {
diff --git a/components/signin/core/browser/oauth2_token_service_delegate_android.cc b/components/signin/core/browser/oauth2_token_service_delegate_android.cc
index 73f3377..0ec84ce 100644
--- a/components/signin/core/browser/oauth2_token_service_delegate_android.cc
+++ b/components/signin/core/browser/oauth2_token_service_delegate_android.cc
@@ -16,9 +16,9 @@
 #include "base/stl_util.h"
 #include "components/signin/core/browser/account_consistency_method.h"
 #include "components/signin/core/browser/account_info.h"
+#include "components/signin/core/browser/android/jni_headers/OAuth2TokenService_jni.h"
 #include "google_apis/gaia/gaia_auth_util.h"
 #include "google_apis/gaia/oauth2_access_token_fetcher.h"
-#include "jni/OAuth2TokenService_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/components/spellcheck/browser/DEPS b/components/spellcheck/browser/DEPS
index ad9d5b0..8ce8e280 100644
--- a/components/spellcheck/browser/DEPS
+++ b/components/spellcheck/browser/DEPS
@@ -6,7 +6,6 @@
   "+content/public/test",
   "+crypto",
   "+google_apis",
-  "+jni",
   "+mojo/public/cpp/bindings",
   "+net",
   "+services/network/public/cpp",
diff --git a/components/spellcheck/browser/android/BUILD.gn b/components/spellcheck/browser/android/BUILD.gn
index 29299405..74404fcc 100644
--- a/components/spellcheck/browser/android/BUILD.gn
+++ b/components/spellcheck/browser/android/BUILD.gn
@@ -8,7 +8,6 @@
   sources = [
     "java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java",
   ]
-  jni_package = "components/spellcheck"
 }
 
 android_library("java") {
diff --git a/components/spellcheck/browser/spellchecker_session_bridge_android.cc b/components/spellcheck/browser/spellchecker_session_bridge_android.cc
index ab3b84d..7b14971 100644
--- a/components/spellcheck/browser/spellchecker_session_bridge_android.cc
+++ b/components/spellcheck/browser/spellchecker_session_bridge_android.cc
@@ -10,10 +10,10 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/metrics/histogram_macros.h"
+#include "components/spellcheck/browser/android/jni_headers/SpellCheckerSessionBridge_jni.h"
 #include "components/spellcheck/common/spellcheck_result.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_process_host.h"
-#include "jni/SpellCheckerSessionBridge_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/components/sync/android/BUILD.gn b/components/sync/android/BUILD.gn
index 158f5b4..1d8373eb 100644
--- a/components/sync/android/BUILD.gn
+++ b/components/sync/android/BUILD.gn
@@ -66,5 +66,4 @@
   sources = [
     "java/src/org/chromium/components/sync/ModelTypeHelper.java",
   ]
-  jni_package = "syncer"
 }
diff --git a/components/sync/android/DEPS b/components/sync/android/DEPS
index e65545e..1779fac 100644
--- a/components/sync/android/DEPS
+++ b/components/sync/android/DEPS
@@ -2,6 +2,5 @@
   "+components/signin/core/browser/android",
   "+components/sync/base",
   "+components/sync/test/android", # For sync test tools
-  "+jni",
   "+third_party/cacheinvalidation",  # For imports in sync/notifier.
 ]
diff --git a/components/sync/android/model_type_helper.cc b/components/sync/android/model_type_helper.cc
index 8b5ee663..dbb13a4e 100644
--- a/components/sync/android/model_type_helper.cc
+++ b/components/sync/android/model_type_helper.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
+#include "components/sync/android/jni_headers/ModelTypeHelper_jni.h"
 #include "components/sync/base/model_type.h"
-#include "jni/ModelTypeHelper_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::ScopedJavaLocalRef;
diff --git a/components/sync/test/DEPS b/components/sync/test/DEPS
index f3e79d2..c70bcd3 100644
--- a/components/sync/test/DEPS
+++ b/components/sync/test/DEPS
@@ -3,7 +3,4 @@
   "+components/sync",
   "+net",
   '+services/network/public/cpp',
-
-  # For generated JNI code.
-  "+jni",
 ]
diff --git a/components/sync/test/fake_server/BUILD.gn b/components/sync/test/fake_server/BUILD.gn
index 3e777ef8..3a1bef42 100644
--- a/components/sync/test/fake_server/BUILD.gn
+++ b/components/sync/test/fake_server/BUILD.gn
@@ -44,7 +44,6 @@
 if (is_android) {
   generate_jni("fake_server_jni") {
     testonly = true
-    jni_package = "sync/test/fake_server"
     sources = [
       "//chrome/android/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java",
     ]
diff --git a/components/sync/test/fake_server/android/fake_server_helper_android.cc b/components/sync/test/fake_server/android/fake_server_helper_android.cc
index 88625c8..994bf83 100644
--- a/components/sync/test/fake_server/android/fake_server_helper_android.cc
+++ b/components/sync/test/fake_server/android/fake_server_helper_android.cc
@@ -19,9 +19,9 @@
 #include "components/sync/protocol/sync.pb.h"
 #include "components/sync/test/fake_server/bookmark_entity_builder.h"
 #include "components/sync/test/fake_server/fake_server.h"
+#include "components/sync/test/fake_server/fake_server_jni/FakeServerHelper_jni.h"
 #include "components/sync/test/fake_server/fake_server_network_resources.h"
 #include "components/sync/test/fake_server/fake_server_verifier.h"
-#include "jni/FakeServerHelper_jni.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
diff --git a/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java b/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java
index 4dd17dd2..7d6bb18 100644
--- a/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java
+++ b/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java
@@ -6,6 +6,7 @@
 
 import android.content.Context;
 
+import org.chromium.base.ApplicationStatus;
 import org.chromium.base.PathUtils;
 import org.chromium.native_test.NativeBrowserTestApplication;
 
@@ -20,6 +21,8 @@
         super.attachBaseContext(base);
 
         if (isBrowserProcess()) {
+            ApplicationStatus.initialize(this);
+
             // Test-only stuff, see also NativeUnitTest.java.
             PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
         }
diff --git a/components/url_formatter/DEPS b/components/url_formatter/DEPS
index 5451f010..70359141 100644
--- a/components/url_formatter/DEPS
+++ b/components/url_formatter/DEPS
@@ -4,7 +4,6 @@
   "-content",
   "-ios",
 
-  "+jni",
   "+net",
   "+ui/gfx",
 ]
diff --git a/components/url_formatter/android/BUILD.gn b/components/url_formatter/android/BUILD.gn
index 9070dc77..12273aad 100644
--- a/components/url_formatter/android/BUILD.gn
+++ b/components/url_formatter/android/BUILD.gn
@@ -17,6 +17,4 @@
   sources = [
     "java/src/org/chromium/components/url_formatter/UrlFormatter.java",
   ]
-
-  jni_package = "url_formatter"
 }
diff --git a/components/url_formatter/url_formatter_android.cc b/components/url_formatter/url_formatter_android.cc
index acc0e01..5226b0ab 100644
--- a/components/url_formatter/url_formatter_android.cc
+++ b/components/url_formatter/url_formatter_android.cc
@@ -6,10 +6,10 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
+#include "components/url_formatter/android/jni_headers/UrlFormatter_jni.h"
 #include "components/url_formatter/elide_url.h"
 #include "components/url_formatter/url_fixer.h"
 #include "components/url_formatter/url_formatter.h"
-#include "jni/UrlFormatter_jni.h"
 #include "url/gurl.h"
 
 using base::android::JavaParamRef;
diff --git a/components/variations/BUILD.gn b/components/variations/BUILD.gn
index 6349f45..a11a63e 100644
--- a/components/variations/BUILD.gn
+++ b/components/variations/BUILD.gn
@@ -92,7 +92,6 @@
       "android/java/src/org/chromium/components/variations/VariationsAssociatedData.java",
       "android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java",
     ]
-    jni_package = "variations"
   }
 
   android_library("load_seed_result_enum_java") {
diff --git a/components/variations/android/DEPS b/components/variations/android/DEPS
index c80012b5..fc3054b 100644
--- a/components/variations/android/DEPS
+++ b/components/variations/android/DEPS
@@ -1,3 +1,3 @@
 include_rules = [
-  "+jni",
+  "+components/variations/jni",
 ]
diff --git a/components/variations/android/variations_associated_data_android.cc b/components/variations/android/variations_associated_data_android.cc
index 043ed0a73..b4d1439 100644
--- a/components/variations/android/variations_associated_data_android.cc
+++ b/components/variations/android/variations_associated_data_android.cc
@@ -5,9 +5,9 @@
 #include <string>
 
 #include "base/android/jni_string.h"
+#include "components/variations/jni/VariationsAssociatedData_jni.h"
 #include "components/variations/variations_associated_data.h"
 #include "components/variations/variations_http_header_provider.h"
-#include "jni/VariationsAssociatedData_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::ConvertUTF8ToJavaString;
diff --git a/components/variations/android/variations_seed_bridge.cc b/components/variations/android/variations_seed_bridge.cc
index e9a5ddc..c3c4a71f 100644
--- a/components/variations/android/variations_seed_bridge.cc
+++ b/components/variations/android/variations_seed_bridge.cc
@@ -12,7 +12,7 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/android/jni_weak_ref.h"
-#include "jni/VariationsSeedBridge_jni.h"
+#include "components/variations/jni/VariationsSeedBridge_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/components/version_info/DEPS b/components/version_info/DEPS
index 96b3c13..e6cdafe9 100644
--- a/components/version_info/DEPS
+++ b/components/version_info/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "+components/strings/grit/components_strings.h",
-  "+jni",
+  "+components/version_info/android/version_constants_bridge_jni",
   "+ui/base",
 
   # version_info is used on iOS and thus cannot depend on //content.
diff --git a/components/version_info/android/BUILD.gn b/components/version_info/android/BUILD.gn
index 40f05812..25baa6e 100644
--- a/components/version_info/android/BUILD.gn
+++ b/components/version_info/android/BUILD.gn
@@ -59,5 +59,4 @@
   sources = [
     "java/src/org/chromium/components/version_info/VersionConstantsBridge.java",
   ]
-  jni_package = "version_constants_bridge"
 }
diff --git a/components/version_info/android/channel_getter.cc b/components/version_info/android/channel_getter.cc
index 2d97192..f40eda8 100644
--- a/components/version_info/android/channel_getter.cc
+++ b/components/version_info/android/channel_getter.cc
@@ -4,7 +4,7 @@
 
 #include "components/version_info/android/channel_getter.h"
 
-#include "jni/VersionConstantsBridge_jni.h"
+#include "components/version_info/android/version_constants_bridge_jni/VersionConstantsBridge_jni.h"
 
 namespace version_info {
 namespace android {
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 24b829372..e078dab5 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -543,7 +543,6 @@
   }
 
   generate_jni("service_jni_headers") {
-    jni_package = "components/viz/service"
     sources = [
       "java/src/org/chromium/components/viz/service/frame_sinks/ExternalBeginFrameSourceAndroid.java",
       "java/src/org/chromium/components/viz/service/gl/ThrowUncaughtException.java",
diff --git a/components/viz/service/frame_sinks/DEPS b/components/viz/service/frame_sinks/DEPS
index fc9f38b..93c4349 100644
--- a/components/viz/service/frame_sinks/DEPS
+++ b/components/viz/service/frame_sinks/DEPS
@@ -16,6 +16,6 @@
     "+third_party/khronos/GLES2",
   ],
   "external_begin_frame_source_android.cc": [
-    "+jni/ExternalBeginFrameSourceAndroid_jni.h",
+    "+components/viz/service/service_jni_headers/ExternalBeginFrameSourceAndroid_jni.h",
   ],
 }
diff --git a/components/viz/service/frame_sinks/external_begin_frame_source_android.cc b/components/viz/service/frame_sinks/external_begin_frame_source_android.cc
index 5dc7b0b..40a333a 100644
--- a/components/viz/service/frame_sinks/external_begin_frame_source_android.cc
+++ b/components/viz/service/frame_sinks/external_begin_frame_source_android.cc
@@ -5,7 +5,7 @@
 #include "components/viz/service/frame_sinks/external_begin_frame_source_android.h"
 
 #include "base/android/jni_android.h"
-#include "jni/ExternalBeginFrameSourceAndroid_jni.h"
+#include "components/viz/service/service_jni_headers/ExternalBeginFrameSourceAndroid_jni.h"
 
 namespace viz {
 
diff --git a/components/viz/service/gl/DEPS b/components/viz/service/gl/DEPS
index 14263ed..acdf01c 100644
--- a/components/viz/service/gl/DEPS
+++ b/components/viz/service/gl/DEPS
@@ -4,6 +4,7 @@
   "+components/arc/video_accelerator",
   "+components/chromeos_camera",
   "+components/crash/core/common/crash_key.h",
+  "+components/viz/service/service_jni_headers",
   "+gpu/command_buffer",
   "+gpu/config",
   "+gpu/ipc",
@@ -11,7 +12,6 @@
   "+gpu/ipc/service",
   "+gpu/vulkan",
   "+ipc",
-  "+jni",
   "+media/gpu",
   "+media/mojo",
   "+mojo/public/cpp",
diff --git a/components/viz/service/gl/throw_uncaught_exception.cc b/components/viz/service/gl/throw_uncaught_exception.cc
index 729d9e4..a51a91e 100644
--- a/components/viz/service/gl/throw_uncaught_exception.cc
+++ b/components/viz/service/gl/throw_uncaught_exception.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_android.h"
 
-#include "jni/ThrowUncaughtException_jni.h"
+#include "components/viz/service/service_jni_headers/ThrowUncaughtException_jni.h"
 
 namespace viz {
 
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc
index 096d5dd7..27860ca 100644
--- a/content/browser/accessibility/accessibility_win_browsertest.cc
+++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -1696,7 +1696,7 @@
         offset, IA2_COORDTYPE_SCREEN_RELATIVE, &x, &y, &width, &height));
     EXPECT_EQ(prev_x, x);
     EXPECT_EQ(prev_y, y);
-    EXPECT_EQ(1, width);
+    EXPECT_EQ(7, width);
     EXPECT_EQ(prev_height, height);
   }
 }
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 8903c77..2ea0b2e 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -252,8 +252,6 @@
 
   BrowserAccessibility* last_focused_node = GetLastFocusedNode();
   if (focus != last_focused_node) {
-    if (last_focused_node)
-      OnFocusLost(last_focused_node);
     if (focus)
       FireFocusEvent(focus);
   }
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h
index 78efe6d..5c3fc29 100644
--- a/content/browser/accessibility/browser_accessibility_manager.h
+++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -160,9 +160,6 @@
   // the frame tree has focus. If focus has changed, calls FireFocusEvent.
   void FireFocusEventsIfNeeded();
 
-  // Send the events triggered when a node lose focus.
-  virtual void OnFocusLost(BrowserAccessibility* node) {}
-
   // Return whether or not we are currently able to fire events.
   virtual bool CanFireEvents();
 
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc
index 0c460ba..2afe87ea 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc
@@ -395,11 +395,6 @@
   }
 }
 
-void BrowserAccessibilityManagerWin::OnFocusLost(BrowserAccessibility* node) {
-  BrowserAccessibilityManager::OnFocusLost(node);
-  DCHECK(node);
-}
-
 void BrowserAccessibilityManagerWin::FireWinAccessibilityEvent(
     LONG win_event_type,
     BrowserAccessibility* node) {
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.h b/content/browser/accessibility/browser_accessibility_manager_win.h
index 13ea393..74e818b 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.h
+++ b/content/browser/accessibility/browser_accessibility_manager_win.h
@@ -58,8 +58,6 @@
   void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
                           BrowserAccessibility* node) override;
 
-  void OnFocusLost(BrowserAccessibility* node) override;
-
   void FireWinAccessibilityEvent(LONG win_event, BrowserAccessibility* node);
   void FireUiaAccessibilityEvent(LONG uia_event, BrowserAccessibility* node);
   void FireUiaPropertyChangedEvent(LONG uia_property,
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 5c941456..c3c10eb 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -773,7 +773,7 @@
   return nullptr;
 }
 
-const std::string& BrowserContext::UniqueId() const {
+const std::string& BrowserContext::UniqueId() {
   return unique_id_;
 }
 
diff --git a/content/browser/loader/cross_site_document_blocking_browsertest.cc b/content/browser/loader/cross_site_document_blocking_browsertest.cc
index 4721675c..7403e84c 100644
--- a/content/browser/loader/cross_site_document_blocking_browsertest.cc
+++ b/content/browser/loader/cross_site_document_blocking_browsertest.cc
@@ -109,30 +109,19 @@
         expected_lock_compatibility, 1);
   }
 
-  std::string bucket;
   CorbMimeType expected_mime_type = CorbMimeType::kInvalidMimeType;
   if (base::MatchPattern(resource_name, "*.html")) {
-    bucket = "HTML";
     expected_mime_type = CorbMimeType::kHtml;
   } else if (base::MatchPattern(resource_name, "*.xml")) {
-    bucket = "XML";
     expected_mime_type = CorbMimeType::kXml;
   } else if (base::MatchPattern(resource_name, "*.json")) {
-    bucket = "JSON";
     expected_mime_type = CorbMimeType::kJson;
   } else if (base::MatchPattern(resource_name, "*.txt")) {
-    bucket = "Plain";
     expected_mime_type = CorbMimeType::kPlain;
   } else if (base::MatchPattern(resource_name, "*.zip") ||
              base::MatchPattern(resource_name, "*.pdf")) {
-    // SiteIsolation.XSD.Browser.Blocked* histograms are only logged from the
-    // pre-kNetworkService code.  Because of this we did not add
-    // SiteIsolation.XSD.Browser.Blocked.NonSniffed histogram.  An empty
-    // |bucket| value indicates that the test should not expect a histogram.
-    bucket = "";
     expected_mime_type = CorbMimeType::kNeverSniffed;
   } else {
-    bucket = "Others";
     expected_mime_type = CorbMimeType::kOthers;
   }
 
@@ -142,15 +131,6 @@
   base::HistogramTester::CountsMap expected_counts;
   std::string base = "SiteIsolation.XSD.Browser";
   expected_counts[base + ".Action"] = 2;
-  if ((base::MatchPattern(resource_name, "*prefixed*") || bucket == "Others") &&
-      (0 != (expectations & kShouldBeBlocked)) && !is_restricted_uma_expected) {
-    expected_counts[base + ".BlockedForParserBreaker"] = 1;
-  }
-  if (0 != (expectations & kShouldBeBlocked && !is_restricted_uma_expected)) {
-    expected_counts[base + ".Blocked"] = 1;
-    if (!bucket.empty())
-      expected_counts[base + ".Blocked." + bucket] = 1;
-  }
   if (0 != (expectations & kShouldBeBlocked)) {
     expected_counts[base + ".Blocked.CanonicalMimeType"] = 1;
   }
@@ -168,18 +148,6 @@
                 testing::ElementsAre(
                     base::Bucket(static_cast<int>(expected_mime_type), 1)))
         << "The wrong CorbMimeType bucket was incremented.";
-    if (!is_restricted_uma_expected) {
-      EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked"),
-                  testing::ElementsAre(
-                      base::Bucket(static_cast<int>(resource_type), 1)))
-          << "The wrong Blocked bucket was incremented.";
-      if (!bucket.empty()) {
-        EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked." + bucket),
-                    testing::ElementsAre(
-                        base::Bucket(static_cast<int>(resource_type), 1)))
-            << "The wrong Blocked bucket was incremented.";
-      }
-    }
   }
 
   // SiteIsolation.XSD.Browser.Action should always include kResponseStarted.
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc
index b18f228..c432d2d 100644
--- a/content/browser/loader/cross_site_document_resource_handler.cc
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
@@ -67,53 +67,6 @@
 
 }  // namespace
 
-void CrossSiteDocumentResourceHandler::LogBlockedResponse(
-    ResourceRequestInfoImpl* resource_request_info,
-    int http_response_code) {
-  DCHECK(resource_request_info);
-  DCHECK(analyzer_);
-  DCHECK_NE(network::CrossOriginReadBlocking::MimeType::kInvalidMimeType,
-            analyzer_->canonical_mime_type());
-
-  analyzer_->LogBlockedResponse();
-
-  ResourceType resource_type = resource_request_info->GetResourceType();
-  UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked", resource_type);
-  switch (analyzer_->canonical_mime_type()) {
-    case MimeType::kHtml:
-      UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.HTML",
-                                resource_type);
-      break;
-    case MimeType::kXml:
-      UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.XML",
-                                resource_type);
-      break;
-    case MimeType::kJson:
-      UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.JSON",
-                                resource_type);
-      break;
-    case MimeType::kPlain:
-      UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Plain",
-                                resource_type);
-      break;
-    case MimeType::kOthers:
-      UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Others",
-                                resource_type);
-      break;
-
-    case MimeType::kNeverSniffed:
-      break;
-
-    case MimeType::kInvalidMimeType:
-      NOTREACHED();
-      break;
-  }
-  if (analyzer_->found_parser_breaker()) {
-    UMA_HISTOGRAM_ENUMERATION(
-        "SiteIsolation.XSD.Browser.BlockedForParserBreaker", resource_type);
-  }
-}
-
 // ResourceController that runs a closure on Resume(), and forwards failures
 // back to CrossSiteDocumentHandler. The closure can optionally be run as
 // a PostTask.
@@ -464,7 +417,7 @@
                      : "null",
                  "url", request()->url().spec());
 
-    LogBlockedResponse(info, analyzer_->http_response_code());
+    analyzer_->LogBlockedResponse();
 
     // Block the response and throw away the data.  Report zero bytes read.
     blocked_read_completed_ = true;
diff --git a/content/browser/loader/cross_site_document_resource_handler.h b/content/browser/loader/cross_site_document_resource_handler.h
index b644e97..dcb9722 100644
--- a/content/browser/loader/cross_site_document_resource_handler.h
+++ b/content/browser/loader/cross_site_document_resource_handler.h
@@ -106,10 +106,6 @@
   // |next_handler_| in response to OnWillRead.
   void StopLocalBuffering(bool copy_data_to_next_handler);
 
-  // Helper for UMA logging.
-  void LogBlockedResponse(ResourceRequestInfoImpl* resource_request_info,
-                          int http_response_code);
-
   // WeakPtrFactory for |next_handler_|.
   base::WeakPtrFactory<ResourceHandler> weak_next_handler_;
 
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 d8ea78c..c7f9ea5 100644
--- a/content/browser/loader/cross_site_document_resource_handler_unittest.cc
+++ b/content/browser/loader/cross_site_document_resource_handler_unittest.cc
@@ -1843,32 +1843,20 @@
   // Verify that histograms are correctly incremented.
   base::HistogramTester::CountsMap expected_counts;
   std::string histogram_base = "SiteIsolation.XSD.Browser";
-  std::string bucket;
   switch (scenario.canonical_mime_type) {
     case MimeType::kHtml:
-      bucket = "HTML";
-      break;
     case MimeType::kXml:
-      bucket = "XML";
-      break;
     case MimeType::kJson:
-      bucket = "JSON";
-      break;
     case MimeType::kPlain:
-      bucket = "Plain";
-      break;
     case MimeType::kOthers:
-      bucket = "Others";
       break;
     case MimeType::kNeverSniffed:
       DCHECK_EQ(Verdict::kBlock, scenario.verdict);
       DCHECK_EQ(-1, scenario.verdict_packet);
-      bucket = "Blocked without sniffing / no bucket";
       break;
     case MimeType::kInvalidMimeType:
       DCHECK_EQ(Verdict::kAllow, scenario.verdict);
       DCHECK_EQ(-1, scenario.verdict_packet);
-      bucket = "Allowed without considering the MIME type / no bucket";
       break;
   }
   int start_action = static_cast<int>(
@@ -1890,40 +1878,14 @@
     NOTREACHED();
   }
 
-  // The parser-breaker detection only on responses that are not blocked by
-  // normal mime-sniffing.
-  bool scenario_requires_parser_breaker_detection =
-      (network::CrossOriginReadBlocking::kYes ==
-       network::CrossOriginReadBlocking::SniffForFetchOnlyResource(
-           scenario.data())) &&
-      !((network::CrossOriginReadBlocking::kYes ==
-         network::CrossOriginReadBlocking::SniffForJSON(scenario.data())) &&
-        (scenario.canonical_mime_type == MimeType::kJson ||
-         scenario.canonical_mime_type == MimeType::kPlain));
-  if (should_be_blocked && expected_to_sniff &&
-      scenario_requires_parser_breaker_detection) {
-    expected_counts[histogram_base + ".BlockedForParserBreaker"] = 1;
-  }
-
   // Expecting two actions: ResponseStarted and one of the outcomes.
   expected_counts[histogram_base + ".Action"] = 2;
   EXPECT_THAT(histograms.GetAllSamples(histogram_base + ".Action"),
               testing::ElementsAre(base::Bucket(start_action, 1),
                                    base::Bucket(end_action, 1)))
       << "Should have incremented the right actions.";
-  if (should_be_blocked) {
-    expected_counts[histogram_base + ".Blocked"] = 1;
+  if (should_be_blocked)
     expected_counts[histogram_base + ".Blocked.CanonicalMimeType"] = 1;
-    expected_counts[histogram_base + ".Blocked." + bucket] = 1;
-    EXPECT_THAT(histograms.GetAllSamples(histogram_base + ".Blocked"),
-                testing::ElementsAre(
-                    base::Bucket(static_cast<int>(scenario.resource_type), 1)))
-        << "Should have incremented aggregate blocking.";
-    EXPECT_THAT(histograms.GetAllSamples(histogram_base + ".Blocked." + bucket),
-                testing::ElementsAre(
-                    base::Bucket(static_cast<int>(scenario.resource_type), 1)))
-        << "Should have incremented blocking for resource type.";
-  }
   // Make sure that the expected metrics, and only those metrics, were
   // incremented.
   EXPECT_THAT(histograms.GetTotalCountsForPrefix("SiteIsolation.XSD.Browser"),
diff --git a/content/browser/network_service_instance_impl.cc b/content/browser/network_service_instance_impl.cc
index 9304b41d..a0f1fde 100644
--- a/content/browser/network_service_instance_impl.cc
+++ b/content/browser/network_service_instance_impl.cc
@@ -96,8 +96,8 @@
     return;
   }
 
-  GetLocalNetworkService() = std::make_unique<network::NetworkService>(
-      nullptr, std::move(request), GetContentClient()->browser()->GetNetLog());
+  GetLocalNetworkService() =
+      std::make_unique<network::NetworkService>(nullptr, std::move(request));
 }
 
 void BindNetworkChangeManagerRequest(
@@ -248,8 +248,8 @@
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   DCHECK(!base::FeatureList::IsEnabled(network::features::kNetworkService));
   if (!GetLocalNetworkService()) {
-    GetLocalNetworkService() = std::make_unique<network::NetworkService>(
-        nullptr, nullptr, GetContentClient()->browser()->GetNetLog());
+    GetLocalNetworkService() =
+        std::make_unique<network::NetworkService>(nullptr, nullptr);
   }
 
   return GetLocalNetworkService().get();
diff --git a/content/browser/picture_in_picture/picture_in_picture_window_controller_impl.h b/content/browser/picture_in_picture/picture_in_picture_window_controller_impl.h
index 7ecd12ff..4b918964 100644
--- a/content/browser/picture_in_picture/picture_in_picture_window_controller_impl.h
+++ b/content/browser/picture_in_picture/picture_in_picture_window_controller_impl.h
@@ -50,8 +50,6 @@
   CONTENT_EXPORT void Close(bool should_pause_video) override;
   CONTENT_EXPORT void CloseAndFocusInitiator() override;
   CONTENT_EXPORT void OnWindowDestroyed() override;
-  CONTENT_EXPORT void EmbedSurface(const viz::SurfaceId& surface_id,
-                                   const gfx::Size& natural_size) override;
   CONTENT_EXPORT OverlayWindow* GetWindowForTesting() override;
   CONTENT_EXPORT void UpdateLayerBounds() override;
   CONTENT_EXPORT bool IsPlayerActive() override;
@@ -86,6 +84,10 @@
   // state of this object.
   void UpdateMediaPlayerId();
 
+  // Embeds a surface in the Picture-in-Picture window.
+  void EmbedSurface(const viz::SurfaceId& surface_id,
+                    const gfx::Size& natural_size);
+
   // Sets the active Picture-in-Picture session associated with the controller.
   // This is different from the service's active session as there is one
   // controller per WebContents and one service per RenderFrameHost.
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 61ea618..db2145e 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -360,12 +360,6 @@
     last_devtools_frame_metadata_.emplace(metadata);
     // Android WebView ignores transparent background.
     is_transparent = false;
-    // Android WebView always uses a black background while fullscreen.
-    // This inadvertently happened in the past (see https://crbug.com/961223#c5)
-    // but has been the behavior for long enough that it's become standard.
-    // This ensures the behaviour is robust.
-    if (host()->delegate()->IsFullscreenForCurrentTab())
-      root_background_color = SK_ColorBLACK;
   }
 
   bool is_mobile_optimized = IsMobileOptimizedFrame(
@@ -443,6 +437,11 @@
   min_page_scale_ = metadata.min_page_scale_factor;
   max_page_scale_ = metadata.max_page_scale_factor;
   current_surface_size_ = metadata.viewport_size_in_pixels;
+
+  // With SurfaceSync we no longer call EvictFrameIfNecessary on every metadata
+  // change. We must still call UpdateWebViewBackgroundColorIfNecessary to
+  // maintain the associated background color changes.
+  UpdateWebViewBackgroundColorIfNecessary();
 }
 
 void RenderWidgetHostViewAndroid::Focus() {
@@ -997,6 +996,18 @@
   }
 }
 
+void RenderWidgetHostViewAndroid::UpdateWebViewBackgroundColorIfNecessary() {
+  // Before SurfaceSync, Android WebView had a bug the BG color was always set
+  // to black when fullscreen (see https://crbug.com/961223#c5). As
+  // applications came to rely on this behavior, preserve it here.
+  if (!features::IsSurfaceSynchronizationEnabled())
+    return;
+  if (!using_browser_compositor_ &&
+      host()->delegate()->IsFullscreenForCurrentTab()) {
+    SetContentBackgroundColor(SK_ColorBLACK);
+  }
+}
+
 void RenderWidgetHostViewAndroid::SubmitCompositorFrame(
     const viz::LocalSurfaceId& local_surface_id,
     viz::CompositorFrame frame,
@@ -2130,6 +2141,9 @@
 
 void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged() {
   EvictFrameIfNecessary();
+  // We may need to update the background color to match pre-surface-sync
+  // behavior of EvictFrameIfNecessary.
+  UpdateWebViewBackgroundColorIfNecessary();
   SynchronizeVisualProperties(
       cc::DeadlinePolicy::UseSpecifiedDeadline(
           ui::DelegatedFrameHostAndroid::ResizeTimeoutFrames()),
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 00f0346..1539d1e 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -396,6 +396,10 @@
 
   void EvictFrameIfNecessary();
 
+  // Helper function to update background color for WebView on fullscreen
+  // changes. See https://crbug.com/961223.
+  void UpdateWebViewBackgroundColorIfNecessary();
+
   // DevTools ScreenCast support for Android WebView.
   void SynchronousCopyContents(
       const gfx::Rect& src_subrect_dip,
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc
index 5d5176f..8e833827 100644
--- a/content/browser/service_manager/service_manager_context.cc
+++ b/content/browser/service_manager/service_manager_context.cc
@@ -272,8 +272,7 @@
   registry->AddInterface(base::BindRepeating(
       [](network::mojom::NetworkServiceTestRequest request) {}));
   return std::make_unique<network::NetworkService>(
-      std::move(registry), nullptr /* request */, nullptr /* net_log */,
-      std::move(service_request));
+      std::move(registry), nullptr /* request */, std::move(service_request));
 }
 
 bool AudioServiceOutOfProcess() {
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 4c564a8..96bcfc8 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -304,7 +304,7 @@
   }
 
   if (!GetContentClient()->browser()->AllowServiceWorker(
-          registration->scope(), provider_host_->site_for_cookies(),
+          registration->scope(), provider_host_->site_for_cookies(), GURL(),
           resource_context_, provider_host_->web_contents_getter())) {
     loader()->FallbackToNetwork();
     TRACE_EVENT_ASYNC_END1(
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
index bca1ff7a..ec04c735 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
@@ -157,6 +157,7 @@
   bool AllowServiceWorker(
       const GURL& scope,
       const GURL& first_party,
+      const GURL& script_url,
       content::ResourceContext* context,
       base::RepeatingCallback<WebContents*()> wc_getter) override {
     return false;
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index c8661214..c4adb32b 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -593,10 +593,12 @@
   service_worker_object_hosts_.erase(version_id);
 }
 
-bool ServiceWorkerProviderHost::AllowServiceWorker(const GURL& scope) {
+bool ServiceWorkerProviderHost::AllowServiceWorker(const GURL& scope,
+                                                   const GURL& script_url) {
   DCHECK(IsContextAlive());
   return GetContentClient()->browser()->AllowServiceWorker(
-      scope, site_for_cookies(), context_->wrapper()->resource_context(),
+      scope, site_for_cookies(), script_url,
+      context_->wrapper()->resource_context(),
       base::BindRepeating(&WebContentsImpl::FromRenderFrameHostID,
                           render_process_id_, frame_id()));
 }
@@ -922,7 +924,7 @@
     const GURL& script_url,
     blink::mojom::ServiceWorkerRegistrationOptionsPtr options,
     RegisterCallback callback) {
-  if (!CanServeContainerHostMethods(&callback, options->scope,
+  if (!CanServeContainerHostMethods(&callback, options->scope, script_url,
                                     kServiceWorkerRegisterErrorPrefix,
                                     nullptr)) {
     return;
@@ -1008,7 +1010,7 @@
 void ServiceWorkerProviderHost::GetRegistration(
     const GURL& client_url,
     GetRegistrationCallback callback) {
-  if (!CanServeContainerHostMethods(&callback, url(),
+  if (!CanServeContainerHostMethods(&callback, url(), GURL(),
                                     kServiceWorkerGetRegistrationErrorPrefix,
                                     nullptr)) {
     return;
@@ -1036,7 +1038,7 @@
 
 void ServiceWorkerProviderHost::GetRegistrations(
     GetRegistrationsCallback callback) {
-  if (!CanServeContainerHostMethods(&callback, url(),
+  if (!CanServeContainerHostMethods(&callback, url(), GURL(),
                                     kServiceWorkerGetRegistrationsErrorPrefix,
                                     base::nullopt)) {
     return;
@@ -1310,6 +1312,7 @@
 bool ServiceWorkerProviderHost::CanServeContainerHostMethods(
     CallbackType* callback,
     const GURL& scope,
+    const GURL& script_url,
     const char* error_prefix,
     Args... args) {
   if (!IsContextAlive()) {
@@ -1332,7 +1335,7 @@
     return false;
   }
 
-  if (!AllowServiceWorker(scope)) {
+  if (!AllowServiceWorker(scope, script_url)) {
     std::move(*callback).Run(
         blink::mojom::ServiceWorkerErrorType::kDisabled,
         std::string(error_prefix) +
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index 34c711d..1873aa4 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -385,7 +385,8 @@
   // settings allows service workers to run at |scope|. If this provider is for
   // a window client, the check involves the topmost frame url as well as
   // |scope|, and may display tab-level UI.
-  bool AllowServiceWorker(const GURL& scope);
+  // If non-empty, |script_url| is the script the service worker will run.
+  bool AllowServiceWorker(const GURL& scope, const GURL& script_url);
 
   // Called when our controller has been terminated and doomed due to an
   // exceptional condition like it could no longer be read from the script
@@ -569,12 +570,15 @@
   // Perform common checks that need to run before ContainerHost methods that
   // come from a child process are handled.
   // |scope| is checked if it is allowed to run a service worker.
+  // If non-empty, |script_url| is the script associated with the service
+  // worker.
   // Returns true if all checks have passed.
   // If anything looks wrong |callback| will run with an error
   // message prefixed by |error_prefix| and |args|, and false is returned.
   template <typename CallbackType, typename... Args>
   bool CanServeContainerHostMethods(CallbackType* callback,
                                     const GURL& scope,
+                                    const GURL& script_url,
                                     const char* error_prefix,
                                     Args... args);
 
diff --git a/content/browser/service_worker/service_worker_provider_host_unittest.cc b/content/browser/service_worker/service_worker_provider_host_unittest.cc
index b7042613..2a6c866 100644
--- a/content/browser/service_worker/service_worker_provider_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
@@ -49,10 +49,13 @@
 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient {
  public:
   struct AllowServiceWorkerCallLog {
-    AllowServiceWorkerCallLog(const GURL& scope, const GURL& first_party)
-        : scope(scope), first_party(first_party) {}
+    AllowServiceWorkerCallLog(const GURL& scope,
+                              const GURL& first_party,
+                              const GURL& script_url)
+        : scope(scope), first_party(first_party), script_url(script_url) {}
     const GURL scope;
     const GURL first_party;
+    const GURL script_url;
   };
 
   ServiceWorkerTestContentBrowserClient() {}
@@ -60,9 +63,10 @@
   bool AllowServiceWorker(
       const GURL& scope,
       const GURL& first_party,
+      const GURL& script_url,
       content::ResourceContext* context,
       base::RepeatingCallback<WebContents*()> wc_getter) override {
-    logs_.emplace_back(scope, first_party);
+    logs_.emplace_back(scope, first_party, script_url);
     return false;
   }
 
@@ -543,6 +547,8 @@
             test_browser_client.logs()[0].scope);
   EXPECT_EQ(GURL("https://www.example.com/top"),
             test_browser_client.logs()[0].first_party);
+  EXPECT_EQ(GURL("https://www.example.com/bar"),
+            test_browser_client.logs()[0].script_url);
 
   EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kDisabled,
             GetRegistration(remote_endpoint.host_ptr()->get(),
@@ -552,6 +558,7 @@
             test_browser_client.logs()[1].scope);
   EXPECT_EQ(GURL("https://www.example.com/top"),
             test_browser_client.logs()[1].first_party);
+  EXPECT_EQ(GURL(), test_browser_client.logs()[1].script_url);
 
   EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kDisabled,
             GetRegistrations(remote_endpoint.host_ptr()->get()));
@@ -560,6 +567,7 @@
             test_browser_client.logs()[2].scope);
   EXPECT_EQ(GURL("https://www.example.com/top"),
             test_browser_client.logs()[2].first_party);
+  EXPECT_EQ(GURL(), test_browser_client.logs()[2].script_url);
 
   SetBrowserClientForTesting(old_browser_client);
 }
@@ -583,7 +591,8 @@
   ContentBrowserClient* old_browser_client =
       SetBrowserClientForTesting(&test_browser_client);
 
-  EXPECT_FALSE(host->AllowServiceWorker(GURL("https://www.example.com/scope")));
+  EXPECT_FALSE(
+      host->AllowServiceWorker(GURL("https://www.example.com/scope"), GURL()));
 
   ASSERT_EQ(1ul, test_browser_client.logs().size());
   EXPECT_EQ(GURL("https://www.example.com/scope"),
diff --git a/content/browser/service_worker/service_worker_registration_object_host.cc b/content/browser/service_worker/service_worker_registration_object_host.cc
index f0903c6..4a1f47f 100644
--- a/content/browser/service_worker/service_worker_registration_object_host.cc
+++ b/content/browser/service_worker/service_worker_registration_object_host.cc
@@ -469,7 +469,7 @@
     return false;
   }
 
-  if (!provider_host_->AllowServiceWorker(registration_->scope())) {
+  if (!provider_host_->AllowServiceWorker(registration_->scope(), GURL())) {
     std::move(*callback).Run(
         blink::mojom::ServiceWorkerErrorType::kDisabled,
         std::string(error_prefix) +
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc
index 260c90b..540a04cf 100644
--- a/content/browser/service_worker/service_worker_registration_unittest.cc
+++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -84,6 +84,7 @@
   bool AllowServiceWorker(
       const GURL& scope,
       const GURL& first_party,
+      const GURL& script_url,
       content::ResourceContext* context,
       base::RepeatingCallback<WebContents*()> wc_getter) override {
     return false;
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index d1a8e9c..fa6fd922 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -2065,7 +2065,7 @@
   // resource_context() can return null in unit tests.
   if ((context_->wrapper()->resource_context() &&
        !GetContentClient()->browser()->AllowServiceWorker(
-           scope_, scope_, context_->wrapper()->resource_context(),
+           scope_, scope_, script_url_, context_->wrapper()->resource_context(),
            base::NullCallback()))) {
     return false;
   }
diff --git a/content/browser/tracing/background_tracing_manager_impl.cc b/content/browser/tracing/background_tracing_manager_impl.cc
index d4ab269..c89e06b 100644
--- a/content/browser/tracing/background_tracing_manager_impl.cc
+++ b/content/browser/tracing/background_tracing_manager_impl.cc
@@ -99,20 +99,21 @@
 void BackgroundTracingManagerImpl::ActivateForProcess(
     int child_process_id,
     mojom::ChildControl* child_control) {
+  // NOTE: Called from any thread.
+
   mojo::PendingRemote<tracing::mojom::BackgroundTracingAgentProvider>
       pending_provider;
   child_control->GetBackgroundTracingAgentProvider(
       pending_provider.InitWithNewPipeAndPassReceiver());
 
-  if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
-    base::PostTaskWithTraits(
-        FROM_HERE, {BrowserThread::UI},
-        base::BindOnce(&BackgroundTracingAgentClientImpl::Create,
-                       child_process_id, std::move(pending_provider)));
-    return;
-  }
-  BackgroundTracingAgentClientImpl::Create(child_process_id,
-                                           std::move(pending_provider));
+  auto constructor =
+      base::BindOnce(&BackgroundTracingAgentClientImpl::Create,
+                     child_process_id, std::move(pending_provider));
+
+  base::PostTaskWithTraits(
+      FROM_HERE, {BrowserThread::UI},
+      base::BindOnce(&BackgroundTracingManagerImpl::AddPendingAgentConstructor,
+                     std::move(constructor)));
 }
 
 BackgroundTracingManagerImpl::BackgroundTracingManagerImpl()
@@ -289,6 +290,8 @@
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   agent_observers_.insert(observer);
 
+  MaybeConstructPendingAgents();
+
   for (auto* agent : agents_) {
     observer->OnAgentAdded(agent);
   }
@@ -481,4 +484,27 @@
   }
 }
 
+// static
+void BackgroundTracingManagerImpl::AddPendingAgentConstructor(
+    base::OnceClosure constructor) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+  // Stash away the parameters here, and delay agent initialization until we
+  // have an interested AgentObserver.
+
+  GetInstance()->pending_agent_constructors_.push_back(std::move(constructor));
+  GetInstance()->MaybeConstructPendingAgents();
+}
+
+void BackgroundTracingManagerImpl::MaybeConstructPendingAgents() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+  if (agent_observers_.empty())
+    return;
+
+  for (auto& constructor : pending_agent_constructors_)
+    std::move(constructor).Run();
+  pending_agent_constructors_.clear();
+}
+
 }  // namespace content
diff --git a/content/browser/tracing/background_tracing_manager_impl.h b/content/browser/tracing/background_tracing_manager_impl.h
index 88b44c09c..e5c1f780 100644
--- a/content/browser/tracing/background_tracing_manager_impl.h
+++ b/content/browser/tracing/background_tracing_manager_impl.h
@@ -9,6 +9,7 @@
 #include <memory>
 #include <set>
 #include <string>
+#include <vector>
 
 #include "base/macros.h"
 #include "content/browser/tracing/background_tracing_config_impl.h"
@@ -87,6 +88,7 @@
 
   CONTENT_EXPORT static BackgroundTracingManagerImpl* GetInstance();
 
+  // Callable from any thread.
   static void ActivateForProcess(int child_process_id,
                                  mojom::ChildControl* child_control);
 
@@ -149,6 +151,8 @@
       perfetto::protos::pbzero::ChromeMetadataPacket* metadata);
   bool IsTriggerHandleValid(TriggerHandle handle) const;
   void OnScenarioAborted();
+  static void AddPendingAgentConstructor(base::OnceClosure constructor);
+  void MaybeConstructPendingAgents();
 
   std::unique_ptr<BackgroundTracingActiveScenario> active_scenario_;
 
@@ -162,6 +166,8 @@
   std::set<tracing::mojom::BackgroundTracingAgent*> agents_;
   std::set<AgentObserver*> agent_observers_;
 
+  std::vector<base::OnceClosure> pending_agent_constructors_;
+
   IdleCallback idle_callback_;
   base::RepeatingClosure tracing_enabled_callback_for_testing_;
 
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index 1d65e03..05a78a2 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -248,12 +248,12 @@
 #endif
 
   // Returns the path of the directory where this context's data is stored.
-  virtual base::FilePath GetPath() const = 0;
+  virtual base::FilePath GetPath() = 0;
 
   // Return whether this context is off the record. Default is false.
   // Note that for Chrome this does not imply Incognito as Guest sessions are
   // also off the record.
-  virtual bool IsOffTheRecord() const = 0;
+  virtual bool IsOffTheRecord() = 0;
 
   // Returns the resource context.
   virtual ResourceContext* GetResourceContext() = 0;
@@ -331,7 +331,7 @@
       service_manager::mojom::ServiceRequest request);
 
   // Returns a unique string associated with this browser context.
-  virtual const std::string& UniqueId() const;
+  virtual const std::string& UniqueId();
 
   // Returns a random salt string that is used for creating media device IDs.
   // Returns a random string by default.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 514fddc..1bbeb6b 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -298,6 +298,7 @@
 bool ContentBrowserClient::AllowServiceWorker(
     const GURL& scope,
     const GURL& first_party,
+    const GURL& script_url,
     ResourceContext* context,
     base::RepeatingCallback<WebContents*()> wc_getter) {
   return true;
@@ -539,10 +540,6 @@
   return nullptr;
 }
 
-net::NetLog* ContentBrowserClient::GetNetLog() {
-  return nullptr;
-}
-
 base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
   return base::FilePath();
 }
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 8d179ac4..163694c7 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -122,7 +122,6 @@
 using ClientCertIdentityList = std::vector<std::unique_ptr<ClientCertIdentity>>;
 class ClientCertStore;
 class CookieStore;
-class NetLog;
 class SSLCertRequestInfo;
 class SSLInfo;
 class URLRequest;
@@ -540,14 +539,23 @@
                              const GURL& first_party,
                              ResourceContext* context);
 
-  // Allow the embedder to control if a Service Worker can be associated
-  // with the given scope.
+  // Allows the embedder to control if a service worker is allowed at the given
+  // |scope| and can be accessed from |first_party|. This function is called
+  // whenever an attempt is made to create or access the persistent state of the
+  // registration, or to start the service worker.
+  //
+  // If non-empty, |script_url| is the script of the service worker that is
+  // attempted to be registered or started. If it's empty, an attempt is being
+  // made to access the registration but there is no specific service worker in
+  // the registration being acted on.
+  //
   // A null |wc_getter| callback indicates this is for starting a service
   // worker, which is not necessarily associated with a particular tab.
   // This is called on the IO thread.
   virtual bool AllowServiceWorker(
       const GURL& scope,
       const GURL& first_party,
+      const GURL& script_url,
       ResourceContext* context,
       base::RepeatingCallback<WebContents*()> wc_getter);
 
@@ -825,9 +833,6 @@
   // Allows the embedder to return a TTS platform implementation.
   virtual TtsPlatform* GetTtsPlatform();
 
-  // Getter for the net logging object. This can be called on any thread.
-  virtual net::NetLog* GetNetLog();
-
   // Called by WebContents to override the WebKit preferences that are used by
   // the renderer. The content layer will add its own settings, and then it's up
   // to the embedder to update it if it wants.
diff --git a/content/public/browser/picture_in_picture_window_controller.h b/content/public/browser/picture_in_picture_window_controller.h
index 2c03c0d..884eabc 100644
--- a/content/public/browser/picture_in_picture_window_controller.h
+++ b/content/public/browser/picture_in_picture_window_controller.h
@@ -7,14 +7,6 @@
 
 #include "content/common/content_export.h"
 
-namespace gfx {
-class Size;
-}  // namespace gfx
-
-namespace viz {
-class SurfaceId;
-}  // namespace viz
-
 namespace content {
 class OverlayWindow;
 class WebContents;
@@ -48,8 +40,6 @@
   // window was requested to be closed and destroyed by the system.
   virtual void OnWindowDestroyed() = 0;
 
-  virtual void EmbedSurface(const viz::SurfaceId& surface_id,
-                            const gfx::Size& natural_size) = 0;
   virtual OverlayWindow* GetWindowForTesting() = 0;
   virtual void UpdateLayerBounds() = 0;
   virtual bool IsPlayerActive() = 0;
diff --git a/content/public/test/test_browser_context.cc b/content/public/test/test_browser_context.cc
index 7e9d7be..8e6100c 100644
--- a/content/public/test/test_browser_context.cc
+++ b/content/public/test/test_browser_context.cc
@@ -101,7 +101,7 @@
   return request_context_.get();
 }
 
-base::FilePath TestBrowserContext::GetPath() const {
+base::FilePath TestBrowserContext::GetPath() {
   return browser_context_dir_.GetPath();
 }
 
@@ -112,7 +112,7 @@
 }
 #endif  // !defined(OS_ANDROID)
 
-bool TestBrowserContext::IsOffTheRecord() const {
+bool TestBrowserContext::IsOffTheRecord() {
   return is_off_the_record_;
 }
 
diff --git a/content/public/test/test_browser_context.h b/content/public/test/test_browser_context.h
index 6947416a..2314463 100644
--- a/content/public/test/test_browser_context.h
+++ b/content/public/test/test_browser_context.h
@@ -44,12 +44,12 @@
   }
 
   // BrowserContext implementation.
-  base::FilePath GetPath() const override;
+  base::FilePath GetPath() override;
 #if !defined(OS_ANDROID)
   std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
 #endif  // !defined(OS_ANDROID)
-  bool IsOffTheRecord() const override;
+  bool IsOffTheRecord() override;
   DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   ResourceContext* GetResourceContext() override;
   BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java
index d50ae20..708b2ed 100644
--- a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java
+++ b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java
@@ -6,6 +6,7 @@
 
 import android.content.Context;
 
+import org.chromium.base.ApplicationStatus;
 import org.chromium.base.PathUtils;
 import org.chromium.native_test.NativeBrowserTestApplication;
 
@@ -20,6 +21,8 @@
         super.attachBaseContext(base);
 
         if (isBrowserProcess()) {
+            ApplicationStatus.initialize(this);
+
             // Test-only stuff, see also NativeUnitTest.java.
             PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
         }
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 15499f4..ce46424 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -626,11 +626,6 @@
   // tests to run accordingly.
   if (!switches::IsRunWebTestsSwitchPresent())
     return PictureInPictureResult::kNotSupported;
-
-  auto* controller =
-      PictureInPictureWindowController::GetOrCreateForWebContents(web_contents);
-  controller->EmbedSurface(surface_id, natural_size);
-
   return PictureInPictureResult::kSuccess;
 }
 
diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc
index 9389a81..226d5b3 100644
--- a/content/shell/browser/shell_browser_context.cc
+++ b/content/shell/browser/shell_browser_context.cc
@@ -154,11 +154,11 @@
 }
 #endif  // !defined(OS_ANDROID)
 
-base::FilePath ShellBrowserContext::GetPath() const {
+base::FilePath ShellBrowserContext::GetPath() {
   return path_;
 }
 
-bool ShellBrowserContext::IsOffTheRecord() const {
+bool ShellBrowserContext::IsOffTheRecord() {
   return off_the_record_;
 }
 
diff --git a/content/shell/browser/shell_browser_context.h b/content/shell/browser/shell_browser_context.h
index 9ec2a63..14919de 100644
--- a/content/shell/browser/shell_browser_context.h
+++ b/content/shell/browser/shell_browser_context.h
@@ -49,12 +49,12 @@
   }
 
   // BrowserContext implementation.
-  base::FilePath GetPath() const override;
+  base::FilePath GetPath() override;
 #if !defined(OS_ANDROID)
   std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
 #endif  // !defined(OS_ANDROID)
-  bool IsOffTheRecord() const override;
+  bool IsOffTheRecord() override;
   DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   ResourceContext* GetResourceContext() override;
   BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index 2099862..079604f 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -424,10 +424,6 @@
   return new ShellSpeechRecognitionManagerDelegate();
 }
 
-net::NetLog* ShellContentBrowserClient::GetNetLog() {
-  return shell_browser_main_parts_->net_log();
-}
-
 void ShellContentBrowserClient::OverrideWebkitPrefs(
     RenderViewHost* render_view_host,
     WebPreferences* prefs) {
diff --git a/content/shell/browser/shell_content_browser_client.h b/content/shell/browser/shell_content_browser_client.h
index ad711ae..8b0949f 100644
--- a/content/shell/browser/shell_content_browser_client.h
+++ b/content/shell/browser/shell_content_browser_client.h
@@ -72,7 +72,6 @@
       std::unique_ptr<ClientCertificateDelegate> delegate) override;
   SpeechRecognitionManagerDelegate* CreateSpeechRecognitionManagerDelegate()
       override;
-  net::NetLog* GetNetLog() override;
   void OverrideWebkitPrefs(RenderViewHost* render_view_host,
                            WebPreferences* prefs) override;
   DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
diff --git a/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-blink.txt b/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-blink.txt
index c0e07c4..4b5e944b 100644
--- a/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-blink.txt
+++ b/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-blink.txt
@@ -2,15 +2,21 @@
 ++textField name='aria-placeholder1'
 ++++genericContainer
 ++textField name='placeholder2'
+++++staticText name='placeholder2'
+++++++inlineTextBox name='placeholder2'
 ++++genericContainer
 ++textField name='aria-label3' placeholder='placeholder3'
+++++staticText name='placeholder3'
+++++++inlineTextBox name='placeholder3'
 ++++genericContainer
 ++textField name='aria-label4' placeholder='aria-placeholder4'
 ++++genericContainer
 ++textField description='aria-description5' name='aria-label5' placeholder='placeholder5' descriptionFrom=relatedElement
+++++staticText name='placeholder5'
+++++++inlineTextBox name='placeholder5'
 ++++genericContainer
 ++genericContainer
 ++++staticText name='aria-description5'
 ++++++inlineTextBox name='aria-description5'
 ++textField description='title6' name='aria-placeholder6' descriptionFrom=attribute
-++++genericContainer
\ No newline at end of file
+++++genericContainer
diff --git a/content/test/data/accessibility/html/actions-expected-blink.txt b/content/test/data/accessibility/html/actions-expected-blink.txt
index f72e618..bdbff8a 100644
--- a/content/test/data/accessibility/html/actions-expected-blink.txt
+++ b/content/test/data/accessibility/html/actions-expected-blink.txt
@@ -3,4 +3,6 @@
 ++++slider horizontal value='50' valueForRange=50.00 minValueForRange=1.00 maxValueForRange=100.00 actions=setValue
 ++++++sliderThumb
 ++++textField name='Test textfield' actions=setValue
+++++++staticText name='Test textfield'
+++++++++inlineTextBox name='Test textfield'
 ++++++genericContainer
diff --git a/content/test/data/accessibility/html/input-text-expected-blink.txt b/content/test/data/accessibility/html/input-text-expected-blink.txt
index a38c27c..416a1dea 100644
--- a/content/test/data/accessibility/html/input-text-expected-blink.txt
+++ b/content/test/data/accessibility/html/input-text-expected-blink.txt
@@ -1,4 +1,6 @@
 rootWebArea
 ++genericContainer
 ++++textField name='Name' textSelStart=0 textSelEnd=0
-++++++genericContainer
\ No newline at end of file
+++++++staticText name='Name'
+++++++++inlineTextBox name='Name'
+++++++genericContainer
diff --git a/content/test/data/accessibility/html/input-text-name-calc-expected-blink.txt b/content/test/data/accessibility/html/input-text-name-calc-expected-blink.txt
index 5902d255..b5184fa 100644
--- a/content/test/data/accessibility/html/input-text-name-calc-expected-blink.txt
+++ b/content/test/data/accessibility/html/input-text-name-calc-expected-blink.txt
@@ -8,14 +8,22 @@
 ++textField description='Title3' name='LabelledBy3' descriptionFrom=attribute
 ++++genericContainer
 ++textField name='Placeholder4'
+++++staticText name='Placeholder4'
+++++++inlineTextBox name='Placeholder4'
 ++++genericContainer
 ++textField name='ARIA Placeholder4a'
 ++++genericContainer
 ++textField name='Placeholder4b'
+++++staticText name='Placeholder4b'
+++++++inlineTextBox name='Placeholder4b'
 ++++genericContainer
 ++textField description='Title5' name='Placeholder5' descriptionFrom=attribute
+++++staticText name='Placeholder5'
+++++++inlineTextBox name='Placeholder5'
 ++++genericContainer
 ++textField description='DescribedBy6' name='LabelledBy6' descriptionFrom=relatedElement
 ++++genericContainer
 ++textField description='DescribedBy7' name='AriaLabel7' descriptionFrom=relatedElement
-++++genericContainer
\ No newline at end of file
+++++staticText name='Placeholder7'
+++++++inlineTextBox name='Placeholder7'
+++++genericContainer
diff --git a/content/test/data/accessibility/html/input-text-read-only-expected-blink.txt b/content/test/data/accessibility/html/input-text-read-only-expected-blink.txt
index beaa2a1..c75349a 100644
--- a/content/test/data/accessibility/html/input-text-read-only-expected-blink.txt
+++ b/content/test/data/accessibility/html/input-text-read-only-expected-blink.txt
@@ -1,4 +1,6 @@
 rootWebArea
 ++genericContainer
 ++++textField name='Name' textSelStart=0 textSelEnd=0 restriction=readOnly
-++++++genericContainer
\ No newline at end of file
+++++++staticText name='Name'
+++++++++inlineTextBox name='Name'
+++++++genericContainer
diff --git a/content/test/gpu/gpu_tests/gpu_integration_test.py b/content/test/gpu/gpu_tests/gpu_integration_test.py
index 8566fa7..a38886bf 100644
--- a/content/test/gpu/gpu_tests/gpu_integration_test.py
+++ b/content/test/gpu/gpu_tests/gpu_integration_test.py
@@ -3,6 +3,7 @@
 # found in the LICENSE file.
 
 import logging
+import re
 
 from telemetry.testing import serially_executed_browser_test_case
 from telemetry.util import screenshot
@@ -86,13 +87,6 @@
     browser_args.append(
       '--disable-gpu-process-for-dx12-vulkan-info-collection')
 
-    if not ('--force_low_power_gpu' in browser_args or
-            '--force_high_performance_gpu' in browser_args):
-      # Force the GPU tests to use the high-performance GPU on dual-GPU machines
-      # by default. In Chromium's hardware fleet this currently only has an
-      # effect on the dual-GPU MacBook Pros.
-      browser_args.append('--force_high_performance_gpu')
-
     # Append the new arguments.
     browser_options.AppendExtraBrowserArgs(browser_args)
     cls._last_launched_browser_args = set(browser_args)
@@ -310,9 +304,8 @@
         gpu_device_tag = '%s-%s' % (gpu_vendor, gpu_device_id)
       angle_renderer = gpu_helper.GetANGLERenderer(gpu_info)
       cmd_decoder = gpu_helper.GetCommandDecoder(gpu_info)
-      # all spaces in the tag will be replaced by '-', and all letters will
-      # be converted to its lower case form.
-      tags.extend([tag.lower().replace(' ', '-').replace('_', '-') for tag in [
+      # all spaces and underscores in the tag will be replaced by dashes
+      tags.extend([re.sub('[ _]', '-', tag) for tag in [
           gpu_vendor, gpu_device_tag, angle_renderer, cmd_decoder]])
     # If additional options have been set via '--extra-browser-args' check for
     # those which map to expectation tags. The '_browser_backend' attribute may
diff --git a/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py b/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py
index 03f4fdd..3550c7d 100644
--- a/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py
+++ b/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py
@@ -52,34 +52,24 @@
 
 
 def _GetTagsToTest(browser, test_class=None, args=None):
-  gpu_tests = test_class or gpu_integration_test.GpuIntegrationTest
-  expectations_fn = gpu_tests.ExpectationsFiles
-  gpu_tests.ExpectationsFiles = mock.MagicMock(return_value=['exp.txt'])
-  ret = None
-  try:
+  test_class = test_class or gpu_integration_test.GpuIntegrationTest
+  with mock.patch.object(
+      test_class, 'ExpectationsFiles', return_value=['exp.txt']):
     possible_browser = fakes.FakePossibleBrowser()
     possible_browser._returned_browser = browser
     args = args or gpu_helper.GetMockArgs()
-    ret = set(gpu_tests.GenerateTags(args, possible_browser))
-  finally:
-    gpu_tests.ExpectationsFiles = expectations_fn
-  return ret
+    return set(test_class.GenerateTags(args, possible_browser))
 
 
 def _GenerateNvidiaExampleTagsForTestClassAndArgs(test_class, args):
-  exp_files_fn = test_class.ExpectationsFiles
-  ret = None
-  try:
-    test_class.ExpectationsFiles = mock.MagicMock(return_value=['exp.txt'])
+  with mock.patch.object(
+      test_class, 'ExpectationsFiles', return_value=['exp.txt']):
     _ = [_ for _ in test_class.GenerateGpuTests(args)]
     platform = fakes.FakePlatform('win', 'win10')
     browser = fakes.FakeBrowser(platform, 'release')
     browser._returned_system_info = _GetSystemInfo(
         gpu=VENDOR_NVIDIA, device=0x1cb3, gl_renderer='ANGLE Direct3D9')
-    ret = _GetTagsToTest(browser, test_class)
-  finally:
-    test_class.ExpectationsFiles = exp_files_fn
-  return ret
+    return _GetTagsToTest(browser, test_class)
 
 
 class GpuIntegrationTestUnittest(unittest.TestCase):
@@ -195,7 +185,7 @@
     self.assertEqual(
         _GetTagsToTest(browser),
         set(['mac', 'mojave', 'release', 'imagination',
-             'imagination-powervr-sgx-554',
+             'imagination-PowerVR-SGX-554',
              'opengles', 'passthrough']))
 
   def testGenerateVendorTagUsingDeviceString(self):
@@ -207,7 +197,7 @@
     self.assertEqual(
         _GetTagsToTest(browser),
         set(['mac', 'mojave', 'release', 'imagination',
-             'imagination-triangle-monster-3000',
+             'imagination-Triangle-Monster-3000',
              'no-angle', 'no-passthrough']))
 
   def testSimpleIntegrationTest(self):
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
index 937aa83..d232205 100644
--- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
+++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -266,11 +266,6 @@
 # Regressions in 10.12.4.
 crbug.com/705865 [ sierra intel ] conformance2/textures/misc/tex-base-level-bug.html [ Failure ]
 crbug.com/705865 [ sierra intel ] conformance2/textures/misc/tex-mipmap-levels.html [ Failure ]
-crbug.com/870856 [ sierra amd ] conformance2/textures/misc/tex-base-level-bug.html [ Failure ]
-
-# Flaky on 10.13 as well.
-crbug.com/870856 [ sierra amd ] conformance2/textures/misc/tex-mipmap-levels.html [ Failure ]
-crbug.com/870856 [ highsierra amd ] conformance2/textures/misc/tex-mipmap-levels.html [ Failure ]
 
 # Regressions in 10.13
 crbug.com/774826 [ highsierra intel-0xa2e ] deqp/functional/gles3/fbocolorbuffer/tex2d_00.html [ Failure ]
@@ -395,11 +390,13 @@
 # self.Fail('conformance2/rendering/texture-switch-performance.html',
 #     ['mac', 'amd'], bug=735483)
 
-# The following two failures are a regression in the Mac AMD
-# OpenGL driver on 10.13.6 specifically. Unfortunately when the
-# tests fail, they fail three times in a row, so we must mark them
-# failing rather than flaky.
-crbug.com/870856 [ highsierra amd ] conformance2/textures/misc/tex-base-level-bug.html [ Failure ]
+# The following two failures appeared to be a regression in the Mac AMD OpenGL
+# driver on 10.13.6 specifically, and are still flaky. Unfortunately when the
+# tests fail, they fail three times in a row, so we must mark them failing
+# rather than flaky.
+crbug.com/870856 [ mac amd ] conformance2/textures/misc/tex-base-level-bug.html [ Failure ]
+crbug.com/870856 [ mac amd ] conformance2/textures/misc/tex-mipmap-levels.html [ Failure ]
+
 crbug.com/483282 [ sierra amd ] deqp/functional/gles3/transformfeedback/array_interleaved_lines.html [ Failure ]
 crbug.com/483282 [ sierra amd ] deqp/functional/gles3/transformfeedback/array_interleaved_points.html [ Failure ]
 crbug.com/483282 [ sierra amd ] deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations_unittest.py b/content/test/gpu/gpu_tests/test_expectations_unittest.py
index 1e29b9b..9d2e5d9 100644
--- a/content/test/gpu/gpu_tests/test_expectations_unittest.py
+++ b/content/test/gpu/gpu_tests/test_expectations_unittest.py
@@ -207,16 +207,11 @@
   expectations_file.write(expectations)
   expectations_file.close()
   gpu_tests = gpu_integration_test.GpuIntegrationTest
-  generate_gpu_fn = gpu_tests.GenerateGpuTests
-  expectations_files_fn = gpu_tests.ExpectationsFiles
-  gpu_tests.GenerateGpuTests = mock.MagicMock(return_value=[('a/b/c', ())])
-  gpu_tests.ExpectationsFiles = mock.MagicMock(
-      return_value=[expectations_file.name])
-  try:
-    CheckTestExpectationsAreForExistingTests(gpu_tests, options)
-  finally:
-    gpu_tests.GenerateGpuTests = generate_gpu_fn
-    gpu_tests.ExpectationsFiles = expectations_files_fn
+  with mock.patch.object(
+      gpu_tests, 'GenerateGpuTests', return_value=[('a/b/c', ())]):
+    with mock.patch.object(
+        gpu_tests, 'ExpectationsFiles', return_value=[expectations_file.name]):
+      CheckTestExpectationsAreForExistingTests(gpu_tests, options)
 
 
 def _CheckPatternIsValid(pattern):
diff --git a/content/utility/utility_service_factory.cc b/content/utility/utility_service_factory.cc
index 2e098ff..35b8382b 100644
--- a/content/utility/utility_service_factory.cc
+++ b/content/utility/utility_service_factory.cc
@@ -110,7 +110,7 @@
     std::unique_ptr<service_manager::BinderRegistry> network_registry,
     scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner) {
   auto service = std::make_unique<network::NetworkService>(
-      std::move(network_registry), nullptr /* request */, nullptr /* net_log */,
+      std::move(network_registry), nullptr /* request */,
       std::move(service_request), true);
 
   // Transfer ownership of the service to itself, and have it post to the main
diff --git a/extensions/browser/api/declarative_net_request/ruleset_source.cc b/extensions/browser/api/declarative_net_request/ruleset_source.cc
index 0330777..fb3d5180 100644
--- a/extensions/browser/api/declarative_net_request/ruleset_source.cc
+++ b/extensions/browser/api/declarative_net_request/ruleset_source.cc
@@ -244,9 +244,8 @@
 }
 
 // static
-RulesetSource RulesetSource::CreateDynamic(
-    const content::BrowserContext* context,
-    const Extension& extension) {
+RulesetSource RulesetSource::CreateDynamic(content::BrowserContext* context,
+                                           const Extension& extension) {
   base::FilePath dynamic_ruleset_directory =
       context->GetPath()
           .AppendASCII(kDynamicRulesetDirectory)
diff --git a/extensions/browser/api/declarative_net_request/ruleset_source.h b/extensions/browser/api/declarative_net_request/ruleset_source.h
index 72eb583..f33bfcf 100644
--- a/extensions/browser/api/declarative_net_request/ruleset_source.h
+++ b/extensions/browser/api/declarative_net_request/ruleset_source.h
@@ -129,7 +129,7 @@
   // Creates RulesetSource corresponding to the dynamic rules added by the
   // extension. This must only be called for extensions which specified a
   // declarative ruleset.
-  static RulesetSource CreateDynamic(const content::BrowserContext* context,
+  static RulesetSource CreateDynamic(content::BrowserContext* context,
                                      const Extension& extension);
 
   // Creates a temporary source i.e. a source corresponding to temporary files.
diff --git a/extensions/shell/browser/shell_prefs_unittest.cc b/extensions/shell/browser/shell_prefs_unittest.cc
index a81dc21..2e92d5630 100644
--- a/extensions/shell/browser/shell_prefs_unittest.cc
+++ b/extensions/shell/browser/shell_prefs_unittest.cc
@@ -24,7 +24,7 @@
   ~PrefsTestBrowserContext() override {}
 
   // content::BrowserContext:
-  base::FilePath GetPath() const override {
+  base::FilePath GetPath() override {
     base::FilePath path;
     base::PathService::Get(extensions::DIR_TEST_DATA, &path);
     return path.AppendASCII("shell_prefs");
diff --git a/fuchsia/engine/browser/web_engine_browser_context.cc b/fuchsia/engine/browser/web_engine_browser_context.cc
index 78b80d2..df15f6c 100644
--- a/fuchsia/engine/browser/web_engine_browser_context.cc
+++ b/fuchsia/engine/browser/web_engine_browser_context.cc
@@ -81,11 +81,11 @@
   return nullptr;
 }
 
-base::FilePath WebEngineBrowserContext::GetPath() const {
+base::FilePath WebEngineBrowserContext::GetPath() {
   return data_dir_path_;
 }
 
-bool WebEngineBrowserContext::IsOffTheRecord() const {
+bool WebEngineBrowserContext::IsOffTheRecord() {
   return data_dir_path_.empty();
 }
 
diff --git a/fuchsia/engine/browser/web_engine_browser_context.h b/fuchsia/engine/browser/web_engine_browser_context.h
index ba79dbc..914f7de2 100644
--- a/fuchsia/engine/browser/web_engine_browser_context.h
+++ b/fuchsia/engine/browser/web_engine_browser_context.h
@@ -26,8 +26,8 @@
   // BrowserContext implementation.
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
-  base::FilePath GetPath() const override;
-  bool IsOffTheRecord() const override;
+  base::FilePath GetPath() override;
+  bool IsOffTheRecord() override;
   content::ResourceContext* GetResourceContext() override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/fuchsia/engine/integration_tests_sandbox_policy b/fuchsia/engine/integration_tests_sandbox_policy
index f987ae2..d5649d3 100644
--- a/fuchsia/engine/integration_tests_sandbox_policy
+++ b/fuchsia/engine/integration_tests_sandbox_policy
@@ -1,9 +1,10 @@
 {
   "features": [
       "isolated-persistent-storage",
-      "shell",
+      "deprecated-shell",
       "system-temp" ],
   "services": [
+      "fuchsia.device.NameProvider",
       "fuchsia.logger.LogSink",
       "fuchsia.net.SocketProvider",
       "fuchsia.netstack.Netstack",
diff --git a/fuchsia/http/sandbox_policy b/fuchsia/http/sandbox_policy
index 5a68527..b174cb7 100644
--- a/fuchsia/http/sandbox_policy
+++ b/fuchsia/http/sandbox_policy
@@ -1,6 +1,7 @@
 {
   "features": [ "root-ssl-certificates" ],
   "services": [
+      "fuchsia.device.NameProvider",
       "fuchsia.logger.LogSink",
       "fuchsia.net.SocketProvider",
       "fuchsia.netstack.Netstack"
diff --git a/fuchsia/runners/cast/sandbox_policy b/fuchsia/runners/cast/sandbox_policy
index 61e5eed..80a1adbe 100644
--- a/fuchsia/runners/cast/sandbox_policy
+++ b/fuchsia/runners/cast/sandbox_policy
@@ -2,6 +2,7 @@
   "features": [],
   "services": [
       "chromium.cast.ApplicationConfigManager",
+      "fuchsia.device.NameProvider",
       "fuchsia.fonts.Provider",
       "fuchsia.logger.LogSink",
       "fuchsia.media.Audio",
diff --git a/fuchsia/runners/web/sandbox_policy b/fuchsia/runners/web/sandbox_policy
index 46083c65..3179a5a 100644
--- a/fuchsia/runners/web/sandbox_policy
+++ b/fuchsia/runners/web/sandbox_policy
@@ -3,6 +3,7 @@
     "isolated-persistent-storage"
   ],
   "services": [
+      "fuchsia.device.NameProvider",
       "fuchsia.fonts.Provider",
       "fuchsia.logger.LogSink",
       "fuchsia.media.Audio",
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 722fec0..6895f25 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1035,11 +1035,14 @@
     validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_EXTERNAL_OES);
   }
 
-  // TODO(kainino): If we add a way to query whether ANGLE is exposing
-  // native support for ETC1 textures, require that here. Otherwise, we could
-  // co-opt the native-ETC2-support query discussed below.
+  // When running on top of ANGLE, also require the
+  // GL_CHROMIUM_compressed_texture_etc exentsion to expose
+  // GL_OES_compressed_ETC1_RGB8_texture. There is no query for native support
+  // of this texture format so assume that if ANGLE natively supports ETC2, ETC1
+  // is also supported.
   if (gfx::HasExtension(extensions, "GL_OES_compressed_ETC1_RGB8_texture") &&
-      !gl_version_info_->is_angle) {
+      (!gl_version_info_->is_angle ||
+       gfx::HasExtension(extensions, "GL_CHROMIUM_compressed_texture_etc"))) {
     AddExtensionString("GL_OES_compressed_ETC1_RGB8_texture");
     feature_flags_.oes_compressed_etc1_rgb8_texture = true;
     validators_.compressed_texture_format.AddValue(GL_ETC1_RGB8_OES);
@@ -1503,12 +1506,6 @@
       gfx::HasExtension(extensions, "GL_ANGLE_request_extension");
   feature_flags_.ext_debug_marker =
       gfx::HasExtension(extensions, "GL_EXT_debug_marker");
-  feature_flags_.arb_robustness =
-      gfx::HasExtension(extensions, "GL_ARB_robustness");
-  feature_flags_.khr_robustness =
-      gfx::HasExtension(extensions, "GL_KHR_robustness");
-  feature_flags_.ext_robustness =
-      gfx::HasExtension(extensions, "GL_EXT_robustness");
   feature_flags_.ext_pixel_buffer_object =
       gfx::HasExtension(extensions, "GL_ARB_pixel_buffer_object") ||
       gfx::HasExtension(extensions, "GL_NV_pixel_buffer_object");
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index ad84692..4078067 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -124,9 +124,6 @@
     bool angle_client_arrays = false;
     bool angle_request_extension = false;
     bool ext_debug_marker = false;
-    bool arb_robustness = false;
-    bool khr_robustness = false;
-    bool ext_robustness = false;
     bool ext_pixel_buffer_object = false;
     bool ext_unpack_subimage = false;
     bool oes_rgb8_rgba8 = false;
diff --git a/gpu/command_buffer/service/gl_context_virtual.cc b/gpu/command_buffer/service/gl_context_virtual.cc
index 8eea608..81703702 100644
--- a/gpu/command_buffer/service/gl_context_virtual.cc
+++ b/gpu/command_buffer/service/gl_context_virtual.cc
@@ -97,8 +97,11 @@
   return shared_context_->SetSafeToForceGpuSwitch();
 }
 
-bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() {
-  return shared_context_->WasAllocatedUsingRobustnessExtension();
+unsigned int GLContextVirtual::CheckStickyGraphicsResetStatus() {
+  // Don't pretend we know which one of the virtual contexts was responsible.
+  unsigned int reset_status = shared_context_->CheckStickyGraphicsResetStatus();
+  return reset_status == GL_NO_ERROR ? GL_NO_ERROR
+                                     : GL_UNKNOWN_CONTEXT_RESET_ARB;
 }
 
 void GLContextVirtual::SetUnbindFboOnMakeCurrent() {
diff --git a/gpu/command_buffer/service/gl_context_virtual.h b/gpu/command_buffer/service/gl_context_virtual.h
index dc3d4d5..3e6f297a 100644
--- a/gpu/command_buffer/service/gl_context_virtual.h
+++ b/gpu/command_buffer/service/gl_context_virtual.h
@@ -42,7 +42,7 @@
   std::string GetGLRenderer() override;
   const gfx::ExtensionSet& GetExtensions() override;
   void SetSafeToForceGpuSwitch() override;
-  bool WasAllocatedUsingRobustnessExtension() override;
+  unsigned int CheckStickyGraphicsResetStatus() override;
   void SetUnbindFboOnMakeCurrent() override;
   gl::YUVToRGBConverter* GetYUVToRGBConverter(
       const gfx::ColorSpace& color_space) override;
diff --git a/gpu/command_buffer/service/gl_context_virtual_unittest.cc b/gpu/command_buffer/service/gl_context_virtual_unittest.cc
index b9c6bcd..67975fb 100644
--- a/gpu/command_buffer/service/gl_context_virtual_unittest.cc
+++ b/gpu/command_buffer/service/gl_context_virtual_unittest.cc
@@ -47,25 +47,57 @@
       .Times(AnyNumber())
       .WillRepeatedly(Return(reinterpret_cast<unsigned const char *>("")));
   {
-    scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub;
+    auto base_context = base::MakeRefCounted<gl::GLContextStub>();
     gl::GLShareGroup* share_group = base_context->share_group();
     share_group->SetSharedContext(GetGLSurface(), base_context.get());
-    scoped_refptr<GLContextVirtual> context(new GLContextVirtual(
-        share_group, base_context.get(), decoder_->AsWeakPtr()));
+    auto context = base::MakeRefCounted<GLContextVirtual>(
+        share_group, base_context.get(), decoder_->AsWeakPtr());
     EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::GLContextAttribs()));
     EXPECT_TRUE(context->MakeCurrent(GetGLSurface()));
   }
   {
-    scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub;
+    auto base_context = base::MakeRefCounted<gl::GLContextStub>();
     gl::GLShareGroup* share_group = base_context->share_group();
     share_group->SetSharedContext(GetGLSurface(), base_context.get());
-    scoped_refptr<GLContextVirtual> context(new GLContextVirtual(
-        share_group, base_context.get(), decoder_->AsWeakPtr()));
+    auto context = base::MakeRefCounted<GLContextVirtual>(
+        share_group, base_context.get(), decoder_->AsWeakPtr());
     EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::GLContextAttribs()));
     EXPECT_TRUE(context->MakeCurrent(GetGLSurface()));
   }
 }
 
+// Tests that CheckStickyGraphicsResetStatus gets the state from the real
+// context, but "virtualizes" the guilty party (i.e. makes it unknown).
+TEST_F(GLContextVirtualTest, CheckStickyGraphicsResetStatus) {
+  EXPECT_CALL(*gl_, GetError())
+      .Times(AnyNumber())
+      .WillRepeatedly(Return(GL_NO_ERROR));
+  auto base_context = base::MakeRefCounted<gl::GLContextStub>();
+  const char gl_extensions[] = "GL_KHR_robustness";
+  base_context->SetExtensionsString(gl_extensions);
+
+  gl::GLShareGroup* share_group = base_context->share_group();
+  share_group->SetSharedContext(GetGLSurface(), base_context.get());
+  auto context = base::MakeRefCounted<GLContextVirtual>(
+      share_group, base_context.get(), decoder_->AsWeakPtr());
+  EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::GLContextAttribs()));
+  EXPECT_TRUE(context->MakeCurrent(GetGLSurface()));
+
+  // If no reset, GLContextVirtual should report no error.
+  EXPECT_CALL(*gl_, GetGraphicsResetStatusARB()).WillOnce(Return(GL_NO_ERROR));
+  EXPECT_EQ(unsigned{GL_NO_ERROR}, context->CheckStickyGraphicsResetStatus());
+
+  // If reset, GLContextVirtual should report an error, but with an unknown
+  // guilty context.
+  EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
+      .WillOnce(Return(GL_GUILTY_CONTEXT_RESET_ARB));
+  EXPECT_EQ(unsigned{GL_UNKNOWN_CONTEXT_RESET_ARB},
+            context->CheckStickyGraphicsResetStatus());
+  // The underlying real context still knows, though.
+  EXPECT_EQ(unsigned{GL_GUILTY_CONTEXT_RESET_ARB},
+            base_context->CheckStickyGraphicsResetStatus());
+}
+
 }  // anonymous namespace
 }  // namespace gles2
 }  // namespace gpu
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c16fda7c..878d6d4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2379,11 +2379,6 @@
            surface_->DeferDraws();
   }
 
-  bool IsRobustnessSupported() {
-    return has_robustness_extension_ &&
-           context_->WasAllocatedUsingRobustnessExtension();
-  }
-
   error::Error WillAccessBoundFramebufferForDraw() {
     if (ShouldDeferDraws())
       return error::kDeferCommandUntilLater;
@@ -2684,7 +2679,6 @@
   // Number of commands remaining to be processed in DoCommands().
   int commands_to_process_;
 
-  bool has_robustness_extension_;
   bool context_was_lost_;
   bool reset_by_robustness_extension_;
   bool supports_post_sub_buffer_;
@@ -3461,7 +3455,6 @@
       validators_(group_->feature_info()->validators()),
       feature_info_(group_->feature_info()),
       frame_number_(0),
-      has_robustness_extension_(false),
       context_was_lost_(false),
       reset_by_robustness_extension_(false),
       supports_post_sub_buffer_(false),
@@ -3913,10 +3906,6 @@
     api()->glEnableFn(GL_TEXTURE_CUBE_MAP_SEAMLESS);
   }
 
-  has_robustness_extension_ = features().arb_robustness ||
-                              features().khr_robustness ||
-                              features().ext_robustness;
-
   GLint range[2] = {0, 0};
   GLint precision = 0;
   QueryShaderPrecisionFormat(gl_version_info(), GL_FRAGMENT_SHADER,
@@ -17050,39 +17039,32 @@
   DCHECK(!WasContextLost());
   DCHECK(context_->IsCurrent(nullptr));
 
-  if (IsRobustnessSupported()) {
-    // If the reason for the call was a GL error, we can try to determine the
-    // reset status more accurately.
-    GLenum driver_status = api()->glGetGraphicsResetStatusARBFn();
-    if (driver_status == GL_NO_ERROR)
+  // If the reason for the call was a GL error, we can try to determine the
+  // reset status more accurately.
+  GLenum driver_status = context_->CheckStickyGraphicsResetStatus();
+  if (driver_status == GL_NO_ERROR)
+    return false;
+
+  LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen")
+             << " context lost via ARB/EXT_robustness. Reset status = "
+             << GLES2Util::GetStringEnum(driver_status);
+
+  switch (driver_status) {
+    case GL_GUILTY_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kGuilty);
+      break;
+    case GL_INNOCENT_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kInnocent);
+      break;
+    case GL_UNKNOWN_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kUnknown);
+      break;
+    default:
+      NOTREACHED();
       return false;
-
-    LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen")
-               << " context lost via ARB/EXT_robustness. Reset status = "
-               << GLES2Util::GetStringEnum(driver_status);
-
-    // Don't pretend we know which client was responsible.
-    if (workarounds().use_virtualized_gl_contexts)
-      driver_status = GL_UNKNOWN_CONTEXT_RESET_ARB;
-
-    switch (driver_status) {
-      case GL_GUILTY_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kGuilty);
-        break;
-      case GL_INNOCENT_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kInnocent);
-        break;
-      case GL_UNKNOWN_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kUnknown);
-        break;
-      default:
-        NOTREACHED();
-        return false;
-    }
-    reset_by_robustness_extension_ = true;
-    return true;
   }
-  return false;
+  reset_by_robustness_extension_ = true;
+  return true;
 }
 
 error::Error GLES2DecoderImpl::HandleDescheduleUntilFinishedCHROMIUM(
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index 7a7eb92..d8d4b73f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -569,7 +569,6 @@
       gpu_trace_level_(2),
       gpu_trace_commands_(false),
       gpu_debug_commands_(false),
-      has_robustness_extension_(false),
       context_lost_(false),
       reset_by_robustness_extension_(false),
       lose_context_when_out_of_memory_(false),
@@ -888,8 +887,6 @@
     api()->glHintFn(GL_TEXTURE_FILTERING_HINT_CHROMIUM, GL_NICEST);
   }
 
-  has_robustness_extension_ = feature_info_->feature_flags().khr_robustness ||
-                              feature_info_->feature_flags().ext_robustness;
   lose_context_when_out_of_memory_ =
       attrib_helper.lose_context_when_out_of_memory;
 
@@ -2037,37 +2034,29 @@
   DCHECK(!WasContextLost());
   DCHECK(context_->IsCurrent(nullptr));
 
-  if (IsRobustnessSupported()) {
-    // If the reason for the call was a GL error, we can try to determine the
-    // reset status more accurately.
-    GLenum driver_status = api()->glGetGraphicsResetStatusARBFn();
-    if (driver_status == GL_NO_ERROR) {
-      return false;
-    }
-
-    switch (driver_status) {
-      case GL_GUILTY_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kGuilty);
-        break;
-      case GL_INNOCENT_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kInnocent);
-        break;
-      case GL_UNKNOWN_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kUnknown);
-        break;
-      default:
-        NOTREACHED();
-        return false;
-    }
-    reset_by_robustness_extension_ = true;
-    return true;
+  // If the reason for the call was a GL error, we can try to determine the
+  // reset status more accurately.
+  GLenum driver_status = context_->CheckStickyGraphicsResetStatus();
+  if (driver_status == GL_NO_ERROR) {
+    return false;
   }
-  return false;
-}
 
-bool GLES2DecoderPassthroughImpl::IsRobustnessSupported() {
-  return has_robustness_extension_ &&
-         context_->WasAllocatedUsingRobustnessExtension();
+  switch (driver_status) {
+    case GL_GUILTY_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kGuilty);
+      break;
+    case GL_INNOCENT_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kInnocent);
+      break;
+    case GL_UNKNOWN_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kUnknown);
+      break;
+    default:
+      NOTREACHED();
+      return false;
+  }
+  reset_by_robustness_extension_ = true;
+  return true;
 }
 
 bool GLES2DecoderPassthroughImpl::IsEmulatedQueryTarget(GLenum target) const {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
index f2f2256..a526b8f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -427,8 +427,6 @@
   GLenum PopError();
   bool FlushErrors();
 
-  bool IsRobustnessSupported();
-
   bool IsEmulatedQueryTarget(GLenum target) const;
   error::Error ProcessQueries(bool did_finish);
   void RemovePendingQuery(GLuint service_id);
@@ -847,7 +845,6 @@
   bool gpu_debug_commands_;
 
   // Context lost state
-  bool has_robustness_extension_;
   bool context_lost_;
   bool reset_by_robustness_extension_;
   bool lose_context_when_out_of_memory_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 02138c0..5e8cc73 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -478,7 +478,7 @@
   }
 #endif
 
-  if (context_->WasAllocatedUsingRobustnessExtension()) {
+  if (context_->HasRobustness()) {
     EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
         .WillOnce(Return(init.lose_context_on_init ? GL_GUILTY_CONTEXT_RESET_ARB
                                                    : GL_NO_ERROR));
@@ -524,7 +524,7 @@
   }
 
   EXPECT_CALL(*context_, MakeCurrent(surface_.get())).WillOnce(Return(true));
-  if (context_->WasAllocatedUsingRobustnessExtension()) {
+  if (context_->HasRobustness()) {
     EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
         .WillOnce(Return(GL_NO_ERROR));
   }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc
index a2df617..7b18a6f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc
@@ -35,7 +35,7 @@
             error::ContextLostReason expected_other_reason) {
     const GLsizei kFakeLargeCount = 0x1234;
     SetupTexture();
-    if (context_->WasAllocatedUsingRobustnessExtension()) {
+    if (context_->HasRobustness()) {
       EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
           .WillOnce(Return(reset_status));
     }
@@ -108,15 +108,6 @@
     InitDecoder(init);
   }
 
-  void InitWithVirtualContextsAndRobustness() {
-    gpu::GpuDriverBugWorkarounds workarounds;
-    workarounds.use_virtualized_gl_contexts = true;
-    InitState init;
-    init.gl_version = "OpenGL ES 2.0";
-    init.extensions = "GL_KHR_robustness";
-    InitDecoderWithWorkarounds(init, workarounds);
-  }
-
   void DoGetErrorWithContextLost(GLenum reset_status) {
     DCHECK(context_->HasExtension("GL_KHR_robustness"));
     EXPECT_CALL(*gl_, GetError())
@@ -309,19 +300,6 @@
   EXPECT_EQ(error::kInnocent, GetContextLostReason());
 }
 
-TEST_P(GLES2DecoderLostContextTest, LoseVirtualContextWithRobustness) {
-  InitWithVirtualContextsAndRobustness();
-  EXPECT_CALL(*mock_decoder_, MarkContextLost(error::kUnknown))
-      .Times(1);
-  // Signal guilty....
-  DoGetErrorWithContextLost(GL_GUILTY_CONTEXT_RESET_KHR);
-  EXPECT_TRUE(decoder_->WasContextLost());
-  EXPECT_TRUE(decoder_->WasContextLostByRobustnessExtension());
-  // ...but make sure we don't pretend, since for virtual contexts we don't
-  // know if this was really the guilty client.
-  EXPECT_EQ(error::kUnknown, GetContextLostReason());
-}
-
 TEST_P(GLES2DecoderLostContextTest, LoseGroupFromRobustness) {
   // If one context in a group is lost through robustness,
   // the other ones should also get lost and query the reset status.
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc
index 09a8eb5c..e8077af8 100644
--- a/gpu/command_buffer/service/raster_decoder.cc
+++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -398,12 +398,6 @@
 #endif
   }
 
-  bool IsRobustnessSupported() {
-    return has_robustness_extension_ &&
-           shared_context_state_->context()
-               ->WasAllocatedUsingRobustnessExtension();
-  }
-
   const gl::GLVersionInfo& gl_version_info() {
     return feature_info()->gl_version_info();
   }
@@ -525,7 +519,6 @@
   bool use_passthrough_ = false;
   bool use_ddl_ = false;
 
-  bool has_robustness_extension_ = false;
   bool reset_by_robustness_extension_ = false;
 
   // The current decoder error communicates the decoder error through command
@@ -738,10 +731,6 @@
 
   query_manager_ = std::make_unique<QueryManager>();
 
-  has_robustness_extension_ = features().arb_robustness ||
-                              features().khr_robustness ||
-                              features().ext_robustness;
-
   if (attrib_helper.enable_oop_rasterization) {
     if (!features().chromium_raster_transport) {
       LOG(ERROR) << "ContextResult::kFatalFailure: "
@@ -1078,39 +1067,33 @@
   DCHECK(!WasContextLost());
   DCHECK(shared_context_state_->context()->IsCurrent(nullptr));
 
-  if (IsRobustnessSupported()) {
-    // If the reason for the call was a GL error, we can try to determine the
-    // reset status more accurately.
-    GLenum driver_status = api()->glGetGraphicsResetStatusARBFn();
-    if (driver_status == GL_NO_ERROR)
+  // If the reason for the call was a GL error, we can try to determine the
+  // reset status more accurately.
+  GLenum driver_status =
+      shared_context_state_->context()->CheckStickyGraphicsResetStatus();
+  if (driver_status == GL_NO_ERROR)
+    return false;
+
+  LOG(ERROR) << "RasterDecoder context lost via ARB/EXT_robustness. Reset "
+                "status = "
+             << gles2::GLES2Util::GetStringEnum(driver_status);
+
+  switch (driver_status) {
+    case GL_GUILTY_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kGuilty);
+      break;
+    case GL_INNOCENT_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kInnocent);
+      break;
+    case GL_UNKNOWN_CONTEXT_RESET_ARB:
+      MarkContextLost(error::kUnknown);
+      break;
+    default:
+      NOTREACHED();
       return false;
-
-    LOG(ERROR) << "RasterDecoder context lost via ARB/EXT_robustness. Reset "
-                  "status = "
-               << gles2::GLES2Util::GetStringEnum(driver_status);
-
-    // Don't pretend we know which client was responsible.
-    if (workarounds().use_virtualized_gl_contexts)
-      driver_status = GL_UNKNOWN_CONTEXT_RESET_ARB;
-
-    switch (driver_status) {
-      case GL_GUILTY_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kGuilty);
-        break;
-      case GL_INNOCENT_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kInnocent);
-        break;
-      case GL_UNKNOWN_CONTEXT_RESET_ARB:
-        MarkContextLost(error::kUnknown);
-        break;
-      default:
-        NOTREACHED();
-        return false;
-    }
-    reset_by_robustness_extension_ = true;
-    return true;
   }
-  return false;
+  reset_by_robustness_extension_ = true;
+  return true;
 }
 
 gles2::Logger* RasterDecoderImpl::GetLogger() {
diff --git a/gpu/command_buffer/service/raster_decoder_unittest_base.cc b/gpu/command_buffer/service/raster_decoder_unittest_base.cc
index 820717f..86f8509 100644
--- a/gpu/command_buffer/service/raster_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/raster_decoder_unittest_base.cc
@@ -175,7 +175,7 @@
   ContextStateTestHelpers::SetupInitState(gl_.get(), feature_info(),
                                           gfx::Size(1, 1));
 
-  if (context_->WasAllocatedUsingRobustnessExtension()) {
+  if (context_->HasRobustness()) {
     EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
         .WillOnce(Return(GL_NO_ERROR));
   }
@@ -210,7 +210,7 @@
             gpu::ContextResult::kSuccess);
 
   EXPECT_CALL(*context_, MakeCurrent(surface_.get())).WillOnce(Return(true));
-  if (context_->WasAllocatedUsingRobustnessExtension()) {
+  if (context_->HasRobustness()) {
     EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
         .WillOnce(Return(GL_NO_ERROR));
   }
diff --git a/gpu/command_buffer/service/raster_decoder_unittest_context_lost.cc b/gpu/command_buffer/service/raster_decoder_unittest_context_lost.cc
index 2574c19..054a41e1 100644
--- a/gpu/command_buffer/service/raster_decoder_unittest_context_lost.cc
+++ b/gpu/command_buffer/service/raster_decoder_unittest_context_lost.cc
@@ -33,7 +33,7 @@
 
   void OOM(GLenum reset_status,
            error::ContextLostReason expected_other_reason) {
-    if (context_->WasAllocatedUsingRobustnessExtension()) {
+    if (context_->HasRobustness()) {
       EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
           .WillOnce(Return(reset_status));
     }
diff --git a/gpu/command_buffer/service/shared_context_state.cc b/gpu/command_buffer/service/shared_context_state.cc
index d14fae3..a9d31cc 100644
--- a/gpu/command_buffer/service/shared_context_state.cc
+++ b/gpu/command_buffer/service/shared_context_state.cc
@@ -212,22 +212,16 @@
   context_state_->InitCapabilities(nullptr);
   context_state_->InitState(nullptr);
 
-  bool has_robustness = (feature_info_->feature_flags().arb_robustness ||
-                         feature_info_->feature_flags().khr_robustness ||
-                         feature_info_->feature_flags().ext_robustness) &&
-                        real_context_->WasAllocatedUsingRobustnessExtension();
-  if (has_robustness) {
-    GLenum driver_status = api->glGetGraphicsResetStatusARBFn();
-    if (driver_status != GL_NO_ERROR) {
-      // If the context was lost at any point before or during initialization,
-      // the values queried from the driver could be bogus, and potentially
-      // inconsistent between various ContextStates on the same underlying real
-      // GL context. Make sure to report the failure early, to not allow
-      // virtualized context switches in that case.
-      feature_info_ = nullptr;
-      context_state_ = nullptr;
-      return false;
-    }
+  GLenum driver_status = real_context_->CheckStickyGraphicsResetStatus();
+  if (driver_status != GL_NO_ERROR) {
+    // If the context was lost at any point before or during initialization,
+    // the values queried from the driver could be bogus, and potentially
+    // inconsistent between various ContextStates on the same underlying real
+    // GL context. Make sure to report the failure early, to not allow
+    // virtualized context switches in that case.
+    feature_info_ = nullptr;
+    context_state_ = nullptr;
+    return false;
   }
 
   if (use_virtualized_gl_contexts_) {
diff --git a/gpu/command_buffer/service/shared_context_state_unittest.cc b/gpu/command_buffer/service/shared_context_state_unittest.cc
index 9fdab5d..a6a3ad3 100644
--- a/gpu/command_buffer/service/shared_context_state_unittest.cc
+++ b/gpu/command_buffer/service/shared_context_state_unittest.cc
@@ -15,13 +15,13 @@
 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
 #include "gpu/command_buffer/service/context_state_test_helpers.h"
 #include "gpu/command_buffer/service/feature_info.h"
-#include "gpu/command_buffer/service/gl_context_mock.h"
 #include "gpu/command_buffer/service/shared_context_state.h"
 #include "gpu/command_buffer/service/test_helper.h"
 #include "gpu/config/gpu_driver_bug_workarounds.h"
 #include "gpu/config/gpu_feature_info.h"
 #include "gpu/config/gpu_preferences.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_context_stub.h"
 #include "ui/gl/gl_mock.h"
 #include "ui/gl/gl_surface_stub.h"
 #include "ui/gl/init/gl_factory.h"
@@ -53,13 +53,13 @@
   InSequence sequence;
 
   auto surface = base::MakeRefCounted<gl::GLSurfaceStub>();
-  auto context = base::MakeRefCounted<StrictMock<GLContextMock>>();
+  auto context = base::MakeRefCounted<gl::GLContextStub>();
   const char gl_version[] = "2.1";
   context->SetGLVersionString(gl_version);
   const char gl_extensions[] = "GL_KHR_robustness";
   context->SetExtensionsString(gl_extensions);
 
-  context->GLContextStub::MakeCurrent(surface.get());
+  context->MakeCurrent(surface.get());
 
   GpuFeatureInfo gpu_feature_info;
   GpuDriverBugWorkarounds workarounds;
@@ -77,7 +77,6 @@
   ContextStateTestHelpers::SetupInitState(&gl_interface, feature_info.get(),
                                           gfx::Size(1, 1));
 
-  EXPECT_TRUE(context->WasAllocatedUsingRobustnessExtension());
   EXPECT_CALL(gl_interface, GetGraphicsResetStatusARB())
       .WillOnce(Return(GL_GUILTY_CONTEXT_RESET_ARB));
 
diff --git a/headless/lib/browser/headless_browser_context_impl.cc b/headless/lib/browser/headless_browser_context_impl.cc
index f35b99e..1faeeeb 100644
--- a/headless/lib/browser/headless_browser_context_impl.cc
+++ b/headless/lib/browser/headless_browser_context_impl.cc
@@ -164,11 +164,11 @@
   return std::unique_ptr<content::ZoomLevelDelegate>();
 }
 
-base::FilePath HeadlessBrowserContextImpl::GetPath() const {
+base::FilePath HeadlessBrowserContextImpl::GetPath() {
   return path_;
 }
 
-bool HeadlessBrowserContextImpl::IsOffTheRecord() const {
+bool HeadlessBrowserContextImpl::IsOffTheRecord() {
   return context_options_->incognito_mode();
 }
 
@@ -290,7 +290,7 @@
   return context_options_.get();
 }
 
-const std::string& HeadlessBrowserContextImpl::Id() const {
+const std::string& HeadlessBrowserContextImpl::Id() {
   return UniqueId();
 }
 
diff --git a/headless/lib/browser/headless_browser_context_impl.h b/headless/lib/browser/headless_browser_context_impl.h
index 5ece0ba..45cae12 100644
--- a/headless/lib/browser/headless_browser_context_impl.h
+++ b/headless/lib/browser/headless_browser_context_impl.h
@@ -46,7 +46,7 @@
   HeadlessWebContents* GetWebContentsForDevToolsAgentHostId(
       const std::string& devtools_agent_host_id) override;
   void Close() override;
-  const std::string& Id() const override;
+  const std::string& Id() override;
 
   void SetDevToolsFrameToken(int render_process_id,
                              int render_frame_routing_id,
@@ -60,8 +60,8 @@
   // BrowserContext implementation:
   std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
       const base::FilePath& partition_path) override;
-  base::FilePath GetPath() const override;
-  bool IsOffTheRecord() const override;
+  base::FilePath GetPath() override;
+  bool IsOffTheRecord() override;
   content::ResourceContext* GetResourceContext() override;
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
   content::BrowserPluginGuestManager* GetGuestManager() override;
diff --git a/headless/public/headless_browser_context.h b/headless/public/headless_browser_context.h
index bb015be..66961f11 100644
--- a/headless/public/headless_browser_context.h
+++ b/headless/public/headless_browser_context.h
@@ -61,7 +61,7 @@
   virtual void Close() = 0;
 
   // GUID for this browser context.
-  virtual const std::string& Id() const = 0;
+  virtual const std::string& Id() = 0;
 
   // TODO(skyostil): Allow saving and restoring contexts (crbug.com/617931).
 
diff --git a/infra/config/cr-buildbucket.cfg b/infra/config/cr-buildbucket.cfg
index 862033d3..96ae615 100644
--- a/infra/config/cr-buildbucket.cfg
+++ b/infra/config/cr-buildbucket.cfg
@@ -908,6 +908,7 @@
 builder_mixins {
   name: "win-gpu-ci"
   mixins: "win"
+  mixins: "builderless"
   recipe {
     properties: "mastername:chromium.gpu"
   }
@@ -924,14 +925,8 @@
 builder_mixins {
   name: "win-gpu-fyi-ci"
   mixins: "win"
+  mixins: "builderless"
   mixins: "gpu-fyi-ci"
-  mixins: "gpu-slow-bot"
-  # Remove the cores dimensions for this mixin so that VMs of differing sizes
-  # can be used.
-  # This works here only because we use auto_builder_dimensions,
-  # so that only the bots that were earmarked for the builders
-  # will be allowed to use them anyways.
-  dimensions: "cores:"
 }
 
 builder_mixins {
@@ -2253,11 +2248,11 @@
     }
     builders {
       name: "Win10 Debug (NVIDIA)"
-      mixins: "win-gpu-ci"
+      mixins: "linux-gpu-ci-tester"
     }
     builders {
       name: "Win10 Release (NVIDIA)"
-      mixins: "win-gpu-ci"
+      mixins: "linux-gpu-ci-tester"
     }
 
     # chromium.gpu.fyi
@@ -2285,80 +2280,82 @@
       name: "GPU FYI Win x64 dEQP Builder"
       mixins: "win-gpu-fyi-ci"
     }
+    # Can't use builderless "win-gpu-fyi-ci" for perf bulder. crbug.com/977735
     builders {
       name: "GPU FYI XR Win Builder"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "win"
+      mixins: "gpu-fyi-ci"
     }
     builders {
       name: "Win10 FYI Debug (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI dEQP Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Exp Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Release (Intel HD 630)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI dEQP Release (Intel HD 630)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Exp Release (Intel HD 630)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Release (AMD RX 550)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win10 FYI Release (NVIDIA GeForce GTX 1660)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
       execution_timeout_secs: 64800 # 18h.
     }
     builders {
       name: "Win10 FYI Release XR Perf (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI Debug (AMD)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI dEQP Release (AMD)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI Release (AMD)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI x64 dEQP Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
       name: "Win7 FYI x64 Release (NVIDIA)"
-      mixins: "win-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
     builders {
-      # TODO(crbug.com/952071): make this configuration work, then
-      # switch all of the Windows testers to use thin Linux VMs.
+      # TODO(crbug.com/952071): remove,
+      # once all of the Windows testers run succesfully on thin Linux VMs.
       name: "Win10 FYI Exp LinuxVM Testing (NVIDIA)"
-      mixins: "linux-gpu-fyi-ci"
+      mixins: "linux-gpu-fyi-ci-tester"
     }
 
     # chromium.dawn
diff --git a/ios/chrome/browser/metrics/ukm_egtest.mm b/ios/chrome/browser/metrics/ukm_egtest.mm
index fb6b281..03d3c09 100644
--- a/ios/chrome/browser/metrics/ukm_egtest.mm
+++ b/ios/chrome/browser/metrics/ukm_egtest.mm
@@ -25,7 +25,6 @@
 #import "ios/chrome/test/earl_grey/chrome_actions.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -189,7 +188,7 @@
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
 
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 }  // namespace
diff --git a/ios/chrome/browser/overlays/overlay_presenter_impl.mm b/ios/chrome/browser/overlays/overlay_presenter_impl.mm
index 63392f3..78934a51 100644
--- a/ios/chrome/browser/overlays/overlay_presenter_impl.mm
+++ b/ios/chrome/browser/overlays/overlay_presenter_impl.mm
@@ -6,6 +6,7 @@
 
 #include "base/logging.h"
 #import "ios/chrome/browser/main/browser.h"
+#include "ios/chrome/browser/overlays/public/overlay_request.h"
 #import "ios/chrome/browser/web_state_list/web_state_list.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -213,17 +214,19 @@
   // Pop the request for overlays dismissed by the user.  The check against the
   // queue's front request prevents popping the request twice in the event that
   // the front request was cancelled by the queue during a user-triggered
-  // dismissal.
+  // dismissal.  |popped_request| is used to extend the lifetime of the request
+  // past the DidHideOverlay() callbacks.
+  std::unique_ptr<OverlayRequest> popped_request;
   if (reason == OverlayDismissalReason::kUserInteraction && queue &&
       queue->front_request() == request) {
-    queue->PopFrontRequest();
+    popped_request = queue->PopFrontRequest();
   }
 
   presenting_ = false;
 
   // Notify the observers that the overlay UI was hidden.
   for (auto& observer : observers_) {
-    observer.DidHideOverlay(this);
+    observer.DidHideOverlay(this, request);
   }
 
   // Only show the next overlay if the active request has changed, either
diff --git a/ios/chrome/browser/overlays/overlay_presenter_impl_unittest.mm b/ios/chrome/browser/overlays/overlay_presenter_impl_unittest.mm
index 1abd5c1..247ee0b 100644
--- a/ios/chrome/browser/overlays/overlay_presenter_impl_unittest.mm
+++ b/ios/chrome/browser/overlays/overlay_presenter_impl_unittest.mm
@@ -31,7 +31,7 @@
   ~MockOverlayPresenterObserver() {}
 
   MOCK_METHOD2(WillShowOverlay, void(OverlayPresenter*, OverlayRequest*));
-  MOCK_METHOD1(DidHideOverlay, void(OverlayPresenter*));
+  MOCK_METHOD2(DidHideOverlay, void(OverlayPresenter*, OverlayRequest*));
 
   // OverlayPresenter's ObserverList checks that it is empty upon deallocation,
   // so a custom verification implemetation must be created.
@@ -157,8 +157,8 @@
   // Reset the UI delegate and verify that the overlay UI is cancelled in the
   // previous delegate's context and presented in the new delegate's context.
   FakeOverlayPresenterUIDelegate new_ui_delegate;
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), request));
   EXPECT_CALL(observer(), WillShowOverlay(&presenter(), request));
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
   presenter().SetUIDelegate(&new_ui_delegate);
   EXPECT_EQ(FakeOverlayPresenterUIDelegate::PresentationState::kCancelled,
             ui_delegate().GetPresentationState(request));
@@ -168,7 +168,7 @@
 
   // Reset the UI delegate to nullptr and verify that the overlay UI is
   // cancelled in |new_ui_delegate|'s context.
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), request));
   presenter().SetUIDelegate(nullptr);
   EXPECT_EQ(FakeOverlayPresenterUIDelegate::PresentationState::kCancelled,
             new_ui_delegate.GetPresentationState(request));
@@ -217,7 +217,7 @@
       std::make_unique<web::TestWebState>();
   web::WebState* second_web_state = passed_web_state.get();
   OverlayRequest* second_request = AddRequest(second_web_state);
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), first_request));
   web_state_list().InsertWebState(/*index=*/1, std::move(passed_web_state),
                                   WebStateList::InsertionFlags::INSERT_ACTIVATE,
                                   WebStateOpener());
@@ -231,8 +231,8 @@
 
   // Reactivate the first WebState and verify that its overlay is presented
   // while the second WebState's overlay is hidden.
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), second_request));
   EXPECT_CALL(observer(), WillShowOverlay(&presenter(), first_request));
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
   web_state_list().ActivateWebStateAt(0);
   EXPECT_EQ(FakeOverlayPresenterUIDelegate::PresentationState::kPresented,
             ui_delegate().GetPresentationState(first_request));
@@ -257,7 +257,7 @@
       std::make_unique<web::TestWebState>();
   web::WebState* replacement_web_state = passed_web_state.get();
   OverlayRequest* replacement_request = AddRequest(replacement_web_state);
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), first_request));
   web_state_list().ReplaceWebStateAt(/*index=*/0, std::move(passed_web_state));
 
   // Verify that the previously shown overlay is canceled and that the overlay
@@ -281,7 +281,7 @@
             ui_delegate().GetPresentationState(request));
 
   // Remove the WebState and verify that its overlay was cancelled.
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), request));
   web_state_list().CloseWebStateAt(/*index=*/0, /* close_flags= */ 0);
   EXPECT_EQ(FakeOverlayPresenterUIDelegate::PresentationState::kCancelled,
             ui_delegate().GetPresentationState(request));
@@ -306,7 +306,7 @@
 
   // Dismiss the overlay and check that the second request's overlay is
   // presented.
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), first_request));
   ui_delegate().SimulateDismissalForRequest(
       first_request, OverlayDismissalReason::kUserInteraction);
 
@@ -334,7 +334,7 @@
             ui_delegate().GetPresentationState(active_request));
 
   // Cancel the queue's requests and verify that the UI is also cancelled.
-  EXPECT_CALL(observer(), DidHideOverlay(&presenter()));
+  EXPECT_CALL(observer(), DidHideOverlay(&presenter(), active_request));
   queue->CancelAllRequests();
   EXPECT_EQ(FakeOverlayPresenterUIDelegate::PresentationState::kCancelled,
             ui_delegate().GetPresentationState(active_request));
diff --git a/ios/chrome/browser/overlays/overlay_request_queue_impl.h b/ios/chrome/browser/overlays/overlay_request_queue_impl.h
index 91f9081..daa55fc 100644
--- a/ios/chrome/browser/overlays/overlay_request_queue_impl.h
+++ b/ios/chrome/browser/overlays/overlay_request_queue_impl.h
@@ -66,10 +66,10 @@
   // The number of requests in the queue.
   size_t size() const { return requests_.size(); }
 
-  // Removes the front or back request from the queue.  Must be called on a non-
-  // empty queue.
-  void PopFrontRequest();
-  void PopBackRequest();
+  // Removes the front or back request from the queue, transferring ownership of
+  // the request to the caller.  Must be called on a non-empty queue.
+  std::unique_ptr<OverlayRequest> PopFrontRequest();
+  std::unique_ptr<OverlayRequest> PopBackRequest();
 
   // OverlayRequestQueue:
   void AddRequest(std::unique_ptr<OverlayRequest> request) override;
diff --git a/ios/chrome/browser/overlays/overlay_request_queue_impl.mm b/ios/chrome/browser/overlays/overlay_request_queue_impl.mm
index 6f13faf8..52fee22 100644
--- a/ios/chrome/browser/overlays/overlay_request_queue_impl.mm
+++ b/ios/chrome/browser/overlays/overlay_request_queue_impl.mm
@@ -61,14 +61,18 @@
   return weak_factory_.GetWeakPtr();
 }
 
-void OverlayRequestQueueImpl::PopFrontRequest() {
+std::unique_ptr<OverlayRequest> OverlayRequestQueueImpl::PopFrontRequest() {
   DCHECK(!requests_.empty());
+  std::unique_ptr<OverlayRequest> request = std::move(requests_.front());
   requests_.pop_front();
+  return request;
 }
 
-void OverlayRequestQueueImpl::PopBackRequest() {
+std::unique_ptr<OverlayRequest> OverlayRequestQueueImpl::PopBackRequest() {
   DCHECK(!requests_.empty());
+  std::unique_ptr<OverlayRequest> request = std::move(requests_.back());
   requests_.pop_back();
+  return request;
 }
 
 #pragma mark OverlayRequestQueue
diff --git a/ios/chrome/browser/overlays/public/overlay_presenter.h b/ios/chrome/browser/overlays/public/overlay_presenter.h
index daefcfb..6e4a2de0 100644
--- a/ios/chrome/browser/overlays/public/overlay_presenter.h
+++ b/ios/chrome/browser/overlays/public/overlay_presenter.h
@@ -69,8 +69,10 @@
     virtual void WillShowOverlay(OverlayPresenter* presenter,
                                  OverlayRequest* request) {}
 
-    // Called when |presenter| is finished dismissing its overlay UI.
-    virtual void DidHideOverlay(OverlayPresenter* presenter) {}
+    // Called when |presenter| is finished dismissing the overlay UI for
+    // |request|.
+    virtual void DidHideOverlay(OverlayPresenter* presenter,
+                                OverlayRequest* request) {}
 
     // Called when |presenter| is destroyed.
     virtual void OverlayPresenterDestroyed(OverlayPresenter* presenter) {}
diff --git a/ios/chrome/browser/ui/authentication/signin_earl_grey_ui.mm b/ios/chrome/browser/ui/authentication/signin_earl_grey_ui.mm
index 8622876a..dd2cef789 100644
--- a/ios/chrome/browser/ui/authentication/signin_earl_grey_ui.mm
+++ b/ios/chrome/browser/ui/authentication/signin_earl_grey_ui.mm
@@ -66,9 +66,7 @@
   [self confirmSigninConfirmationDialog];
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
-  NSError* signedInError =
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
-  GREYAssertNil(signedInError, signedInError.localizedDescription);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 }
 
 + (void)selectIdentityWithEmail:(NSString*)userEmail {
diff --git a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h
index 6c5d665..7cf2827 100644
--- a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h
+++ b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h
@@ -28,12 +28,11 @@
 // Returns a fake managed identity.
 - (ChromeIdentity*)fakeManagedIdentity;
 
-// Checks that |identity| is actually signed in to the active profile.
-- (NSError*)checkSignedInWithIdentity:(ChromeIdentity*)identity
-    WARN_UNUSED_RESULT;
+// Induces a GREYAssert if |identity| is not signed in to the active profile.
+- (void)checkSignedInWithIdentity:(ChromeIdentity*)identity;
 
-// Checks that no identity is signed in.
-- (NSError*)checkSignedOut WARN_UNUSED_RESULT;
+// Induces a GREYAssert if an identity is signed in.
+- (void)checkSignedOut;
 
 @end
 
diff --git a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm
index 302af9d9..0d60c7c 100644
--- a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm
+++ b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm
@@ -37,7 +37,7 @@
                                           name:@"Fake Managed"];
 }
 
-- (NSError*)checkSignedInWithIdentity:(ChromeIdentity*)identity {
+- (void)checkSignedInWithIdentity:(ChromeIdentity*)identity {
   BOOL identityIsNonNil = identity != nil;
   EG_TEST_HELPER_ASSERT_TRUE(identityIsNonNil, @"Need to give an identity");
 
@@ -55,11 +55,9 @@
                        identity.gaiaID, primaryAccountGaiaID];
   EG_TEST_HELPER_ASSERT_TRUE(
       [identity.gaiaID isEqualToString:primaryAccountGaiaID], errorStr);
-
-  return nil;
 }
 
-- (NSError*)checkSignedOut {
+- (void)checkSignedOut {
   // Required to avoid any problem since the following test is not dependant to
   // UI, and the previous action has to be totally finished before going through
   // the assert.
@@ -67,8 +65,6 @@
 
   EG_TEST_HELPER_ASSERT_TRUE([SignInEarlGreyUtilsAppInterface isSignedOut],
                              @"Unexpected signed in user");
-
-  return nil;
 }
 
 @end
diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
index f22a0ca0..8df4ff77 100644
--- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm
+++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
@@ -26,7 +26,6 @@
 #include "ios/chrome/grit/ios_chromium_strings.h"
 #include "ios/chrome/grit/ios_strings.h"
 #import "ios/chrome/test/app/chrome_test_util.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -218,8 +217,7 @@
   [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()]
       performAction:grey_tap()];
 
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 
   // Undo the sign-in and dismiss the Sign In screen.
   [[EarlGrey selectElementWithMatcher:UndoAccountConsistencyButton()]
@@ -228,7 +226,7 @@
       performAction:grey_tap()];
 
   // |identity| shouldn't be signed in.
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 // Signs in to an account and then taps the Advanced link to go to settings.
@@ -247,13 +245,7 @@
     [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()]
         performAction:grey_tap()];
 
-    NSError* signedInError =
-        [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
-    // TODO(crbug.com/951600): Avoid asserting directly unless the test fails,
-    // due to timing issues.
-    if (signedInError != nil) {
-      GREYAssert(false, signedInError.localizedDescription);
-    }
+    [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
   }
 
   // Tap Settings link.
@@ -274,8 +266,7 @@
         performAction:grey_tap()];
   }
 
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 
   GREYAssertTrue(sync_service->HasFinishedInitialSetup(),
                  @"Sync should have finished its original setup");
diff --git a/ios/chrome/browser/ui/infobars/banners/BUILD.gn b/ios/chrome/browser/ui/infobars/banners/BUILD.gn
index 55938ac..f049edf 100644
--- a/ios/chrome/browser/ui/infobars/banners/BUILD.gn
+++ b/ios/chrome/browser/ui/infobars/banners/BUILD.gn
@@ -24,6 +24,7 @@
   sources = [
     "infobar_banner_constants.h",
     "infobar_banner_constants.mm",
+    "infobar_banner_interaction_delegate.h",
   ]
 }
 
diff --git a/ios/chrome/browser/ui/infobars/banners/infobar_banner_interaction_delegate.h b/ios/chrome/browser/ui/infobars/banners/infobar_banner_interaction_delegate.h
new file mode 100644
index 0000000..1de2248
--- /dev/null
+++ b/ios/chrome/browser/ui/infobars/banners/infobar_banner_interaction_delegate.h
@@ -0,0 +1,22 @@
+// 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_INFOBARS_BANNERS_INFOBAR_BANNER_INTERACTION_DELEGATE_H_
+#define IOS_CHROME_BROWSER_UI_INFOBARS_BANNERS_INFOBAR_BANNER_INTERACTION_DELEGATE_H_
+
+// Delegate for InfobarBannerInteractable events.
+@protocol InfobarBannerInteractionDelegate
+// Called by the InfobarBanner whenever an interaction has started.
+- (void)infobarBannerStartedInteraction;
+@end
+
+// An InfobarBanner must conform to this protocol if its presentation will be
+// interactable and interruptible.
+@protocol InfobarBannerInteractable
+// Delegate to communicate events.
+@property(nonatomic, weak) id<InfobarBannerInteractionDelegate>
+    interactionDelegate;
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_INFOBARS_BANNERS_INFOBAR_BANNER_INTERACTION_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h
index 088b1816..72400e7 100644
--- a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h
+++ b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h
@@ -8,12 +8,14 @@
 #import <UIKit/UIKit.h>
 
 #import "ios/chrome/browser/infobars/infobar_type.h"
+#import "ios/chrome/browser/ui/infobars/banners/infobar_banner_interaction_delegate.h"
 
 @protocol InfobarBannerDelegate;
 
 // ViewController that manages an InfobarBanner. It consists of a leading icon,
 // a title and optional subtitle, and a trailing button.
-@interface InfobarBannerViewController : UIViewController
+@interface InfobarBannerViewController
+    : UIViewController <InfobarBannerInteractable>
 
 // Designated Initializer. |delegate| handles InfobarBannerVC actions, and
 // |infobarType| is used to know which Coordinator presented this VC.
diff --git a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm
index a5bb55f..58c946f8 100644
--- a/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.mm
@@ -92,6 +92,7 @@
 @end
 
 @implementation InfobarBannerViewController
+@synthesize interactionDelegate = _interactionDelegate;
 
 - (instancetype)initWithDelegate:(id<InfobarBannerDelegate>)delegate
                             type:(InfobarType)infobarType {
@@ -283,6 +284,7 @@
   CGPoint touchLocation = [gesture locationInView:self.view];
 
   if (gesture.state == UIGestureRecognizerStateBegan) {
+    [self.interactionDelegate infobarBannerStartedInteraction];
     [self.metricsRecorder recordBannerEvent:MobileMessagesBannerEvent::Handled];
     self.originalCenter = self.view.center;
     self.touchInProgress = YES;
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
index 4a3238c..bb95d990 100644
--- a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
+++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
@@ -4,6 +4,7 @@
 
 #import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.h"
 
+#include "base/mac/foundation_util.h"
 #import "ios/chrome/browser/ui/fullscreen/animated_scoped_fullscreen_disabler.h"
 #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.h"
 #import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h"
@@ -92,6 +93,14 @@
   self.bannerTransitionDriver = [[InfobarBannerTransitionDriver alloc] init];
   self.bannerTransitionDriver.bannerPositioner = self;
   self.bannerViewController.transitioningDelegate = self.bannerTransitionDriver;
+  if ([self.bannerViewController
+          conformsToProtocol:@protocol(InfobarBannerInteractable)]) {
+    UIViewController<InfobarBannerInteractable>* interactableBanner =
+        base::mac::ObjCCastStrict<UIViewController<InfobarBannerInteractable>>(
+            self.bannerViewController);
+    interactableBanner.interactionDelegate = self.bannerTransitionDriver;
+  }
+
   __weak __typeof(self) weakSelf = self;
   [self.baseViewController
       presentViewController:self.bannerViewController
@@ -175,7 +184,11 @@
                     animated:(BOOL)animated
                   completion:(void (^)())completion {
   DCHECK(self.baseViewController);
-  if (self.baseViewController.presentedViewController) {
+  // Make sure the banner is completely presented before trying to dismiss it.
+  [self.bannerTransitionDriver completePresentationTransitionIfRunning];
+
+  if (self.baseViewController.presentedViewController ==
+      self.bannerViewController) {
     [self.baseViewController
         dismissViewControllerAnimated:animated
                            completion:^{
diff --git a/ios/chrome/browser/ui/infobars/presentation/BUILD.gn b/ios/chrome/browser/ui/infobars/presentation/BUILD.gn
index 9a1a8e07..30a35c5 100644
--- a/ios/chrome/browser/ui/infobars/presentation/BUILD.gn
+++ b/ios/chrome/browser/ui/infobars/presentation/BUILD.gn
@@ -22,6 +22,7 @@
   ]
   deps = [
     "//base",
+    "//ios/chrome/browser/ui/infobars/banners:public",
     "//ios/chrome/browser/ui/util",
   ]
 }
diff --git a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.h b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.h
index e8fcb40..4c70b20b 100644
--- a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.h
+++ b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.h
@@ -17,6 +17,9 @@
 // one.
 @property(nonatomic, assign) BOOL presenting;
 
+// The UIViewPropertyAnimator animating the presentation/dismissal.
+@property(nonatomic, strong) UIViewPropertyAnimator* propertyAnimator;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_INFOBARS_PRESENTATION_INFOBAR_BANNER_ANIMATOR_H_
diff --git a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.mm b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.mm
index 7c414e1..64114fcb 100644
--- a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.mm
+++ b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.mm
@@ -91,7 +91,8 @@
     [transitionContext completeTransition:success];
   }];
 
-  [animator startAnimation];
+  self.propertyAnimator = animator;
+  [self.propertyAnimator startAnimation];
 }
 
 @end
diff --git a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h
index 491b5b3..10eafa5 100644
--- a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h
+++ b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h
@@ -7,15 +7,24 @@
 
 #import <UIKit/UIKit.h>
 
+#import "ios/chrome/browser/ui/infobars/banners/infobar_banner_interaction_delegate.h"
+
 @protocol InfobarBannerPositioner;
 
 // The transition delegate used to present an InfobarBanner.
 @interface InfobarBannerTransitionDriver
-    : NSObject <UIViewControllerTransitioningDelegate>
+    : NSObject <UIViewControllerTransitioningDelegate,
+                InfobarBannerInteractionDelegate>
 
 // Delegate used to position the InfobarBanner.
 @property(nonatomic, assign) id<InfobarBannerPositioner> bannerPositioner;
 
+// Completes the banner presentation if taking place. This will stop the banner
+// animation and move it to the presenting ViewController hierarchy.
+// This method should be called if trying to dismiss the banner before its
+// presentation has finished.
+- (void)completePresentationTransitionIfRunning;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_INFOBARS_PRESENTATION_INFOBAR_BANNER_TRANSITION_DRIVER_H_
diff --git a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
index 93906a287..877ca13 100644
--- a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
+++ b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
@@ -68,4 +68,21 @@
   return self.bannerAnimator;
 }
 
+#pragma mark - Public Methods
+
+- (void)completePresentationTransitionIfRunning {
+  if (self.bannerAnimator.presenting &&
+      self.bannerAnimator.propertyAnimator.running) {
+    [self.bannerAnimator.propertyAnimator stopAnimation:NO];
+    [self.bannerAnimator.propertyAnimator
+        finishAnimationAtPosition:UIViewAnimatingPositionCurrent];
+  }
+}
+
+#pragma mark - InfobarBannerInteractionDelegate
+
+- (void)infobarBannerStartedInteraction {
+  [self completePresentationTransitionIfRunning];
+}
+
 @end
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm
index 1e54929..5f48c836 100644
--- a/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm
+++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm
@@ -25,7 +25,6 @@
 #include "ios/chrome/grit/ios_strings.h"
 #import "ios/chrome/test/app/chrome_test_util.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -82,7 +81,7 @@
 
   [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
       assertWithMatcher:grey_sufficientlyVisible()];
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -108,7 +107,7 @@
 
   [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
       assertWithMatcher:grey_sufficientlyVisible()];
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -141,8 +140,7 @@
                                    grey_accessibilityLabel(identity2.userEmail),
                                    grey_sufficientlyVisible(), nil)]
       assertWithMatcher:grey_nil()];
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity1]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity1];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -188,8 +186,7 @@
                                    grey_accessibilityLabel(identity2.userEmail),
                                    grey_sufficientlyVisible(), nil)]
       assertWithMatcher:grey_nil()];
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity1]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity1];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -215,7 +212,7 @@
   // Check that the user is signed out and the Main Settings screen is shown.
   [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
       assertWithMatcher:grey_sufficientlyVisible()];
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -244,8 +241,7 @@
   [[EarlGrey selectElementWithMatcher:chrome_test_util::
                                           SettingsAccountsCollectionView()]
       assertWithMatcher:grey_sufficientlyVisible()];
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
diff --git a/ios/chrome/browser/ui/settings/signin_settings_egtest.mm b/ios/chrome/browser/ui/settings/signin_settings_egtest.mm
index 9f76d33..5fc18a7 100644
--- a/ios/chrome/browser/ui/settings/signin_settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/signin_settings_egtest.mm
@@ -15,7 +15,6 @@
 #include "ios/chrome/grit/ios_strings.h"
 #import "ios/chrome/test/app/chrome_test_util.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -74,8 +73,7 @@
   [SigninEarlGreyUI confirmSigninConfirmationDialog];
 
   // User signed in.
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
   [SigninEarlGreyUI checkSigninPromoNotVisible];
   [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
       assertWithMatcher:grey_interactable()];
@@ -95,8 +93,7 @@
   [SigninEarlGreyUI confirmSigninConfirmationDialog];
 
   // User signed in.
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
   [SigninEarlGreyUI checkSigninPromoNotVisible];
   [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
       assertWithMatcher:grey_interactable()];
diff --git a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm
index a75d6e9..673294d 100644
--- a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm
+++ b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm
@@ -28,7 +28,6 @@
 #include "ios/chrome/grit/ios_strings.h"
 #import "ios/chrome/test/app/chrome_test_util.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -91,8 +90,7 @@
   [SigninEarlGreyUI signinWithIdentity:identity];
 
   // Check |identity| is signed-in.
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 }
 
 // Tests that signing out from the Settings works correctly.
@@ -123,7 +121,7 @@
       performAction:grey_tap()];
 
   // Check that there is no signed in user.
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 // Tests that signing out of a managed account from the Settings works
@@ -146,8 +144,7 @@
   SetEarlGreySynchronizationEnabled(YES);
 
   [SigninEarlGreyUI confirmSigninConfirmationDialog];
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 
   // Go to Accounts Settings and tap the sign out button.
   [[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsAccountButton()]
@@ -167,7 +164,7 @@
       performAction:grey_tap()];
 
   // Check that there is no signed in user.
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 // Tests that signing in, tapping the Settings link on the confirmation screen
@@ -199,8 +196,7 @@
           IDS_IOS_SETTINGS_TITLE);
   [[EarlGrey selectElementWithMatcher:settings_matcher]
       assertWithMatcher:grey_notVisible()];
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
 }
 
 // Opens the sign in screen and then cancel it by opening a new tab. Ensures
@@ -269,7 +265,7 @@
       onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()]
       performAction:grey_tap()];
   TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 
   // Sign in with |identity1|.
   [[EarlGrey selectElementWithMatcher:SecondarySignInButton()]
@@ -300,7 +296,7 @@
   TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON);
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 // Opens the sign in screen from the bookmarks and then cancel it by tapping on
@@ -468,11 +464,10 @@
   GREYAssertEqual(expectedString, webState->GetVisibleURL(), @"url not loaded");
   if (tapSettingsLink) {
     // Should be signed in.
-    CHROME_EG_ASSERT_NO_ERROR(
-        [SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
+    [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
   } else {
     // Should be not signed in.
-    CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+    [SigninEarlGreyUtils checkSignedOut];
   }
 }
 
diff --git a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_unity_egtest.mm b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_unity_egtest.mm
index 9a86ee69..5112911 100644
--- a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_unity_egtest.mm
+++ b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_unity_egtest.mm
@@ -18,7 +18,6 @@
 #include "ios/chrome/grit/ios_strings.h"
 #import "ios/chrome/test/app/chrome_test_util.h"
 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
-#import "ios/chrome/test/earl_grey/chrome_error_util.h"
 #import "ios/chrome/test/earl_grey/chrome_matchers.h"
 #import "ios/chrome/test/earl_grey/chrome_test_case.h"
 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
@@ -62,7 +61,7 @@
       onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()]
       performAction:grey_tap()];
   TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
-  CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]);
+  [SigninEarlGreyUtils checkSignedOut];
 }
 
 }  // namespace
@@ -160,8 +159,7 @@
       performAction:grey_tap()];
 
   // Check the signed-in user did change.
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity2]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity2];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
@@ -205,8 +203,7 @@
       performAction:grey_tap()];
 
   // Check the signed-in user did change.
-  CHROME_EG_ASSERT_NO_ERROR(
-      [SigninEarlGreyUtils checkSignedInWithIdentity:identity2]);
+  [SigninEarlGreyUtils checkSignedInWithIdentity:identity2];
 
   [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
       performAction:grey_tap()];
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 7a477c73f..9ce7011dd3 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -3264,7 +3264,6 @@
       "android/java/src/org/chromium/net/ProxyChangeListener.java",
       "android/java/src/org/chromium/net/X509Util.java",
     ]
-    jni_package = "net"
   }
   generate_jni("net_test_jni_headers") {
     sources = [
@@ -3274,7 +3273,6 @@
       "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
       "test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
     ]
-    jni_package = "net/test"
   }
 }
 
@@ -3733,6 +3731,8 @@
     "data/crl_unittest/bad_crldp_has_crlissuer.pem",
     "data/crl_unittest/bad_fake_critical_crlentryextension.pem",
     "data/crl_unittest/bad_fake_critical_extension.pem",
+    "data/crl_unittest/bad_idp_contains_wrong_uri.pem",
+    "data/crl_unittest/bad_idp_indirectcrl.pem",
     "data/crl_unittest/bad_key_rollover_signature.pem",
     "data/crl_unittest/bad_nextupdate_too_old.pem",
     "data/crl_unittest/bad_signature.pem",
@@ -3743,6 +3743,7 @@
     "data/crl_unittest/good_fake_extension.pem",
     "data/crl_unittest/good_fake_extension_no_nextupdate.pem",
     "data/crl_unittest/good_generalizedtime.pem",
+    "data/crl_unittest/good_idp_contains_uri.pem",
     "data/crl_unittest/good_issuer_name_normalization.pem",
     "data/crl_unittest/good_issuer_no_keyusage.pem",
     "data/crl_unittest/good_key_rollover.pem",
@@ -3766,6 +3767,8 @@
     "data/crl_unittest/invalid_garbage_tbscertlist.pem",
     "data/crl_unittest/invalid_garbage_thisupdate.pem",
     "data/crl_unittest/invalid_garbage_version.pem",
+    "data/crl_unittest/invalid_idp_dpname_choice_extra_data.pem",
+    "data/crl_unittest/invalid_idp_empty_sequence.pem",
     "data/crl_unittest/invalid_issuer_keyusage_no_crlsign.pem",
     "data/crl_unittest/invalid_key_rollover_issuer_keyusage_no_crlsign.pem",
     "data/crl_unittest/invalid_mismatched_signature_algorithm.pem",
@@ -6346,6 +6349,17 @@
   ]
 }
 
+fuzzer_test("net_cert_crl_parse_issuing_distribution_point_fuzzer") {
+  sources = [
+    "cert/internal/crl_parse_issuing_distribution_point_fuzzer.cc",
+  ]
+  seed_corpus = "data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer"
+  deps = [
+    "//base",
+    "//net",
+  ]
+}
+
 fuzzer_test("net_cert_crl_getcrlstatusforcert_fuzzer") {
   sources = [
     "cert/internal/crl_getcrlstatusforcert_fuzzer.cc",
diff --git a/net/DEPS b/net/DEPS
index df77e03..291fa1a 100644
--- a/net/DEPS
+++ b/net/DEPS
@@ -1,8 +1,8 @@
 include_rules = [
   "+crypto",
   "+gin",
-  "+jni",
   "+mojo/public",
+  "+net/net_jni_headers",
   "+third_party/apple_apsl",
   "+third_party/boringssl/src/include",
   "+third_party/nss",
diff --git a/net/android/android_http_util.cc b/net/android/android_http_util.cc
index fa4f64f..83f8831 100644
--- a/net/android/android_http_util.cc
+++ b/net/android/android_http_util.cc
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include "base/android/jni_string.h"
-#include "jni/HttpUtil_jni.h"
 #include "net/http/http_util.h"
+#include "net/net_jni_headers/HttpUtil_jni.h"
 #include "url/gurl.h"
 
 using base::android::JavaParamRef;
diff --git a/net/android/cellular_signal_strength.cc b/net/android/cellular_signal_strength.cc
index 3242461..3525440 100644
--- a/net/android/cellular_signal_strength.cc
+++ b/net/android/cellular_signal_strength.cc
@@ -4,7 +4,7 @@
 
 #include "net/android/cellular_signal_strength.h"
 
-#include "jni/AndroidCellularSignalStrength_jni.h"
+#include "net/net_jni_headers/AndroidCellularSignalStrength_jni.h"
 
 namespace net {
 
diff --git a/net/android/cert_verify_result_android.cc b/net/android/cert_verify_result_android.cc
index eff90d8b..39655b6 100644
--- a/net/android/cert_verify_result_android.cc
+++ b/net/android/cert_verify_result_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_array.h"
-#include "jni/AndroidCertVerifyResult_jni.h"
+#include "net/net_jni_headers/AndroidCertVerifyResult_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::JavaArrayOfByteArrayToStringVector;
diff --git a/net/android/dummy_spnego_authenticator.cc b/net/android/dummy_spnego_authenticator.cc
index b251f6f..7ff2ca1 100644
--- a/net/android/dummy_spnego_authenticator.cc
+++ b/net/android/dummy_spnego_authenticator.cc
@@ -6,7 +6,7 @@
 #include "base/android/jni_string.h"
 #include "base/base64.h"
 #include "base/stl_util.h"
-#include "net/test/jni/DummySpnegoAuthenticator_jni.h"
+#include "net/net_test_jni_headers/DummySpnegoAuthenticator_jni.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 using base::android::JavaParamRef;
diff --git a/net/android/gurl_utils.cc b/net/android/gurl_utils.cc
index 68d65b3..764324b 100644
--- a/net/android/gurl_utils.cc
+++ b/net/android/gurl_utils.cc
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/android/jni_string.h"
-#include "jni/GURLUtils_jni.h"
+#include "net/net_jni_headers/GURLUtils_jni.h"
 #include "url/gurl.h"
 
 using base::android::JavaParamRef;
diff --git a/net/android/http_auth_negotiate_android.cc b/net/android/http_auth_negotiate_android.cc
index e83f94ba..f8263c8 100644
--- a/net/android/http_auth_negotiate_android.cc
+++ b/net/android/http_auth_negotiate_android.cc
@@ -11,12 +11,12 @@
 #include "base/location.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "jni/HttpNegotiateAuthenticator_jni.h"
 #include "net/base/auth.h"
 #include "net/base/net_errors.h"
 #include "net/http/http_auth_challenge_tokenizer.h"
 #include "net/http/http_auth_multi_round_parse.h"
 #include "net/http/http_auth_preferences.h"
+#include "net/net_jni_headers/HttpNegotiateAuthenticator_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertUTF8ToJavaString;
diff --git a/net/android/keystore.cc b/net/android/keystore.cc
index ce0aa792..a3e577f 100644
--- a/net/android/keystore.cc
+++ b/net/android/keystore.cc
@@ -10,7 +10,7 @@
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
 #include "base/logging.h"
-#include "jni/AndroidKeyStore_jni.h"
+#include "net/net_jni_headers/AndroidKeyStore_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/net/android/network_change_notifier_delegate_android.cc b/net/android/network_change_notifier_delegate_android.cc
index a659534..b5fbd2f0 100644
--- a/net/android/network_change_notifier_delegate_android.cc
+++ b/net/android/network_change_notifier_delegate_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_array.h"
 #include "base/logging.h"
-#include "jni/NetworkChangeNotifier_jni.h"
 #include "net/android/network_change_notifier_android.h"
+#include "net/net_jni_headers/NetworkChangeNotifier_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::JavaRef;
diff --git a/net/android/network_library.cc b/net/android/network_library.cc
index 41665c4..6ed1e809 100644
--- a/net/android/network_library.cc
+++ b/net/android/network_library.cc
@@ -9,8 +9,8 @@
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/logging.h"
-#include "jni/AndroidNetworkLibrary_jni.h"
 #include "net/dns/public/dns_protocol.h"
+#include "net/net_jni_headers/AndroidNetworkLibrary_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
diff --git a/net/android/traffic_stats.cc b/net/android/traffic_stats.cc
index e690974e..48cdcd2 100644
--- a/net/android/traffic_stats.cc
+++ b/net/android/traffic_stats.cc
@@ -4,7 +4,7 @@
 
 #include "net/android/traffic_stats.h"
 
-#include "jni/AndroidTrafficStats_jni.h"
+#include "net/net_jni_headers/AndroidTrafficStats_jni.h"
 
 namespace net {
 
diff --git a/net/base/net_string_util_icu_alternatives_android.cc b/net/base/net_string_util_icu_alternatives_android.cc
index 222312e1..fad7f451 100644
--- a/net/base/net_string_util_icu_alternatives_android.cc
+++ b/net/base/net_string_util_icu_alternatives_android.cc
@@ -6,8 +6,8 @@
 #include "base/android/jni_string.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_piece.h"
-#include "jni/NetStringUtil_jni.h"
 #include "net/base/net_string_util.h"
+#include "net/net_jni_headers/NetStringUtil_jni.h"
 
 using base::android::ScopedJavaLocalRef;
 
diff --git a/net/cert/internal/crl.cc b/net/cert/internal/crl.cc
index a810e87..9563484 100644
--- a/net/cert/internal/crl.cc
+++ b/net/cert/internal/crl.cc
@@ -19,6 +19,13 @@
 
 namespace {
 
+// id-ce-issuingDistributionPoint OBJECT IDENTIFIER ::= { id-ce 28 }
+// In dotted notation: 2.5.29.28
+der::Input IssuingDistributionPointOid() {
+  static const uint8_t oid[] = {0x55, 0x1d, 0x1c};
+  return der::Input(oid);
+}
+
 WARN_UNUSED_RESULT bool NormalizeNameTLV(const der::Input& name_tlv,
                                          std::string* out_normalized_name) {
   der::Parser parser(name_tlv);
@@ -29,6 +36,14 @@
          !parser.HasMore();
 }
 
+bool ContainsExactMatchingName(std::vector<base::StringPiece> a,
+                               std::vector<base::StringPiece> b) {
+  std::sort(a.begin(), a.end());
+  std::sort(b.begin(), b.end());
+  return !base::STLSetIntersection<std::vector<base::StringPiece>>(a, b)
+              .empty();
+}
+
 }  // namespace
 
 bool ParseCrlCertificateList(const der::Input& crl_tlv,
@@ -158,6 +173,70 @@
   return true;
 }
 
+bool ParseIssuingDistributionPoint(
+    const der::Input& extension_value,
+    std::unique_ptr<GeneralNames>* out_distribution_point_names) {
+  der::Parser idp_extension_value_parser(extension_value);
+  // IssuingDistributionPoint ::= SEQUENCE {
+  der::Parser idp_parser;
+  if (!idp_extension_value_parser.ReadSequence(&idp_parser))
+    return false;
+
+  // 5.2.5.  Conforming CRLs issuers MUST NOT issue CRLs where the DER
+  //    encoding of the issuing distribution point extension is an empty
+  //    sequence.
+  if (!idp_parser.HasMore())
+    return false;
+
+  //  distributionPoint          [0] DistributionPointName OPTIONAL,
+  base::Optional<der::Input> distribution_point;
+  if (!idp_parser.ReadOptionalTag(
+          der::kTagContextSpecific | der::kTagConstructed | 0,
+          &distribution_point)) {
+    return false;
+  }
+
+  if (distribution_point.has_value()) {
+    //   DistributionPointName ::= CHOICE {
+    der::Parser dp_name_parser(*distribution_point);
+    //        fullName                [0]     GeneralNames,
+    //        nameRelativeToCRLIssuer [1]     RelativeDistinguishedName }
+    base::Optional<der::Input> der_full_name;
+    if (!dp_name_parser.ReadOptionalTag(
+            der::kTagContextSpecific | der::kTagConstructed | 0,
+            &der_full_name)) {
+      return false;
+    }
+    if (!der_full_name) {
+      // Only fullName is supported.
+      return false;
+    }
+    CertErrors errors;
+    *out_distribution_point_names =
+        GeneralNames::CreateFromValue(*der_full_name, &errors);
+    if (!*out_distribution_point_names)
+      return false;
+
+    if (dp_name_parser.HasMore()) {
+      // CHOICE represents a single value.
+      return false;
+    }
+  }
+
+  //  onlyContainsUserCerts      [1] BOOLEAN DEFAULT FALSE,
+  //  onlyContainsCACerts        [2] BOOLEAN DEFAULT FALSE,
+  //  onlySomeReasons            [3] ReasonFlags OPTIONAL,
+  //  indirectCRL                [4] BOOLEAN DEFAULT FALSE,
+  //  onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
+  // onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL,
+  // and onlyContainsAttributeCerts are not supported, fail parsing if they are
+  // present.
+  if (idp_parser.HasMore())
+    return false;
+
+  return true;
+}
+
 CRLRevocationStatus GetCRLStatusForCert(
     const der::Input& cert_serial,
     CrlVersion crl_version,
@@ -336,16 +415,65 @@
   if (der::Input(&normalized_crl_issuer) != target_cert->normalized_issuer())
     return CRLRevocationStatus::UNKNOWN;
 
-  // 6.3.3 (b) (2) If the complete CRL includes an issuing distribution point
-  //               (IDP) CRL extension ...
-  // This implementation does not support CRL extensions, fail if any critical
-  // CRL extensions are present.
   if (tbs_cert_list.crl_extensions_tlv.has_value()) {
     std::map<der::Input, ParsedExtension> extensions;
     if (!ParseExtensions(*tbs_cert_list.crl_extensions_tlv, &extensions))
       return CRLRevocationStatus::UNKNOWN;
 
+    // 6.3.3 (b) (2) If the complete CRL includes an issuing distribution point
+    //               (IDP) CRL extension, check the following:
+    ParsedExtension idp_extension;
+    if (ConsumeExtension(IssuingDistributionPointOid(), &extensions,
+                         &idp_extension)) {
+      std::unique_ptr<GeneralNames> distribution_point_names;
+      if (!ParseIssuingDistributionPoint(idp_extension.value,
+                                         &distribution_point_names)) {
+        return CRLRevocationStatus::UNKNOWN;
+      }
+
+      if (distribution_point_names) {
+        // 6.3.3. [If the CRL was not specified in a distribution point], assume
+        //        a DP with both the reasons and the cRLIssuer fields omitted
+        //        and a distribution point name of the certificate issuer.
+        // Since only URI distribution point names are supported currently,
+        // just fail in this case.
+        // TODO(https://crbug.com/749276): update this if all distribution
+        // point name types are supported.
+        if (!cert_dp)
+          return CRLRevocationStatus::UNKNOWN;
+
+        // 6.3.3. (b) (2) (i) If the distribution point name is present in the
+        //                    IDP CRL extension and the distribution field is
+        //                    present in the DP, then verify that one of the
+        //                    names in the IDP matches one of the names in the
+        //                    DP.
+        // 5.2.5.  The identical encoding MUST be used in the distributionPoint
+        //         fields of the certificate and the CRL.
+        // TODO(https://crbug.com/749276): Check other name types?
+        if (!ContainsExactMatchingName(
+                cert_dp->uris,
+                distribution_point_names->uniform_resource_identifiers)) {
+          return CRLRevocationStatus::UNKNOWN;
+        }
+
+        // 6.3.3. (b) (2) (i) If the distribution point name is present in the
+        //                    IDP CRL extension and the distribution field is
+        //                    omitted from the DP, then verify that one of the
+        //                    names in the IDP matches one of the names in the
+        //                    cRLIssuer field of the DP.
+        // Indirect CRLs are not supported, if indirectCRL was specified,
+        // ParseIssuingDistributionPoint would already have failed.
+      }
+
+      // 6.3.3. (b) (2) (ii - iiii): onlyContainsUserCerts,
+      // onlyContainsCACerts, onlyContainsAttributeCerts not supported.
+      // TODO(https://crbug.com/749276): handle onlyContainsUserCerts &
+      // onlyContainsCACerts. Some random sampling of public CRLs found a few
+      // that use those and it should be easy enough to implement.
+    }
+
     for (const auto& ext : extensions) {
+      // Fail if any unhandled critical CRL extensions are present.
       if (ext.second.critical)
         return CRLRevocationStatus::UNKNOWN;
     }
diff --git a/net/cert/internal/crl.h b/net/cert/internal/crl.h
index bbf1753..a2e93df2 100644
--- a/net/cert/internal/crl.h
+++ b/net/cert/internal/crl.h
@@ -9,6 +9,7 @@
 #include "base/strings/string_piece_forward.h"
 #include "base/time/time.h"
 #include "net/base/net_export.h"
+#include "net/cert/internal/general_names.h"
 #include "net/cert/internal/parsed_certificate.h"
 #include "net/der/input.h"
 #include "net/der/parse_values.h"
@@ -145,6 +146,35 @@
   base::Optional<der::Input> crl_extensions_tlv;
 };
 
+// Parses a DER-encoded IssuingDistributionPoint extension value.
+// Returns true on success and sets the results in the
+// |out_distribution_point_names| parameter.
+//
+// If the IssuingDistributionPoint contains a distributionPoint fullName field,
+// |out_distribution_point_names| will contain the parsed representation.
+// If the distributionPoint type is nameRelativeToCRLIssuer, parsing will fail.
+//
+// onlyContainsUserCerts, onlyContainsCACerts, indirectCRL and
+// onlyContainsAttributeCerts are not supported and parsing will fail if they
+// are present.
+//
+// Note that on success |out_distribution_point_names| aliases data from the
+// input |extension_value|.
+//
+// On failure |out_distribution_point_names| has undefined state.
+//
+// IssuingDistributionPoint ::= SEQUENCE {
+//     distributionPoint          [0] DistributionPointName OPTIONAL,
+//     onlyContainsUserCerts      [1] BOOLEAN DEFAULT FALSE,
+//     onlyContainsCACerts        [2] BOOLEAN DEFAULT FALSE,
+//     onlySomeReasons            [3] ReasonFlags OPTIONAL,
+//     indirectCRL                [4] BOOLEAN DEFAULT FALSE,
+//     onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
+NET_EXPORT_PRIVATE bool ParseIssuingDistributionPoint(
+    const der::Input& extension_value,
+    std::unique_ptr<GeneralNames>* out_distribution_point_names)
+    WARN_UNUSED_RESULT;
+
 NET_EXPORT_PRIVATE CRLRevocationStatus
 GetCRLStatusForCert(const der::Input& cert_serial,
                     CrlVersion crl_version,
diff --git a/net/cert/internal/crl_parse_issuing_distribution_point_fuzzer.cc b/net/cert/internal/crl_parse_issuing_distribution_point_fuzzer.cc
new file mode 100644
index 0000000..3a7cd455
--- /dev/null
+++ b/net/cert/internal/crl_parse_issuing_distribution_point_fuzzer.cc
@@ -0,0 +1,22 @@
+// 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 <stddef.h>
+#include <stdint.h>
+
+#include "net/cert/internal/crl.h"
+#include "net/der/input.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  net::der::Input idp_der(data, size);
+
+  std::unique_ptr<net::GeneralNames> distribution_point_names;
+
+  if (net::ParseIssuingDistributionPoint(idp_der, &distribution_point_names)) {
+    CHECK((distribution_point_names &&
+           distribution_point_names->present_name_types !=
+               net::GENERAL_NAME_NONE));
+  }
+  return 0;
+}
diff --git a/net/cert/internal/crl_unittest.cc b/net/cert/internal/crl_unittest.cc
index 11330061..6ecc5bc 100644
--- a/net/cert/internal/crl_unittest.cc
+++ b/net/cert/internal/crl_unittest.cc
@@ -47,6 +47,7 @@
     "good_no_version.pem",
     "good_no_crldp.pem",
     "good_key_rollover.pem",
+    "good_idp_contains_uri.pem",
     "revoked.pem",
     "revoked_no_nextupdate.pem",
     "revoked_fake_crlentryextension.pem",
@@ -61,6 +62,8 @@
     "bad_nextupdate_too_old.pem",
     "bad_wrong_issuer.pem",
     "bad_key_rollover_signature.pem",
+    "bad_idp_contains_wrong_uri.pem",
+    "bad_idp_indirectcrl.pem",
     "invalid_mismatched_signature_algorithm.pem",
     "invalid_revoked_empty_sequence.pem",
     "invalid_v1_with_extension.pem",
@@ -86,6 +89,8 @@
     "invalid_garbage_after_revocationdate.pem",
     "invalid_garbage_after_crlentryextensions.pem",
     "invalid_garbage_crlentry.pem",
+    "invalid_idp_dpname_choice_extra_data.pem",
+    "invalid_idp_empty_sequence.pem",
 };
 
 struct PrintTestName {
diff --git a/net/cert/x509_util_android.cc b/net/cert/x509_util_android.cc
index 3ad4bdf..d607d5b 100644
--- a/net/cert/x509_util_android.cc
+++ b/net/cert/x509_util_android.cc
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "jni/X509Util_jni.h"
 #include "net/cert/cert_database.h"
+#include "net/net_jni_headers/X509Util_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/net/data/crl_unittest/bad_idp_contains_wrong_uri.pem b/net/data/crl_unittest/bad_idp_contains_wrong_uri.pem
new file mode 100644
index 0000000..c332e908
--- /dev/null
+++ b/net/data/crl_unittest/bad_idp_contains_wrong_uri.pem
@@ -0,0 +1,224 @@
+Generated by generate_crl_test_data.py. Do not edit.
+
+Leaf not covered by CRL (IDP with different URI)
+
+SEQUENCE {
+  SEQUENCE {
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    UTCTime { "170302001122Z" }
+    UTCTime { "170602001122Z" }
+    [0] {
+      SEQUENCE {
+        SEQUENCE {
+          # issuingDistributionPoint
+          OBJECT_IDENTIFIER { 2.5.29.28 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            SEQUENCE {
+              [0] {
+                [0] {
+                  [6 PRIMITIVE] { "http://example.com/FOO.CRL" }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `0060e4465673e30d5d312b2e3b5cc724cf4a1e927d37f92927d55ac6ae4a76f5fc6ca6e6564dc536d5b2559b238691397d83aa0f2265c70033c5060ede8540e92c5495eda163cf145841357e219c0a0e6db03f0ee2161e9f4759cfc6fc89e08a84fc8a3b2c92c29a01c2ae48ca02687e052bbd37a843e0fea0078331fb2d78c061` }
+}
+-----BEGIN CRL-----
+MIIBGTCBgwIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0IEludGVy
+bWVkaWF0ZSBDQRcNMTcwMzAyMDAxMTIyWhcNMTcwNjAyMDAxMTIyWqAwMC4wLAYD
+VR0cAQH/BCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9GT08uQ1JMMA0GCSqG
+SIb3DQEBCwUAA4GBAGDkRlZz4w1dMSsuO1zHJM9KHpJ9N/kpJ9Vaxq5KdvX8bKbm
+Vk3FNtWyVZsjhpE5fYOqDyJlxwAzxQYO3oVA6SxUle2hY88UWEE1fiGcCg5tsD8O
+4hYen0dZz8b8ieCKhPyKOyySwpoBwq5IygJofgUrvTeoQ+D+oAeDMfsteMBh
+-----END CRL-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00a35afbe7508b58895a28f81ebe71ea37f659fe29d1da13bd5b12460b8cf570dc57966aa97f06382fd01c4fbafc46564de12aa0d1d90d2060ad3f845189dab146559409c673b170edeb83bb56ecd2a7257b2283626d53f62e352c3edbb1a2198ddc73a92deb96b1beffd855f1e1aa005ae2ade2f763cbb0d0bd6cce4b768808c5` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # keyUsage
+          OBJECT_IDENTIFIER { 2.5.29.15 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            BIT_STRING { `0106` }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `0043b0323ab8f10378ccd100d12068c5bad3c32fdaa1b441ed1a4d52baa46aa967237345db8fdf03e0513825fd43c747aa710e371a88ae5ee4f460c59ddb6c5b08505feaa3cce3272e5c3d9b08a878822d5e601517b903537cb90e9085ec954c460f88af5217cb86e7c48be7d0847ec10f36a8df6177599d4a0d2ad4ea0ca857b2` }
+}
+-----BEGIN CA CERTIFICATE-----
+MIIBvTCCASagAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0
+IENBMCIYDzIwMTcwMTAxMDAwMDAwWhgPMjAxODAxMDEwMDAwMDBaMB8xHTAbBgNV
+BAMMFFRlc3QgSW50ZXJtZWRpYXRlIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQCjWvvnUItYiVoo+B6+ceo39ln+KdHaE71bEkYLjPVw3FeWaql/Bjgv0BxP
+uvxGVk3hKqDR2Q0gYK0/hFGJ2rFGVZQJxnOxcO3rg7tW7NKnJXsig2JtU/YuNSw+
+27GiGY3cc6kt65axvv/YVfHhqgBa4q3i92PLsNC9bM5LdogIxQIDAQABoxIwEDAO
+BgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEAQ7AyOrjxA3jM0QDRIGjF
+utPDL9qhtEHtGk1SuqRqqWcjc0Xbj98D4FE4Jf1Dx0eqcQ43GoiuXuT0YMWd22xb
+CFBf6qPM4ycuXD2bCKh4gi1eYBUXuQNTfLkOkIXslUxGD4ivUhfLhufEi+fQhH7B
+Dzao32F3WZ1KDSrU6gyoV7I=
+-----END CA CERTIFICATE-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 5 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Cert" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00abdd04e5f0239dace20256547addf9df3ebb4081eacb549675116355e574620e2a350118cc9a03f754f73f93e1f95555db4f1533d14c50bebe6823c7e4032e2fa65536bdf33ff918c739680a809f4164f4c901c56d2c18785fc205f705b16086339be26d77d60de259dfbac76780ee5f2b416ff84566c5cc52a9d167ab818c67` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # cRLDistributionPoints
+          OBJECT_IDENTIFIER { 2.5.29.31 }
+          OCTET_STRING {
+            SEQUENCE {
+              SEQUENCE {
+                [0] {
+                  [0] {
+                    [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `000e3be5de5d0a6a2a155fa41f786443e6921899ed5566a1ba9fed2cec41dd925d1e077e3b9ce0aeacdf01261d31b828247da6d83d45a2ce469007d4dafda3603463b78bf18eff05e7b97521cbe10e44f185e945fdc09f637b982abbb2f1d380705305c0d63c207f622e6f14ed5509c68ecf907794de3a055137502ba47e37074d` }
+}
+-----BEGIN CERTIFICATE-----
+MIIB3DCCAUWgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0
+IEludGVybWVkaWF0ZSBDQTAiGA8yMDE3MDEwMTAwMDAwMFoYDzIwMTgwMTAxMDAw
+MDAwWjAUMRIwEAYDVQQDDAlUZXN0IENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAKvdBOXwI52s4gJWVHrd+d8+u0CB6stUlnURY1XldGIOKjUBGMyaA/dU
+9z+T4flVVdtPFTPRTFC+vmgjx+QDLi+mVTa98z/5GMc5aAqAn0Fk9MkBxW0sGHhf
+wgX3BbFghjOb4m131g3iWd+6x2eA7l8rQW/4RWbFzFKp0WergYxnAgMBAAGjLzAt
+MCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsMA0G
+CSqGSIb3DQEBCwUAA4GBAA475d5dCmoqFV+kH3hkQ+aSGJntVWahup/tLOxB3ZJd
+Hgd+O5zgrqzfASYdMbgoJH2m2D1Fos5GkAfU2v2jYDRjt4vxjv8F57l1IcvhDkTx
+helF/cCfY3uYKruy8dOAcFMFwNY8IH9iLm8U7VUJxo7PkHeU3joFUTdQK6R+NwdN
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/net/data/crl_unittest/bad_idp_indirectcrl.pem b/net/data/crl_unittest/bad_idp_indirectcrl.pem
new file mode 100644
index 0000000..94181ee
--- /dev/null
+++ b/net/data/crl_unittest/bad_idp_indirectcrl.pem
@@ -0,0 +1,225 @@
+Generated by generate_crl_test_data.py. Do not edit.
+
+CRL IDP name matches, but has indirectCRL flag set
+
+SEQUENCE {
+  SEQUENCE {
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    UTCTime { "170302001122Z" }
+    UTCTime { "170602001122Z" }
+    [0] {
+      SEQUENCE {
+        SEQUENCE {
+          # issuingDistributionPoint
+          OBJECT_IDENTIFIER { 2.5.29.28 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            SEQUENCE {
+              [0] {
+                [0] {
+                  [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                }
+              }
+              [4 PRIMITIVE] { `ff` }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `008575e0844de9900f4ffe043ecf057212ec75c3f5736249ce3f9491c51afecc63b0fd68684419a99b72e6b075054f220ef4574c53bc3502f2751743326633551baf2888bcc3939d9ca4a22660a86be5ef766c872a4640386156905aff45c8bc40b2d2f648275d687c873fa7dfc080b89cd49d528bf1e3166022baee75907aa48a` }
+}
+-----BEGIN CRL-----
+MIIBHDCBhgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0IEludGVy
+bWVkaWF0ZSBDQRcNMTcwMzAyMDAxMTIyWhcNMTcwNjAyMDAxMTIyWqAzMDEwLwYD
+VR0cAQH/BCUwI6AeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JshAH/MA0G
+CSqGSIb3DQEBCwUAA4GBAIV14IRN6ZAPT/4EPs8FchLsdcP1c2JJzj+UkcUa/sxj
+sP1oaEQZqZty5rB1BU8iDvRXTFO8NQLydRdDMmYzVRuvKIi8w5OdnKSiJmCoa+Xv
+dmyHKkZAOGFWkFr/Rci8QLLS9kgnXWh8hz+n38CAuJzUnVKL8eMWYCK67nWQeqSK
+-----END CRL-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00bd60ec89240bf0ea7b3f4a6a3f14406eae57ba2becb1b9479cda724cd41d71cd948871c969589c8199f4196193475abbf12e4a660865801695f5904046286522c9e4c7d09ccd28c8a3afc68b15d6917e04be426e26e5c7b3b734b68fe4b9ceb1f3738ebf285c98d89e65b931f2a2986c0bfb3cac53b2320199e4c75885dbd3ef` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # keyUsage
+          OBJECT_IDENTIFIER { 2.5.29.15 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            BIT_STRING { `0106` }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `00c4ed6f392c591e97505d31c5f2d966754a5ab9279b95d251ddc7391ded5052f130a3ea1b6cbb718acd19ee47e75e0811c8a1f0b2548779f6bcc28e4f110d4e242f4197c4cb7d8d27149ef1ae28af45c2d3fcb83c9c1bc2fb4cd44d9508ec64d54864244e9be13ec1575a6e3951dc233be5859995c6d0ee9be69d098273296065` }
+}
+-----BEGIN CA CERTIFICATE-----
+MIIBvTCCASagAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0
+IENBMCIYDzIwMTcwMTAxMDAwMDAwWhgPMjAxODAxMDEwMDAwMDBaMB8xHTAbBgNV
+BAMMFFRlc3QgSW50ZXJtZWRpYXRlIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQC9YOyJJAvw6ns/Smo/FEBurle6K+yxuUec2nJM1B1xzZSIcclpWJyBmfQZ
+YZNHWrvxLkpmCGWAFpX1kEBGKGUiyeTH0JzNKMijr8aLFdaRfgS+Qm4m5ceztzS2
+j+S5zrHzc46/KFyY2J5luTHyophsC/s8rFOyMgGZ5MdYhdvT7wIDAQABoxIwEDAO
+BgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEAxO1vOSxZHpdQXTHF8tlm
+dUpauSebldJR3cc5He1QUvEwo+obbLtxis0Z7kfnXggRyKHwslSHefa8wo5PEQ1O
+JC9Bl8TLfY0nFJ7xriivRcLT/Lg8nBvC+0zUTZUI7GTVSGQkTpvhPsFXWm45Udwj
+O+WFmZXG0O6b5p0JgnMpYGU=
+-----END CA CERTIFICATE-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 5 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Cert" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00fbff662387c3e71432d3188342014cee96bfd313373db79f4f427c4e6d2b8949b0597f6d3649428dc4eb93f72710f08c9aedf46c38fa6eecb235dad488681e526588be960402e971e14155d065c5ab2213ccb199c195246bfc604173bb4d31e1c7beffe84a3007feb05e5f51c6c1fc942f1fc2e62e6a095271b69665aebd9ae3` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # cRLDistributionPoints
+          OBJECT_IDENTIFIER { 2.5.29.31 }
+          OCTET_STRING {
+            SEQUENCE {
+              SEQUENCE {
+                [0] {
+                  [0] {
+                    [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `005eae7b92f2a53dc2350b6041bb514239a999c326708a6b6337aceb4f0b871f70bdfa7caaf218e8daa4a8e0f6ee968ccdc7a1cf13fc5c319e53c5e067cbe4c0602b5bf1f7201cff6c927e406c8021176722969268cacbf1766ad61d967a329e376ac0a8d33eeef2f185304f22a351d80a1ad0969c64e14a41b2783710bc7560c6` }
+}
+-----BEGIN CERTIFICATE-----
+MIIB3DCCAUWgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0
+IEludGVybWVkaWF0ZSBDQTAiGA8yMDE3MDEwMTAwMDAwMFoYDzIwMTgwMTAxMDAw
+MDAwWjAUMRIwEAYDVQQDDAlUZXN0IENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAPv/ZiOHw+cUMtMYg0IBTO6Wv9MTNz23n09CfE5tK4lJsFl/bTZJQo3E
+65P3JxDwjJrt9Gw4+m7ssjXa1IhoHlJliL6WBALpceFBVdBlxasiE8yxmcGVJGv8
+YEFzu00x4ce+/+hKMAf+sF5fUcbB/JQvH8LmLmoJUnG2lmWuvZrjAgMBAAGjLzAt
+MCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsMA0G
+CSqGSIb3DQEBCwUAA4GBAF6ue5LypT3CNQtgQbtRQjmpmcMmcIprYzes608Lhx9w
+vfp8qvIY6NqkqOD27paMzcehzxP8XDGeU8XgZ8vkwGArW/H3IBz/bJJ+QGyAIRdn
+IpaSaMrL8XZq1h2WejKeN2rAqNM+7vLxhTBPIqNR2Aoa0JacZOFKQbJ4NxC8dWDG
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/net/data/crl_unittest/generate_crl_test_data.py b/net/data/crl_unittest/generate_crl_test_data.py
index 955ee91..254728f 100755
--- a/net/data/crl_unittest/generate_crl_test_data.py
+++ b/net/data/crl_unittest/generate_crl_test_data.py
@@ -351,6 +351,61 @@
        OCTET_STRING { `5678` }
      }
   ''',
+
+  # An issuingDistributionPoint with multiple fullName values, one of which
+  # matches the URI in |LEAF|'s crlDistributionPoints extension.
+  'issuingDistributionPoint': '''
+     SEQUENCE {
+       OBJECT_IDENTIFIER { 2.5.29.28 }
+       BOOLEAN { `ff` }
+       OCTET_STRING {
+         SEQUENCE {
+           [0] {
+             [0] {
+               [1 PRIMITIVE] { "foo@example.com" }
+               [6 PRIMITIVE] { "http://zexample.com/foo.crl" }
+               [6 PRIMITIVE] { "http://example.com/foo.crl" }
+               [6 PRIMITIVE] { "http://aexample.com/foo.crl" }
+             }
+           }
+         }
+       }
+     }
+  ''',
+
+  'issuingDistributionPoint_wrong_uri': '''
+     SEQUENCE {
+       OBJECT_IDENTIFIER { 2.5.29.28 }
+       BOOLEAN { `ff` }
+       OCTET_STRING {
+         SEQUENCE {
+           [0] {
+             [0] {
+               [6 PRIMITIVE] { "http://example.com/FOO.CRL" }
+             }
+           }
+         }
+       }
+     }
+  ''',
+
+  'issuingDistributionPoint_with_indirectCRL': '''
+     SEQUENCE {
+       OBJECT_IDENTIFIER { 2.5.29.28 }
+       BOOLEAN { `ff` }
+       OCTET_STRING {
+         SEQUENCE {
+           [0] {
+             [0] {
+               [6 PRIMITIVE] { "http://example.com/foo.crl" }
+             }
+           }
+           [4 PRIMITIVE] { `ff` }
+         }
+       }
+     }
+  ''',
+
 }
 
 
@@ -494,6 +549,26 @@
 
 
 Store(
+    'good_idp_contains_uri',
+    'Leaf covered by CRLs and not revoked, CRL has IDP with URI matching '
+    'cert DP',
+    LEAF, CA,
+    SignAsciiCRL('''
+  INTEGER { 1 }
+  %(sha256WithRSAEncryption)s
+  %(CA_name)s
+  %(thisUpdate)s
+  %(nextUpdate)s
+  # no revoked certs list
+  [0] {
+    SEQUENCE {
+      %(issuingDistributionPoint)s
+    }
+  }
+''' % crl_strings))
+
+
+Store(
     'good_no_crldp',
     'Leaf covered by CRLs and not revoked, leaf has no crlDistributionPoints',
     LEAF_NO_CRLDP, CA,
@@ -758,6 +833,44 @@
 
 
 Store(
+    'bad_idp_contains_wrong_uri',
+    'Leaf not covered by CRL (IDP with different URI)',
+    LEAF, CA,
+    SignAsciiCRL('''
+  INTEGER { 1 }
+  %(sha256WithRSAEncryption)s
+  %(CA_name)s
+  %(thisUpdate)s
+  %(nextUpdate)s
+  # no revoked certs list
+  [0] {
+    SEQUENCE {
+      %(issuingDistributionPoint_wrong_uri)s
+    }
+  }
+''' % crl_strings))
+
+
+Store(
+    'bad_idp_indirectcrl',
+    'CRL IDP name matches, but has indirectCRL flag set',
+    LEAF, CA,
+    SignAsciiCRL('''
+  INTEGER { 1 }
+  %(sha256WithRSAEncryption)s
+  %(CA_name)s
+  %(thisUpdate)s
+  %(nextUpdate)s
+  # no revoked certs list
+  [0] {
+    SEQUENCE {
+      %(issuingDistributionPoint_with_indirectCRL)s
+    }
+  }
+''' % crl_strings))
+
+
+Store(
     'invalid_mismatched_signature_algorithm',
     'Leaf covered by CRLs and not revoked, but signatureAlgorithm in '
     'CertificateList does not match the one in TBSCertList.',
@@ -1227,3 +1340,67 @@
                  {'LEAF_SERIAL':LEAF['cert'].get_serial_number()}))))
 
 
+Store(
+    'invalid_idp_dpname_choice_extra_data',
+    'IssuingDistributionPoint extension distributionPoint is invalid',
+    LEAF, CA,
+    SignAsciiCRL('''
+  INTEGER { 1 }
+  %(sha256WithRSAEncryption)s
+  %(CA_name)s
+  %(thisUpdate)s
+  %(nextUpdate)s
+  # no revoked certs list
+  [0] {
+    SEQUENCE {
+      SEQUENCE {
+        OBJECT_IDENTIFIER { 2.5.29.28 }
+        BOOLEAN { `ff` }
+        OCTET_STRING {
+          SEQUENCE {
+            [0] {
+              [0] {
+                [6 PRIMITIVE] { "http://example.com/foo.crl" }
+              }
+              [1] {
+                SET {
+                  SEQUENCE {
+                    # countryName
+                    OBJECT_IDENTIFIER { 2.5.4.6 }
+                    PrintableString { "US" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+''' % crl_strings))
+
+
+Store(
+    'invalid_idp_empty_sequence',
+    'IssuingDistributionPoint extension is invalid',
+    LEAF, CA,
+    SignAsciiCRL('''
+  INTEGER { 1 }
+  %(sha256WithRSAEncryption)s
+  %(CA_name)s
+  %(thisUpdate)s
+  %(nextUpdate)s
+  # no revoked certs list
+  [0] {
+    SEQUENCE {
+      SEQUENCE {
+        OBJECT_IDENTIFIER { 2.5.29.28 }
+        BOOLEAN { `ff` }
+        OCTET_STRING {
+          SEQUENCE {
+          }
+        }
+      }
+    }
+  }
+''' % crl_strings))
diff --git a/net/data/crl_unittest/good_idp_contains_uri.pem b/net/data/crl_unittest/good_idp_contains_uri.pem
new file mode 100644
index 0000000..9918143
--- /dev/null
+++ b/net/data/crl_unittest/good_idp_contains_uri.pem
@@ -0,0 +1,229 @@
+Generated by generate_crl_test_data.py. Do not edit.
+
+Leaf covered by CRLs and not revoked, CRL has IDP with URI matching cert DP
+
+SEQUENCE {
+  SEQUENCE {
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    UTCTime { "170302001122Z" }
+    UTCTime { "170602001122Z" }
+    [0] {
+      SEQUENCE {
+        SEQUENCE {
+          # issuingDistributionPoint
+          OBJECT_IDENTIFIER { 2.5.29.28 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            SEQUENCE {
+              [0] {
+                [0] {
+                  [1 PRIMITIVE] { "foo@example.com" }
+                  [6 PRIMITIVE] { "http://zexample.com/foo.crl" }
+                  [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  [6 PRIMITIVE] { "http://aexample.com/foo.crl" }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `006b659179378a15aac130d45749d08a24c91888959d8fb5356343e453d024c6517ad657f7ee509fa368b0ef54e6cc50077e25b67ee6caed57a15abd2dfd9e13564eb8bc39b75d96ca25215f00851293536d6e988c38e86339a9694d75e03e089116c74cb20f1bf1e8091d5dd946cda218af2810abe5854a2e17c77110b2fa263c` }
+}
+-----BEGIN CRL-----
+MIIBZDCBzgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0IEludGVy
+bWVkaWF0ZSBDQRcNMTcwMzAyMDAxMTIyWhcNMTcwNjAyMDAxMTIyWqB7MHkwdwYD
+VR0cAQH/BG0wa6BpoGeBD2Zvb0BleGFtcGxlLmNvbYYbaHR0cDovL3pleGFtcGxl
+LmNvbS9mb28uY3JshhpodHRwOi8vZXhhbXBsZS5jb20vZm9vLmNybIYbaHR0cDov
+L2FleGFtcGxlLmNvbS9mb28uY3JsMA0GCSqGSIb3DQEBCwUAA4GBAGtlkXk3ihWq
+wTDUV0nQiiTJGIiVnY+1NWND5FPQJMZRetZX9+5Qn6NosO9U5sxQB34ltn7myu1X
+oVq9Lf2eE1ZOuLw5t12WyiUhXwCFEpNTbW6YjDjoYzmpaU114D4IkRbHTLIPG/Ho
+CR1d2UbNohivKBCr5YVKLhfHcRCy+iY8
+-----END CRL-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00a35afbe7508b58895a28f81ebe71ea37f659fe29d1da13bd5b12460b8cf570dc57966aa97f06382fd01c4fbafc46564de12aa0d1d90d2060ad3f845189dab146559409c673b170edeb83bb56ecd2a7257b2283626d53f62e352c3edbb1a2198ddc73a92deb96b1beffd855f1e1aa005ae2ade2f763cbb0d0bd6cce4b768808c5` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # keyUsage
+          OBJECT_IDENTIFIER { 2.5.29.15 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            BIT_STRING { `0106` }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `0043b0323ab8f10378ccd100d12068c5bad3c32fdaa1b441ed1a4d52baa46aa967237345db8fdf03e0513825fd43c747aa710e371a88ae5ee4f460c59ddb6c5b08505feaa3cce3272e5c3d9b08a878822d5e601517b903537cb90e9085ec954c460f88af5217cb86e7c48be7d0847ec10f36a8df6177599d4a0d2ad4ea0ca857b2` }
+}
+-----BEGIN CA CERTIFICATE-----
+MIIBvTCCASagAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0
+IENBMCIYDzIwMTcwMTAxMDAwMDAwWhgPMjAxODAxMDEwMDAwMDBaMB8xHTAbBgNV
+BAMMFFRlc3QgSW50ZXJtZWRpYXRlIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQCjWvvnUItYiVoo+B6+ceo39ln+KdHaE71bEkYLjPVw3FeWaql/Bjgv0BxP
+uvxGVk3hKqDR2Q0gYK0/hFGJ2rFGVZQJxnOxcO3rg7tW7NKnJXsig2JtU/YuNSw+
+27GiGY3cc6kt65axvv/YVfHhqgBa4q3i92PLsNC9bM5LdogIxQIDAQABoxIwEDAO
+BgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEAQ7AyOrjxA3jM0QDRIGjF
+utPDL9qhtEHtGk1SuqRqqWcjc0Xbj98D4FE4Jf1Dx0eqcQ43GoiuXuT0YMWd22xb
+CFBf6qPM4ycuXD2bCKh4gi1eYBUXuQNTfLkOkIXslUxGD4ivUhfLhufEi+fQhH7B
+Dzao32F3WZ1KDSrU6gyoV7I=
+-----END CA CERTIFICATE-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 5 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Cert" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00abdd04e5f0239dace20256547addf9df3ebb4081eacb549675116355e574620e2a350118cc9a03f754f73f93e1f95555db4f1533d14c50bebe6823c7e4032e2fa65536bdf33ff918c739680a809f4164f4c901c56d2c18785fc205f705b16086339be26d77d60de259dfbac76780ee5f2b416ff84566c5cc52a9d167ab818c67` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # cRLDistributionPoints
+          OBJECT_IDENTIFIER { 2.5.29.31 }
+          OCTET_STRING {
+            SEQUENCE {
+              SEQUENCE {
+                [0] {
+                  [0] {
+                    [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `000e3be5de5d0a6a2a155fa41f786443e6921899ed5566a1ba9fed2cec41dd925d1e077e3b9ce0aeacdf01261d31b828247da6d83d45a2ce469007d4dafda3603463b78bf18eff05e7b97521cbe10e44f185e945fdc09f637b982abbb2f1d380705305c0d63c207f622e6f14ed5509c68ecf907794de3a055137502ba47e37074d` }
+}
+-----BEGIN CERTIFICATE-----
+MIIB3DCCAUWgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0
+IEludGVybWVkaWF0ZSBDQTAiGA8yMDE3MDEwMTAwMDAwMFoYDzIwMTgwMTAxMDAw
+MDAwWjAUMRIwEAYDVQQDDAlUZXN0IENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAKvdBOXwI52s4gJWVHrd+d8+u0CB6stUlnURY1XldGIOKjUBGMyaA/dU
+9z+T4flVVdtPFTPRTFC+vmgjx+QDLi+mVTa98z/5GMc5aAqAn0Fk9MkBxW0sGHhf
+wgX3BbFghjOb4m131g3iWd+6x2eA7l8rQW/4RWbFzFKp0WergYxnAgMBAAGjLzAt
+MCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsMA0G
+CSqGSIb3DQEBCwUAA4GBAA475d5dCmoqFV+kH3hkQ+aSGJntVWahup/tLOxB3ZJd
+Hgd+O5zgrqzfASYdMbgoJH2m2D1Fos5GkAfU2v2jYDRjt4vxjv8F57l1IcvhDkTx
+helF/cCfY3uYKruy8dOAcFMFwNY8IH9iLm8U7VUJxo7PkHeU3joFUTdQK6R+NwdN
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/net/data/crl_unittest/invalid_idp_dpname_choice_extra_data.pem b/net/data/crl_unittest/invalid_idp_dpname_choice_extra_data.pem
new file mode 100644
index 0000000..d64b2d2
--- /dev/null
+++ b/net/data/crl_unittest/invalid_idp_dpname_choice_extra_data.pem
@@ -0,0 +1,234 @@
+Generated by generate_crl_test_data.py. Do not edit.
+
+IssuingDistributionPoint extension distributionPoint is invalid
+
+SEQUENCE {
+  SEQUENCE {
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    UTCTime { "170302001122Z" }
+    UTCTime { "170602001122Z" }
+    [0] {
+      SEQUENCE {
+        SEQUENCE {
+          # issuingDistributionPoint
+          OBJECT_IDENTIFIER { 2.5.29.28 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            SEQUENCE {
+              [0] {
+                [0] {
+                  [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                }
+                [1] {
+                  SET {
+                    SEQUENCE {
+                      # countryName
+                      OBJECT_IDENTIFIER { 2.5.4.6 }
+                      PrintableString { "US" }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `0006c98c9191f2a57043ef6422f23c2a6f458a5bdcd995b70dc6e5c2525e61c09bab709c79ef892dc5a406bbe4f8409ae1e33e0bb243318f339f5472134c14d0a183ea1dccc520063868534e74a64abfe5302c182fee2cde2f035c1c8bf8f4f75f9fcc7c6a66a172de8c0b3dab3fe6b8d52f7321e0b7f5a89535b602f9f20f6394` }
+}
+-----BEGIN CRL-----
+MIIBKDCBkgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0IEludGVy
+bWVkaWF0ZSBDQRcNMTcwMzAyMDAxMTIyWhcNMTcwNjAyMDAxMTIyWqA/MD0wOwYD
+VR0cAQH/BDEwL6AtoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsoQ0xCzAJ
+BgNVBAYTAlVTMA0GCSqGSIb3DQEBCwUAA4GBAAbJjJGR8qVwQ+9kIvI8Km9Filvc
+2ZW3DcblwlJeYcCbq3Ccee+JLcWkBrvk+ECa4eM+C7JDMY8zn1RyE0wU0KGD6h3M
+xSAGOGhTTnSmSr/lMCwYL+4s3i8DXByL+PT3X5/MfGpmoXLejAs9qz/muNUvcyHg
+t/WolTW2AvnyD2OU
+-----END CRL-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00d8f829b13d9a2659010e0313b15f2d11e54598cfb739bc936522719d585f86b7e81b4ed40007618edb03fea56c65b8bfb68c560984de16c02db43eed00d6d2409661c7976def87811cdce44f3e9498bfb1316f7c1d79158495780660e07c5fc4d302288fe0a9c409a7c708f48f1c1dd8e878bc00f4e7c596edaf3994ac0eb4dd` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # keyUsage
+          OBJECT_IDENTIFIER { 2.5.29.15 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            BIT_STRING { `0106` }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `003f30d040e2a230cd961b63ba65ccf7c61f60f364d0a5c4a5afa72303ebbdd7be2a879e57d9c09ca28495cd8bd62678207214e36c80dfbf8a722f808260c52a9713a27518c9a1075ab786268cf29972e82ad4a750502491de00e3cec21f7fc424830a5382fc2ff6db4c7ddbf3f6cf89985a9de7002a78556c6a778e9ff6cc369d` }
+}
+-----BEGIN CA CERTIFICATE-----
+MIIBvTCCASagAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0
+IENBMCIYDzIwMTcwMTAxMDAwMDAwWhgPMjAxODAxMDEwMDAwMDBaMB8xHTAbBgNV
+BAMMFFRlc3QgSW50ZXJtZWRpYXRlIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQDY+CmxPZomWQEOAxOxXy0R5UWYz7c5vJNlInGdWF+Gt+gbTtQAB2GO2wP+
+pWxluL+2jFYJhN4WwC20Pu0A1tJAlmHHl23vh4Ec3ORPPpSYv7Exb3wdeRWElXgG
+YOB8X8TTAiiP4KnECafHCPSPHB3Y6Hi8APTnxZbtrzmUrA603QIDAQABoxIwEDAO
+BgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEAPzDQQOKiMM2WG2O6Zcz3
+xh9g82TQpcSlr6cjA+u9174qh55X2cCcooSVzYvWJnggchTjbIDfv4pyL4CCYMUq
+lxOidRjJoQdat4YmjPKZcugq1KdQUCSR3gDjzsIff8QkgwpTgvwv9ttMfdvz9s+J
+mFqd5wAqeFVsaneOn/bMNp0=
+-----END CA CERTIFICATE-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 5 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Cert" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00a5c695feb8c268dd012b8f112f5bcd7e0ad91f4e7491bd4903ccfc4d9e88e96d6b43fbfb89ad6e88028e7bcad2aeee3c735fb31639ed92455daee9d8fafd468d2ba9ddcf487880498b64e95a3d47d8358d8cfdaeb8a962fdbf1e8fb4e06deda0a072996f46495b5de9ff39a8b1bdc995afe9b453988cbc33d0d467e49dca1349` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # cRLDistributionPoints
+          OBJECT_IDENTIFIER { 2.5.29.31 }
+          OCTET_STRING {
+            SEQUENCE {
+              SEQUENCE {
+                [0] {
+                  [0] {
+                    [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `00549634347f1e456ae66f4ef3cff73c1176a61305805ed402505471e23b58a9c61ad2f77c2e13da450a60bf54958a69841a4102f296881689d95f10e604b36e6082504c433083591399d020c7f3d173fb261156d8a60a889bac1a755338c7daba530750e249c88ad5657e7832337507ae3c65101aba15f83635d351f07b548de3` }
+}
+-----BEGIN CERTIFICATE-----
+MIIB3DCCAUWgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0
+IEludGVybWVkaWF0ZSBDQTAiGA8yMDE3MDEwMTAwMDAwMFoYDzIwMTgwMTAxMDAw
+MDAwWjAUMRIwEAYDVQQDDAlUZXN0IENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAKXGlf64wmjdASuPES9bzX4K2R9OdJG9SQPM/E2eiOlta0P7+4mtbogC
+jnvK0q7uPHNfsxY57ZJFXa7p2Pr9Ro0rqd3PSHiASYtk6Vo9R9g1jYz9rripYv2/
+Ho+04G3toKBymW9GSVtd6f85qLG9yZWv6bRTmIy8M9DUZ+SdyhNJAgMBAAGjLzAt
+MCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsMA0G
+CSqGSIb3DQEBCwUAA4GBAFSWNDR/HkVq5m9O88/3PBF2phMFgF7UAlBUceI7WKnG
+GtL3fC4T2kUKYL9UlYpphBpBAvKWiBaJ2V8Q5gSzbmCCUExDMINZE5nQIMfz0XP7
+JhFW2KYKiJusGnVTOMfaulMHUOJJyIrVZX54MjN1B648ZRAauhX4NjXTUfB7VI3j
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/net/data/crl_unittest/invalid_idp_empty_sequence.pem b/net/data/crl_unittest/invalid_idp_empty_sequence.pem
new file mode 100644
index 0000000..1d070b9
--- /dev/null
+++ b/net/data/crl_unittest/invalid_idp_empty_sequence.pem
@@ -0,0 +1,218 @@
+Generated by generate_crl_test_data.py. Do not edit.
+
+IssuingDistributionPoint extension is invalid
+
+SEQUENCE {
+  SEQUENCE {
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    UTCTime { "170302001122Z" }
+    UTCTime { "170602001122Z" }
+    [0] {
+      SEQUENCE {
+        SEQUENCE {
+          # issuingDistributionPoint
+          OBJECT_IDENTIFIER { 2.5.29.28 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            SEQUENCE {}
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `007e30782faeb5a9b4aed94ade2d1aafe5b17af96ee9ebe1696b6bb6f92815a3d8643acbfa59bacb4255e635e02cd62c14cdfc13e128ceace0ffc96da315eee2dd35995f322c972c3ee4ff7fc7b463339cfc85eec97cde4b7e1a1e8ce2f336fcab4a548164d84f6b83d652c4e08c5b31468c69fb3478bd2af335ab6e27cdb52583` }
+}
+-----BEGIN CRL-----
+MIH4MGMCAQEwDQYJKoZIhvcNAQELBQAwHzEdMBsGA1UEAwwUVGVzdCBJbnRlcm1l
+ZGlhdGUgQ0EXDTE3MDMwMjAwMTEyMloXDTE3MDYwMjAwMTEyMlqgEDAOMAwGA1Ud
+HAEB/wQCMAAwDQYJKoZIhvcNAQELBQADgYEAfjB4L661qbSu2UreLRqv5bF6+W7p
+6+Fpa2u2+SgVo9hkOsv6WbrLQlXmNeAs1iwUzfwT4SjOrOD/yW2jFe7i3TWZXzIs
+lyw+5P9/x7RjM5z8he7JfN5LfhoejOLzNvyrSlSBZNhPa4PWUsTgjFsxRoxp+zR4
+vSrzNatuJ821JYM=
+-----END CRL-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 1 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00b17ca575a8ed4c57e6290feec7641298cb22569fc6cdaed87186b5fb9fa201c7986b7a758753c7b407606487c3ed223a402c7ee930e22654e9390b4cdae8b8e135ca73e5550c116d29d10ef59ccff23f63e50399a7430ea3b8e040ebe63776450642b895ca20468038980c23ca30e49e93633f6507da641b4db1518f74958d8b` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # keyUsage
+          OBJECT_IDENTIFIER { 2.5.29.15 }
+          BOOLEAN { `ff` }
+          OCTET_STRING {
+            BIT_STRING { `0106` }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `00a329373d689f35e199ce1b0a1eef4f6c36b926344368f00687b37489ab486407ea3cadb4441d4f383d18feebb68fcee74fa2204c645c2369ef0bdce02bc646a1d36a2383625b7b46d23e344ef5e85e015f1176ab7ce112a7604e34767ef9c47b818e6599ec752255b04fb3339dfc56bb7c3c62bd8109deff2fc75d615b64d65d` }
+}
+-----BEGIN CA CERTIFICATE-----
+MIIBvTCCASagAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0
+IENBMCIYDzIwMTcwMTAxMDAwMDAwWhgPMjAxODAxMDEwMDAwMDBaMB8xHTAbBgNV
+BAMMFFRlc3QgSW50ZXJtZWRpYXRlIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQCxfKV1qO1MV+YpD+7HZBKYyyJWn8bNrthxhrX7n6IBx5hrenWHU8e0B2Bk
+h8PtIjpALH7pMOImVOk5C0za6LjhNcpz5VUMEW0p0Q71nM/yP2PlA5mnQw6juOBA
+6+Y3dkUGQriVyiBGgDiYDCPKMOSek2M/ZQfaZBtNsVGPdJWNiwIDAQABoxIwEDAO
+BgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEAoyk3PWifNeGZzhsKHu9P
+bDa5JjRDaPAGh7N0iatIZAfqPK20RB1POD0Y/uu2j87nT6IgTGRcI2nvC9zgK8ZG
+odNqI4NiW3tG0j40TvXoXgFfEXarfOESp2BONHZ++cR7gY5lmex1IlWwT7MznfxW
+u3w8Yr2BCd7/L8ddYVtk1l0=
+-----END CA CERTIFICATE-----
+
+SEQUENCE {
+  SEQUENCE {
+    [0] {
+      INTEGER { 2 }
+    }
+    INTEGER { 5 }
+    SEQUENCE {
+      # sha256WithRSAEncryption
+      OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+      NULL {}
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Intermediate CA" }
+        }
+      }
+    }
+    SEQUENCE {
+      GeneralizedTime { "20170101000000Z" }
+      GeneralizedTime { "20180101000000Z" }
+    }
+    SEQUENCE {
+      SET {
+        SEQUENCE {
+          # commonName
+          OBJECT_IDENTIFIER { 2.5.4.3 }
+          UTF8String { "Test Cert" }
+        }
+      }
+    }
+    SEQUENCE {
+      SEQUENCE {
+        # rsaEncryption
+        OBJECT_IDENTIFIER { 1.2.840.113549.1.1.1 }
+        NULL {}
+      }
+      BIT_STRING {
+        `00`
+        SEQUENCE {
+          INTEGER { `00d1f551f3f9137e84c706271349971ec0fea83a78d7cfcb86f37eacbcdd4cf6f76e8b8f158efacf1c5d8c9a37dc273b8e547c2c86c97ef744b1efc523b5470449b99889b46265668e5a3d61d2f75bb03a528f68abd56cac295abd47ac19532e72ccc8e40e914d276504f2f738d1b32c19dea39a1ca011ec91ded82eef136323ed` }
+          INTEGER { 65537 }
+        }
+      }
+    }
+    [3] {
+      SEQUENCE {
+        SEQUENCE {
+          # cRLDistributionPoints
+          OBJECT_IDENTIFIER { 2.5.29.31 }
+          OCTET_STRING {
+            SEQUENCE {
+              SEQUENCE {
+                [0] {
+                  [0] {
+                    [6 PRIMITIVE] { "http://example.com/foo.crl" }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  SEQUENCE {
+    # sha256WithRSAEncryption
+    OBJECT_IDENTIFIER { 1.2.840.113549.1.1.11 }
+    NULL {}
+  }
+  BIT_STRING { `0030608eee0754a85a3ea4caba97270ed8222c007aa3986916a47a0658ea7df85aac02ceb7b30a80d8decb1090e28e09d1481b61312554466e2b8d640c79e4d266c527b4e875ad372666f2e877f0edca1503273377381c76b383396106689c17a967cc6b290ddc6c146405b15a2ca6bc47f1a6b65fd65810bef9347bb2e04bf2dc` }
+}
+-----BEGIN CERTIFICATE-----
+MIIB3DCCAUWgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRUZXN0
+IEludGVybWVkaWF0ZSBDQTAiGA8yMDE3MDEwMTAwMDAwMFoYDzIwMTgwMTAxMDAw
+MDAwWjAUMRIwEAYDVQQDDAlUZXN0IENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBANH1UfP5E36ExwYnE0mXHsD+qDp418/LhvN+rLzdTPb3bouPFY76zxxd
+jJo33Cc7jlR8LIbJfvdEse/FI7VHBEm5mIm0YmVmjlo9YdL3W7A6Uo9oq9VsrCla
+vUesGVMucszI5A6RTSdlBPL3ONGzLBneo5ocoBHskd7YLu8TYyPtAgMBAAGjLzAt
+MCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9leGFtcGxlLmNvbS9mb28uY3JsMA0G
+CSqGSIb3DQEBCwUAA4GBADBgju4HVKhaPqTKupcnDtgiLAB6o5hpFqR6Bljqffha
+rALOt7MKgNjeyxCQ4o4J0UgbYTElVEZuK41kDHnk0mbFJ7Toda03Jmby6Hfw7coV
+AyczdzgcdrODOWEGaJwXqWfMaykN3GwUZAWxWiymvEfxprZf1lgQvvk0e7LgS/Lc
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/empty_sequence b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/empty_sequence
new file mode 100644
index 0000000..def7fcb
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/empty_sequence
Binary files differ
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_fullName_uri b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_fullName_uri
new file mode 100644
index 0000000..2f742346
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_fullName_uri
@@ -0,0 +1 @@
+0   †http://example.com/foo.crl
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_nameRelativeToCRLIssuer b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_nameRelativeToCRLIssuer
new file mode 100644
index 0000000..a45d0242
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_distributionPoint_nameRelativeToCRLIssuer
Binary files differ
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_dpname_onlyca_reasons_and_indirectcrl b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_dpname_onlyca_reasons_and_indirectcrl
new file mode 100644
index 0000000..d5954c7
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_dpname_onlyca_reasons_and_indirectcrl
@@ -0,0 +1 @@
+0+  †http://example.com/foo.crl‚ÿƒŸ€„ÿ
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_indirectCrl b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_indirectCrl
new file mode 100644
index 0000000..fe8256c
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_indirectCrl
@@ -0,0 +1 @@
+0„ÿ
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsAttributeCerts b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsAttributeCerts
new file mode 100644
index 0000000..4195f6e
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsAttributeCerts
@@ -0,0 +1 @@
+0…ÿ
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsCaCerts b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsCaCerts
new file mode 100644
index 0000000..e38a636
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsCaCerts
@@ -0,0 +1 @@
+0‚ÿ
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsUserCerts b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsUserCerts
new file mode 100644
index 0000000..91d56bd
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlyContainsUserCerts
@@ -0,0 +1 @@
+0ÿ
\ No newline at end of file
diff --git a/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlySomeReasons b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlySomeReasons
new file mode 100644
index 0000000..fdedbe9
--- /dev/null
+++ b/net/data/fuzzer_data/crl_parse_issuing_distribution_point_fuzzer/idp_with_onlySomeReasons
@@ -0,0 +1 @@
+0ƒŸ€
\ No newline at end of file
diff --git a/net/docs/crash-course-in-net-internals.md b/net/docs/crash-course-in-net-internals.md
index 8c1fbbb..1a120fb 100644
--- a/net/docs/crash-course-in-net-internals.md
+++ b/net/docs/crash-course-in-net-internals.md
@@ -19,7 +19,7 @@
 
 The top level network stack object is the URLRequestContext.  The Events view
 has information for all Chrome URLRequestContexts that are hooked up to the
-single, global, ChromeNetLog object.  This includes both incognito and
+single, global, NetLog object.  This includes both incognito and
 non-incognito profiles, among other things.  The Events view only shows events
 for the period that net-internals was open and running, and is incrementally
 updated as events occur.  The code attempts to add a top level event for
diff --git a/net/proxy_resolution/proxy_config_service_android.cc b/net/proxy_resolution/proxy_config_service_android.cc
index 8c04674..81d70ab 100644
--- a/net/proxy_resolution/proxy_config_service_android.cc
+++ b/net/proxy_resolution/proxy_config_service_android.cc
@@ -20,8 +20,8 @@
 #include "base/strings/string_tokenizer.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
-#include "jni/ProxyChangeListener_jni.h"
 #include "net/base/host_port_pair.h"
+#include "net/net_jni_headers/ProxyChangeListener_jni.h"
 #include "net/proxy_resolution/proxy_config_with_annotation.h"
 #include "url/third_party/mozilla/url_parse.h"
 
diff --git a/net/proxy_resolution/proxy_config_service_android_unittest.cc b/net/proxy_resolution/proxy_config_service_android_unittest.cc
index 7052903..6283c44 100644
--- a/net/proxy_resolution/proxy_config_service_android_unittest.cc
+++ b/net/proxy_resolution/proxy_config_service_android_unittest.cc
@@ -13,7 +13,7 @@
 #include "base/compiler_specific.h"
 #include "base/run_loop.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "jni/AndroidProxyConfigServiceTestUtil_jni.h"
+#include "net/net_test_jni_headers/AndroidProxyConfigServiceTestUtil_jni.h"
 #include "net/proxy_resolution/proxy_config_with_annotation.h"
 #include "net/proxy_resolution/proxy_info.h"
 #include "net/test/test_with_scoped_task_environment.h"
diff --git a/net/quic/bidirectional_stream_quic_impl_unittest.cc b/net/quic/bidirectional_stream_quic_impl_unittest.cc
index d2d046b..6dd6dcbb 100644
--- a/net/quic/bidirectional_stream_quic_impl_unittest.cc
+++ b/net/quic/bidirectional_stream_quic_impl_unittest.cc
@@ -43,7 +43,6 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
 #include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
 #include "net/third_party/quiche/src/quic/core/quic_connection.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
@@ -676,31 +675,29 @@
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructClientRstStreamPacket(
       uint64_t packet_number) {
-    return ConstructRstStreamCancelledPacket(packet_number, !kIncludeVersion, 0,
+    return ConstructRstStreamCancelledPacket(packet_number, !kIncludeVersion,
                                              &client_maker_);
   }
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructServerRstStreamPacket(
       uint64_t packet_number) {
-    return ConstructRstStreamCancelledPacket(packet_number, !kIncludeVersion, 0,
+    return ConstructRstStreamCancelledPacket(packet_number, !kIncludeVersion,
                                              &server_maker_);
   }
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructClientEarlyRstStreamPacket(
       uint64_t packet_number) {
-    return ConstructRstStreamCancelledPacket(packet_number, kIncludeVersion, 0,
+    return ConstructRstStreamCancelledPacket(packet_number, kIncludeVersion,
                                              &client_maker_);
   }
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructRstStreamCancelledPacket(
       uint64_t packet_number,
       bool include_version,
-      size_t bytes_written,
       QuicTestPacketMaker* maker) {
-    std::unique_ptr<quic::QuicReceivedPacket> packet(
-        maker->MakeRstPacket(packet_number, include_version, stream_id_,
-                             quic::QUIC_STREAM_CANCELLED, bytes_written,
-                             /*include_stop_sending_if_v99=*/true));
+    std::unique_ptr<quic::QuicReceivedPacket> packet(maker->MakeRstPacket(
+        packet_number, include_version, stream_id_, quic::QUIC_STREAM_CANCELLED,
+        /*include_stop_sending_if_v99=*/true));
     DVLOG(2) << "packet(" << packet_number << "): " << std::endl
              << quic::QuicTextUtils::HexDump(packet->AsStringPiece());
     return packet;
diff --git a/net/quic/quic_chromium_client_session_test.cc b/net/quic/quic_chromium_client_session_test.cc
index 744f462..f87bc19 100644
--- a/net/quic/quic_chromium_client_session_test.cc
+++ b/net/quic/quic_chromium_client_session_test.cc
@@ -51,7 +51,6 @@
 #include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
 #include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
@@ -518,7 +517,7 @@
     quic_data.AddWrite(
         SYNCHRONOUS, client_maker_.MakeRstPacket(
                          3, true, GetNthClientInitiatedBidirectionalStreamId(0),
-                         quic::QUIC_STREAM_CANCELLED, 0,
+                         quic::QUIC_STREAM_CANCELLED,
                          /*include_stop_sending_if_v99=*/false));
     // After the STREAMS_BLOCKED is sent, receive a MAX_STREAMS to increase
     // the limit to 53.
@@ -657,7 +656,7 @@
     quic_data.AddWrite(
         SYNCHRONOUS, client_maker_.MakeRstPacket(
                          3, true, GetNthClientInitiatedBidirectionalStreamId(0),
-                         quic::QUIC_STREAM_CANCELLED, 0,
+                         quic::QUIC_STREAM_CANCELLED,
                          /*include_stop_sending_if_v99=*/false));
   } else {
     quic_data.AddWrite(
diff --git a/net/quic/quic_chromium_client_stream_test.cc b/net/quic/quic_chromium_client_stream_test.cc
index 7dac6426..9081d74 100644
--- a/net/quic/quic_chromium_client_stream_test.cc
+++ b/net/quic/quic_chromium_client_stream_test.cc
@@ -21,7 +21,6 @@
 #include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h"
 #include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index f70c2c1..0641806 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -57,7 +57,6 @@
 #include "net/third_party/quiche/src/quic/core/quic_connection.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/core/quic_write_blocked_list.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
@@ -466,14 +465,13 @@
       RequestPriority request_priority,
       quic::QuicStreamId parent_stream_id,
       size_t* spdy_headers_frame_length,
-      quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written) {
+      quic::QuicRstStreamErrorCode error_code) {
     spdy::SpdyPriority priority =
         ConvertRequestPriorityToQuicPriority(request_priority);
     return client_maker_.MakeRequestHeadersAndRstPacket(
         packet_number, stream_id, should_include_version, fin, priority,
         std::move(request_headers_), parent_stream_id,
-        spdy_headers_frame_length, error_code, bytes_written);
+        spdy_headers_frame_length, error_code);
   }
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructRequestHeadersPacket(
@@ -2373,7 +2371,7 @@
   AddWrite(ConstructRequestAndRstPacket(
       2, GetNthClientInitiatedBidirectionalStreamId(0), kIncludeVersion, !kFin,
       DEFAULT_PRIORITY, 0, &spdy_request_headers_frame_length,
-      quic::QUIC_ERROR_PROCESSING_STREAM, 0));
+      quic::QUIC_ERROR_PROCESSING_STREAM));
 
   Initialize();
 
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index 8afec5b..c589f5f5 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -371,10 +371,8 @@
   std::unique_ptr<quic::QuicEncryptedPacket> ConstructClientRstPacket(
       uint64_t num,
       quic::QuicStreamId stream_id,
-      quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written) {
+      quic::QuicRstStreamErrorCode error_code) {
     return client_maker_.MakeRstPacket(num, false, stream_id, error_code,
-                                       bytes_written,
                                        /*include_stop_sending_if_v99=*/true);
   }
 
@@ -7000,7 +6998,7 @@
   mock_quic_data.AddWrite(SYNCHRONOUS,
                           ConstructClientRstPacket(
                               3, GetNthServerInitiatedUnidirectionalStreamId(0),
-                              quic::QUIC_INVALID_PROMISE_URL, 0));
+                              quic::QUIC_INVALID_PROMISE_URL));
 
   mock_quic_data.AddRead(
       ASYNC, ConstructServerResponseHeadersPacket(
@@ -7092,8 +7090,7 @@
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
       ConstructClientRstPacket(5, GetNthClientInitiatedBidirectionalStreamId(0),
-                               quic::QUIC_STREAM_CANCELLED,
-                               strlen(get_request) + header.length()));
+                               quic::QUIC_STREAM_CANCELLED));
 
   mock_quic_data.AddSocketDataToFactory(&socket_factory_);
 
@@ -7183,8 +7180,7 @@
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
       ConstructClientRstPacket(5, GetNthClientInitiatedBidirectionalStreamId(0),
-                               quic::QUIC_STREAM_CANCELLED,
-                               get_frame.size() + header.length()));
+                               quic::QUIC_STREAM_CANCELLED));
 
   mock_quic_data.AddSocketDataToFactory(&socket_factory_);
 
@@ -7239,7 +7235,6 @@
                  1, GetNthClientInitiatedBidirectionalStreamId(0), false, false,
                  GetResponseHeaders("200 OK")));
 
-  quic::QuicStreamOffset client_data_offset = 0;
   quic::QuicStreamOffset server_data_offset = 0;
   const char get_request_1[] =
       "GET / HTTP/1.1\r\n"
@@ -7260,8 +7255,6 @@
                          false, {header, std::string(get_request_1)}));
   }
 
-  client_data_offset += strlen(get_request_1) + header.length();
-
   const char get_response_1[] =
       "HTTP/1.1 200 OK\r\n"
       "Content-Length: 10\r\n\r\n";
@@ -7293,14 +7286,12 @@
         ConstructClientMultipleDataFramesPacket(
             write_packet_index++, GetNthClientInitiatedBidirectionalStreamId(0),
             false, false, {header4, std::string(get_request_2)}));
-    client_data_offset += header4.length() + strlen(get_request_2);
   } else {
     mock_quic_data.AddWrite(
         SYNCHRONOUS,
         ConstructClientDataPacket(
             write_packet_index++, GetNthClientInitiatedBidirectionalStreamId(0),
             false, false, quic::QuicStringPiece(get_request_2)));
-    client_data_offset += strlen(get_request_2);
   }
 
   const char get_response_2[] =
@@ -7326,9 +7317,9 @@
 
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
-      ConstructClientRstPacket(
-          write_packet_index++, GetNthClientInitiatedBidirectionalStreamId(0),
-          quic::QUIC_STREAM_CANCELLED, client_data_offset));
+      ConstructClientRstPacket(write_packet_index++,
+                               GetNthClientInitiatedBidirectionalStreamId(0),
+                               quic::QUIC_STREAM_CANCELLED));
 
   mock_quic_data.AddSocketDataToFactory(&socket_factory_);
 
@@ -7482,13 +7473,11 @@
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
       ConstructClientRstPacket(8, GetNthClientInitiatedBidirectionalStreamId(0),
-                               quic::QUIC_STREAM_CANCELLED,
-                               strlen(get_request) + header.length()));
+                               quic::QUIC_STREAM_CANCELLED));
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
       ConstructClientRstPacket(9, GetNthClientInitiatedBidirectionalStreamId(1),
-                               quic::QUIC_STREAM_CANCELLED,
-                               get_frame.size() + header4.length()));
+                               quic::QUIC_STREAM_CANCELLED));
 
   mock_quic_data.AddSocketDataToFactory(&socket_factory_);
 
@@ -7689,8 +7678,7 @@
   mock_quic_data.AddWrite(
       SYNCHRONOUS,
       ConstructClientRstPacket(7, GetNthClientInitiatedBidirectionalStreamId(1),
-                               quic::QUIC_STREAM_CANCELLED,
-                               strlen(get_request) + header.length()));
+                               quic::QUIC_STREAM_CANCELLED));
 
   mock_quic_data.AddSocketDataToFactory(&socket_factory_);
 
@@ -7908,7 +7896,6 @@
             "QUIC proxy.example.org:70", TRAFFIC_ANNOTATION_FOR_TESTS);
 
     MockQuicData mock_quic_data(version_);
-    quic::QuicStreamOffset client_data_offset = 0;
     quic::QuicStreamOffset server_data_offset = 0;
 
     mock_quic_data.AddWrite(SYNCHRONOUS,
@@ -7952,7 +7939,7 @@
         SYNCHRONOUS,
         client_maker->MakeRstPacket(
             4, false, GetNthClientInitiatedBidirectionalStreamId(0),
-            quic::QUIC_STREAM_CANCELLED, client_data_offset,
+            quic::QUIC_STREAM_CANCELLED,
             /*include_stop_sending_if_v99=*/true));
 
     headers = client_maker->ConnectRequestHeaders("mail.example.org:443");
diff --git a/net/quic/quic_proxy_client_socket_unittest.cc b/net/quic/quic_proxy_client_socket_unittest.cc
index 6e5dcf1..cd44890 100644
--- a/net/quic/quic_proxy_client_socket_unittest.cc
+++ b/net/quic/quic_proxy_client_socket_unittest.cc
@@ -42,7 +42,6 @@
 #include "net/test/test_with_scoped_task_environment.h"
 #include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
@@ -280,7 +279,7 @@
     return client_maker_.MakeInitialSettingsPacket(packet_number);
   }
 
-  std::unique_ptr<quic::QuicReceivedPacket> ConstructAckAndRstPacket(
+  std::unique_ptr<quic::QuicReceivedPacket> ConstructAckAndRstOnlyPacket(
       uint64_t packet_number,
       quic::QuicRstStreamErrorCode error_code,
       uint64_t largest_received,
@@ -288,20 +287,7 @@
       uint64_t least_unacked) {
     return client_maker_.MakeAckAndRstPacket(
         packet_number, !kIncludeVersion, client_data_stream_id1_, error_code,
-        largest_received, smallest_received, least_unacked, kSendFeedback);
-  }
-
-  std::unique_ptr<quic::QuicReceivedPacket> ConstructAckAndRstOnlyPacket(
-      uint64_t packet_number,
-      quic::QuicRstStreamErrorCode error_code,
-      uint64_t largest_received,
-      uint64_t smallest_received,
-      uint64_t least_unacked,
-      size_t bytes_written) {
-    return client_maker_.MakeAckAndRstPacket(
-        packet_number, !kIncludeVersion, client_data_stream_id1_, error_code,
         largest_received, smallest_received, least_unacked, kSendFeedback,
-        bytes_written,
         /*include_stop_sending=*/false);
   }
 
@@ -310,22 +296,18 @@
       quic::QuicRstStreamErrorCode error_code,
       uint64_t largest_received,
       uint64_t smallest_received,
-      uint64_t least_unacked,
-      size_t bytes_written) {
+      uint64_t least_unacked) {
     return client_maker_.MakeAckAndRstPacket(
         packet_number, !kIncludeVersion, client_data_stream_id1_, error_code,
         largest_received, smallest_received, least_unacked, kSendFeedback,
-        bytes_written,
         /*include_stop_sending_if_v99=*/true);
   }
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructRstPacket(
       uint64_t packet_number,
-      quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written) {
+      quic::QuicRstStreamErrorCode error_code) {
     return client_maker_.MakeRstPacket(packet_number, !kIncludeVersion,
                                        client_data_stream_id1_, error_code,
-                                       bytes_written,
                                        /*include_stop_sending_if_v99=*/true);
   }
 
@@ -403,11 +385,9 @@
 
   std::unique_ptr<quic::QuicReceivedPacket> ConstructServerRstPacket(
       uint64_t packet_number,
-      quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written) {
+      quic::QuicRstStreamErrorCode error_code) {
     return server_maker_.MakeRstPacket(packet_number, !kIncludeVersion,
                                        client_data_stream_id1_, error_code,
-                                       bytes_written,
                                        /*include_stop_sending_if_v99=*/true);
   }
 
@@ -758,8 +738,8 @@
       ASYNC, ConstructServerDataPacket(2, header + std::string(kMsg1, kLen1)));
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -791,8 +771,8 @@
       ConstructServerDataPacket(2, header + std::string(kMsg333, kLen333)));
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -853,9 +833,7 @@
                              ConstructMultipleDataFramesPacket(
                                  4, {header2, std::string(kMsg2, kLen2)}));
     mock_quic_data_.AddWrite(
-        SYNCHRONOUS,
-        ConstructRstPacket(5, quic::QUIC_STREAM_CANCELLED,
-                           kLen1 + kLen2 + header.length() + header2.length()));
+        SYNCHRONOUS, ConstructRstPacket(5, quic::QUIC_STREAM_CANCELLED));
   } else {
     mock_quic_data_.AddWrite(
         SYNCHRONOUS,
@@ -863,8 +841,7 @@
     mock_quic_data_.AddWrite(SYNCHRONOUS,
                              ConstructDataPacket(4, std::string(kMsg2, kLen2)));
     mock_quic_data_.AddWrite(
-        SYNCHRONOUS,
-        ConstructRstPacket(5, quic::QUIC_STREAM_CANCELLED, kLen1 + kLen2));
+        SYNCHRONOUS, ConstructRstPacket(5, quic::QUIC_STREAM_CANCELLED));
   }
 
   Initialize();
@@ -938,8 +915,8 @@
   }
 
   mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(write_packet_index++,
-                                      quic::QUIC_STREAM_CANCELLED, offset));
+      SYNCHRONOUS,
+      ConstructRstPacket(write_packet_index++, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -968,8 +945,8 @@
       ASYNC, ConstructServerDataPacket(2, header + std::string(kMsg1, kLen1)));
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -1164,8 +1141,8 @@
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
 
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -1278,9 +1255,9 @@
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
 
   mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructAckAndRstPacket(write_packet_index++,
-                                            quic::QUIC_STREAM_CANCELLED, 3, 3,
-                                            1, kLen2 + header2.length()));
+      SYNCHRONOUS,
+      ConstructAckAndRstPacket(write_packet_index++,
+                               quic::QUIC_STREAM_CANCELLED, 3, 3, 1));
 
   Initialize();
 
@@ -1337,9 +1314,8 @@
                                          header3 + std::string(kMsg2, kLen2)));
   }
 
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(6, quic::QUIC_STREAM_CANCELLED,
-                                      kLen2 + kLen2 + 2 * header3.length()));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(6, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -1442,8 +1418,8 @@
                                      2, header + std::string(kMsg1, kLen1)));
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -1600,22 +1576,22 @@
   mock_quic_data_.AddRead(ASYNC, ERR_IO_PENDING);  // Pause
 
   mock_quic_data_.AddRead(
-      ASYNC, ConstructServerRstPacket(2, quic::QUIC_STREAM_CANCELLED, 0));
+      ASYNC, ConstructServerRstPacket(2, quic::QUIC_STREAM_CANCELLED));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
   std::string header = ConstructDataHeader(kLen2);
   if (version_.transport_version != quic::QUIC_VERSION_99) {
     mock_quic_data_.AddWrite(ASYNC, ConstructAckAndDataPacket(
                                         3, 1, 1, 1, std::string(kMsg2, kLen2)));
     mock_quic_data_.AddWrite(
-        SYNCHRONOUS, ConstructAckAndRstPacket(4, quic::QUIC_RST_ACKNOWLEDGEMENT,
-                                              2, 2, 1, kLen2));
+        SYNCHRONOUS,
+        ConstructAckAndRstPacket(4, quic::QUIC_RST_ACKNOWLEDGEMENT, 2, 2, 1));
   } else {
     mock_quic_data_.AddWrite(
         ASYNC, ConstructAckAndMultipleDataFramesPacket(
                    3, 1, 1, 1, {header, std::string(kMsg2, kLen2)}));
-    mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckAndRstOnlyPacket(
-                                              4, quic::QUIC_STREAM_CANCELLED, 2,
-                                              2, 1, header.length() + kLen2));
+    mock_quic_data_.AddWrite(
+        SYNCHRONOUS,
+        ConstructAckAndRstOnlyPacket(4, quic::QUIC_STREAM_CANCELLED, 2, 2, 1));
   }
 
   Initialize();
@@ -1654,8 +1630,8 @@
       ASYNC, ConstructServerDataPacket(2, header + std::string(kMsg1, kLen1)));
   mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1, 1));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  mock_quic_data_.AddWrite(
-      SYNCHRONOUS, ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED, 0));
+  mock_quic_data_.AddWrite(SYNCHRONOUS,
+                           ConstructRstPacket(4, quic::QUIC_STREAM_CANCELLED));
 
   Initialize();
 
@@ -1732,22 +1708,22 @@
   mock_quic_data_.AddRead(ASYNC, ERR_IO_PENDING);  // Pause
 
   mock_quic_data_.AddRead(
-      ASYNC, ConstructServerRstPacket(2, quic::QUIC_STREAM_CANCELLED, 0));
+      ASYNC, ConstructServerRstPacket(2, quic::QUIC_STREAM_CANCELLED));
   mock_quic_data_.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
   if (version_.transport_version != quic::QUIC_VERSION_99) {
     mock_quic_data_.AddWrite(ASYNC, ConstructAckAndDataPacket(
                                         3, 1, 1, 1, std::string(kMsg1, kLen1)));
     mock_quic_data_.AddWrite(
-        SYNCHRONOUS, ConstructAckAndRstPacket(4, quic::QUIC_RST_ACKNOWLEDGEMENT,
-                                              2, 2, 1, kLen1));
+        SYNCHRONOUS,
+        ConstructAckAndRstPacket(4, quic::QUIC_RST_ACKNOWLEDGEMENT, 2, 2, 1));
   } else {
     std::string header = ConstructDataHeader(kLen1);
     mock_quic_data_.AddWrite(
         ASYNC, ConstructAckAndMultipleDataFramesPacket(
                    3, 1, 1, 1, {header, std::string(kMsg1, kLen1)}));
-    mock_quic_data_.AddWrite(SYNCHRONOUS, ConstructAckAndRstOnlyPacket(
-                                              4, quic::QUIC_STREAM_CANCELLED, 2,
-                                              2, 1, header.length() + kLen1));
+    mock_quic_data_.AddWrite(
+        SYNCHRONOUS,
+        ConstructAckAndRstOnlyPacket(4, quic::QUIC_STREAM_CANCELLED, 2, 2, 1));
   }
 
   Initialize();
diff --git a/net/quic/quic_server_info.h b/net/quic/quic_server_info.h
index 7682438..e3ae672 100644
--- a/net/quic/quic_server_info.h
+++ b/net/quic/quic_server_info.h
@@ -60,7 +60,7 @@
 
     void Clear();
 
-    // This class matches QuicClientCryptoConfig::CachedState.
+    // This class matches QuicCryptoClientConfig::CachedState.
     std::string server_config;         // A serialized handshake message.
     std::string source_address_token;  // An opaque proof of IP ownership.
     std::string cert_sct;              // Signed timestamp of the leaf cert.
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 40fedcd..a4299fc 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -57,7 +57,6 @@
 #include "net/third_party/quiche/src/quic/core/http/quic_client_promised_info.h"
 #include "net/third_party/quiche/src/quic/core/quic_connection.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_clock.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
 #include "third_party/boringssl/src/include/openssl/aead.h"
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index f3a01d23d..5282eec 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -4763,7 +4763,7 @@
   socket_data1.AddWrite(
       SYNCHRONOUS, client_maker_.MakeRstPacket(
                        5, false, GetNthClientInitiatedBidirectionalStreamId(1),
-                       quic::QUIC_STREAM_CANCELLED, 0,
+                       quic::QUIC_STREAM_CANCELLED,
                        /*include_stop_sending_if_v99=*/true));
 
   socket_data1.AddSocketDataToFactory(socket_factory_.get());
@@ -4975,7 +4975,7 @@
   quic_data3.AddWrite(
       SYNCHRONOUS, client_maker_.MakeRstPacket(
                        5, false, GetNthClientInitiatedBidirectionalStreamId(0),
-                       quic::QUIC_STREAM_CANCELLED, 0,
+                       quic::QUIC_STREAM_CANCELLED,
                        /*include_stop_sending_if_v99=*/true));
   quic_data3.AddSocketDataToFactory(socket_factory_.get());
 
@@ -5710,7 +5710,7 @@
   socket_data1.AddWrite(
       SYNCHRONOUS, client_maker_.MakeRstPacket(
                        4, false, GetNthClientInitiatedBidirectionalStreamId(1),
-                       quic::QUIC_STREAM_CANCELLED, 0,
+                       quic::QUIC_STREAM_CANCELLED,
                        /*include_stop_sending_if_v99=*/true));
 
   socket_data1.AddSocketDataToFactory(socket_factory_.get());
@@ -5836,7 +5836,7 @@
       SYNCHRONOUS,
       client_maker_.MakeRstPacket(packet_number++, true,
                                   GetNthClientInitiatedBidirectionalStreamId(1),
-                                  quic::QUIC_STREAM_CANCELLED, 0,
+                                  quic::QUIC_STREAM_CANCELLED,
                                   /*include_stop_sending_if_v99=*/true));
   socket_data1.AddRead(
       ASYNC,
@@ -5976,7 +5976,7 @@
       SYNCHRONOUS,
       client_maker_.MakeRstPacket(packet_number++, true,
                                   GetNthClientInitiatedBidirectionalStreamId(1),
-                                  quic::QUIC_STREAM_CANCELLED, 0,
+                                  quic::QUIC_STREAM_CANCELLED,
                                   /*include_stop_sending_if_v99=*/true));
   socket_data1.AddWrite(
       SYNCHRONOUS,
diff --git a/net/quic/quic_test_packet_maker.cc b/net/quic/quic_test_packet_maker.cc
index 59ebc90a..395a6416eb 100644
--- a/net/quic/quic_test_packet_maker.cc
+++ b/net/quic/quic_test_packet_maker.cc
@@ -175,7 +175,7 @@
     bool include_version,
     quic::QuicStreamId stream_id,
     quic::QuicRstStreamErrorCode error_code) {
-  return MakeRstPacket(num, include_version, stream_id, error_code, 0,
+  return MakeRstPacket(num, include_version, stream_id, error_code,
                        /*include_stop_sending_if_v99=*/true);
 }
 
@@ -184,13 +184,13 @@
     bool include_version,
     quic::QuicStreamId stream_id,
     quic::QuicRstStreamErrorCode error_code,
-    size_t bytes_written,
     bool include_stop_sending_if_v99) {
   InitializeHeader(num, include_version);
 
   quic::QuicFrames frames;
 
-  quic::QuicRstStreamFrame rst(1, stream_id, error_code, bytes_written);
+  quic::QuicRstStreamFrame rst(1, stream_id, error_code,
+                               stream_offsets_[stream_id]);
   frames.push_back(quic::QuicFrame(&rst));
   DVLOG(1) << "Adding frame: " << frames.back();
 
@@ -283,7 +283,7 @@
     bool send_feedback) {
   return MakeAckAndRstPacket(num, include_version, stream_id, error_code,
                              largest_received, smallest_received, least_unacked,
-                             send_feedback, 0,
+                             send_feedback,
                              /*include_stop_sending_if_v99=*/true);
 }
 
@@ -297,7 +297,6 @@
     uint64_t smallest_received,
     uint64_t least_unacked,
     bool send_feedback,
-    size_t bytes_written,
     bool include_stop_sending_if_v99) {
   InitializeHeader(num, include_version);
 
@@ -315,7 +314,8 @@
   frames.push_back(quic::QuicFrame(&ack));
   DVLOG(1) << "Adding frame: " << frames.back();
 
-  quic::QuicRstStreamFrame rst(1, stream_id, error_code, bytes_written);
+  quic::QuicRstStreamFrame rst(1, stream_id, error_code,
+                               stream_offsets_[stream_id]);
   frames.push_back(quic::QuicFrame(&rst));
   DVLOG(1) << "Adding frame: " << frames.back();
 
@@ -742,8 +742,7 @@
     spdy::SpdyHeaderBlock headers,
     quic::QuicStreamId parent_stream_id,
     size_t* spdy_headers_frame_length,
-    quic::QuicRstStreamErrorCode error_code,
-    size_t bytes_written) {
+    quic::QuicRstStreamErrorCode error_code) {
   spdy::SpdySerializedFrame spdy_frame = MakeSpdyHeadersFrame(
       stream_id, fin, priority, std::move(headers), parent_stream_id);
   if (spdy_headers_frame_length) {
@@ -753,7 +752,8 @@
       quic::QuicUtils::GetHeadersStreamId(version_.transport_version), false,
       quic::QuicStringPiece(spdy_frame.data(), spdy_frame.size()));
 
-  quic::QuicRstStreamFrame rst_frame(1, stream_id, error_code, bytes_written);
+  quic::QuicRstStreamFrame rst_frame(1, stream_id, error_code,
+                                     stream_offsets_[stream_id]);
 
   quic::QuicFrames frames;
   frames.push_back(quic::QuicFrame(headers_frame));
diff --git a/net/quic/quic_test_packet_maker.h b/net/quic/quic_test_packet_maker.h
index 87d9bd6..65c8a57a 100644
--- a/net/quic/quic_test_packet_maker.h
+++ b/net/quic/quic_test_packet_maker.h
@@ -89,7 +89,6 @@
       bool include_version,
       quic::QuicStreamId stream_id,
       quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written,
       bool include_stop_sending_if_v99);
 
   std::unique_ptr<quic::QuicReceivedPacket> MakeRstAndRequestHeadersPacket(
@@ -122,7 +121,6 @@
       uint64_t smallest_received,
       uint64_t least_unacked,
       bool send_feedback,
-      size_t bytes_written,
       bool include_stop_sending_if_v99);
   std::unique_ptr<quic::QuicReceivedPacket> MakeRstAckAndConnectionClosePacket(
       uint64_t num,
@@ -269,8 +267,7 @@
       spdy::SpdyHeaderBlock headers,
       quic::QuicStreamId parent_stream_id,
       size_t* spdy_headers_frame_length,
-      quic::QuicRstStreamErrorCode error_code,
-      size_t bytes_written);
+      quic::QuicRstStreamErrorCode error_code);
 
   // If |spdy_headers_frame_length| is non-null, it will be set to the size of
   // the SPDY headers frame created for this packet.
diff --git a/net/ssl/ssl_platform_key_android_unittest.cc b/net/ssl/ssl_platform_key_android_unittest.cc
index bdad44d..a09ebc23 100644
--- a/net/ssl/ssl_platform_key_android_unittest.cc
+++ b/net/ssl/ssl_platform_key_android_unittest.cc
@@ -13,10 +13,10 @@
 #include "base/files/file_util.h"
 #include "net/android/keystore.h"
 #include "net/cert/x509_certificate.h"
+#include "net/net_test_jni_headers/AndroidKeyStoreTestUtil_jni.h"
 #include "net/ssl/ssl_private_key.h"
 #include "net/ssl/ssl_private_key_test_util.h"
 #include "net/test/cert_test_util.h"
-#include "net/test/jni/AndroidKeyStoreTestUtil_jni.h"
 #include "net/test/test_data_directory.h"
 #include "net/test/test_with_scoped_task_environment.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/test/embedded_test_server/android/embedded_test_server_android.cc b/net/test/embedded_test_server/android/embedded_test_server_android.cc
index bf505d7..99571e1 100644
--- a/net/test/embedded_test_server/android/embedded_test_server_android.cc
+++ b/net/test/embedded_test_server/android/embedded_test_server_android.cc
@@ -11,7 +11,7 @@
 #include "base/files/file_path.h"
 #include "base/test/test_support_android.h"
 #include "base/trace_event/trace_event.h"
-#include "net/test/jni/EmbeddedTestServerImpl_jni.h"
+#include "net/net_test_jni_headers/EmbeddedTestServerImpl_jni.h"
 
 using base::android::JavaParamRef;
 using base::android::JavaRef;
diff --git a/net/tools/quic/quic_simple_server.cc b/net/tools/quic/quic_simple_server.cc
index 35748907d..2349d45 100644
--- a/net/tools/quic/quic_simple_server.cc
+++ b/net/tools/quic/quic_simple_server.cc
@@ -20,7 +20,6 @@
 #include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
 #include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
-#include "net/third_party/quiche/src/quic/core/tls_server_handshaker.h"
 #include "net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h"
 #include "net/tools/quic/quic_simple_server_packet_writer.h"
 #include "net/tools/quic/quic_simple_server_session_helper.h"
diff --git a/net/tools/quic/quic_simple_server_test.cc b/net/tools/quic/quic_simple_server_test.cc
index 83f0f2cc..a341077 100644
--- a/net/tools/quic/quic_simple_server_test.cc
+++ b/net/tools/quic/quic_simple_server_test.cc
@@ -9,7 +9,6 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
 #include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/core/tls_server_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_quic_dispatcher.h"
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc
index 928db3b..498e04e4 100644
--- a/net/url_request/url_request_http_job_unittest.cc
+++ b/net/url_request/url_request_http_job_unittest.cc
@@ -50,7 +50,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
-#include "jni/AndroidNetworkLibraryTestUtil_jni.h"
+#include "net/net_test_jni_headers/AndroidNetworkLibraryTestUtil_jni.h"
 #endif
 
 using net::test::IsError;
diff --git a/printing/BUILD.gn b/printing/BUILD.gn
index 2fd86c2..48a5884 100644
--- a/printing/BUILD.gn
+++ b/printing/BUILD.gn
@@ -362,7 +362,6 @@
     sources = [
       "android/java/src/org/chromium/printing/PrintingContext.java",
     ]
-    jni_package = "printing"
   }
 
   android_library("printing_java") {
diff --git a/printing/DEPS b/printing/DEPS
index fb7ac6ec..41732d72 100644
--- a/printing/DEPS
+++ b/printing/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "+cc/paint",
-  "+jni",
+  "+printing/printing_jni_headers",
   "+skia/ext",
   "+third_party/icu/source/common/unicode",
   "+third_party/icu/source/i18n/unicode",
diff --git a/printing/printing_context_android.cc b/printing/printing_context_android.cc
index ec40ab6..05f9ed6 100644
--- a/printing/printing_context_android.cc
+++ b/printing/printing_context_android.cc
@@ -16,9 +16,9 @@
 #include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
-#include "jni/PrintingContext_jni.h"
 #include "printing/metafile.h"
 #include "printing/print_job_constants.h"
+#include "printing/printing_jni_headers/PrintingContext_jni.h"
 #include "printing/units.h"
 #include "third_party/icu/source/i18n/unicode/ulocdata.h"
 #include "ui/android/window_android.h"
diff --git a/remoting/android/BUILD.gn b/remoting/android/BUILD.gn
index 0aaa68d..c375405d 100644
--- a/remoting/android/BUILD.gn
+++ b/remoting/android/BUILD.gn
@@ -19,7 +19,6 @@
     "java/src/org/chromium/chromoting/jni/JniOAuthTokenGetter.java",
     "java/src/org/chromium/chromoting/jni/TouchEventData.java",
   ]
-  jni_package = "remoting"
 }
 
 _raw_resources_base_dir = "$target_gen_dir/credits_resources_raw/res"
diff --git a/remoting/client/jni/DEPS b/remoting/client/jni/DEPS
index 85fd7732..a93722ea 100644
--- a/remoting/client/jni/DEPS
+++ b/remoting/client/jni/DEPS
@@ -1,4 +1,4 @@
 include_rules = [
-  "+jni",
+  "+remoting/android/jni_headers",
   "+ui/gfx/android",
 ]
diff --git a/remoting/client/jni/jni_client.cc b/remoting/client/jni/jni_client.cc
index 87ed4299..62d7608 100644
--- a/remoting/client/jni/jni_client.cc
+++ b/remoting/client/jni/jni_client.cc
@@ -7,7 +7,7 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/logging.h"
-#include "jni/Client_jni.h"
+#include "remoting/android/jni_headers/Client_jni.h"
 #include "remoting/client/audio/audio_player_android.h"
 #include "remoting/client/chromoting_client_runtime.h"
 #include "remoting/client/chromoting_session.h"
diff --git a/remoting/client/jni/jni_directory_service.cc b/remoting/client/jni/jni_directory_service.cc
index e4d72bc8..cad0a43 100644
--- a/remoting/client/jni/jni_directory_service.cc
+++ b/remoting/client/jni/jni_directory_service.cc
@@ -14,7 +14,7 @@
 #include "base/bind.h"
 #include "base/macros.h"
 #include "base/threading/sequenced_task_runner_handle.h"
-#include "jni/DirectoryService_jni.h"
+#include "remoting/android/jni_headers/DirectoryService_jni.h"
 #include "remoting/base/grpc_support/grpc_async_unary_request.h"
 #include "remoting/base/grpc_support/grpc_authenticated_executor.h"
 #include "remoting/base/grpc_support/grpc_channel.h"
diff --git a/remoting/client/jni/jni_gl_display_handler.cc b/remoting/client/jni/jni_gl_display_handler.cc
index d971d127..124b71f 100644
--- a/remoting/client/jni/jni_gl_display_handler.cc
+++ b/remoting/client/jni/jni_gl_display_handler.cc
@@ -11,7 +11,7 @@
 #include "base/android/jni_android.h"
 #include "base/bind.h"
 #include "base/logging.h"
-#include "jni/GlDisplay_jni.h"
+#include "remoting/android/jni_headers/GlDisplay_jni.h"
 #include "remoting/client/chromoting_client_runtime.h"
 #include "remoting/client/cursor_shape_stub_proxy.h"
 #include "remoting/client/display/gl_canvas.h"
diff --git a/remoting/client/jni/jni_oauth_token_getter.cc b/remoting/client/jni/jni_oauth_token_getter.cc
index ea6a1e8..0411472d 100644
--- a/remoting/client/jni/jni_oauth_token_getter.cc
+++ b/remoting/client/jni/jni_oauth_token_getter.cc
@@ -7,7 +7,7 @@
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
 #include "base/android/scoped_java_ref.h"
-#include "jni/JniOAuthTokenGetter_jni.h"
+#include "remoting/android/jni_headers/JniOAuthTokenGetter_jni.h"
 
 using base::android::ConvertJavaStringToUTF8;
 using base::android::JavaParamRef;
diff --git a/remoting/client/jni/jni_runtime_delegate.cc b/remoting/client/jni/jni_runtime_delegate.cc
index ddc8282..1f1797ec 100644
--- a/remoting/client/jni/jni_runtime_delegate.cc
+++ b/remoting/client/jni/jni_runtime_delegate.cc
@@ -16,7 +16,7 @@
 #include "base/stl_util.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/task/thread_pool/thread_pool.h"
-#include "jni/JniInterface_jni.h"
+#include "remoting/android/jni_headers/JniInterface_jni.h"
 #include "remoting/base/chromium_url_request.h"
 #include "remoting/base/oauth_token_getter_proxy.h"
 #include "remoting/base/url_request_context_getter.h"
diff --git a/remoting/client/jni/jni_touch_event_data.cc b/remoting/client/jni/jni_touch_event_data.cc
index 842ea1f..52eaecf 100644
--- a/remoting/client/jni/jni_touch_event_data.cc
+++ b/remoting/client/jni/jni_touch_event_data.cc
@@ -4,7 +4,7 @@
 
 #include "remoting/client/jni/jni_touch_event_data.h"
 
-#include "jni/TouchEventData_jni.h"
+#include "remoting/android/jni_headers/TouchEventData_jni.h"
 #include "remoting/proto/event.pb.h"
 
 namespace remoting {
diff --git a/services/data_decoder/DEPS b/services/data_decoder/DEPS
index 91ccb2b..ebd5ee2 100644
--- a/services/data_decoder/DEPS
+++ b/services/data_decoder/DEPS
@@ -1,7 +1,7 @@
 include_rules = [
   "+device/bluetooth/public",
   "+gin",
-  "+jni",
+  "+services/data_decoder/public/cpp/android/safe_json_jni_headers",
   "+skia",
   "+third_party/libxml/chromium",
   "+third_party/blink/public",
diff --git a/services/data_decoder/public/cpp/android/BUILD.gn b/services/data_decoder/public/cpp/android/BUILD.gn
index 4a07518..3474ecf2 100644
--- a/services/data_decoder/public/cpp/android/BUILD.gn
+++ b/services/data_decoder/public/cpp/android/BUILD.gn
@@ -9,7 +9,6 @@
 
 generate_jni("safe_json_jni_headers") {
   sources = _jni_sources
-  jni_package = "data_decoder"
 }
 
 if (current_toolchain == default_toolchain) {
diff --git a/services/data_decoder/public/cpp/json_sanitizer_android.cc b/services/data_decoder/public/cpp/json_sanitizer_android.cc
index e871839..b9a8f89 100644
--- a/services/data_decoder/public/cpp/json_sanitizer_android.cc
+++ b/services/data_decoder/public/cpp/json_sanitizer_android.cc
@@ -12,7 +12,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/strings/string_util.h"
 #include "base/threading/sequenced_task_runner_handle.h"
-#include "jni/JsonSanitizer_jni.h"
+#include "services/data_decoder/public/cpp/android/safe_json_jni_headers/JsonSanitizer_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/services/device/BUILD.gn b/services/device/BUILD.gn
index 173bab1d..4f61fe3d 100644
--- a/services/device/BUILD.gn
+++ b/services/device/BUILD.gn
@@ -306,7 +306,6 @@
     sources = [
       "android/java/src/org/chromium/services/device/InterfaceRegistrar.java",
     ]
-    jni_package = "device_service"
   }
 
   android_library("java") {
diff --git a/services/device/DEPS b/services/device/DEPS
index 35d0c5e4..d0ac51a 100644
--- a/services/device/DEPS
+++ b/services/device/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "+device",
-  "+jni",
+  "+services/device/usb/jni_headers",
   "+services/network/public/cpp",
   "+services/network/test",
   "+ui/gfx/native_widget_types.h",
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index 88716e5..127ae6b8 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -30,7 +30,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
-#include "jni/InterfaceRegistrar_jni.h"
+#include "services/device/device_service_jni_headers/InterfaceRegistrar_jni.h"
 #include "services/device/screen_orientation/screen_orientation_listener_android.h"
 #else
 #include "services/device/battery/battery_monitor_impl.h"
diff --git a/services/device/generic_sensor/BUILD.gn b/services/device/generic_sensor/BUILD.gn
index 42290d309..fc50c56 100644
--- a/services/device/generic_sensor/BUILD.gn
+++ b/services/device/generic_sensor/BUILD.gn
@@ -121,7 +121,6 @@
     visibility = [ ":generic_sensor" ]
 
     sources = device_sensors_jni_sources
-    jni_package = "device"
   }
 
   android_library("java") {
diff --git a/services/device/generic_sensor/DEPS b/services/device/generic_sensor/DEPS
index 54137bf6..a89688a 100644
--- a/services/device/generic_sensor/DEPS
+++ b/services/device/generic_sensor/DEPS
@@ -1,6 +1,6 @@
 include_rules = [
   "+device/base/synchronization",
-  "+jni",
+  "+services/device/generic_sensor/jni_headers",
   "+services/device/public/cpp/device_features.h",
   "+third_party/sudden_motion_sensor",
   "+ui/gfx/geometry"
diff --git a/services/device/generic_sensor/platform_sensor_android.cc b/services/device/generic_sensor/platform_sensor_android.cc
index 9b0efcc..a1a2900 100644
--- a/services/device/generic_sensor/platform_sensor_android.cc
+++ b/services/device/generic_sensor/platform_sensor_android.cc
@@ -5,7 +5,7 @@
 #include "services/device/generic_sensor/platform_sensor_android.h"
 
 #include "base/bind.h"
-#include "jni/PlatformSensor_jni.h"
+#include "services/device/generic_sensor/jni_headers/PlatformSensor_jni.h"
 
 using base::android::AttachCurrentThread;
 using base::android::JavaRef;
diff --git a/services/device/generic_sensor/platform_sensor_provider_android.cc b/services/device/generic_sensor/platform_sensor_provider_android.cc
index 787aefc..b7ce5f7 100644
--- a/services/device/generic_sensor/platform_sensor_provider_android.cc
+++ b/services/device/generic_sensor/platform_sensor_provider_android.cc
@@ -10,8 +10,8 @@
 #include "base/android/scoped_java_ref.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/singleton.h"
-#include "jni/PlatformSensorProvider_jni.h"
 #include "services/device/generic_sensor/absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h"
+#include "services/device/generic_sensor/jni_headers/PlatformSensorProvider_jni.h"
 #include "services/device/generic_sensor/linear_acceleration_fusion_algorithm_using_accelerometer.h"
 #include "services/device/generic_sensor/orientation_euler_angles_fusion_algorithm_using_quaternion.h"
 #include "services/device/generic_sensor/orientation_quaternion_fusion_algorithm_using_euler_angles.h"
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
index 49b2827..03a2fa7 100644
--- a/services/device/geolocation/BUILD.gn
+++ b/services/device/geolocation/BUILD.gn
@@ -129,7 +129,6 @@
       "android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java",
       "android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java",
     ]
-    jni_package = "device"
   }
 
   android_library("geolocation_java") {
diff --git a/services/device/geolocation/DEPS b/services/device/geolocation/DEPS
index 5bcd2371..9175131 100644
--- a/services/device/geolocation/DEPS
+++ b/services/device/geolocation/DEPS
@@ -2,7 +2,6 @@
   "+chromeos",
   "+components/location",
   "+dbus",
-  "+jni",
   "+net/base",
   "+net/traffic_annotation",
   "+services/network/public/cpp",
diff --git a/services/device/geolocation/geolocation_provider_impl.cc b/services/device/geolocation/geolocation_provider_impl.cc
index 058933ca..528911d9 100644
--- a/services/device/geolocation/geolocation_provider_impl.cc
+++ b/services/device/geolocation/geolocation_provider_impl.cc
@@ -25,7 +25,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
-#include "jni/LocationProviderFactory_jni.h"
+#include "services/device/geolocation/geolocation_jni_headers/LocationProviderFactory_jni.h"
 #endif
 
 namespace device {
diff --git a/services/device/geolocation/location_api_adapter_android.cc b/services/device/geolocation/location_api_adapter_android.cc
index 9930609..e3c14a2 100644
--- a/services/device/geolocation/location_api_adapter_android.cc
+++ b/services/device/geolocation/location_api_adapter_android.cc
@@ -10,7 +10,7 @@
 #include "base/location.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/time.h"
-#include "jni/LocationProviderAdapter_jni.h"
+#include "services/device/geolocation/geolocation_jni_headers/LocationProviderAdapter_jni.h"
 #include "services/device/geolocation/location_provider_android.h"
 
 using base::android::AttachCurrentThread;
diff --git a/services/device/screen_orientation/BUILD.gn b/services/device/screen_orientation/BUILD.gn
index 410ee39..2bb4c756 100644
--- a/services/device/screen_orientation/BUILD.gn
+++ b/services/device/screen_orientation/BUILD.gn
@@ -36,7 +36,6 @@
     sources = [
       "android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java",
     ]
-    jni_package = "screen_orientation"
   }
 
   android_library("java") {
diff --git a/services/device/screen_orientation/DEPS b/services/device/screen_orientation/DEPS
index dbaf051..16764a92 100644
--- a/services/device/screen_orientation/DEPS
+++ b/services/device/screen_orientation/DEPS
@@ -1,4 +1,3 @@
 include_rules = [
-  "+jni",
   "+mojo/public/cpp/bindings",
 ]
diff --git a/services/device/screen_orientation/screen_orientation_listener_android.cc b/services/device/screen_orientation/screen_orientation_listener_android.cc
index 11f69ce..0487ab81 100644
--- a/services/device/screen_orientation/screen_orientation_listener_android.cc
+++ b/services/device/screen_orientation/screen_orientation_listener_android.cc
@@ -6,8 +6,8 @@
 
 #include "base/android/jni_android.h"
 #include "base/message_loop/message_loop.h"
-#include "jni/ScreenOrientationListener_jni.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/device/screen_orientation/screen_orientation_jni_headers/ScreenOrientationListener_jni.h"
 
 namespace device {
 
diff --git a/services/device/time_zone_monitor/BUILD.gn b/services/device/time_zone_monitor/BUILD.gn
index 80dba46..1f56c9f 100644
--- a/services/device/time_zone_monitor/BUILD.gn
+++ b/services/device/time_zone_monitor/BUILD.gn
@@ -63,7 +63,6 @@
     sources = [
       "android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java",
     ]
-    jni_package = "time_zone_monitor"
   }
 
   android_library("java") {
diff --git a/services/device/time_zone_monitor/DEPS b/services/device/time_zone_monitor/DEPS
index 07571e7..2ebcba38 100644
--- a/services/device/time_zone_monitor/DEPS
+++ b/services/device/time_zone_monitor/DEPS
@@ -1,6 +1,5 @@
 include_rules = [
   "+chromeos/settings",
-  "+jni",
   "+mojo/public/cpp/bindings",
   "+ui/gfx/win",
 ]
\ No newline at end of file
diff --git a/services/device/time_zone_monitor/time_zone_monitor_android.cc b/services/device/time_zone_monitor/time_zone_monitor_android.cc
index d04acbc..bd9072e 100644
--- a/services/device/time_zone_monitor/time_zone_monitor_android.cc
+++ b/services/device/time_zone_monitor/time_zone_monitor_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_android.h"
 #include "base/sequenced_task_runner.h"
-#include "jni/TimeZoneMonitor_jni.h"
+#include "services/device/time_zone_monitor/time_zone_monitor_jni_headers/TimeZoneMonitor_jni.h"
 
 using base::android::JavaParamRef;
 
diff --git a/services/device/usb/BUILD.gn b/services/device/usb/BUILD.gn
index 677a17ed..5a0f0e1 100644
--- a/services/device/usb/BUILD.gn
+++ b/services/device/usb/BUILD.gn
@@ -204,7 +204,6 @@
 
   generate_jni("jni_headers") {
     sources = java_sources_needing_jni
-    jni_package = "device"
   }
 
   android_library("java") {
diff --git a/services/device/usb/DEPS b/services/device/usb/DEPS
index 51fbd47..a69d02c 100644
--- a/services/device/usb/DEPS
+++ b/services/device/usb/DEPS
@@ -2,7 +2,7 @@
   "+components/device_event_log",
   "+chromeos",
   "+dbus",
-  "+jni",
+  "+services/device/usb/jni_headers",
 
   "+third_party/libusb",
 ]
diff --git a/services/device/usb/usb_configuration_android.cc b/services/device/usb/usb_configuration_android.cc
index 9274d9c2..a22babe0 100644
--- a/services/device/usb/usb_configuration_android.cc
+++ b/services/device/usb/usb_configuration_android.cc
@@ -4,7 +4,7 @@
 
 #include "services/device/usb/usb_configuration_android.h"
 
-#include "jni/ChromeUsbConfiguration_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbConfiguration_jni.h"
 #include "services/device/usb/usb_interface_android.h"
 
 using base::android::ScopedJavaLocalRef;
diff --git a/services/device/usb/usb_device_android.cc b/services/device/usb/usb_device_android.cc
index de98b43fc..2ce6ae9 100644
--- a/services/device/usb/usb_device_android.cc
+++ b/services/device/usb/usb_device_android.cc
@@ -9,7 +9,7 @@
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "jni/ChromeUsbDevice_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbDevice_jni.h"
 #include "services/device/usb/usb_configuration_android.h"
 #include "services/device/usb/usb_descriptors.h"
 #include "services/device/usb/usb_device_handle_android.h"
diff --git a/services/device/usb/usb_device_handle_android.cc b/services/device/usb/usb_device_handle_android.cc
index 8f38771..e71b3d7 100644
--- a/services/device/usb/usb_device_handle_android.cc
+++ b/services/device/usb/usb_device_handle_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/bind.h"
 #include "base/location.h"
-#include "jni/ChromeUsbConnection_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbConnection_jni.h"
 #include "services/device/usb/usb_device.h"
 #include "services/device/usb/usb_service.h"
 
diff --git a/services/device/usb/usb_endpoint_android.cc b/services/device/usb/usb_endpoint_android.cc
index d0dcc2f..34517ac 100644
--- a/services/device/usb/usb_endpoint_android.cc
+++ b/services/device/usb/usb_endpoint_android.cc
@@ -4,7 +4,7 @@
 
 #include "services/device/usb/usb_endpoint_android.h"
 
-#include "jni/ChromeUsbEndpoint_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbEndpoint_jni.h"
 
 namespace device {
 
diff --git a/services/device/usb/usb_interface_android.cc b/services/device/usb/usb_interface_android.cc
index 7cd8ab00..e327951 100644
--- a/services/device/usb/usb_interface_android.cc
+++ b/services/device/usb/usb_interface_android.cc
@@ -5,7 +5,7 @@
 #include "services/device/usb/usb_interface_android.h"
 
 #include "base/android/build_info.h"
-#include "jni/ChromeUsbInterface_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbInterface_jni.h"
 #include "services/device/usb/usb_endpoint_android.h"
 
 using base::android::ScopedJavaLocalRef;
diff --git a/services/device/usb/usb_service_android.cc b/services/device/usb/usb_service_android.cc
index 117938d9..6aab6485 100644
--- a/services/device/usb/usb_service_android.cc
+++ b/services/device/usb/usb_service_android.cc
@@ -11,7 +11,7 @@
 #include "base/location.h"
 #include "base/sequenced_task_runner.h"
 #include "components/device_event_log/device_event_log.h"
-#include "jni/ChromeUsbService_jni.h"
+#include "services/device/usb/jni_headers/ChromeUsbService_jni.h"
 #include "services/device/usb/usb_device_android.h"
 
 using base::android::AttachCurrentThread;
diff --git a/services/device/vibration/android/BUILD.gn b/services/device/vibration/android/BUILD.gn
index 9a692c3..c83adbbb 100644
--- a/services/device/vibration/android/BUILD.gn
+++ b/services/device/vibration/android/BUILD.gn
@@ -9,7 +9,6 @@
   sources = [
     "java/src/org/chromium/device/vibration/VibrationManagerImpl.java",
   ]
-  jni_package = "vibration"
 }
 
 android_library("vibration_manager_java") {
diff --git a/services/device/vibration/vibration_manager_impl_unittest.cc b/services/device/vibration/vibration_manager_impl_unittest.cc
index fe3a3c8..98dcd15e 100644
--- a/services/device/vibration/vibration_manager_impl_unittest.cc
+++ b/services/device/vibration/vibration_manager_impl_unittest.cc
@@ -9,7 +9,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
-#include "jni/VibrationManagerImpl_jni.h"
+#include "services/device/vibration/android/vibration_jni_headers/VibrationManagerImpl_jni.h"
 #else
 #include "services/device/vibration/vibration_manager_impl.h"
 #endif
diff --git a/services/device/wake_lock/power_save_blocker/BUILD.gn b/services/device/wake_lock/power_save_blocker/BUILD.gn
index d8a0b73..21f4e5ea 100644
--- a/services/device/wake_lock/power_save_blocker/BUILD.gn
+++ b/services/device/wake_lock/power_save_blocker/BUILD.gn
@@ -93,7 +93,6 @@
   generate_jni("jni_headers") {
     visibility = [ ":power_save_blocker" ]
     sources = java_sources_needing_jni
-    jni_package = "device"
   }
 
   android_library("java") {
diff --git a/services/device/wake_lock/power_save_blocker/DEPS b/services/device/wake_lock/power_save_blocker/DEPS
index 32c624a..8ab9716e4 100644
--- a/services/device/wake_lock/power_save_blocker/DEPS
+++ b/services/device/wake_lock/power_save_blocker/DEPS
@@ -1,7 +1,6 @@
 include_rules = [
   "+chromeos/dbus",
   "+dbus",
-  "+jni",
   "+services/device/public",
   "+ui/android",
   "+ui/gfx",
diff --git a/services/device/wake_lock/power_save_blocker/power_save_blocker_android.cc b/services/device/wake_lock/power_save_blocker/power_save_blocker_android.cc
index fd115bd..b9f272d 100644
--- a/services/device/wake_lock/power_save_blocker/power_save_blocker_android.cc
+++ b/services/device/wake_lock/power_save_blocker/power_save_blocker_android.cc
@@ -10,7 +10,7 @@
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/sequenced_task_runner.h"
-#include "jni/PowerSaveBlocker_jni.h"
+#include "services/device/wake_lock/power_save_blocker/jni_headers/PowerSaveBlocker_jni.h"
 #include "ui/android/view_android.h"
 
 namespace device {
diff --git a/services/media_session/DEPS b/services/media_session/DEPS
index de074ee..361de0b 100644
--- a/services/media_session/DEPS
+++ b/services/media_session/DEPS
@@ -1,5 +1,4 @@
 include_rules = [
-  "+jni",
   "+ui/gfx",
   "+third_party/skia/include",
 ]
diff --git a/services/media_session/public/cpp/android/BUILD.gn b/services/media_session/public/cpp/android/BUILD.gn
index 46857b0..aedbc571 100644
--- a/services/media_session/public/cpp/android/BUILD.gn
+++ b/services/media_session/public/cpp/android/BUILD.gn
@@ -11,7 +11,6 @@
 
 generate_jni("media_session_jni_headers") {
   sources = _jni_sources
-  jni_package = "media_metadata"
 }
 
 if (current_toolchain == default_toolchain) {
diff --git a/services/media_session/public/cpp/media_image_android.cc b/services/media_session/public/cpp/media_image_android.cc
index 0cf7967f..8551e51 100644
--- a/services/media_session/public/cpp/media_image_android.cc
+++ b/services/media_session/public/cpp/media_image_android.cc
@@ -8,7 +8,7 @@
 
 #include "base/android/jni_android.h"
 #include "base/android/jni_string.h"
-#include "jni/MediaImage_jni.h"
+#include "services/media_session/public/cpp/android/media_session_jni_headers/MediaImage_jni.h"
 
 using base::android::ScopedJavaLocalRef;
 
diff --git a/services/media_session/public/cpp/media_metadata_android.cc b/services/media_session/public/cpp/media_metadata_android.cc
index 45152aa..283b6226 100644
--- a/services/media_session/public/cpp/media_metadata_android.cc
+++ b/services/media_session/public/cpp/media_metadata_android.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_array.h"
 #include "base/android/jni_string.h"
-#include "jni/MediaMetadata_jni.h"
+#include "services/media_session/public/cpp/android/media_session_jni_headers/MediaMetadata_jni.h"
 #include "services/media_session/public/cpp/media_image.h"
 
 using base::android::ScopedJavaLocalRef;
diff --git a/services/network/network_service.cc b/services/network/network_service.cc
index 184cc442..e86fd8f 100644
--- a/services/network/network_service.cc
+++ b/services/network/network_service.cc
@@ -220,10 +220,9 @@
 NetworkService::NetworkService(
     std::unique_ptr<service_manager::BinderRegistry> registry,
     mojom::NetworkServiceRequest request,
-    net::NetLog* net_log,
     service_manager::mojom::ServiceRequest service_request,
     bool delay_initialization_until_set_client)
-    : registry_(std::move(registry)), binding_(this) {
+    : net_log_(GetNetLog()), registry_(std::move(registry)), binding_(this) {
   DCHECK(!g_network_service);
   g_network_service = this;
 
@@ -249,12 +248,6 @@
     Bind(std::move(request));
   }
 
-  if (net_log) {
-    net_log_ = net_log;
-  } else {
-    net_log_ = GetNetLog();
-  }
-
   if (!delay_initialization_until_set_client)
     Initialize(mojom::NetworkServiceParams::New());
 }
@@ -304,7 +297,7 @@
 
   trace_net_log_observer_.WatchForTraceStart(net_log_);
 
-  // Add an observer that will emit network change events to the ChromeNetLog.
+  // Add an observer that will emit network change events to |net_log_|.
   // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be
   // logging the network change before other IO thread consumers respond to it.
   network_change_observer_ =
@@ -351,9 +344,8 @@
 
 std::unique_ptr<NetworkService> NetworkService::Create(
     mojom::NetworkServiceRequest request,
-    net::NetLog* net_log,
     service_manager::mojom::ServiceRequest service_request) {
-  return std::make_unique<NetworkService>(nullptr, std::move(request), net_log,
+  return std::make_unique<NetworkService>(nullptr, std::move(request),
                                           std::move(service_request));
 }
 
@@ -379,7 +371,7 @@
     service_manager::mojom::ServiceRequest service_request) {
   return std::make_unique<NetworkService>(
       std::make_unique<service_manager::BinderRegistry>(),
-      nullptr /* request */, nullptr /* net_log */, std::move(service_request));
+      nullptr /* request */, std::move(service_request));
 }
 
 void NetworkService::RegisterNetworkContext(NetworkContext* network_context) {
diff --git a/services/network/network_service.h b/services/network/network_service.h
index 3e891aec..629871b 100644
--- a/services/network/network_service.h
+++ b/services/network/network_service.h
@@ -62,15 +62,9 @@
     : public service_manager::Service,
       public mojom::NetworkService {
  public:
-  // |net_log| is an optional shared NetLog, which will be used instead of the
-  // service's own NetLog. It must outlive the NetworkService.
-  //
-  // TODO(https://crbug.com/767450): Once the NetworkService can always create
-  // its own NetLog in production, remove the |net_log| argument.
   NetworkService(
       std::unique_ptr<service_manager::BinderRegistry> registry,
       mojom::NetworkServiceRequest request = nullptr,
-      net::NetLog* net_log = nullptr,
       service_manager::mojom::ServiceRequest service_request = nullptr,
       bool delay_initialization_until_set_client = false);
 
@@ -108,12 +102,8 @@
   // Creates a NetworkService instance on the current thread, optionally using
   // the passed-in NetLog. Does not take ownership of |net_log|. Must be
   // destroyed before |net_log|.
-  //
-  // TODO(https://crbug.com/767450): Make it so NetworkService can always create
-  // its own NetLog, instead of sharing one.
   static std::unique_ptr<NetworkService> Create(
       mojom::NetworkServiceRequest request,
-      net::NetLog* net_log = nullptr,
       service_manager::mojom::ServiceRequest service_request = nullptr);
 
   // Creates a testing instance of NetworkService not bound to an actual
@@ -268,7 +258,7 @@
 
   bool initialized_ = false;
 
-  net::NetLog* net_log_ = nullptr;
+  net::NetLog* net_log_;
 
   std::unique_ptr<net::FileNetLogObserver> file_net_log_observer_;
   net::TraceNetLogObserver trace_net_log_observer_;
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
index a38c8e2..effb897 100644
--- a/services/shape_detection/BUILD.gn
+++ b/services/shape_detection/BUILD.gn
@@ -81,7 +81,6 @@
     sources = [
       "android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
     ]
-    jni_package = "shape_detection"
   }
 
   android_library("shape_detection_java") {
diff --git a/services/shape_detection/DEPS b/services/shape_detection/DEPS
index fa44d0d..eda4b66 100644
--- a/services/shape_detection/DEPS
+++ b/services/shape_detection/DEPS
@@ -1,5 +1,4 @@
 include_rules = [
-  "+jni",
   "+skia/ext/skia_utils_mac.h",
   "+third_party/skia/include",
   "+ui/gfx/codec",
diff --git a/services/shape_detection/shape_detection_service.cc b/services/shape_detection/shape_detection_service.cc
index 60403a4b..fcb488e6 100644
--- a/services/shape_detection/shape_detection_service.cc
+++ b/services/shape_detection/shape_detection_service.cc
@@ -24,7 +24,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
-#include "jni/InterfaceRegistrar_jni.h"
+#include "services/shape_detection/shape_detection_jni_headers/InterfaceRegistrar_jni.h"
 #endif
 
 namespace shape_detection {
diff --git a/services/tracing/BUILD.gn b/services/tracing/BUILD.gn
index 63bdc249..e4605e96 100644
--- a/services/tracing/BUILD.gn
+++ b/services/tracing/BUILD.gn
@@ -184,7 +184,6 @@
     sources = [
       "android/test/src/org/chromium/tracing/UnwindTestHelper.java",
     ]
-    jni_package = "tracing"
   }
 
   android_library("tracing_test_helper_java") {
diff --git a/services/tracing/DEPS b/services/tracing/DEPS
index 82fb24d..9f4fc19 100644
--- a/services/tracing/DEPS
+++ b/services/tracing/DEPS
@@ -8,6 +8,6 @@
 
 specific_include_rules = {
   'stack_unwinder_android_unittest.cc': [
-    "+jni",
+    "+services/tracing/jni_headers",
   ],
 }
diff --git a/services/tracing/public/cpp/stack_sampling/stack_unwinder_android_unittest.cc b/services/tracing/public/cpp/stack_sampling/stack_unwinder_android_unittest.cc
index 11abc10..7c3a17f 100644
--- a/services/tracing/public/cpp/stack_sampling/stack_unwinder_android_unittest.cc
+++ b/services/tracing/public/cpp/stack_sampling/stack_unwinder_android_unittest.cc
@@ -10,7 +10,7 @@
 #include "base/task/post_task.h"
 #include "base/test/scoped_task_environment.h"
 #include "base/trace_event/cfi_backtrace_android.h"
-#include "jni/UnwindTestHelper_jni.h"
+#include "services/tracing/jni_headers/UnwindTestHelper_jni.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace tracing {
diff --git a/testing/android/native_test/BUILD.gn b/testing/android/native_test/BUILD.gn
index d98b78a..15a0b12 100644
--- a/testing/android/native_test/BUILD.gn
+++ b/testing/android/native_test/BUILD.gn
@@ -69,5 +69,4 @@
     "java/src/org/chromium/native_test/MainRunner.java",
     "java/src/org/chromium/native_test/NativeTest.java",
   ]
-  jni_package = "testing"
 }
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeBrowserTestApplication.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeBrowserTestApplication.java
index 22015b65..708dbcb6 100644
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeBrowserTestApplication.java
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeBrowserTestApplication.java
@@ -7,9 +7,7 @@
 import android.app.Application;
 import android.content.Context;
 
-import org.chromium.base.ApplicationStatus;
 import org.chromium.base.BuildConfig;
-import org.chromium.base.CommandLine;
 import org.chromium.base.ContextUtils;
 import org.chromium.base.multidex.ChromiumMultiDexInstaller;
 
@@ -21,10 +19,6 @@
     protected void attachBaseContext(Context base) {
         super.attachBaseContext(base);
         ContextUtils.initApplicationContext(this);
-        if (isBrowserProcess()) {
-            CommandLine.init(new String[] {});
-            ApplicationStatus.initialize(this);
-        }
 
         if (isMainProcess() || isBrowserProcess()) {
             // We need secondary dex in order to run EmbeddedTestServer in a
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java
index d4812a70..d161758 100644
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeTest.java
@@ -12,6 +12,7 @@
 import android.os.Handler;
 import android.os.Process;
 
+import org.chromium.base.CommandLine;
 import org.chromium.base.Log;
 import org.chromium.base.annotations.JNINamespace;
 import org.chromium.base.multidex.ChromiumMultiDexInstaller;
@@ -70,6 +71,8 @@
     }
 
     public void postCreate(Activity activity) {
+        CommandLine.init(new String[]{});
+
         parseArgumentsFromIntent(activity, activity.getIntent());
         mReporter = new TestStatusReporter(activity);
         mReporter.testRunStarted(Process.myPid());
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestApplication.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestApplication.java
index ca2fc1d..c5f29d48 100644
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestApplication.java
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestApplication.java
@@ -8,7 +8,6 @@
 import android.content.Context;
 
 import org.chromium.base.BuildConfig;
-import org.chromium.base.CommandLine;
 import org.chromium.base.multidex.ChromiumMultiDexInstaller;
 
 /**
@@ -19,7 +18,6 @@
     protected void attachBaseContext(Context base) {
         super.attachBaseContext(base);
         assert getBaseContext() != null;
-        CommandLine.init(new String[] {});
         if (BuildConfig.IS_MULTIDEX_ENABLED) {
             ChromiumMultiDexInstaller.install(this);
         }
diff --git a/testing/android/native_test/main_runner.cc b/testing/android/native_test/main_runner.cc
index 1200a58..6826089 100644
--- a/testing/android/native_test/main_runner.cc
+++ b/testing/android/native_test/main_runner.cc
@@ -6,7 +6,7 @@
 
 #include "base/android/jni_array.h"
 #include "base/logging.h"
-#include "jni/MainRunner_jni.h"
+#include "testing/android/native_test/native_test_jni_headers/MainRunner_jni.h"
 #include "testing/android/native_test/native_test_util.h"
 
 extern int main(int argc, char** argv);
diff --git a/testing/android/native_test/native_test_launcher.cc b/testing/android/native_test/native_test_launcher.cc
index 441422b..2cd5475 100644
--- a/testing/android/native_test/native_test_launcher.cc
+++ b/testing/android/native_test/native_test_launcher.cc
@@ -26,8 +26,8 @@
 #include "base/strings/stringprintf.h"
 #include "base/test/test_support_android.h"
 #include "gtest/gtest.h"
-#include "jni/NativeTest_jni.h"
 #include "testing/android/native_test/main_runner.h"
+#include "testing/android/native_test/native_test_jni_headers/NativeTest_jni.h"
 #include "testing/android/native_test/native_test_util.h"
 
 using base::android::JavaParamRef;
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json
index 494cf9aa..6ddba42a 100644
--- a/testing/buildbot/chromium.gpu.fyi.json
+++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -8413,11 +8413,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "shards": 4
         },
         "test": "angle_end2end_tests"
@@ -8438,11 +8439,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "angle_unittests"
       },
@@ -8460,11 +8462,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "angle_white_box_tests"
       },
@@ -8486,11 +8489,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "browser_tests"
       },
@@ -8508,11 +8512,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "gl_tests"
       },
@@ -8530,11 +8535,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "gl_unittests"
       },
@@ -8551,11 +8557,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "gles2_conform_test"
       },
@@ -8569,11 +8576,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         },
         "test": "swiftshader_unittests"
       }
@@ -8598,11 +8606,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
-          ]
+          ],
+          "expiration": 21600
         }
       },
       {
@@ -8626,11 +8635,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8655,11 +8665,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8684,11 +8695,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8713,11 +8725,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8746,11 +8759,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8782,11 +8796,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8834,11 +8849,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false,
           "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com"
         }
@@ -8879,11 +8895,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8909,11 +8926,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8938,11 +8956,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false
         }
       },
@@ -8969,11 +8988,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false,
           "shards": 20
         }
@@ -9001,11 +9021,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false,
           "shards": 20
         }
@@ -9031,11 +9052,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false,
           "shards": 2
         }
@@ -9061,11 +9083,12 @@
           "containment_type": "AUTO",
           "dimension_sets": [
             {
-              "gpu": "10de:1cb3-410.78",
-              "os": "Ubuntu-14.04",
+              "gpu": "10de:1cb3-418.56",
+              "os": "Ubuntu-19.04",
               "pool": "Chrome-GPU"
             }
           ],
+          "expiration": 21600,
           "idempotent": false,
           "shards": 2
         }
diff --git a/testing/buildbot/filters/chromeos.browser_tests.filter b/testing/buildbot/filters/chromeos.browser_tests.filter
index 879a1945..0ce3eea 100644
--- a/testing/buildbot/filters/chromeos.browser_tests.filter
+++ b/testing/buildbot/filters/chromeos.browser_tests.filter
@@ -1,6 +1,31 @@
+# TODO(crbug.com/977736): Enable this.
+-ActiveDirectoryWebUILoginTest.PasswordChange_ReopenClearErrors
+
+# TODO(crbug.com/977737): Enable this.
+-AppListClientImplBrowserTest.OpenSearchResult
+
+# TODO(crbug.com/977738): Enable this.
+-ChromePluginTest.InstalledPlugins
+
+# TODO(crbug.com/977739): Enable this.
+-CrSettingsPeoplePageAccountManagerTest.All
+
+# TODO(crbug.com/977740): Enable this.
+-LoginUIKeyboardTest.CheckPODScreenDefault
+-LoginUIKeyboardTestWithUsersAndOwner.CheckPODScreenKeyboard
+
+# TODO(crbug.com/977741): Enable this.
+-LoginUtilsTest.RlzInitialized
+
 # TODO(crbug.com/976083): Enable this.
 -MSE_Widevine/EncryptedMediaTest.*
 
+# TODO(crbug.com/977743): Enable this.
+-ManagementApiKioskTest.ManagementApi
+
+# TODO(crbug.com/977744): Enable this.
+-ProcessMemoryMetricsEmitterTest.RendererBuildId
+
 # TODO(crbug.com/976807): Enable this.
 -SiteIsolationFlagHandlingTest.FlagHandlingTest*
 
@@ -9,6 +34,14 @@
 -StructSequence/OobeLocalizationTest.LocalizationTest/4
 -StructSequence/OobeLocalizationTest.LocalizationTest/8
 
+# TODO(crbug.com/977745): Enable this.
+-SupervisionTransitionScreenTest.SuccessfulTransition/0
+-SupervisionTransitionScreenTest.TransitionTimeout/0
+
+# TODO(crbug.com/977749): Enable this.
+-TestAsNormalAndGuestUser/SpokenFeedbackTest.OverviewMode/0
+-TestAsNormalAndGuestUser/SpokenFeedbackTest.OverviewMode/1
+
 # TODO(crbug.com/976987): Enable this.
 -UserCloudPolicyManagerTest.ErrorLoadingPolicyForUnmanagedUser/0
 -UserCloudPolicyManagerTest.ErrorLoadingPolicyForUnmanagedUser/1
@@ -18,3 +51,6 @@
 -UserCloudPolicyManagerTest.PolicyForChildUser/1
 -UserCloudPolicyManagerTest.StartSession/0
 -UserCloudPolicyManagerTest.StartSession/1
+
+# TODO(crbug.com/977750): Enable this.
+-WelcomeScreenBrowserTest.WelcomeScreenKeyboardSelection
diff --git a/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter b/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter
index ce551a0..2144092f 100644
--- a/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter
+++ b/testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter
@@ -7,7 +7,9 @@
 -DumpAccessibilityTreeTest.AccessibilityOffscreenSelect/blink
 -DumpAccessibilityTreeTest.AccessibilityWindowCropsItems/blink
 -File/MediaTest.VideoBearMp4/0
+-File/MediaTest.VideoTulipWebm/0
 -Http/MediaTest.VideoBearMp4/0
+-Http/MediaTest.VideoTulipWebm/0
 -MediaColorTest.Yuv420pTheora
 -MediaColorTest.Yuv420pVp8
 -MediaSessionImplBrowserTest.MetadataWhenFileUrlScheme
@@ -39,6 +41,7 @@
 -SitePerProcessHighDPIHitTestBrowserTest.OverlapSurfaceHitTestTest/0
 -SitePerProcessHitTestBrowserTest.BubbledScrollEventsTransformedCorrectly/0
 -SitePerProcessHitTestBrowserTest.CrossProcessMouseCapture/0
+-SitePerProcessHitTestBrowserTest.CrossProcessMouseCapture/1
 -SitePerProcessHitTestBrowserTest.CrossProcessMouseEnterAndLeaveTest/0
 -SitePerProcessHitTestBrowserTest.CrossProcessMousePointerCapture/0
 -SitePerProcessHitTestBrowserTest.CrossProcessTooltipTestAndroid/0
@@ -59,6 +62,7 @@
 -TouchSelectionControllerClientAndroidSiteIsolationTest.BasicSelectionIsolatedIframe
 -WebContentsImplBrowserTest.PopupWindowBrowserNavResumeLoad
 -WebRtcBrowserTest.CanSetupH264VideoCallOnSupportedDevice
+-WebRtcCaptureFromElementBrowserTest.CaptureFromCanvas2DHandlesContextLoss
 -WebRtcCaptureFromElementBrowserTest.VerifyCanvasCaptureOffscreenCanvasFrames
 -WebRtcCaptureFromElementBrowserTest.VerifyCanvasCaptureWebGLFrames
 -WebRtcCaptureFromElementBrowserTest.VerifyCanvasCapture2DFrames
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl
index b34f264..5986eeec 100644
--- a/testing/buildbot/mixins.pyl
+++ b/testing/buildbot/mixins.pyl
@@ -301,8 +301,8 @@
   'linux_nvidia_quadro_p400_experimental': {
     'swarming': {
       'dimensions': {
-        'gpu': '10de:1cb3-410.78',
-        'os': 'Ubuntu-14.04',
+        'gpu': '10de:1cb3-418.56',
+        'os': 'Ubuntu-19.04',
         'pool': 'Chrome-GPU',
       },
     },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl
index 99ca4c4..88acad7a2 100644
--- a/testing/buildbot/waterfalls.pyl
+++ b/testing/buildbot/waterfalls.pyl
@@ -2616,6 +2616,7 @@
         'os_type': 'linux',
         'browser_config': 'release',
         'mixins': [
+          'limited_capacity_bot',
           'linux_nvidia_quadro_p400_experimental',
         ],
         'test_suites': {
diff --git a/third_party/blink/renderer/core/animation/css_length_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_length_interpolation_type.cc
index 7b7fb41..0d278ac 100644
--- a/third_party/blink/renderer/core/animation/css_length_interpolation_type.cc
+++ b/third_party/blink/renderer/core/animation/css_length_interpolation_type.cc
@@ -10,7 +10,6 @@
 #include "base/memory/ptr_util.h"
 #include "third_party/blink/renderer/core/animation/length_interpolation_functions.h"
 #include "third_party/blink/renderer/core/animation/length_property_functions.h"
-#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_identifier_value.h"
 #include "third_party/blink/renderer/core/css/resolver/style_builder.h"
 #include "third_party/blink/renderer/core/css/resolver/style_resolver_state.h"
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline.cc b/third_party/blink/renderer/core/animation/scroll_timeline.cc
index 82566e7b..1c91e9f7 100644
--- a/third_party/blink/renderer/core/animation/scroll_timeline.cc
+++ b/third_party/blink/renderer/core/animation/scroll_timeline.cc
@@ -4,7 +4,6 @@
 
 #include "third_party/blink/renderer/core/animation/scroll_timeline.h"
 
-#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h"
 #include "third_party/blink/renderer/core/css/parser/css_tokenizer.h"
 #include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
@@ -109,18 +108,20 @@
   }
 
   return MakeGarbageCollected<ScrollTimeline>(
-      scroll_source, orientation, start_scroll_offset, end_scroll_offset,
-      options->timeRange().GetAsDouble(),
+      &document, scroll_source, orientation, start_scroll_offset,
+      end_scroll_offset, options->timeRange().GetAsDouble(),
       Timing::StringToFillMode(options->fill()));
 }
 
-ScrollTimeline::ScrollTimeline(Element* scroll_source,
+ScrollTimeline::ScrollTimeline(Document* document,
+                               Element* scroll_source,
                                ScrollDirection orientation,
                                CSSPrimitiveValue* start_scroll_offset,
                                CSSPrimitiveValue* end_scroll_offset,
                                double time_range,
                                Timing::FillMode fill)
-    : scroll_source_(scroll_source),
+    : document_(document),
+      scroll_source_(scroll_source),
       resolved_scroll_source_(ResolveScrollSource(scroll_source_)),
       orientation_(orientation),
       start_scroll_offset_(start_scroll_offset),
@@ -348,6 +349,7 @@
 }
 
 void ScrollTimeline::Trace(blink::Visitor* visitor) {
+  visitor->Trace(document_);
   visitor->Trace(scroll_source_);
   visitor->Trace(resolved_scroll_source_);
   visitor->Trace(start_scroll_offset_);
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline.h b/third_party/blink/renderer/core/animation/scroll_timeline.h
index aa8d673..bbfc2fa64 100644
--- a/third_party/blink/renderer/core/animation/scroll_timeline.h
+++ b/third_party/blink/renderer/core/animation/scroll_timeline.h
@@ -40,7 +40,8 @@
                                 ScrollTimelineOptions*,
                                 ExceptionState&);
 
-  ScrollTimeline(Element*,
+  ScrollTimeline(Document*,
+                 Element*,
                  ScrollDirection,
                  CSSPrimitiveValue*,
                  CSSPrimitiveValue*,
@@ -50,7 +51,7 @@
   // AnimationTimeline implementation.
   double currentTime(bool& is_null) final;
   bool IsScrollTimeline() const override { return true; }
-  Document* GetDocument() override { return &scroll_source_->GetDocument(); }
+  Document* GetDocument() override { return document_; }
   // ScrollTimeline is not active if scrollSource is null, does not currently
   // have a CSS layout box, or if its layout box is not a scroll container.
   // https://github.com/WICG/scroll-animations/issues/31
@@ -96,6 +97,7 @@
   static bool HasActiveScrollTimeline(Node* node);
 
  private:
+  Member<Document> document_;
   // Use |scroll_source_| only to implement the web-exposed API but use
   // resolved_scroll_source_ to actually access the scroll related properties.
   Member<Element> scroll_source_;
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline_test.cc b/third_party/blink/renderer/core/animation/scroll_timeline_test.cc
index 03ea5af..9f3d74d 100644
--- a/third_party/blink/renderer/core/animation/scroll_timeline_test.cc
+++ b/third_party/blink/renderer/core/animation/scroll_timeline_test.cc
@@ -231,7 +231,7 @@
   CSSPrimitiveValue* start_scroll_offset = nullptr;
   CSSPrimitiveValue* end_scroll_offset = nullptr;
   ScrollTimeline* scroll_timeline = MakeGarbageCollected<ScrollTimeline>(
-      scroll_source, ScrollTimeline::Block, start_scroll_offset,
+      &GetDocument(), scroll_source, ScrollTimeline::Block, start_scroll_offset,
       end_scroll_offset, 100, Timing::FillMode::NONE);
 
   // Sanity checks.
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline_util_test.cc b/third_party/blink/renderer/core/animation/scroll_timeline_util_test.cc
index 2897cc7..b22caec 100644
--- a/third_party/blink/renderer/core/animation/scroll_timeline_util_test.cc
+++ b/third_party/blink/renderer/core/animation/scroll_timeline_util_test.cc
@@ -82,7 +82,7 @@
   CSSPrimitiveValue* start_scroll_offset = nullptr;
   CSSPrimitiveValue* end_scroll_offset = nullptr;
   ScrollTimeline* timeline = MakeGarbageCollected<ScrollTimeline>(
-      scroll_source, ScrollTimeline::Block, start_scroll_offset,
+      &GetDocument(), scroll_source, ScrollTimeline::Block, start_scroll_offset,
       end_scroll_offset, 100, Timing::FillMode::NONE);
 
   std::unique_ptr<CompositorScrollTimeline> compositor_timeline =
diff --git a/third_party/blink/renderer/core/css/css_primitive_value_mappings.h b/third_party/blink/renderer/core/css/css_primitive_value_mappings.h
index ff08262..755063b 100644
--- a/third_party/blink/renderer/core/css/css_primitive_value_mappings.h
+++ b/third_party/blink/renderer/core/css/css_primitive_value_mappings.h
@@ -32,7 +32,6 @@
 #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_PRIMITIVE_VALUE_MAPPINGS_H_
 
 #include "cc/input/scroll_snap_data.h"
-#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_identifier_value.h"
 #include "third_party/blink/renderer/core/css/css_primitive_value.h"
 #include "third_party/blink/renderer/core/css/css_reflection_direction.h"
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
index a6bd2be..01e53b7d 100644
--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
@@ -32,6 +32,7 @@
 #include "build/build_config.h"
 #include "third_party/blink/renderer/core/css/basic_shape_functions.h"
 #include "third_party/blink/renderer/core/css/css_axis_value.h"
+#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_color_value.h"
 #include "third_party/blink/renderer/core/css/css_content_distribution_value.h"
 #include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
index 1149fc52..a60c2c8 100644
--- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc
+++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -38,7 +38,6 @@
 #include "third_party/blink/renderer/core/animation/invalidatable_interpolation.h"
 #include "third_party/blink/renderer/core/animation/keyframe_effect.h"
 #include "third_party/blink/renderer/core/animation/transition_interpolation.h"
-#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
 #include "third_party/blink/renderer/core/css/css_default_style_sheets.h"
 #include "third_party/blink/renderer/core/css/css_font_selector.h"
diff --git a/third_party/blink/renderer/core/css/resolver/transform_builder.cc b/third_party/blink/renderer/core/css/resolver/transform_builder.cc
index c3e1ba7..86d5622 100644
--- a/third_party/blink/renderer/core/css/resolver/transform_builder.cc
+++ b/third_party/blink/renderer/core/css/resolver/transform_builder.cc
@@ -30,6 +30,7 @@
 
 #include "third_party/blink/renderer/core/css/resolver/transform_builder.h"
 
+#include "third_party/blink/renderer/core/css/css_calculation_value.h"
 #include "third_party/blink/renderer/core/css/css_function_value.h"
 #include "third_party/blink/renderer/core/css/css_primitive_value_mappings.h"
 #include "third_party/blink/renderer/platform/heap/handle.h"
@@ -109,6 +110,7 @@
       const auto& primitive_value = To<CSSPrimitiveValue>(*item);
 
       if (primitive_value.IsCalculated()) {
+        // TODO(xiaochengh): Get type from CSSPrimitiveValue directly.
         CSSCalcValue* css_calc_value = primitive_value.CssCalcValue();
         CSSPrimitiveValue::UnitType resolved_type =
             css_calc_value->ExpressionNode()->TypeWithCalcResolved();
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 5b48129..4df86006 100644
--- a/third_party/blink/renderer/core/frame/local_frame_view.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -1520,12 +1520,23 @@
       ToLayoutBox(root).IsGridItem() || root.IsTablePart())
     return false;
 
-  // Do not pre-layout objects that are fully managed by LayoutNG; it is not
-  // necessary and may lead to double layouts. We do need to pre-layout
-  // objects whose containing block is a legacy object so that it can
-  // properly compute its intrinsic size.
-  if (RuntimeEnabledFeatures::LayoutNGEnabled() && IsManagedByLayoutNG(root))
-    return false;
+  if (RuntimeEnabledFeatures::LayoutNGEnabled()) {
+    // Do not pre-layout objects that are fully managed by LayoutNG; it is not
+    // necessary and may lead to double layouts. We do need to pre-layout
+    // objects whose containing block is a legacy object so that it can
+    // properly compute its intrinsic size.
+    if (IsManagedByLayoutNG(root))
+      return false;
+
+    // If the root is legacy but has |CachedLayoutResult|, its parent is NG,
+    // which called |RunLegacyLayout()|. This parent not only needs to run
+    // pre-layout, but also clearing |NeedsLayout()| without updating
+    // |CachedLayoutResult| is harmful.
+    if (const auto* box = ToLayoutBoxOrNull(&root)) {
+      if (box->GetCachedLayoutResult())
+        return false;
+    }
+  }
 
   RemoveFloatingObjectsForSubtreeRoot(root);
   return true;
diff --git a/third_party/blink/renderer/core/frame/picture_in_picture_controller.h b/third_party/blink/renderer/core/frame/picture_in_picture_controller.h
index e530afc..0f08617 100644
--- a/third_party/blink/renderer/core/frame/picture_in_picture_controller.h
+++ b/third_party/blink/renderer/core/frame/picture_in_picture_controller.h
@@ -47,6 +47,7 @@
     kDisabledBySystem,
     kDisabledByFeaturePolicy,
     kDisabledByAttribute,
+    kInvalidWidthOrHeightOption,
   };
 
   // Enter Picture-in-Picture for an element with options if any and resolve
diff --git a/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc b/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc
index b443048e..666bc1bb 100644
--- a/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc
+++ b/third_party/blink/renderer/core/html/parser/html_preload_scanner_test.cc
@@ -1232,6 +1232,7 @@
 }
 
 TEST_F(HTMLPreloadScannerTest, LazyLoadImage_FeatureDisabledWithAttribute) {
+  ScopedLazyImageLoadingForTest scoped_lazy_image_loading_for_test(false);
   GetDocument().GetSettings()->SetLazyLoadEnabled(true);
   RunSetUp(kViewportEnabled);
   LazyLoadImageTestCase test_cases[] = {
diff --git a/third_party/blink/renderer/core/layout/layout_flexible_box.cc b/third_party/blink/renderer/core/layout/layout_flexible_box.cc
index 397c35b4..da431e5 100644
--- a/third_party/blink/renderer/core/layout/layout_flexible_box.cc
+++ b/third_party/blink/renderer/core/layout/layout_flexible_box.cc
@@ -847,8 +847,10 @@
     const Length& cross_size_length = IsHorizontalFlow()
                                           ? child.StyleRef().Height()
                                           : child.StyleRef().Width();
-    return ComputeMainSizeFromAspectRatioUsing(child, cross_size_length) -
-           main_axis_border_scrollbar_padding;
+    LayoutUnit result =
+        ComputeMainSizeFromAspectRatioUsing(child, cross_size_length);
+    result = AdjustChildSizeForAspectRatioCrossAxisMinAndMax(child, result);
+    return result - main_axis_border_scrollbar_padding;
   }
 
   // The flex basis is indefinite (=auto), so we need to compute the actual
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc
index a0dab7e..cb1bd70 100644
--- a/third_party/blink/renderer/core/layout/layout_object.cc
+++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -183,23 +183,22 @@
 }
 #endif
 
-struct SameSizeAsLayoutObject : DisplayItemClient {
+struct SameSizeAsLayoutObject : ImageResourceObserver, DisplayItemClient {
   // Normally this field uses the gap between DisplayItemClient and
   // LayoutObject's other fields.
   uint8_t paint_invalidation_reason_;
-  void* pointers[5];
-  Member<void*> members[1];
 #if DCHECK_IS_ON()
   unsigned debug_bitfields_;
 #endif
   unsigned bitfields_;
   unsigned bitfields2_;
   unsigned bitfields3_;
+  void* pointers[4];
+  Member<void*> members[1];
   // The following fields are in FragmentData.
   IntRect visual_rect_;
   PhysicalOffset paint_offset_;
   std::unique_ptr<int> rare_data_;
-  std::unique_ptr<FragmentData> next_fragment_;
 };
 
 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject),
@@ -298,17 +297,17 @@
 
 LayoutObject::LayoutObject(Node* node)
     : full_paint_invalidation_reason_(PaintInvalidationReason::kNone),
-      style_(nullptr),
-      node_(node),
-      parent_(nullptr),
-      previous_(nullptr),
-      next_(nullptr),
 #if DCHECK_IS_ON()
       has_ax_object_(false),
       set_needs_layout_forbidden_(false),
       as_image_observer_count_(0),
 #endif
-      bitfields_(node) {
+      bitfields_(node),
+      style_(nullptr),
+      node_(node),
+      parent_(nullptr),
+      previous_(nullptr),
+      next_(nullptr) {
   InstanceCounters::IncrementCounter(InstanceCounters::kLayoutObjectCounter);
   if (node_)
     GetFrameView()->IncrementLayoutObjectCount();
@@ -3156,7 +3155,7 @@
   if (RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled() ||
       RuntimeEnabledFeatures::ElementTimingEnabled(&GetDocument())) {
     if (LocalFrameView* frame_view = GetFrameView()) {
-      frame_view->GetPaintTimingDetector().NotifyNodeRemoved(*this);
+      frame_view->GetPaintTimingDetector().LayoutObjectWillBeDestroyed(*this);
     }
   }
 }
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h
index c319bb4..d9ec29c7 100644
--- a/third_party/blink/renderer/core/layout/layout_object.h
+++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -2710,15 +2710,6 @@
   // DisplayItemClient and LayoutObject's other fields.
   PaintInvalidationReason full_paint_invalidation_reason_;
 
-  scoped_refptr<const ComputedStyle> style_;
-
-  // Oilpan: This untraced pointer to the owning Node is considered safe.
-  UntracedMember<Node> node_;
-
-  LayoutObject* parent_;
-  LayoutObject* previous_;
-  LayoutObject* next_;
-
 #if DCHECK_IS_ON()
   unsigned has_ax_object_ : 1;
   unsigned set_needs_layout_forbidden_ : 1;
@@ -3203,6 +3194,15 @@
  private:
   friend class LineLayoutItem;
 
+  scoped_refptr<const ComputedStyle> style_;
+
+  // Oilpan: This untraced pointer to the owning Node is considered safe.
+  UntracedMember<Node> node_;
+
+  LayoutObject* parent_;
+  LayoutObject* previous_;
+  LayoutObject* next_;
+
   // Store state between styleWillChange and styleDidChange
   static bool affects_parent_block_;
 
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
index 80313e52..5c8487a0 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
@@ -1007,6 +1007,7 @@
     // Using |LayoutObject::LayoutIfNeeded| save us a little bit of overhead,
     // compared to |LayoutObject::ForceLayout|.
     DCHECK(!box_->IsLayoutNGMixin());
+    bool needed_layout = box_->NeedsLayout();
     if (box_->NeedsLayout() && !needs_force_relayout)
       box_->LayoutIfNeeded();
     else
@@ -1034,6 +1035,12 @@
     layout_result = builder.ToBoxFragment();
 
     box_->SetCachedLayoutResult(*layout_result, /* break_token */ nullptr);
+
+    // If |SetCachedLayoutResult| did not update cached |LayoutResult|,
+    // |NeedsLayout()| flag should not be cleared.
+    if (needed_layout && layout_result != box_->GetCachedLayoutResult()) {
+      box_->SetNeedsLayout(layout_invalidation_reason::kUnknown);
+    }
   } else if (layout_result) {
     // OOF-positioned nodes have a two-tier cache, and their layout results
     // must always contain the correct percentage resolution size.
diff --git a/third_party/blink/renderer/core/paint/fragment_data.cc b/third_party/blink/renderer/core/paint/fragment_data.cc
index ad011e8..91dd73c 100644
--- a/third_party/blink/renderer/core/paint/fragment_data.cc
+++ b/third_party/blink/renderer/core/paint/fragment_data.cc
@@ -15,21 +15,22 @@
 FragmentData::RareData::~RareData() = default;
 
 void FragmentData::DestroyTail() {
-  while (next_fragment_) {
-    // Take the following (next-next) fragment, clearing
-    // |next_fragment_->next_fragment_|.
-    std::unique_ptr<FragmentData> next =
-        std::move(next_fragment_->next_fragment_);
-    // Point |next_fragment_| to the following fragment and destroy
-    // the current |next_fragment_|.
-    next_fragment_ = std::move(next);
+  if (!rare_data_)
+    return;
+  // Take next_fragment_ which clears it in this fragment.
+  std::unique_ptr<FragmentData> next = std::move(rare_data_->next_fragment_);
+  while (next && next->rare_data_) {
+    // Take next_fragment_ which clears it in that fragment, and the assignment
+    // deletes the previous |next|.
+    next = std::move(next->rare_data_->next_fragment_);
   }
+  // The last |next| will be deleted on return.
 }
 
 FragmentData& FragmentData::EnsureNextFragment() {
-  if (!next_fragment_)
-    next_fragment_ = std::make_unique<FragmentData>();
-  return *next_fragment_.get();
+  if (!NextFragment())
+    EnsureRareData().next_fragment_ = std::make_unique<FragmentData>();
+  return *rare_data_->next_fragment_;
 }
 
 FragmentData::RareData& FragmentData::EnsureRareData() {
diff --git a/third_party/blink/renderer/core/paint/fragment_data.h b/third_party/blink/renderer/core/paint/fragment_data.h
index 0b57cdf..39e92e5 100644
--- a/third_party/blink/renderer/core/paint/fragment_data.h
+++ b/third_party/blink/renderer/core/paint/fragment_data.h
@@ -23,7 +23,9 @@
   USING_FAST_MALLOC(FragmentData);
 
  public:
-  FragmentData* NextFragment() const { return next_fragment_.get(); }
+  FragmentData* NextFragment() const {
+    return rare_data_ ? rare_data_->next_fragment_.get() : nullptr;
+  }
   FragmentData& EnsureNextFragment();
   void ClearNextFragment() { DestroyTail(); }
 
@@ -227,13 +229,17 @@
   void MapRectToFragment(const FragmentData& fragment, IntRect&) const;
 
   ~FragmentData() {
-    if (next_fragment_)
+    if (NextFragment())
       DestroyTail();
   }
 
  private:
   friend class FragmentDataTest;
 
+  // We could let the compiler generate code to automatically destroy the
+  // next_fragment_ chain, but the code would cause stack overflow in some
+  // cases (e.g. fast/multicol/infinitely-tall-content-in-outer-crash.html).
+  // This function destroy the next_fragment_ chain non-recursively.
   void DestroyTail();
 
   // Contains rare data that that is not needed on all fragments.
@@ -260,6 +266,7 @@
     bool is_clip_path_cache_valid = false;
     base::Optional<IntRect> clip_path_bounding_box;
     scoped_refptr<const RefCountedPath> clip_path_path;
+    std::unique_ptr<FragmentData> next_fragment_;
 
     DISALLOW_COPY_AND_ASSIGN(RareData);
   };
@@ -270,7 +277,6 @@
   PhysicalOffset paint_offset_;
 
   std::unique_ptr<RareData> rare_data_;
-  std::unique_ptr<FragmentData> next_fragment_;
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc b/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
index 516004fb..e9f2597 100644
--- a/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
+++ b/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
@@ -153,7 +153,7 @@
   RegisterNotifySwapTime();
 }
 
-void ImagePaintTimingDetector::NotifyNodeRemoved(DOMNodeId node_id) {
+void ImagePaintTimingDetector::LayoutObjectWillBeDestroyed(DOMNodeId node_id) {
   if (!is_recording_)
     return;
   // Todo: check whether it is visible background image.
diff --git a/third_party/blink/renderer/core/paint/image_paint_timing_detector.h b/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
index 6a80130..03f6e42 100644
--- a/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
+++ b/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
@@ -212,7 +212,7 @@
       const ImageResourceContent& cached_image,
       const PropertyTreeState& current_paint_chunk_properties);
   void OnPaintFinished();
-  void NotifyNodeRemoved(DOMNodeId);
+  void LayoutObjectWillBeDestroyed(DOMNodeId);
   void NotifyBackgroundImageRemoved(DOMNodeId, const ImageResourceContent*);
   // After the method being called, the detector stops to record new entries and
   // node removal. But it still observe the loading status. In other words, if
diff --git a/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.cc b/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.cc
index e0065e0d..f220825 100644
--- a/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.cc
+++ b/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.cc
@@ -31,11 +31,11 @@
 }
 
 void LargestContentfulPaintCalculator::OnLargestTextUpdated(
-    const TextRecord* largest_text) {
+    base::WeakPtr<TextRecord> largest_text) {
   largest_text_.reset();
   if (largest_text) {
     largest_text_ = std::make_unique<TextRecord>(
-        kInvalidDOMNodeId, largest_text->first_size, FloatRect());
+        largest_text->node_id, largest_text->first_size, FloatRect());
     largest_text_->paint_time = largest_text->paint_time;
   }
 
diff --git a/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.h b/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.h
index 7149ff7..3025610c 100644
--- a/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.h
+++ b/third_party/blink/renderer/core/paint/largest_contentful_paint_calculator.h
@@ -21,7 +21,7 @@
 
   void OnLargestImageUpdated(const ImageRecord* largest_image);
 
-  void OnLargestTextUpdated(const TextRecord* largest_text);
+  void OnLargestTextUpdated(base::WeakPtr<TextRecord> largest_text);
 
   void Trace(blink::Visitor* visitor);
 
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
index 7a27b344..36c4cde 100644
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -2491,38 +2491,48 @@
   // should also skip any fragment clip created by the skipped pagination
   // container. We also need to skip fragment clip if the object is a paint
   // invalidation container which doesn't allow fragmentation.
-  // TODO(crbug.com/803649): This may also skip necessary clips under the
-  // skipped fragment clip.
-  if (object_.IsColumnSpanAll() ||
-      (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled() &&
-       object_.IsPaintInvalidationContainer() &&
-       ToLayoutBoxModelObject(object_).Layer()->EnclosingPaginationLayer())) {
-    if (const auto* pagination_layer_in_tree_hierarchy =
-            object_.Parent()->EnclosingLayer()->EnclosingPaginationLayer()) {
-      const auto& clip_container =
-          pagination_layer_in_tree_hierarchy->GetLayoutObject();
-      const auto* properties = clip_container.FirstFragment().PaintProperties();
-      if (properties && properties->FragmentClip()) {
-        // However, because we don't allow an object's clip to escape the
-        // output clip of the object's effect, we can't skip fragment clip if
-        // between this object and the container there is any effect that has
-        // an output clip. TODO(crbug.com/803649): Fix this workaround.
-        const auto& clip_container_effect = clip_container.FirstFragment()
-                                                .LocalBorderBoxProperties()
-                                                .Effect()
-                                                .Unalias();
-        for (const auto* effect =
-                 &context_.fragments[0].current_effect->Unalias();
-             effect && effect != &clip_container_effect;
-             effect = SafeUnalias(effect->Parent())) {
-          if (effect->OutputClip())
-            return;
-        }
-        context_.fragments[0].current.clip =
-            properties->FragmentClip()->Parent();
-      }
-    }
+  bool skip_fragment_clip_for_composited_layer =
+      !RuntimeEnabledFeatures::CompositeAfterPaintEnabled() &&
+      object_.IsPaintInvalidationContainer() &&
+      ToLayoutBoxModelObject(object_).Layer()->EnclosingPaginationLayer();
+  if (!skip_fragment_clip_for_composited_layer && !object_.IsColumnSpanAll())
+    return;
+
+  const auto* pagination_layer_in_tree_hierarchy =
+      object_.Parent()->EnclosingLayer()->EnclosingPaginationLayer();
+  if (!pagination_layer_in_tree_hierarchy)
+    return;
+
+  const auto& clip_container =
+      pagination_layer_in_tree_hierarchy->GetLayoutObject();
+  const auto* properties = clip_container.FirstFragment().PaintProperties();
+  if (!properties || !properties->FragmentClip())
+    return;
+
+  // Skip fragment clip for composited layer only when there are no other clips.
+  // TODO(crbug.com/803649): This is still incorrect if this object first
+  // appear in the second or later fragment of its parent.
+  if (skip_fragment_clip_for_composited_layer &&
+      properties->FragmentClip() != context_.fragments[0].current.clip)
+    return;
+
+  // However, because we don't allow an object's clip to escape the
+  // output clip of the object's effect, we can't skip fragment clip if
+  // between this object and the container there is any effect that has
+  // an output clip. TODO(crbug.com/803649): Fix this workaround.
+  const auto& clip_container_effect = clip_container.FirstFragment()
+                                          .LocalBorderBoxProperties()
+                                          .Effect()
+                                          .Unalias();
+  for (const auto* effect = &context_.fragments[0].current_effect->Unalias();
+       effect && effect != &clip_container_effect;
+       effect = SafeUnalias(effect->Parent())) {
+    if (effect->OutputClip())
+      return;
   }
+
+  // Skip the fragment clip.
+  context_.fragments[0].current.clip = properties->FragmentClip()->Parent();
 }
 
 void PaintPropertyTreeBuilder::UpdateCompositedLayerPaginationOffset() {
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
index 8f2d375..4592534 100644
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
@@ -5841,6 +5841,28 @@
                                    .Clip());
 }
 
+TEST_P(PaintPropertyTreeBuilderTest, CompositedLayerUnderClipUnerMulticol) {
+  SetBodyInnerHTML(R"HTML(
+    <div id="multicol" style="columns: 2">
+      <div id="clip" style="height: 100px; overflow: hidden">
+        <div id="composited"
+             style="width: 200px; height: 200px; will-change: transform">
+        </div>
+      </div>
+    </div>
+  )HTML");
+
+  const auto* flow_thread =
+      GetLayoutObjectByElementId("multicol")->SlowFirstChild();
+  const auto* fragment_clip =
+      flow_thread->FirstFragment().PaintProperties()->FragmentClip();
+  const auto* clip_properties = PaintPropertiesForElement("clip");
+  const auto* composited = GetLayoutObjectByElementId("composited");
+  EXPECT_EQ(clip_properties->OverflowClip(),
+            &composited->FirstFragment().LocalBorderBoxProperties().Clip());
+  EXPECT_EQ(fragment_clip, clip_properties->OverflowClip()->Parent());
+}
+
 TEST_P(PaintPropertyTreeBuilderTest, RepeatingFixedPositionInPagedMedia) {
   SetBodyInnerHTML(R"HTML(
     <div id="fixed" style="position: fixed; top: 20px; left: 20px">
diff --git a/third_party/blink/renderer/core/paint/paint_timing_detector.cc b/third_party/blink/renderer/core/paint/paint_timing_detector.cc
index 914a84c4..169c55d 100644
--- a/third_party/blink/renderer/core/paint/paint_timing_detector.cc
+++ b/third_party/blink/renderer/core/paint/paint_timing_detector.cc
@@ -61,8 +61,10 @@
 void PaintTimingDetector::NotifyPaintFinished() {
   if (text_paint_timing_detector_) {
     text_paint_timing_detector_->OnPaintFinished();
-    if (text_paint_timing_detector_->FinishedReportingText())
+    if (text_paint_timing_detector_->FinishedReportingText()) {
+      text_paint_timing_detector_->StopRecordEntries();
       text_paint_timing_detector_ = nullptr;
+    }
   }
   if (image_paint_timing_detector_) {
     image_paint_timing_detector_->OnPaintFinished();
@@ -114,15 +116,17 @@
   }
 }
 
-void PaintTimingDetector::NotifyNodeRemoved(const LayoutObject& object) {
+void PaintTimingDetector::LayoutObjectWillBeDestroyed(
+    const LayoutObject& object) {
+  if (text_paint_timing_detector_)
+    text_paint_timing_detector_->LayoutObjectWillBeDestroyed(object);
+
   DOMNodeId node_id = DOMNodeIds::ExistingIdForNode(object.GetNode());
   if (node_id == kInvalidDOMNodeId)
     return;
 
-  if (text_paint_timing_detector_)
-    text_paint_timing_detector_->NotifyNodeRemoved(node_id);
   if (image_paint_timing_detector_)
-    image_paint_timing_detector_->NotifyNodeRemoved(node_id);
+    image_paint_timing_detector_->LayoutObjectWillBeDestroyed(node_id);
 }
 
 void PaintTimingDetector::NotifyBackgroundImageRemoved(
@@ -137,12 +141,7 @@
   }
 }
 
-void PaintTimingDetector::NotifyInputEvent(WebInputEvent::Type type) {
-  if (type == WebInputEvent::kMouseMove || type == WebInputEvent::kMouseEnter ||
-      type == WebInputEvent::kMouseLeave ||
-      WebInputEvent::IsPinchGestureEventType(type)) {
-    return;
-  }
+void PaintTimingDetector::StopRecordingIfNeeded() {
   DCHECK(frame_view_);
   if (text_paint_timing_detector_) {
     text_paint_timing_detector_->StopRecordingLargestTextPaint();
@@ -155,19 +154,19 @@
     image_paint_timing_detector_->StopRecordEntries();
 }
 
+void PaintTimingDetector::NotifyInputEvent(WebInputEvent::Type type) {
+  if (type == WebInputEvent::kMouseMove || type == WebInputEvent::kMouseEnter ||
+      type == WebInputEvent::kMouseLeave ||
+      WebInputEvent::IsPinchGestureEventType(type)) {
+    return;
+  }
+  StopRecordingIfNeeded();
+}
+
 void PaintTimingDetector::NotifyScroll(ScrollType scroll_type) {
   if (scroll_type != kUserScroll && scroll_type != kCompositorScroll)
     return;
-  DCHECK(frame_view_);
-  if (text_paint_timing_detector_) {
-    text_paint_timing_detector_->StopRecordingLargestTextPaint();
-    if (!RuntimeEnabledFeatures::ElementTimingEnabled(
-            frame_view_->GetFrame().GetDocument())) {
-      text_paint_timing_detector_->StopRecordEntries();
-    }
-  }
-  if (image_paint_timing_detector_)
-    image_paint_timing_detector_->StopRecordEntries();
+  StopRecordingIfNeeded();
 }
 
 bool PaintTimingDetector::NeedToNotifyInputOrScroll() const {
diff --git a/third_party/blink/renderer/core/paint/paint_timing_detector.h b/third_party/blink/renderer/core/paint/paint_timing_detector.h
index 8ca21905..0335fe3 100644
--- a/third_party/blink/renderer/core/paint/paint_timing_detector.h
+++ b/third_party/blink/renderer/core/paint/paint_timing_detector.h
@@ -49,7 +49,7 @@
       const PropertyTreeState& current_paint_chunk_properties);
   inline static void NotifyTextPaint(const IntRect& text_visual_rect);
 
-  void NotifyNodeRemoved(const LayoutObject&);
+  void LayoutObjectWillBeDestroyed(const LayoutObject&);
   void NotifyBackgroundImageRemoved(const LayoutObject&,
                                     const ImageResourceContent*);
   void NotifyPaintFinished();
@@ -83,6 +83,7 @@
   void Trace(Visitor* visitor);
 
  private:
+  void StopRecordingIfNeeded();
   bool HasLargestImagePaintChanged(base::TimeTicks, uint64_t size) const;
   bool HasLargestTextPaintChanged(base::TimeTicks, uint64_t size) const;
   Member<LocalFrameView> frame_view_;
diff --git a/third_party/blink/renderer/core/paint/text_paint_timing_detector.cc b/third_party/blink/renderer/core/paint/text_paint_timing_detector.cc
index 26a35df..9bfc68c 100644
--- a/third_party/blink/renderer/core/paint/text_paint_timing_detector.cc
+++ b/third_party/blink/renderer/core/paint/text_paint_timing_detector.cc
@@ -54,10 +54,8 @@
 void TextPaintTimingDetector::PopulateTraceValue(
     TracedValue& value,
     const TextRecord& first_text_paint) {
+  // TODO(crbug.com/976893): Remove DOMNodeId.
   value.SetInteger("DOMNodeId", static_cast<int>(first_text_paint.node_id));
-#ifndef NDEBUG
-  value.SetString("text", first_text_paint.text);
-#endif
   value.SetInteger("size", static_cast<int>(first_text_paint.first_size));
   value.SetInteger("candidateIndex", ++count_candidates_);
   value.SetBoolean("isMainFrame", frame_view_->GetFrame().IsMainFrame());
@@ -69,6 +67,8 @@
     const TextRecord& largest_text_record) {
   auto value = std::make_unique<TracedValue>();
   PopulateTraceValue(*value, largest_text_record);
+  // TODO(crbug.com/976894): Check if the event is needed before preparing the
+  // trace value.
   TRACE_EVENT_MARK_WITH_TIMESTAMP2("loading", "LargestTextPaint::Candidate",
                                    largest_text_record.paint_time, "data",
                                    std::move(value), "frame",
@@ -86,6 +86,7 @@
                ToTraceValue(&frame_view_->GetFrame()));
 }
 
+// The timer has guaranteed that |this| exists when this function is invoked.
 void TextPaintTimingDetector::TimerFired(TimerBase* time) {
   // Wrap |UpdateCandidate| method in TimerFired so that we can drop |time| for
   // |UpdateCandidate| in testing.
@@ -93,11 +94,13 @@
 }
 
 void TextPaintTimingDetector::UpdateCandidate() {
-  if (!records_manager_.IsRecordingLargestTextPaint())
+  if (!is_recording_)
+    return;
+  if (!is_recording_ltp_)
     return;
 
   DCHECK(RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled());
-  TextRecord* largest_text_record =
+  base::WeakPtr<TextRecord> largest_text_record =
       records_manager_.FindLargestPaintCandidate();
   const base::TimeTicks time =
       largest_text_record ? largest_text_record->paint_time : base::TimeTicks();
@@ -129,25 +132,24 @@
     if (!timer_.IsActive() && is_recording_ltp_)
       timer_.StartRepeating(kTimerDelay, FROM_HERE);
     if (!awaiting_swap_promise_) {
+      // |WrapCrossThreadWeakPersistent| guarantees that when |this| is killed,
+      // the callback function will not be invoked.
       RegisterNotifySwapTime(
           CrossThreadBindOnce(&TextPaintTimingDetector::ReportSwapTime,
                               WrapCrossThreadWeakPersistent(this)));
     }
   }
-  // Delete unneeded information from |records_manager_| if no longer recording
-  // LargestTextPaint.
-  if (!is_recording_ltp_ && records_manager_.IsRecordingLargestTextPaint())
-    records_manager_.StopRecordingLargestTextPaint();
 }
 
-void TextPaintTimingDetector::NotifyNodeRemoved(DOMNodeId node_id) {
+void TextPaintTimingDetector::LayoutObjectWillBeDestroyed(
+    const LayoutObject& object) {
   if (!is_recording_)
     return;
-  if (records_manager_.IsKnownVisibleNode(node_id)) {
-    records_manager_.RemoveVisibleRecord(node_id);
+  if (records_manager_.IsKnownVisible(object)) {
+    records_manager_.RemoveVisibleRecord(object);
     need_update_timing_at_frame_end_ = true;
-  } else if (records_manager_.IsKnownInvisibleNode(node_id)) {
-    records_manager_.RemoveInvisibleRecord(node_id);
+  } else if (records_manager_.IsKnownInvisible(object)) {
+    records_manager_.RemoveInvisibleRecord(object);
     need_update_timing_at_frame_end_ = true;
   }
 }
@@ -165,6 +167,8 @@
 
 void TextPaintTimingDetector::ReportSwapTime(WebWidgetClient::SwapResult result,
                                              base::TimeTicks timestamp) {
+  if (!is_recording_)
+    return;
   if (!records_manager_.HasTextElementTiming()) {
     Document* document = frame_view_->GetFrame().GetDocument();
     if (document && RuntimeEnabledFeatures::ElementTimingEnabled(document)) {
@@ -199,7 +203,7 @@
     return true;
   // This metric defines the size of a text block by its first size, so we
   // should not walk the object if it has been recorded.
-  return !records_manager_.HasRecorded(node_id);
+  return !records_manager_.HasRecorded(object);
 }
 
 void TextPaintTimingDetector::RecordAggregatedText(
@@ -223,43 +227,39 @@
   uint64_t aggregated_size = mapped_visual_rect.Size().Area();
 
   if (aggregated_size == 0) {
-    records_manager_.RecordInvisibleNode(node_id);
+    records_manager_.RecordInvisibleObject(aggregator);
   } else {
-    records_manager_.RecordVisibleNode(
-        node_id, aggregated_size,
+    records_manager_.RecordVisibleObject(
+        aggregator, aggregated_size,
         TextElementTiming::ComputeIntersectionRect(
             node, aggregated_visual_rect, property_tree_state, frame_view_),
-        aggregator);
+        node_id);
   }
 
   if (records_manager_.HasTooManyNodes()) {
     TRACE_EVENT_INSTANT2("loading", "TextPaintTimingDetector::OverNodeLimit",
                          TRACE_EVENT_SCOPE_THREAD, "count_size_non_zero_nodes",
-                         records_manager_.CountVisibleNodes(),
+                         records_manager_.CountVisibleObjects(),
                          "count_size_zero_nodes",
-                         records_manager_.CountInvisibleNodes());
+                         records_manager_.CountInvisibleObjects());
     StopRecordEntries();
   }
 }
 
-TextRecord* TextPaintTimingDetector::FindLargestPaintCandidate() {
+base::WeakPtr<TextRecord> TextPaintTimingDetector::FindLargestPaintCandidate() {
   return records_manager_.FindLargestPaintCandidate();
 }
 
 void TextPaintTimingDetector::StopRecordEntries() {
   timer_.Stop();
   is_recording_ = false;
+  records_manager_.CleanUp();
 }
 
 void TextPaintTimingDetector::StopRecordingLargestTextPaint() {
-  // This does not immediately call TextRecordsManager's
-  // StopRecordingLargestTextPaint(). However, it stops the timer, and the next
-  // time OnPaintFinished() is called, the TextRecordsManager has the last
-  // chance to update LargestTextPaint (based on elements that had already been
-  // painted), and THEN we call its StopRecordingLargestTextPaint() so that the
-  // LargestTextPaint-only information is cleared.
   timer_.Stop();
   is_recording_ltp_ = false;
+  records_manager_.CleanUpLargestContentfulPaint();
 }
 
 void TextPaintTimingDetector::Trace(blink::Visitor* visitor) {
@@ -269,16 +269,23 @@
 
 TextRecordsManager::TextRecordsManager() : size_ordered_set_(&LargeTextFirst) {}
 
-void TextRecordsManager::RemoveVisibleRecord(const DOMNodeId& node_id) {
-  DCHECK(visible_node_map_.Contains(node_id));
-  size_ordered_set_.erase(visible_node_map_.at(node_id)->AsWeakPtr());
-  visible_node_map_.erase(node_id);
+void TextRecordsManager::RemoveVisibleRecord(const LayoutObject& object) {
+  DCHECK(visible_node_map_.Contains(&object));
+  size_ordered_set_.erase(visible_node_map_.at(&object)->AsWeakPtr());
+  visible_node_map_.erase(&object);
+  // We don't need to remove elements in |texts_queued_for_paint_time_| and
+  // |cached_largest_paint_candidate_| as they are weak ptr.
   is_result_invalidated_ = true;
 }
 
-void TextRecordsManager::RemoveInvisibleRecord(const DOMNodeId& node_id) {
-  DCHECK(invisible_node_ids_.Contains(node_id));
-  invisible_node_ids_.erase(node_id);
+void TextRecordsManager::CleanUpLargestContentfulPaint() {
+  size_ordered_set_.clear();
+  is_result_invalidated_ = true;
+}
+
+void TextRecordsManager::RemoveInvisibleRecord(const LayoutObject& object) {
+  DCHECK(invisible_node_ids_.Contains(&object));
+  invisible_node_ids_.erase(&object);
   is_result_invalidated_ = true;
 }
 
@@ -297,7 +304,6 @@
       texts_queued_for_paint_time_.erase(iterator);
       continue;
     }
-    DCHECK(visible_node_map_.Contains(record->node_id));
     DCHECK_EQ(record->paint_time, base::TimeTicks());
     record->paint_time = timestamp;
   }
@@ -307,29 +313,20 @@
   is_result_invalidated_ = true;
 }
 
-void TextRecordsManager::RecordVisibleNode(const DOMNodeId& node_id,
-                                           const uint64_t& visual_size,
-                                           const FloatRect& element_timing_rect,
-                                           const LayoutObject& text_object) {
+void TextRecordsManager::RecordVisibleObject(
+    const LayoutObject& object,
+    const uint64_t& visual_size,
+    const FloatRect& element_timing_rect,
+    DOMNodeId node_id) {
   DCHECK(!HasTooManyNodes());
   DCHECK_GT(visual_size, 0u);
+
   std::unique_ptr<TextRecord> record =
       std::make_unique<TextRecord>(node_id, visual_size, element_timing_rect);
-#ifndef NDEBUG
-  String text;
-  if (text_object.IsText()) {
-    text = ToLayoutText(&text_object)->GetText();
-  } else if (text_object.IsFileUploadControl()) {
-    text = ToLayoutFileUploadControl(&text_object)->FileTextValue();
-  } else {
-    text = String("NON-TEXT-OBJECT");
-  }
-  record->text = text;
-#endif
   if (is_recording_ltp_)
     size_ordered_set_.emplace(record->AsWeakPtr());
   QueueToMeasurePaintTime(record->AsWeakPtr());
-  visible_node_map_.insert(node_id, std::move(record));
+  visible_node_map_.insert(&object, std::move(record));
   is_result_invalidated_ = true;
 }
 
@@ -338,20 +335,15 @@
          kTextNodeNumberLimit;
 }
 
-TextRecord* TextRecordsManager::FindLargestPaintCandidate() {
-  DCHECK(is_recording_ltp_);
+base::WeakPtr<TextRecord> TextRecordsManager::FindLargestPaintCandidate() {
   DCHECK_EQ(visible_node_map_.size(), size_ordered_set_.size());
-  if (!is_result_invalidated_)
+  if (!is_result_invalidated_ && cached_largest_paint_candidate_)
     return cached_largest_paint_candidate_;
-  TextRecord* new_largest_paint_candidate = nullptr;
-  for (auto it = size_ordered_set_.begin(); it != size_ordered_set_.end();
-       ++it) {
-    // WeakPtr::IsValid() is expensive. We use raw pointer to reduce the checks.
-    TextRecord* text_record = (*it).get();
+  base::WeakPtr<TextRecord> new_largest_paint_candidate = nullptr;
+  for (const auto& text_record : size_ordered_set_) {
     DCHECK(text_record);
     if (text_record->paint_time.is_null())
       continue;
-    DCHECK(visible_node_map_.Contains(text_record->node_id));
     new_largest_paint_candidate = text_record;
     break;
   }
@@ -360,10 +352,11 @@
   return new_largest_paint_candidate;
 }
 
-void TextRecordsManager::StopRecordingLargestTextPaint() {
-  is_recording_ltp_ = false;
-  size_ordered_set_.clear();
-  cached_largest_paint_candidate_ = nullptr;
+void TextRecordsManager::CleanUp() {
+  visible_node_map_.clear();
+  invisible_node_ids_.clear();
+  texts_queued_for_paint_time_.clear();
+  CleanUpLargestContentfulPaint();
 }
 
 void TextRecordsManager::Trace(blink::Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/paint/text_paint_timing_detector.h b/third_party/blink/renderer/core/paint/text_paint_timing_detector.h
index 8eb1af5..5f6d10f 100644
--- a/third_party/blink/renderer/core/paint/text_paint_timing_detector.h
+++ b/third_party/blink/renderer/core/paint/text_paint_timing_detector.h
@@ -40,9 +40,6 @@
   FloatRect element_timing_rect_;
   // The time of the first paint after fully loaded.
   base::TimeTicks paint_time = base::TimeTicks();
-#ifndef NDEBUG
-  String text = "";
-#endif
   DISALLOW_COPY_AND_ASSIGN(TextRecord);
 };
 
@@ -56,40 +53,43 @@
 
  public:
   TextRecordsManager();
-  TextRecord* FindLargestPaintCandidate();
+  base::WeakPtr<TextRecord> FindLargestPaintCandidate();
 
-  void RemoveVisibleRecord(const DOMNodeId&);
-  void RemoveInvisibleRecord(const DOMNodeId&);
-  inline void RecordInvisibleNode(const DOMNodeId& node_id) {
+  void RemoveVisibleRecord(const LayoutObject&);
+  void RemoveInvisibleRecord(const LayoutObject&);
+  inline void RecordInvisibleObject(const LayoutObject& object) {
     DCHECK(!HasTooManyNodes());
-    invisible_node_ids_.insert(node_id);
+    invisible_node_ids_.insert(&object);
   }
-  void RecordVisibleNode(const DOMNodeId&,
-                         const uint64_t& visual_size,
-                         const FloatRect& element_timing_rect,
-                         const LayoutObject&);
+  void RecordVisibleObject(const LayoutObject&,
+                           const uint64_t& visual_size,
+                           const FloatRect& element_timing_rect,
+                           DOMNodeId);
   bool NeedMeausuringPaintTime() const {
     return !texts_queued_for_paint_time_.IsEmpty();
   }
   void AssignPaintTimeToQueuedNodes(const base::TimeTicks&);
 
   bool HasTooManyNodes() const;
-  inline bool HasRecorded(const DOMNodeId& node_id) const {
-    return visible_node_map_.Contains(node_id) ||
-           invisible_node_ids_.Contains(node_id);
+  inline bool HasRecorded(const LayoutObject& object) const {
+    return visible_node_map_.Contains(&object) ||
+           invisible_node_ids_.Contains(&object);
   }
 
-  size_t CountVisibleNodes() const { return visible_node_map_.size(); }
-  size_t CountInvisibleNodes() const { return invisible_node_ids_.size(); }
+  size_t CountVisibleObjects() const { return visible_node_map_.size(); }
+  size_t CountInvisibleObjects() const { return invisible_node_ids_.size(); }
 
-  inline bool IsKnownVisibleNode(const DOMNodeId& node_id) const {
-    return visible_node_map_.Contains(node_id);
+  inline bool IsKnownVisible(const LayoutObject& object) const {
+    return visible_node_map_.Contains(&object);
   }
 
-  inline bool IsKnownInvisibleNode(const DOMNodeId& node_id) const {
-    return invisible_node_ids_.Contains(node_id);
+  inline bool IsKnownInvisible(const LayoutObject& object) const {
+    return invisible_node_ids_.Contains(&object);
   }
 
+  void CleanUp();
+
+  void CleanUpLargestContentfulPaint();
   void StopRecordingLargestTextPaint();
   bool IsRecordingLargestTextPaint() const { return is_recording_ltp_; }
 
@@ -113,14 +113,15 @@
   // Timing.
   bool is_recording_ltp_ =
       RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled();
-  HashMap<DOMNodeId, std::unique_ptr<TextRecord>> visible_node_map_;
-  HashSet<DOMNodeId> invisible_node_ids_;
-  // This is used to order the nodes in |visible_node_map_| so that we can find
-  // the largest node efficiently. Note that the entries in |size_ordered_set_|
-  // and |visible_node_map_| should always be added/deleted together.
+  // Once LayoutObject* is destroyed, |visible_node_map_| and
+  // |invisible_node_ids_| must immediately clear the corresponding record from
+  // themselves.
+  HashMap<const LayoutObject*, std::unique_ptr<TextRecord>> visible_node_map_;
+  HashSet<const LayoutObject*> invisible_node_ids_;
+
   TextRecordSet size_ordered_set_;
   Deque<base::WeakPtr<TextRecord>> texts_queued_for_paint_time_;
-  TextRecord* cached_largest_paint_candidate_;
+  base::WeakPtr<TextRecord> cached_largest_paint_candidate_;
   Member<TextElementTiming> text_element_timing_;
 
   DISALLOW_COPY_AND_ASSIGN(TextRecordsManager);
@@ -156,8 +157,8 @@
                             const IntRect& aggregated_visual_rect,
                             const PropertyTreeState&);
   void OnPaintFinished();
-  void NotifyNodeRemoved(DOMNodeId);
-  TextRecord* FindLargestPaintCandidate();
+  void LayoutObjectWillBeDestroyed(const LayoutObject&);
+  base::WeakPtr<TextRecord> FindLargestPaintCandidate();
   void StopRecordEntries();
   void StopRecordingLargestTextPaint();
   bool IsRecording() const { return is_recording_; }
diff --git a/third_party/blink/renderer/core/paint/text_paint_timing_detector_test.cc b/third_party/blink/renderer/core/paint/text_paint_timing_detector_test.cc
index 14c45e9..ee2b8cf 100644
--- a/third_party/blink/renderer/core/paint/text_paint_timing_detector_test.cc
+++ b/third_party/blink/renderer/core/paint/text_paint_timing_detector_test.cc
@@ -42,16 +42,17 @@
 
   LocalFrameView& GetChildFrameView() { return *ChildFrame().View(); }
 
-  unsigned CountVisibleTexts() {
-    if (!GetPaintTimingDetector().GetTextPaintTimingDetector())
-      return 0u;
+  TextPaintTimingDetector* GetTextPaintTimingDetector() {
+    return GetPaintTimingDetector().GetTextPaintTimingDetector();
+  }
 
-    return GetPaintTimingDetector()
-        .GetTextPaintTimingDetector()
+  wtf_size_t CountVisibleTexts() {
+    DCHECK(GetTextPaintTimingDetector());
+    return GetTextPaintTimingDetector()
         ->records_manager_.visible_node_map_.size();
   }
 
-  unsigned CountRankingSetSize() {
+  wtf_size_t CountRankingSetSize() {
     return GetPaintTimingDetector()
         .GetTextPaintTimingDetector()
         ->records_manager_.size_ordered_set_.size();
@@ -118,14 +119,14 @@
     return div;
   }
 
-  TextRecord* TextRecordOfLargestTextPaint() {
+  base::WeakPtr<TextRecord> TextRecordOfLargestTextPaint() {
     return GetFrameView()
         .GetPaintTimingDetector()
         .GetTextPaintTimingDetector()
         ->FindLargestPaintCandidate();
   }
 
-  TextRecord* ChildFrameTextRecordOfLargestTextPaint() {
+  base::WeakPtr<TextRecord> ChildFrameTextRecordOfLargestTextPaint() {
     return GetChildFrameView()
         .GetPaintTimingDetector()
         .GetTextPaintTimingDetector()
@@ -292,7 +293,7 @@
                      AtomicString("position:fixed;left:30px"));
   UpdateAllLifecyclePhasesAndSimulateSwapTime();
   AdvanceClock(base::TimeDelta::FromSecondsD(1));
-  TextRecord* record = TextRecordOfLargestTextPaint();
+  base::WeakPtr<TextRecord> record = TextRecordOfLargestTextPaint();
   EXPECT_TRUE(record);
   EXPECT_EQ(record->paint_time, start_time + base::TimeDelta::FromSecondsD(1));
 }
@@ -438,11 +439,7 @@
   AppendDivElementToBody(WTF::String::Number(5000));
   UpdateAllLifecyclePhasesAndSimulateSwapTime();
   // Reached limit, so stopped recording and now should have 0 texts.
-  EXPECT_EQ(CountVisibleTexts(), 0u);
-
-  AppendDivElementToBody(WTF::String::Number(5001));
-  UpdateAllLifecyclePhasesAndSimulateSwapTime();
-  EXPECT_EQ(CountVisibleTexts(), 0u);
+  EXPECT_FALSE(GetTextPaintTimingDetector());
 }
 
 // This is for comparison with the ClippedByViewport test.
@@ -522,7 +519,7 @@
   UpdateAllLifecyclePhasesForTest();
   EXPECT_EQ(CountPendingSwapTime(GetChildFrameView()), 1u);
   ChildFrameSwapTimeCallBack();
-  TextRecord* text = ChildFrameTextRecordOfLargestTextPaint();
+  base::WeakPtr<TextRecord> text = ChildFrameTextRecordOfLargestTextPaint();
   EXPECT_TRUE(text);
 }
 
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
index 3aaaf33..2e67eea6 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -2455,13 +2455,6 @@
   if (GetNode() && IsHTMLMapElement(GetNode()))
     return false;  // Does not have a role, so check here
 
-  // Placeholder gets exposed as an attribute on the input accessibility node,
-  // so there's no need to add its text children.
-  if (GetElement() && GetElement()->ShadowPseudoId() ==
-                          AtomicString("-webkit-input-placeholder")) {
-    return false;
-  }
-
   switch (native_role_) {
     case ax::mojom::Role::kButton:
     case ax::mojom::Role::kCheckBox:
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.cc b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.cc
index d6948d4b..2e69085 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.cc
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.cc
@@ -33,16 +33,21 @@
     "Picture-in-Picture.";
 const char kDisablePictureInPicturePresent[] =
     "\"disablePictureInPicture\" attribute is present.";
+const char kInvalidSize[] =
+    "The width and height attributes must be greater "
+    "than zero.";
+
 }  // namespace
 
 // static
 ScriptPromise HTMLElementPictureInPicture::requestPictureInPicture(
     ScriptState* script_state,
     HTMLElement& element,
-    PictureInPictureOptions* options) {
-  DOMException* exception = CheckIfPictureInPictureIsAllowed(element);
-  if (exception)
-    return ScriptPromise::RejectWithDOMException(script_state, exception);
+    PictureInPictureOptions* options,
+    ExceptionState& exception_state) {
+  CheckIfPictureInPictureIsAllowed(element, options, exception_state);
+  if (exception_state.HadException())
+    return ScriptPromise();
 
   auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
   auto promise = resolver->Promise();
@@ -54,32 +59,41 @@
 }
 
 // static
-DOMException* HTMLElementPictureInPicture::CheckIfPictureInPictureIsAllowed(
-    HTMLElement& element) {
+void HTMLElementPictureInPicture::CheckIfPictureInPictureIsAllowed(
+    HTMLElement& element,
+    PictureInPictureOptions* options,
+    ExceptionState& exception_state) {
   Document& document = element.GetDocument();
   PictureInPictureControllerImpl& controller =
       PictureInPictureControllerImpl::From(document);
 
-  switch (controller.IsElementAllowed(element)) {
+  switch (controller.VerifyElementAndOptions(element, options)) {
     case Status::kFrameDetached:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kInvalidStateError, kDetachedError);
+      exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
+                                        kDetachedError);
+      return;
     case Status::kMetadataNotLoaded:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kInvalidStateError, kMetadataNotLoadedError);
+      exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
+                                        kMetadataNotLoadedError);
+      return;
     case Status::kVideoTrackNotAvailable:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kInvalidStateError, kVideoTrackNotAvailableError);
+      exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
+                                        kVideoTrackNotAvailableError);
+      return;
     case Status::kDisabledByFeaturePolicy:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kSecurityError, kFeaturePolicyBlocked);
+      exception_state.ThrowSecurityError(kFeaturePolicyBlocked);
+      return;
     case Status::kDisabledByAttribute:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kInvalidStateError,
-          kDisablePictureInPicturePresent);
+      exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
+                                        kDisablePictureInPicturePresent);
+      return;
     case Status::kDisabledBySystem:
-      return MakeGarbageCollected<DOMException>(
-          DOMExceptionCode::kNotSupportedError, kNotAvailable);
+      exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
+                                        kNotAvailable);
+      return;
+    case Status::kInvalidWidthOrHeightOption:
+      exception_state.ThrowTypeError(kInvalidSize);
+      return;
     case Status::kEnabled:
       break;
   }
@@ -90,11 +104,9 @@
   DCHECK(frame);
   if (!controller.PictureInPictureElement() &&
       !LocalFrame::ConsumeTransientUserActivation(frame)) {
-    return MakeGarbageCollected<DOMException>(
-        DOMExceptionCode::kNotAllowedError, kUserGestureRequired);
+    exception_state.ThrowDOMException(DOMExceptionCode::kNotAllowedError,
+                                      kUserGestureRequired);
   }
-
-  return nullptr;
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.h b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.h
index 51f58faf..0dc7be6 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.h
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.h
@@ -9,7 +9,7 @@
 
 namespace blink {
 
-class DOMException;
+class ExceptionState;
 class HTMLElement;
 class PictureInPictureOptions;
 class ScriptPromise;
@@ -19,12 +19,14 @@
   STATIC_ONLY(HTMLElementPictureInPicture);
 
  public:
-  static ScriptPromise requestPictureInPicture(
-      ScriptState*,
-      HTMLElement&,
-      PictureInPictureOptions* options);
+  static ScriptPromise requestPictureInPicture(ScriptState*,
+                                               HTMLElement&,
+                                               PictureInPictureOptions*,
+                                               ExceptionState&);
 
-  static DOMException* CheckIfPictureInPictureIsAllowed(HTMLElement&);
+  static void CheckIfPictureInPictureIsAllowed(HTMLElement&,
+                                               PictureInPictureOptions*,
+                                               ExceptionState&);
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.idl b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.idl
index b9ee532..be8608c 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.idl
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_element_picture_in_picture.idl
@@ -8,5 +8,5 @@
     RuntimeEnabled=PictureInPictureV2
 ]
 partial interface HTMLElement {
-    [CallWith=ScriptState, NewObject] Promise<PictureInPictureWindow> requestPictureInPicture(PictureInPictureOptions options);
+    [CallWith=ScriptState, NewObject, RaisesException] Promise<PictureInPictureWindow> requestPictureInPicture(optional PictureInPictureOptions options);
 };
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.cc b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.cc
index 1286f28..7765509 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.cc
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.cc
@@ -18,11 +18,12 @@
 // static
 ScriptPromise HTMLVideoElementPictureInPicture::requestPictureInPicture(
     ScriptState* script_state,
-    HTMLVideoElement& element) {
-  DOMException* exception =
-      HTMLElementPictureInPicture::CheckIfPictureInPictureIsAllowed(element);
-  if (exception)
-    return ScriptPromise::RejectWithDOMException(script_state, exception);
+    HTMLVideoElement& element,
+    ExceptionState& exception_state) {
+  HTMLElementPictureInPicture::CheckIfPictureInPictureIsAllowed(
+      element, nullptr /* options */, exception_state);
+  if (exception_state.HadException())
+    return ScriptPromise();
 
   auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
   auto promise = resolver->Promise();
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.h b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.h
index 53a8a02..ff574126 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.h
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.h
@@ -10,6 +10,7 @@
 
 namespace blink {
 
+class ExceptionState;
 class HTMLVideoElement;
 class ScriptPromise;
 class ScriptState;
@@ -18,7 +19,9 @@
   STATIC_ONLY(HTMLVideoElementPictureInPicture);
 
  public:
-  static ScriptPromise requestPictureInPicture(ScriptState*, HTMLVideoElement&);
+  static ScriptPromise requestPictureInPicture(ScriptState*,
+                                               HTMLVideoElement&,
+                                               ExceptionState&);
 
   static bool FastHasAttribute(const QualifiedName&, const HTMLVideoElement&);
 
diff --git a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.idl b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.idl
index 015f00b..3ce3ff49 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.idl
+++ b/third_party/blink/renderer/modules/picture_in_picture/html_video_element_picture_in_picture.idl
@@ -7,7 +7,7 @@
     ImplementedAs=HTMLVideoElementPictureInPicture
 ]
 partial interface HTMLVideoElement {
-    [RuntimeEnabled=PictureInPictureAPI, CallWith=ScriptState, Measure, NewObject] Promise<PictureInPictureWindow> requestPictureInPicture();
+    [RuntimeEnabled=PictureInPictureAPI, CallWith=ScriptState, Measure, NewObject, RaisesException] Promise<PictureInPictureWindow> requestPictureInPicture();
 
     [RuntimeEnabled=PictureInPictureAPI] attribute EventHandler onenterpictureinpicture;
     [RuntimeEnabled=PictureInPictureAPI] attribute EventHandler onleavepictureinpicture;
diff --git a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
index 21bb58d3..2767a28 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
+++ b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
@@ -19,6 +19,7 @@
 #include "third_party/blink/renderer/core/html/media/html_media_element.h"
 #include "third_party/blink/renderer/core/html/media/html_video_element.h"
 #include "third_party/blink/renderer/modules/picture_in_picture/enter_picture_in_picture_event.h"
+#include "third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_options.h"
 #include "third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_window.h"
 #include "third_party/blink/renderer/platform/heap/heap.h"
 #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -87,6 +88,25 @@
 }
 
 PictureInPictureController::Status
+PictureInPictureControllerImpl::VerifyElementAndOptions(
+    const HTMLElement& element,
+    const PictureInPictureOptions* options) const {
+  if (!IsVideoElement(element) && options) {
+    // If either the width or height is present then we should make sure they
+    // are both present and valid.
+    if (options->hasWidth() || options->hasHeight()) {
+      if (!options->hasWidth() || options->width() <= 0)
+        return Status::kInvalidWidthOrHeightOption;
+
+      if (!options->hasHeight() || options->height() <= 0)
+        return Status::kInvalidWidthOrHeightOption;
+    }
+  }
+
+  return IsElementAllowed(element);
+}
+
+PictureInPictureController::Status
 PictureInPictureControllerImpl::IsElementAllowed(
     const HTMLElement& element) const {
   PictureInPictureController::Status status = IsDocumentAllowed();
diff --git a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h
index 94bd45c4..f48b7a183 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h
+++ b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h
@@ -55,6 +55,11 @@
   // request Picture-in-Picture.
   Status IsDocumentAllowed() const;
 
+  // Returns whether the combination of element and options can be in
+  // Picture-in-Picture.
+  Status VerifyElementAndOptions(const HTMLElement&,
+                                 const PictureInPictureOptions*) const;
+
   // Returns element currently in Picture-in-Picture if any. Null otherwise.
   Element* PictureInPictureElement() const;
   Element* PictureInPictureElement(TreeScope&) const;
diff --git a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_options.idl b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_options.idl
index 8f3f7bf9..3aba5a1 100644
--- a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_options.idl
+++ b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_options.idl
@@ -4,6 +4,7 @@
 
 // https://wicg.github.io/picture-in-picture/v2/
 dictionary PictureInPictureOptions {
-  required double aspectRatio;
+  long height;
+  long width;
   boolean interactive = false;
 };
diff --git a/third_party/blink/renderer/modules/plugins/mime_type.idl b/third_party/blink/renderer/modules/plugins/mime_type.idl
index 213765e..bec65da53 100644
--- a/third_party/blink/renderer/modules/plugins/mime_type.idl
+++ b/third_party/blink/renderer/modules/plugins/mime_type.idl
@@ -18,7 +18,10 @@
     Boston, MA 02110-1301, USA.
 */
 
+// https://html.spec.whatwg.org/multipage/system-state.html#mimetype
+
 [
+    Exposed=Window,
     ImplementedAs=DOMMimeType
 ] interface MimeType {
     readonly attribute DOMString type;
diff --git a/third_party/blink/renderer/modules/plugins/mime_type_array.idl b/third_party/blink/renderer/modules/plugins/mime_type_array.idl
index 1a59dcf..58523084 100644
--- a/third_party/blink/renderer/modules/plugins/mime_type_array.idl
+++ b/third_party/blink/renderer/modules/plugins/mime_type_array.idl
@@ -18,7 +18,10 @@
     Boston, MA 02110-1301, USA.
 */
 
+// https://html.spec.whatwg.org/multipage/system-state.html#mimetypearray
+
 [
+    Exposed=Window,
     ImplementedAs=DOMMimeTypeArray,
     LegacyUnenumerableNamedProperties
 ] interface MimeTypeArray {
diff --git a/third_party/blink/renderer/modules/plugins/plugin.idl b/third_party/blink/renderer/modules/plugins/plugin.idl
index 2a1be74d..f80fcf6 100644
--- a/third_party/blink/renderer/modules/plugins/plugin.idl
+++ b/third_party/blink/renderer/modules/plugins/plugin.idl
@@ -18,9 +18,10 @@
     Boston, MA 02110-1301, USA.
 */
 
-// https://html.spec.whatwg.org/C/#plugins-2
+// https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin
 
 [
+    Exposed=Window,
     ImplementedAs=DOMPlugin,
     LegacyUnenumerableNamedProperties
 ] interface Plugin {
diff --git a/third_party/blink/renderer/modules/plugins/plugin_array.idl b/third_party/blink/renderer/modules/plugins/plugin_array.idl
index 9e123be..f302db4 100644
--- a/third_party/blink/renderer/modules/plugins/plugin_array.idl
+++ b/third_party/blink/renderer/modules/plugins/plugin_array.idl
@@ -18,9 +18,10 @@
     Boston, MA 02110-1301, USA.
 */
 
-// https://html.spec.whatwg.org/C/#plugins-2
+// https://html.spec.whatwg.org/multipage/system-state.html#pluginarray
 
 [
+    Exposed=Window,
     ImplementedAs=DOMPluginArray,
     LegacyUnenumerableNamedProperties
 ] interface PluginArray {
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
index fe94acc..213632e 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -491,7 +491,7 @@
   bool SupportsDirectCompositing() const override { return true; }
   bool SupportsSingleBuffering() const override { return false; }
   GLuint GetBackingTextureHandleForOverwrite() override {
-    if (!ContextProviderWrapper())
+    if (IsGpuContextLost())
       return 0u;
 
     FlushGrContext();
@@ -501,6 +501,9 @@
 
   scoped_refptr<CanvasResource> CreateResource() final {
     TRACE_EVENT0("blink", "CanvasResourceProviderSharedImage::CreateResource");
+    if (IsGpuContextLost())
+      return nullptr;
+
     return CanvasResourceSharedImage::Create(
         Size(), ContextProviderWrapper(), CreateWeakPtr(), FilterQuality(),
         ColorParams(), is_overlay_candidate_, is_origin_top_left_);
@@ -521,6 +524,9 @@
   scoped_refptr<CanvasResource> ProduceCanvasResource() override {
     TRACE_EVENT0("blink",
                  "CanvasResourceProviderSharedImage::ProduceCanvasResource");
+    if (IsGpuContextLost())
+      return nullptr;
+
     // Its important to end read access and ref the resource before the WillDraw
     // call below. Since it relies on resource ref-count to trigger
     // copy-on-write and asserts that we only have write access when the
@@ -544,6 +550,9 @@
 
   scoped_refptr<StaticBitmapImage> Snapshot() override {
     TRACE_EVENT0("blink", "CanvasResourceProviderSharedImage::Snapshot");
+    if (IsGpuContextLost())
+      return nullptr;
+
     EndWriteAccess();
     return resource_->Bitmap();
   }
@@ -551,7 +560,7 @@
   void WillDraw() override {
     DCHECK(resource_);
 
-    if (!ContextProviderWrapper())
+    if (IsGpuContextLost())
       return;
 
     // If |resource_| is still being used by the compositor we need to create
@@ -619,6 +628,8 @@
     // only perform a GrContext flush if that SkSurface has any pending ops. And
     // this resource may be written to or read from skia without using the
     // SkSurface here.
+    if (IsGpuContextLost())
+      return;
     GetGrContext()->flush();
   }
 
@@ -629,7 +640,7 @@
     DCHECK(!resource()->is_cross_thread())
         << "Write access is only allowed on the owning thread";
 
-    if (current_resource_has_write_access_ || !ContextProviderWrapper())
+    if (current_resource_has_write_access_ || IsGpuContextLost())
       return;
 
     auto texture_id = resource()->GetTextureIdForBackendTexture();
@@ -641,7 +652,7 @@
   void EndWriteAccess() {
     DCHECK(!resource()->is_cross_thread());
 
-    if (!current_resource_has_write_access_ || !ContextProviderWrapper())
+    if (!current_resource_has_write_access_ || IsGpuContextLost())
       return;
 
     // Issue any skia work using this resource before releasing write access.
@@ -920,6 +931,12 @@
             size, color_params, context_provider_wrapper, resource_dispatcher);
         break;
       case CanvasResourceType::kSharedImage: {
+        if (usage == kAcceleratedDirect2DResourceUsage ||
+            usage == kAcceleratedDirect3DResourceUsage) {
+          // Shared images don't work for single buffered canvas yet.
+          continue;
+        }
+
         // TODO(khushalsagar): Also kAcceleratedDirect2DResourceUsage when we
         // switch it to use shared images.
         const bool is_overlay_candidate =
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 07b3e4e..a9e2ac29 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -835,12 +835,14 @@
     },
     {
       name: "LazyFrameLoading",
+      status: "experimental",
     },
     {
       name: "LazyFrameVisibleLoadTimeMetrics",
     },
     {
       name: "LazyImageLoading",
+      status: "experimental",
     },
     {
       name: "LazyImageVisibleLoadTimeMetrics",
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 9ce2a75..7eb3050 100644
--- a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
+++ b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
@@ -29,6 +29,7 @@
 Bug(none) virtual/android/fullscreen/video-overlay-scroll.html [ Failure ]
 Bug(none) virtual/android/rootscroller/nested-rootscroller-browser-controls-bounds-hidden.html [ Crash ]
 Bug(none) virtual/android/rootscroller/nested-rootscroller-browser-controls-bounds-shown.html [ Crash ]
+Bug(none) virtual/android/url-bar/bottom-and-top-fixed-sticks-to-top.html [ Crash ]
 Bug(none) virtual/android/url-bar/bottom-fixed-adjusted-when-showing-url-bar.html [ Crash ]
 
 Bug(none) compositing/animation/hidden-composited.html [ Failure ]
@@ -122,6 +123,7 @@
 Bug(none) fast/css/outline-offset-large.html [ Failure ]
 Bug(none) fast/forms/validation-bubble-device-emulation-change.html [ Failure ]
 Bug(none) fast/webgl/pixelated.html [ Failure ]
+Bug(none) ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling.htm [ Failure ]
 Bug(none) images/color-profile-svg-foreign-object.html [ Failure ]
 Bug(none) fast/multicol/insane-column-count-and-padding-nested-crash.html [ Crash ]
 Bug(none) fast/sub-pixel/should-not-repaint-subpixel-composited-layer.html [ Failure ]
@@ -159,6 +161,10 @@
 Bug(none) paint/invalidation/scroll/scrollbar-ancestor-clip-change.html [ Failure ]
 Bug(none) paint/invalidation/svg/resize-svg-invalidate-children-2.html [ Failure ]
 
+# Under-invalidation
+Bug(none) fast/events/touch/touch-rect-crash-on-unpromote-layer.html [ Crash ]
+Bug(none) paint/background/scrolling-background-with-negative-z-child.html [ Crash ]
+
 # "Missing" raster invalidation because composited layers are re-created.
 crbug.com/842356 paint/invalidation/compositing/containing-block-added-individual.html [ Failure ]
 crbug.com/842356 paint/invalidation/compositing/containing-block-added.html [ Failure ]
@@ -504,6 +510,7 @@
 crbug.com/962191 external/wpt/css/css-easing/step-timing-functions-output.html [ Crash ]
 crbug.com/962191 external/wpt/css/css-logical/animation-001.html [ Crash ]
 crbug.com/962191 external/wpt/css/css-transitions/KeyframeEffect-target.tentative.html [ Crash ]
+crbug.com/962191 external/wpt/scroll-animations/scroll-animation.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/animation-types/addition-per-property.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/animation-types/discrete.html [ Crash ]
@@ -515,11 +522,14 @@
 crbug.com/962191 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html [ Crash ]
+crbug.com/966981 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Animatable/animate.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Animatable/getAnimations.html [ Crash ]
+crbug.com/966981 external/wpt/web-animations/interfaces/Animation/commitStyles.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Animation/finished.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Animation/id.html [ Crash ]
+crbug.com/966981 external/wpt/web-animations/interfaces/Animation/persist.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Animation/ready.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/AnimationEffect/updateTiming.html [ Crash ]
 crbug.com/962191 external/wpt/web-animations/interfaces/Document/getAnimations.html [ Crash ]
@@ -554,63 +564,51 @@
 crbug.com/962191 virtual/threaded/transitions/svg-transitions.html [ Crash ]
 
 # These failures need to be triaged and are being added to unblock the CQ (see: https://crbug.com/966981).
-crbug.com/966981 compositing/opacity-with-mask.html [ Skip ]
-crbug.com/966981 compositing/images/direct-image-clip-path.html [ Skip ]
-crbug.com/966981 compositing/images/direct-image-dynamic-clip-path.html [ Skip ]
-crbug.com/966981 compositing/overflow/border-radius-composited-subframe.html [ Skip ]
-crbug.com/966981 compositing/overflow/nested-border-radius-clipping.html [ Skip ]
-crbug.com/966981 compositing/overflow/relpos-under-abspos-border-radius.html [ Skip ]
-crbug.com/966981 external/wpt/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations.html [ Skip ]
-crbug.com/966981 external/wpt/web-animations/interfaces/Animation/commitStyles.html [ Skip ]
-crbug.com/966981 external/wpt/web-animations/interfaces/Animation/persist.html [ Skip ]
-crbug.com/966981 fast/borders/border-radius-mask-canvas-all.html [ Skip ]
-crbug.com/966981 fast/borders/border-radius-mask-canvas-padding.html [ Skip ]
-crbug.com/966981 fast/borders/border-radius-mask-canvas-with-mask.html [ Skip ]
-crbug.com/966981 fast/borders/border-radius-mask-canvas-with-shadow.html [ Skip ]
-crbug.com/966981 fast/borders/border-radius-with-composited-child.html [ Skip ]
-crbug.com/966981 paint/clipath/clip-path-with-background-and-box-behind.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/fractional-scroll-offset-document.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/hover-during-scroll.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/no-hover-during-scroll.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scrolled-document.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller-scrolled-document.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-root-scroller.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-scrolled-absolute-scroller.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-scrolled-position-fixed-scroller.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/overflow-scrollability.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/reset-scroll-in-onscroll.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/scroll-non-composited-scroller.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/scroll-then-composite.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-document.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-scrolled-element.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-window.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-document.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-scrolled-element.html [ Skip ]
-crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-window.html [ Skip ]
-crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-disabled-frame-no-scroll-manual.tentative.html [ Skip ]
-crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html [ Skip ]
-crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-touch-action-manual.tentative.html [ Skip ]
-crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-touch-block-manual.tentative.html [ Skip ]
-crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-wheel-block-manual.tentative.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/events/pinch/gesture-pinch-zoom-scroll-bubble.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/events/pinch/pinch-zoom-pan-position-fixed.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scroll-behavior/overscroll-behavior.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scroll-behavior/smooth-scroll/scroll-during-selection.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/fractional-scroll-offset-document.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/hover-during-scroll.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/no-hover-during-scroll.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scrolled-document.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller-scrolled-document.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-root-scroller.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/reset-scroll-in-onscroll.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/scroll-non-composited-scroller.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/scroll-then-composite.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-document.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-scrolled-element.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-window.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-document.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-scrolled-element.html [ Skip ]
-crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-window.html [ Skip ]
-crbug.com/966981 virtual/threaded/synthetic_gestures/animated-wheel-tiny-delta.html [ Skip ]
+crbug.com/966981 compositing/images/direct-image-clip-path.html [ Failure ]
+crbug.com/966981 compositing/images/direct-image-dynamic-clip-path.html [ Failure ]
+crbug.com/966981 paint/clipath/clip-path-with-background-and-box-behind.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/fractional-scroll-offset-document.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/hover-during-scroll.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/no-hover-during-scroll.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scrolled-document.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller-scrolled-document.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-root-scroller.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-scrolled-absolute-scroller.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/non-composited-scroller-in-scrolled-position-fixed-scroller.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/overflow-scrollability.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/reset-scroll-in-onscroll.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/scroll-non-composited-scroller.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/scroll-then-composite.html [ Failure ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-document.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-scrolled-element.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/overscroll-event-fired-to-window.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-document.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-scrolled-element.html [ Timeout ]
+crbug.com/966981 virtual/fractional_scrolling_threaded/fast/scrolling/events/scrollend-event-fired-to-window.html [ Timeout ]
+crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-disabled-frame-no-scroll-manual.tentative.html [ Failure ]
+crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-main-frame-manual.tentative.html [ Failure ]
+crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-touch-action-manual.tentative.html [ Failure ]
+crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-touch-block-manual.tentative.html [ Failure ]
+crbug.com/966981 virtual/threaded/external/wpt/feature-policy/experimental-features/vertical-scroll-wheel-block-manual.tentative.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/events/pinch/gesture-pinch-zoom-scroll-bubble.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/events/pinch/pinch-zoom-pan-position-fixed.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scroll-behavior/overscroll-behavior.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scroll-behavior/smooth-scroll/scroll-during-selection.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/fractional-scroll-offset-document.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/hover-during-scroll.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/no-hover-during-scroll.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scrolled-document.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller-scrolled-document.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-position-fixed-scroller.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/non-composited-scroller-in-root-scroller.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/reset-scroll-in-onscroll.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/scroll-non-composited-scroller.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/scroll-then-composite.html [ Failure ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-document.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-scrolled-element.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/overscroll-event-fired-to-window.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-document.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-scrolled-element.html [ Timeout ]
+crbug.com/966981 virtual/threaded/fast/scrolling/events/scrollend-event-fired-to-window.html [ Timeout ]
+crbug.com/966981 virtual/threaded/synthetic_gestures/animated-wheel-tiny-delta.html [ Failure ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
index 09a92c4c..abec1732 100644
--- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
+++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
@@ -448038,7 +448038,7 @@
    "testharness"
   ],
   "page-visibility/onvisibilitychange.html": [
-   "054e8c76c868b7c4d75c598d62511a3b99d44095",
+   "f8540842805ac9078da4e4c68ef2209a082eab83",
    "testharness"
   ],
   "page-visibility/prerender_call-expected.txt": [
@@ -448106,7 +448106,7 @@
    "testharness"
   ],
   "page-visibility/unload.html": [
-   "48cf203cdeca2b54bfdd14cb5fa1107378c0ac7a",
+   "9b7dcb8c66c5724806d6bc8241561b28dc3f4a71",
    "testharness"
   ],
   "paint-timing/META.yml": [
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-aspect-ratio-img-column-005.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-aspect-ratio-img-column-005.html
new file mode 100644
index 0000000..0bd7ef8b
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-aspect-ratio-img-column-005.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<link rel="author" title="Google LLC" href="http://www.google.com" />
+<link rel="help" href="https://drafts.csswg.org/css-flexbox/#line-sizing" />
+<title>css-flexbox: Tests that we use the aspect ratio, clamped by min/max, to compute the main size</title>
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
+
+<style>
+.flex {
+  display: flex;
+  width: 100px;
+  flex-direction: column;
+}
+
+img {
+  max-width: 100%;
+  width: 500px;
+  min-height: 0;
+}
+</style>
+
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+
+<div class="flex">
+      <img src="support/100x100-green.png">
+</div>
+
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol-ref.html b/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol-ref.html
new file mode 100644
index 0000000..ebd2d86
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background: green"></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol.html b/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol.html
new file mode 100644
index 0000000..a47ed89
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/composited-under-clip-under-multicol.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css-multicol">
+<link rel="match" href="composited-under-clip-under-multicol-ref.html">
+<meta name="assert" content="Test that clip under multicol is correctly applied on composited child">
+<style>
+.columns {
+  columns: 2;
+  column-gap: 20px;
+  width: 220px;
+  height: 100px;
+}
+.clip {
+  height: 100px;
+  overflow: hidden;
+}
+.composited {
+  will-change: transform;
+  margin-top: -20px;
+  margin-left: -20px;
+  border: 20px solid red;
+  width: 200px;
+  height: 200px;
+  background: green;
+}
+</style>
+<div class="columns">
+  <div class="clip">
+    <div class="composited"></div>
+  </div>
+  <div class="clip"></div>
+</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-sizing/min-max-content-orthogonal-flow-crash-001.html b/third_party/blink/web_tests/external/wpt/css/css-sizing/min-max-content-orthogonal-flow-crash-001.html
new file mode 100644
index 0000000..d2617f8
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-sizing/min-max-content-orthogonal-flow-crash-001.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>CSS Test: Check computing min-/max-content does not cause crash</title>
+<link rel="help" href="https://crbug.com/976859">
+<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#sizing-values">
+<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+body {
+  width: fit-content;
+}
+#target {
+  display: block;
+  writing-mode: vertical-lr;
+  columns: 2;
+}
+.after #target {
+  float: left;
+}
+</style>
+<body>
+  <div id="target"></div>
+<script>
+test(() => {
+  const body = document.body;
+  body.offsetTop;
+  body.classList.add("after");
+});
+</script>
+</body>
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl b/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl
index 95210c0..565eab7 100644
--- a/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl
+++ b/third_party/blink/web_tests/external/wpt/interfaces/mediasession.idl
@@ -23,9 +23,10 @@
   "nexttrack",
   "skipad",
   "stop",
+  "seekto"
 };
 
-callback MediaSessionActionHandler = void();
+callback MediaSessionActionHandler = void(MediaSessionActionDetails details);
 
 [Exposed=Window]
 interface MediaSession {
@@ -64,3 +65,16 @@
   double playbackRate = 1.0;
   double position = 0.0;
 };
+
+dictionary MediaSessionActionDetails {
+  required MediaSessionAction action;
+};
+
+dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails {
+  double? seekOffset;
+};
+
+dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails {
+  required double seekTime;
+  bool? fastSeek;
+};
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl b/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl
index b18d4ac2..c7bb45d 100644
--- a/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl
+++ b/third_party/blink/web_tests/external/wpt/interfaces/webrtc.idl
@@ -466,6 +466,7 @@
 };
 
 enum RTCIceRole {
+    "unknown",
     "controlling",
     "controlled"
 };
diff --git a/third_party/blink/web_tests/external/wpt/portals/portal-activate-data.html b/third_party/blink/web_tests/external/wpt/portals/portal-activate-data.html
index 6010fe6..057ecbf 100644
--- a/third_party/blink/web_tests/external/wpt/portals/portal-activate-data.html
+++ b/third_party/blink/web_tests/external/wpt/portals/portal-activate-data.html
@@ -12,7 +12,6 @@
 }
 
 async function openPortalAndActivate(logic, activateOptions) {
-  const bc = new BroadcastChannel('portal-activate-data');
   const w = window.open();
   try {
     const portal = w.document.createElement('portal');
@@ -23,7 +22,6 @@
     return (await nextMessage(w.portalHost)).data;
   } finally {
     w.close();
-    bc.close();
   }
 }
 
diff --git a/third_party/blink/web_tests/fast/multicol/overflow-unsplittable-expected.html b/third_party/blink/web_tests/fast/multicol/overflow-unsplittable-expected.html
index e5d51fd..2370277 100644
--- a/third_party/blink/web_tests/fast/multicol/overflow-unsplittable-expected.html
+++ b/third_party/blink/web_tests/fast/multicol/overflow-unsplittable-expected.html
@@ -1,21 +1,21 @@
 <!DOCTYPE html>
 <p>Test that a scrollable container isn't split across multiple columns.</p>
-<p>There should be three columns below. The first one should contain "line1". The second one should
-    contain "line2", "line3", "line4" and a vertical scrollbar. The third one should contain
-    "line5". No red should be seen</p>
-<div style="width:32em; line-height:2em;">
+<p>There should be three columns below. The first one should contain "LINE1". The second one should
+    contain "LINE2", "LINE3", "LINE4" and a vertical scrollbar. The third one should contain
+    "LINE5". No red should be seen</p>
+<div style="width:32em; LINE-height:2em;">
     <div style="float:left; width:11em;">
-        line1<br>
+        LINE1<br>
     </div>
     <div style="float:left; width:11em;">
         <div style="overflow:auto; width:10em; height:6em;">
-            line2<br>
-            line3<br>
-            line4<br>
+            LINE2<br>
+            LINE3<br>
+            LINE4<br>
             <span style="color:red;">FAIL</span>
         </div>
     </div>
     <div style="float:left;">
-        line5<br>
+        LINE5<br>
     </div>
 </div>
diff --git a/third_party/blink/web_tests/fast/multicol/overflow-unsplittable.html b/third_party/blink/web_tests/fast/multicol/overflow-unsplittable.html
index 7f64cdf..74c7054 100644
--- a/third_party/blink/web_tests/fast/multicol/overflow-unsplittable.html
+++ b/third_party/blink/web_tests/fast/multicol/overflow-unsplittable.html
@@ -1,15 +1,15 @@
 <!DOCTYPE html>
 <p>Test that a scrollable container isn't split across multiple columns.</p>
-<p>There should be three columns below. The first one should contain "line1". The second one should
-    contain "line2", "line3", "line4" and a vertical scrollbar. The third one should contain
-    "line5". No red should be seen</p>
-<div style="-webkit-columns:3; -webkit-column-gap:1em; width:32em; line-height:2em;">
-    line1<br>
+<p>There should be three columns below. The first one should contain "LINE1". The second one should
+    contain "LINE2", "LINE3", "LINE4" and a vertical scrollbar. The third one should contain
+    "LINE5". No red should be seen</p>
+<div style="-webkit-columns:3; -webkit-column-gap:1em; width:32em; LINE-height:2em;">
+    LINE1<br>
     <div style="overflow:auto; height:6em;">
-        line2<br>
-        line3<br>
-        line4<br>
+        LINE2<br>
+        LINE3<br>
+        LINE4<br>
         <span style="color:red;">FAIL</span>
     </div>
-    line5<br>
+    LINE5<br>
 </div>
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/animations/rotate-transform-equivalent-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/animations/rotate-transform-equivalent-expected.png
new file mode 100644
index 0000000..a2b52d3
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/animations/rotate-transform-equivalent-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png
deleted file mode 100644
index fe37bf2..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png
index a6dbec0a..9f81350 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/opacity-with-mask-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/opacity-with-mask-expected.png
index 693e8cd..09d99f3 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/opacity-with-mask-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/opacity-with-mask-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/border-radius-composited-subframe-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/border-radius-composited-subframe-expected.png
index 474301c..6b63616 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/border-radius-composited-subframe-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/border-radius-composited-subframe-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/nested-border-radius-clipping-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/nested-border-radius-clipping-expected.png
index 6263f29..c66ab4b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/nested-border-radius-clipping-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/nested-border-radius-clipping-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/relpos-under-abspos-border-radius-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/relpos-under-abspos-border-radius-expected.png
new file mode 100644
index 0000000..246277b
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/relpos-under-abspos-border-radius-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/remove-overflow-crash2-expected.png
deleted file mode 100644
index f546fd89..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/remove-overflow-crash2-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png
new file mode 100644
index 0000000..f5c0980a
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/css3/flexbox/flexbox-baseline-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/css3/flexbox/flexbox-baseline-expected.png
deleted file mode 100644
index 416f40f..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/css3/flexbox/flexbox-baseline-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-all-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-all-expected.png
index 75811178..51a86004 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-all-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-all-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-padding-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-padding-expected.png
index 0597b0f..476ee5f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-padding-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-padding-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-mask-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-mask-expected.png
index 9a439dd..c57410b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-mask-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-mask-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-shadow-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-shadow-expected.png
index 724d267..29c50e6 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-shadow-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-mask-canvas-with-shadow-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-with-composited-child-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-with-composited-child-expected.png
index 4ec4fb95..fa6cafe 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-with-composited-child-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/border-radius-with-composited-child-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-expected.png
index fdf4417..60d2cee 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-outset-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-outset-expected.png
index cea4a04..0ed61484 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-outset-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/inline-mask-overlay-image-outset-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/rtl-border-02-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/rtl-border-02-expected.png
index 150970f2..3b88a502 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/rtl-border-02-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/borders/rtl-border-02-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/dom/scroll-reveal-top-overflow-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/dom/scroll-reveal-top-overflow-expected.png
deleted file mode 100644
index cc5cddf..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/dom/scroll-reveal-top-overflow-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png
index b04d7f30..52f5726e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png
index 3243790..873b1c3 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/textarea/basic-textareas-quirks-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/textarea/basic-textareas-quirks-expected.png
index cb9f036..5d659e7 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/textarea/basic-textareas-quirks-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/textarea/basic-textareas-quirks-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/validation-bubble-appearance-wrap-expected.png
new file mode 100644
index 0000000..8c342ce
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/forms/validation-bubble-appearance-wrap-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/frames/iframe-scrolling-attribute-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/frames/iframe-scrolling-attribute-expected.png
index 4e44ebb6..f434fd5 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/frames/iframe-scrolling-attribute-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/frames/iframe-scrolling-attribute-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/multicol/composited-inner-multicol-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/multicol/composited-inner-multicol-expected.png
index 9d5e71e5..c2be3d8 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/multicol/composited-inner-multicol-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/multicol/composited-inner-multicol-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/002-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/002-expected.png
deleted file mode 100644
index 44b9755..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/002-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/image-selection-highlight-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/image-selection-highlight-expected.png
deleted file mode 100644
index e17c2fc3..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/image-selection-highlight-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-float-stacking-expected.png
deleted file mode 100644
index 29b0b82..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-float-stacking-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-expected.png
deleted file mode 100644
index 677ffb9..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-vertical-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-vertical-expected.png
deleted file mode 100644
index d4076496..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-rtl-vertical-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-stacking-expected.png
deleted file mode 100644
index b0879df8..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-stacking-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-text-hit-testing-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-text-hit-testing-expected.png
deleted file mode 100644
index 676249b..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-text-hit-testing-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-update-transform-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-update-transform-expected.png
deleted file mode 100644
index 660e57a7..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-update-transform-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-with-local-background-attachment-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-with-local-background-attachment-expected.png
deleted file mode 100644
index 3aa6b2b..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-with-local-background-attachment-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-x-y-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-x-y-expected.png
index 813831e..d3d6489 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-x-y-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/overflow-x-y-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/table-overflow-float-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/table-overflow-float-expected.png
deleted file mode 100644
index 82df536..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/fast/overflow/table-overflow-float-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png
deleted file mode 100644
index c997cbc..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/background/background-misaligned-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/background/background-misaligned-expected.txt
index de8b67e..c30f878 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/background/background-misaligned-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/background/background-misaligned-expected.txt
@@ -7,7 +7,17 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='target'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV",
+          "rect": [8, 8, 273, 276],
+          "reason": "appeared"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (relative positioned) DIV",
+          "rect": [8, 8, 273, 276],
+          "reason": "disappeared"
+        },
+        {
+          "object": "LayoutNGBlockFlow (positioned) DIV id='target'",
           "rect": [238, 241, 40, 40],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-layout-inline-children-replaced-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-layout-inline-children-replaced-expected.txt
index c836ba5..b2df2350 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-layout-inline-children-replaced-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-layout-inline-children-replaced-expected.txt
@@ -7,9 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target' class='target'",
+          "object": "LayoutNGBlockFlow DIV id='target' class='target'",
           "rect": [0, 116, 402, 152],
-          "reason": "geometry"
+          "reason": "disappeared"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='target' class='target'",
+          "rect": [0, 116, 402, 152],
+          "reason": "appeared"
         },
         {
           "object": "LayoutImage IMG",
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-no-inflow-children-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-no-inflow-children-expected.txt
index eb2117e..5a088f7 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-no-inflow-children-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/block-no-inflow-children-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'La la la la'",
+          "object": "NGPhysicalTextFragment 'La la la la'",
           "rect": [0, 0, 62, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'La la la'",
-          "rect": [0, 0, 47, 19],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/hover-pseudo-borders-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/hover-pseudo-borders-expected.txt
index 6ae7c1289..2269bf1 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/hover-pseudo-borders-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/hover-pseudo-borders-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) \u003Cpseudo:after\u003E",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (positioned) \u003Cpseudo:after\u003E",
           "rect": [138, 8, 100, 100],
           "reason": "style change"
         },
         {
-          "object": "LayoutBlockFlow DIV class='hitregion'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='hitregion'",
           "rect": [8, 8, 100, 100],
           "reason": "background"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/invalidate-box-shadow-currentColor-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/invalidate-box-shadow-currentColor-expected.txt
index 47f1f234..ca6d5886 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/invalidate-box-shadow-currentColor-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/box/invalidate-box-shadow-currentColor-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineFlowBox",
-          "rect": [8, 8, 29, 24],
+          "object": "NGPhysicalTextFragment 'Text'",
+          "rect": [8, 8, 29, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'Text'",
-          "rect": [8, 8, 29, 19],
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='target'",
+          "rect": [8, 8, 28, 24],
           "reason": "style change"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-3509-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-3509-expected.txt
index 0690614..31f992ea63 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-3509-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-3509-expected.txt
@@ -7,19 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='im'",
-          "rect": [11, 131, 100, 100],
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='im'",
+          "rect": [61, 131, 50, 100],
+          "reason": "incremental"
+        },
+        {
+          "object": "NGPhysicalTextFragment '\u00A0'",
+          "rect": [11, 131, 4, 19],
           "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox '\u00A0'",
-          "rect": [11, 131, 4, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '\u00A0'",
-          "rect": [11, 131, 4, 19],
-          "reason": "disappeared"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-5699-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-5699-expected.txt
index 1b9d78d..fe90b4c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-5699-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-5699-expected.txt
@@ -7,24 +7,24 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Hello'",
+          "object": "NGPhysicalTextFragment 'Hello'",
           "rect": [8, 184, 35, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Hello'",
+          "object": "NGPhysicalTextFragment 'Hello'",
           "rect": [8, 156, 35, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [8, 150, 4, 19],
-          "reason": "appeared"
+          "reason": "style change"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [8, 136, 4, 19],
-          "reason": "disappeared"
+          "reason": "style change"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-6278-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-6278-expected.txt
index bbfe5aa..3c8ce82 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-6278-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-6278-expected.txt
@@ -7,124 +7,124 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [10, 138, 292, 160],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV",
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [10, 303, 292, 50],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Curabitur pretium, quam quis semper'",
+          "object": "NGPhysicalTextFragment 'Curabitur pretium, quam quis semper'",
           "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'Phasellus vehicula, sem at posuere vehicula,'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'augue nibh molestie nisl, nec ullamcorper'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'fringilla orci nibh sed neque. Quisque eu nulla'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'lacus ante vulputate pede.'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'laoreet ac, laoreet non, suscipit sed, sapien.'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'malesuada, est libero feugiat libero, vel'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'non nisi molestie accumsan. Etiam tellus urna,'",
-          "rect": [10, 138, 291, 159],
-          "reason": "disappeared"
-        },
-        {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [10, 138, 242, 200],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalTextFragment 'Phasellus vehicula, sem at posuere'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Quisque eu nulla non nisi molestie'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'ac, laoreet non, suscipit sed, sapien.'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'accumsan. Etiam tellus urna, laoreet'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'malesuada, est libero feugiat libero,'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'vehicula, augue nibh molestie nisl,'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'vel fringilla orci nibh sed neque.'",
+          "rect": [10, 138, 291, 159],
+          "reason": "geometry"
+        },
+        {
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [10, 343, 242, 50],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD id='col1'",
+          "object": "LayoutNGTableCell TD id='col1'",
           "rect": [10, 353, 242, 40],
           "reason": "incremental"
         },
         {
-          "object": "InlineTextBox 'Curabitur pretium, quam quis semper'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
+          "rect": [10, 298, 242, 40],
+          "reason": "incremental"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Curabitur pretium, quam quis semper'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Phasellus vehicula, sem at posuere'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Quisque eu nulla non nisi molestie'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'ac, laoreet non, suscipit sed, sapien.'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'accumsan. Etiam tellus urna, laoreet'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'malesuada, est libero feugiat libero,'",
+          "rect": [10, 138, 235, 199],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'nec ullamcorper lacus ante vulputate'",
           "rect": [10, 138, 235, 199],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'Phasellus vehicula, sem at posuere'",
+          "object": "NGPhysicalTextFragment 'pede.'",
           "rect": [10, 138, 235, 199],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'Quisque eu nulla non nisi molestie'",
+          "object": "NGPhysicalTextFragment 'vehicula, augue nibh molestie nisl,'",
           "rect": [10, 138, 235, 199],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'ac, laoreet non, suscipit sed, sapien.'",
+          "object": "NGPhysicalTextFragment 'vel fringilla orci nibh sed neque.'",
           "rect": [10, 138, 235, 199],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'accumsan. Etiam tellus urna, laoreet'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'malesuada, est libero feugiat libero,'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'nec ullamcorper lacus ante vulputate'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'pede.'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'vehicula, augue nibh molestie nisl,'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'vel fringilla orci nibh sed neque.'",
-          "rect": [10, 138, 235, 199],
-          "reason": "appeared"
-        },
-        {
-          "object": "LayoutTableCell TD id='col1'",
+          "object": "LayoutNGTableCell TD id='col1'",
           "rect": [252, 138, 50, 215],
           "reason": "incremental"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
+          "rect": [252, 138, 50, 160],
+          "reason": "incremental"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-7235-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-7235-expected.txt
index 918c8977..1aaa126 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-7235-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/bugzilla-7235-expected.txt
@@ -7,19 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='t'",
+          "object": "LayoutNGBlockFlow (positioned) DIV id='t'",
           "rect": [8, 176, 100, 100],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [8, 156, 4, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '\u00A0'",
-          "rect": [8, 156, 4, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/clip-with-layout-delta-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/clip-with-layout-delta-expected.txt
index d57ee14..96be1989 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/clip-with-layout-delta-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/clip-with-layout-delta-expected.txt
@@ -7,32 +7,32 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV",
           "rect": [108, 8, 100, 100],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV",
           "rect": [108, 8, 100, 100],
           "reason": "chunk appeared"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [8, 8, 100, 100],
           "reason": "appeared"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [8, 8, 100, 100],
           "reason": "chunk disappeared"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [108, 8, 4, 19],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow HTML",
+          "object": "LayoutNGBlockFlow HTML",
           "rect": [8, 8, 4, 19],
           "reason": "chunk appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/outline-clip-change-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/outline-clip-change-expected.txt
index d0f31ef..a3100e9 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/outline-clip-change-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/clip/outline-clip-change-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) A id='link' class='updated'",
-          "rect": [48, 108, 90, 25],
+          "object": "LayoutNGBlockFlow (positioned) A id='link' class='updated'",
+          "rect": [48, 88, 90, 25],
           "reason": "chunk appeared"
         },
         {
-          "object": "LayoutBlockFlow HTML",
-          "rect": [48, 108, 86, 19],
+          "object": "LayoutNGBlockFlow HTML",
+          "rect": [48, 88, 86, 19],
           "reason": "chunk disappeared"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt
index 958e579..4225a9a 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.txt
@@ -4,74 +4,58 @@
       "name": "Scrolling background of LayoutView #document",
       "bounds": [800, 600],
       "contentsOpaque": true,
-      "backgroundColor": "#FFFFFF"
-    },
-    {
-      "name": "HorizontalScrollbar",
-      "bounds": [200, 200],
+      "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 150, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 258, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 130, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 238, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 110, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 218, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 90, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 198, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 70, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 178, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 50, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 158, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 30, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 138, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 10, 77, 19],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 118, 77, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 170, 77, 15],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 278, 77, 15],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'CONTENT'",
-          "rect": [0, 0, 77, 9],
+          "object": "NGPhysicalTextFragment 'CONTENT'",
+          "rect": [8, 108, 77, 9],
           "reason": "style change"
         }
-      ],
-      "transform": 1
-    }
-  ],
-  "transforms": [
-    {
-      "id": 1,
-      "transform": [
-        [1, 0, 0, 0],
-        [0, 1, 0, 0],
-        [0, 0, 1, 0],
-        [8, 108, 0, 1]
       ]
     }
   ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-4-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-4-expected.txt
index e520904..661082a 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-4-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-4-expected.txt
@@ -7,32 +7,32 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='keep' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='keep' class='item'",
           "rect": [408, 88, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='to_remove' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='to_remove' class='item'",
           "rect": [408, 88, 100, 100],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow DIV id='keep' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='keep' class='item'",
           "rect": [208, 88, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [408, 88, 4, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [408, 88, 4, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [208, 88, 4, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-expected.txt
index 8ac8039..bb788bc80 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/crbug-371640-expected.txt
@@ -7,32 +7,32 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='keep' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='keep' class='item'",
           "rect": [348, 88, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='to_remove' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='to_remove' class='item'",
           "rect": [348, 88, 100, 100],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow DIV id='keep' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='keep' class='item'",
           "rect": [88, 88, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [348, 88, 4, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [348, 88, 4, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [88, 88, 4, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/remove-inline-block-descendant-of-flex-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/remove-inline-block-descendant-of-flex-expected.txt
index a98e9e00..fe72aa0 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/remove-inline-block-descendant-of-flex-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/remove-inline-block-descendant-of-flex-expected.txt
@@ -7,17 +7,17 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='inline-block-2' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='inline-block-2' class='item'",
           "rect": [0, 200, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='inline-block-1' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='inline-block-1' class='item'",
           "rect": [0, 100, 100, 100],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow DIV id='inline-block-2' class='item'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='inline-block-2' class='item'",
           "rect": [0, 100, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/repaint-expected.txt
index 3ece875d..93e67000 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/flexbox/repaint-expected.txt
@@ -7,152 +7,152 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='content'",
+          "object": "LayoutNGBlockFlow DIV id='content'",
           "rect": [138, 128, 654, 100],
           "reason": "style change"
         },
         {
-          "object": "LayoutBlockFlow DIV id='content'",
+          "object": "LayoutNGBlockFlow DIV id='content'",
           "rect": [148, 128, 644, 100],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
           "rect": [138, 128, 636, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
+          "object": "NGPhysicalTextFragment 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
           "rect": [138, 128, 636, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
+          "object": "NGPhysicalTextFragment 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
           "rect": [138, 128, 636, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
+          "object": "NGPhysicalTextFragment 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
           "rect": [138, 128, 636, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
+          "object": "NGPhysicalTextFragment 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
           "rect": [138, 128, 636, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
           "rect": [148, 128, 635, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
           "rect": [148, 128, 635, 99],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
+          "object": "NGPhysicalTextFragment 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
           "rect": [148, 128, 635, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
+          "object": "NGPhysicalTextFragment 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
           "rect": [148, 128, 635, 99],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
+          "object": "NGPhysicalTextFragment 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
           "rect": [148, 128, 635, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
+          "object": "NGPhysicalTextFragment 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
           "rect": [148, 128, 635, 99],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
+          "object": "NGPhysicalTextFragment 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
           "rect": [148, 128, 635, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
+          "object": "NGPhysicalTextFragment 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
           "rect": [148, 128, 635, 99],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
+          "object": "NGPhysicalTextFragment 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
           "rect": [148, 128, 635, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
+          "object": "NGPhysicalTextFragment 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
           "rect": [148, 128, 635, 99],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='content'",
+          "object": "LayoutNGBlockFlow DIV id='content'",
           "rect": [400, 128, 392, 180],
           "reason": "style change"
         },
         {
-          "object": "LayoutBlockFlow DIV id='left'",
+          "object": "LayoutNGBlockFlow DIV id='left'",
           "rect": [8, 228, 392, 80],
           "reason": "incremental"
         },
         {
-          "object": "InlineTextBox 'Aenean laoreet dolor id urna eleifend aliquet. Nulla vel dolor'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet.'",
+          "rect": [400, 128, 391, 179],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et'",
+          "rect": [400, 128, 391, 179],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed'",
+          "rect": [400, 128, 391, 179],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis'",
           "rect": [400, 128, 391, 179],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'",
+          "object": "NGPhysicalTextFragment 'elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id'",
           "rect": [400, 128, 391, 179],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'Sed volutpat, tellus vel varius vestibulum, purus quam mollis'",
+          "object": "NGPhysicalTextFragment 'magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
+          "rect": [400, 128, 391, 179],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.'",
+          "rect": [400, 128, 391, 179],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'quam.'",
           "rect": [400, 128, 391, 179],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id'",
+          "object": "NGPhysicalTextFragment 'sapien, in condimentum leo neque sed nulla. Nunc quis porta'",
           "rect": [400, 128, 391, 179],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis'",
-          "rect": [400, 128, 391, 179],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'natoque penatibus et magnis dis parturient montes, nascetur'",
-          "rect": [400, 128, 391, 179],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'quam.'",
-          "rect": [400, 128, 391, 179],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'ridiculus mus. Sed congue magna vitae dolor feugiat vehicula.'",
-          "rect": [400, 128, 391, 179],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'sapien, in condimentum leo neque sed nulla. Nunc quis porta'",
-          "rect": [400, 128, 391, 179],
-          "reason": "disappeared"
-        },
-        {
-          "object": "LayoutBlockFlow DIV id='left'",
+          "object": "LayoutNGBlockFlow DIV id='left'",
           "rect": [148, 128, 252, 180],
           "reason": "incremental"
         },
         {
-          "object": "LayoutBlockFlow DIV id='left'",
+          "object": "LayoutNGBlockFlow DIV id='left'",
           "rect": [8, 128, 140, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/float-new-in-block-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/float-new-in-block-expected.txt
index e04cc838..1657af5 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/float-new-in-block-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/float-new-in-block-expected.txt
@@ -7,7 +7,17 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (floating) DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV",
+          "rect": [8, 8, 784, 20],
+          "reason": "disappeared"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
+          "rect": [8, 8, 784, 20],
+          "reason": "appeared"
+        },
+        {
+          "object": "LayoutNGBlockFlow (floating) DIV id='target'",
           "rect": [8, 8, 100, 100],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/forms/details-marker-color-change-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/forms/details-marker-color-change-expected.txt
index 94b1780..899d29b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/forms/details-marker-color-change-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/forms/details-marker-color-change-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Details'",
+          "object": "NGPhysicalTextFragment 'Details'",
           "rect": [24, 8, 45, 19],
           "reason": "style change"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/gradients-em-stops-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/gradients-em-stops-repaint-expected.txt
index 4d8ae20..145da90 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/gradients-em-stops-repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/gradients-em-stops-repaint-expected.txt
@@ -7,29 +7,19 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='box4' class='box'",
+          "object": "LayoutNGBlockFlow DIV id='box4' class='box'",
           "rect": [344, 18, 302, 122],
           "reason": "style change"
         },
         {
-          "object": "LayoutBlockFlow DIV id='box3' class='box'",
-          "rect": [18, 18, 302, 122],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='indicator'",
+          "object": "LayoutNGBlockFlow DIV class='indicator'",
           "rect": [345, 19, 240, 20],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment ' '",
           "rect": [330, 135, 4, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '\n'",
-          "rect": [330, 135, 4, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-color-change-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-color-change-expected.txt
index bed8cbf..17d92bb 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-color-change-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-color-change-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineFlowBox",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='target'",
           "rect": [8, 72, 38, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'PASS'",
+          "object": "NGPhysicalTextFragment 'PASS'",
           "rect": [8, 72, 38, 19],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-reflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-reflow-expected.txt
index 0f9e566c..b073860 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-reflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/inline-reflow-expected.txt
@@ -7,139 +7,134 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'A A A A A AA AA'",
+          "object": "NGPhysicalTextFragment 'A A A A A AA AA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'A A'",
+          "object": "NGPhysicalTextFragment 'A A'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AA AA AA A A A'",
+          "object": "NGPhysicalTextFragment 'AA AA AA A A A'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AA AA AAA AAA'",
+          "object": "NGPhysicalTextFragment 'AA AA AAA AAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAA AAA AAA AA'",
+          "object": "NGPhysicalTextFragment 'AAA AAA AAA AA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAA AAAA AAAA'",
+          "object": "NGPhysicalTextFragment 'AAA AAAA AAAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAAA AAAA AAAA'",
+          "object": "NGPhysicalTextFragment 'AAAAA AAAA AAAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAAA AAAAA'",
+          "object": "NGPhysicalTextFragment 'AAAAA AAAAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAAAA AAAAA'",
+          "object": "NGPhysicalTextFragment 'AAAAAA AAAAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAAAA AAAAAAA'",
+          "object": "NGPhysicalTextFragment 'AAAAAA AAAAAAA'",
           "rect": [0, 0, 300, 200],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'A A A A A'",
+          "object": "NGPhysicalTextFragment 'A A A A A AA AA'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'A A A A'",
           "rect": [0, 0, 200, 300],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'A A A A'",
+          "object": "NGPhysicalTextFragment 'A A'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AA AA AA A A A'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AA AA AA A'",
           "rect": [0, 0, 200, 300],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'AA AA AA A'",
+          "object": "NGPhysicalTextFragment 'AA AA AAA AAA'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AAA AAA AA'",
           "rect": [0, 0, 200, 300],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'AA AA AA'",
+          "object": "NGPhysicalTextFragment 'AAA AAA AAA AA'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AAA AAAA AAAA'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AAAA AAA'",
           "rect": [0, 0, 200, 300],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'AA AAA AAA'",
+          "object": "NGPhysicalTextFragment 'AAAAA AAAA AAAA'",
+          "rect": [0, 0, 200, 300],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'AAAAA AAAA'",
           "rect": [0, 0, 200, 300],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'AAA AAA AA'",
+          "object": "NGPhysicalTextFragment 'AAAAA AAAAA'",
           "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAA AAAA'",
+          "object": "NGPhysicalTextFragment 'AAAAAA AAAAA'",
           "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAA AAA'",
+          "object": "NGPhysicalTextFragment 'AAAAAA AAAAAAA'",
           "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAA AAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAA AAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAAAAA'",
-          "rect": [0, 0, 200, 300],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'A A A A A'",
+          "object": "NGPhysicalTextFragment 'A A A A A'",
           "rect": [0, 300, 180, 20],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'A A A A A'",
-          "rect": [0, 300, 180, 20],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/lines-with-layout-delta-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/lines-with-layout-delta-expected.txt
index a14384a..bec00001 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/lines-with-layout-delta-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/lines-with-layout-delta-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'PASS'",
+          "object": "NGPhysicalTextFragment 'PASS'",
           "rect": [8, 58, 38, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'FAIL'",
-          "rect": [8, 58, 35, 19],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/list-marker-2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/list-marker-2-expected.txt
index 842bfd2..a078ee8 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/list-marker-2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/list-marker-2-expected.txt
@@ -12,12 +12,12 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutListMarker (anonymous)",
+          "object": "NGPhysicalTextFragment '\u2022 '",
           "rect": [30, 185, 7, 19],
           "reason": "geometry"
         },
         {
-          "object": "LayoutListMarker (anonymous)",
+          "object": "NGPhysicalTextFragment '\u2022 '",
           "rect": [30, 135, 7, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/non-text-link-invalidation-optimization-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/non-text-link-invalidation-optimization-expected.txt
index 4f2693df..beacf1e8 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/non-text-link-invalidation-optimization-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/non-text-link-invalidation-optimization-expected.txt
@@ -7,32 +7,32 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox ' text is invalidated and '",
+          "object": "NGPhysicalTextFragment ' text is invalidated and '",
           "rect": [164, 8, 145, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox ' passes if '",
+          "object": "NGPhysicalTextFragment ' passes if '",
           "rect": [75, 8, 61, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'This test '",
+          "object": "NGPhysicalTextFragment 'This test '",
           "rect": [8, 8, 57, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox ' images.'",
+          "object": "NGPhysicalTextFragment ' images.'",
           "rect": [353, 8, 52, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'only'",
+          "object": "NGPhysicalTextFragment 'only'",
           "rect": [136, 8, 28, 19],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox ' no '",
+          "object": "NGPhysicalTextFragment ' no '",
           "rect": [319, 8, 24, 19],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/offset-change-wrong-invalidation-with-float-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/offset-change-wrong-invalidation-with-float-expected.txt
index 64ec9b8..6d1bf57 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/offset-change-wrong-invalidation-with-float-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/offset-change-wrong-invalidation-with-float-expected.txt
@@ -7,19 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) UL id='submenu'",
+          "object": "LayoutNGBlockFlow (positioned) UL id='submenu'",
           "rect": [48, 94, 40, 20],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutListMarker (anonymous)",
+          "object": "NGPhysicalTextFragment '\u25E6 '",
           "rect": [70, 94, 7, 19],
           "reason": "disappeared"
-        },
-        {
-          "object": "LayoutListMarker (anonymous)",
-          "rect": [30, 44, 7, 19],
-          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-continuations-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-continuations-expected.txt
index 9542ed4..278192e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-continuations-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-continuations-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN id='outer'",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='outer'",
           "rect": [7, 87, 88, 22],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-enable-continuations-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-enable-continuations-expected.txt
index 093a0f9..3b8961d1 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-enable-continuations-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-enable-continuations-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN id='outer'",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='outer'",
           "rect": [7, 87, 88, 22],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-child-move-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-child-move-expected.txt
index 24eee5fb..35713fc 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-child-move-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-child-move-expected.txt
@@ -7,17 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV",
-          "rect": [99, 49, 302, 302],
-          "reason": "outline"
-        },
-        {
-          "object": "LayoutBlockFlow (positioned) DIV id='child'",
+          "object": "LayoutNGBlockFlow (positioned) DIV id='child'",
           "rect": [300, 50, 20, 300],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='child'",
+          "object": "LayoutNGBlockFlow (positioned) DIV id='child'",
           "rect": [150, 50, 20, 300],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-continuation-move-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-continuation-move-expected.txt
index e78623b..f2fb1e4 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-continuation-move-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-continuation-move-expected.txt
@@ -7,22 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN",
           "rect": [207, 231, 102, 102],
           "reason": "outline"
         },
         {
-          "object": "LayoutInline SPAN",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN",
           "rect": [7, 231, 102, 102],
           "reason": "outline"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV id='block'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV id='block'",
           "rect": [208, 232, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV id='block'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV id='block'",
           "rect": [8, 232, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-inline-continuation-move-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-inline-continuation-move-expected.txt
index b1e315bc..9eabdba 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-inline-continuation-move-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/focus-ring-on-inline-continuation-move-expected.txt
@@ -7,17 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN",
-          "rect": [7, 7, 102, 182],
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN",
+          "rect": [7, 7, 102, 106],
           "reason": "outline"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV id='block'",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN",
+          "rect": [7, 87, 102, 102],
+          "reason": "outline"
+        },
+        {
+          "object": "LayoutNGBlockFlow (relative positioned) DIV id='block'",
           "rect": [8, 88, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV id='block'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV id='block'",
           "rect": [8, 8, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/inline-outline-repaint-2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/inline-outline-repaint-2-expected.txt
index 9ffdfaab..e7ded99 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/inline-outline-repaint-2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/inline-outline-repaint-2-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN",
           "rect": [210, 0, 50, 15],
           "reason": "outline"
         },
         {
-          "object": "InlineTextBox 'Test'",
+          "object": "NGPhysicalTextFragment 'Test'",
           "rect": [215, 0, 40, 10],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-change-invalidation-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-change-invalidation-expected.txt
index d5ba2ed..9bdff1c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-change-invalidation-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-change-invalidation-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow A id='link'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow A id='link'",
           "rect": [43, 83, 754, 30],
           "reason": "appeared"
-        },
-        {
-          "object": "LayoutListMarker (anonymous)",
-          "rect": [30, 88, 7, 19],
-          "reason": "style change"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-containing-image-in-non-standard-mode-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-containing-image-in-non-standard-mode-expected.txt
index 0a42a9d..db65b4b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-containing-image-in-non-standard-mode-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-containing-image-in-non-standard-mode-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN id='target'",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='target'",
           "rect": [6, 6, 204, 58],
           "reason": "style change"
-        },
-        {
-          "object": "LayoutImage IMG",
-          "rect": [8, 8, 200, 50],
-          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-continuations-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-continuations-expected.txt
index 5fc838c..306d74a 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-continuations-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/outline/outline-continuations-expected.txt
@@ -7,27 +7,27 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutInline SPAN id='outer'",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='outer'",
           "rect": [16, 108, 90, 63],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'CONTENTS'",
+          "object": "NGPhysicalTextFragment 'CONTENTS'",
           "rect": [18, 150, 86, 19],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'CONTENTS'",
+          "object": "NGPhysicalTextFragment 'CONTENTS'",
           "rect": [18, 150, 86, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'CONTENTS'",
+          "object": "NGPhysicalTextFragment 'CONTENTS'",
           "rect": [18, 110, 86, 19],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'CONTENTS'",
+          "object": "NGPhysicalTextFragment 'CONTENTS'",
           "rect": [18, 110, 86, 19],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-expected.txt
index 6c2f216..05e6d5d8 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-expected.txt
@@ -7,42 +7,42 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 537, 62, 37],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 531, 62, 37],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 498, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 492, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 459, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 453, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 420, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 414, 62, 22],
           "reason": "geometry"
         },
@@ -67,52 +67,52 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 171, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 165, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 132, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 126, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 93, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 87, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 54, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 48, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 15, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [61, 9, 62, 22],
           "reason": "geometry"
         },
@@ -147,32 +147,32 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 504, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 498, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 465, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 459, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 426, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 420, 50, 10],
           "reason": "geometry"
         },
@@ -187,182 +187,182 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 177, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 171, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 138, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 132, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 99, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 93, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 60, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 54, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 21, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 15, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 374, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 368, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 335, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 329, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 296, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [69, 290, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 375, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 369, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 336, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 330, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 297, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [70, 291, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [67, 138, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [67, 132, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [65, 60, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [65, 54, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [65, 21, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [65, 15, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 543, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 537, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 504, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 498, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 465, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 459, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 426, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 420, 40, 10],
           "reason": "geometry"
         },
@@ -387,97 +387,37 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 177, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 171, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 99, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [59, 93, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 543, 32, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [67, 537, 32, 20],
           "reason": "geometry"
         },
         {
           "object": "InlineTextBox 'x'",
-          "rect": [66, 299, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [66, 293, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [63, 23, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [63, 17, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 545, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 539, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 506, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 500, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 467, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 461, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 428, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 422, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
           "rect": [59, 257, 16, 17],
           "reason": "geometry"
         },
@@ -497,63 +437,123 @@
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 179, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [66, 299, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 173, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [66, 293, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 140, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [63, 23, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [59, 134, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [63, 17, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [58, 377, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 545, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [58, 371, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 539, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [58, 338, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 506, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [58, 332, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 500, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [57, 101, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 467, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [57, 95, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 461, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [57, 62, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 428, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [57, 56, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 422, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 179, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 173, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 140, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [59, 134, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [58, 377, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [58, 371, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [58, 338, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [58, 332, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [57, 101, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [57, 95, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [57, 62, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [57, 56, 16, 16],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-right-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-right-expected.txt
index 54943d7..237a747b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-right-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/float-overflow-right-expected.txt
@@ -7,42 +7,42 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 537, 62, 37],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 531, 62, 37],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 498, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 492, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 459, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 453, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 420, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 414, 62, 22],
           "reason": "geometry"
         },
@@ -67,52 +67,52 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 171, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 165, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 132, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 126, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 93, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 87, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 54, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 48, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 15, 62, 22],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='outer'",
+          "object": "LayoutNGBlockFlow DIV class='outer'",
           "rect": [677, 9, 62, 22],
           "reason": "geometry"
         },
@@ -147,32 +147,32 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 504, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 498, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 465, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 459, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 426, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 420, 50, 10],
           "reason": "geometry"
         },
@@ -187,122 +187,122 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 177, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 171, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 138, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 132, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 99, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 93, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 60, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 54, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 21, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [683, 15, 50, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 374, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 368, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 335, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 329, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 296, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [689, 290, 42, 12],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 543, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 537, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 504, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 498, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 465, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 459, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 426, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 420, 40, 10],
           "reason": "geometry"
         },
@@ -327,177 +327,97 @@
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 177, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 171, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 99, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [701, 93, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [695, 60, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [695, 54, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [695, 21, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [695, 15, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [693, 138, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [693, 132, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 375, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 369, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 336, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 330, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 297, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (floating) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (floating) DIV",
           "rect": [690, 291, 40, 10],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [701, 543, 32, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
           "rect": [701, 537, 32, 20],
           "reason": "geometry"
         },
         {
           "object": "InlineTextBox 'x'",
-          "rect": [727, 101, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [727, 95, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [727, 62, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [727, 56, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [726, 377, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [726, 371, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [726, 338, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [726, 332, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 545, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 539, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 506, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 500, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 467, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 461, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 428, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 422, 16, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'x'",
           "rect": [725, 257, 16, 17],
           "reason": "geometry"
         },
@@ -517,43 +437,123 @@
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 179, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [727, 101, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 173, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [727, 95, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 140, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [727, 62, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [725, 134, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [727, 56, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [721, 23, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [726, 377, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [721, 17, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [726, 371, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [718, 299, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [726, 338, 16, 16],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
-          "rect": [718, 293, 16, 17],
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [726, 332, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 545, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 539, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 506, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 500, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 467, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 461, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 428, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 422, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 179, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 173, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 140, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [725, 134, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [721, 23, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [721, 17, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [718, 299, 16, 16],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'x'",
+          "rect": [718, 293, 16, 16],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-overflow-expected.txt
index ac5f9b7..5475dd3 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-overflow-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'A\u00A0\u00A0B'",
+          "object": "NGPhysicalTextFragment 'A\u00A0\u00A0B'",
           "rect": [33, 33, 250, 100],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-lr-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-lr-overflow-expected.txt
index 86670ac4..6699f55 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-lr-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-lr-overflow-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'A\u00A0\u00A0B'",
+          "object": "NGPhysicalTextFragment 'A\u00A0\u00A0B'",
           "rect": [33, 33, 100, 250],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-rl-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-rl-overflow-expected.txt
index 6973bc7..b8c55508 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-rl-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/inline-vertical-rl-overflow-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'A\u00A0\u00A0B'",
+          "object": "NGPhysicalTextFragment 'A\u00A0\u00A0B'",
           "rect": [667, 33, 100, 250],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/line-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/line-overflow-expected.txt
index 7d357a1e..7ccd4ae 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/line-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/line-overflow-expected.txt
@@ -7,92 +7,62 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox ' eleifend'",
+          "object": "NGPhysicalTextFragment ' eleifend'",
           "rect": [8, 122, 195, 99],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'convallis.'",
+          "object": "NGPhysicalTextFragment 'convallis.'",
+          "rect": [8, 122, 195, 99],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'lacus, at sagittis eros leo'",
           "rect": [8, 122, 195, 99],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'lacus, at sagittis eros leo'",
+          "object": "NGPhysicalTextFragment 'pulvinar velit. Integer'",
           "rect": [8, 122, 195, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'pulvinar velit. Integer'",
+          "object": "NGPhysicalTextFragment 'sollicitudin nisi ut urna blandit'",
           "rect": [8, 122, 195, 99],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'sollicitudin nisi ut urna blandit'",
-          "rect": [8, 122, 195, 99],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox ' eleifend lacus,'",
+          "object": "NGPhysicalTextFragment ' eleifend lacus,'",
           "rect": [8, 142, 195, 79],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'at sagittis eros leo pulvinar'",
-          "rect": [8, 142, 195, 79],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'urna blandit convallis.'",
-          "rect": [8, 142, 195, 79],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'velit. Integer sollicitudin nisi ut'",
-          "rect": [8, 142, 195, 79],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'Cras faucibus. Nunc'",
+          "object": "NGPhysicalTextFragment 'Cras faucibus. Nunc'",
           "rect": [8, 82, 192, 59],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'adipiscing, enim in scelerisque'",
+          "object": "NGPhysicalTextFragment 'adipiscing, enim in scelerisque'",
           "rect": [8, 82, 192, 59],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'augue '",
+          "object": "NGPhysicalTextFragment 'convallis, augue '",
           "rect": [8, 82, 192, 59],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'augue'",
-          "rect": [8, 82, 192, 59],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'convallis,\n'",
-          "rect": [8, 82, 192, 59],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'convallis,\n'",
-          "rect": [8, 82, 192, 59],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineFlowBox",
+          "object": "NGPhysicalBoxFragment LayoutInline SPAN id='t'",
           "rect": [114, 92, 35, 49],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'purus'",
+          "object": "NGPhysicalTextFragment 'purus'",
           "rect": [114, 122, 35, 19],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'purus'",
+          "object": "NGPhysicalTextFragment 'purus'",
           "rect": [38, 142, 35, 19],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/negative-text-indent-with-overflow-hidden-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/negative-text-indent-with-overflow-hidden-expected.txt
index ba0250a6..7123f75 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/negative-text-indent-with-overflow-hidden-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/overflow/negative-text-indent-with-overflow-hidden-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target' class='changed'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV id='target' class='changed'",
           "rect": [550, 8, 200, 50],
           "reason": "background"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries-expected.txt
index d3a3d34..81e3ddc0 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow HTML",
+          "object": "LayoutNGBlockFlow HTML",
           "rect": [18, 18, 22, 19],
           "reason": "chunk disappeared"
         },
         {
-          "object": "InlineTextBox 'abc'",
+          "object": "NGPhysicalTextFragment 'abc'",
           "rect": [8, 187, 22, 19],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/abspos-shift-image-incorrect-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/abspos-shift-image-incorrect-repaint-expected.txt
index 589f5f9..7fd7cf9 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/abspos-shift-image-incorrect-repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/abspos-shift-image-incorrect-repaint-expected.txt
@@ -22,12 +22,12 @@
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment ' '",
           "rect": [700, 217, 4, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment ' '",
           "rect": [450, 217, 4, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/inline-relative-positioned-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/inline-relative-positioned-expected.txt
index 0d8d2b0..b9e0e46 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/inline-relative-positioned-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/inline-relative-positioned-expected.txt
@@ -7,19 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'a'",
+          "object": "NGPhysicalTextFragment 'a'",
           "rect": [8, 88, 100, 100],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'p'",
-          "rect": [8, 88, 100, 100],
-          "reason": "disappeared"
-        },
-        {
-          "object": "LayoutBlockFlow DIV id='target'",
-          "rect": [8, 88, 100, 100],
-          "reason": "geometry"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layout-state-relative-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layout-state-relative-expected.txt
index b3a85af..b04a530 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layout-state-relative-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layout-state-relative-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'PASS'",
+          "object": "NGPhysicalTextFragment 'PASS'",
           "rect": [8, 152, 38, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'FAIL'",
-          "rect": [8, 152, 35, 19],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt
index d458703..c1b8f03 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/layoutstate-invalid-invalidation-inline-relative-positioned-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'x'",
+          "object": "NGPhysicalTextFragment 'x'",
           "rect": [8, 220, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'x'",
+          "object": "NGPhysicalTextFragment 'x'",
           "rect": [8, 200, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-document-element-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-document-element-expected.txt
index ea0f4e3..32d9a579 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-document-element-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-document-element-expected.txt
@@ -12,14 +12,14 @@
           "reason": "background"
         },
         {
-          "object": "InlineTextBox 'Tests that the entire viewport is painted with a floated html element.'",
+          "object": "NGPhysicalTextFragment 'Tests that the entire viewport is painted with a floated html element.'",
           "rect": [108, 116, 424, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Tests that the entire viewport is painted with a floated html element.'",
+          "object": "NGPhysicalTextFragment 'Tests that the entire viewport is painted with a floated html element.'",
           "rect": [8, 16, 424, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-great-grandparent-change-location-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-great-grandparent-change-location-expected.txt
index 6a41d4b..711db39 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-great-grandparent-change-location-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/position/positioned-great-grandparent-change-location-expected.txt
@@ -7,22 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (positioned) DIV",
           "rect": [100, 200, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (positioned) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (positioned) DIV",
           "rect": [100, 100, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Target'",
+          "object": "NGPhysicalTextFragment 'Target'",
           "rect": [100, 200, 41, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Target'",
+          "object": "NGPhysicalTextFragment 'Target'",
           "rect": [100, 100, 41, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/push-block-with-first-line-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/push-block-with-first-line-expected.txt
index cde54ff0..2e18264f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/push-block-with-first-line-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/push-block-with-first-line-expected.txt
@@ -7,22 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "RootInlineBox",
+          "object": "NGPhysicalLineBoxFragment",
           "rect": [8, 68, 784, 20],
           "reason": "geometry"
         },
         {
-          "object": "RootInlineBox",
+          "object": "NGPhysicalLineBoxFragment",
           "rect": [8, 8, 784, 20],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'JOCULAR'",
+          "object": "NGPhysicalTextFragment 'JOCULAR'",
           "rect": [8, 68, 140, 20],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'JOCULAR'",
+          "object": "NGPhysicalTextFragment 'JOCULAR'",
           "rect": [8, 8, 140, 20],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/quotes-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/quotes-expected.txt
index 2b7d771..c04b58d 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/quotes-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/quotes-expected.txt
@@ -7,34 +7,29 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'quote 2'",
+          "object": "NGPhysicalTextFragment 'quote 2'",
           "rect": [17, 28, 47, 19],
-          "reason": "disappeared"
+          "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'quote 2'",
+          "object": "NGPhysicalTextFragment 'quote 2'",
           "rect": [16, 28, 47, 19],
-          "reason": "appeared"
+          "reason": "style change"
         },
         {
-          "object": "InlineTextBox '\u003E'",
+          "object": "NGPhysicalTextFragment '}'",
           "rect": [64, 28, 9, 19],
-          "reason": "disappeared"
+          "reason": "style change"
         },
         {
-          "object": "InlineTextBox '\u003C'",
+          "object": "NGPhysicalTextFragment '{'",
           "rect": [8, 28, 9, 19],
-          "reason": "disappeared"
+          "reason": "style change"
         },
         {
-          "object": "InlineTextBox '}'",
+          "object": "NGPhysicalTextFragment '}'",
           "rect": [63, 28, 8, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '{'",
-          "rect": [8, 28, 8, 19],
-          "reason": "appeared"
+          "reason": "style change"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-redraw-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-redraw-expected.txt
index 1a83b8e9..25615108 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-redraw-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-redraw-expected.txt
@@ -7,62 +7,62 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'The color of this'",
+          "object": "NGPhysicalTextFragment 'The color of this'",
           "rect": [380, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'should be green'",
+          "object": "NGPhysicalTextFragment 'should be green'",
           "rect": [380, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'text in the reflection'",
+          "object": "NGPhysicalTextFragment 'text in the reflection'",
           "rect": [380, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'The color of this'",
+          "object": "NGPhysicalTextFragment 'The color of this'",
           "rect": [70, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'should be green'",
+          "object": "NGPhysicalTextFragment 'should be green'",
           "rect": [70, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'text in the reflection'",
+          "object": "NGPhysicalTextFragment 'text in the reflection'",
           "rect": [70, 267, 286, 59],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'The color of this'",
+          "object": "NGPhysicalTextFragment 'The color of this'",
           "rect": [305, 34, 126, 182],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'should be green'",
+          "object": "NGPhysicalTextFragment 'should be green'",
           "rect": [305, 34, 126, 182],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'text in the reflection'",
+          "object": "NGPhysicalTextFragment 'text in the reflection'",
           "rect": [305, 34, 126, 182],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'The color of this'",
+          "object": "NGPhysicalTextFragment 'The color of this'",
           "rect": [305, 377, 126, 156],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'should be green'",
+          "object": "NGPhysicalTextFragment 'should be green'",
           "rect": [305, 377, 126, 156],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'text in the reflection'",
+          "object": "NGPhysicalTextFragment 'text in the reflection'",
           "rect": [305, 377, 126, 156],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-with-rotation-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-with-rotation-expected.txt
index cf3904c..6670092 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-with-rotation-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/reflection/reflection-with-rotation-expected.txt
@@ -7,19 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target'",
-          "rect": [22, 50, 226, 167],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'PASS'",
+          "object": "NGPhysicalTextFragment 'PASS'",
           "rect": [23, 51, 72, 110],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'FAIL'",
-          "rect": [23, 51, 69, 109],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/remove-inline-after-layout-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/remove-inline-after-layout-expected.txt
index 401f650..bef69aa2 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/remove-inline-after-layout-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/remove-inline-after-layout-expected.txt
@@ -7,34 +7,24 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'This span should disappear.\n'",
+          "object": "NGPhysicalTextFragment 'This span should disappear. '",
           "rect": [112, 193, 178, 19],
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [290, 108, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
+          "object": "LayoutNGBlockFlow DIV",
           "rect": [112, 108, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [8, 108, 100, 100],
+          "object": "NGPhysicalTextFragment ' '",
+          "rect": [108, 193, 4, 19],
           "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox '\n'",
-          "rect": [108, 193, 4, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '\n'",
-          "rect": [108, 193, 4, 19],
-          "reason": "disappeared"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
index 5ea0d30..42d8268 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox '\u7B2C\u4E00\u6BB5\u843D paragraph 1'",
+          "object": "NGPhysicalTextFragment '\u7B2C\u4E00\u6BB5\u843D paragraph 1'",
           "rect": [548, 191, 23, 36],
           "reason": "selection"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-descandant-on-ancestor-layer-move-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-descandant-on-ancestor-layer-move-expected.txt
index 942f794..fce8217 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-descandant-on-ancestor-layer-move-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/repaint-descandant-on-ancestor-layer-move-expected.txt
@@ -7,22 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (relative positioned) DIV",
           "rect": [428, 38, 300, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (relative positioned) DIV",
           "rect": [28, 38, 300, 20],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'There should only be one copy of this text.'",
+          "object": "NGPhysicalTextFragment 'There should only be one copy of this text.'",
           "rect": [428, 38, 270, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'There should only be one copy of this text.'",
+          "object": "NGPhysicalTextFragment 'There should only be one copy of this text.'",
           "rect": [28, 38, 270, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/invalidate-after-composited-scroll-of-window-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/invalidate-after-composited-scroll-of-window-expected.txt
index 8600202..ccfedca 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/invalidate-after-composited-scroll-of-window-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/invalidate-after-composited-scroll-of-window-expected.txt
@@ -7,12 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Tests that invalidation of a div after scrolling invalidates just the div and no other area.'",
+          "object": "NGPhysicalTextFragment 'Tests that invalidation of a div after scrolling invalidates just the div and no other area.'",
           "rect": [8, 4908, 540, 19],
           "reason": "appeared"
         },
         {
-          "object": "LayoutBlockFlow DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV id='target'",
           "rect": [8, 2408, 100, 100],
           "reason": "background"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset-expected.txt
index 5f11d0da..5944b07 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'before'",
+          "object": "NGPhysicalTextFragment 'after'",
           "rect": [100, 120, 40, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'after'",
-          "rect": [100, 120, 29, 19],
-          "reason": "appeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset2-expected.txt
index 2423daf..788d8fb 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset2-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'before'",
+          "object": "NGPhysicalTextFragment 'after'",
           "rect": [102, 122, 40, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'after'",
-          "rect": [102, 122, 29, 19],
-          "reason": "appeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset3-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset3-expected.txt
index d1d008d..ca1b3fa 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset3-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/layout-state-scrolloffset3-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'before'",
+          "object": "NGPhysicalTextFragment 'after'",
           "rect": [100, 120, 34, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'after'",
-          "rect": [100, 120, 29, 19],
-          "reason": "appeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/line-in-scrolled-clipped-block-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/line-in-scrolled-clipped-block-expected.txt
index fa8792c..b1de7092 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/line-in-scrolled-clipped-block-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/line-in-scrolled-clipped-block-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox '                         FAIL     .'",
+          "object": "NGPhysicalTextFragment '                         PASS     .'",
           "rect": [8, 8, 100, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox '                         PASS     .'",
-          "rect": [8, 8, 100, 19],
-          "reason": "appeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt
index 8f7d5396..59bf467 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt
@@ -4,34 +4,23 @@
       "name": "Scrolling background of LayoutView #document",
       "bounds": [800, 600],
       "contentsOpaque": true,
-      "backgroundColor": "#FFFFFF"
-    },
-    {
-      "name": "LayoutBlockFlow (positioned) DIV id='outer'",
-      "bounds": [650, 600],
-      "backgroundColor": "#0000FF",
-      "transform": 2
-    },
-    {
-      "name": "HorizontalScrollbar",
-      "bounds": [300, 300],
+      "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
           "object": "HorizontalScrollbar",
-          "rect": [0, 285, 285, 15],
+          "rect": [8, 293, 285, 15],
           "reason": "scroll control"
         }
-      ],
-      "transform": 1
+      ]
     },
     {
-      "name": "LayoutBlockFlow (positioned) DIV id='container'",
+      "name": "LayoutNGBlockFlow (positioned) DIV id='container'",
       "bounds": [600, 600],
       "contentsOpaque": true,
       "backgroundColor": "#FF0000",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='inner'",
+          "object": "LayoutNGBlockFlow DIV id='inner'",
           "rect": [0, 0, 600, 600],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
index 754e6a60f..55af056 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'xx'",
-          "rect": [8, 8, 48, 33],
+          "object": "NGPhysicalTextFragment 'xx'",
+          "rect": [8, 8, 48, 32],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'y'",
-          "rect": [8, 8, 48, 33],
+          "object": "NGPhysicalTextFragment 'y'",
+          "rect": [8, 8, 48, 32],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
index bae25100..52e204b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'xx'",
-          "rect": [0, 8, 40, 33],
+          "object": "NGPhysicalTextFragment 'xx'",
+          "rect": [0, 8, 40, 32],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'y'",
-          "rect": [0, 8, 40, 33],
+          "object": "NGPhysicalTextFragment 'y'",
+          "rect": [0, 8, 40, 32],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
index 2eee78ca..7507e2e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'xx'",
-          "rect": [8, 8, 33, 48],
+          "object": "NGPhysicalTextFragment 'xx'",
+          "rect": [8, 8, 32, 48],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'y'",
-          "rect": [8, 8, 33, 48],
+          "object": "NGPhysicalTextFragment 'y'",
+          "rect": [8, 8, 32, 48],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
index b11c4e5..7507e2e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'xx'",
-          "rect": [7, 8, 33, 48],
+          "object": "NGPhysicalTextFragment 'xx'",
+          "rect": [8, 8, 32, 48],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'y'",
-          "rect": [7, 8, 33, 48],
+          "object": "NGPhysicalTextFragment 'y'",
+          "rect": [8, 8, 32, 48],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
index 250b77aa..eb16fda 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
@@ -7,17 +7,17 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'b'",
-          "rect": [8, 24, 32, 17],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [24, 8, 16, 16],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'a'",
+          "object": "NGPhysicalTextFragment 'b'",
+          "rect": [8, 24, 16, 16],
+          "reason": "selection"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'a'",
           "rect": [8, 8, 16, 16],
           "reason": "selection"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/japanese-rl-selection-clear-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/japanese-rl-selection-clear-expected.txt
index cea15293..1d1c9e7 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/japanese-rl-selection-clear-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/japanese-rl-selection-clear-expected.txt
@@ -7,73 +7,73 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox '\u3042\u3063\u305F\u304B\u5FD8\u308C\u3066\u3057\u307E\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3042\u3063\u305F\u304B\u5FD8\u308C\u3066\u3057\u307E\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B\u3089\u3082\u691C\u7D22'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B\u3089\u3082\u691C\u7D22'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3059\u3002\u8A2A\u554F\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3059\u3002\u8A2A\u554F\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305B\u3063\u304B\u304F\u898B\u3064\u3051\u305F\u3059'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305B\u3063\u304B\u304F\u898B\u3064\u3051\u305F\u3059'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u305B\u3063\u304B\u304F\u898B\u3064\u3051\u305F\u3059\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u305B\u3063\u304B\u304F\u898B\u3064\u3051\u305F\u3059\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B \u306A\u3089\u30BF\u30A4\u30C8\u30EB\u3068\u30A2'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B \u306A\u3089\u30BF\u30A4\u30C8\u30EB\u3068\u30A2'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3064\u3051\u305F\u3059\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B\u3042\u3063\u305F\u304B\u5FD8'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3064\u3051\u305F\u3059\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B\u3042\u3063\u305F\u304B\u5FD8'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u306A\u3089\u30BF\u30A4\u30C8\u30EB\u3068\u30A2\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u306A\u3089\u30BF\u30A4\u30C8\u30EB\u3068\u30A2\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B\u3089\u3082\u691C\u7D22\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304B\u3089\u3082\u691C\u7D22\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B\u3042\u3063\u305F\u304B\u5FD8\u308C\u3066\u3057\u307E'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3070\u3089\u3057\u3044\u8A18\u4E8B\u304C\u3069\u3053\u306B\u3042\u3063\u305F\u304B\u5FD8\u308C\u3066\u3057\u307E'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u3089\u3082\u691C\u7D22\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305B\u3063\u304B\u304F\u898B'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u3089\u3082\u691C\u7D22\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u305B\u3063\u304B\u304F\u898B'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u308C\u3066\u3057\u307E\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B \u306A\u3089\u30BF\u30A4'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u308C\u3066\u3057\u307E\u3063\u305F\u7D4C\u9A13\u306F\u3042\u308A\u307E\u3059\u304B \u306A\u3089\u30BF\u30A4'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u30C8\u30EB\u3068\u30A2\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u30C8\u30EB\u3068\u30A2\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8'",
-          "rect": [334, 123, 441, 404],
+          "object": "NGPhysicalTextFragment '\u30C9\u30EC\u30B9\u3060\u3051\u3067\u306A\u304F\u3001\u8A2A\u554F\u3057\u305F\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8'",
+          "rect": [334, 123, 443, 404],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-change-in-iframe-with-relative-parent-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-change-in-iframe-with-relative-parent-expected.txt
index a76765bcf..724797f2 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-change-in-iframe-with-relative-parent-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-change-in-iframe-with-relative-parent-expected.txt
@@ -7,42 +7,42 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Bazz'",
+          "object": "NGPhysicalTextFragment 'Bazz'",
           "rect": [18, 238, 40, 10],
           "reason": "selection"
         },
         {
-          "object": "InlineTextBox 'Bar'",
+          "object": "NGPhysicalTextFragment 'Bar'",
           "rect": [18, 218, 30, 10],
           "reason": "selection"
         },
         {
-          "object": "InlineTextBox 'Foo'",
+          "object": "NGPhysicalTextFragment 'Foo'",
           "rect": [18, 198, 30, 10],
           "reason": "selection"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [58, 238, 10, 10],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [48, 218, 10, 10],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [48, 198, 10, 10],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [18, 228, 10, 10],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox '\n'",
+          "object": "NGPhysicalTextFragment '\n'",
           "rect": [18, 208, 10, 10],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-clear-after-move-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-clear-after-move-expected.txt
index aaadcbda..7170890 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-clear-after-move-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-clear-after-move-expected.txt
@@ -8,7 +8,7 @@
       "paintInvalidations": [
         {
           "object": "LayoutImage IMG",
-          "rect": [100, 300, 50, 50],
+          "rect": [100, 300, 50, 51],
           "reason": "selection"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-partial-invalidation-between-blocks-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-partial-invalidation-between-blocks-expected.txt
index d870a26..2b06c43d 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-partial-invalidation-between-blocks-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-partial-invalidation-between-blocks-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Second cell'",
-          "rect": [11, 35, 73, 19],
-          "reason": "selection"
+          "object": "NGPhysicalTextFragment 'Second cell'",
+          "rect": [11, 35, 74, 20],
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'First cell'",
-          "rect": [11, 11, 58, 19],
+          "object": "NGPhysicalTextFragment 'First cell'",
+          "rect": [11, 11, 58, 20],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-rl-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-rl-expected.txt
index fe1c886..bd9acd0 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-rl-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-rl-expected.txt
@@ -7,9 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Testing both hit testing'",
-          "rect": [773, 38, 19, 83],
-          "reason": "selection"
+          "object": "NGPhysicalTextFragment 'Testing both hit testing'",
+          "rect": [772, 8, 20, 143],
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-within-composited-scroller-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
index 050d5c91..644ce49 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF"
     },
     {
-      "name": "LayoutBlockFlow DIV id='scroller'",
+      "name": "LayoutNGBlockFlow DIV id='scroller'",
       "bounds": [200, 1620],
       "backgroundColor": "#D3D3D3",
       "transform": 2
@@ -17,9 +17,9 @@
       "bounds": [200, 200],
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'test'",
-          "rect": [0, 160, 21, 19],
-          "reason": "selection"
+          "object": "NGPhysicalTextFragment 'test'",
+          "rect": [0, 160, 22, 20],
+          "reason": "geometry"
         }
       ],
       "transform": 1
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-2-expected.txt
index 7be5e096..02dd6d6 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-2-expected.txt
@@ -7,8 +7,8 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Should have blue, not gray, highlight'",
-          "rect": [18, 18, 233, 19],
+          "object": "NGPhysicalTextFragment 'Should have blue, not gray, highlight'",
+          "rect": [18, 18, 233, 20],
           "reason": "selection"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-expected.txt
index 9b33c805..8332d6a9 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/selection/text-selection-rect-in-overflow-expected.txt
@@ -7,8 +7,8 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Should have green background'",
-          "rect": [8, 8, 197, 19],
+          "object": "NGPhysicalTextFragment 'Should have green background'",
+          "rect": [8, 8, 197, 20],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/stacked-diacritics-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/stacked-diacritics-expected.txt
index 37a1404..00c82cf2 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/stacked-diacritics-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/stacked-diacritics-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox '\u1EA6\u1EA4\u1EAA\u1EA8\u1EB0'",
+          "object": "NGPhysicalTextFragment '\u1EA6\u1EA4\u1EAA\u1EA8\u1EB0'",
           "rect": [19, 166, 130, 43],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/subtree-root-skipped-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/subtree-root-skipped-expected.txt
index 92792ca..ea9c98b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/subtree-root-skipped-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/subtree-root-skipped-expected.txt
@@ -7,6 +7,11 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
+          "object": "NGPhysicalTextFragment 'Selection is here'",
+          "rect": [8, 30, 103, 19],
+          "reason": "geometry"
+        },
+        {
           "object": "InlineTextBox 'PASS'",
           "rect": [10, 11, 35, 16],
           "reason": "appeared"
@@ -17,7 +22,7 @@
           "reason": "disappeared"
         },
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='div'",
+          "object": "LayoutNGBlockFlow (positioned) DIV id='div'",
           "rect": [8, 288, 10, 20],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/add-background-property-on-root-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/add-background-property-on-root-expected.txt
index c18a01b..2abc06a 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/add-background-property-on-root-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/add-background-property-on-root-expected.txt
@@ -7,14 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [8, 8, 100, 100],
-          "reason": "disappeared"
-        },
-        {
           "object": "LayoutSVGRoot svg",
           "rect": [8, 8, 100, 100],
           "reason": "chunk appeared"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
+          "rect": [8, 8, 100, 100],
+          "reason": "disappeared"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size-expected.txt
index 17673ba..1a58d6cc 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size-expected.txt
@@ -7,21 +7,21 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 8, 402, 402],
           "reason": "geometry"
         },
         {
-          "object": "LayoutEmbeddedObject object",
-          "rect": [9, 9, 400, 400],
-          "reason": "geometry"
-        },
-        {
           "object": "LayoutSVGRoot svg",
           "rect": [9, 9, 400, 400],
           "reason": "paint property change"
         },
         {
+          "object": "LayoutEmbeddedObject object",
+          "rect": [209, 9, 200, 400],
+          "reason": "incremental"
+        },
+        {
           "object": "LayoutSVGRoot svg",
           "rect": [9, 109, 200, 200],
           "reason": "paint property change"
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-expected.txt
index 4f275fc..10b4957 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-with-resources-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-with-resources-expected.txt
index 11af00d0..0eedb06 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-with-resources-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-content-with-resources-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-deep-shadow-tree-content-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-deep-shadow-tree-content-expected.txt
index 4e3dac7..9ce768e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-deep-shadow-tree-content-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-deep-shadow-tree-content-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-image-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-image-expected.txt
index 4beebf5..f616a1c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-image-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-image-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-inner-svg-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-inner-svg-expected.txt
index 65541e26..895557c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-inner-svg-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-inner-svg-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 52, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-expected.txt
index 1bab0415f9..ffd7ac5 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-with-symbol-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-with-symbol-expected.txt
index 4b94819..7c52c91e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-with-symbol-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-shadow-tree-content-with-symbol-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 72, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-on-symbol-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-on-symbol-expected.txt
index 3542424..f0b7035 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-on-symbol-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-on-symbol-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 52, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-without-attributes-on-symbol-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-without-attributes-on-symbol-expected.txt
index 00fa6eca..34711fc 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-without-attributes-on-symbol-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/relative-sized-use-without-attributes-on-symbol-expected.txt
@@ -7,7 +7,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 52, 402, 402],
           "reason": "geometry"
         },
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/remove-background-property-on-root-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/remove-background-property-on-root-expected.txt
index 5c1efcd..fa66761d 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/remove-background-property-on-root-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/remove-background-property-on-root-expected.txt
@@ -7,14 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [8, 8, 100, 100],
-          "reason": "appeared"
-        },
-        {
           "object": "LayoutSVGRoot svg",
           "rect": [8, 8, 100, 100],
           "reason": "chunk disappeared"
+        },
+        {
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV",
+          "rect": [8, 8, 100, 100],
+          "reason": "appeared"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/svg-image-change-content-size-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/svg-image-change-content-size-expected.txt
index ef568fbc..4a5941a 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/svg-image-change-content-size-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/svg/svg-image-change-content-size-expected.txt
@@ -7,14 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow div id='contentBox'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow div id='contentBox'",
           "rect": [8, 52, 602, 422],
           "reason": "geometry"
-        },
-        {
-          "object": "LayoutImage img",
-          "rect": [9, 53, 420, 420],
-          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/cached-change-cell-sl-border-color-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/cached-change-cell-sl-border-color-expected.txt
index 0b3e777..ed1a6809 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/cached-change-cell-sl-border-color-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/cached-change-cell-sl-border-color-expected.txt
@@ -12,12 +12,17 @@
           "reason": "style change"
         },
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='blockDiv'",
+          "object": "LayoutNGBlockFlow (positioned) DIV id='blockDiv'",
           "rect": [90, 30, 20, 20],
-          "reason": "full"
+          "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'A'",
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow (positioned) DIV id='blockDiv'",
+          "rect": [90, 30, 20, 20],
+          "reason": "disappeared"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'A'",
           "rect": [90, 30, 12, 19],
           "reason": "disappeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/composited-table-row-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/composited-table-row-expected.txt
index f4b75e4..16624dd 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/composited-table-row-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/composited-table-row-expected.txt
@@ -13,7 +13,7 @@
       "backgroundColor": "#FF0000",
       "paintInvalidations": [
         {
-          "object": "LayoutTableCell TD id='target'",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD id='target'",
           "rect": [0, 0, 37, 23],
           "reason": "appeared"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-percent-size-cell-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-percent-size-cell-expected.txt
index fde4e4b..7909350 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-percent-size-cell-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-percent-size-cell-expected.txt
@@ -22,24 +22,24 @@
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'ROW2'",
+          "object": "NGPhysicalTextFragment 'ROW2'",
           "rect": [3, 400, 46, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'ROW1'",
+          "object": "NGPhysicalTextFragment 'ROW1'",
           "rect": [3, 161, 46, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'ROW2'",
+          "object": "NGPhysicalTextFragment 'ROW2'",
           "rect": [3, 115, 46, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'ROW1'",
+          "object": "NGPhysicalTextFragment 'ROW1'",
           "rect": [3, 66, 46, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-vertical-align-cell-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-vertical-align-cell-expected.txt
index e1033ef8..7b84f9b7 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-vertical-align-cell-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-repaint-vertical-align-cell-expected.txt
@@ -7,14 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'MIDDLE'",
+          "object": "NGPhysicalTextFragment 'MIDDLE'",
           "rect": [3, 280, 63, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'MIDDLE'",
+          "object": "NGPhysicalTextFragment 'MIDDLE'",
           "rect": [3, 90, 63, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-row-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-row-repaint-expected.txt
index f6b0bccd..1559ba0 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-row-repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/resize-table-row-repaint-expected.txt
@@ -7,14 +7,14 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'MIDDLE'",
+          "object": "NGPhysicalTextFragment 'MIDDLE'",
           "rect": [3, 192, 63, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'MIDDLE'",
+          "object": "NGPhysicalTextFragment 'MIDDLE'",
           "rect": [3, 142, 63, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-collapsed-border-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-collapsed-border-expected.txt
index 2d1841b..92abdcd 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-collapsed-border-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-collapsed-border-expected.txt
@@ -57,79 +57,49 @@
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'ipsum dolor'",
+          "object": "NGPhysicalTextFragment 'ipsum dolor'",
           "rect": [23, 317, 76, 19],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'ipsum dolor'",
+          "object": "NGPhysicalTextFragment 'ipsum dolor'",
           "rect": [23, 133, 76, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'sit amet'",
+          "object": "NGPhysicalTextFragment 'sit amet'",
           "rect": [23, 339, 49, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'sit amet'",
-          "rect": [23, 339, 49, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'sit amet'",
+          "object": "NGPhysicalTextFragment 'sit amet'",
           "rect": [23, 155, 49, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'sit amet'",
-          "rect": [23, 155, 49, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'Lorem'",
+          "object": "NGPhysicalTextFragment 'Lorem'",
           "rect": [23, 295, 43, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Lorem'",
-          "rect": [23, 295, 43, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'Lorem'",
+          "object": "NGPhysicalTextFragment 'Lorem'",
           "rect": [23, 111, 43, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'Lorem'",
-          "rect": [23, 111, 43, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'dolor'",
+          "object": "NGPhysicalTextFragment 'dolor'",
           "rect": [23, 225, 34, 19],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [17, 225, 4, 19],
-          "reason": "appeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '\u00A0'",
-          "rect": [17, 225, 4, 19],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox '\u00A0'",
+          "object": "NGPhysicalTextFragment '\u00A0'",
           "rect": [17, 133, 4, 19],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox '\u00A0'",
-          "rect": [17, 133, 4, 19],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-shrink-row-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-shrink-row-repaint-expected.txt
index 2343ed7..e8285c2 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-shrink-row-repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/table/table-shrink-row-repaint-expected.txt
@@ -7,217 +7,217 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutTableCell TD id='resizeMe'",
+          "object": "LayoutNGTableCell TD id='resizeMe'",
           "rect": [8, 112, 769, 210],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 782, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 742, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 722, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 682, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 662, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 622, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 602, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 562, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 542, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 502, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 482, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 442, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 422, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 382, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 362, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 322, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 302, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 242, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 182, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 122, 769, 60],
           "reason": "geometry"
         },
         {
-          "object": "LayoutTableCell TD",
+          "object": "NGPhysicalBoxFragment LayoutNGTableCell TD",
           "rect": [8, 802, 769, 48],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '10'",
+          "object": "NGPhysicalTextFragment '10'",
           "rect": [13, 822, 16, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '13'",
+          "object": "NGPhysicalTextFragment '13'",
           "rect": [13, 802, 16, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '12'",
+          "object": "NGPhysicalTextFragment '12'",
           "rect": [13, 742, 16, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '10'",
+          "object": "NGPhysicalTextFragment '10'",
           "rect": [13, 622, 16, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '11'",
+          "object": "NGPhysicalTextFragment '11'",
           "rect": [13, 682, 15, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '9'",
+          "object": "NGPhysicalTextFragment '9'",
           "rect": [13, 762, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '8'",
+          "object": "NGPhysicalTextFragment '8'",
           "rect": [13, 702, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '7'",
+          "object": "NGPhysicalTextFragment '7'",
           "rect": [13, 642, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '6'",
+          "object": "NGPhysicalTextFragment '6'",
           "rect": [13, 582, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '9'",
+          "object": "NGPhysicalTextFragment '9'",
           "rect": [13, 562, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '5'",
+          "object": "NGPhysicalTextFragment '5'",
           "rect": [13, 522, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '8'",
+          "object": "NGPhysicalTextFragment '8'",
           "rect": [13, 502, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '4'",
+          "object": "NGPhysicalTextFragment '4'",
           "rect": [13, 462, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '7'",
+          "object": "NGPhysicalTextFragment '7'",
           "rect": [13, 442, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '3'",
+          "object": "NGPhysicalTextFragment '3'",
           "rect": [13, 402, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '6'",
+          "object": "NGPhysicalTextFragment '6'",
           "rect": [13, 382, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '2'",
+          "object": "NGPhysicalTextFragment '2'",
           "rect": [13, 342, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '5'",
+          "object": "NGPhysicalTextFragment '5'",
           "rect": [13, 322, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '4'",
+          "object": "NGPhysicalTextFragment '4'",
           "rect": [13, 262, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '3'",
+          "object": "NGPhysicalTextFragment '3'",
           "rect": [13, 202, 8, 19],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox '2'",
+          "object": "NGPhysicalTextFragment '2'",
           "rect": [13, 142, 8, 19],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/text-append-dirty-lines-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/text-append-dirty-lines-expected.txt
index dda3984..0d8203f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/text-append-dirty-lines-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/text-append-dirty-lines-expected.txt
@@ -7,49 +7,39 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Curabitur a velit'",
-          "rect": [8, 44, 756, 139],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'Curabitur a velit.'",
-          "rect": [8, 44, 756, 139],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse placerat. Morbi tristique. Mauris eu lacus sed felis'",
+          "object": "NGPhysicalTextFragment 'Curabitur a velit.'",
           "rect": [8, 44, 756, 139],
           "reason": "full"
         },
         {
-          "object": "InlineTextBox 'fermentum ut, tortor. Sed rhoncus. Quisque enim metus, luctus tincidunt, vestibulum eu, vestibulum eu, libero. Mauris'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse placerat. Morbi tristique. Mauris eu lacus sed felis'",
           "rect": [8, 44, 756, 139],
           "reason": "full"
         },
         {
-          "object": "InlineTextBox 'feugiat molestie, mi lorem bibendum leo, ac gravida orci nunc nec nulla. Nunc nunc lorem, rhoncus et, rutrum ac,'",
+          "object": "NGPhysicalTextFragment 'fermentum ut, tortor. Sed rhoncus. Quisque enim metus, luctus tincidunt, vestibulum eu, vestibulum eu, libero. Mauris'",
           "rect": [8, 44, 756, 139],
           "reason": "full"
         },
         {
-          "object": "InlineTextBox 'laoreet feugiat. Phasellus mollis pulvinar mi. Etiam ut neque sed eros egestas laoreet. Vestibulum ullamcorper, nulla non'",
+          "object": "NGPhysicalTextFragment 'feugiat molestie, mi lorem bibendum leo, ac gravida orci nunc nec nulla. Nunc nunc lorem, rhoncus et, rutrum ac,'",
           "rect": [8, 44, 756, 139],
           "reason": "full"
         },
         {
-          "object": "InlineTextBox 'pellentesque cursus. Proin vitae nulla. Vivamus in ipsum. Etiam mi. Nam malesuada purus in sem. Sed eget elit vel erat'",
+          "object": "NGPhysicalTextFragment 'laoreet feugiat. Phasellus mollis pulvinar mi. Etiam ut neque sed eros egestas laoreet. Vestibulum ullamcorper, nulla non'",
           "rect": [8, 44, 756, 139],
           "reason": "full"
         },
         {
-          "object": "InlineTextBox 'sagittis aliquam nunc. Nullam pharetra molestie eros. Donec tempus purus ut ligula. Phasellus non nisl. Etiam eu mauris.'",
+          "object": "NGPhysicalTextFragment 'pellentesque cursus. Proin vitae nulla. Vivamus in ipsum. Etiam mi. Nam malesuada purus in sem. Sed eget elit vel erat'",
           "rect": [8, 44, 756, 139],
-          "reason": "appeared"
+          "reason": "full"
         },
         {
-          "object": "InlineTextBox 'sagittis aliquam nunc. Nullam pharetra molestie eros. Donec tempus purus ut ligula. Phasellus non nisl. Etiam eu mauris.'",
+          "object": "NGPhysicalTextFragment 'sagittis aliquam nunc. Nullam pharetra molestie eros. Donec tempus purus ut ligula. Phasellus non nisl. Etiam eu mauris.'",
           "rect": [8, 44, 756, 139],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-inline-layered-child-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-inline-layered-child-expected.txt
index 7a4483b..3b34aaf 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-inline-layered-child-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-inline-layered-child-expected.txt
@@ -7,13 +7,13 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='box'",
-          "rect": [135, 361, 159, 195],
+          "object": "LayoutNGBlockFlow (positioned) DIV id='box'",
+          "rect": [135, 361, 159, 194],
           "reason": "chunk appeared"
         },
         {
-          "object": "LayoutBlockFlow HTML",
-          "rect": [300, 302, 80, 177],
+          "object": "LayoutNGBlockFlow HTML",
+          "rect": [300, 302, 80, 176],
           "reason": "chunk disappeared"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-layout-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-layout-repaint-expected.txt
index cee53a7..9880e55f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-layout-repaint-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/transform/transform-layout-repaint-expected.txt
@@ -7,19 +7,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target'",
-          "rect": [40, 50, 208, 118],
-          "reason": "geometry"
-        },
-        {
-          "object": "InlineTextBox 'PASS'",
+          "object": "NGPhysicalTextFragment 'PASS'",
           "rect": [52, 51, 43, 32],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'FAIL'",
-          "rect": [52, 51, 40, 31],
-          "reason": "disappeared"
+          "reason": "full"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length1-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length1-expected.txt
index 3f2acd83..55a581f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length1-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length1-expected.txt
@@ -7,27 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target'",
-          "rect": [20, 0, 100, 100],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [120, 130, 20, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [120, 100, 20, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [0, 130, 20, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [0, 100, 20, 20],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length2-expected.txt
index 825563ee..3478a1c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align-length2-expected.txt
@@ -7,22 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV class='other'",
-          "rect": [300, 0, 200, 200],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='other'",
-          "rect": [0, 0, 200, 200],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV id='target'",
           "rect": [200, 80, 100, 100],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV id='target'",
           "rect": [200, 50, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align1-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align1-expected.txt
index 1506b6c0..a8cec71f 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align1-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align1-expected.txt
@@ -7,27 +7,22 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV id='target'",
-          "rect": [20, 0, 100, 100],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [120, 33, 20, 21],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [0, 33, 20, 21],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [120, 80, 20, 20],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='other'",
+          "object": "LayoutNGBlockFlow DIV class='other'",
           "rect": [0, 80, 20, 20],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align2-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align2-expected.txt
index 3f8b93ea..f673c7b 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align2-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-align2-expected.txt
@@ -7,22 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow DIV class='other'",
-          "rect": [300, 0, 200, 200],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='other'",
-          "rect": [0, 0, 200, 200],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV id='target'",
           "rect": [200, 146, 100, 101],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV id='target'",
+          "object": "LayoutNGBlockFlow DIV id='target'",
           "rect": [200, 100, 100, 100],
           "reason": "geometry"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-rl-as-paint-container-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-rl-as-paint-container-expected.txt
index ec099fa..9b3fd1bf 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-rl-as-paint-container-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/vertical-rl-as-paint-container-expected.txt
@@ -7,28 +7,28 @@
       "backgroundColor": "#FFFFFF"
     },
     {
-      "name": "LayoutBlockFlow DIV id='target'",
+      "name": "LayoutNGBlockFlow DIV id='target'",
       "position": [528, 8],
       "bounds": [80, 340],
       "backfaceVisibility": "hidden",
       "paintInvalidations": [
         {
-          "object": "InlineTextBox 'Lorem ipsum dolor'",
+          "object": "NGPhysicalTextFragment 'Lorem ipsum dolor'",
           "rect": [0, 0, 80, 340],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'adipiscing elit.'",
+          "object": "NGPhysicalTextFragment 'adipiscing elit.'",
           "rect": [0, 0, 80, 340],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'consectetur'",
+          "object": "NGPhysicalTextFragment 'consectetur'",
           "rect": [0, 0, 80, 340],
           "reason": "style change"
         },
         {
-          "object": "InlineTextBox 'sit amet,'",
+          "object": "NGPhysicalTextFragment 'sit amet,'",
           "rect": [0, 0, 80, 340],
           "reason": "style change"
         }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-centered-inline-under-fixed-pos-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-centered-inline-under-fixed-pos-expected.txt
index c990e7a..6ff1f2c 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-centered-inline-under-fixed-pos-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-centered-inline-under-fixed-pos-expected.txt
@@ -7,17 +7,12 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV class='container'",
+          "object": "LayoutNGBlockFlow (positioned) DIV class='container'",
           "rect": [0, 0, 600, 250],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow DIV class='parent'",
-          "rect": [0, 0, 6, 250],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow (relative positioned) DIV class='child'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV class='child'",
           "rect": [0, 125, 6, 30],
           "reason": "geometry"
         }
@@ -34,19 +29,9 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV class='container'",
+          "object": "LayoutNGBlockFlow (positioned) DIV class='container'",
           "rect": [0, 0, 400, 250],
           "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='parent'",
-          "rect": [0, 0, 6, 250],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow (relative positioned) DIV class='child'",
-          "rect": [0, 125, 6, 30],
-          "reason": "geometry"
         }
       ]
     }
@@ -61,7 +46,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV class='container'",
+          "object": "LayoutNGBlockFlow (positioned) DIV class='container'",
           "rect": [0, 0, 400, 600],
           "reason": "geometry"
         },
@@ -71,17 +56,17 @@
           "reason": "incremental"
         },
         {
-          "object": "LayoutBlockFlow DIV class='parent'",
-          "rect": [0, 0, 6, 600],
-          "reason": "geometry"
+          "object": "NGPhysicalBoxFragment LayoutNGBlockFlow DIV class='parent'",
+          "rect": [0, 250, 6, 350],
+          "reason": "incremental"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV class='child'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV class='child'",
           "rect": [0, 300, 6, 30],
           "reason": "geometry"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV class='child'",
+          "object": "LayoutNGBlockFlow (relative positioned) DIV class='child'",
           "rect": [0, 125, 6, 30],
           "reason": "geometry"
         }
@@ -98,7 +83,7 @@
       "backgroundColor": "#FFFFFF",
       "paintInvalidations": [
         {
-          "object": "LayoutBlockFlow (positioned) DIV class='container'",
+          "object": "LayoutNGBlockFlow (positioned) DIV class='container'",
           "rect": [0, 0, 800, 600],
           "reason": "geometry"
         },
@@ -106,16 +91,6 @@
           "object": "Scrolling background of LayoutView #document",
           "rect": [400, 0, 400, 600],
           "reason": "incremental"
-        },
-        {
-          "object": "LayoutBlockFlow DIV class='parent'",
-          "rect": [0, 0, 6, 600],
-          "reason": "geometry"
-        },
-        {
-          "object": "LayoutBlockFlow (relative positioned) DIV class='child'",
-          "rect": [0, 300, 6, 30],
-          "reason": "geometry"
         }
       ]
     }
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
index 4a78c7f..dc082a6 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
@@ -12,67 +12,67 @@
           "reason": "background"
         },
         {
-          "object": "InlineTextBox 'AAAA'",
+          "object": "NGPhysicalTextFragment 'AAAA'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'BBBB'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'CCCC'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'DDDD'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'EEEE'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'FFFF'",
+          "rect": [10, 8, 920, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'GGGG'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'BBBB'",
+          "object": "NGPhysicalTextFragment 'HHHH'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'CCCC'",
+          "object": "NGPhysicalTextFragment 'IIII JJJJ'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'DDDD'",
+          "object": "NGPhysicalTextFragment 'KKKK'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'EEEE'",
+          "object": "NGPhysicalTextFragment 'LLLL'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'FFFF'",
+          "object": "NGPhysicalTextFragment 'MMMM'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
         {
-          "object": "InlineTextBox 'GGGG'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'HHHH'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'IIII JJJJ'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'KKKK'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'LLLL'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'MMMM'",
-          "rect": [10, 8, 920, 212],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'NNNN'",
+          "object": "NGPhysicalTextFragment 'NNNN'",
           "rect": [10, 8, 920, 212],
           "reason": "appeared"
         },
@@ -82,34 +82,34 @@
           "reason": "background"
         },
         {
-          "object": "InlineTextBox 'AAAA BBBB'",
+          "object": "NGPhysicalTextFragment 'AAAA'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'CCCC DDDD'",
+          "object": "NGPhysicalTextFragment 'BBBB'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'EEEE FFFF GGGG'",
+          "object": "NGPhysicalTextFragment 'CCCC'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'HHHH IIII JJJJ'",
+          "object": "NGPhysicalTextFragment 'DDDD'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'KKKK LLLL'",
+          "object": "NGPhysicalTextFragment 'EEEE'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'MMMM NNNN'",
+          "object": "NGPhysicalTextFragment 'FFFF'",
           "rect": [168, 8, 423, 227],
-          "reason": "disappeared"
+          "reason": "geometry"
         }
       ],
       "transform": 1
@@ -199,94 +199,94 @@
           "reason": "background"
         },
         {
-          "object": "InlineTextBox 'AAAA'",
+          "object": "NGPhysicalTextFragment 'AAAA BBBB CCCC'",
+          "rect": [10, 8, 390, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'DDDD EEEE FFFF'",
+          "rect": [10, 8, 390, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'FFFF'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'BBBB'",
+          "object": "NGPhysicalTextFragment 'GGGG HHHH IIII JJJJ'",
+          "rect": [10, 8, 390, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'GGGG'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'CCCC'",
+          "object": "NGPhysicalTextFragment 'HHHH'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'DDDD'",
+          "object": "NGPhysicalTextFragment 'IIII JJJJ'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'EEEE'",
+          "object": "NGPhysicalTextFragment 'KKKK LLLL MMMM'",
+          "rect": [10, 8, 390, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'KKKK'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'FFFF'",
+          "object": "NGPhysicalTextFragment 'LLLL'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'GGGG'",
+          "object": "NGPhysicalTextFragment 'MMMM'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'HHHH'",
+          "object": "NGPhysicalTextFragment 'NNNN'",
+          "rect": [10, 8, 390, 212],
+          "reason": "geometry"
+        },
+        {
+          "object": "NGPhysicalTextFragment 'NNNN'",
           "rect": [10, 8, 390, 212],
           "reason": "disappeared"
         },
         {
-          "object": "InlineTextBox 'IIII JJJJ'",
-          "rect": [10, 8, 390, 212],
-          "reason": "disappeared"
+          "object": "NGPhysicalTextFragment 'AAAA BBBB CCCC'",
+          "rect": [39, 8, 352, 561],
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'KKKK'",
-          "rect": [10, 8, 390, 212],
-          "reason": "disappeared"
+          "object": "NGPhysicalTextFragment 'DDDD EEEE FFFF'",
+          "rect": [39, 8, 352, 561],
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'LLLL'",
-          "rect": [10, 8, 390, 212],
-          "reason": "disappeared"
+          "object": "NGPhysicalTextFragment 'GGGG HHHH IIII JJJJ'",
+          "rect": [39, 8, 352, 561],
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'MMMM'",
-          "rect": [10, 8, 390, 212],
-          "reason": "disappeared"
+          "object": "NGPhysicalTextFragment 'KKKK LLLL MMMM'",
+          "rect": [39, 8, 352, 561],
+          "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'NNNN'",
-          "rect": [10, 8, 390, 212],
-          "reason": "disappeared"
-        },
-        {
-          "object": "InlineTextBox 'AAAA BBBB CCCC'",
-          "rect": [39, 8, 352, 562],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'DDDD EEEE FFFF'",
-          "rect": [39, 8, 352, 562],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'GGGG HHHH IIII JJJJ'",
-          "rect": [39, 8, 352, 562],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'KKKK LLLL MMMM'",
-          "rect": [39, 8, 352, 562],
-          "reason": "appeared"
-        },
-        {
-          "object": "InlineTextBox 'NNNN'",
-          "rect": [39, 8, 352, 562],
-          "reason": "appeared"
+          "object": "NGPhysicalTextFragment 'NNNN'",
+          "rect": [39, 8, 352, 561],
+          "reason": "geometry"
         }
       ]
     }
@@ -306,53 +306,53 @@
           "reason": "incremental"
         },
         {
-          "object": "InlineTextBox 'AAAA BBBB CCCC'",
-          "rect": [439, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'AAAA BBBB CCCC'",
+          "rect": [439, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'DDDD EEEE FFFF'",
-          "rect": [439, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'DDDD EEEE FFFF'",
+          "rect": [439, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'GGGG HHHH IIII JJJJ'",
-          "rect": [439, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'GGGG HHHH IIII JJJJ'",
+          "rect": [439, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'KKKK LLLL MMMM'",
-          "rect": [439, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'KKKK LLLL MMMM'",
+          "rect": [439, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'NNNN'",
-          "rect": [439, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'NNNN'",
+          "rect": [439, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'AAAA BBBB CCCC'",
-          "rect": [39, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'AAAA BBBB CCCC'",
+          "rect": [39, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'DDDD EEEE FFFF'",
-          "rect": [39, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'DDDD EEEE FFFF'",
+          "rect": [39, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'GGGG HHHH IIII JJJJ'",
-          "rect": [39, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'GGGG HHHH IIII JJJJ'",
+          "rect": [39, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'KKKK LLLL MMMM'",
-          "rect": [39, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'KKKK LLLL MMMM'",
+          "rect": [39, 8, 352, 561],
           "reason": "geometry"
         },
         {
-          "object": "InlineTextBox 'NNNN'",
-          "rect": [39, 8, 352, 562],
+          "object": "NGPhysicalTextFragment 'NNNN'",
+          "rect": [39, 8, 352, 561],
           "reason": "geometry"
         }
       ]
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/overflow-scrollbar-combinations-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/overflow-scrollbar-combinations-expected.png
index b2a3ef1..de423820 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/overflow-scrollbar-combinations-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/overflow-scrollbar-combinations-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-expected.png
deleted file mode 100644
index 83ec41f..0000000
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png
index 2feef75..b967c28 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug131020-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug131020-expected.png
index 521f303..f2f1527 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug131020-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug131020-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug59354-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug59354-expected.png
index 17694d94..64c2790 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug59354-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla/bugs/bug59354-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png
index 62a22d4e..f93ad74e 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/basic-scrollbar-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/basic-scrollbar-expected.png
similarity index 97%
rename from third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/basic-scrollbar-expected.png
rename to third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/basic-scrollbar-expected.png
index f9bc8cec..a796efb9 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/basic-scrollbar-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/basic-scrollbar-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/disabled-scrollbar-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/disabled-scrollbar-expected.png
similarity index 96%
rename from third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/disabled-scrollbar-expected.png
rename to third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/disabled-scrollbar-expected.png
index fbfdde0..b5c429b8 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/disabled-scrollbar-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/disabled-scrollbar-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-buttons-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-buttons-expected.png
similarity index 96%
rename from third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-buttons-expected.png
rename to third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-buttons-expected.png
index 04ded31..5909d0e4 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-buttons-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-buttons-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-orientation-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-orientation-expected.png
similarity index 97%
rename from third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-orientation-expected.png
rename to third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-orientation-expected.png
index 5fe8a64..ec5ec09 100644
--- a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/scrollbars/scrollbar-orientation-expected.png
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-orientation-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/threaded/animations/rotate-transform-equivalent-expected.png b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/threaded/animations/rotate-transform-equivalent-expected.png
new file mode 100644
index 0000000..95695bb
--- /dev/null
+++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=CompositeAfterPaint/virtual/threaded/animations/rotate-transform-equivalent-expected.png
Binary files differ
diff --git a/third_party/blink/web_tests/media/picture-in-picture/v2/detached-iframe.html b/third_party/blink/web_tests/media/picture-in-picture/v2/detached-iframe.html
index a53bb97..dca52300 100644
--- a/third_party/blink/web_tests/media/picture-in-picture/v2/detached-iframe.html
+++ b/third_party/blink/web_tests/media/picture-in-picture/v2/detached-iframe.html
@@ -20,6 +20,6 @@
   const element = frame.contentDocument.createElement('div');
   document.body.removeChild(frame);
   return promise_rejects(t, 'InvalidStateError',
-    requestPictureInPictureWithTrustedClick(element, { aspectRatio: 1 }));
+    requestPictureInPictureWithTrustedClick(element, { height: 1, width: 1 }));
 }, 'request Picture-in-Picture rejects when frame is detached');
 </script>
diff --git a/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture-twice.html b/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture-twice.html
index a1084cb..c075649e 100644
--- a/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture-twice.html
+++ b/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture-twice.html
@@ -8,7 +8,7 @@
 <script src="utils.js"></script>
 <body></body>
 <script>
-const options = { aspectRatio: 1 };
+const options = { height: 1, width: 1 };
 
 promise_test(async t => {
   enablePictureInPictureV2ForTest(t);
@@ -30,6 +30,6 @@
   assert_equals(document.pictureInPictureElement, video);
 
   const element = document.createElement('div');
-  return element.requestPictureInPicture({ aspectRatio: 1 });
+  return element.requestPictureInPicture({ height: 1, width: 1 });
 }, 'request Picture-in-Picture does not require user gesture if document.pictureInPictureElement is set');
 </script>
diff --git a/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture.html b/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture.html
index de99c65..745d4c04 100644
--- a/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture.html
+++ b/third_party/blink/web_tests/media/picture-in-picture/v2/request-picture-in-picture.html
@@ -19,35 +19,99 @@
   enablePictureInPictureV2ForTest(t);
 
   const element = document.getElementById('example');
-  return requestPictureInPictureWithTrustedClick(element, { aspectRatio: 1 });
+  return requestPictureInPictureWithTrustedClick(element, { height: 1, width: 1 });
 }, 'request Picture-in-Picture resolves on user click');
 
 promise_test(async t => {
   enablePictureInPictureV2ForTest(t);
 
   const element = document.getElementById('example');
-  return requestPictureInPictureWithTrustedClick(element, { aspectRatio: 1, interactive: true });
+  return requestPictureInPictureWithTrustedClick(element, { height: 1, width: 1, interactive: true });
 }, 'request Picture-in-Picture takes an interactive option that can be true');
 
 promise_test(async t => {
   enablePictureInPictureV2ForTest(t);
 
   const element = document.getElementById('example');
-  return requestPictureInPictureWithTrustedClick(element, { aspectRatio: 1, interactive: false });
+  return requestPictureInPictureWithTrustedClick(element, { height: 1, width: 1, interactive: false });
 }, 'request Picture-in-Picture takes an interactive option that can be false');
 
 promise_test(async t => {
   enablePictureInPictureV2ForTest(t);
 
   const element = document.getElementById('example');
-  return requestPictureInPictureWithTrustedClick(element, { aspectRatio: 1, interactive: 'test' });
+  return requestPictureInPictureWithTrustedClick(element, { height: 1, width: 1, interactive: 'test' });
 }, 'request Picture-in-Picture validates interactive option');
 
 promise_test(async t => {
   enablePictureInPictureV2ForTest(t);
 
   const element = document.getElementById('example');
-  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({}));
-}, 'request Picture-in-Picture requires aspect ratio option');
+  return requestPictureInPictureWithTrustedClick(element, {});
+}, 'request Picture-in-Picture does not require width/height by default');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ height: 1 }));
+}, 'request Picture-in-Picture requires width option if height present');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 1 }));
+}, 'request Picture-in-Picture requires height option if width present');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: -10, height: -10 }));
+}, 'request Picture-in-Picture requires width/height to be positive (both negative)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 10, height: -10 }));
+}, 'request Picture-in-Picture requires width/height to be positive (negative width)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: -10, height: 10 }));
+}, 'request Picture-in-Picture requires width/height to be positive (negative height)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 0, height: 0 }));
+}, 'request Picture-in-Picture requires width/height to not be zero (both zero)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 10, height: 0 }));
+}, 'request Picture-in-Picture requires width/height to not be zero (width zero)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 0, height: 10 }));
+}, 'request Picture-in-Picture requires width/height to not be zero (height zero)');
+
+promise_test(async t => {
+  enablePictureInPictureV2ForTest(t);
+
+  const element = document.getElementById('example');
+  await test_driver.bless('request Picture-in-Picture');
+  return element.requestPictureInPicture();
+}, 'request Picture-in-Picture does not require options');
 </script>
 </body>
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 a9f9d79..d6767a5 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
@@ -638,6 +638,7 @@
     property frameBorder
     property getSVGDocument
     property height
+    property loading
     property longDesc
     property marginHeight
     property marginWidth
@@ -662,6 +663,7 @@
     property importance
     property intrinsicSize
     property isMap
+    property loading
     property longDesc
     property lowsrc
     property name
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 7b41786..cb3cf6a7 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
@@ -3120,6 +3120,7 @@
     getter featurePolicy
     getter frameBorder
     getter height
+    getter loading
     getter longDesc
     getter marginHeight
     getter marginWidth
@@ -3139,6 +3140,7 @@
     setter csp
     setter frameBorder
     setter height
+    setter loading
     setter longDesc
     setter marginHeight
     setter marginWidth
@@ -3163,6 +3165,7 @@
     getter importance
     getter intrinsicSize
     getter isMap
+    getter loading
     getter longDesc
     getter lowsrc
     getter name
@@ -3189,6 +3192,7 @@
     setter importance
     setter intrinsicSize
     setter isMap
+    setter loading
     setter longDesc
     setter lowsrc
     setter name
@@ -4242,6 +4246,7 @@
     getter importance
     getter intrinsicSize
     getter isMap
+    getter loading
     getter longDesc
     getter lowsrc
     getter name
@@ -4268,6 +4273,7 @@
     setter importance
     setter intrinsicSize
     setter isMap
+    setter loading
     setter longDesc
     setter lowsrc
     setter name
diff --git a/third_party/blink/web_tests/xr/xrInputSource_gamepad_disconnect.html b/third_party/blink/web_tests/xr/xrInputSource_gamepad_disconnect.html
index f0f33745..25714d44 100644
--- a/third_party/blink/web_tests/xr/xrInputSource_gamepad_disconnect.html
+++ b/third_party/blink/web_tests/xr/xrInputSource_gamepad_disconnect.html
@@ -50,12 +50,17 @@
         // have an input source.
         assert_equals(session.inputSources.length, 1,
           "removing the gamepad shouldn't remove the input source");
+        // However, disconnecting the gamepad from the input source should cause
+        // the input source to be re-created. Verify this.
+        assertInputSourceRecreated(event);
         assertGamepadDisconnected();
+        cached_input_source = session.inputSources[0];
       } else if (inputChangeEvents === 3) {
         assert_equals(session.inputSources.length, 1,
           "re-adding the gamepad shouldn't add an extra input source");
         // The third event should be reconnecting our gamepad, we should still
-        // have an input source.
+        // have an input source. However, it should have been re-created.
+        assertInputSourceRecreated(event);
         assertGamepadConnected();
       } else if (inputChangeEvents === 4) {
         // The fourth event should be disconnecting our gamepad, we should no
@@ -67,13 +72,20 @@
         // The fifth event should be re-connecting our gamepad to prep for
         // ending the session.
         assert_equals(session.inputSources.length, 1,
-        "input source should have been re-connected");
+          "input source should have been re-connected");
         assertGamepadConnected();
         session.dispatchEvent(watcherDone);
       }
     });
   }
 
+  function assertInputSourceRecreated(event) {
+    assert_equals(event.added.length, 1);
+    assert_equals(event.removed.length, 1);
+    assert_equals(session.inputSources[0], event.added[0]);
+    assert_equals(cached_input_source, event.removed[0]);
+  }
+
   function assertGamepadConnected() {
     cached_input_source = session.inputSources[0];
     assert_not_equals(cached_input_source, null,
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium
index 55994a05..f26ddc6 100644
--- a/third_party/libvpx/README.chromium
+++ b/third_party/libvpx/README.chromium
@@ -5,9 +5,9 @@
 License File: source/libvpx/LICENSE
 Security Critical: yes
 
-Date: Saturday June 15 2019
+Date: Thursday June 20 2019
 Branch: master
-Commit: bb9511684f70a735b3b909712666021e178c93e7
+Commit: 7d9288f5f86e1b0a03ae5a555dc034e7055845ca
 
 Description:
 Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/libvpx_srcs.gni b/third_party/libvpx/libvpx_srcs.gni
index 6a9ae8a..bbe73b89 100644
--- a/third_party/libvpx/libvpx_srcs.gni
+++ b/third_party/libvpx/libvpx_srcs.gni
@@ -354,6 +354,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -823,6 +824,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -1277,6 +1279,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -1673,6 +1676,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -2036,6 +2040,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -2508,6 +2513,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -2920,6 +2926,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -3355,6 +3362,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -3689,6 +3697,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -4022,6 +4031,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
@@ -4355,6 +4365,7 @@
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_atomics.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h",
+  "//third_party/libvpx/source/libvpx/vpx_util/vpx_timestamp.h",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.c",
   "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h",
 ]
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h
index 330e299b..88a37b48 100644
--- a/third_party/libvpx/source/config/vpx_version.h
+++ b/third_party/libvpx/source/config/vpx_version.h
@@ -2,7 +2,7 @@
 #define VERSION_MAJOR  1
 #define VERSION_MINOR  8
 #define VERSION_PATCH  0
-#define VERSION_EXTRA  "551-gbb9511684f"
+#define VERSION_EXTRA  "564-g7d9288f5f8"
 #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))
-#define VERSION_STRING_NOSP "v1.8.0-551-gbb9511684f"
-#define VERSION_STRING      " v1.8.0-551-gbb9511684f"
+#define VERSION_STRING_NOSP "v1.8.0-564-g7d9288f5f8"
+#define VERSION_STRING      " v1.8.0-564-g7d9288f5f8"
diff --git a/tools/binary_size/sizes.gni b/tools/binary_size/sizes.gni
index 246304e0..c7213fc 100644
--- a/tools/binary_size/sizes.gni
+++ b/tools/binary_size/sizes.gni
@@ -33,6 +33,17 @@
         "--size-path",
         mac_bin_path + "size",
       ]
+
+      if (!defined(data)) {
+        data = []
+      }
+
+      # 'size' is a symlink to 'llvm-size', so throw both in there, but don't
+      # add the entire bin path since it's large.
+      data += [
+        mac_bin_path + "llvm-size",
+        mac_bin_path + "size",
+      ]
     }
   }
 }
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index 810c9b95..fcec84e 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -1175,6 +1175,7 @@
 
     is_android = 'target_os="android"' in vals['gn_args']
     is_fuchsia = 'target_os="fuchsia"' in vals['gn_args']
+    is_cros = 'target_os="chromeos"' in vals['gn_args']
     is_simplechrome = vals.get('cros_passthrough', False)
     is_mac = self.platform == 'darwin'
     is_win = self.platform == 'win32' or 'target_os="win"' in vals['gn_args']
@@ -1255,7 +1256,8 @@
           # Enable lsan when asan is enabled except on Windows where LSAN isn't
           # supported.
           # TODO(https://crbug.com/948939): Enable on Mac once things pass.
-          '--lsan=%d' % (asan and not is_mac and not is_win),
+          # TODO(https://crbug.com/974478): Enable on ChromeOS once things pass.
+          '--lsan=%d' % (asan and not is_mac and not is_win and not is_cros),
           '--msan=%d' % msan,
           '--tsan=%d' % tsan,
           '--cfi-diag=%d' % cfi_diag,
@@ -1269,7 +1271,8 @@
           # Enable lsan when asan is enabled except on Windows where LSAN isn't
           # supported.
           # TODO(https://crbug.com/948939): Enable on Mac once things pass.
-          '--lsan=%d' % (asan and not is_mac and not is_win),
+          # TODO(https://crbug.com/974478): Enable on ChromeOS once things pass.
+          '--lsan=%d' % (asan and not is_mac and not is_win and not is_cros),
           '--msan=%d' % msan,
           '--tsan=%d' % tsan,
           '--cfi-diag=%d' % cfi_diag,
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl
index 905e833..8686b687 100644
--- a/tools/mb/mb_config.pyl
+++ b/tools/mb/mb_config.pyl
@@ -26,7 +26,7 @@
     'chromium': {
       'android-archive-rel': 'android_without_codecs_release_bot_minimal_symbols',
       'android-archive-dbg': 'android_without_codecs_debug_bot',
-      'linux-archive-rel': 'release_bot_minimal_symbols',
+      'linux-archive-rel': 'release_bot',
       'linux-archive-dbg': 'debug_bot',
       'mac-archive-rel': 'release_bot_mac_strip_minimal_symbols',
       'mac-archive-dbg': 'debug_bot',
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index da801ed3..acd243f 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -20684,6 +20684,7 @@
   <int value="20" label="Unknown Request Error">
     Catch-all for unknown request failures.
   </int>
+  <int value="21" label="No SplitCompat">SplitCompat has not been enabled.</int>
 </enum>
 
 <enum name="FeatureObserver">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index f1b6e3c..d14c8832 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -9103,7 +9103,10 @@
 </histogram>
 
 <histogram name="Autofill.DaysSincePreviousUseAtSubmission.Profile"
-    units="days" expires_after="M83">
+    units="days" expires_after="M77">
+  <obsolete>
+    Deprecated as of 06/2019.
+  </obsolete>
   <owner>csashi@google.com</owner>
   <owner>jsaul@google.com</owner>
   <owner>sebsg@chromium.org</owner>
@@ -9315,6 +9318,9 @@
 
 <histogram name="Autofill.HasModifiedProfile.CreditCardFormSubmission"
     enum="Boolean" expires_after="M77">
+  <obsolete>
+    Deprecated as of 06/2019.
+  </obsolete>
   <owner>csashi@google.com</owner>
   <owner>jsaul@google.com</owner>
   <owner>sebsg@chromium.org</owner>
@@ -67128,8 +67134,9 @@
 </histogram>
 
 <histogram name="Net.CertVerifier_First_Job_Latency" units="ms"
-    expires_after="M77">
-  <owner>davidben@chromium.org</owner>
+    expires_after="M83">
+  <owner>mattm@chromium.org</owner>
+  <owner>net-dev@chromium.org</owner>
   <summary>
     The actual amount of time spent verifying a certificate using the underlying
     cryptographic APIs. Because parallel verifications for the same certificate
@@ -78977,6 +78984,9 @@
 
 <histogram name="NewTabPage.AnimatedLogoDownloadTime" units="ms"
     expires_after="M77">
+  <obsolete>
+    Removed 06/2019. No longer used.
+  </obsolete>
   <owner>treib@chromium.org</owner>
   <summary>
     The amount of time it takes to download the animated logo. Android only.
@@ -80283,8 +80293,8 @@
   </summary>
 </histogram>
 
-<histogram name="NewTabPage.NumberOfTiles" expires_after="M77">
-  <owner>treib@chromium.org</owner>
+<histogram name="NewTabPage.NumberOfTiles" expires_after="M87">
+  <owner>dbeam@chromium.org</owner>
   <summary>
     The number of tiles that are on the NTP, no matter if they are thumbnails,
     gray tiles, or external tiles. Recorded before reloading the suggestions,
@@ -123464,6 +123474,11 @@
 
 <histogram name="SiteIsolation.XSD.Browser.Blocked" enum="ContentResourceType2"
     expires_after="M77">
+  <obsolete>
+    Removed in June 2019 / M77. Some old data have been saved in a
+    Google-internal doc at
+    https://docs.google.com/document/d/1hgPpFD5GpxgWsTQvrA0eLunrG0mwb_uJgWWJmG_kVN4
+  </obsolete>
   <owner>creis@chromium.org</owner>
   <summary>
     The total count of responses that were blocked by the cross-site document
@@ -123520,6 +123535,11 @@
 
 <histogram name="SiteIsolation.XSD.Browser.BlockedForParserBreaker"
     enum="ContentResourceType2" expires_after="M77">
+  <obsolete>
+    Removed in June 2019 / M77. Some old data have been saved in a
+    Google-internal doc at
+    https://docs.google.com/document/d/1hgPpFD5GpxgWsTQvrA0eLunrG0mwb_uJgWWJmG_kVN4
+  </obsolete>
   <owner>creis@chromium.org</owner>
   <summary>
     The total count of responses that were blocked by the cross-site document
@@ -149440,14 +149460,24 @@
 </histogram_suffixes>
 
 <histogram_suffixes name="AndroidFeatureModuleInstallDuration" separator=".">
-  <suffix name="Downloading"
+  <suffix name="Download"
       label="Duration between download start and download end"/>
+  <suffix name="Downloading"
+      label="Duration between download start and download end">
+    <obsolete>
+      Deprecated in favor of 'Download'
+    </obsolete>
+  </suffix>
   <suffix name="Installing"
       label="Duration between install start and install end"/>
   <suffix name="PendingDownload"
-      label="Duration between request and downloast start"/>
+      label="Duration between request and download start"/>
   <suffix name="PendingInstall"
-      label="Duration between download end and install start"/>
+      label="Duration between download end and install start">
+    <obsolete>
+      State does not exist
+    </obsolete>
+  </suffix>
   <affected-histogram name="Android.FeatureModules.CachedInstallDuration"/>
   <affected-histogram name="Android.FeatureModules.UncachedInstallDuration"/>
 </histogram_suffixes>
@@ -162254,6 +162284,11 @@
 </histogram_suffixes>
 
 <histogram_suffixes name="SiteIsolation.XSD.MIME" separator=".">
+  <obsolete>
+    Removed in June 2019 / M77. Some old data have been saved in a
+    Google-internal doc at
+    https://docs.google.com/document/d/1hgPpFD5GpxgWsTQvrA0eLunrG0mwb_uJgWWJmG_kVN4
+  </obsolete>
   <suffix name="HTML" label="Classified as HTML MIME type."/>
   <suffix name="JSON" label="Classified as JSON MIME type."/>
   <suffix name="Others" label="Classified as other MIME types."/>
diff --git a/ui/android/overscroll_refresh.cc b/ui/android/overscroll_refresh.cc
index 13d546ef..e99b7664 100644
--- a/ui/android/overscroll_refresh.cc
+++ b/ui/android/overscroll_refresh.cc
@@ -73,7 +73,8 @@
 
   float ydelta = cumulative_scroll_.y();
   float xdelta = cumulative_scroll_.x();
-  bool in_y_direction = std::abs(ydelta) * kWeightAngle30 > std::abs(xdelta);
+  bool in_y_direction = std::abs(ydelta) > std::abs(xdelta);
+  bool in_x_direction = std::abs(ydelta) * kWeightAngle30 < std::abs(xdelta);
   OverscrollAction type = OverscrollAction::NONE;
   bool navigate_forward = false;
   if (ydelta > 0 && in_y_direction) {
@@ -84,7 +85,7 @@
       return;
     }
     type = OverscrollAction::PULL_TO_REFRESH;
-  } else if (!in_y_direction &&
+  } else if (in_x_direction &&
              (scroll_begin_x_ < edge_width_ ||
               viewport_width_ - scroll_begin_x_ < edge_width_)) {
     // Swipe-to-navigate. Check overscroll-behavior-x
diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc
index a72137c..a42e2f08 100644
--- a/ui/gl/gl_context.cc
+++ b/ui/gl/gl_context.cc
@@ -283,8 +283,9 @@
   state_restorer_ = base::WrapUnique(state_restorer);
 }
 
-bool GLContext::WasAllocatedUsingRobustnessExtension() {
-  return false;
+GLenum GLContext::CheckStickyGraphicsResetStatus() {
+  DCHECK(IsCurrent(nullptr));
+  return GL_NO_ERROR;
 }
 
 void GLContext::InitializeDynamicBindings() {
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index c31dc27..8170446 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -159,7 +159,12 @@
   // Returns the last GLContext made current, virtual or real.
   static GLContext* GetCurrent();
 
-  virtual bool WasAllocatedUsingRobustnessExtension();
+  // Returns the 'sticky' value of glGetGraphicsResetStatus, if available.
+  // 'sticky' implies that if glGetGraphicsResetStatus ever returns a value
+  // other than GL_NO_ERROR, that value is returned until the context is
+  // destroyed.
+  // The context must be current.
+  virtual unsigned int CheckStickyGraphicsResetStatus();
 
   // Make this context current when used for context virtualization.
   bool MakeVirtuallyCurrent(GLContext* virtual_context, GLSurface* surface);
diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc
index e839b08..f64fdd0 100644
--- a/ui/gl/gl_context_egl.cc
+++ b/ui/gl/gl_context_egl.cc
@@ -374,8 +374,17 @@
   return context_;
 }
 
-bool GLContextEGL::WasAllocatedUsingRobustnessExtension() {
-  return GLSurfaceEGL::IsCreateContextRobustnessSupported();
+unsigned int GLContextEGL::CheckStickyGraphicsResetStatus() {
+  DCHECK(IsCurrent(nullptr));
+  DCHECK(g_current_gl_driver);
+  const ExtensionsGL& ext = g_current_gl_driver->ext;
+  if ((graphics_reset_status_ == GL_NO_ERROR) &&
+      GLSurfaceEGL::IsCreateContextRobustnessSupported() &&
+      (ext.b_GL_KHR_robustness || ext.b_GL_EXT_robustness ||
+       ext.b_GL_ARB_robustness)) {
+    graphics_reset_status_ = glGetGraphicsResetStatusARB();
+  }
+  return graphics_reset_status_;
 }
 
 GLContextEGL::~GLContextEGL() {
diff --git a/ui/gl/gl_context_egl.h b/ui/gl/gl_context_egl.h
index 09ffe6a..0cba379 100644
--- a/ui/gl/gl_context_egl.h
+++ b/ui/gl/gl_context_egl.h
@@ -33,7 +33,7 @@
   void ReleaseCurrent(GLSurface* surface) override;
   bool IsCurrent(GLSurface* surface) override;
   void* GetHandle() override;
-  bool WasAllocatedUsingRobustnessExtension() override;
+  unsigned int CheckStickyGraphicsResetStatus() override;
   void SetUnbindFboOnMakeCurrent() override;
   YUVToRGBConverter* GetYUVToRGBConverter(
       const gfx::ColorSpace& color_space) override;
@@ -48,6 +48,7 @@
   EGLContext context_ = nullptr;
   EGLDisplay display_ = nullptr;
   EGLConfig config_ = nullptr;
+  unsigned int graphics_reset_status_ = 0;  // GL_NO_ERROR;
   bool unbind_fbo_on_makecurrent_ = false;
   bool lost_ = false;
   std::map<gfx::ColorSpace, std::unique_ptr<YUVToRGBConverter>>
diff --git a/ui/gl/gl_context_glx.cc b/ui/gl/gl_context_glx.cc
index f8229c64..59b3c058 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -278,8 +278,17 @@
   return context_;
 }
 
-bool GLContextGLX::WasAllocatedUsingRobustnessExtension() {
-  return GLSurfaceGLX::IsCreateContextRobustnessSupported();
+unsigned int GLContextGLX::CheckStickyGraphicsResetStatus() {
+  DCHECK(IsCurrent(nullptr));
+  DCHECK(g_current_gl_driver);
+  const ExtensionsGL& ext = g_current_gl_driver->ext;
+  if ((graphics_reset_status_ == GL_NO_ERROR) &&
+      GLSurfaceGLX::IsCreateContextRobustnessSupported() &&
+      (ext.b_GL_KHR_robustness || ext.b_GL_EXT_robustness ||
+       ext.b_GL_ARB_robustness)) {
+    graphics_reset_status_ = glGetGraphicsResetStatusARB();
+  }
+  return graphics_reset_status_;
 }
 
 GLContextGLX::~GLContextGLX() {
diff --git a/ui/gl/gl_context_glx.h b/ui/gl/gl_context_glx.h
index 5cc8d23a..ed203cb 100644
--- a/ui/gl/gl_context_glx.h
+++ b/ui/gl/gl_context_glx.h
@@ -31,7 +31,7 @@
   void ReleaseCurrent(GLSurface* surface) override;
   bool IsCurrent(GLSurface* surface) override;
   void* GetHandle() override;
-  bool WasAllocatedUsingRobustnessExtension() override;
+  unsigned int CheckStickyGraphicsResetStatus() override;
 
  protected:
   ~GLContextGLX() override;
@@ -41,6 +41,7 @@
 
   void* context_;
   XDisplay* display_;
+  unsigned int graphics_reset_status_ = 0;  // GL_NO_ERROR
 
   DISALLOW_COPY_AND_ASSIGN(GLContextGLX);
 };
diff --git a/ui/gl/gl_context_stub.cc b/ui/gl/gl_context_stub.cc
index 4c7b2696..fc9a1ee 100644
--- a/ui/gl/gl_context_stub.cc
+++ b/ui/gl/gl_context_stub.cc
@@ -50,9 +50,12 @@
   return std::string("CHROMIUM");
 }
 
-bool GLContextStub::WasAllocatedUsingRobustnessExtension() {
-  return HasExtension("GL_ARB_robustness") ||
-         HasExtension("GL_KHR_robustness") || HasExtension("GL_EXT_robustness");
+unsigned int GLContextStub::CheckStickyGraphicsResetStatus() {
+  DCHECK(IsCurrent(nullptr));
+  if ((graphics_reset_status_ == GL_NO_ERROR) && HasRobustness()) {
+    graphics_reset_status_ = glGetGraphicsResetStatusARB();
+  }
+  return graphics_reset_status_;
 }
 
 void GLContextStub::SetUseStubApi(bool stub_api) {
@@ -67,6 +70,11 @@
   version_str_ = std::string(version_str ? version_str : "");
 }
 
+bool GLContextStub::HasRobustness() {
+  return HasExtension("GL_ARB_robustness") ||
+         HasExtension("GL_KHR_robustness") || HasExtension("GL_EXT_robustness");
+}
+
 GLContextStub::~GLContextStub() {}
 
 GLApi* GLContextStub::CreateGLApi(DriverGL* driver) {
diff --git a/ui/gl/gl_context_stub.h b/ui/gl/gl_context_stub.h
index db4a0a37..53107a3 100644
--- a/ui/gl/gl_context_stub.h
+++ b/ui/gl/gl_context_stub.h
@@ -28,11 +28,12 @@
   void* GetHandle() override;
   std::string GetGLVersion() override;
   std::string GetGLRenderer() override;
-  bool WasAllocatedUsingRobustnessExtension() override;
+  unsigned int CheckStickyGraphicsResetStatus() override;
 
   void SetUseStubApi(bool stub_api);
   void SetExtensionsString(const char* extensions);
   void SetGLVersionString(const char* version_str);
+  bool HasRobustness();
 
  protected:
   ~GLContextStub() override;
@@ -42,6 +43,7 @@
  private:
   bool use_stub_api_;
   std::string version_str_;
+  unsigned int graphics_reset_status_ = 0;  // GL_NO_ERROR
 
   DISALLOW_COPY_AND_ASSIGN(GLContextStub);
 };
diff --git a/ui/gl/gl_fence_arb.cc b/ui/gl/gl_fence_arb.cc
index 7bc089d8..237dc85 100644
--- a/ui/gl/gl_fence_arb.cc
+++ b/ui/gl/gl_fence_arb.cc
@@ -75,13 +75,7 @@
 
 void GLFenceARB::HandleClientWaitFailure() {
   DCHECK(GLContext::GetCurrent());
-  if (GLContext::GetCurrent()->WasAllocatedUsingRobustnessExtension()) {
-    // This function pointer is only set if one of the robustness
-    // extensions was available.
-    DCHECK(g_current_gl_driver &&
-           g_current_gl_driver->fn.glGetGraphicsResetStatusARBFn);
-    DCHECK(g_current_gl_driver->fn.glGetGraphicsResetStatusARBFn() !=
-           GL_NO_ERROR);
+  if (GLContext::GetCurrent()->CheckStickyGraphicsResetStatus()) {
     LOG(ERROR) << "Failed to wait for GLFence; context was lost. Error code: "
                << GetGLErrors();
   } else {
diff --git a/ui/views/layout/box_layout.h b/ui/views/layout/box_layout.h
index f91486c..62aeb7c 100644
--- a/ui/views/layout/box_layout.h
+++ b/ui/views/layout/box_layout.h
@@ -58,7 +58,7 @@
   // Use |inside_border_insets| to add additional space between the child
   // view area and the host view border. |between_child_spacing| controls the
   // space in between child views. Use view->SetProperty(kMarginsKey,
-  // new gfx::Insets(xxx)) to add additional margins on a per-view basis. The
+  // gfx::Insets(xxx)) to add additional margins on a per-view basis. The
   // |collapse_margins_spacing| parameter controls whether or not adjacent
   // spacing/margins are collapsed based on the max of the two values. For the
   // cross axis, |collapse_margins_spacing| will collapse to the max of
diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js
index 3f71e73..101e3c8 100644
--- a/ui/webui/resources/js/cr.js
+++ b/ui/webui/resources/js/cr.js
@@ -215,11 +215,15 @@
     // TODO(crbug.com/425829): Remove above suppression once we no longer use
     // deprecated functions lookupGetter, defineGetter, lookupSetter, and
     // defineSetter.
+    // eslint-disable-next-line no-restricted-properties
     if (!obj.__lookupGetter__(name)) {
+      // eslint-disable-next-line no-restricted-properties
       obj.__defineGetter__(name, getGetter(name, kind));
     }
 
+    // eslint-disable-next-line no-restricted-properties
     if (!obj.__lookupSetter__(name)) {
+      // eslint-disable-next-line no-restricted-properties
       obj.__defineSetter__(name, getSetter(name, kind, opt_setHook));
     }
   }
diff --git a/ui/webui/resources/js/cr/ui/context_menu_handler.js b/ui/webui/resources/js/cr/ui/context_menu_handler.js
index e2a348bc..6673058 100644
--- a/ui/webui/resources/js/cr/ui/context_menu_handler.js
+++ b/ui/webui/resources/js/cr/ui/context_menu_handler.js
@@ -236,9 +236,11 @@
           elementOrClass.prototype :
           elementOrClass;
 
+      // eslint-disable-next-line no-restricted-properties
       target.__defineGetter__('contextMenu', function() {
         return this.contextMenu_;
       });
+      // eslint-disable-next-line no-restricted-properties
       target.__defineSetter__('contextMenu', function(menu) {
         const oldContextMenu = this.contextMenu;
 
diff --git a/ui/webui/resources/js/cr/ui/overlay.js b/ui/webui/resources/js/cr/ui/overlay.js
index 9388ae6..27f75ba 100644
--- a/ui/webui/resources/js/cr/ui/overlay.js
+++ b/ui/webui/resources/js/cr/ui/overlay.js
@@ -118,6 +118,7 @@
     // TODO(crbug.com/425829): Remove above suppression once we no longer use
     // deprecated functions defineSetter, and defineGetter.
     // Remove the 'pulse' animation any time the overlay is hidden or shown.
+    // eslint-disable-next-line no-restricted-properties
     overlay.__defineSetter__('hidden', function(value) {
       this.classList.remove('pulse');
       if (value) {
@@ -126,6 +127,7 @@
         this.removeAttribute('hidden');
       }
     });
+    // eslint-disable-next-line no-restricted-properties
     overlay.__defineGetter__('hidden', function() {
       return this.hasAttribute('hidden');
     });
diff --git a/url/BUILD.gn b/url/BUILD.gn
index b52a2286..8dee2f5 100644
--- a/url/BUILD.gn
+++ b/url/BUILD.gn
@@ -108,7 +108,6 @@
     sources = [
       "android/java/src/org/chromium/url/IDNStringUtil.java",
     ]
-    jni_package = "url"
   }
 }
 
diff --git a/url/DEPS b/url/DEPS
index 8ee3d2de..5df1be8 100644
--- a/url/DEPS
+++ b/url/DEPS
@@ -1,6 +1,4 @@
 include_rules = [
-  "+jni",
-
   # Limit files that can depend on icu.
   "-base/i18n",
   "-third_party/icu",
diff --git a/url/url_idna_icu_alternatives_android.cc b/url/url_idna_icu_alternatives_android.cc
index daa0582..6f31c81 100644
--- a/url/url_idna_icu_alternatives_android.cc
+++ b/url/url_idna_icu_alternatives_android.cc
@@ -8,8 +8,8 @@
 #include "base/android/jni_string.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_piece.h"
-#include "jni/IDNStringUtil_jni.h"
 #include "url/url_canon_internal.h"
+#include "url/url_jni_headers/IDNStringUtil_jni.h"
 
 using base::android::ScopedJavaLocalRef;