diff --git a/DEPS b/DEPS index 14c783d..0065999 100644 --- a/DEPS +++ b/DEPS
@@ -185,7 +185,7 @@ # 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': '8f9a888e1a66be718fc1fd3e2553b6c0f5a48728', + 'v8_revision': '0fba36f90087ef91a063f9511557e05fb02343d2', # 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. @@ -193,15 +193,15 @@ # 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': 'db49bc7dd0759fac8cb4065aa2afc3172aed7948', + 'angle_revision': '90bf5bece617b038e926fb16dfc30585fc9fad2b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '43e33165a8f03a9b85b782f3a87bf49fbd90b25b', + 'swiftshader_revision': '7d0ce41d01de6236e9d3336502bf2c4a45a2c542', # 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': '7d0916bb7588ca5f7f1ae7707edae7b02cbb5c26', + 'pdfium_revision': 'e83d8b4f0dd4b0c4edc3ea0d24d5fc0fcce40ed4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -244,7 +244,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': 'a209c4d9908c4c3715ea16378bd8423e1a4527ba', + 'catapult_revision': '28c4ea91f668f7b2aa04658e9cbebb834dcf3b01', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -252,7 +252,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '57b82d61dd2e7f0a0f25dbee2b3a1fa3b5ca8a97', + 'devtools_frontend_revision': '58a8e025554becc5f1e027307bccb7e8678e32e0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -312,7 +312,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'd1cba106c84920f5b236f553615b7293d3d3a814', + 'dawn_revision': '96f79f6db56b87150be2a12755fed10f91f574dc', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -963,7 +963,7 @@ }, 'src/third_party/glslang/src': - Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + '1642ca11282a9d96a42dfedea6065ae25c4c137d', + Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + 'e5dbc3114cb98b1592d9faa697efe5eb290c12a4', 'src/third_party/google_toolbox_for_mac/src': { 'url': Var('chromium_git') + '/external/github.com/google/google-toolbox-for-mac.git' + '@' + Var('google_toolbox_for_mac_revision'), @@ -1297,7 +1297,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '6eff57638287f43a7c5a3be3bc1b039dc1689825', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '752dcc2bcda2f8f5f5110a48369a1cc7ab70fd3b', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1498,7 +1498,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '88d715c9115a5ce65c0bf660209dfeee9131ccd0', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '75b58972cbb788300b23a93bcb92012343d5606b', + Var('webrtc_git') + '/src.git' + '@' + '0b3a6e383e17c80e5f3adce826cce7bc202a01cf', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1568,7 +1568,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d065442915f46cdc0cbe686b3c16a05f2fdf1c59', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@65f043777aedc0a95254978c869bb3ce5c4602e6', 'condition': 'checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 91f1592..de04432 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1347,17 +1347,13 @@ # Bypass the AUTHORS check for these accounts. _KNOWN_ROBOTS = set( - '%s-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com' % s - for s in ('afdo', 'angle', 'catapult', 'chromite', 'depot-tools', - 'fuchsia-sdk', 'nacl', 'pdfium', 'perfetto', 'skia', - 'spirv', 'src-internal', 'webrtc') ) | set('%s@appspot.gserviceaccount.com' % s for s in ('findit-for-me',) ) | set('%s@developer.gserviceaccount.com' % s for s in ('3su6n15k.default',) ) | set('%s@chops-service-accounts.iam.gserviceaccount.com' % s for s in ('bling-autoroll-builder', 'v8-ci-autoroll-builder', 'wpt-autoroller',) ) | set('%s@skia-public.iam.gserviceaccount.com' % s - for s in ('chromium-autoroll',) + for s in ('chromium-autoroll', 'chromium-release-autoroll') ) | set('%s@skia-corp.google.com.iam.gserviceaccount.com' % s for s in ('chromium-internal-autoroll',))
diff --git a/ash/system/message_center/ash_message_popup_collection.cc b/ash/system/message_center/ash_message_popup_collection.cc index 68f6df6..e950894 100644 --- a/ash/system/message_center/ash_message_popup_collection.cc +++ b/ash/system/message_center/ash_message_popup_collection.cc
@@ -12,8 +12,10 @@ #include "ash/shelf/shelf.h" #include "ash/shell.h" #include "ash/system/tray/tray_constants.h" +#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/work_area_insets.h" #include "base/i18n/rtl.h" +#include "chromeos/constants/chromeos_switches.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/gfx/geometry/rect.h" @@ -89,7 +91,21 @@ } int AshMessagePopupCollection::GetBaseline() const { - return work_area_.bottom() - kUnifiedMenuPadding - tray_bubble_height_; + int baseline = + work_area_.bottom() - kUnifiedMenuPadding - tray_bubble_height_; + + // The work area in tablet mode always uses the in-app shelf height, which + // ignores the height of the hotseat. We need to add additional height to the + // baseline to compensate. + bool in_tablet_mode = Shell::Get()->tablet_mode_controller() && + Shell::Get()->tablet_mode_controller()->InTabletMode(); + bool is_bottom_alignment = shelf_->alignment() == ShelfAlignment::kBottom; + if (chromeos::switches::ShouldShowShelfHotseat() && in_tablet_mode && + !ShelfConfig::Get()->is_in_app() && is_bottom_alignment) { + baseline -= kPopupCollectionHotseatHeightCompensation; + } + + return baseline; } gfx::Rect AshMessagePopupCollection::GetWorkArea() const {
diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 97595b8..8f560f4e 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h
@@ -200,6 +200,8 @@ constexpr int kStatusAreaForceCollapseAvailableWidth = 200; constexpr int kStatusAreaOverflowGradientSize = 24; +constexpr int kPopupCollectionHotseatHeightCompensation = 16; + } // namespace ash #endif // ASH_SYSTEM_TRAY_TRAY_CONSTANTS_H_
diff --git a/base/BUILD.gn b/base/BUILD.gn index 4bf1ec40..ea4c4d7 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -3280,8 +3280,6 @@ "android/java/src/org/chromium/base/MathUtils.java", "android/java/src/org/chromium/base/MemoryPressureListener.java", "android/java/src/org/chromium/base/NonThreadSafe.java", - "android/java/src/org/chromium/base/ObservableSupplier.java", - "android/java/src/org/chromium/base/ObservableSupplierImpl.java", "android/java/src/org/chromium/base/ObserverList.java", "android/java/src/org/chromium/base/PackageManagerUtils.java", "android/java/src/org/chromium/base/PackageUtils.java", @@ -3293,7 +3291,6 @@ "android/java/src/org/chromium/base/SecureRandomInitializer.java", "android/java/src/org/chromium/base/StreamUtil.java", "android/java/src/org/chromium/base/StrictModeContext.java", - "android/java/src/org/chromium/base/Supplier.java", "android/java/src/org/chromium/base/SysUtils.java", "android/java/src/org/chromium/base/ThreadUtils.java", "android/java/src/org/chromium/base/TimeUtils.java", @@ -3359,6 +3356,10 @@ "android/java/src/org/chromium/base/process_launcher/ChildProcessService.java", "android/java/src/org/chromium/base/process_launcher/ChildProcessServiceDelegate.java", "android/java/src/org/chromium/base/process_launcher/FileDescriptorInfo.java", + "android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java", + "android/java/src/org/chromium/base/supplier/ObservableSupplier.java", + "android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java", + "android/java/src/org/chromium/base/supplier/Supplier.java", "android/java/src/org/chromium/base/task/AsyncTask.java", "android/java/src/org/chromium/base/task/BackgroundOnlyAsyncTask.java", "android/java/src/org/chromium/base/task/ChoreographerTaskRunner.java", @@ -3585,12 +3586,12 @@ "android/junit/src/org/chromium/base/LifetimeAssertTest.java", "android/junit/src/org/chromium/base/LogTest.java", "android/junit/src/org/chromium/base/NonThreadSafeTest.java", - "android/junit/src/org/chromium/base/ObservableSupplierImplTest.java", "android/junit/src/org/chromium/base/PiiEliderTest.java", "android/junit/src/org/chromium/base/PromiseTest.java", "android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java", "android/junit/src/org/chromium/base/process_launcher/ChildConnectionAllocatorTest.java", "android/junit/src/org/chromium/base/process_launcher/ChildProcessConnectionTest.java", + "android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java", "android/junit/src/org/chromium/base/task/AsyncTaskThreadTest.java", "android/junit/src/org/chromium/base/task/TaskTraitsTest.java", "android/junit/src/org/chromium/base/util/GarbageCollectionTestUtilsUnitTest.java",
diff --git a/base/android/java/src/org/chromium/base/CommandLineInitUtil.java b/base/android/java/src/org/chromium/base/CommandLineInitUtil.java index 2cebaef..3425191 100644 --- a/base/android/java/src/org/chromium/base/CommandLineInitUtil.java +++ b/base/android/java/src/org/chromium/base/CommandLineInitUtil.java
@@ -11,6 +11,8 @@ import androidx.annotation.Nullable; +import org.chromium.base.supplier.Supplier; + import java.io.File; /**
diff --git a/base/android/java/src/org/chromium/base/memory/MemoryPressureMonitor.java b/base/android/java/src/org/chromium/base/memory/MemoryPressureMonitor.java index fa80cb4..a6c7e6b 100644 --- a/base/android/java/src/org/chromium/base/memory/MemoryPressureMonitor.java +++ b/base/android/java/src/org/chromium/base/memory/MemoryPressureMonitor.java
@@ -15,10 +15,10 @@ import org.chromium.base.ContextUtils; import org.chromium.base.MemoryPressureLevel; import org.chromium.base.MemoryPressureListener; -import org.chromium.base.Supplier; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.MainDex; import org.chromium.base.metrics.CachedMetrics; +import org.chromium.base.supplier.Supplier; import java.util.concurrent.TimeUnit;
diff --git a/base/android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java b/base/android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java new file mode 100644 index 0000000..2d1f05af --- /dev/null +++ b/base/android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java
@@ -0,0 +1,20 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base.supplier; + +/** + * An {@link ObservableSupplier} that may be destroyed by anyone with a reference to the object. + * This is useful if the class that constructs the object implementing this interface is not + * responsible for its cleanup. For example, this may be useful when constructing an object + * using the factory pattern. + * + * @param <E> The type of the wrapped object. + */ +public interface DestroyableObservableSupplier<E> extends ObservableSupplier<E> { + /** + * Destroy the supplier and the object it holds. + */ + void destroy(); +}
diff --git a/base/android/java/src/org/chromium/base/ObservableSupplier.java b/base/android/java/src/org/chromium/base/supplier/ObservableSupplier.java similarity index 95% rename from base/android/java/src/org/chromium/base/ObservableSupplier.java rename to base/android/java/src/org/chromium/base/supplier/ObservableSupplier.java index 3aeb27c..0daba6d 100644 --- a/base/android/java/src/org/chromium/base/ObservableSupplier.java +++ b/base/android/java/src/org/chromium/base/supplier/ObservableSupplier.java
@@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.base; +package org.chromium.base.supplier; + +import org.chromium.base.Callback; /** * ObservableSupplier wraps an asynchronously provided object E, notifying observers when the
diff --git a/base/android/java/src/org/chromium/base/ObservableSupplierImpl.java b/base/android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java similarity index 95% rename from base/android/java/src/org/chromium/base/ObservableSupplierImpl.java rename to base/android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java index d265c151..a0048673 100644 --- a/base/android/java/src/org/chromium/base/ObservableSupplierImpl.java +++ b/base/android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java
@@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.base; +package org.chromium.base.supplier; import android.os.Handler; import androidx.annotation.Nullable; +import org.chromium.base.Callback; +import org.chromium.base.ObserverList; + /** * Concrete implementation of {@link ObservableSupplier} to be used by classes owning the * ObservableSupplier and providing it as a dependency to others.
diff --git a/base/android/java/src/org/chromium/base/Supplier.java b/base/android/java/src/org/chromium/base/supplier/Supplier.java similarity index 92% rename from base/android/java/src/org/chromium/base/Supplier.java rename to base/android/java/src/org/chromium/base/supplier/Supplier.java index 59fef23..be8fac61 100644 --- a/base/android/java/src/org/chromium/base/Supplier.java +++ b/base/android/java/src/org/chromium/base/supplier/Supplier.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.base; +package org.chromium.base.supplier; /** * Based on Java 8's java.util.function.Supplier.
diff --git a/base/android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java b/base/android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java index 1249a66..1cf6a90e 100644 --- a/base/android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java +++ b/base/android/junit/src/org/chromium/base/memory/MemoryPressureMonitorTest.java
@@ -16,8 +16,8 @@ import org.robolectric.shadows.ShadowLooper; import org.chromium.base.MemoryPressureLevel; -import org.chromium.base.Supplier; import org.chromium.base.ThreadUtils; +import org.chromium.base.supplier.Supplier; import org.chromium.base.test.BaseRobolectricTestRunner; import java.util.concurrent.TimeUnit;
diff --git a/base/android/junit/src/org/chromium/base/ObservableSupplierImplTest.java b/base/android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java similarity index 98% rename from base/android/junit/src/org/chromium/base/ObservableSupplierImplTest.java rename to base/android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java index 3526a5f..40af533f 100644 --- a/base/android/junit/src/org/chromium/base/ObservableSupplierImplTest.java +++ b/base/android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.base; +package org.chromium.base.supplier; import android.os.Handler; @@ -11,6 +11,7 @@ import org.junit.runner.RunWith; import org.robolectric.annotation.Config; +import org.chromium.base.Callback; import org.chromium.base.test.BaseRobolectricTestRunner; /**
diff --git a/build/config/fuchsia/package.gni b/build/config/fuchsia/package.gni index 165104a..59c84e8 100644 --- a/build/config/fuchsia/package.gni +++ b/build/config/fuchsia/package.gni
@@ -12,8 +12,14 @@ # if different than |target_name|. # binary: The executable target which should be launched. # manifest: A path to the manifest that will be used. -# "testonly" targets default to using //build/config/fuchsia/tests-with-exec.cmx. +# "testonly" targets default to using +# //build/config/fuchsia/tests-with-exec.cmx. # Non-test targets must explicitly specify a |manifest|. +# additional_manifests: Manifest files that should be included in the package in +# the /meta directory. This allows to package more than one component per +# manifest. These manifest files must specify program/binary to run, which +# is not required for the main manifest file where this parameter is added +# during build. # component_name_override: If set, specifies the name of the component. # By default, the component name is the same as the package name. # deps: Additional targets to build and include in the package (optional). @@ -65,6 +71,7 @@ forward_variables_from(invoker, [ + "data", "deps", "testonly", ]) @@ -124,6 +131,15 @@ } } + if (defined(pkg.additional_manifests)) { + foreach(filename, pkg.additional_manifests) { + args += [ + "--additional-manifest", + rebase_path(filename), + ] + } + } + write_runtime_deps = _runtime_deps_file } @@ -142,6 +158,10 @@ "${fuchsia_sdk}/.hash", ] + if (defined(pkg.additional_manifests)) { + inputs += pkg.additional_manifests + } + outputs = [ _meta_far_file, ]
diff --git a/build/config/fuchsia/prepare_package_inputs.py b/build/config/fuchsia/prepare_package_inputs.py index 54ca02ee..6b5af267 100644 --- a/build/config/fuchsia/prepare_package_inputs.py +++ b/build/config/fuchsia/prepare_package_inputs.py
@@ -154,6 +154,11 @@ os.path.relpath(args.component_manifest_path, args.out_dir))) + for manifest in args.additional_manifest: + manifest.write('meta/%s=%s\n' % + (os.path.basename(manifest), + os.path.relpath(manifest, args.out_dir))) + depfile.write( "%s: %s" % (os.path.relpath(args.package_manifest_path, args.out_dir), " ".join([os.path.relpath(f, args.out_dir) @@ -179,6 +184,8 @@ help='Path to write GN deps file.') parser.add_argument('--exclude-file', action='append', default=[], help='Package-relative file path to exclude from the package.') + parser.add_argument('--additional-manifest', action='append', default=[], + help='Additional component manifest file to include in the package.') parser.add_argument('--package-manifest-path', required=True, help='Package manifest (file listing) output path.') parser.add_argument('--component-manifest-path', required=True,
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 2d6f20a..31fa3f5 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -8891891694497095280 \ No newline at end of file +8891849889272099440 \ No newline at end of file
diff --git a/chrome/VERSION b/chrome/VERSION index 864b85b..fdff123 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=81 MINOR=0 -BUILD=4021 +BUILD=4022 PATCH=0
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index fb6f6cc..0d96c029 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -937,6 +937,7 @@ "java/src/org/chromium/chrome/browser/multiwindow/MultiWindowModeStateDispatcherImpl.java", "java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java", "java/src/org/chromium/chrome/browser/native_page/BasicNativePage.java", + "java/src/org/chromium/chrome/browser/native_page/BrowserControlsMarginSupplier.java", "java/src/org/chromium/chrome/browser/native_page/ContextMenuManager.java", "java/src/org/chromium/chrome/browser/native_page/FrozenNativePage.java", "java/src/org/chromium/chrome/browser/native_page/NativePage.java",
diff --git a/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_payment_method_summary.xml b/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_payment_method_summary.xml index 7df0772..e1c58ea6 100644 --- a/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_payment_method_summary.xml +++ b/chrome/android/features/autofill_assistant/java/res/layout/autofill_assistant_payment_method_summary.xml
@@ -40,7 +40,6 @@ android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="1" - android:text="@string/autofill_assistant_payment_information_missing" android:textAppearance="@style/TextAppearance.ErrorCaption" android:visibility="gone"/> </LinearLayout>
diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataBinder.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataBinder.java index 391ec3e..1049b5e 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataBinder.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataBinder.java
@@ -256,6 +256,10 @@ view.mPaymentMethodSection.setBillingPostalCodeMissingText( model.get(AssistantCollectUserDataModel.BILLING_POSTAL_CODE_MISSING_TEXT)); return true; + } else if (propertyKey == AssistantCollectUserDataModel.CREDIT_CARD_EXPIRED_TEXT) { + view.mPaymentMethodSection.setCreditCardExpiredText( + model.get(AssistantCollectUserDataModel.CREDIT_CARD_EXPIRED_TEXT)); + return true; } else if (propertyKey == AssistantCollectUserDataModel.AVAILABLE_LOGINS) { if (model.get(AssistantCollectUserDataModel.REQUEST_LOGIN_CHOICE)) { view.mLoginSection.onLoginsChanged(
diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataModel.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataModel.java index eaa592b..9d126906 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataModel.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataModel.java
@@ -124,6 +124,9 @@ public static final WritableObjectPropertyKey<String> BILLING_POSTAL_CODE_MISSING_TEXT = new WritableObjectPropertyKey<>(); + public static final WritableObjectPropertyKey<String> CREDIT_CARD_EXPIRED_TEXT = + new WritableObjectPropertyKey<>(); + public static final WritableBooleanPropertyKey REQUEST_DATE_RANGE = new WritableBooleanPropertyKey(); @@ -161,10 +164,11 @@ ACCEPT_TERMS_AND_CONDITIONS_TEXT, SHOW_TERMS_AS_CHECKBOX, REQUEST_LOGIN_CHOICE, AVAILABLE_PROFILES, AVAILABLE_AUTOFILL_PAYMENT_METHODS, SUPPORTED_BASIC_CARD_NETWORKS, AVAILABLE_LOGINS, EXPANDED_SECTION, - REQUIRE_BILLING_POSTAL_CODE, BILLING_POSTAL_CODE_MISSING_TEXT, REQUEST_DATE_RANGE, - DATE_RANGE_START, DATE_RANGE_START_LABEL, DATE_RANGE_END, DATE_RANGE_END_LABEL, - PREPENDED_SECTIONS, APPENDED_SECTIONS, TERMS_REQUIRE_REVIEW_TEXT, - PRIVACY_NOTICE_TEXT, GENERIC_USER_INTERFACE); + REQUIRE_BILLING_POSTAL_CODE, BILLING_POSTAL_CODE_MISSING_TEXT, + CREDIT_CARD_EXPIRED_TEXT, REQUEST_DATE_RANGE, DATE_RANGE_START, + DATE_RANGE_START_LABEL, DATE_RANGE_END, DATE_RANGE_END_LABEL, PREPENDED_SECTIONS, + APPENDED_SECTIONS, TERMS_REQUIRE_REVIEW_TEXT, PRIVACY_NOTICE_TEXT, + GENERIC_USER_INTERFACE); /** * Set initial state for basic type properties (others are implicitly null). @@ -231,6 +235,11 @@ } @CalledByNative + private void setCreditCardExpiredText(String text) { + set(CREDIT_CARD_EXPIRED_TEXT, text); + } + + @CalledByNative private void setLoginSectionTitle(String loginSectionTitle) { set(LOGIN_SECTION_TITLE, loginSectionTitle); }
diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantPaymentMethodSection.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantPaymentMethodSection.java index 776a0b67..cbfe148f 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantPaymentMethodSection.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantPaymentMethodSection.java
@@ -34,6 +34,7 @@ private boolean mIgnorePaymentMethodsChangeNotifications; private boolean mRequiresBillingPostalCode; private String mBillingPostalCodeMissingText; + private String mCreditCardExpiredText; AssistantPaymentMethodSection(Context context, ViewGroup parent) { super(context, parent, R.layout.autofill_assistant_payment_method_summary, @@ -118,9 +119,9 @@ method.getCard().getFormattedExpirationDate(summaryView.getContext())); hideIfEmpty(cardExpirationView); - TextView methodIncompleteView = summaryView.findViewById(R.id.incomplete_error); - setIncompleteErrorMessage(methodIncompleteView, method); - hideIfEmpty(methodIncompleteView); + TextView errorMessageView = summaryView.findViewById(R.id.incomplete_error); + setErrorMessage(errorMessageView, method); + hideIfEmpty(errorMessageView); } @Override @@ -204,6 +205,10 @@ mBillingPostalCodeMissingText = text; } + void setCreditCardExpiredText(String text) { + mCreditCardExpiredText = text; + } + private void addAutocompleteInformationToEditor(PersonalDataManager.AutofillProfile profile) { // The check for non-null label is necessary to prevent crash in editor when opening. if (mEditor == null || profile.getLabel() == null) { @@ -212,37 +217,26 @@ mEditor.updateBillingAddressIfComplete(new AutofillAddress(mContext, profile)); } - private boolean hasAllRequiredFields(AutofillPaymentInstrument method) { + private void setErrorMessage(TextView errorMessageView, AutofillPaymentInstrument method) { if (!method.isComplete()) { - return false; - } - - if (!mRequiresBillingPostalCode) { - return true; - } - - if (method.getBillingProfile() == null - || TextUtils.isEmpty(method.getBillingProfile().getPostalCode())) { - return false; - } - - return true; - } - - private void setIncompleteErrorMessage( - TextView methodIncompleteView, AutofillPaymentInstrument method) { - if (hasAllRequiredFields(method)) { - methodIncompleteView.setText(""); + errorMessageView.setText(R.string.autofill_assistant_payment_information_missing); return; } - // we have to show an error message either because the payment method is incomplete (missing - // information), or because a postcode is required and the billing address does not have - // one. - if (method.isComplete()) { - methodIncompleteView.setText(mBillingPostalCodeMissingText); - } else { - methodIncompleteView.setText(R.string.autofill_assistant_payment_information_missing); + if (mRequiresBillingPostalCode + && (method.getBillingProfile() == null + || TextUtils.isEmpty(method.getBillingProfile().getPostalCode()))) { + errorMessageView.setText(mBillingPostalCodeMissingText); + return; } + + if ((method.getMissingFields() + & AutofillPaymentInstrument.CompletionStatus.CREDIT_CARD_EXPIRED) + == 1) { + errorMessageView.setText(mCreditCardExpiredText); + return; + } + + errorMessageView.setText(""); } } \ No newline at end of file
diff --git a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantCollectUserDataUiTest.java b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantCollectUserDataUiTest.java index 109eec4..01aebea3 100644 --- a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantCollectUserDataUiTest.java +++ b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantCollectUserDataUiTest.java
@@ -808,6 +808,57 @@ } /** + * For expired credit cards, an error message should be displayed. + */ + @Test + @MediumTest + public void testExpiredCreditCard() throws Exception { + // add credit card without postcode. + PersonalDataManager.AutofillProfile profile = + mHelper.createDummyProfile("John Doe", "john@gmail.com", ""); + String profileId = mHelper.setProfile(profile); + PersonalDataManager.CreditCard creditCard = mHelper.createDummyCreditCard(profileId); + creditCard.setYear("2019"); + + AssistantCollectUserDataModel.PaymentTuple expiredPaymentTuple = + new AssistantCollectUserDataModel.PaymentTuple(creditCard, profile); + + AssistantCollectUserDataModel model = new AssistantCollectUserDataModel(); + AssistantCollectUserDataCoordinator coordinator = createCollectUserDataCoordinator(model); + AutofillAssistantCollectUserDataTestHelper + .ViewHolder viewHolder = TestThreadUtils.runOnUiThreadBlocking( + () -> new AutofillAssistantCollectUserDataTestHelper.ViewHolder(coordinator)); + + TestThreadUtils.runOnUiThreadBlocking(() -> { + // WEB_CONTENTS are necessary for the creation of the editors. + model.set(AssistantCollectUserDataModel.WEB_CONTENTS, mTestRule.getWebContents()); + model.set(AssistantCollectUserDataModel.REQUEST_PAYMENT, true); + model.set(AssistantCollectUserDataModel.CREDIT_CARD_EXPIRED_TEXT, "Card is expired"); + model.set(AssistantCollectUserDataModel.VISIBLE, true); + model.set(AssistantCollectUserDataModel.AVAILABLE_AUTOFILL_PAYMENT_METHODS, + Collections.singletonList(expiredPaymentTuple)); + model.set(AssistantCollectUserDataModel.PAYMENT_METHOD, expiredPaymentTuple); + }); + + // check that the card is not accepted (i.e. an error message is shown). + onView(is(getPaymentSummaryErrorView(viewHolder))).check(matches(isDisplayed())); + onView(is(getPaymentSummaryErrorView(viewHolder))) + .check(matches(withText("Card is expired"))); + + creditCard.setYear("2050"); + AssistantCollectUserDataModel.PaymentTuple validPaymentTuple = + new AssistantCollectUserDataModel.PaymentTuple(creditCard, profile); + TestThreadUtils.runOnUiThreadBlocking(() -> { + model.set(AssistantCollectUserDataModel.AVAILABLE_AUTOFILL_PAYMENT_METHODS, + Collections.singletonList(validPaymentTuple)); + model.set(AssistantCollectUserDataModel.PAYMENT_METHOD, validPaymentTuple); + }); + + // check that the card is now accepted. + onView(is(getPaymentSummaryErrorView(viewHolder))).check(matches(not(isDisplayed()))); + } + + /** * Test that requiring a billing postal code for a billing address that has it does not display * an error message. */
diff --git a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiTestUtil.java b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiTestUtil.java index b19c2554..2f46e72 100644 --- a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiTestUtil.java +++ b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiTestUtil.java
@@ -39,8 +39,8 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; -import org.chromium.base.Supplier; import org.chromium.base.ThreadUtils; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.autofill_assistant.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelManager;
diff --git a/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingMediator.java b/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingMediator.java index 75891b0..f934649 100644 --- a/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingMediator.java +++ b/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingMediator.java
@@ -25,7 +25,7 @@ import androidx.annotation.Px; import androidx.annotation.VisibleForTesting; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
diff --git a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceLayout.java b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceLayout.java index b87b43b6..aee74d6 100644 --- a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceLayout.java +++ b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceLayout.java
@@ -17,9 +17,9 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Log; -import org.chromium.base.Supplier; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeVersionInfo; import org.chromium.chrome.browser.compositor.LayerTitleCache;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupPopupUiCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupPopupUiCoordinator.java index 3071edf7..6a7553aa 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupPopupUiCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupPopupUiCoordinator.java
@@ -7,7 +7,7 @@ import android.view.View; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.lifecycle.Destroyable;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegate.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegate.java index 16592fb..9bf6abf7 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegate.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegate.java
@@ -8,7 +8,7 @@ import android.view.View; import android.view.ViewGroup; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.compositor.layouts.Layout;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegateImpl.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegateImpl.java index df2e532..2a1153af 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegateImpl.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabManagementDelegateImpl.java
@@ -10,9 +10,9 @@ import android.view.View; import android.view.ViewGroup; -import org.chromium.base.ObservableSupplier; import org.chromium.base.SysUtils; import org.chromium.base.annotations.UsedByReflection; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ThemeColorProvider;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java index ea1406877..3341c86 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
@@ -51,12 +51,13 @@ * @param tabModelSelector The {@link TabModelSelector} for the containing activity. * @param activityTabProvider Allows us to check if we are the current tab. * @param activityLifecycleDispatcher Allows us to subscribe to backgrounding events. + * @param tab The {@link TabImpl} that contains this new tab page. */ public FeedNewTabPage(ChromeActivity activity, NativePageHost nativePageHost, TabModelSelector tabModelSelector, ActivityTabProvider activityTabProvider, - ActivityLifecycleDispatcher activityLifecycleDispatcher) { + ActivityLifecycleDispatcher activityLifecycleDispatcher, TabImpl tab) { super(activity, nativePageHost, tabModelSelector, activityTabProvider, - activityLifecycleDispatcher); + activityLifecycleDispatcher, tab); // Don't store a direct reference to the activity, because it might change later if the tab // is reparented.
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/actionparser/ActionParserFactory.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/actionparser/ActionParserFactory.java index e2ccf3c..5014f53 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/actionparser/ActionParserFactory.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/actionparser/ActionParserFactory.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feed.library.api.internal.actionparser; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; /** Factory for {@link ActionParser}. */
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/store/Store.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/store/Store.java index eaaba0e6..c5f0a8c 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/store/Store.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/api/internal/store/Store.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feed.library.api.internal.store; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.internal.common.PayloadWithId; import org.chromium.chrome.browser.feed.library.api.internal.common.SemanticPropertiesWithId; import org.chromium.chrome.browser.feed.library.common.Result;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/actions/StreamActionApiImpl.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/actions/StreamActionApiImpl.java index 34faf208..dd16671 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/actions/StreamActionApiImpl.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/actions/StreamActionApiImpl.java
@@ -8,7 +8,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; import org.chromium.chrome.browser.feed.library.api.host.action.ActionApi; import org.chromium.chrome.browser.feed.library.api.host.action.StreamActionApi;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriver.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriver.java index a66dfb6e..335fe3f 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriver.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriver.java
@@ -12,7 +12,7 @@ import androidx.annotation.Nullable; import org.chromium.base.Consumer; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; import org.chromium.chrome.browser.feed.library.api.client.stream.Stream.ContentChangedListener; import org.chromium.chrome.browser.feed.library.api.host.action.ActionApi;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/common/functional/Suppliers.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/common/functional/Suppliers.java index 4e0e854..ae1af89f 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/common/functional/Suppliers.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/common/functional/Suppliers.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feed.library.common.functional; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; /** Utility methods for working with the {@link Supplier} class. */ public class Suppliers {
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParser.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParser.java index 4c28369..c8adb29 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParser.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParser.java
@@ -14,7 +14,7 @@ import android.view.View; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; import org.chromium.chrome.browser.feed.library.api.host.action.StreamActionApi; import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParserFactory.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParserFactory.java index cc6c1505..86f3a1b 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParserFactory.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedactionparser/FeedActionParserFactory.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feed.library.feedactionparser; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi; import org.chromium.chrome.browser.feed.library.api.internal.actionparser.ActionParser;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionCache.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionCache.java index cc9bb9d..ef751349 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionCache.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionCache.java
@@ -8,7 +8,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.logging.Task; import org.chromium.chrome.browser.feed.library.api.internal.common.PayloadWithId; import org.chromium.chrome.browser.feed.library.api.internal.common.ThreadUtils;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/FeedStore.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/FeedStore.java index 70c7fef..ebfc7c3 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/FeedStore.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/FeedStore.java
@@ -6,7 +6,7 @@ import com.google.protobuf.ByteString; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration; import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi; import org.chromium.chrome.browser.feed.library.api.host.logging.InternalFeedError;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/ContentGc.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/ContentGc.java index 1f64b62c..7a996f0 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/ContentGc.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/ContentGc.java
@@ -8,7 +8,7 @@ import static org.chromium.chrome.browser.feed.library.feedstore.internal.FeedStoreConstants.SHARED_STATE_PREFIX; import static org.chromium.chrome.browser.feed.library.feedstore.internal.FeedStoreConstants.UPLOADABLE_ACTION_PREFIX; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration.ConfigKey; import org.chromium.chrome.browser.feed.library.api.host.logging.Task;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/EphemeralFeedStore.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/EphemeralFeedStore.java index 3253853..83b8c58 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/EphemeralFeedStore.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/EphemeralFeedStore.java
@@ -6,7 +6,7 @@ import com.google.protobuf.ByteString; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.storage.CommitResult; import org.chromium.chrome.browser.feed.library.api.internal.common.PayloadWithId; import org.chromium.chrome.browser.feed.library.api.internal.common.SemanticPropertiesWithId;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/PersistentFeedStore.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/PersistentFeedStore.java index 4043f7b..3ad96e7f 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/PersistentFeedStore.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/internal/PersistentFeedStore.java
@@ -14,7 +14,7 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration; import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi; import org.chromium.chrome.browser.feed.library.api.host.logging.InternalFeedError;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/testing/DelegatingStore.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/testing/DelegatingStore.java index e8e11d6..9d79ac8e 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/testing/DelegatingStore.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/feedstore/testing/DelegatingStore.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feed.library.feedstore.testing; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.internal.common.PayloadWithId; import org.chromium.chrome.browser.feed.library.api.internal.common.SemanticPropertiesWithId; import org.chromium.chrome.browser.feed.library.api.internal.store.ContentMutation;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/AdapterParameters.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/AdapterParameters.java index 4475322..e856d73 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/AdapterParameters.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/AdapterParameters.java
@@ -9,7 +9,7 @@ import android.view.View; import android.view.ViewGroup; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.time.Clock; import org.chromium.chrome.browser.feed.library.piet.PietStylesHelper.PietStylesHelperFactory; import org.chromium.chrome.browser.feed.library.piet.ui.RoundedCornerMaskCache;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/GridRowAdapter.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/GridRowAdapter.java index 430666b7..71c47adb 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/GridRowAdapter.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/GridRowAdapter.java
@@ -16,7 +16,7 @@ import android.view.View; import android.widget.LinearLayout; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.ui.LayoutUtils; import org.chromium.chrome.browser.feed.library.piet.AdapterFactory.AdapterKeySupplier; import org.chromium.chrome.browser.feed.library.piet.AdapterFactory.SingletonKeySupplier;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManager.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManager.java index a185c08..0b96c37a 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManager.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManager.java
@@ -9,7 +9,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.DebugBehavior; import org.chromium.chrome.browser.feed.library.common.functional.Suppliers; import org.chromium.chrome.browser.feed.library.common.time.Clock;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImpl.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImpl.java index d2af56e83..f185bb9 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImpl.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImpl.java
@@ -10,7 +10,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.DebugBehavior; import org.chromium.chrome.browser.feed.library.common.time.Clock; import org.chromium.chrome.browser.feed.library.piet.host.ActionHandler;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/host/AssetProvider.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/host/AssetProvider.java index 970f05a..66b5743 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/host/AssetProvider.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/host/AssetProvider.java
@@ -9,7 +9,7 @@ import android.support.annotation.VisibleForTesting; import org.chromium.base.Consumer; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.piet.host.TypefaceProvider.GoogleSansTypeface; import org.chromium.components.feed.core.proto.ui.piet.ImagesProto.Image;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientDrawable.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientDrawable.java index 261a1ea..db6bc54 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientDrawable.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientDrawable.java
@@ -7,7 +7,7 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.components.feed.core.proto.ui.piet.GradientsProto.LinearGradient; /** Class to display gradients according to the Piet spec (angle + color stops at %ages) */
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientShader.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientShader.java index 8e75b21..d445f49c7 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientShader.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GradientShader.java
@@ -14,7 +14,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; /** Generates a linear gradient according to CSS behavior */ class GradientShader extends ShapeDrawable.ShaderFactory {
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GridRowView.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GridRowView.java index 307463cb..07ae722 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GridRowView.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/GridRowView.java
@@ -14,7 +14,7 @@ import android.view.ViewGroup; import android.widget.LinearLayout; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.logging.Logger; /** LinearLayout with special measuring code for GridRow */
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperView.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperView.java index c575425..ac25191d 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperView.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperView.java
@@ -19,7 +19,7 @@ import android.view.ViewParent; import android.widget.FrameLayout; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.ui.LayoutUtils; import org.chromium.chrome.browser.feed.library.piet.ui.RoundedCornerDelegateFactory.RoundingStrategy; import org.chromium.components.feed.core.proto.ui.piet.RoundedCornersProto.RoundedCorners;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/StreamRecyclerViewAdapterTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/StreamRecyclerViewAdapterTest.java index 26e97e29..fe4bfad 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/StreamRecyclerViewAdapterTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/StreamRecyclerViewAdapterTest.java
@@ -37,7 +37,7 @@ import org.robolectric.Robolectric; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.stream.Header; import org.chromium.chrome.browser.feed.library.api.client.stream.Stream.ContentChangedListener; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriverTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriverTest.java index 8a997b2..29a2fac5 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriverTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/drivers/ContentDriverTest.java
@@ -31,7 +31,7 @@ import org.mockito.Mockito; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.ContentMetadata; import org.chromium.chrome.browser.feed.library.api.client.stream.Stream.ContentChangedListener; import org.chromium.chrome.browser.feed.library.api.host.action.ActionApi;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/viewholders/PietViewHolderTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/viewholders/PietViewHolderTest.java index 59781df5..f03cc9be 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/viewholders/PietViewHolderTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/basicstream/internal/viewholders/PietViewHolderTest.java
@@ -33,7 +33,7 @@ import org.robolectric.Robolectric; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration; import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi; import org.chromium.chrome.browser.feed.library.api.host.stream.CardConfiguration;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionManagerMutationTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionManagerMutationTest.java index c40e00b8..1ec16c2 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionManagerMutationTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/feedsessionmanager/internal/SessionManagerMutationTest.java
@@ -26,7 +26,7 @@ import org.mockito.Mock; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.client.knowncontent.KnownContent; import org.chromium.chrome.browser.feed.library.api.common.MutationContext; import org.chromium.chrome.browser.feed.library.api.host.config.Configuration;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImplTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImplTest.java index 268f8cd7..6f348349 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImplTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/PietManagerImplTest.java
@@ -27,7 +27,7 @@ import org.robolectric.annotation.Config; import org.chromium.base.Consumer; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.api.host.config.DebugBehavior; import org.chromium.chrome.browser.feed.library.common.functional.Suppliers; import org.chromium.chrome.browser.feed.library.common.time.Clock;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/BitmapMaskingRoundedCornerDelegateTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/BitmapMaskingRoundedCornerDelegateTest.java index 98cac9e..28a3099 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/BitmapMaskingRoundedCornerDelegateTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/BitmapMaskingRoundedCornerDelegateTest.java
@@ -26,7 +26,7 @@ import org.robolectric.Robolectric; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.functional.Suppliers; import org.chromium.chrome.browser.feed.library.piet.ui.RoundedCornerMaskCache.Corner; import org.chromium.chrome.browser.feed.library.piet.ui.RoundedCornerMaskCache.RoundedCornerBitmaps;
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperViewTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperViewTest.java index 674365f..ad6913d 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperViewTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/library/piet/ui/RoundedCornerWrapperViewTest.java
@@ -18,7 +18,7 @@ import org.robolectric.Robolectric; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.feed.library.common.functional.Suppliers; import org.chromium.chrome.browser.feed.library.piet.ui.RoundedCornerDelegateFactory.RoundingStrategy; import org.chromium.components.feed.core.proto.ui.piet.RoundedCornersProto.RoundedCorners;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java index a080dde..0fbd4a0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java
@@ -8,7 +8,7 @@ import org.chromium.base.ObserverList; import org.chromium.base.ObserverList.RewindableIterator; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; import org.chromium.chrome.browser.compositor.layouts.SceneChangeObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 1d58e77e..d76c07ec 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -45,14 +45,14 @@ import org.chromium.base.ContextUtils; import org.chromium.base.DiscardableReferencePool; import org.chromium.base.MathUtils; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.ObservableSupplierImpl; import org.chromium.base.StrictModeContext; import org.chromium.base.SysUtils; import org.chromium.base.TraceEvent; import org.chromium.base.annotations.UsedByReflection; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate; import org.chromium.chrome.browser.IntentHandler.TabOpenType;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index b23f5f2e..728f2ad 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -36,10 +36,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.MemoryPressureListener; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.ObservableSupplierImpl; import org.chromium.base.ObserverList; -import org.chromium.base.Supplier; import org.chromium.base.ThreadUtils; import org.chromium.base.TraceEvent; import org.chromium.base.library_loader.LibraryLoader; @@ -47,6 +44,9 @@ import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; +import org.chromium.base.supplier.Supplier; import org.chromium.base.task.PostTask; import org.chromium.chrome.R; import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java index b6c9de5..e912395f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator; import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator; import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java index 7dc32dd..1f65fe62 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
@@ -23,8 +23,8 @@ import org.chromium.base.Callback; import org.chromium.base.CommandLine; import org.chromium.base.ContextUtils; -import org.chromium.base.ObservableSupplier; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeSwitches;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java index 78285eb..d97936a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
@@ -4,15 +4,12 @@ package org.chromium.chrome.browser.bookmarks; -import android.view.View; - import androidx.annotation.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.native_page.BasicNativePage; import org.chromium.chrome.browser.native_page.NativePageHost; -import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; import org.chromium.chrome.browser.util.UrlConstants; /** @@ -28,21 +25,14 @@ * @param host A NativePageHost to load urls. */ public BookmarkPage(ChromeActivity activity, NativePageHost host) { - super(activity, host); - } + super(host); - @Override - protected void initialize(ChromeActivity activity, NativePageHost host) { - mManager = new BookmarkManager( - activity, false, ((SnackbarManageable) activity).getSnackbarManager()); + mManager = new BookmarkManager(activity, false, activity.getSnackbarManager()); mManager.setBasicNativePage(this); mManager.setHistoryNavigationDelegate(host.createHistoryNavigationDelegate()); - mTitle = activity.getString(R.string.bookmarks); - } + mTitle = host.getContext().getResources().getString(R.string.bookmarks); - @Override - public View getView() { - return mManager.getView(); + initWithView(mManager.getView()); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/animation/CompositorAnimator.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/animation/CompositorAnimator.java index fc735789..4e1803d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/animation/CompositorAnimator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/animation/CompositorAnimator.java
@@ -18,7 +18,7 @@ import org.chromium.base.Log; import org.chromium.base.ObserverList; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.components.browser_ui.widget.animation.Interpolators; import java.lang.annotation.Retention;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/ephemeraltab/EphemeralTabCaptionControl.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/ephemeraltab/EphemeralTabCaptionControl.java index 0d210a1..75517ce7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/ephemeraltab/EphemeralTabCaptionControl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/ephemeraltab/EphemeralTabCaptionControl.java
@@ -12,7 +12,7 @@ import androidx.annotation.DrawableRes; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelTextViewInflater;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java index fc378223..271671e6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.customtabs; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java index e9c54f0d..e22205a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
@@ -18,7 +18,7 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.ContextUtils; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.DefaultBrowserInfo;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/directactions/DirectActionCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/directactions/DirectActionCoordinator.java index 00b3965..32dc3fa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/directactions/DirectActionCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/directactions/DirectActionCoordinator.java
@@ -10,8 +10,8 @@ import androidx.annotation.NonNull; import org.chromium.base.Callback; -import org.chromium.base.Supplier; import org.chromium.base.metrics.CachedMetrics; +import org.chromium.base.supplier.Supplier; import java.util.LinkedHashSet; import java.util.List;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadPage.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadPage.java index 1ddc5f02..465dba8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadPage.java
@@ -4,8 +4,6 @@ package org.chromium.chrome.browser.download; -import android.view.View; - import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; import org.chromium.base.ApplicationStatus.ActivityStateListener; @@ -17,7 +15,6 @@ import org.chromium.chrome.browser.download.home.DownloadManagerUiConfig; import org.chromium.chrome.browser.native_page.BasicNativePage; import org.chromium.chrome.browser.native_page.NativePageHost; -import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; import org.chromium.chrome.browser.util.UrlConstants; /** @@ -35,21 +32,18 @@ * @param host A NativePageHost to load urls. */ public DownloadPage(ChromeActivity activity, NativePageHost host) { - super(activity, host); - } + super(host); - @Override - protected void initialize(ChromeActivity activity, final NativePageHost host) { ThreadUtils.assertOnUiThread(); DownloadManagerUiConfig config = new DownloadManagerUiConfig.Builder() - .setIsOffTheRecord(host.isIncognito()) + .setIsOffTheRecord(activity.getCurrentTabModel().isIncognito()) .setIsSeparateActivity(false) .setShowPaginationHeaders(DownloadUtils.shouldShowPaginationHeaders()) .build(); mDownloadCoordinator = DownloadManagerCoordinatorFactory.create(activity, config, - ((SnackbarManageable) activity).getSnackbarManager(), activity.getComponentName(), + activity.getSnackbarManager(), activity.getComponentName(), activity.getModalDialogManager()); mDownloadCoordinator.addObserver(this); @@ -63,15 +57,13 @@ // resumed. mActivityStateListener = (activity1, newState) -> { if (newState == ActivityState.RESUMED) { - DownloadUtils.checkForExternallyRemovedDownloads(host.isIncognito()); + DownloadUtils.checkForExternallyRemovedDownloads( + activity.getCurrentTabModel().isIncognito()); } }; ApplicationStatus.registerStateListenerForActivity(mActivityStateListener, activity); - } - @Override - public View getView() { - return mDownloadCoordinator.getView(); + initWithView(mDownloadCoordinator.getView()); } @Override
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 5e0a25e..344c8a3 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
@@ -5,14 +5,12 @@ package org.chromium.chrome.browser.explore_sites; import android.content.Context; -import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.Base64; -import android.view.View; import androidx.annotation.IntDef; import androidx.annotation.Nullable; @@ -161,27 +159,6 @@ } /** - * Create a new instance of the explore sites page. - */ - public ExploreSitesPage(ChromeActivity activity, NativePageHost host) { - super(activity, host); - } - - /** - * Returns whether the given URL should render the ExploreSitesPage native page. - * @param url The url to check. - * @return Whether or not this URL corresponds to the ExploreSitesPage. - */ - public static boolean isExploreSitesUrl(String url) { - Uri uri = Uri.parse(url); - if (!UrlConstants.CHROME_NATIVE_SCHEME.equals(uri.getScheme())) { - return false; - } - - return isExploreSitesHost(uri.getHost()); - } - - /** * Returns whether the given host is the ExploreSitesPage's host. Does not check the * scheme, which is required to fully validate a URL. * @param host The host to check @@ -191,15 +168,19 @@ return UrlConstants.EXPLORE_HOST.equals(host); } - @Override - protected void initialize(ChromeActivity activity, final NativePageHost host) { + /** + * Create a new instance of the explore sites page. + */ + public ExploreSitesPage(ChromeActivity activity, NativePageHost host) { + super(host); + mHost = host; - mTab = mHost.getActiveTab(); + mTab = activity.getActivityTab(); mTitle = activity.getString(R.string.explore_sites_title); mView = (HistoryNavigationLayout) activity.getLayoutInflater().inflate( R.layout.explore_sites_page_layout, null); - mProfile = ((TabImpl) mHost.getActiveTab()).getProfile(); + mProfile = ((TabImpl) mTab).getProfile(); mDenseVariation = ExploreSitesBridge.getDenseVariation(); int maxRows; @@ -253,16 +234,15 @@ context.getResources().getDimensionPixelSize(textSizeDimensionResource)); NativePageNavigationDelegateImpl navDelegate = new NativePageNavigationDelegateImpl( - activity, mProfile, host, activity.getTabModelSelector()); + activity, mProfile, host, activity.getTabModelSelector(), mTab); // Don't direct reference activity because it might change if tab is reparented. - Runnable closeContextMenuCallback = - () -> ((TabImpl) host.getActiveTab()).getActivity().closeContextMenu(); + Runnable closeContextMenuCallback = () -> ((TabImpl) mTab).getActivity().closeContextMenu(); mContextMenuManager = createContextMenuManager( navDelegate, closeContextMenuCallback, CONTEXT_MENU_USER_ACTION_PREFIX); - host.getActiveTab().getWindowAndroid().addContextMenuCloseListener(mContextMenuManager); + mTab.getWindowAndroid().addContextMenuCloseListener(mContextMenuManager); CategoryCardAdapter adapterDelegate = new CategoryCardAdapter( mModel, mLayoutManager, iconGenerator, mContextMenuManager, navDelegate, mProfile); @@ -301,6 +281,8 @@ ExploreSitesBridge.getCatalog(mProfile, ExploreSitesCatalogUpdateRequestSource.EXPLORE_SITES_PAGE, this::translateToModel); + initWithView(mView); + RecordUserAction.record("Android.ExploreSitesPage.Open"); } @@ -458,11 +440,6 @@ } @Override - public View getView() { - return mView; - } - - @Override public String getTitle() { return mTitle; } @@ -488,7 +465,7 @@ if (mTabObserver != null) { mTab.removeObserver(mTabObserver); } - mHost.getActiveTab().getWindowAndroid().removeContextMenuCloseListener(mContextMenuManager); + mTab.getWindowAndroid().removeContextMenuCloseListener(mContextMenuManager); super.destroy(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java index 32983cd..d31478e2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java
@@ -10,8 +10,8 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.CommandLine; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate; import org.chromium.content_public.common.BrowserControlsState;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java index e8bd34ae..a330c3a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java
@@ -20,8 +20,8 @@ import androidx.annotation.Nullable; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.ObservableSupplierImpl; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.chrome.R; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.tab.Tab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegate.java index 589ffbf..e82d1c2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegate.java
@@ -6,7 +6,7 @@ import android.view.View; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegateFactory.java index 6bf4631..f6abe37c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/HistoryNavigationDelegateFactory.java
@@ -9,7 +9,7 @@ import android.view.View; import android.view.WindowInsets; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.tab.Tab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationGlowFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationGlowFactory.java index c31a6e0..08f9c85b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationGlowFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationGlowFactory.java
@@ -6,7 +6,7 @@ import android.view.ViewGroup; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.content_public.browser.WebContents; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationHandler.java index a5ad1b7..b25b24ba 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationHandler.java
@@ -13,7 +13,7 @@ import androidx.annotation.IntDef; import androidx.annotation.VisibleForTesting; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.gesturenav.NavigationBubble.CloseTarget; import java.lang.annotation.Retention;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheet.java index 64db357c..7d37ce8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheet.java
@@ -7,7 +7,7 @@ import android.content.Context; import android.view.View; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; import org.chromium.content_public.browser.NavigationHistory;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheetCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheetCoordinator.java index cc62e4c..606cf80 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheetCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheetCoordinator.java
@@ -13,8 +13,8 @@ import android.widget.ListView; import android.widget.TextView; -import org.chromium.base.Supplier; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.gesturenav.NavigationSheetMediator.ItemProperties; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContent;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java index dab126e1..5f3405c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.history; import android.app.Activity; -import android.view.View; import androidx.annotation.VisibleForTesting; @@ -13,7 +12,6 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.native_page.BasicNativePage; import org.chromium.chrome.browser.native_page.NativePageHost; -import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; import org.chromium.chrome.browser.util.UrlConstants; /** @@ -30,20 +28,14 @@ * @param host A NativePageHost to load URLs. */ public HistoryPage(ChromeActivity activity, NativePageHost host) { - super(activity, host); - } + super(host); - @Override - protected void initialize(ChromeActivity activity, final NativePageHost host) { - mHistoryManager = new HistoryManager(activity, false, - ((SnackbarManageable) activity).getSnackbarManager(), host.isIncognito()); - mTitle = activity.getString(R.string.menu_history); + mHistoryManager = new HistoryManager(activity, false, activity.getSnackbarManager(), + activity.getCurrentTabModel().isIncognito()); + mTitle = host.getContext().getResources().getString(R.string.menu_history); mHistoryManager.setHistoryNavigationDelegate(host.createHistoryNavigationDelegate()); - } - @Override - public View getView() { - return mHistoryManager.getView(); + initWithView(mHistoryManager.getView()); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java index c0256ef9..cb2ee74 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
@@ -9,9 +9,9 @@ import androidx.annotation.VisibleForTesting; -import org.chromium.base.Supplier; import org.chromium.base.TraceEvent; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.IntentHandler;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/ActivityTabStartupMetricsTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/ActivityTabStartupMetricsTracker.java index a37fe3a..aaf81eae2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/ActivityTabStartupMetricsTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/ActivityTabStartupMetricsTracker.java
@@ -6,8 +6,8 @@ import android.os.SystemClock; -import org.chromium.base.ObservableSupplier; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java index 4c9ff99..be285736 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java
@@ -17,8 +17,8 @@ import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; -import org.chromium.base.ObservableSupplier; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.MenuOrKeyboardActionController; import org.chromium.chrome.browser.flags.FeatureUtilities;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/BasicNativePage.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/BasicNativePage.java index 71e91a7..6899cf4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/BasicNativePage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/BasicNativePage.java
@@ -4,43 +4,60 @@ package org.chromium.chrome.browser.native_page; +import android.graphics.Rect; import android.view.View; import android.widget.FrameLayout.LayoutParams; -import org.chromium.chrome.browser.ChromeActivity; -import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; +import org.chromium.base.Callback; +import org.chromium.base.supplier.DestroyableObservableSupplier; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.content_public.browser.LoadUrlParams; /** - * A basic implementation of a white {@link NativePage} that docks below the toolbar. + * A basic implementation of a white {@link NativePage} that docks below the toolbar. This class + * handles default behavior for background color, URL updates and margins. + * + * Sub-classes must call {@link #initWithView(View)} to finish setup. */ -public abstract class BasicNativePage - implements NativePage, ChromeFullscreenManager.FullscreenListener { +public abstract class BasicNativePage implements NativePage { private final NativePageHost mHost; - private final ChromeFullscreenManager mFullscreenManager; private final int mBackgroundColor; - + private DestroyableObservableSupplier<Rect> mMarginSupplier; + private Callback<Rect> mMarginObserver; + private View mView; private String mUrl; - public BasicNativePage(ChromeActivity activity, NativePageHost host) { - initialize(activity, host); + protected BasicNativePage(NativePageHost host) { mHost = host; - mBackgroundColor = ChromeColors.getPrimaryBackgroundColor(activity.getResources(), false); - - mFullscreenManager = activity.getFullscreenManager(); - mFullscreenManager.addListener(this); - - updateMargins(); + mBackgroundColor = + ChromeColors.getPrimaryBackgroundColor(host.getContext().getResources(), false); } /** - * Subclasses shall implement this method to initialize the UI that they hold. + * Sets the View contained in this native page and finishes BasicNativePage initialization. */ - protected abstract void initialize(ChromeActivity activity, NativePageHost host); + protected void initWithView(View view) { + assert mView == null : "initWithView() should only be called once"; + mView = view; + + mMarginObserver = result -> updateMargins(result); + mMarginSupplier = mHost.createDefaultMarginSupplier(); + mMarginSupplier.addObserver(mMarginObserver); + + // Update margins immediately if available rather than waiting for a posted notification. + // Waiting for a posted notification could allow a layout pass to occur before the margins + // are set. + if (mMarginSupplier.get() != null) { + updateMargins(mMarginSupplier.get()); + } + } @Override - public abstract View getView(); + public final View getView() { + assert mView != null : "Need to call initWithView()"; + + return mView; + } @Override public String getUrl() { @@ -64,25 +81,10 @@ @Override public void destroy() { - if (mHost.getActiveTab() == null) return; - mFullscreenManager.removeListener(this); - } - - @Override - public void onContentOffsetChanged(int offset) {} - - @Override - public void onControlsOffsetChanged(int topOffset, int bottomOffset, boolean needsAnimate) { - updateMargins(); - } - - @Override - public void onToggleOverlayVideoMode(boolean enabled) {} - - @Override - public void onBottomControlsHeightChanged( - int bottomControlsHeight, int bottomControlsMinHeight) { - updateMargins(); + if (mMarginSupplier != null) { + mMarginSupplier.removeObserver(mMarginObserver); + mMarginSupplier.destroy(); + } } /** @@ -96,18 +98,13 @@ params.setShouldReplaceCurrentEntry(replaceLastUrl); mHost.loadUrl(params, /* incognito = */ false); } - /** * Updates the top margin depending on whether the browser controls are shown or hidden. */ - private void updateMargins() { - int topMargin = mFullscreenManager.getTopControlsHeight() - + mFullscreenManager.getTopControlOffset(); - int bottomMargin = mFullscreenManager.getBottomControlsHeight() - - mFullscreenManager.getBottomControlOffset(); + private void updateMargins(Rect margins) { LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); - layoutParams.setMargins(0, topMargin, 0, bottomMargin); + layoutParams.setMargins(margins.left, margins.top, margins.left, margins.bottom); getView().setLayoutParams(layoutParams); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/BrowserControlsMarginSupplier.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/BrowserControlsMarginSupplier.java new file mode 100644 index 0000000..ce317ee --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/BrowserControlsMarginSupplier.java
@@ -0,0 +1,62 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.native_page; + +import android.graphics.Rect; + +import org.chromium.base.supplier.DestroyableObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; +import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; + +/** + * An implementation of {@link DestroyableObservableSupplier} that monitors changes to browser + * controls and updates top/bottom margins as needed. + */ +class BrowserControlsMarginSupplier extends ObservableSupplierImpl<Rect> + implements ChromeFullscreenManager.FullscreenListener, DestroyableObservableSupplier<Rect> { + private final ChromeFullscreenManager mFullscreenManager; + + BrowserControlsMarginSupplier(ChromeFullscreenManager fullscreenManager) { + mFullscreenManager = fullscreenManager; + mFullscreenManager.addListener(this); + updateMargins(); + } + + @Override + public void destroy() { + mFullscreenManager.removeListener(this); + } + + @Override + public void onContentOffsetChanged(int offset) {} + + @Override + public void onControlsOffsetChanged(int topOffset, int bottomOffset, boolean needsAnimate) { + updateMargins(); + } + + @Override + public void onToggleOverlayVideoMode(boolean enabled) {} + + @Override + public void onTopControlsHeightChanged( + int topControlsHeight, int topControlsMinHeight, boolean controlsResizeView) { + updateMargins(); + } + + @Override + public void onBottomControlsHeightChanged( + int bottomControlsHeight, int bottomControlsMinHeight) { + updateMargins(); + } + + private void updateMargins() { + int topMargin = mFullscreenManager.getTopControlsHeight() + + mFullscreenManager.getTopControlOffset(); + int bottomMargin = mFullscreenManager.getBottomControlsHeight() + - mFullscreenManager.getBottomControlOffset(); + super.set(new Rect(0, topMargin, 0, bottomMargin)); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePage.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePage.java index c1b4694..ff1a9f8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePage.java
@@ -7,7 +7,7 @@ import android.view.View; /** - * An interface for pages that will be shown in a tab using Android views instead of html. + * An interface for pages that will be using Android views instead of html/rendered Web content. */ public interface NativePage { /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java index 43c2df60..e86229a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java
@@ -4,19 +4,22 @@ package org.chromium.chrome.browser.native_page; +import android.content.Context; +import android.graphics.Rect; import android.net.Uri; import androidx.annotation.IntDef; import androidx.annotation.VisibleForTesting; +import org.chromium.base.supplier.DestroyableObservableSupplier; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.TabLoadStatus; import org.chromium.chrome.browser.bookmarks.BookmarkPage; import org.chromium.chrome.browser.download.DownloadPage; import org.chromium.chrome.browser.explore_sites.ExploreSitesPage; import org.chromium.chrome.browser.feed.FeedNewTabPage; +import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.gesturenav.HistoryNavigationDelegate; import org.chromium.chrome.browser.gesturenav.HistoryNavigationDelegateFactory; import org.chromium.chrome.browser.history.HistoryPage; @@ -50,38 +53,43 @@ activity.getLifecycleDispatcher(); if (tab.isIncognito()) { - return new IncognitoNewTabPage(activity, new TabShim(tab)); + return new IncognitoNewTabPage( + activity, new TabShim(tab, activity.getFullscreenManager())); } if (ChromeFeatureList.isEnabled(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)) { - return new FeedNewTabPage(activity, new TabShim(tab), tabModelSelector, - activityTabProvider, activityLifecycleDispatcher); + return new FeedNewTabPage(activity, + new TabShim(tab, activity.getFullscreenManager()), tabModelSelector, + activityTabProvider, activityLifecycleDispatcher, (TabImpl) tab); } - return new NewTabPage(activity, new TabShim(tab), tabModelSelector, activityTabProvider, - activityLifecycleDispatcher); + return new NewTabPage(activity, new TabShim(tab, activity.getFullscreenManager()), + tabModelSelector, activityTabProvider, activityLifecycleDispatcher, + (TabImpl) tab); } protected NativePage buildBookmarksPage(ChromeActivity activity, Tab tab) { - return new BookmarkPage(activity, new TabShim(tab)); + return new BookmarkPage(activity, new TabShim(tab, activity.getFullscreenManager())); } protected NativePage buildDownloadsPage(ChromeActivity activity, Tab tab) { - return new DownloadPage(activity, new TabShim(tab)); + return new DownloadPage(activity, new TabShim(tab, activity.getFullscreenManager())); } protected NativePage buildExploreSitesPage(ChromeActivity activity, Tab tab) { - return new ExploreSitesPage(activity, new TabShim(tab)); + return new ExploreSitesPage( + activity, new TabShim(tab, activity.getFullscreenManager())); } protected NativePage buildHistoryPage(ChromeActivity activity, Tab tab) { - return new HistoryPage(activity, new TabShim(tab)); + return new HistoryPage(activity, new TabShim(tab, activity.getFullscreenManager())); } protected NativePage buildRecentTabsPage(ChromeActivity activity, Tab tab) { RecentTabsManager recentTabsManager = new RecentTabsManager(tab, ((TabImpl) tab).getProfile(), activity); - return new RecentTabsPage(activity, recentTabsManager, new TabShim(tab)); + return new RecentTabsPage( + activity, recentTabsManager, new TabShim(tab, activity.getFullscreenManager())); } } @@ -205,26 +213,28 @@ /** Simple implementation of NativePageHost backed by a {@link Tab} */ private static class TabShim implements NativePageHost { private final Tab mTab; + private final ChromeFullscreenManager mFullscreenManager; - public TabShim(Tab mTab) { - this.mTab = mTab; + public TabShim(Tab tab, ChromeFullscreenManager fullscreenManager) { + mTab = tab; + mFullscreenManager = fullscreenManager; } @Override - public int loadUrl(LoadUrlParams urlParams, boolean incognito) { + public Context getContext() { + return mTab.getContext(); + } + + @Override + public void loadUrl(LoadUrlParams urlParams, boolean incognito) { if (incognito && !mTab.isIncognito()) { TabModelSelector.from(mTab).openNewTab(urlParams, TabLaunchType.FROM_LONGPRESS_FOREGROUND, mTab, /* incognito = */ true); - return TabLoadStatus.DEFAULT_PAGE_LOAD; + return; } - return mTab.loadUrl(urlParams); - } - - @Override - public boolean isIncognito() { - return mTab.isIncognito(); + mTab.loadUrl(urlParams); } @Override @@ -233,11 +243,6 @@ } @Override - public Tab getActiveTab() { - return mTab; - } - - @Override public boolean isVisible() { return mTab == TabModelSelector.from(mTab).getCurrentTab(); } @@ -246,5 +251,10 @@ public HistoryNavigationDelegate createHistoryNavigationDelegate() { return HistoryNavigationDelegateFactory.create(mTab); } + + @Override + public DestroyableObservableSupplier<Rect> createDefaultMarginSupplier() { + return new BrowserControlsMarginSupplier(mFullscreenManager); + } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageHost.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageHost.java index 52834b8..d5412e3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageHost.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageHost.java
@@ -4,10 +4,11 @@ package org.chromium.chrome.browser.native_page; -import androidx.annotation.Nullable; +import android.content.Context; +import android.graphics.Rect; +import org.chromium.base.supplier.DestroyableObservableSupplier; import org.chromium.chrome.browser.gesturenav.HistoryNavigationDelegate; -import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.LoadUrlParams; /** @@ -15,22 +16,18 @@ */ public interface NativePageHost { /** + * @return A context to use for inflating views and obtaining resources. + */ + Context getContext(); + + /** * Load a non-native URL in an active tab. This should be used to either navigate away from * the current native page or load external content in a content area (i.e. a tab or web * contents). * @param urlParams The params describing the URL to be loaded. * @param incognito Whether the URL should be loaded in incognito mode. - * @return {@link TabLoadStatus.FULL_PRERENDERED_PAGE_LOAD} or - * {@link TabLoadStatus.PARTIAL_PRERENDERED_PAGE_LOAD} if the page has been prerendered. - * {@link TabLoadStatus.DEFAULT_PAGE_LOAD} if it had not */ - int loadUrl(LoadUrlParams urlParams, boolean incognito); - - /** - * Determine if the browser is currently in an incognito context. - * @return True if the browser is incognito. - */ - boolean isIncognito(); + void loadUrl(LoadUrlParams urlParams, boolean incognito); /** * If the host is a tab, get the ID of its parent. @@ -38,15 +35,6 @@ */ int getParentId(); - /** - * Get the currently active tab. This may be the tab that is displaying the native page or the - * tab behind the bottom sheet (if enabled). If the bottom sheet is open and displaying the - * NTP UI, then the active tab will be null. - * @return The active tab. - */ - @Nullable - Tab getActiveTab(); - /** @return whether the hosted native page is currently visible. */ boolean isVisible(); @@ -55,4 +43,12 @@ * @return {@link HistoryNavigationDelegate} implementation. */ HistoryNavigationDelegate createHistoryNavigationDelegate(); + + /** + * Creates a default margin supplier. Once created, the NativePage is responsible for calling + * {@link DestroyableObservableSupplier#destroy()} to clean-up the supplier once it is no longer + * needed. + * @return A {@link DestroyableObservableSupplier} to use for setting margins. + */ + DestroyableObservableSupplier<Rect> createDefaultMarginSupplier(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java index 7c8bbb7..97a51dd0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageNavigationDelegateImpl.java
@@ -31,16 +31,18 @@ private static final String TAG = "PageNavDelegate"; private final Profile mProfile; private final TabModelSelector mTabModelSelector; + private final Tab mTab; protected final ChromeActivity mActivity; protected final NativePageHost mHost; public NativePageNavigationDelegateImpl(ChromeActivity activity, Profile profile, - NativePageHost host, TabModelSelector tabModelSelector) { + NativePageHost host, TabModelSelector tabModelSelector, Tab tab) { mActivity = activity; mProfile = profile; mHost = host; mTabModelSelector = tabModelSelector; + mTab = tab; } @Override @@ -56,7 +58,7 @@ switch (windowOpenDisposition) { case WindowOpenDisposition.CURRENT_TAB: mHost.loadUrl(loadUrlParams, mTabModelSelector.isIncognitoSelected()); - loadingTab = mHost.getActiveTab(); + loadingTab = mTab; break; case WindowOpenDisposition.NEW_BACKGROUND_TAB: loadingTab = openUrlInNewTab(loadUrlParams); @@ -84,7 +86,7 @@ private Tab openUrlInNewTab(LoadUrlParams loadUrlParams) { Tab tab = mTabModelSelector.openNewTab(loadUrlParams, - TabLaunchType.FROM_LONGPRESS_BACKGROUND, mHost.getActiveTab(), + TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, /* incognito = */ false); // If animations are disabled in the DeviceClassManager, a toast is already displayed for @@ -100,9 +102,8 @@ } private void saveUrlForOffline(String url) { - if (mHost.getActiveTab() != null) { - OfflinePageBridge.getForProfile(mProfile).scheduleDownload( - mHost.getActiveTab().getWebContents(), + if (mTab != null) { + OfflinePageBridge.getForProfile(mProfile).scheduleDownload(mTab.getWebContents(), OfflinePageBridge.NTP_SUGGESTIONS_NAMESPACE, url, DownloadUiActionFlags.ALL); } else { RequestCoordinatorBridge.getForProfile(mProfile).savePageLater(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java index 833b4ac..7b161d6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java
@@ -9,14 +9,12 @@ import android.os.Build; import android.support.v4.view.ViewCompat; import android.view.LayoutInflater; -import android.view.View; import android.widget.TextView; import androidx.annotation.VisibleForTesting; import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; -import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.native_page.BasicNativePage; @@ -52,23 +50,14 @@ * Constructs an Incognito NewTabPage. * @param activity The activity used to create the new tab page's View. */ - public IncognitoNewTabPage(ChromeActivity activity, NativePageHost host) { - super(activity, host); + public IncognitoNewTabPage(Activity activity, NativePageHost host) { + super(host); - mIncognitoNTPBackgroundColor = - ApiCompatibilityUtils.getColor(activity.getResources(), R.color.ntp_bg_incognito); - - // Work around https://crbug.com/943873 and https://crbug.com/963385 where default focus - // highlight shows up after toggling dark mode. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - getView().setDefaultFocusHighlightEnabled(false); - } - } - - @Override - protected void initialize(ChromeActivity activity, final NativePageHost host) { mActivity = activity; + mIncognitoNTPBackgroundColor = ApiCompatibilityUtils.getColor( + host.getContext().getResources(), R.color.ntp_bg_incognito); + mIncognitoNewTabPageManager = new IncognitoNewTabPageManager() { @Override public void loadIncognitoLearnMore() { @@ -89,17 +78,25 @@ } }; - mTitle = activity.getResources().getString(R.string.button_new_tab); + mTitle = host.getContext().getResources().getString(R.string.button_new_tab); - LayoutInflater inflater = LayoutInflater.from(activity); + LayoutInflater inflater = LayoutInflater.from(host.getContext()); mIncognitoNewTabPageView = (IncognitoNewTabPageView) inflater.inflate(R.layout.new_tab_page_incognito, null); mIncognitoNewTabPageView.initialize(mIncognitoNewTabPageManager); mIncognitoNewTabPageView.setNavigationDelegate(host.createHistoryNavigationDelegate()); TextView newTabIncognitoHeader = - (TextView) mIncognitoNewTabPageView.findViewById(R.id.new_tab_incognito_title); + mIncognitoNewTabPageView.findViewById(R.id.new_tab_incognito_title); newTabIncognitoHeader.setText(R.string.new_tab_otr_title); + + // Work around https://crbug.com/943873 and https://crbug.com/963385 where default focus + // highlight shows up after toggling dark mode. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + mIncognitoNewTabPageView.setDefaultFocusHighlightEnabled(false); + } + + initWithView(mIncognitoNewTabPageView); } /** @@ -140,11 +137,6 @@ } @Override - public View getView() { - return mIncognitoNewTabPageView; - } - - @Override public String getHost() { return UrlConstants.NTP_HOST; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java index 16406a96..6545bc5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -85,7 +85,7 @@ private static final String NAVIGATION_ENTRY_SCROLL_POSITION_KEY = "NewTabPageScrollPosition"; public static final String CONTEXT_MENU_USER_ACTION_PREFIX = "Suggestions"; - protected final Tab mTab; + protected final TabImpl mTab; private final ActivityTabProvider mActivityTabProvider; private final ActivityLifecycleDispatcher mActivityLifecycleDispatcher; @@ -274,24 +274,26 @@ * @param tabModelSelector The TabModelSelector used to open tabs. * @param activityTabProvider Allows us to check if we are the current tab. * @param activityLifecycleDispatcher Allows us to subscribe to backgrounding events. + * @param tab The {@link TabImpl} that contains this new tab page. */ public NewTabPage(ChromeActivity activity, NativePageHost nativePageHost, TabModelSelector tabModelSelector, ActivityTabProvider activityTabProvider, - ActivityLifecycleDispatcher activityLifecycleDispatcher) { + ActivityLifecycleDispatcher activityLifecycleDispatcher, TabImpl tab) { mConstructedTimeNs = System.nanoTime(); TraceEvent.begin(TAG); mActivityTabProvider = activityTabProvider; mActivityLifecycleDispatcher = activityLifecycleDispatcher; - mTab = nativePageHost.getActiveTab(); - Profile profile = ((TabImpl) mTab).getProfile(); + + mTab = tab; + Profile profile = mTab.getProfile(); SuggestionsDependencyFactory depsFactory = SuggestionsDependencyFactory.getInstance(); SuggestionsSource suggestionsSource = depsFactory.createSuggestionSource(profile); SuggestionsEventReporter eventReporter = depsFactory.createEventReporter(); SuggestionsNavigationDelegate navigationDelegate = new SuggestionsNavigationDelegate( - activity, profile, nativePageHost, tabModelSelector); + activity, profile, nativePageHost, tabModelSelector, mTab); mNewTabPageManager = new NewTabPageManagerImpl(suggestionsSource, eventReporter, navigationDelegate, profile, nativePageHost, GlobalDiscardableReferencePool.getReferencePool(), activity.getSnackbarManager());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java index bb00f93..2b3cbd5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
@@ -19,9 +19,9 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Log; -import org.chromium.base.Supplier; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ActivityTabProvider.ActivityTabTabObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessor.java index c4d6fe75..c9019266 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessor.java
@@ -8,9 +8,9 @@ import android.graphics.Bitmap; import android.support.annotation.DrawableRes; -import org.chromium.base.Supplier; import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.image_fetcher.ImageFetcher; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessor.java index 955bea8..18445f0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessor.java
@@ -9,8 +9,8 @@ import android.support.annotation.DrawableRes; import android.text.TextUtils; -import org.chromium.base.Supplier; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.favicon.LargeIconBridge;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java index 7d4600b..c6a5f11 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionProcessor.java
@@ -14,9 +14,9 @@ import androidx.annotation.IntDef; -import org.chromium.base.Supplier; import org.chromium.base.metrics.CachedMetrics; import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeFeatureList;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessor.java index d7804318..6ec08d5c7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessor.java
@@ -12,10 +12,10 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Log; -import org.chromium.base.Supplier; import org.chromium.base.SysUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.image_fetcher.ImageFetcher; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java index f35747d..04e1edc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java
@@ -11,8 +11,8 @@ import androidx.annotation.VisibleForTesting; -import org.chromium.base.Supplier; import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeVersionInfo; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java index d695e6b..f705f287 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java
@@ -30,8 +30,8 @@ private static final String NEW_TAB_URL_HELP = "https://support.google.com/chrome/?p=new_tab"; public SuggestionsNavigationDelegate(ChromeActivity activity, Profile profile, - NativePageHost host, TabModelSelector tabModelSelector) { - super(activity, profile, host, tabModelSelector); + NativePageHost host, TabModelSelector tabModelSelector, Tab tab) { + super(activity, profile, host, tabModelSelector, tab); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java index 872209d6..5130fa8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/BrowserControlsVisibilityDelegate.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.tab; -import org.chromium.base.ObservableSupplierImpl; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.content_public.common.BrowserControlsState; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java index bd3bb6d..30d32d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java
@@ -7,7 +7,7 @@ import android.content.Context; import android.view.View; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.appmenu.AppMenuIconRowFooter;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java index 24e51715..46dc669 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java
@@ -17,7 +17,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.compositor.layouts.EmptyOverviewModeObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java index cc8f540..14831ab 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -8,8 +8,8 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; import org.chromium.base.TraceEvent; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.task.PostTask; import org.chromium.chrome.browser.AppHooks; import org.chromium.chrome.browser.ChromeActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java index bbfc54b..ec7c4207 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java
@@ -9,7 +9,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.ImmersiveModeManager;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java index 57b9356f..38facb5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
@@ -9,9 +9,9 @@ import androidx.annotation.Nullable; -import org.chromium.base.Supplier; import org.chromium.base.SysUtils; import org.chromium.base.TraceEvent; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.ServiceTabLauncher;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index e24e78f..d49409f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -28,12 +28,12 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; import org.chromium.base.MathUtils; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.ObservableSupplierImpl; -import org.chromium.base.Supplier; import org.chromium.base.metrics.CachedMetrics.ActionEvent; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java index c75d2020..f9e9a9d9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java
@@ -12,7 +12,7 @@ import androidx.annotation.Nullable; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java index 4f5bc0e..eb16977 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java
@@ -10,7 +10,7 @@ import android.view.ViewGroup; import android.view.ViewStub; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ThemeColorProvider;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java index 794d6db..73acce327 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java
@@ -9,7 +9,7 @@ import android.view.View.OnLongClickListener; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ActivityTabProvider.HintlessActivityTabObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomSheetManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomSheetManager.java index dc545d3..964d580b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomSheetManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomSheetManager.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.ui; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.tab.Tab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java index d1bc8ba..4ee78c7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
@@ -13,10 +13,10 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; -import org.chromium.base.Supplier; import org.chromium.base.TraceEvent; import org.chromium.base.metrics.RecordUserAction; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/EmptyBackgroundViewWrapper.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/EmptyBackgroundViewWrapper.java index d152301..8a7461e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/EmptyBackgroundViewWrapper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/EmptyBackgroundViewWrapper.java
@@ -12,7 +12,7 @@ import androidx.annotation.Nullable; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.tab.Tab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappTabDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappTabDelegate.java index fb62689..cf381e89 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappTabDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappTabDelegate.java
@@ -16,7 +16,7 @@ import org.chromium.base.Log; import org.chromium.base.PackageManagerUtils; import org.chromium.base.StrictModeContext; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider.LaunchSourceType;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java index 07f14155..e3a4425 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetController.java
@@ -10,7 +10,7 @@ import androidx.annotation.IntDef; import androidx.annotation.VisibleForTesting; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ActivityTabProvider.HintlessActivityTabObserver; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ShareIntentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ShareIntentTest.java index 7c0aeb38..6caf641 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ShareIntentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ShareIntentTest.java
@@ -19,7 +19,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; import org.chromium.base.test.util.CommandLineFlags;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java index 9eca80b..a3aa43e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java
@@ -14,7 +14,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.tabmodel.ChromeTabCreator;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java index 7ff13c5..96fc6ea8 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java
@@ -14,7 +14,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.ObservableSupplierImpl; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.MetricsUtils.HistogramDelta;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java index dbbca71..1f2be8c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
@@ -22,7 +22,7 @@ import org.robolectric.shadows.ShadowLooper; import org.chromium.base.Callback; -import org.chromium.base.ObservableSupplierImpl; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Feature; import org.chromium.content_public.common.BrowserControlsState;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninPromoUtilTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninPromoUtilTest.java index f26c1b16..fe744ea 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninPromoUtilTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninPromoUtilTest.java
@@ -21,7 +21,7 @@ import org.mockito.Mockito; import org.robolectric.annotation.Config; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.base.test.BaseRobolectricTestRunner; import java.util.Arrays;
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 9deb3cf..ecfdd1d 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS
@@ -458,4 +458,7 @@ "chrome_authenticator_request_delegate_unittest\.cc": [ "+third_party/microsoft_webauthn/webauthn.h", ], + "chrome_find_request_manager_browsertest\.cc": [ + "+pdf/document_loader_impl.h", + ], }
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index f35b53e..c8641a03 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2111,6 +2111,9 @@ {"crostini-backup", flag_descriptions::kCrostiniBackupName, flag_descriptions::kCrostiniBackupDescription, kOsCrOS, FEATURE_VALUE_TYPE(chromeos::features::kCrostiniBackup)}, + {"crostini-port-forwarding", flag_descriptions::kCrostiniPortForwardingName, + flag_descriptions::kCrostiniPortForwardingDescription, kOsCrOS, + FEATURE_VALUE_TYPE(chromeos::features::kCrostiniPortForwarding)}, {"terminal-system-app", flag_descriptions::kTerminalSystemAppName, flag_descriptions::kTerminalSystemAppDescription, kOsCrOS, FEATURE_VALUE_TYPE(features::kTerminalSystemApp)},
diff --git a/chrome/browser/android/autofill_assistant/ui_controller_android.cc b/chrome/browser/android/autofill_assistant/ui_controller_android.cc index 611b676..3927e6f8 100644 --- a/chrome/browser/android/autofill_assistant/ui_controller_android.cc +++ b/chrome/browser/android/autofill_assistant/ui_controller_android.cc
@@ -941,6 +941,10 @@ env, jmodel, base::android::ConvertUTF8ToJavaString( env, collect_user_data_options->billing_postal_code_missing_text)); + Java_AssistantCollectUserDataModel_setCreditCardExpiredText( + env, jmodel, + base::android::ConvertUTF8ToJavaString( + env, collect_user_data_options->credit_card_expired_text)); Java_AssistantCollectUserDataModel_setSupportedBasicCardNetworks( env, jmodel, base::android::ToJavaArrayOfStrings(
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc index 873f56b..c14358e 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -300,7 +300,8 @@ browser_context); } -ChromeBrowsingDataRemoverDelegate::~ChromeBrowsingDataRemoverDelegate() {} +ChromeBrowsingDataRemoverDelegate::~ChromeBrowsingDataRemoverDelegate() = + default; void ChromeBrowsingDataRemoverDelegate::Shutdown() { history_task_tracker_.TryCancelAll();
diff --git a/chrome/browser/chrome_find_request_manager_browsertest.cc b/chrome/browser/chrome_find_request_manager_browsertest.cc index 5ee3f14f..387d7da 100644 --- a/chrome/browser/chrome_find_request_manager_browsertest.cc +++ b/chrome/browser/chrome_find_request_manager_browsertest.cc
@@ -3,7 +3,10 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/files/file_util.h" +#include "base/path_service.h" #include "base/strings/utf_string_conversions.h" +#include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "chrome/browser/pdf/pdf_extension_test_util.h" #include "chrome/browser/ui/browser.h" @@ -12,11 +15,16 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_plugin_guest_manager.h" +#include "content/public/browser/navigation_controller.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/find_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/controllable_http_response.h" +#include "pdf/document_loader_impl.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h" namespace content { @@ -31,7 +39,6 @@ void SetUpOnMainThread() override { host_resolver()->AddRule("*", "127.0.0.1"); embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data"); - ASSERT_TRUE(embedded_test_server()->Start()); // Swap the WebContents's delegate for our test delegate. normal_delegate_ = contents()->GetDelegate(); @@ -89,6 +96,7 @@ #define MAYBE_FindInPDF FindInPDF #endif IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, MAYBE_FindInPDF) { + ASSERT_TRUE(embedded_test_server()->Start()); LoadAndWait("/find_in_pdf_page.pdf"); ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents())); @@ -106,6 +114,132 @@ EXPECT_EQ(3, results.active_match_ordinal); } +void SendRangeResponse(net::test_server::ControllableHttpResponse* response, + const std::string& pdf_contents) { + int range_start = -1; + int range_end = -1; + { + auto it = response->http_request()->headers.find("Range"); + ASSERT_NE(response->http_request()->headers.end(), it); + base::StringPiece range_header = it->second; + base::StringPiece kBytesPrefix = "bytes="; + ASSERT_TRUE(range_header.starts_with(kBytesPrefix)); + range_header.remove_prefix(kBytesPrefix.size()); + auto dash_pos = range_header.find('-'); + ASSERT_NE(std::string::npos, dash_pos); + ASSERT_LT(0u, dash_pos); + ASSERT_LT(dash_pos, range_header.size() - 1); + ASSERT_TRUE( + base::StringToInt(range_header.substr(0, dash_pos), &range_start)); + ASSERT_TRUE( + base::StringToInt(range_header.substr(dash_pos + 1), &range_end)); + } + ASSERT_LT(0, range_start); + ASSERT_LT(range_start, range_end); + ASSERT_LT(static_cast<size_t>(range_end), pdf_contents.size()); + int range_length = range_end - range_start + 1; + response->Send("HTTP/1.1 206 Partial Content\r\n"); + response->Send(base::StringPrintf("Content-Range: bytes %d-%d/%zu\r\n", + range_start, range_end, + pdf_contents.size())); + response->Send(base::StringPrintf("Content-Length: %d\r\n", range_length)); + response->Send("\r\n"); + response->Send(pdf_contents.substr(range_start, range_length)); + response->Done(); +} + +// Tests searching in a PDF received in chunks via range-requests. See also +// https://crbug.com/1027173. +IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, FindInChunkedPDF) { + constexpr uint32_t kStalledResponseSize = + chrome_pdf::DocumentLoaderImpl::kDefaultRequestSize + 123; + + // Load contents of a big, linearized pdf test file. + // See also //content/test/data/linearized.pdf.README file. + std::string pdf_contents; + { + base::ScopedAllowBlockingForTesting allow_blocking_io; + base::FilePath content_test_dir; + ASSERT_TRUE( + base::PathService::Get(content::DIR_TEST_DATA, &content_test_dir)); + base::FilePath real_pdf_path = + content_test_dir.AppendASCII("linearized.pdf"); + ASSERT_TRUE(base::ReadFileToString(real_pdf_path, &pdf_contents)); + } + DCHECK_GT(pdf_contents.size(), kStalledResponseSize); + + // Set up handling of HTTP responses from within the test. + const char kSimulatedPdfPath[] = "/simulated/chunked.pdf"; + net::test_server::ControllableHttpResponse nav_response( + embedded_test_server(), kSimulatedPdfPath); + net::test_server::ControllableHttpResponse range_response1( + embedded_test_server(), kSimulatedPdfPath); + net::test_server::ControllableHttpResponse range_response2( + embedded_test_server(), kSimulatedPdfPath); + ASSERT_TRUE(embedded_test_server()->Start()); + GURL pdf_url = embedded_test_server()->GetURL("a.com", kSimulatedPdfPath); + + // Kick-off browser-initiated navigation to a PDF file. + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + TestNavigationObserver navigation_observer(web_contents); + content::NavigationController::LoadURLParams params(pdf_url); + params.transition_type = ui::PageTransitionFromInt( + ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); + web_contents->GetController().LoadURLWithParams(params); + + // Have the test HTTP server handle the 1st request (navigation). This + // request is handler in the test, rather than by embedded_test_server, to + // stall the request after it delivers the first kStalledResponseSize bytes of + // data (the stalling ensures that the range request will be processed in the + // next test steps). + nav_response.WaitForRequest(); + nav_response.Send("HTTP/1.1 200 OK\r\n"); + nav_response.Send("Accept-Ranges: bytes\r\n"); + nav_response.Send( + base::StringPrintf("Content-Length: %zu\r\n", pdf_contents.size())); + nav_response.Send("Content-Type: application/pdf\r\n"); + nav_response.Send("Pragma: no-cache\r\n"); + nav_response.Send("Cache-Control: no-cache, no-store, must-revalidate\r\n"); + nav_response.Send("\r\n"); + nav_response.Send(pdf_contents.substr(0, kStalledResponseSize)); + + // At this point the navigation should be considered successful (even though + // we haven't loaded all the bytes of the PDF yet). + navigation_observer.Wait(); + ASSERT_TRUE(navigation_observer.last_navigation_succeeded()); + + // Have the test handle the 2 range requests (subresource requests initiated + // by the PDF plugin and proxied through a renderer process for + // MimeHandlerView extension). These requests are handled in the test, rather + // than by embedded_test_server, to verify that we are indeed getting range + // requests (i.e. this is a sanity check that the test still tests the right + // thing). + range_response1.WaitForRequest(); + SendRangeResponse(&range_response1, pdf_contents); + range_response2.WaitForRequest(); + SendRangeResponse(&range_response2, pdf_contents); + + // Finish the first HTTP response and verify that the PDF has loaded + // successfully. + nav_response.Done(); + ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents())); + + // Verify that find-in-page works fine. + auto options = blink::mojom::FindOptions::New(); + options->run_synchronously_for_testing = true; + Find("FXCMAP_CMap", options.Clone()); + options->find_next = true; + Find("FXCMAP_CMap", options.Clone()); + Find("FXCMAP_CMap", options.Clone()); + delegate()->WaitForFinalReply(); + + FindResults results = delegate()->GetFindResults(); + EXPECT_EQ(last_request_id(), results.request_id); + EXPECT_EQ(15, results.number_of_matches); + EXPECT_EQ(3, results.active_match_ordinal); +} + // Tests searching in a page with embedded PDFs. Note that this test, the // FindInPDF test, and the find tests in web_view_browsertest.cc ensure that // find-in-page works across GuestViews. @@ -115,6 +249,7 @@ // fixed and enabled in a subsequent patch. IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, DISABLED_FindInEmbeddedPDFs) { + ASSERT_TRUE(embedded_test_server()->Start()); LoadAndWait("/find_in_embedded_pdf_page.html"); ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents())); @@ -134,6 +269,7 @@ } IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, FindMissingStringInPDF) { + ASSERT_TRUE(embedded_test_server()->Start()); LoadAndWait("/find_in_pdf_page.pdf"); ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents())); @@ -152,6 +288,7 @@ // done by a user typing into the find bar. IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, CharacterByCharacterFindInPDF) { + ASSERT_TRUE(embedded_test_server()->Start()); LoadAndWait("/find_in_pdf_page.pdf"); ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents()));
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 08c7bf3..fd69f52 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -836,8 +836,8 @@ "crostini/ansible/software_config.h", "crostini/crostini_export_import.cc", "crostini/crostini_export_import.h", - "crostini/crostini_export_import_notification.cc", - "crostini/crostini_export_import_notification.h", + "crostini/crostini_export_import_notification_controller.cc", + "crostini/crostini_export_import_notification_controller.h", "crostini/crostini_export_import_status_tracker.cc", "crostini/crostini_export_import_status_tracker.h", "crostini/crostini_features.cc", @@ -2013,6 +2013,8 @@ "power/renderer_freezer.h", "power/smart_charging/smart_charging_manager.cc", "power/smart_charging/smart_charging_manager.h", + "power/smart_charging/smart_charging_ukm_logger.cc", + "power/smart_charging/smart_charging_ukm_logger.h", "preferences.cc", "preferences.h", "printing/automatic_usb_printer_configurer.cc", @@ -2937,6 +2939,7 @@ "power/process_data_collector_unittest.cc", "power/renderer_freezer_unittest.cc", "power/smart_charging/smart_charging_manager_unittest.cc", + "power/smart_charging/smart_charging_ukm_logger_unittest.cc", "preferences_unittest.cc", "printing/automatic_usb_printer_configurer_unittest.cc", "printing/bulk_printers_calculator_unittest.cc",
diff --git a/chrome/browser/chromeos/arc/session/arc_session_manager.cc b/chrome/browser/chromeos/arc/session/arc_session_manager.cc index 0cd4090f..4d89d03 100644 --- a/chrome/browser/chromeos/arc/session/arc_session_manager.cc +++ b/chrome/browser/chromeos/arc/session/arc_session_manager.cc
@@ -43,6 +43,7 @@ #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager/session_manager_client.h" +#include "chromeos/system/statistics_provider.h" #include "components/account_id/account_id.h" #include "components/arc/arc_features.h" #include "components/arc/arc_prefs.h" @@ -80,7 +81,18 @@ // Maximum amount of time we'll wait for ARC to finish booting up. Once this // timeout expires, keep ARC running in case the user wants to file feedback, // but present the UI to try again. -constexpr base::TimeDelta kArcSignInTimeout = base::TimeDelta::FromMinutes(5); +base::TimeDelta GetArcSignInTimeout() { + constexpr base::TimeDelta kArcSignInTimeout = base::TimeDelta::FromMinutes(5); + constexpr base::TimeDelta kArcVmSignInTimeoutForVM = + base::TimeDelta::FromMinutes(20); + + if (chromeos::system::StatisticsProvider::GetInstance()->IsRunningOnVm() && + arc::IsArcVmEnabled()) { + return kArcVmSignInTimeoutForVM; + } else { + return kArcSignInTimeout; + } +} // Updates UMA with user cancel only if error is not currently shown. void MaybeUpdateOptInCancelUMA(const ArcSupportHost* support_host) { @@ -968,7 +980,7 @@ VLOG(1) << "Starting ARC for first sign in."; sign_in_start_time_ = base::TimeTicks::Now(); arc_sign_in_timer_.Start( - FROM_HERE, kArcSignInTimeout, + FROM_HERE, GetArcSignInTimeout(), base::Bind(&ArcSessionManager::OnArcSignInTimeout, weak_ptr_factory_.GetWeakPtr())); StartArc();
diff --git a/chrome/browser/chromeos/crostini/crostini_export_import.cc b/chrome/browser/chromeos/crostini/crostini_export_import.cc index eafb81c..76b41624 100644 --- a/chrome/browser/chromeos/crostini/crostini_export_import.cc +++ b/chrome/browser/chromeos/crostini/crostini_export_import.cc
@@ -107,8 +107,8 @@ ExportImportType type, ContainerId container_id) { TrackerFactory factory = - base::BindOnce(&CrostiniExportImportNotification::Create, profile_, - container_id, GetUniqueNotificationId()); + base::BindOnce(&CrostiniExportImportNotificationController::Create, + profile_, container_id, GetUniqueNotificationId()); return NewOperationData(type, std::move(container_id), std::move(factory)); } @@ -616,13 +616,14 @@ return status_trackers_.find(id) != status_trackers_.end(); } -CrostiniExportImportNotification* -CrostiniExportImport::GetNotificationForTesting(ContainerId container_id) { +CrostiniExportImportNotificationController* +CrostiniExportImport::GetNotificationControllerForTesting( + ContainerId container_id) { auto it = status_trackers_.find(container_id); if (it == status_trackers_.end()) { return nullptr; } - return static_cast<CrostiniExportImportNotification*>(it->second); + return static_cast<CrostiniExportImportNotificationController*>(it->second); } } // namespace crostini
diff --git a/chrome/browser/chromeos/crostini/crostini_export_import.h b/chrome/browser/chromeos/crostini/crostini_export_import.h index 024222c..3583f150 100644 --- a/chrome/browser/chromeos/crostini/crostini_export_import.h +++ b/chrome/browser/chromeos/crostini/crostini_export_import.h
@@ -12,7 +12,7 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "base/time/time.h" -#include "chrome/browser/chromeos/crostini/crostini_export_import_notification.h" +#include "chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.h" #include "chrome/browser/chromeos/crostini/crostini_manager.h" #include "components/keyed_service/core/keyed_service.h" @@ -117,8 +117,8 @@ // Whether an export or import is currently in progress. bool GetExportImportOperationStatus() const; - CrostiniExportImportNotification* GetNotificationForTesting( - ContainerId container_id); + CrostiniExportImportNotificationController* + GetNotificationControllerForTesting(ContainerId container_id); private: FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
diff --git a/chrome/browser/chromeos/crostini/crostini_export_import_notification.cc b/chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.cc similarity index 87% rename from chrome/browser/chromeos/crostini/crostini_export_import_notification.cc rename to chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.cc index 16878ea..6ce81e8 100644 --- a/chrome/browser/chromeos/crostini/crostini_export_import_notification.cc +++ b/chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/crostini/crostini_export_import_notification.h" +#include "chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.h" #include "ash/public/cpp/notification_utils.h" #include "base/strings/utf_string_conversions.h" @@ -32,12 +32,13 @@ } // namespace -CrostiniExportImportNotification::CrostiniExportImportNotification( - Profile* profile, - ExportImportType type, - const std::string& notification_id, - base::FilePath path, - ContainerId container_id) +CrostiniExportImportNotificationController:: + CrostiniExportImportNotificationController( + Profile* profile, + ExportImportType type, + const std::string& notification_id, + base::FilePath path, + ContainerId container_id) : CrostiniExportImportStatusTracker(type, std::move(path)), profile_(profile), container_id_(std::move(container_id)) { @@ -60,9 +61,10 @@ SetStatusRunning(0); } -CrostiniExportImportNotification::~CrostiniExportImportNotification() = default; +CrostiniExportImportNotificationController:: + ~CrostiniExportImportNotificationController() = default; -void CrostiniExportImportNotification::ForceRedisplay() { +void CrostiniExportImportNotificationController::ForceRedisplay() { hidden_ = false; NotificationDisplayService::GetForProfile(profile_)->Display( @@ -70,7 +72,7 @@ /*metadata=*/nullptr); } -void CrostiniExportImportNotification::SetStatusRunningUI( +void CrostiniExportImportNotificationController::SetStatusRunningUI( int progress_percent) { if (hidden_) { return; @@ -93,7 +95,7 @@ ForceRedisplay(); } -void CrostiniExportImportNotification::SetStatusCancellingUI() { +void CrostiniExportImportNotificationController::SetStatusCancellingUI() { if (hidden_) { return; } @@ -113,7 +115,7 @@ ForceRedisplay(); } -void CrostiniExportImportNotification::SetStatusDoneUI() { +void CrostiniExportImportNotificationController::SetStatusDoneUI() { notification_->set_type(message_center::NOTIFICATION_TYPE_SIMPLE); notification_->set_accent_color(ash::kSystemNotificationColorNormal); notification_->set_title(l10n_util::GetStringUTF16( @@ -131,12 +133,12 @@ ForceRedisplay(); } -void CrostiniExportImportNotification::SetStatusCancelledUI() { +void CrostiniExportImportNotificationController::SetStatusCancelledUI() { NotificationDisplayService::GetForProfile(profile_)->Close( NotificationHandler::Type::TRANSIENT, notification_->id()); } -void CrostiniExportImportNotification::SetStatusFailedWithMessageUI( +void CrostiniExportImportNotificationController::SetStatusFailedWithMessageUI( Status status, const base::string16& message) { notification_->set_type(message_center::NOTIFICATION_TYPE_SIMPLE); @@ -153,7 +155,7 @@ ForceRedisplay(); } -void CrostiniExportImportNotification::Close(bool by_user) { +void CrostiniExportImportNotificationController::Close(bool by_user) { switch (status()) { case Status::RUNNING: case Status::CANCELLING: @@ -172,7 +174,7 @@ } } -void CrostiniExportImportNotification::Click( +void CrostiniExportImportNotificationController::Click( const base::Optional<int>& button_index, const base::Optional<base::string16>&) { switch (status()) {
diff --git a/chrome/browser/chromeos/crostini/crostini_export_import_notification.h b/chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.h similarity index 65% rename from chrome/browser/chromeos/crostini/crostini_export_import_notification.h rename to chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.h index 850d2bc..c83495c 100644 --- a/chrome/browser/chromeos/crostini/crostini_export_import_notification.h +++ b/chrome/browser/chromeos/crostini/crostini_export_import_notification_controller.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_H_ -#define CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_H_ +#ifndef CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_CONTROLLER_H_ +#define CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_CONTROLLER_H_ #include <memory> #include <string> @@ -24,25 +24,26 @@ enum class ExportImportType; -// Notification for Crostini export and import. -class CrostiniExportImportNotification +// Controller for Crostini's Export Import Notification UI. +// It can be used to change the look of the UI, and handles actions from the UI. +class CrostiniExportImportNotificationController : public CrostiniExportImportStatusTracker, public message_center::NotificationObserver { public: - // Used to construct CrostiniExportImportNotification to ensure it controls - // its lifetime. + // Used to construct CrostiniExportImportNotificationController to ensure it + // controls its lifetime. static CrostiniExportImportStatusTracker* Create( Profile* profile, ContainerId container_id, const std::string& notification_id, ExportImportType type, base::FilePath path) { - return new CrostiniExportImportNotification(profile, type, notification_id, - std::move(path), - std::move(container_id)); + return new CrostiniExportImportNotificationController( + profile, type, notification_id, std::move(path), + std::move(container_id)); } - ~CrostiniExportImportNotification() override; + ~CrostiniExportImportNotificationController() override; // Getters for testing. message_center::Notification* get_notification() { @@ -55,11 +56,11 @@ const base::Optional<base::string16>& reply) override; private: - CrostiniExportImportNotification(Profile* profile, - ExportImportType type, - const std::string& notification_id, - base::FilePath path, - ContainerId container_id); + CrostiniExportImportNotificationController(Profile* profile, + ExportImportType type, + const std::string& notification_id, + base::FilePath path, + ContainerId container_id); // CrostiniExportImportStatusTracker: void ForceRedisplay() override; @@ -77,11 +78,11 @@ base::TimeTicks started_ = base::TimeTicks::Now(); std::unique_ptr<message_center::Notification> notification_; bool hidden_ = false; - base::WeakPtrFactory<CrostiniExportImportNotification> weak_ptr_factory_{ - this}; - DISALLOW_COPY_AND_ASSIGN(CrostiniExportImportNotification); + base::WeakPtrFactory<CrostiniExportImportNotificationController> + weak_ptr_factory_{this}; + DISALLOW_COPY_AND_ASSIGN(CrostiniExportImportNotificationController); }; } // namespace crostini -#endif // CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_H_ +#endif // CHROME_BROWSER_CHROMEOS_CROSTINI_CROSTINI_EXPORT_IMPORT_NOTIFICATION_CONTROLLER_H_
diff --git a/chrome/browser/chromeos/crostini/crostini_export_import_unittest.cc b/chrome/browser/chromeos/crostini/crostini_export_import_unittest.cc index 37fd31b..fd002dc 100644 --- a/chrome/browser/chromeos/crostini/crostini_export_import_unittest.cc +++ b/chrome/browser/chromeos/crostini/crostini_export_import_unittest.cc
@@ -42,6 +42,11 @@ class CrostiniExportImportTest : public testing::Test { public: + CrostiniExportImportNotificationController* GetController() { + return crostini_export_import_->GetNotificationControllerForTesting( + container_id_); + } + void SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status status, const ExportProgressOptionalArguments& arguments = {}) { @@ -158,50 +163,49 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::EXPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // 20% PACK = 10% overall. SendExportProgress(vm_tools::cicerone:: ExportLxdContainerProgressSignal_Status_EXPORTING_PACK, {.progress_percent = 20}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 10); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 10); + EXPECT_TRUE(controller->get_notification()->pinned()); // 20% DOWNLOAD = 60% overall. SendExportProgress( vm_tools::cicerone:: ExportLxdContainerProgressSignal_Status_EXPORTING_DOWNLOAD, {.progress_percent = 20}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Close notification and update progress. Should not update notification. - notification->Close(false); + controller->Close(false); SendExportProgress( vm_tools::cicerone:: ExportLxdContainerProgressSignal_Status_EXPORTING_DOWNLOAD, {.progress_percent = 40}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Done. SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status_DONE); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::DONE); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); // CrostiniExportImport should've created the exported file. task_environment_.RunUntilIdle(); EXPECT_TRUE(base::PathExists(tarball_)); @@ -212,13 +216,12 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::EXPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // STREAMING 10% bytes done + 30% files done = 20% overall. SendExportProgress( @@ -228,10 +231,10 @@ .total_bytes = 100, .files_streamed = 30, .bytes_streamed = 10}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 20); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 20); + EXPECT_TRUE(controller->get_notification()->pinned()); // STREAMING 66% bytes done + 55% files done then floored = 60% overall. SendExportProgress( @@ -241,13 +244,13 @@ .total_bytes = 100, .files_streamed = 55, .bytes_streamed = 66}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Close notification and update progress. Should not update notification. - notification->Close(false); + controller->Close(false); SendExportProgress( vm_tools::cicerone:: ExportLxdContainerProgressSignal_Status_EXPORTING_STREAMING, @@ -255,17 +258,17 @@ .total_bytes = 100, .files_streamed = 90, .bytes_streamed = 85}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Done. SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status_DONE); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::DONE); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); // CrostiniExportImport should've created the exported file. task_environment_.RunUntilIdle(); EXPECT_TRUE(base::PathExists(tarball_)); @@ -276,15 +279,14 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::EXPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); + CrostiniExportImportNotificationController* controller = GetController(); // Failed. SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status_FAILED); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::FAILED_UNKNOWN_REASON); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); // CrostiniExportImport should cleanup the file if an export fails. task_environment_.RunUntilIdle(); EXPECT_FALSE(base::PathExists(tarball_)); @@ -295,21 +297,20 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::EXPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // CANCELLING: crostini_export_import_->CancelOperation(ExportImportType::EXPORT, container_id_); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); EXPECT_TRUE(base::PathExists(tarball_)); // STREAMING: should not be displayed as cancel is in progress @@ -320,17 +321,16 @@ .total_bytes = 100, .files_streamed = 50, .bytes_streamed = 50}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); EXPECT_TRUE(base::PathExists(tarball_)); // CANCELLED: SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status_CANCELLED); - EXPECT_FALSE( - crostini_export_import_->GetNotificationForTesting(container_id_)); + EXPECT_FALSE(GetController()); task_environment_.RunUntilIdle(); EXPECT_FALSE(base::PathExists(tarball_)); } @@ -340,28 +340,26 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::EXPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // CANCELLING: crostini_export_import_->CancelOperation(ExportImportType::EXPORT, container_id_); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); EXPECT_TRUE(base::PathExists(tarball_)); // DONE: Completed before cancel processed, file should be deleted. SendExportProgress( vm_tools::cicerone::ExportLxdContainerProgressSignal_Status_DONE); - EXPECT_FALSE( - crostini_export_import_->GetNotificationForTesting(container_id_)); + EXPECT_FALSE(GetController()); task_environment_.RunUntilIdle(); EXPECT_FALSE(base::PathExists(tarball_)); } @@ -371,51 +369,50 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // 20% UPLOAD = 10% overall. SendImportProgress( vm_tools::cicerone:: ImportLxdContainerProgressSignal_Status_IMPORTING_UPLOAD, {.progress_percent = 20}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 10); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 10); + EXPECT_TRUE(controller->get_notification()->pinned()); // 20% UNPACK = 60% overall. SendImportProgress( vm_tools::cicerone:: ImportLxdContainerProgressSignal_Status_IMPORTING_UNPACK, {.progress_percent = 20}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Close notification and update progress. Should not update notification. - notification->Close(false); + controller->Close(false); SendImportProgress( vm_tools::cicerone:: ImportLxdContainerProgressSignal_Status_IMPORTING_UNPACK, {.progress_percent = 40}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 60); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 60); + EXPECT_TRUE(controller->get_notification()->pinned()); // Done. SendImportProgress( vm_tools::cicerone::ImportLxdContainerProgressSignal_Status_DONE); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::DONE); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); } TEST_F(CrostiniExportImportTest, TestImportFail) { @@ -423,18 +420,16 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); + CrostiniExportImportNotificationController* controller = GetController(); // Failed. SendImportProgress( vm_tools::cicerone::ImportLxdContainerProgressSignal_Status_FAILED); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::FAILED_UNKNOWN_REASON); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); std::string msg("Restoring couldn't be completed due to an error"); - EXPECT_EQ(notification->get_notification()->message(), - base::UTF8ToUTF16(msg)); + EXPECT_EQ(controller->get_notification()->message(), base::UTF8ToUTF16(msg)); } TEST_F(CrostiniExportImportTest, TestImportCancelled) { @@ -442,37 +437,35 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // CANCELLING: crostini_export_import_->CancelOperation(ExportImportType::IMPORT, container_id_); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); // STREAMING: should not be displayed as cancel is in progress SendImportProgress( vm_tools::cicerone:: ImportLxdContainerProgressSignal_Status_IMPORTING_UPLOAD, {.progress_percent = 50}); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); // CANCELLED: SendImportProgress( vm_tools::cicerone::ImportLxdContainerProgressSignal_Status_CANCELLED); - EXPECT_FALSE( - crostini_export_import_->GetNotificationForTesting(container_id_)); + EXPECT_FALSE(GetController()); } TEST_F(CrostiniExportImportTest, TestImportDoneBeforeCancelled) { @@ -480,28 +473,27 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); - ASSERT_NE(notification, nullptr); - EXPECT_EQ(notification->status(), + CrostiniExportImportNotificationController* controller = GetController(); + ASSERT_NE(controller, nullptr); + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::RUNNING); - EXPECT_EQ(notification->get_notification()->progress(), 0); - EXPECT_TRUE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), 0); + EXPECT_TRUE(controller->get_notification()->pinned()); // CANCELLING: crostini_export_import_->CancelOperation(ExportImportType::IMPORT, container_id_); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::CANCELLING); - EXPECT_EQ(notification->get_notification()->progress(), -1); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_EQ(controller->get_notification()->progress(), -1); + EXPECT_FALSE(controller->get_notification()->pinned()); // DONE: Cancel couldn't be processed in time, done is displayed instead. SendImportProgress( vm_tools::cicerone::ImportLxdContainerProgressSignal_Status_DONE); - EXPECT_EQ(notification->status(), + EXPECT_EQ(controller->status(), CrostiniExportImportStatusTracker::Status::DONE); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); } TEST_F(CrostiniExportImportTest, TestImportFailArchitecture) { @@ -509,24 +501,22 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); + CrostiniExportImportNotificationController* controller = GetController(); // Failed Architecture. SendImportProgress( vm_tools::cicerone:: ImportLxdContainerProgressSignal_Status_FAILED_ARCHITECTURE); EXPECT_EQ( - notification->status(), + controller->status(), CrostiniExportImportStatusTracker::Status::FAILED_ARCHITECTURE_MISMATCH); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); std::string msg( "Cannot import container architecture type arch_con with this device " "which is arch_dev. You can try restoring this container into a " "different device, or you can access the files inside this container " "image by opening in Files app."); - EXPECT_EQ(notification->get_notification()->message(), - base::UTF8ToUTF16(msg)); + EXPECT_EQ(controller->get_notification()->message(), base::UTF8ToUTF16(msg)); } TEST_F(CrostiniExportImportTest, TestImportFailSpace) { @@ -534,8 +524,7 @@ tarball_, 0, crostini_export_import_->NewOperationData(ExportImportType::IMPORT)); task_environment_.RunUntilIdle(); - CrostiniExportImportNotification* notification = - crostini_export_import_->GetNotificationForTesting(container_id_); + CrostiniExportImportNotificationController* controller = GetController(); // Failed Space. SendImportProgress( @@ -545,14 +534,13 @@ .min_required_space = 35ul * 1'024 * 1'024 * 1'024 // 35Gb }); EXPECT_EQ( - notification->status(), + controller->status(), CrostiniExportImportStatusTracker::Status::FAILED_INSUFFICIENT_SPACE); - EXPECT_FALSE(notification->get_notification()->pinned()); + EXPECT_FALSE(controller->get_notification()->pinned()); std::string msg = "Cannot restore due to lack of storage space. Free up 15.0 GB from the " "device and try again."; - EXPECT_EQ(notification->get_notification()->message(), - base::UTF8ToUTF16(msg)); + EXPECT_EQ(controller->get_notification()->message(), base::UTF8ToUTF16(msg)); } } // namespace crostini
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index 78420511..15d9a5f9 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -444,6 +444,7 @@ TestCase("openQuickView").InGuestMode(), TestCase("openQuickView").TabletMode(), TestCase("openQuickViewAudio"), + TestCase("openQuickViewAudioWithImageMetadata"), TestCase("openQuickViewImage"), TestCase("openQuickViewImageExif"), TestCase("openQuickViewImageRaw"),
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc index 74630c0..01f29c73 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc
@@ -2038,8 +2038,14 @@ } if (name == "dispatchTabKey") { - ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_TAB, 0); + // Read optional modifier parameter |shift|. + bool shift; + if (!value.GetBoolean("shift", &shift)) { + shift = false; + } + int flag = shift ? ui::EF_SHIFT_DOWN : 0; + ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_TAB, flag); // Try to dispatch the event close-to-native without pulling in too many // dependencies (i.e. X11/Ozone/Wayland/Mus). aura::WindowTreeHost is pretty // high up in the dispatch stack, but we might need event_injector.mojom
diff --git a/chrome/browser/chromeos/fileapi/external_file_url_loader_factory.cc b/chrome/browser/chromeos/fileapi/external_file_url_loader_factory.cc index fd2039f..c6442eb 100644 --- a/chrome/browser/chromeos/fileapi/external_file_url_loader_factory.cc +++ b/chrome/browser/chromeos/fileapi/external_file_url_loader_factory.cc
@@ -31,6 +31,7 @@ #include "net/http/http_byte_range.h" #include "net/http/http_util.h" #include "services/network/public/mojom/url_loader.mojom.h" +#include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "storage/browser/file_system/file_stream_reader.h" #include "storage/browser/file_system/file_system_backend.h"
diff --git a/chrome/browser/chromeos/input_method/native_input_method_engine.h b/chrome/browser/chromeos/input_method/native_input_method_engine.h index 2891a51..e5e031e 100644 --- a/chrome/browser/chromeos/input_method/native_input_method_engine.h +++ b/chrome/browser/chromeos/input_method/native_input_method_engine.h
@@ -7,7 +7,7 @@ #include "chrome/browser/chromeos/input_method/input_method_engine.h" -#include "chromeos/services/ime/public/mojom/input_engine.mojom.h" +#include "chromeos/services/ime/public/mojom/input_engine.mojom-forward.h" #include "mojo/public/cpp/bindings/remote.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/lock_screen_apps/state_controller.h b/chrome/browser/chromeos/lock_screen_apps/state_controller.h index 254577c..5f39839 100644 --- a/chrome/browser/chromeos/lock_screen_apps/state_controller.h +++ b/chrome/browser/chromeos/lock_screen_apps/state_controller.h
@@ -8,7 +8,7 @@ #include <memory> #include <string> -#include "ash/public/mojom/tray_action.mojom.h" +#include "ash/public/mojom/tray_action.mojom-forward.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h"
diff --git a/chrome/browser/chromeos/note_taking_helper.h b/chrome/browser/chromeos/note_taking_helper.h index 9b21b22..6ebf402 100644 --- a/chrome/browser/chromeos/note_taking_helper.h +++ b/chrome/browser/chromeos/note_taking_helper.h
@@ -18,7 +18,7 @@ #include "chrome/browser/chromeos/arc/session/arc_session_manager.h" #include "chrome/browser/profiles/profile_manager_observer.h" #include "components/arc/intent_helper/arc_intent_helper_observer.h" -#include "components/arc/mojom/intent_helper.mojom.h" +#include "components/arc/mojom/intent_helper.mojom-forward.h" #include "components/prefs/pref_change_registrar.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry_observer.h"
diff --git a/chrome/browser/chromeos/policy/app_install_event_log_collector.h b/chrome/browser/chromeos/policy/app_install_event_log_collector.h index cbe7d6cc9..6d1f1540 100644 --- a/chrome/browser/chromeos/policy/app_install_event_log_collector.h +++ b/chrome/browser/chromeos/policy/app_install_event_log_collector.h
@@ -17,7 +17,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "components/arc/mojom/policy.mojom.h" +#include "components/arc/mojom/policy.mojom-forward.h" #include "services/network/public/cpp/network_connection_tracker.h" class Profile;
diff --git a/chrome/browser/chromeos/policy/display_resolution_handler.h b/chrome/browser/chromeos/policy/display_resolution_handler.h index 49836c96..c68a950 100644 --- a/chrome/browser/chromeos/policy/display_resolution_handler.h +++ b/chrome/browser/chromeos/policy/display_resolution_handler.h
@@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "ash/public/mojom/cros_display_config.mojom.h" +#include "ash/public/mojom/cros_display_config.mojom-forward.h" #include "chrome/browser/chromeos/policy/display_settings_handler.h" namespace policy {
diff --git a/chrome/browser/chromeos/policy/display_rotation_default_handler.h b/chrome/browser/chromeos/policy/display_rotation_default_handler.h index 2e7272db..3fa7b19b 100644 --- a/chrome/browser/chromeos/policy/display_rotation_default_handler.h +++ b/chrome/browser/chromeos/policy/display_rotation_default_handler.h
@@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "ash/public/mojom/cros_display_config.mojom.h" +#include "ash/public/mojom/cros_display_config.mojom-forward.h" #include "chrome/browser/chromeos/policy/display_settings_handler.h" #include "ui/display/display.h"
diff --git a/chrome/browser/chromeos/policy/scheduled_update_checker/device_scheduled_update_checker.h b/chrome/browser/chromeos/policy/scheduled_update_checker/device_scheduled_update_checker.h index c971f65..8fa04b5 100644 --- a/chrome/browser/chromeos/policy/scheduled_update_checker/device_scheduled_update_checker.h +++ b/chrome/browser/chromeos/policy/scheduled_update_checker/device_scheduled_update_checker.h
@@ -19,7 +19,7 @@ #include "chromeos/dbus/power/native_timer.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/settings/timezone_settings.h" -#include "services/device/public/mojom/wake_lock.mojom.h" +#include "services/device/public/mojom/wake_lock.mojom-forward.h" #include "third_party/icu/source/i18n/unicode/calendar.h" #include "third_party/icu/source/i18n/unicode/timezone.h"
diff --git a/chrome/browser/chromeos/policy/scheduled_update_checker/scoped_wake_lock.h b/chrome/browser/chromeos/policy/scheduled_update_checker/scoped_wake_lock.h index a3628d6e..8191e3a8 100644 --- a/chrome/browser/chromeos/policy/scheduled_update_checker/scoped_wake_lock.h +++ b/chrome/browser/chromeos/policy/scheduled_update_checker/scoped_wake_lock.h
@@ -12,7 +12,7 @@ #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/wake_lock.mojom.h" -#include "services/device/public/mojom/wake_lock_provider.mojom.h" +#include "services/device/public/mojom/wake_lock_provider.mojom-forward.h" namespace policy {
diff --git a/chrome/browser/chromeos/power/ml/user_activity_manager.h b/chrome/browser/chromeos/power/ml/user_activity_manager.h index 348ad55..e74da02 100644 --- a/chrome/browser/chromeos/power/ml/user_activity_manager.h +++ b/chrome/browser/chromeos/power/ml/user_activity_manager.h
@@ -26,7 +26,7 @@ #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" #include "services/metrics/public/cpp/ukm_source_id.h" -#include "services/viz/public/mojom/compositing/video_detector_observer.mojom.h" +#include "services/viz/public/mojom/compositing/video_detector_observer.mojom-forward.h" #include "ui/aura/window.h" #include "ui/base/user_activity/user_activity_detector.h" #include "ui/base/user_activity/user_activity_observer.h"
diff --git a/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.cc b/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.cc index 8ee5dab..b92b38f 100644 --- a/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.cc +++ b/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.cc
@@ -46,7 +46,8 @@ kNumUserInputEventsBuckets)), touch_counter_(std::make_unique<ml::RecentEventsCounter>( kUserActivityDuration, - kNumUserInputEventsBuckets)) { + kNumUserInputEventsBuckets)), + ukm_logger_(std::make_unique<SmartChargingUkmLogger>()) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(detector); user_activity_observer_.Add(detector); @@ -259,7 +260,7 @@ // ukm logger is available. user_charging_event_for_test_ = proto; - // TODO(crbug.com/1028853): Implements logic of this function. + ukm_logger_->LogEvent(proto); } void SmartChargingManager::OnTimerFired() {
diff --git a/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.h b/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.h index 73c64f1..52ac00f 100644 --- a/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.h +++ b/chrome/browser/chromeos/power/smart_charging/smart_charging_manager.h
@@ -13,6 +13,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "chrome/browser/chromeos/power/ml/boot_clock.h" +#include "chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.h" #include "chrome/browser/chromeos/power/smart_charging/user_charging_event.pb.h" #include "chromeos/dbus/power/power_manager_client.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -139,6 +140,8 @@ base::Optional<power_manager::PowerSupplyProperties::ExternalPower> external_power_; + const std::unique_ptr<SmartChargingUkmLogger> ukm_logger_; + SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<SmartChargingManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.cc b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.cc new file mode 100644 index 0000000..12da1bc0 --- /dev/null +++ b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.cc
@@ -0,0 +1,126 @@ +// Copyright 2020 The Chromium 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/power/smart_charging/smart_charging_ukm_logger.h" + +#include "base/logging.h" +#include "chrome/browser/chromeos/power/smart_charging/user_charging_event.pb.h" +#include "services/metrics/public/cpp/ukm_builders.h" +#include "services/metrics/public/cpp/ukm_recorder.h" +#include "services/metrics/public/cpp/ukm_source_id.h" + +namespace chromeos { +namespace power { + +void SmartChargingUkmLogger::LogEvent( + const UserChargingEvent& user_charging_event) const { + const ukm::SourceId source_id = ukm::UkmRecorder::GetNewSourceID(); + ukm::builders::SmartCharging ukm_smart_charging(source_id); + + ukm_smart_charging.SetEventId(user_charging_event.event().event_id()); + ukm_smart_charging.SetReason(user_charging_event.event().reason()); + + const UserChargingEvent::Features features = user_charging_event.features(); + + if (features.has_battery_percentage()) { + ukm_smart_charging.SetBatteryPercentage(features.battery_percentage()); + } + + if (features.has_time_since_last_charge()) { + ukm_smart_charging.SetTimeSinceLastCharge( + features.time_since_last_charge()); + } + + if (features.has_duration_of_last_charge()) { + ukm_smart_charging.SetDurationOfLastCharge( + features.duration_of_last_charge()); + } + + if (features.has_battery_percentage_of_last_charge()) { + ukm_smart_charging.SetBatteryPercentageOfLastCharge( + features.battery_percentage_of_last_charge()); + } + + if (features.has_battery_percentage_before_last_charge()) { + ukm_smart_charging.SetBatteryPercentageBeforeLastCharge( + features.battery_percentage_before_last_charge()); + } + + if (features.has_time_of_the_day()) { + ukm_smart_charging.SetTimeOfTheDay(features.time_of_the_day()); + } + + if (features.has_day_of_week()) { + ukm_smart_charging.SetDayOfWeek(features.day_of_week()); + } + + if (features.has_day_of_month()) { + ukm_smart_charging.SetDayOfMonth(features.day_of_month()); + } + + if (features.has_month()) { + ukm_smart_charging.SetMonth(features.month()); + } + + if (features.has_timezone_difference_from_last_charge()) { + ukm_smart_charging.SetTimezoneDifferenceFromLastCharge( + features.timezone_difference_from_last_charge()); + } + + if (features.has_device_type()) { + ukm_smart_charging.SetDeviceType(features.device_type()); + } + + if (features.has_device_mode()) { + ukm_smart_charging.SetDeviceMode(features.device_mode()); + } + + if (features.has_num_recent_key_events()) { + ukm_smart_charging.SetNumRecentKeyEvents(features.num_recent_key_events()); + } + + if (features.has_num_recent_mouse_events()) { + ukm_smart_charging.SetNumRecentMouseEvents( + features.num_recent_mouse_events()); + } + + if (features.has_num_recent_touch_events()) { + ukm_smart_charging.SetNumRecentTouchEvents( + features.num_recent_touch_events()); + } + + if (features.has_num_recent_stylus_events()) { + ukm_smart_charging.SetNumRecentStylusEvents( + features.num_recent_stylus_events()); + } + + if (features.has_duration_recent_video_playing()) { + ukm_smart_charging.SetDurationRecentVideoPlaying( + features.duration_recent_video_playing()); + } + + if (features.has_duration_recent_audio_playing()) { + ukm_smart_charging.SetDurationRecentAudioPlaying( + features.duration_recent_audio_playing()); + } + + if (features.has_screen_brightness_percent()) { + ukm_smart_charging.SetScreenBrightnessPercent( + features.screen_brightness_percent()); + } + + if (features.has_voltage()) { + ukm_smart_charging.SetVoltage(features.voltage()); + } + + if (features.has_halt_from_last_charge()) { + ukm_smart_charging.SetHaltFromLastCharge(features.halt_from_last_charge()); + } + + ukm::UkmRecorder* const ukm_recorder = ukm::UkmRecorder::Get(); + ukm_smart_charging.Record(ukm_recorder); +} + +} // namespace power +} // namespace chromeos
diff --git a/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.h b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.h new file mode 100644 index 0000000..6164e475 --- /dev/null +++ b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger.h
@@ -0,0 +1,26 @@ +// Copyright 2020 The Chromium 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_POWER_SMART_CHARGING_SMART_CHARGING_UKM_LOGGER_H_ +#define CHROME_BROWSER_CHROMEOS_POWER_SMART_CHARGING_SMART_CHARGING_UKM_LOGGER_H_ + +#include "services/metrics/public/cpp/ukm_source_id.h" + +namespace chromeos { +namespace power { +class UserChargingEvent; + +class SmartChargingUkmLogger { + public: + SmartChargingUkmLogger() = default; + ~SmartChargingUkmLogger() = default; + SmartChargingUkmLogger(const SmartChargingUkmLogger&) = delete; + SmartChargingUkmLogger& operator=(const SmartChargingUkmLogger&) = delete; + + void LogEvent(const UserChargingEvent& user_charging_event) const; +}; +} // namespace power +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_POWER_SMART_CHARGING_SMART_CHARGING_UKM_LOGGER_H_
diff --git a/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger_unittest.cc b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger_unittest.cc new file mode 100644 index 0000000..54a95ae --- /dev/null +++ b/chrome/browser/chromeos/power/smart_charging/smart_charging_ukm_logger_unittest.cc
@@ -0,0 +1,106 @@ +// Copyright 2020 The Chromium 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/power/smart_charging/smart_charging_ukm_logger.h" + +#include "chrome/browser/chromeos/power/smart_charging/user_charging_event.pb.h" +#include "chrome/browser/ui/tabs/tab_ukm_test_helper.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "services/metrics/public/cpp/ukm_builders.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace chromeos { +namespace power { + +namespace { +using UkmEntry = ukm::builders::SmartCharging; + +} // namespace + +class SmartChargingUkmLoggerTest : public ChromeRenderViewHostTestHarness { + public: + SmartChargingUkmLoggerTest() {} + ~SmartChargingUkmLoggerTest() override = default; + SmartChargingUkmLoggerTest(const SmartChargingUkmLoggerTest&) = delete; + SmartChargingUkmLoggerTest& operator=(const SmartChargingUkmLoggerTest&) = + delete; + + void LogEvent(const UserChargingEvent& user_charging_event) { + smart_charging_ukm_logger_.LogEvent(user_charging_event); + } + + protected: + UkmEntryChecker ukm_entry_checker_; + + private: + SmartChargingUkmLogger smart_charging_ukm_logger_; +}; + +TEST_F(SmartChargingUkmLoggerTest, TestRecordCorrectly) { + // Constructs an input event. + UserChargingEvent user_charging_event; + user_charging_event.mutable_event()->set_event_id(5); + user_charging_event.mutable_event()->set_reason( + UserChargingEvent::Event::CHARGER_PLUGGED_IN); + + UserChargingEvent::Features* features = + user_charging_event.mutable_features(); + features->set_battery_percentage(35); + features->set_time_since_last_charge(128); + features->set_duration_of_last_charge(47); + features->set_battery_percentage_of_last_charge(80); + features->set_battery_percentage_before_last_charge(19); + features->set_time_of_the_day(620); + features->set_day_of_week(UserChargingEvent::Features::WED); + features->set_day_of_month(27); + features->set_month(UserChargingEvent::Features::AUG); + features->set_timezone_difference_from_last_charge(-5); + features->set_device_type(UserChargingEvent::Features::TABLET); + features->set_device_mode(UserChargingEvent::Features::TABLET_MODE); + features->set_num_recent_key_events(75); + features->set_num_recent_mouse_events(235); + features->set_num_recent_touch_events(139); + features->set_num_recent_stylus_events(92); + features->set_duration_recent_video_playing(4); + features->set_duration_recent_audio_playing(8); + features->set_screen_brightness_percent(23); + features->set_voltage(3500); + features->set_halt_from_last_charge(true); + + // Constructs the expected output. + const UkmMetricMap user_charging_values = { + {UkmEntry::kEventIdName, 5}, + {UkmEntry::kReasonName, 1}, + {UkmEntry::kBatteryPercentageName, 35}, + {UkmEntry::kTimeSinceLastChargeName, 128}, + {UkmEntry::kDurationOfLastChargeName, 47}, + {UkmEntry::kBatteryPercentageOfLastChargeName, 80}, + {UkmEntry::kBatteryPercentageBeforeLastChargeName, 19}, + {UkmEntry::kTimeOfTheDayName, 620}, + {UkmEntry::kDayOfWeekName, 3}, + {UkmEntry::kDayOfMonthName, 27}, + {UkmEntry::kMonthName, 8}, + {UkmEntry::kTimezoneDifferenceFromLastChargeName, -5}, + {UkmEntry::kDeviceTypeName, 3}, + {UkmEntry::kDeviceModeName, 3}, + {UkmEntry::kNumRecentKeyEventsName, 75}, + {UkmEntry::kNumRecentMouseEventsName, 235}, + {UkmEntry::kNumRecentTouchEventsName, 139}, + {UkmEntry::kNumRecentStylusEventsName, 92}, + {UkmEntry::kDurationRecentVideoPlayingName, 4}, + {UkmEntry::kDurationRecentAudioPlayingName, 8}, + {UkmEntry::kScreenBrightnessPercentName, 23}, + {UkmEntry::kHaltFromLastChargeName, 1}}; + + // Log a charging event. + LogEvent(user_charging_event); + + // Check the output. + EXPECT_EQ(1, ukm_entry_checker_.NumNewEntriesRecorded(UkmEntry::kEntryName)); + ukm_entry_checker_.ExpectNewEntry(UkmEntry::kEntryName, GURL(""), + user_charging_values); +} + +} // namespace power +} // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/cups_proxy_service_manager.h b/chrome/browser/chromeos/printing/cups_proxy_service_manager.h index b161d58..5042793 100644 --- a/chrome/browser/chromeos/printing/cups_proxy_service_manager.h +++ b/chrome/browser/chromeos/printing/cups_proxy_service_manager.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/services/cups_proxy/cups_proxy_service.h" -#include "chrome/services/cups_proxy/public/mojom/proxy.mojom.h" +#include "chrome/services/cups_proxy/public/mojom/proxy.mojom-forward.h" #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/remote.h"
diff --git a/chrome/browser/chromeos/printing/usb_printer_detector.cc b/chrome/browser/chromeos/printing/usb_printer_detector.cc index 9577611..d8e41db 100644 --- a/chrome/browser/chromeos/printing/usb_printer_detector.cc +++ b/chrome/browser/chromeos/printing/usb_printer_detector.cc
@@ -35,6 +35,7 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/usb_device.mojom.h" +#include "services/device/public/mojom/usb_manager.mojom.h" #include "services/device/public/mojom/usb_manager_client.mojom.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/printing/usb_printer_detector.h b/chrome/browser/chromeos/printing/usb_printer_detector.h index 9d26b58c..d0458ea 100644 --- a/chrome/browser/chromeos/printing/usb_printer_detector.h +++ b/chrome/browser/chromeos/printing/usb_printer_detector.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "chrome/browser/chromeos/printing/printer_detector.h" #include "mojo/public/cpp/bindings/pending_remote.h" -#include "services/device/public/mojom/usb_manager.mojom.h" +#include "services/device/public/mojom/usb_manager.mojom-forward.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/printing/usb_printer_util.h b/chrome/browser/chromeos/printing/usb_printer_util.h index 8875730..d35dbdd3 100644 --- a/chrome/browser/chromeos/printing/usb_printer_util.h +++ b/chrome/browser/chromeos/printing/usb_printer_util.h
@@ -10,7 +10,7 @@ #include <memory> #include "mojo/public/cpp/bindings/remote.h" -#include "services/device/public/mojom/usb_device.mojom.h" +#include "services/device/public/mojom/usb_device.mojom-forward.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/usb/cros_usb_detector.h b/chrome/browser/chromeos/usb/cros_usb_detector.h index 1c49128..cb157ee2 100644 --- a/chrome/browser/chromeos/usb/cros_usb_detector.h +++ b/chrome/browser/chromeos/usb/cros_usb_detector.h
@@ -18,8 +18,8 @@ #include "mojo/public/cpp/bindings/associated_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" -#include "services/device/public/mojom/usb_enumeration_options.mojom.h" -#include "services/device/public/mojom/usb_manager.mojom.h" +#include "services/device/public/mojom/usb_enumeration_options.mojom-forward.h" +#include "services/device/public/mojom/usb_manager.mojom-forward.h" #include "services/device/public/mojom/usb_manager_client.mojom.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/wilco_dtc_supportd/testing_wilco_dtc_supportd_bridge_wrapper.h b/chrome/browser/chromeos/wilco_dtc_supportd/testing_wilco_dtc_supportd_bridge_wrapper.h index ebb5399f..b75fdb59 100644 --- a/chrome/browser/chromeos/wilco_dtc_supportd/testing_wilco_dtc_supportd_bridge_wrapper.h +++ b/chrome/browser/chromeos/wilco_dtc_supportd/testing_wilco_dtc_supportd_bridge_wrapper.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_bridge.h" -#include "chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom.h" +#include "chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom-forward.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h"
diff --git a/chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_bridge.h b/chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_bridge.h index f6f94636..242d70b7 100644 --- a/chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_bridge.h +++ b/chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_bridge.h
@@ -15,7 +15,7 @@ #include "base/time/time.h" #include "chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_notification_controller.h" #include "chrome/browser/chromeos/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service.h" -#include "chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom.h" +#include "chrome/services/wilco_dtc_supportd/public/mojom/wilco_dtc_supportd.mojom-forward.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/system/buffer.h"
diff --git a/chrome/browser/extensions/fetch_apitest.cc b/chrome/browser/extensions/fetch_apitest.cc index 2eae605..8d857d2 100644 --- a/chrome/browser/extensions/fetch_apitest.cc +++ b/chrome/browser/extensions/fetch_apitest.cc
@@ -334,6 +334,39 @@ ExecuteScriptInBackgroundPage(extension->id(), script)); } +// An extension background script should be able to fetch resources contained in +// the extension, and those resources should not be opaque. +IN_PROC_BROWSER_TEST_F(ExtensionFetchTest, ExtensionResourceShouldNotBeOpaque) { + // We use a script to test this feature. Ideally testing with fetch() and + // response type is better, but some logic in blink (see the manual + // response type handling in blink::FetchManager) would hide potential + // breakages, which is why we are using a script. + const std::string script = base::StringPrintf(R"( + const script = document.createElement('script'); + window.onerror = (message) => { + window.domAutomationController.send('onerror: ' + message); + } + script.src = 'error.js' + document.body.appendChild(script);)"); + TestExtensionDir dir; + dir.WriteManifest(R"JSON( + { + "background": {"scripts": ["bg.js"]}, + "manifest_version": 2, + "name": "FetchResponseType", + "permissions": [], + "version": "1" + })JSON"); + dir.WriteFile(FILE_PATH_LITERAL("error.js"), "throw TypeError('hi!')"); + const Extension* extension = WriteFilesAndLoadTestExtension(&dir); + ASSERT_TRUE(extension); + + // We expect that we can read the content of the error here. Otherwise + // "onerror: Script error." will be seen. + EXPECT_EQ("onerror: Uncaught TypeError: hi!", + ExecuteScriptInBackgroundPage(extension->id(), script)); +} + } // namespace } // namespace extensions
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index b7b0a3104..d1577afa2 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -600,6 +600,11 @@ "expiry_milestone": 85 }, { + "name": "crostini-port-forwarding", + "owners": [ "matterchen", "davidmunro", "hollingum" ], + "expiry_milestone": 84 + }, + { "name": "crostini-usb-allow-unsupported", "owners": [ "nverne", "benwells", "clumptini" ], "expiry_milestone": 85
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 9bfba6e..009efcb 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -3342,6 +3342,10 @@ const char kCrostiniBackupName[] = "Crostini Backup"; const char kCrostiniBackupDescription[] = "Enable Crostini export and import."; +const char kCrostiniPortForwardingName[] = "Crostini Port Forwarding"; +const char kCrostiniPortForwardingDescription[] = + "Enable Crostini port forwarding."; + const char kCrostiniUseBusterImageName[] = "New Crostini containers use Buster"; const char kCrostiniUseBusterImageDescription[] = "New Crostini containers use Debian Buster images instead of Debian "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 9362e79..a78fae25 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1981,6 +1981,9 @@ extern const char kCrostiniBackupName[]; extern const char kCrostiniBackupDescription[]; +extern const char kCrostiniPortForwardingName[]; +extern const char kCrostiniPortForwardingDescription[]; + extern const char kCrostiniUseBusterImageName[]; extern const char kCrostiniUseBusterImageDescription[];
diff --git a/chrome/browser/installable/installable_logging.cc b/chrome/browser/installable/installable_logging.cc index 70f4cc90..e5432efd0 100644 --- a/chrome/browser/installable/installable_logging.cc +++ b/chrome/browser/installable/installable_logging.cc
@@ -33,8 +33,8 @@ "attribute, if set, must include \"any\" or \"maskable\"."; static const char kNoMatchingServiceWorkerMessage[] = "No matching service worker detected. You may need to reload the page, or " - "check that the service worker for the current page also controls the " - "start URL from the manifest"; + "check that the scope of the service worker for the current page encloses " + "the scope and start URL from the manifest."; static const char kNoAcceptableIconMessage[] = "No supplied icon is at least %dpx square in PNG, SVG or WebP format"; static const char kCannotDownloadIconMessage[] =
diff --git a/chrome/browser/navigation_predictor/navigation_predictor_preconnect_client_browsertest.cc b/chrome/browser/navigation_predictor/navigation_predictor_preconnect_client_browsertest.cc index 831e7f97..e4547f1 100644 --- a/chrome/browser/navigation_predictor/navigation_predictor_preconnect_client_browsertest.cc +++ b/chrome/browser/navigation_predictor/navigation_predictor_preconnect_client_browsertest.cc
@@ -291,7 +291,7 @@ #define MAYBE_PreconnectSearchWithFeature PreconnectSearchWithFeature #endif IN_PROC_BROWSER_TEST_F(NavigationPredictorPreconnectClientBrowserTestWithSearch, - PreconnectSearchWithFeature) { + MAYBE_PreconnectSearchWithFeature) { static const char kShortName[] = "test"; static const char kSearchURL[] = "/anchors_different_area.html?q={searchTerms}";
diff --git a/chrome/browser/resources/bookmarks/list.html b/chrome/browser/resources/bookmarks/list.html index a03d4f3..b87fb87 100644 --- a/chrome/browser/resources/bookmarks/list.html +++ b/chrome/browser/resources/bookmarks/list.html
@@ -31,6 +31,10 @@ user-select: none; white-space: nowrap; } + + [role='row']:focus-within { + z-index: 1; + } </style> <iron-list id="list" items="[[displayedList_]]"
diff --git a/chrome/browser/resources/chromeos/camera/.style.yapf b/chrome/browser/resources/chromeos/camera/.style.yapf new file mode 100644 index 0000000..de0c6a70 --- /dev/null +++ b/chrome/browser/resources/chromeos/camera/.style.yapf
@@ -0,0 +1,2 @@ +[style] +based_on_style = chromium
diff --git a/chrome/browser/resources/chromeos/camera/src/js/main.js b/chrome/browser/resources/chromeos/camera/src/js/main.js index b51adf2..ec74a39 100644 --- a/chrome/browser/resources/chromeos/camera/src/js/main.js +++ b/chrome/browser/resources/chromeos/camera/src/js/main.js
@@ -57,16 +57,17 @@ */ this.cameraView_ = (() => { const intent = this.backgroundOps_.getIntent(); + const perfLogger = this.backgroundOps_.getPerfLogger(); if (intent !== null && intent.shouldHandleResult) { cca.state.set(cca.state.State.SHOULD_HANDLE_INTENT_RESULT, true); return new cca.views.CameraIntent( intent, this.infoUpdater_, this.photoPreferrer_, - this.videoPreferrer_); + this.videoPreferrer_, perfLogger); } else { + const mode = intent !== null ? intent.mode : cca.Mode.PHOTO; return new cca.views.Camera( this.galleryButton_, this.infoUpdater_, this.photoPreferrer_, - this.videoPreferrer_, - intent !== null ? intent.mode : cca.Mode.PHOTO); + this.videoPreferrer_, mode, perfLogger); } })();
diff --git a/chrome/browser/resources/chromeos/camera/src/js/views/camera.js b/chrome/browser/resources/chromeos/camera/src/js/views/camera.js index 8a7c0ce..45cce62 100644 --- a/chrome/browser/resources/chromeos/camera/src/js/views/camera.js +++ b/chrome/browser/resources/chromeos/camera/src/js/views/camera.js
@@ -2,83 +2,106 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -'use strict'; - -/** - * Namespace for the Camera app. - */ -var cca = cca || {}; - -/** - * Namespace for views. - */ -cca.views = cca.views || {}; +import {assert} from '../chrome_util.js'; +import {PhotoConstraintsPreferrer, // eslint-disable-line no-unused-vars + VideoConstraintsPreferrer, // eslint-disable-line no-unused-vars +} from '../device/constraints_preferrer.js'; +// eslint-disable-next-line no-unused-vars +import {DeviceInfoUpdater} from '../device/device_info_updater.js'; +import * as metrics from '../metrics.js'; +// eslint-disable-next-line no-unused-vars +import {ResultSaver} from '../models/result_saver.js'; +import {ChromeHelper} from '../mojo/chrome_helper.js'; +import {DeviceOperator} from '../mojo/device_operator.js'; +import * as nav from '../nav.js'; +// eslint-disable-next-line no-unused-vars +import {PerfLogger} from '../perf.js'; +import * as sound from '../sound.js'; +import * as state from '../state.js'; +import * as toast from '../toast.js'; +import {Mode} from '../type.js'; +import * as util from '../util.js'; +import {Layout} from './camera/layout.js'; +import {Modes, + PhotoResult, // eslint-disable-line no-unused-vars + VideoResult, // eslint-disable-line no-unused-vars +} from './camera/modes.js'; +import {Options} from './camera/options.js'; +import {Preview} from './camera/preview.js'; +import * as timertick from './camera/timertick.js'; +import {View, ViewName} from './view.js'; /** * Thrown when app window suspended during stream reconfiguration. */ -cca.views.CameraSuspendedError = class extends Error { +class CameraSuspendedError extends Error { /** * @param {string=} message Error message. */ constructor(message = 'Camera suspended.') { super(message); - this.name = 'CameraSuspendedError'; + this.name = this.constructor.name; } -}; +} /** - * Creates the camera-view controller. + * Camera-view controller. */ - -cca.views.Camera = class extends cca.views.View { +export class Camera extends View { /** - * @param {!cca.models.ResultSaver} resultSaver - * @param {!cca.device.DeviceInfoUpdater} infoUpdater - * @param {!cca.device.PhotoConstraintsPreferrer} photoPreferrer - * @param {!cca.device.VideoConstraintsPreferrer} videoPreferrer - * @param {cca.Mode} defaultMode + * @param {!ResultSaver} resultSaver + * @param {!DeviceInfoUpdater} infoUpdater + * @param {!PhotoConstraintsPreferrer} photoPreferrer + * @param {!VideoConstraintsPreferrer} videoPreferrer + * @param {Mode} defaultMode + * @param {!PerfLogger} perfLogger */ constructor( - resultSaver, infoUpdater, photoPreferrer, videoPreferrer, defaultMode) { - super(cca.views.ViewName.CAMERA); + resultSaver, infoUpdater, photoPreferrer, videoPreferrer, defaultMode, + perfLogger) { + super(ViewName.CAMERA); /** - * @type {!cca.device.DeviceInfoUpdater} + * @type {!DeviceInfoUpdater} * @private */ this.infoUpdater_ = infoUpdater; /** - * @type {!cca.Mode} + * @type {!Mode} * @protected */ this.defaultMode_ = defaultMode; /** - * Layout handler for the camera view. - * @type {!cca.views.camera.Layout} + * @type {!PerfLogger} * @private */ - this.layout_ = new cca.views.camera.Layout(); + this.perfLogger_ = perfLogger; + + /** + * Layout handler for the camera view. + * @type {!Layout} + * @private + */ + this.layout_ = new Layout(); /** * Video preview for the camera. - * @type {!cca.views.camera.Preview} + * @type {!Preview} * @private */ - this.preview_ = new cca.views.camera.Preview(this.start.bind(this)); + this.preview_ = new Preview(this.start.bind(this)); /** * Options for the camera. - * @type {!cca.views.camera.Options} + * @type {!Options} * @private */ - this.options_ = - new cca.views.camera.Options(infoUpdater, this.start.bind(this)); + this.options_ = new Options(infoUpdater, this.start.bind(this)); /** - * @type {!cca.models.ResultSaver} + * @type {!ResultSaver} * @protected */ this.resultSaver_ = resultSaver; @@ -94,16 +117,16 @@ const createVideoSaver = async () => resultSaver.startSaveVideo(); const playShutterEffect = () => { - cca.sound.play('#sound-shutter'); - cca.util.animateOnce(this.preview_.video); + sound.play('#sound-shutter'); + util.animateOnce(this.preview_.video); }; /** * Modes for the camera. - * @type {cca.views.camera.Modes} + * @type {Modes} * @private */ - this.modes_ = new cca.views.camera.Modes( + this.modes_ = new Modes( this.defaultMode_, photoPreferrer, videoPreferrer, this.start.bind(this), this.doSavePhoto_.bind(this), createVideoSaver, this.doSaveVideo_.bind(this), playShutterEffect); @@ -161,8 +184,7 @@ document.addEventListener('visibilitychange', async () => { const isTabletBackground = await this.isTabletBackground_(); - const recording = cca.state.get(cca.state.State.TAKING) && - cca.state.get(cca.Mode.VIDEO); + const recording = state.get(state.State.TAKING) && state.get(Mode.VIDEO); if (isTabletBackground && !recording) { this.start(); } @@ -186,8 +208,7 @@ * @private */ async isTabletBackground_() { - const isTabletMode = - await cca.mojo.ChromeHelper.getInstance().isTabletMode(); + const isTabletMode = await ChromeHelper.getInstance().isTabletMode(); return isTabletMode && !this.isVisible_; } @@ -197,8 +218,7 @@ */ async isSuspended() { return this.locked_ || chrome.app.window.current().isMinimized() || - cca.state.get(cca.state.State.SUSPEND) || - await this.isTabletBackground_(); + state.get(state.State.SUSPEND) || await this.isTabletBackground_(); } /** @@ -217,17 +237,16 @@ * @protected */ beginTake_() { - if (!cca.state.get(cca.state.State.STREAMING) || - cca.state.get(cca.state.State.TAKING)) { + if (!state.get(state.State.STREAMING) || state.get(state.State.TAKING)) { return null; } - cca.state.set(cca.state.State.TAKING, true); + state.set(state.State.TAKING, true); this.focus(); // Refocus the visible shutter button for ChromeVox. this.take_ = (async () => { let hasError = false; try { - await cca.views.camera.timertick.start(); + await timertick.start(); await this.modes_.current.startCapture(); } catch (e) { hasError = true; @@ -237,7 +256,7 @@ console.error(e); } finally { this.take_ = null; - cca.state.set(cca.state.State.TAKING, false, {hasError}); + state.set(state.State.TAKING, false, {hasError}); this.focus(); // Refocus the visible shutter button for ChromeVox. } })(); @@ -250,45 +269,45 @@ * @private */ endTake_() { - cca.views.camera.timertick.cancel(); + timertick.cancel(); this.modes_.current.stopCapture(); return Promise.resolve(this.take_); } /** * Handles captured photo result. - * @param {!cca.views.camera.PhotoResult} result Captured photo result. + * @param {!PhotoResult} result Captured photo result. * @param {string} name Name of the photo result to be saved as. * @return {!Promise} Promise for the operation. * @protected */ async doSavePhoto_(result, name) { - cca.metrics.log( - cca.metrics.Type.CAPTURE, this.facingMode_, /* length= */ 0, - result.resolution, cca.metrics.IntentResultType.NOT_INTENT); + metrics.log( + metrics.Type.CAPTURE, this.facingMode_, /* length= */ 0, + result.resolution, metrics.IntentResultType.NOT_INTENT); try { await this.resultSaver_.savePhoto(result.blob, name); } catch (e) { - cca.toast.show('error_msg_save_file_failed'); + toast.show('error_msg_save_file_failed'); throw e; } } /** * Handles captured video result. - * @param {!cca.views.camera.VideoResult} result Captured video result. + * @param {!VideoResult} result Captured video result. * @param {string} name Name of the video result to be saved as. * @return {!Promise} Promise for the operation. * @protected */ async doSaveVideo_(result, name) { - cca.metrics.log( - cca.metrics.Type.CAPTURE, this.facingMode_, result.duration, - result.resolution, cca.metrics.IntentResultType.NOT_INTENT); + metrics.log( + metrics.Type.CAPTURE, this.facingMode_, result.duration, + result.resolution, metrics.IntentResultType.NOT_INTENT); try { await this.resultSaver_.finishSaveVideo(result.videoSaver, name); } catch (e) { - cca.toast.show('error_msg_save_file_failed'); + toast.show('error_msg_save_file_failed'); throw e; } } @@ -305,7 +324,7 @@ */ handlingKey(key) { if (key === 'Ctrl-R') { - cca.toast.show(this.preview_.toString()); + toast.show(this.preview_.toString()); return true; } return false; @@ -327,7 +346,7 @@ } this.configuring_ = (async () => { try { - if (cca.state.get(cca.state.State.TAKING)) { + if (state.get(state.State.TAKING)) { await this.endTake_(); } } finally { @@ -341,12 +360,12 @@ /** * Try start stream reconfiguration with specified mode and device id. * @param {?string} deviceId - * @param {!cca.Mode} mode + * @param {!Mode} mode * @return {!Promise<boolean>} If found suitable stream and reconfigure * successfully. */ async startWithMode_(deviceId, mode) { - const deviceOperator = await cca.mojo.DeviceOperator.getInstance(); + const deviceOperator = await DeviceOperator.getInstance(); let resolCandidates = null; if (deviceOperator !== null) { if (deviceId !== null) { @@ -366,11 +385,11 @@ for (const {resolution: captureR, previewCandidates} of resolCandidates) { for (const constraints of previewCandidates) { if (await this.isSuspended()) { - throw new cca.views.CameraSuspendedError(); + throw new CameraSuspendedError(); } try { if (deviceOperator !== null) { - cca.assert(deviceId !== null); + assert(deviceId !== null); await deviceOperator.setFpsRange(deviceId, constraints); await deviceOperator.setCaptureIntent( deviceId, this.modes_.getCaptureIntent(mode)); @@ -380,7 +399,7 @@ this.facingMode_ = await this.options_.updateValues(stream); await this.modes_.updateModeSelectionUI(deviceId); await this.modes_.updateMode(mode, stream, deviceId, captureR); - cca.nav.close('warning', 'no-camera'); + nav.close('warning', 'no-camera'); return true; } catch (e) { this.preview_.stop(); @@ -424,30 +443,30 @@ if (await this.startWithDevice_(id)) { // Make the different active camera announced by screen reader. const currentId = this.options_.currentDeviceId; - cca.assert(currentId !== null); + assert(currentId !== null); if (currentId === this.activeDeviceId_) { return; } this.activeDeviceId_ = currentId; const info = await this.infoUpdater_.getDeviceInfo(currentId); if (info !== null) { - cca.toast.speak(chrome.i18n.getMessage( + toast.speak(chrome.i18n.getMessage( 'status_msg_camera_switched', info.label)); } return; } } } - throw new cca.views.CameraSuspendedError(); + throw new CameraSuspendedError(); }); this.configuring_ = null; return true; } catch (error) { this.activeDeviceId_ = null; - if (!(error instanceof cca.views.CameraSuspendedError)) { + if (!(error instanceof CameraSuspendedError)) { console.error(error); - cca.nav.open('warning', 'no-camera'); + nav.open('warning', 'no-camera'); } // Schedule to retry. if (this.retryStartTimeout_) { @@ -458,10 +477,11 @@ this.configuring_ = this.start_(); }, 100); - cca.assert(window['backgroundOps'] !== undefined); - const /** !cca.bg.BackgroundOps */ bgOps = window['backgroundOps']; - bgOps.getPerfLogger().interrupt(); + this.perfLogger_.interrupt(); return false; } } -}; +} + +/** @const */ +cca.views.Camera = Camera;
diff --git a/chrome/browser/resources/chromeos/camera/src/js/views/camera_intent.js b/chrome/browser/resources/chromeos/camera/src/js/views/camera_intent.js index 3637be0b..4c84508 100644 --- a/chrome/browser/resources/chromeos/camera/src/js/views/camera_intent.js +++ b/chrome/browser/resources/chromeos/camera/src/js/views/camera_intent.js
@@ -2,17 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -'use strict'; - -/** - * Namespace for the Camera app. - */ -var cca = cca || {}; - -/** - * Namespace for views. - */ -cca.views = cca.views || {}; +// eslint-disable-next-line no-unused-vars +import {assertNotReached} from '../chrome_util.js'; +import {PhotoConstraintsPreferrer, // eslint-disable-line no-unused-vars + VideoConstraintsPreferrer, // eslint-disable-line no-unused-vars +} from '../device/constraints_preferrer.js'; +// eslint-disable-next-line no-unused-vars +import {DeviceInfoUpdater} from '../device/device_info_updater.js'; +// eslint-disable-next-line no-unused-vars +import {Intent} from '../intent.js'; +import * as metrics from '../metrics.js'; +import {IntentVideoSaver} from '../models/intent_video_saver.js'; +// eslint-disable-next-line no-unused-vars +import {ResultSaver} from '../models/result_saver.js'; +// eslint-disable-next-line no-unused-vars +import {PerfLogger} from '../perf.js'; +import * as state from '../state.js'; +import * as toast from '../toast.js'; +import * as util from '../util.js'; +import {Camera} from './camera.js'; +import {PhotoResult, // eslint-disable-line no-unused-vars + VideoResult, // eslint-disable-line no-unused-vars +} from './camera/modes.js'; +import {ReviewResult} from './camera/review_result.js'; /** * The maximum number of pixels in the downscaled intent photo result. Reference @@ -20,27 +32,27 @@ * @type {number} * @const */ -cca.views.DOWNSCALE_INTENT_MAX_PIXEL_NUM = 50 * 1024; +const DOWNSCALE_INTENT_MAX_PIXEL_NUM = 50 * 1024; /** - * Creates the camera-intent-view controller. + * Camera-intent-view controller. */ -cca.views.CameraIntent = class extends cca.views.Camera { +export class CameraIntent extends Camera { /** - * @param {!cca.intent.Intent} intent - * @param {!cca.device.DeviceInfoUpdater} infoUpdater - * @param {!cca.device.PhotoConstraintsPreferrer} photoPreferrer - * @param {!cca.device.VideoConstraintsPreferrer} videoPreferrer + * @param {!Intent} intent + * @param {!DeviceInfoUpdater} infoUpdater + * @param {!PhotoConstraintsPreferrer} photoPreferrer + * @param {!VideoConstraintsPreferrer} videoPreferrer + * @param {!PerfLogger} perfLogger */ - constructor(intent, infoUpdater, photoPreferrer, videoPreferrer) { - const resultSaver = /** @type {!cca.models.ResultSaver} */ ({ + constructor(intent, infoUpdater, photoPreferrer, videoPreferrer, perfLogger) { + const resultSaver = /** @type {!ResultSaver} */ ({ savePhoto: async (blob) => { if (intent.shouldDownScale) { - const image = await cca.util.blobToImage(blob); + const image = await util.blobToImage(blob); const ratio = Math.sqrt( - cca.views.DOWNSCALE_INTENT_MAX_PIXEL_NUM / - (image.width * image.height)); - blob = await cca.util.scalePicture( + DOWNSCALE_INTENT_MAX_PIXEL_NUM / (image.width * image.height)); + blob = await util.scalePicture( image.src, false, Math.floor(image.width * ratio), Math.floor(image.height * ratio)); } @@ -48,29 +60,30 @@ await this.intent_.appendData(new Uint8Array(buf)); }, startSaveVideo: async () => { - return await cca.models.IntentVideoSaver.create(intent); + return await IntentVideoSaver.create(intent); }, finishSaveVideo: async (video, savedName) => { this.videoResultFile_ = await video.endWrite(); }, }); super( - resultSaver, infoUpdater, photoPreferrer, videoPreferrer, intent.mode); + resultSaver, infoUpdater, photoPreferrer, videoPreferrer, intent.mode, + perfLogger); /** - * @type {!cca.intent.Intent} + * @type {!Intent} * @private */ this.intent_ = intent; /** - * @type {?cca.views.camera.PhotoResult} + * @type {?PhotoResult} * @private */ this.photoResult_ = null; /** - * @type {?cca.views.camera.VideoResult} + * @type {?VideoResult} * @private */ this.videoResult_ = null; @@ -82,10 +95,10 @@ this.videoResultFile_ = null; /** - * @type {!cca.views.camera.ReviewResult} + * @type {!ReviewResult} * @private */ - this.reviewResult_ = new cca.views.camera.ReviewResult(); + this.reviewResult_ = new ReviewResult(); } /** @@ -96,7 +109,7 @@ try { await this.resultSaver_.savePhoto(result.blob, name); } catch (e) { - cca.toast.show('error_msg_save_file_failed'); + toast.show('error_msg_save_file_failed'); throw e; } } @@ -109,7 +122,7 @@ try { await this.resultSaver_.finishSaveVideo(result.videoSaver, name); } catch (e) { - cca.toast.show('error_msg_save_file_failed'); + toast.show('error_msg_save_file_failed'); throw e; } } @@ -129,7 +142,7 @@ return (async () => { await take; - cca.state.set(cca.state.State.SUSPEND, true); + state.set(state.State.SUSPEND, true); await this.start(); const confirmed = await (() => { if (this.photoResult_ !== null) { @@ -137,22 +150,22 @@ } else if (this.videoResultFile_ !== null) { return this.reviewResult_.openVideo(this.videoResultFile_); } else { - cca.assertNotReached('End take without intent result.'); + assertNotReached('End take without intent result.'); } })(); const result = this.photoResult_ || this.videoResult_; - cca.metrics.log( - cca.metrics.Type.CAPTURE, this.facingMode_, result.duration || 0, + metrics.log( + metrics.Type.CAPTURE, this.facingMode_, result.duration || 0, result.resolution, - confirmed ? cca.metrics.IntentResultType.CONFIRMED : - cca.metrics.IntentResultType.CANCELED); + confirmed ? metrics.IntentResultType.CONFIRMED : + metrics.IntentResultType.CANCELED); if (confirmed) { await this.intent_.finish(); window.close(); return; } this.focus(); // Refocus the visible shutter button for ChromeVox. - cca.state.set(cca.state.State.SUSPEND, false); + state.set(state.State.SUSPEND, false); await this.intent_.clearData(); await this.start(); })(); @@ -164,4 +177,7 @@ async startWithDevice_(deviceId) { return this.startWithMode_(deviceId, this.defaultMode_); } -}; +} + +/** @const */ +cca.views.CameraIntent = CameraIntent;
diff --git a/chrome/browser/resources/chromeos/camera/src/views/main.html b/chrome/browser/resources/chromeos/camera/src/views/main.html index 5a6233f..d50a7ac 100644 --- a/chrome/browser/resources/chromeos/camera/src/views/main.html +++ b/chrome/browser/resources/chromeos/camera/src/views/main.html
@@ -47,8 +47,8 @@ <script type="module" src="../js/mojo/device_operator.js"></script> <script type="module" src="../js/mojo/image_capture.js"></script> <script type="module" src="../js/views/view.js"></script> - <script defer src="../js/views/camera.js"></script> - <script defer src="../js/views/camera_intent.js"></script> + <script type="module" src="../js/views/camera.js"></script> + <script type="module" src="../js/views/camera_intent.js"></script> <script type="module" src="../js/views/camera/layout.js"></script> <script type="module" src="../js/views/camera/options.js"></script> <script type="module" src="../js/views/camera/preview.js"></script>
diff --git a/chrome/browser/resources/settings/a11y_page/a11y_page.html b/chrome/browser/resources/settings/a11y_page/a11y_page.html index c5a8127b..28b890e 100644 --- a/chrome/browser/resources/settings/a11y_page/a11y_page.html +++ b/chrome/browser/resources/settings/a11y_page/a11y_page.html
@@ -10,7 +10,7 @@ <link rel="import" href="captions_browser_proxy.html"> </if> -<if expr="not is_macosx and not is_chromeos"> +<if expr="not is_macosx and not chromeos"> <link rel="import" href="captions_subpage.html"> <link rel="import" href="../settings_page/settings_subpage.html"> </if> @@ -51,7 +51,7 @@ external> </cr-link-row> </div> -<if expr="not is_macosx and not is_chromeos"> +<if expr="not is_macosx and not chromeos"> <template is="dom-if" if="[[showCaptionSettings_]]"> <template is="dom-if" route-path="/captions"> <settings-subpage
diff --git a/chrome/browser/resources/settings/manifest.json b/chrome/browser/resources/settings/manifest.json deleted file mode 100644 index acbaa3c..0000000 --- a/chrome/browser/resources/settings/manifest.json +++ /dev/null
@@ -1,13 +0,0 @@ -{ - "name": "$i18nRaw{name}", - "display": "standalone", - "icons": [ - { - "src": "icon-192.png", - "sizes": "192x192", - "type": "image/png" - } - ], - "start_url": "/", - "theme_color": "#254FAE" -}
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js index bba083a..dd7e1d6 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.js +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -232,6 +232,9 @@ /** @private */ searchFilter_: String, + + /** @private */ + siteDataFilter_: String, }, observers: [
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index d004a28..b527c97 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -37,12 +37,6 @@ file="a11y_page/captions_browser_proxy.js" type="chrome_html" /> </if> - <if expr="chromeos"> - <structure name="IDR_SETTINGS_MANIFEST" - file="manifest.json" - type="chrome_html" /> - - </if> <structure name="IDR_SETTINGS_ABOUT_PAGE_BROWSER_PROXY_HTML" file="about_page/about_page_browser_proxy.html" type="chrome_html" />
diff --git a/chrome/browser/resources/settings/settings_resources_vulcanized.grd b/chrome/browser/resources/settings/settings_resources_vulcanized.grd index 61b333f..1ffdf0b 100644 --- a/chrome/browser/resources/settings/settings_resources_vulcanized.grd +++ b/chrome/browser/resources/settings/settings_resources_vulcanized.grd
@@ -16,7 +16,6 @@ <include name="IDR_SETTINGS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\settings\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" /> <include name="IDR_SETTINGS_LAZY_LOAD_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\lazy_load.vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" /> <include name="IDR_SETTINGS_LAZY_LOAD_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\settings\lazy_load.crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" /> - <include name="IDR_SETTINGS_MANIFEST" file="manifest.json" type="BINDATA" compress="gzip" /> </includes> </release> </grit>
diff --git a/chrome/browser/resources/settings/site_settings/site_data.js b/chrome/browser/resources/settings/site_settings/site_data.js index cd6370aa..89e740f 100644 --- a/chrome/browser/resources/settings/site_settings/site_data.js +++ b/chrome/browser/resources/settings/site_settings/site_data.js
@@ -40,7 +40,7 @@ * The current filter applied to the cookie data list. */ filter: { - observer: 'updateSiteList_', + observer: 'onFilterChanged_', notify: true, type: String, }, @@ -89,8 +89,12 @@ lastSelected_: null, /** @override */ - ready: function() { + created: function() { this.browserProxy_ = settings.LocalDataBrowserProxyImpl.getInstance(); + }, + + /** @override */ + ready: function() { this.addWebUIListener( 'on-tree-item-removed', this.updateSiteList_.bind(this)); }, @@ -170,6 +174,18 @@ }, /** + * @param {string} current + * @param {string|undefined} previous + * @private + */ + onFilterChanged_: function(current, previous) { + if (previous === undefined) { + return; + } + this.updateSiteList_(); + }, + + /** * Gather all the site data. * @private */
diff --git a/chrome/browser/sessions/chrome_tab_restore_service_client.cc b/chrome/browser/sessions/chrome_tab_restore_service_client.cc index 8119ec6..c2408dc 100644 --- a/chrome/browser/sessions/chrome_tab_restore_service_client.cc +++ b/chrome/browser/sessions/chrome_tab_restore_service_client.cc
@@ -114,12 +114,12 @@ } void ChromeTabRestoreServiceClient::GetLastSession( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) { DCHECK(HasLastSession()); #if BUILDFLAG(ENABLE_SESSION_SERVICE) - SessionServiceFactory::GetForProfile(profile_) - ->GetLastSession(callback, tracker); + SessionServiceFactory::GetForProfile(profile_)->GetLastSession( + std::move(callback), tracker); #endif }
diff --git a/chrome/browser/sessions/chrome_tab_restore_service_client.h b/chrome/browser/sessions/chrome_tab_restore_service_client.h index e433d5f0..a1e470e2 100644 --- a/chrome/browser/sessions/chrome_tab_restore_service_client.h +++ b/chrome/browser/sessions/chrome_tab_restore_service_client.h
@@ -33,7 +33,7 @@ base::FilePath GetPathToSaveTo() override; GURL GetNewTabURL() override; bool HasLastSession() override; - void GetLastSession(const sessions::GetLastSessionCallback& callback, + void GetLastSession(sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) override; void OnTabRestored(const GURL& url) override;
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index d542d9e..9a99de9 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc
@@ -554,14 +554,13 @@ } base::CancelableTaskTracker::TaskId SessionService::GetLastSession( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) { // OnGotSessionCommands maps the SessionCommands to browser state, then run // the callback. return base_session_service_->ScheduleGetLastSessionCommands( - base::Bind(&SessionService::OnGotSessionCommands, - weak_factory_.GetWeakPtr(), - callback), + base::BindOnce(&SessionService::OnGotSessionCommands, + weak_factory_.GetWeakPtr(), std::move(callback)), tracker); } @@ -642,7 +641,7 @@ } void SessionService::OnGotSessionCommands( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, std::vector<std::unique_ptr<sessions::SessionCommand>> commands) { std::vector<std::unique_ptr<sessions::SessionWindow>> valid_windows; SessionID active_window_id = SessionID::InvalidValue(); @@ -651,7 +650,7 @@ &active_window_id); RemoveUnusedRestoreWindows(&valid_windows); - callback.Run(std::move(valid_windows), active_window_id); + std::move(callback).Run(std::move(valid_windows), active_window_id); } void SessionService::BuildCommandsForTab(
diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index 7547755e..47344361 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h
@@ -225,7 +225,7 @@ // done. If the callback is supplied an empty vector of SessionWindows // it means the session could not be restored. base::CancelableTaskTracker::TaskId GetLastSession( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker); // BaseSessionServiceDelegate: @@ -265,7 +265,7 @@ // Converts |commands| to SessionWindows and notifies the callback. void OnGotSessionCommands( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, std::vector<std::unique_ptr<sessions::SessionCommand>> commands); // Adds commands to commands that will recreate the state of the specified
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc index 62df7846..fbdc7ee 100644 --- a/chrome/browser/sync/chrome_sync_client.cc +++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -375,7 +375,6 @@ // Web Apps sync is disabled by default. if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions) && - base::FeatureList::IsEnabled(features::kDesktopPWAsUSS) && web_app::WebAppProvider::Get(profile_)) { if (!disabled_types.Has(syncer::WEB_APPS)) { controllers.push_back(CreateWebAppsModelTypeController(sync_service)); @@ -624,7 +623,6 @@ case syncer::WEB_APPS: { DCHECK(base::FeatureList::IsEnabled( features::kDesktopPWAsWithoutExtensions)); - DCHECK(base::FeatureList::IsEnabled(features::kDesktopPWAsUSS)); auto* provider = web_app::WebAppProvider::Get(profile_); DCHECK(provider);
diff --git a/chrome/browser/sync/profile_sync_service_factory_unittest.cc b/chrome/browser/sync/profile_sync_service_factory_unittest.cc index bc710371..99fb1a3 100644 --- a/chrome/browser/sync/profile_sync_service_factory_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_factory_unittest.cc
@@ -77,10 +77,8 @@ datatypes.push_back(syncer::EXTENSIONS); datatypes.push_back(syncer::EXTENSION_SETTINGS); datatypes.push_back(syncer::APP_SETTINGS); - if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions) && - base::FeatureList::IsEnabled(features::kDesktopPWAsUSS)) { + if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions)) datatypes.push_back(syncer::WEB_APPS); - } #endif // BUILDFLAG(ENABLE_EXTENSIONS) #if !defined(OS_ANDROID)
diff --git a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc index 4c5130b..ec906e5 100644 --- a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
@@ -299,11 +299,10 @@ public: SingleClientStandaloneTransportOsSyncTest() : OsSyncTest(SINGLE_CLIENT) { // Don't auto-start browser sync. Enable in-development types. - scoped_features_.InitWithFeatures( - {switches::kSyncManualStartChromeOS, - features::kDesktopPWAsWithoutExtensions, features::kDesktopPWAsUSS, - switches::kSyncWifiConfigurations}, - {}); + scoped_features_.InitWithFeatures({switches::kSyncManualStartChromeOS, + features::kDesktopPWAsWithoutExtensions, + switches::kSyncWifiConfigurations}, + {}); } ~SingleClientStandaloneTransportOsSyncTest() override = default;
diff --git a/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc b/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc index 343dd772..989649b 100644 --- a/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_web_apps_sync_test.cc
@@ -25,9 +25,7 @@ class SingleClientWebAppsOsSyncTest : public OsSyncTest { public: SingleClientWebAppsOsSyncTest() : OsSyncTest(SINGLE_CLIENT) { - features_.InitWithFeatures( - {features::kDesktopPWAsWithoutExtensions, features::kDesktopPWAsUSS}, - {}); + features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions); } ~SingleClientWebAppsOsSyncTest() override = default; @@ -56,9 +54,7 @@ class SingleClientWebAppsSyncTest : public SyncTest { public: SingleClientWebAppsSyncTest() : SyncTest(SINGLE_CLIENT) { - features_.InitWithFeatures( - {features::kDesktopPWAsWithoutExtensions, features::kDesktopPWAsUSS}, - {}); + features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions); } ~SingleClientWebAppsSyncTest() override = default;
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider.cc b/chrome/browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider.cc index 181b915..eb1478e 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/ml_app_rank_provider.cc
@@ -250,7 +250,7 @@ kAppScheme + crx_file::id_util::GenerateId(features.arc_package_name())); } else { - LOG(ERROR) << "Unknown app type: " << features.app_type(); + // TODO(crbug.com/1027782): Add DCHECK that this branch is not reached. } return example; }
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarTest.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarTest.java index 17ba0a7..da666533 100644 --- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarTest.java +++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarTest.java
@@ -11,7 +11,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.base.task.PostTask; import org.chromium.base.test.util.RetryOnFailure; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index 517b735..63529eed 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -166,6 +166,7 @@ // Only web-app windows support dynamic frame colors set by HTML meta tags. if (web_app_frame_toolbar_) web_app_frame_toolbar_->UpdateCaptionColors(); + SchedulePaint(); } SkColor BrowserNonClientFrameView::GetToolbarTopSeparatorColor() const {
diff --git a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc index f5b6f95b..4909436f 100644 --- a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc +++ b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc
@@ -86,12 +86,16 @@ return install_options; } -InstallResultCode InstallApp(Profile* profile, - ExternalInstallOptions install_options) { +InstallResultCode PendingAppManagerInstall( + Profile* profile, + ExternalInstallOptions install_options) { + DCHECK(profile); + auto* provider = WebAppProviderBase::GetProviderBase(profile); + DCHECK(provider); base::RunLoop run_loop; InstallResultCode result_code; - WebAppProviderBase::GetProviderBase(profile)->pending_app_manager().Install( + provider->pending_app_manager().Install( std::move(install_options), base::BindLambdaForTesting( [&result_code, &run_loop](const GURL& provided_url,
diff --git a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h index 1bac57e..b914ac7 100644 --- a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h +++ b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h
@@ -8,6 +8,7 @@ #include <memory> #include "chrome/browser/web_applications/components/web_app_helpers.h" +#include "url/gurl.h" class Browser; class Profile; @@ -18,6 +19,7 @@ struct ExternalInstallOptions; enum class InstallResultCode; +// Synchronous version of InstallManager::InstallWebAppFromInfo. AppId InstallWebApp(Profile* profile, std::unique_ptr<WebApplicationInfo>); // Launches a new app window for |app| in |profile|. @@ -26,9 +28,11 @@ // Launches a new tab for |app| in |profile|. Browser* LaunchBrowserForWebAppInTab(Profile*, const AppId&); +// Return |ExternalInstallOptions| with OS shortcut creation disabled. ExternalInstallOptions CreateInstallOptions(const GURL& url); -InstallResultCode InstallApp(Profile*, ExternalInstallOptions); +// Synchronous version of PendingAppManager::Install. +InstallResultCode PendingAppManagerInstall(Profile*, ExternalInstallOptions); } // namespace web_app
diff --git a/chrome/browser/ui/web_applications/web_app_engagement_browsertest.cc b/chrome/browser/ui/web_applications/web_app_engagement_browsertest.cc index 2fa23fe..b787a2e 100644 --- a/chrome/browser/ui/web_applications/web_app_engagement_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_engagement_browsertest.cc
@@ -217,7 +217,8 @@ } void InstallDefaultAppAndCountApps(ExternalInstallOptions install_options) { - result_code_ = InstallApp(browser()->profile(), std::move(install_options)); + result_code_ = PendingAppManagerInstall(browser()->profile(), + std::move(install_options)); CountUserInstalledApps(); }
diff --git a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc index cca14f07..1822dd3 100644 --- a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc
@@ -126,7 +126,6 @@ web_ui->AddMessageHandler(std::make_unique<MetricsHandler>()); // Add the System Web App resources for Settings. - // TODO(jamescook|calamity): Migrate to chromeos::settings::OSSettingsUI. if (web_app::SystemWebAppManager::IsEnabled()) { html_source->AddResourcePath("icon-192.png", IDR_SETTINGS_LOGO_192); html_source->AddResourcePath("pwa.html", IDR_PWA_HTML);
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 35519e71..a4fe51f 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -97,7 +97,6 @@ #include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_client_factory.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" -#include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h" #include "chrome/browser/ui/webui/chromeos/smb_shares/smb_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h" @@ -119,9 +118,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/parental_controls_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/plugin_vm_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/wallpaper_handler.h" -#include "chrome/browser/web_applications/system_web_app_manager.h" #include "chrome/common/chrome_switches.h" -#include "chrome/grit/browser_resources.h" #include "chromeos/components/account_manager/account_manager.h" #include "chromeos/components/account_manager/account_manager_factory.h" #include "chromeos/constants/chromeos_features.h" @@ -298,17 +295,6 @@ // Add the metrics handler to write uma stats. web_ui->AddMessageHandler(std::make_unique<MetricsHandler>()); -#if defined(OS_CHROMEOS) - // Add the System Web App resources for Settings. - // TODO(jamescook|calamity): Migrate to chromeos::settings::OSSettingsUI. - if (web_app::SystemWebAppManager::IsEnabled()) { - html_source->AddResourcePath("icon-192.png", IDR_SETTINGS_LOGO_192); - html_source->AddResourcePath("pwa.html", IDR_PWA_HTML); - web_app::SetManifestRequestFilter(html_source, IDR_SETTINGS_MANIFEST, - IDS_SETTINGS_SETTINGS); - } -#endif // defined (OS_CHROMEOS) - #if BUILDFLAG(OPTIMIZE_WEBUI) html_source->AddResourcePath("crisper.js", IDR_SETTINGS_CRISPER_JS); html_source->AddResourcePath("lazy_load.crisper.js",
diff --git a/chrome/browser/web_applications/components/app_icon_manager.h b/chrome/browser/web_applications/components/app_icon_manager.h index 91d7790..0f88631e 100644 --- a/chrome/browser/web_applications/components/app_icon_manager.h +++ b/chrome/browser/web_applications/components/app_icon_manager.h
@@ -23,30 +23,35 @@ AppIconManager() = default; virtual ~AppIconManager() = default; - // Returns false if no downloaded icon with precise |icon_size_in_px|. - virtual bool HasIcon(const AppId& app_id, int icon_size_in_px) const = 0; + // Returns false if any icon in |icon_sizes_in_px| is missing from downloaded + // icons for a given app. |icon_sizes_in_px| must be sorted in ascending + // order. + virtual bool HasIcons( + const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px) const = 0; // Returns false if no downloaded icon matching |icon_size_in_px|. virtual bool HasSmallestIcon(const AppId& app_id, - int icon_size_in_px) const = 0; + SquareSizePx icon_size_in_px) const = 0; - // Reads icon's bitmap for an app. Returns empty SkBitmap in |callback| if IO - // error. - using ReadIconCallback = base::OnceCallback<void(const SkBitmap&)>; - virtual void ReadIcon(const AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const = 0; + using ReadIconsCallback = + base::OnceCallback<void(std::map<SquareSizePx, SkBitmap> icon_bitmaps)>; + + // Reads specified icon bitmaps for an app. Returns empty map in |callback| if + // IO error. |icon_sizes_in_px| must be sorted in ascending order. + virtual void ReadIcons(const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px, + ReadIconsCallback callback) const = 0; // Reads all icon bitmaps for an app. Returns empty |icon_bitmaps| in // |callback| if IO error. - using ReadAllIconsCallback = - base::OnceCallback<void(std::map<SquareSizePx, SkBitmap> icon_bitmaps)>; virtual void ReadAllIcons(const AppId& app_id, - ReadAllIconsCallback callback) const = 0; + ReadIconsCallback callback) const = 0; // Reads smallest icon with size at least |icon_size_in_px|. Returns empty // SkBitmap in |callback| if IO error. + using ReadIconCallback = base::OnceCallback<void(const SkBitmap&)>; virtual void ReadSmallestIcon(const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadIconCallback callback) const = 0; // Reads smallest icon, compressed as PNG with size at least @@ -55,7 +60,7 @@ base::OnceCallback<void(std::vector<uint8_t> data)>; virtual void ReadSmallestCompressedIcon( const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadCompressedIconCallback callback) const = 0; private:
diff --git a/chrome/browser/web_applications/components/install_manager.h b/chrome/browser/web_applications/components/install_manager.h index cd7fa10b..476c73a 100644 --- a/chrome/browser/web_applications/components/install_manager.h +++ b/chrome/browser/web_applications/components/install_manager.h
@@ -92,7 +92,8 @@ // Starts a web app installation process using prefilled // |web_application_info| which holds all the data needed for installation. - // InstallManager doesn't fetch a manifest. + // This doesn't fetch a manifest and doesn't perform all required steps for + // External installed apps: use |PendingAppManager::Install| instead. virtual void InstallWebAppFromInfo( std::unique_ptr<WebApplicationInfo> web_application_info, ForInstallableSite for_installable_site,
diff --git a/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.cc b/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.cc index 11680ef7..1a8829c 100644 --- a/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.cc +++ b/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.cc
@@ -33,7 +33,7 @@ void ReadExtensionIcon(Profile* profile, const web_app::AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ExtensionIconSet::MatchType match_type, BookmarkAppIconManager::ReadIconCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -48,9 +48,8 @@ base::BindOnce(&OnExtensionIconLoaded, std::move(callback))); } -void OnExtensionIconsLoaded( - BookmarkAppIconManager::ReadAllIconsCallback callback, - const gfx::Image& image) { +void OnExtensionIconsLoaded(BookmarkAppIconManager::ReadIconsCallback callback, + const gfx::Image& image) { std::map<SquareSizePx, SkBitmap> icons_map; gfx::ImageSkia image_skia = image.AsImageSkia(); @@ -62,19 +61,16 @@ void ReadExtensionIcons(Profile* profile, const web_app::AppId& app_id, - BookmarkAppIconManager::ReadAllIconsCallback callback) { + const std::vector<SquareSizePx>& icon_sizes_in_px, + BookmarkAppIconManager::ReadIconsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - const Extension* extension = GetBookmarkApp(profile, app_id); - DCHECK(extension); - - const ExtensionIconSet& icons = IconsInfo::GetIcons(extension); + const Extension* app = GetBookmarkApp(profile, app_id); + DCHECK(app); std::vector<ImageLoader::ImageRepresentation> info_list; - for (const ExtensionIconSet::IconMap::value_type& icon_info : icons.map()) { - const int size_in_px = icon_info.first; - + for (SquareSizePx size_in_px : icon_sizes_in_px) { ExtensionResource resource = IconsInfo::GetIconResource( - extension, size_in_px, ExtensionIconSet::MATCH_EXACTLY); + app, size_in_px, ExtensionIconSet::MATCH_EXACTLY); ImageLoader::ImageRepresentation image_rep{ resource, ImageLoader::ImageRepresentation::NEVER_RESIZE, gfx::Size{size_in_px, size_in_px}, /*scale_factor=*/0.0f}; @@ -83,10 +79,25 @@ ImageLoader* loader = ImageLoader::Get(profile); loader->LoadImagesAsync( - extension, info_list, + app, info_list, base::BindOnce(&OnExtensionIconsLoaded, std::move(callback))); } +void ReadAllExtensionIcons(Profile* profile, + const web_app::AppId& app_id, + BookmarkAppIconManager::ReadIconsCallback callback) { + const Extension* app = GetBookmarkApp(profile, app_id); + DCHECK(app); + + const ExtensionIconSet& icons = IconsInfo::GetIcons(app); + + std::vector<SquareSizePx> icon_sizes_in_px; + for (const ExtensionIconSet::IconMap::value_type& icon_info : icons.map()) + icon_sizes_in_px.push_back(icon_info.first); + + ReadExtensionIcons(profile, app_id, icon_sizes_in_px, std::move(callback)); +} + } // anonymous namespace BookmarkAppIconManager::BookmarkAppIconManager(Profile* profile) @@ -94,31 +105,55 @@ BookmarkAppIconManager::~BookmarkAppIconManager() = default; -bool BookmarkAppIconManager::HasIcon(const web_app::AppId& app_id, - int icon_size_in_px) const { - return GetBookmarkApp(profile_, app_id); +bool BookmarkAppIconManager::HasIcons( + const web_app::AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px) const { + const Extension* app = GetBookmarkApp(profile_, app_id); + if (!app) + return false; + + const ExtensionIconSet& icons = IconsInfo::GetIcons(app); + + for (SquareSizePx size_in_px : icon_sizes_in_px) { + const std::string& path = + icons.Get(size_in_px, ExtensionIconSet::MATCH_EXACTLY); + if (path.empty()) + return false; + } + + return true; } -bool BookmarkAppIconManager::HasSmallestIcon(const web_app::AppId& app_id, - int icon_size_in_px) const { - return GetBookmarkApp(profile_, app_id); +bool BookmarkAppIconManager::HasSmallestIcon( + const web_app::AppId& app_id, + SquareSizePx icon_size_in_px) const { + const Extension* app = GetBookmarkApp(profile_, app_id); + if (!app) + return false; + + const ExtensionIconSet& icons = IconsInfo::GetIcons(app); + + const std::string& path = + icons.Get(icon_size_in_px, ExtensionIconSet::MATCH_BIGGER); + + return !path.empty(); } -void BookmarkAppIconManager::ReadIcon(const web_app::AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const { - DCHECK(HasIcon(app_id, icon_size_in_px)); - ReadExtensionIcon(profile_, app_id, icon_size_in_px, - ExtensionIconSet::MATCH_EXACTLY, std::move(callback)); +void BookmarkAppIconManager::ReadIcons( + const web_app::AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px, + ReadIconsCallback callback) const { + DCHECK(HasIcons(app_id, icon_sizes_in_px)); + ReadExtensionIcons(profile_, app_id, icon_sizes_in_px, std::move(callback)); } void BookmarkAppIconManager::ReadAllIcons(const web_app::AppId& app_id, - ReadAllIconsCallback callback) const { - ReadExtensionIcons(profile_, app_id, std::move(callback)); + ReadIconsCallback callback) const { + ReadAllExtensionIcons(profile_, app_id, std::move(callback)); } void BookmarkAppIconManager::ReadSmallestIcon(const web_app::AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadIconCallback callback) const { DCHECK(HasSmallestIcon(app_id, icon_size_in_px)); ReadExtensionIcon(profile_, app_id, icon_size_in_px, @@ -127,7 +162,7 @@ void BookmarkAppIconManager::ReadSmallestCompressedIcon( const web_app::AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadCompressedIconCallback callback) const { NOTIMPLEMENTED(); DCHECK(HasSmallestIcon(app_id, icon_size_in_px));
diff --git a/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.h b/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.h index 102aa31..1b5f69e 100644 --- a/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.h +++ b/chrome/browser/web_applications/extensions/bookmark_app_icon_manager.h
@@ -20,21 +20,22 @@ ~BookmarkAppIconManager() override; // AppIconManager: - bool HasIcon(const web_app::AppId& app_id, - int icon_size_in_px) const override; + bool HasIcons( + const web_app::AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px) const override; bool HasSmallestIcon(const web_app::AppId& app_id, - int icon_size_in_px) const override; - void ReadIcon(const web_app::AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const override; + SquareSizePx icon_size_in_px) const override; + void ReadIcons(const web_app::AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px, + ReadIconsCallback callback) const override; void ReadAllIcons(const web_app::AppId& app_id, - ReadAllIconsCallback callback) const override; + ReadIconsCallback callback) const override; void ReadSmallestIcon(const web_app::AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadIconCallback callback) const override; void ReadSmallestCompressedIcon( const web_app::AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadCompressedIconCallback callback) const override; private:
diff --git a/chrome/browser/web_applications/pending_app_manager_impl_browsertest.cc b/chrome/browser/web_applications/pending_app_manager_impl_browsertest.cc index d6dde86..0d09f5fe 100644 --- a/chrome/browser/web_applications/pending_app_manager_impl_browsertest.cc +++ b/chrome/browser/web_applications/pending_app_manager_impl_browsertest.cc
@@ -54,7 +54,8 @@ } void InstallApp(ExternalInstallOptions install_options) { - result_code_ = web_app::InstallApp(browser()->profile(), install_options); + result_code_ = web_app::PendingAppManagerInstall(browser()->profile(), + install_options); } void CheckServiceWorkerStatus(const GURL& url,
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 6b67ed9..cfebe9b 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/web_applications/web_app.h" +#include <algorithm> #include <ios> #include <ostream> #include <tuple> @@ -153,6 +154,7 @@ } void WebApp::SetDownloadedIconSizes(std::vector<SquareSizePx> sizes) { + std::sort(sizes.begin(), sizes.end()); downloaded_icon_sizes_ = std::move(sizes); }
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index 3fd7f82..1befaab0 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h
@@ -68,6 +68,7 @@ } // Represents which icon sizes we successfully downloaded from the icon_infos. + // Icon sizes are sorted in ascending order. const std::vector<SquareSizePx>& downloaded_icon_sizes() const { return downloaded_icon_sizes_; } @@ -149,6 +150,7 @@ void SetIsLocallyInstalled(bool is_locally_installed); void SetIsInSyncInstall(bool is_in_sync_install); void SetIconInfos(std::vector<WebApplicationIconInfo> icon_infos); + // Performs sorting of |sizes| vector. Must be called rarely. void SetDownloadedIconSizes(std::vector<SquareSizePx> sizes); void SetFileHandlers(FileHandlers file_handlers);
diff --git a/chrome/browser/web_applications/web_app_database_factory.cc b/chrome/browser/web_applications/web_app_database_factory.cc index d789ca0..e9601e4 100644 --- a/chrome/browser/web_applications/web_app_database_factory.cc +++ b/chrome/browser/web_applications/web_app_database_factory.cc
@@ -4,20 +4,30 @@ #include "chrome/browser/web_applications/web_app_database_factory.h" +#include "base/feature_list.h" +#include "chrome/browser/sync/model_type_store_service_factory.h" #include "chrome/browser/web_applications/components/web_app_utils.h" +#include "chrome/common/chrome_features.h" #include "components/sync/model_impl/model_type_store_service_impl.h" namespace web_app { WebAppDatabaseFactory::WebAppDatabaseFactory(Profile* profile) - : model_type_store_service_( - std::make_unique<syncer::ModelTypeStoreServiceImpl>( - GetWebAppsDirectory(profile))) {} + : profile_(profile) { + if (!base::FeatureList::IsEnabled(features::kDesktopPWAsSharedStoreService)) { + model_type_store_service_ = + std::make_unique<syncer::ModelTypeStoreServiceImpl>( + GetWebAppsDirectory(profile)); + } +} -WebAppDatabaseFactory::~WebAppDatabaseFactory() {} +WebAppDatabaseFactory::~WebAppDatabaseFactory() = default; syncer::OnceModelTypeStoreFactory WebAppDatabaseFactory::GetStoreFactory() { - return model_type_store_service_->GetStoreFactory(); + return model_type_store_service_ + ? model_type_store_service_->GetStoreFactory() + : ModelTypeStoreServiceFactory::GetForProfile(profile_) + ->GetStoreFactory(); } } // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_database_factory.h b/chrome/browser/web_applications/web_app_database_factory.h index 33ac124..9d3497c 100644 --- a/chrome/browser/web_applications/web_app_database_factory.h +++ b/chrome/browser/web_applications/web_app_database_factory.h
@@ -33,10 +33,13 @@ syncer::OnceModelTypeStoreFactory GetStoreFactory() override; private: - // TODO(loyso): Consider using shared ModelTypeStoreService from profile. - // crbug.com/902214. + // If null, the Web Apps system uses the shared ModelTypeStoreService from the + // profile. Otherwise, the Web Apps system uses its own ModelTypeStoreService + // instance. std::unique_ptr<syncer::ModelTypeStoreService> model_type_store_service_; + Profile* const profile_; + DISALLOW_COPY_AND_ASSIGN(WebAppDatabaseFactory); };
diff --git a/chrome/browser/web_applications/web_app_icon_manager.cc b/chrome/browser/web_applications/web_app_icon_manager.cc index 95a5468a..2c317fa 100644 --- a/chrome/browser/web_applications/web_app_icon_manager.cc +++ b/chrome/browser/web_applications/web_app_icon_manager.cc
@@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_refptr.h" +#include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "base/task/post_task.h" #include "base/task/task_traits.h" @@ -198,17 +199,17 @@ } // Performs blocking I/O. May be called on another thread. -std::map<SquareSizePx, SkBitmap> ReadAllIconsBlocking( +std::map<SquareSizePx, SkBitmap> ReadIconsBlocking( std::unique_ptr<FileUtilsWrapper> utils, base::FilePath web_apps_directory, AppId app_id, - const std::vector<SquareSizePx>& downloaded_icon_sizes) { + const std::vector<SquareSizePx>& icon_sizes) { base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::MAY_BLOCK); std::map<SquareSizePx, SkBitmap> result; - for (SquareSizePx icon_size_px : downloaded_icon_sizes) { + for (SquareSizePx icon_size_px : icon_sizes) { base::FilePath icon_file = GetIconFileName(web_apps_directory, app_id, icon_size_px); @@ -293,37 +294,38 @@ std::move(callback)); } -bool WebAppIconManager::HasIcon(const AppId& app_id, - int icon_size_in_px) const { +bool WebAppIconManager::HasIcons( + const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px) const { const WebApp* web_app = registrar_.GetAppById(app_id); if (!web_app) return false; - for (SquareSizePx size : web_app->downloaded_icon_sizes()) { - if (size == icon_size_in_px) - return true; - } - - return false; + return base::STLIncludes(web_app->downloaded_icon_sizes(), icon_sizes_in_px); } bool WebAppIconManager::HasSmallestIcon(const AppId& app_id, - int icon_size_in_px) const { + SquareSizePx icon_size_in_px) const { int best_size_in_px = 0; return FindBestSizeInPx(app_id, icon_size_in_px, &best_size_in_px); } -void WebAppIconManager::ReadIcon(const AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const { +void WebAppIconManager::ReadIcons( + const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px, + ReadIconsCallback callback) const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - DCHECK(HasIcon(app_id, icon_size_in_px)); + DCHECK(HasIcons(app_id, icon_sizes_in_px)); - ReadIconInternal(app_id, icon_size_in_px, std::move(callback)); + base::PostTaskAndReplyWithResult( + FROM_HERE, kTaskTraits, + base::BindOnce(ReadIconsBlocking, utils_->Clone(), web_apps_directory_, + app_id, icon_sizes_in_px), + std::move(callback)); } void WebAppIconManager::ReadAllIcons(const AppId& app_id, - ReadAllIconsCallback callback) const { + ReadIconsCallback callback) const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); const WebApp* web_app = registrar_.GetAppById(app_id); if (!web_app) { @@ -333,13 +335,13 @@ base::PostTaskAndReplyWithResult( FROM_HERE, kTaskTraits, - base::BindOnce(ReadAllIconsBlocking, utils_->Clone(), web_apps_directory_, + base::BindOnce(ReadIconsBlocking, utils_->Clone(), web_apps_directory_, app_id, web_app->downloaded_icon_sizes()), std::move(callback)); } void WebAppIconManager::ReadSmallestIcon(const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadIconCallback callback) const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -348,12 +350,16 @@ FindBestSizeInPx(app_id, icon_size_in_px, &best_size_in_px); DCHECK(has_smallest_icon); - ReadIconInternal(app_id, best_size_in_px, std::move(callback)); + base::PostTaskAndReplyWithResult( + FROM_HERE, kTaskTraits, + base::BindOnce(ReadIconBlocking, utils_->Clone(), web_apps_directory_, + app_id, best_size_in_px), + std::move(callback)); } void WebAppIconManager::ReadSmallestCompressedIcon( const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadCompressedIconCallback callback) const { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -386,14 +392,4 @@ return *best_size_in_px != std::numeric_limits<int>::max(); } -void WebAppIconManager::ReadIconInternal(const AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const { - base::PostTaskAndReplyWithResult( - FROM_HERE, kTaskTraits, - base::BindOnce(ReadIconBlocking, utils_->Clone(), web_apps_directory_, - app_id, icon_size_in_px), - std::move(callback)); -} - } // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_icon_manager.h b/chrome/browser/web_applications/web_app_icon_manager.h index f4e8609..db30dfd 100644 --- a/chrome/browser/web_applications/web_app_icon_manager.h +++ b/chrome/browser/web_applications/web_app_icon_manager.h
@@ -36,19 +36,22 @@ void DeleteData(AppId app_id, WriteDataCallback callback); // AppIconManager: - bool HasIcon(const AppId& app_id, int icon_size_in_px) const override; - bool HasSmallestIcon(const AppId& app_id, int icon_size_in_px) const override; - void ReadIcon(const AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const override; + bool HasIcons( + const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px) const override; + bool HasSmallestIcon(const AppId& app_id, + SquareSizePx icon_size_in_px) const override; + void ReadIcons(const AppId& app_id, + const std::vector<SquareSizePx>& icon_sizes_in_px, + ReadIconsCallback callback) const override; void ReadAllIcons(const AppId& app_id, - ReadAllIconsCallback callback) const override; + ReadIconsCallback callback) const override; void ReadSmallestIcon(const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadIconCallback callback) const override; void ReadSmallestCompressedIcon( const AppId& app_id, - int icon_size_in_px, + SquareSizePx icon_size_in_px, ReadCompressedIconCallback callback) const override; private: @@ -56,10 +59,6 @@ int icon_size_in_px, int* best_size_in_px) const; - void ReadIconInternal(const AppId& app_id, - int icon_size_in_px, - ReadIconCallback callback) const; - const WebAppRegistrar& registrar_; base::FilePath web_apps_directory_; std::unique_ptr<FileUtilsWrapper> utils_;
diff --git a/chrome/browser/web_applications/web_app_icon_manager_unittest.cc b/chrome/browser/web_applications/web_app_icon_manager_unittest.cc index 68a4884..ff9ee84c 100644 --- a/chrome/browser/web_applications/web_app_icon_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_icon_manager_unittest.cc
@@ -122,29 +122,38 @@ TestFileUtils* file_utils_ = nullptr; }; -TEST_F(WebAppIconManagerTest, WriteAndReadIcon) { +TEST_F(WebAppIconManagerTest, WriteAndReadIcons) { auto web_app = CreateWebApp(); const AppId app_id = web_app->app_id(); - const std::vector<int> sizes_px{icon_size::k512}; - const std::vector<SkColor> colors{SK_ColorYELLOW}; + const std::vector<int> sizes_px{icon_size::k256, icon_size::k512}; + const std::vector<SkColor> colors{SK_ColorGREEN, SK_ColorYELLOW}; WriteIcons(app_id, sizes_px, colors); web_app->SetDownloadedIconSizes(sizes_px); controller().RegisterApp(std::move(web_app)); - EXPECT_TRUE(icon_manager().HasIcon(app_id, sizes_px[0])); + EXPECT_TRUE(icon_manager().HasIcons(app_id, sizes_px)); { base::RunLoop run_loop; - icon_manager().ReadIcon( - app_id, sizes_px[0], - base::BindLambdaForTesting([&](const SkBitmap& bitmap) { - EXPECT_FALSE(bitmap.empty()); - EXPECT_EQ(colors[0], bitmap.getColor(0, 0)); - run_loop.Quit(); - })); + icon_manager().ReadIcons( + app_id, sizes_px, + base::BindLambdaForTesting( + [&](std::map<SquareSizePx, SkBitmap> icon_bitmaps) { + EXPECT_EQ(2u, icon_bitmaps.size()); + + EXPECT_FALSE(icon_bitmaps[icon_size::k256].empty()); + EXPECT_EQ(SK_ColorGREEN, + icon_bitmaps[icon_size::k256].getColor(0, 0)); + + EXPECT_FALSE(icon_bitmaps[icon_size::k512].empty()); + EXPECT_EQ(SK_ColorYELLOW, + icon_bitmaps[icon_size::k512].getColor(0, 0)); + + run_loop.Quit(); + })); run_loop.Run(); } @@ -240,31 +249,32 @@ } } -TEST_F(WebAppIconManagerTest, ReadIconFailed) { +TEST_F(WebAppIconManagerTest, ReadIconsFailed) { auto web_app = CreateWebApp(); const AppId app_id = web_app->app_id(); - const int icon_size_px = icon_size::k256; + const std::vector<SquareSizePx> icon_sizes_px{icon_size::k256}; // Set icon meta-info but don't write bitmap to disk. - web_app->SetDownloadedIconSizes({icon_size_px}); + web_app->SetDownloadedIconSizes(icon_sizes_px); controller().RegisterApp(std::move(web_app)); - // Check non-existing icon size. - EXPECT_FALSE(icon_manager().HasIcon(app_id, icon_size::k96)); - - EXPECT_TRUE(icon_manager().HasIcon(app_id, icon_size_px)); + EXPECT_FALSE(icon_manager().HasIcons(app_id, {icon_size::k96})); + EXPECT_TRUE(icon_manager().HasIcons(app_id, {icon_size::k256})); + EXPECT_FALSE( + icon_manager().HasIcons(app_id, {icon_size::k96, icon_size::k256})); // Request existing icon size which doesn't exist on disk. base::RunLoop run_loop; - icon_manager().ReadIcon( - app_id, icon_size_px, - base::BindLambdaForTesting([&](const SkBitmap& bitmap) { - EXPECT_TRUE(bitmap.empty()); - run_loop.Quit(); - })); + icon_manager().ReadIcons( + app_id, icon_sizes_px, + base::BindLambdaForTesting( + [&](std::map<SquareSizePx, SkBitmap> icon_bitmaps) { + EXPECT_TRUE(icon_bitmaps.empty()); + run_loop.Quit(); + })); run_loop.Run(); } @@ -282,19 +292,22 @@ controller().RegisterApp(std::move(web_app)); - EXPECT_FALSE(icon_manager().HasIcon(app_id, 40)); + EXPECT_FALSE(icon_manager().HasIcons(app_id, {40})); { base::RunLoop run_loop; - EXPECT_TRUE(icon_manager().HasIcon(app_id, 20)); + EXPECT_TRUE(icon_manager().HasIcons(app_id, {20})); - icon_manager().ReadIcon( - app_id, 20, base::BindLambdaForTesting([&](const SkBitmap& bitmap) { - EXPECT_FALSE(bitmap.empty()); - EXPECT_EQ(SK_ColorBLUE, bitmap.getColor(0, 0)); - run_loop.Quit(); - })); + icon_manager().ReadIcons( + app_id, {20}, + base::BindLambdaForTesting( + [&](std::map<SquareSizePx, SkBitmap> icon_bitmaps) { + EXPECT_EQ(1u, icon_bitmaps.size()); + EXPECT_FALSE(icon_bitmaps[20].empty()); + EXPECT_EQ(SK_ColorBLUE, icon_bitmaps[20].getColor(0, 0)); + run_loop.Quit(); + })); run_loop.Run(); } @@ -313,7 +326,7 @@ controller().RegisterApp(std::move(web_app)); - EXPECT_FALSE(icon_manager().HasIcon(app_id, 70)); + EXPECT_FALSE(icon_manager().HasSmallestIcon(app_id, 70)); { base::RunLoop run_loop;
diff --git a/chrome/browser/web_applications/web_app_provider_factory.cc b/chrome/browser/web_applications/web_app_provider_factory.cc index 0381720..daf6535 100644 --- a/chrome/browser/web_applications/web_app_provider_factory.cc +++ b/chrome/browser/web_applications/web_app_provider_factory.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/web_applications/web_app_provider_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/sync/model_type_store_service_factory.h" #include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -32,6 +33,7 @@ WebAppProviderBaseFactory::SetInstance(this); DependsOn( extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); + DependsOn(ModelTypeStoreServiceFactory::GetInstance()); } WebAppProviderFactory::~WebAppProviderFactory() {
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 2963b978..1780a246 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -266,20 +266,27 @@ // universal web_app::AppRegistrar) by extensions-based bookmark apps. Note that // the new Desktop PWAs implementation (not based on extensions) always uses the // new browser controller. +// TODO(crbug.com/877898): Enable and delete this feature flag before +// kDesktopPWAsWithoutExtensions launch. const base::Feature kDesktopPWAsUnifiedUiController{ "DesktopPWAsUnifiedUiController", base::FEATURE_DISABLED_BY_DEFAULT}; // Enables or disables use of new Desktop PWAs launch manager by // extensions-based bookmark apps. (Note that Bookmark apps not based // on extensions unconditionally use the new launch manager.) +// TODO(crbug.com/877898): Enable and delete this feature flag before +// kDesktopPWAsWithoutExtensions launch. const base::Feature kDesktopPWAsUnifiedLaunch{ "DesktopPWAsUnifiedLaunch", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enables or disables new Desktop PWAs Unified Sync and Storage (USS) -// implementation that does not use extensions. Requires +// Enables or disables usage of shared LevelDB instance (ModelTypeStoreService). +// If this flag is disabled, the new Web Apps system uses its own isolated +// LevelDB instance for manual testing purposes. Requires // kDesktopPWAsWithoutExtensions to be enabled. -const base::Feature kDesktopPWAsUSS{"DesktopPWAsUSS", - base::FEATURE_DISABLED_BY_DEFAULT}; +// TODO(crbug.com/877898): Delete this feature flag before +// kDesktopPWAsWithoutExtensions launch. +const base::Feature kDesktopPWAsSharedStoreService{ + "DesktopPWAsSharedStoreService", base::FEATURE_ENABLED_BY_DEFAULT}; // Disables downloads of unsafe file types over HTTP. const base::Feature kDisallowUnsafeHttpDownloads{
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index b20960d..99d52f6 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -153,7 +153,7 @@ extern const base::Feature kDesktopPWAsUnifiedLaunch; COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kDesktopPWAsUSS; +extern const base::Feature kDesktopPWAsSharedStoreService; COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kDisallowUnsafeHttpDownloads;
diff --git a/chrome/common/extensions/docs/templates/articles/xhr.html b/chrome/common/extensions/docs/templates/articles/xhr.html index c1ee41b..80a77543 100644 --- a/chrome/common/extensions/docs/templates/articles/xhr.html +++ b/chrome/common/extensions/docs/templates/articles/xhr.html
@@ -243,3 +243,19 @@ adding either the <code>connect-src</code> or <code>default-src</code> directives. </p> + +<h2 id="origin-neither-GET-nor-HEAD">Origin header for requests with neither +GET nor HEAD methods</h2> + +<p>A request with an HTTP method that is neither GET nor HEAD (such as POST) +always has an Origin header, regardless of whether the request is cross-origin. +<span class="availability">Starting from Chrome 80</span>, the origin of +the destination URL, not the extension's security origin, is attached to the +header if all of the following conditions are met: +<ul> +<li>The request is made in a frame with the extension's security origin, such as +the background page, the popup, or an extension tab.</li> +<li>The request has a method that is neither GET nor HEAD.</li> +<li>The extension has cross-origin permission to the destination URL.</li> +</ul> +</p>
diff --git a/chrome/test/data/chromeos/file_manager/id3Audio.mp3 b/chrome/test/data/chromeos/file_manager/id3Audio.mp3 new file mode 100644 index 0000000..61efa2c --- /dev/null +++ b/chrome/test/data/chromeos/file_manager/id3Audio.mp3 Binary files differ
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index 2d9e41a..241d605f 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -1427,7 +1427,7 @@ CrSettingsSiteDataTest.prototype = { __proto__: CrSettingsBrowserTest.prototype, - browsePreload: 'chrome://settings/site_settings/site_data.html', + browsePreload: 'chrome://settings/siteData', extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ '../test_util.js',
diff --git a/chrome/test/data/webui/settings/site_data_test.js b/chrome/test/data/webui/settings/site_data_test.js index d3d426d5d..9701396 100644 --- a/chrome/test/data/webui/settings/site_data_test.js +++ b/chrome/test/data/webui/settings/site_data_test.js
@@ -14,6 +14,7 @@ testBrowserProxy = new TestLocalDataBrowserProxy(); settings.LocalDataBrowserProxyImpl.instance_ = testBrowserProxy; siteData = document.createElement('site-data'); + siteData.filter = ''; }); teardown(function() {
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java index c0d1f93e..8aa8241 100644 --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java
@@ -5,7 +5,7 @@ package org.chromium.chromecast.shell; import org.chromium.base.Consumer; -import org.chromium.base.Supplier; +import org.chromium.base.supplier.Supplier; import org.chromium.base.task.AsyncTask; import org.chromium.chromecast.base.Scope;
diff --git a/chromeos/components/drivefs/drivefs_host.cc b/chromeos/components/drivefs/drivefs_host.cc index 92539cf..4e12239b 100644 --- a/chromeos/components/drivefs/drivefs_host.cc +++ b/chromeos/components/drivefs/drivefs_host.cc
@@ -17,7 +17,6 @@ #include "chromeos/constants/chromeos_features.h" #include "components/drive/drive_notification_manager.h" #include "components/drive/drive_notification_observer.h" -#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/platform/platform_channel_endpoint.h" #include "mojo/public/cpp/system/invitation.h" #include "services/network/public/cpp/network_connection_tracker.h"
diff --git a/chromeos/constants/chromeos_features.cc b/chromeos/constants/chromeos_features.cc index de92ece..2758bf39 100644 --- a/chromeos/constants/chromeos_features.cc +++ b/chromeos/constants/chromeos_features.cc
@@ -51,6 +51,10 @@ const base::Feature kCrostiniBackup{"CrostiniBackup", base::FEATURE_ENABLED_BY_DEFAULT}; +// Enables or disables Crostini port forwarding. +const base::Feature kCrostiniPortForwarding{"CrostiniPortForwarding", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables or disables Crostini using Buster container images. const base::Feature kCrostiniUseBusterImage{"CrostiniUseBusterImage", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chromeos/constants/chromeos_features.h b/chromeos/constants/chromeos_features.h index d6f845a..11565a5 100644 --- a/chromeos/constants/chromeos_features.h +++ b/chromeos/constants/chromeos_features.h
@@ -33,6 +33,8 @@ extern const base::Feature kCameraSystemWebApp; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kCrostiniBackup; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +extern const base::Feature kCrostiniPortForwarding; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kCrostiniUseBusterImage; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kCrostiniGpuSupport;
diff --git a/chromeos/services/assistant/platform/audio_input_impl.h b/chromeos/services/assistant/platform/audio_input_impl.h index cc0acd1..a2b6cbaf 100644 --- a/chromeos/services/assistant/platform/audio_input_impl.h +++ b/chromeos/services/assistant/platform/audio_input_impl.h
@@ -20,7 +20,6 @@ #include "chromeos/services/assistant/public/mojom/assistant.mojom.h" #include "libassistant/shared/public/platform_audio_input.h" #include "media/base/audio_capturer_source.h" -#include "mojo/public/cpp/bindings/binding.h" namespace chromeos { class CrasAudioHandler;
diff --git a/chromeos/services/assistant/platform/audio_output_provider_impl.h b/chromeos/services/assistant/platform/audio_output_provider_impl.h index cfcf0b6..c405a32 100644 --- a/chromeos/services/assistant/platform/audio_output_provider_impl.h +++ b/chromeos/services/assistant/platform/audio_output_provider_impl.h
@@ -19,7 +19,6 @@ #include "chromeos/services/assistant/public/mojom/assistant.mojom.h" #include "chromeos/services/assistant/public/mojom/assistant_audio_decoder.mojom.h" #include "libassistant/shared/public/platform_audio_output.h" -#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/audio/public/mojom/stream_factory.mojom.h"
diff --git a/chromeos/services/secure_channel/single_client_message_proxy.h b/chromeos/services/secure_channel/single_client_message_proxy.h index 1271dc9..92f3790 100644 --- a/chromeos/services/secure_channel/single_client_message_proxy.h +++ b/chromeos/services/secure_channel/single_client_message_proxy.h
@@ -10,7 +10,6 @@ #include "base/macros.h" #include "base/unguessable_token.h" #include "chromeos/services/secure_channel/public/mojom/secure_channel.mojom.h" -#include "mojo/public/cpp/bindings/binding.h" namespace chromeos {
diff --git a/components/autofill_assistant/browser/actions/collect_user_data_action.cc b/components/autofill_assistant/browser/actions/collect_user_data_action.cc index 9c032465..d67a6c1a 100644 --- a/components/autofill_assistant/browser/actions/collect_user_data_action.cc +++ b/components/autofill_assistant/browser/actions/collect_user_data_action.cc
@@ -601,6 +601,14 @@ collect_user_data_options_->billing_postal_code_missing_text.empty()) { return false; } + collect_user_data_options_->credit_card_expired_text = + collect_user_data.credit_card_expired_text(); + // TODO(b/146195295): Remove fallback and enforce non-empty backend string. + if (collect_user_data_options_->credit_card_expired_text.empty()) { + collect_user_data_options_->credit_card_expired_text = + l10n_util::GetStringUTF8( + IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED); + } collect_user_data_options_->request_login_choice = collect_user_data.has_login_details(); collect_user_data_options_->login_section_title.assign(
diff --git a/components/autofill_assistant/browser/actions/collect_user_data_action_unittest.cc b/components/autofill_assistant/browser/actions/collect_user_data_action_unittest.cc index 03d7c33..6fec4c7 100644 --- a/components/autofill_assistant/browser/actions/collect_user_data_action_unittest.cc +++ b/components/autofill_assistant/browser/actions/collect_user_data_action_unittest.cc
@@ -572,6 +572,11 @@ user_data.billing_address->SetRawInfo(autofill::ADDRESS_HOME_ZIP, base::UTF8ToUTF16("B1675")); EXPECT_TRUE(CollectUserDataAction::IsUserDataComplete(user_data, options)); + + // Expired credit card. + user_data.card->SetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR, + base::UTF8ToUTF16("2019")); + EXPECT_FALSE(CollectUserDataAction::IsUserDataComplete(user_data, options)); } TEST_F(CollectUserDataActionTest, UserDataComplete_Terms) {
diff --git a/components/autofill_assistant/browser/service.proto b/components/autofill_assistant/browser/service.proto index 8eeeaee..60d29159 100644 --- a/components/autofill_assistant/browser/service.proto +++ b/components/autofill_assistant/browser/service.proto
@@ -1426,6 +1426,8 @@ // The error message to display when the billing address is missing the // postal code. This field is mandatory if |require_postal_code| is true. optional string billing_postal_code_missing_text = 15; + // The error message to display when the selected credit card is expired. + optional string credit_card_expired_text = 23; // The login details that should be gathered. optional LoginDetailsProto login_details = 16; // The date/time range that should be gathered.
diff --git a/components/autofill_assistant/browser/user_data.h b/components/autofill_assistant/browser/user_data.h index 16070c6..431929e 100644 --- a/components/autofill_assistant/browser/user_data.h +++ b/components/autofill_assistant/browser/user_data.h
@@ -127,6 +127,7 @@ bool require_billing_postal_code = false; std::string billing_postal_code_missing_text; + std::string credit_card_expired_text; // If empty, terms and conditions should not be shown. std::string accept_terms_and_conditions_text;
diff --git a/components/invalidation/impl/BUILD.gn b/components/invalidation/impl/BUILD.gn index e9a992d..06a896ae 100644 --- a/components/invalidation/impl/BUILD.gn +++ b/components/invalidation/impl/BUILD.gn
@@ -198,8 +198,6 @@ "fake_invalidation_state_tracker.h", "fake_invalidator.cc", "fake_invalidator.h", - "fake_system_resources.cc", - "fake_system_resources.h", "invalidation_service_test_template.cc", "invalidation_service_test_template.h", "invalidation_test_util.cc",
diff --git a/components/invalidation/impl/fake_system_resources.cc b/components/invalidation/impl/fake_system_resources.cc deleted file mode 100644 index d8f7b088..0000000 --- a/components/invalidation/impl/fake_system_resources.cc +++ /dev/null
@@ -1,65 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/invalidation/impl/fake_system_resources.h" - -#include "google/cacheinvalidation/deps/string_util.h" -#include "google/cacheinvalidation/include/system-resources.h" - -namespace invalidation { - -FakeSystemResources::FakeSystemResources( - std::unique_ptr<Logger> logger, - std::unique_ptr<NetworkChannel> network, - std::unique_ptr<Storage> storage, - const string& platform) - : logger_(std::move(logger)), - network_(std::move(network)), - storage_(std::move(storage)), - platform_(platform) { - logger_->SetSystemResources(this); - network_->SetSystemResources(this); - storage_->SetSystemResources(this); -} - -FakeSystemResources::~FakeSystemResources() {} - -void FakeSystemResources::Start() { - is_started_ = true; -} - -void FakeSystemResources::Stop() { - CHECK(is_started_) << "cannot stop resources that aren't started"; - is_started_ = false; -} - -bool FakeSystemResources::IsStarted() const { - return is_started_; -} - -Logger* FakeSystemResources::logger() { - return logger_.get(); -} - -Scheduler* FakeSystemResources::internal_scheduler() { - return nullptr; -} - -Scheduler* FakeSystemResources::listener_scheduler() { - return nullptr; -} - -NetworkChannel* FakeSystemResources::network() { - return network_.get(); -} - -Storage* FakeSystemResources::storage() { - return storage_.get(); -} - -string FakeSystemResources::platform() const { - return platform_; -} - -} // namespace invalidation
diff --git a/components/invalidation/impl/fake_system_resources.h b/components/invalidation/impl/fake_system_resources.h deleted file mode 100644 index 7171385..0000000 --- a/components/invalidation/impl/fake_system_resources.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_INVALIDATION_IMPL_FAKE_SYSTEM_RESOURCES_H_ -#define COMPONENTS_INVALIDATION_IMPL_FAKE_SYSTEM_RESOURCES_H_ - -#include "google/cacheinvalidation/include/system-resources.h" -#include "google/cacheinvalidation/include/types.h" - -namespace invalidation { - -class Logger; -class NetworkChannel; -class Scheduler; -class Storage; -class SystemResources; - -class FakeSystemResources : public SystemResources { - public: - FakeSystemResources(std::unique_ptr<Logger> logger, - std::unique_ptr<NetworkChannel> network, - std::unique_ptr<Storage> storage, - const string& platform); - - ~FakeSystemResources() override; - - // Overrides from SystemResources. - void Start() override; - void Stop() override; - bool IsStarted() const override; - - Logger* logger() override; - Scheduler* internal_scheduler() override; - Scheduler* listener_scheduler() override; - NetworkChannel* network() override; - Storage* storage() override; - string platform() const override; - - private: - // Components comprising the system resources. We delegate calls to these as - // appropriate. - std::unique_ptr<Logger> logger_; - std::unique_ptr<NetworkChannel> network_; - std::unique_ptr<Storage> storage_; - - // Information about the client operating system/platform. - string platform_; - bool is_started_ = false; -}; - -} // namespace invalidation - -#endif // COMPONENTS_INVALIDATION_IMPL_FAKE_SYSTEM_RESOURCES_H_
diff --git a/components/password_manager/core/browser/password_manager_util.cc b/components/password_manager/core/browser/password_manager_util.cc index 7907cd9..d0fc224 100644 --- a/components/password_manager/core/browser/password_manager_util.cc +++ b/components/password_manager/core/browser/password_manager_util.cc
@@ -371,10 +371,15 @@ // Only show the opt-in if: // - Sync transport is enabled (i.e. user is signed in, Sync is not disabled // by policy etc) - otherwise there's no point in asking. + // - There is no custom Sync passphrase (Sync transport offers no way to enter + // the passphrase yet). Note that checking this requires the SyncEngine to + // be initialized. // - Sync feature is NOT enabled - Sync feature doesn't depend on this opt-in. // - Not already opted in. return sync_service->GetTransportState() != syncer::SyncService::TransportState::DISABLED && + sync_service->IsEngineInitialized() && + !sync_service->GetUserSettings()->IsUsingSecondaryPassphrase() && !sync_service->IsSyncFeatureEnabled() && !IsOptedInForAccountStorage(pref_service, sync_service); }
diff --git a/components/password_manager_strings.grdp b/components/password_manager_strings.grdp index 1dbb38b..b84df79 100644 --- a/components/password_manager_strings.grdp +++ b/components/password_manager_strings.grdp
@@ -16,13 +16,13 @@ <message name="IDS_CREDENTIAL_LEAK_TITLE_CHECK" desc="The title of the credential leak dialog when the user should check all passwords on passwords.google.com."> Check your passwords </message> - <message name="IDS_CREDENTIAL_LEAK_CHECK_PASSWORDS_MESSAGE" desc="The text that is used in credential leak detection dialog when saved credentials were used on multiple sites."> + <message name="IDS_CREDENTIAL_LEAK_CHECK_PASSWORDS_MESSAGE" desc="The text that is used in credential leak detection dialog when the leaked credentials are saved and used on multiple sites. The leaked credentials may have been leaked by the current website, some other third-party website or even a third-party app used by the user. It could also be coincidental reuse of a trivial password used by some other users in the world and exposed in a public leak."> A data breach on a site or app exposed your password. Chrome recommends checking your saved passwords now. </message> - <message name="IDS_CREDENTIAL_LEAK_CHANGE_PASSWORD_MESSAGE" desc="The text that is used in credential leak detection dialog when credentials were leaked on current site only."> + <message name="IDS_CREDENTIAL_LEAK_CHANGE_PASSWORD_MESSAGE" desc="The text that is used in credential leak detection dialog when the leaked credentials are not saved for other sites or the user isn't syncing passwords. The leaked credentials may have been leaked by the current website, some other third-party website or even a third-party app used by the user. It could also be coincidental reuse of a trivial password used by some other users in the world and exposed in a public leak."> A data breach on a site or app exposed your password. Chrome recommends changing your password on <ph name="ORIGIN">$1<ex>example.com</ex></ph> now. </message> - <message name="IDS_CREDENTIAL_LEAK_CHANGE_AND_CHECK_PASSWORDS_MESSAGE" desc="The text that is used in credential leak detection dialog when credentials were not saved in chrome, but used on multiple sites."> + <message name="IDS_CREDENTIAL_LEAK_CHANGE_AND_CHECK_PASSWORDS_MESSAGE" desc="The text that is used in credential leak detection dialog when the leaked credentials were not saved but used on multiple sites. The leaked credentials may have been leaked by the current website, some other third-party website or even a third-party app used by the user. It could also be coincidental reuse of a trivial password used by some other users in the world and exposed in a public leak."> A data breach on a site or app exposed your password. Chrome recommends checking your saved passwords and changing your password on <ph name="ORIGIN">$1<ex>example.com</ex></ph> now. </message> <message name="IDS_PASSWORD_MANAGER_LEAK_HELP_MESSAGE" desc="The text is shown in a popup that explains to the user why they are seeing a warning about leaked passwords. This is a stand-alone string and the only content of the popup dialog.">
diff --git a/components/sessions/core/tab_restore_service_client.h b/components/sessions/core/tab_restore_service_client.h index f9388fe9..a3beea6 100644 --- a/components/sessions/core/tab_restore_service_client.h +++ b/components/sessions/core/tab_restore_service_client.h
@@ -32,8 +32,8 @@ // Callback from TabRestoreServiceClient::GetLastSession. // The second parameter is the id of the window that was last active. using GetLastSessionCallback = - base::Callback<void(std::vector<std::unique_ptr<SessionWindow>>, - SessionID)>; + base::OnceCallback<void(std::vector<std::unique_ptr<SessionWindow>>, + SessionID)>; // A client interface that needs to be supplied to the tab restore service by // the embedder. @@ -78,7 +78,7 @@ // Fetches the contents of the last session, notifying the callback when // done. If the callback is supplied an empty vector of SessionWindows // it means the session could not be restored. - virtual void GetLastSession(const GetLastSessionCallback& callback, + virtual void GetLastSession(GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) = 0; // Called when a tab is restored. |url| is the URL that the tab is currently
diff --git a/content/browser/appcache/appcache_subresource_url_factory.cc b/content/browser/appcache/appcache_subresource_url_factory.cc index 1ff6e9d..99297738 100644 --- a/content/browser/appcache/appcache_subresource_url_factory.cc +++ b/content/browser/appcache/appcache_subresource_url_factory.cc
@@ -396,7 +396,7 @@ // Subresource requests from renderer processes should not be allowed to use // network::mojom::FetchRequestMode::kNavigate. - if (network::IsNavigationRequestMode(request.mode)) { + if (request.mode == network::mojom::RequestMode::kNavigate) { mojo::ReportBadMessage("APPCACHE_SUBRESOURCE_URL_FACTORY_NAVIGATE"); return; }
diff --git a/content/browser/back_forward_cache_browsertest.cc b/content/browser/back_forward_cache_browsertest.cc index 6c8196f7..8906b42 100644 --- a/content/browser/back_forward_cache_browsertest.cc +++ b/content/browser/back_forward_cache_browsertest.cc
@@ -1678,6 +1678,40 @@ FROM_HERE); } +IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, DoesNotCacheIfWebHID) { + ASSERT_TRUE(embedded_test_server()->Start()); + + // Navigate to an empty page. + GURL url(embedded_test_server()->GetURL("/title1.html")); + EXPECT_TRUE(NavigateToURL(shell(), url)); + + // Request for HID devices. + EXPECT_EQ("success", EvalJs(current_frame_host(), R"( + new Promise(resolve => { + navigator.hid.getDevices() + .then(m => { resolve("success"); }) + .catch(() => { resolve("error"); }); + }); + )")); + + RenderFrameDeletedObserver deleted(current_frame_host()); + + // 2) Navigate away. + shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title1.html")); + + // The page uses WebHID so it should be deleted. + deleted.WaitUntilDeleted(); + + // 3) Go back. + web_contents()->GetController().GoBack(); + EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); + ExpectNotRestored( + {BackForwardCacheMetrics::NotRestoredReason::kBlocklistedFeatures}, + FROM_HERE); + ExpectBlocklistedFeature( + blink::scheduler::WebSchedulerTrackedFeature::kWebHID, FROM_HERE); +} + IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, DoesNotCacheIfHttpError) { ASSERT_TRUE(embedded_test_server()->Start());
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index f1563004..7f530ca 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -320,7 +320,6 @@ void (RenderProcessHost::*method)(Args...), Args... args) { DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); - DCHECK(host->IsProviderForServiceWorker()); content::RunOrPostTaskOnThread( FROM_HERE, BrowserThread::UI, base::BindOnce(
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.cc b/content/browser/browsing_data/browsing_data_remover_impl.cc index a0824f47..f115e243 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl.cc
@@ -130,9 +130,11 @@ // TODO(bauerb): If it becomes a problem that browsing data might not actually // be fully cleared when an observer is notified, add a success flag. while (!task_queue_.empty()) { - if (observer_list_.HasObserver(task_queue_.front().observer)) - task_queue_.front().observer->OnBrowsingDataRemoverDone(); - task_queue_.pop(); + for (Observer* observer : task_queue_.front().observers) { + if (observer_list_.HasObserver(observer)) + observer->OnBrowsingDataRemoverDone(); + } + task_queue_.pop_front(); } } @@ -220,8 +222,20 @@ DCHECK(filter_builder->IsEmptyBlacklist()); } - task_queue_.emplace(delete_begin, delete_end, remove_mask, origin_type_mask, - std::move(filter_builder), observer); + RemovalTask task(delete_begin, delete_end, remove_mask, origin_type_mask, + std::move(filter_builder), observer); + + // If there is an identical deletion task that is not already running, + // we don't have to perform the deletion twice. + for (size_t i = 1; i < task_queue_.size(); i++) { + if (task_queue_[i].IsSameDeletion(task)) { + if (observer) + task_queue_[i].observers.push_back(observer); + return; + } + } + + task_queue_.push_back(std::move(task)); // If this is the only scheduled task, execute it immediately. Otherwise, // it will be automatically executed when all tasks scheduled before it @@ -538,13 +552,23 @@ delete_end(delete_end), remove_mask(remove_mask), origin_type_mask(origin_type_mask), - filter_builder(std::move(filter_builder)), - observer(observer) {} + filter_builder(std::move(filter_builder)) { + if (observer) + observers.push_back(observer); +} BrowsingDataRemoverImpl::RemovalTask::RemovalTask( RemovalTask&& other) noexcept = default; -BrowsingDataRemoverImpl::RemovalTask::~RemovalTask() {} +BrowsingDataRemoverImpl::RemovalTask::~RemovalTask() = default; + +bool BrowsingDataRemoverImpl::RemovalTask::IsSameDeletion( + const RemovalTask& other) { + return delete_begin == other.delete_begin && delete_end == other.delete_end && + remove_mask == other.remove_mask && + origin_type_mask == other.origin_type_mask && + *filter_builder == *other.filter_builder; +} void BrowsingDataRemoverImpl::Notify() { // Some tests call |RemoveImpl| directly, without using the task scheduler. @@ -562,8 +586,10 @@ DCHECK(!task_queue_.empty()); const RemovalTask& task = task_queue_.front(); - if (task.observer != nullptr && observer_list_.HasObserver(task.observer)) { - task.observer->OnBrowsingDataRemoverDone(); + for (Observer* observer : task.observers) { + if (observer_list_.HasObserver(observer)) { + observer->OnBrowsingDataRemoverDone(); + } } if (task.filter_builder->GetMode() == BrowsingDataFilterBuilder::BLACKLIST) { base::TimeDelta delta = base::Time::Now() - task.task_started; @@ -579,7 +605,7 @@ } } - task_queue_.pop(); + task_queue_.pop_front(); if (task_queue_.empty()) { // All removal tasks have finished. Inform the observers that we're idle.
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.h b/content/browser/browsing_data/browsing_data_remover_impl.h index 6984b7c1..6340925 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl.h +++ b/content/browser/browsing_data/browsing_data_remover_impl.h
@@ -97,6 +97,7 @@ private: // Testing the private RemovalTask. FRIEND_TEST_ALL_PREFIXES(BrowsingDataRemoverImplTest, MultipleTasks); + FRIEND_TEST_ALL_PREFIXES(BrowsingDataRemoverImplTest, MultipleIdenticalTasks); // For debugging purposes. Please add new deletion tasks at the end. // This enum is recorded in a histogram, so don't change or reuse ids. @@ -129,12 +130,16 @@ RemovalTask(RemovalTask&& other) noexcept; ~RemovalTask(); + // Returns true if the deletion parameters are equal. + // Does not compare |observer| and |task_started|. + bool IsSameDeletion(const RemovalTask& other); + base::Time delete_begin; base::Time delete_end; int remove_mask; int origin_type_mask; std::unique_ptr<BrowsingDataFilterBuilder> filter_builder; - Observer* observer; + std::vector<Observer*> observers; base::Time task_started; }; @@ -207,7 +212,7 @@ bool is_removing_; // Removal tasks to be processed. - base::queue<RemovalTask> task_queue_; + std::deque<RemovalTask> task_queue_; // If non-null, the |would_complete_callback_| is called each time an instance // is about to complete a browsing data removal process, and has the ability
diff --git a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc index 9c99db7..6a8dc59 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc
@@ -161,8 +161,8 @@ class StoragePartitionRemovalTestStoragePartition : public TestStoragePartition { public: - StoragePartitionRemovalTestStoragePartition() {} - ~StoragePartitionRemovalTestStoragePartition() override {} + StoragePartitionRemovalTestStoragePartition() = default; + ~StoragePartitionRemovalTestStoragePartition() override = default; void ClearDataForOrigin(uint32_t remove_mask, uint32_t quota_storage_remove_mask, @@ -181,11 +181,7 @@ storage_partition_removal_data_.remove_begin = begin; storage_partition_removal_data_.remove_end = end; - base::PostTask( - FROM_HERE, {BrowserThread::UI}, - base::BindOnce( - &StoragePartitionRemovalTestStoragePartition::AsyncRunCallback, - base::Unretained(this), std::move(callback))); + base::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(callback)); } void ClearData(uint32_t remove_mask, @@ -206,11 +202,7 @@ storage_partition_removal_data_.cookie_deletion_filter = std::move(cookie_deletion_filter); - base::PostTask( - FROM_HERE, {BrowserThread::UI}, - base::BindOnce( - &StoragePartitionRemovalTestStoragePartition::AsyncRunCallback, - base::Unretained(this), std::move(callback))); + base::PostTask(FROM_HERE, {BrowserThread::UI}, std::move(callback)); } void ClearCodeCaches( @@ -229,10 +221,6 @@ } private: - void AsyncRunCallback(base::OnceClosure callback) { - std::move(callback).Run(); - } - StoragePartitionRemovalData storage_partition_removal_data_; DISALLOW_COPY_AND_ASSIGN(StoragePartitionRemovalTestStoragePartition); @@ -257,9 +245,8 @@ const base::RepeatingCallback<bool(const GURL&)>& filter) : to_match_(filter) {} - virtual bool MatchAndExplain( - const base::RepeatingCallback<bool(const GURL&)>& filter, - MatchResultListener* listener) const { + bool MatchAndExplain(const base::RepeatingCallback<bool(const GURL&)>& filter, + MatchResultListener* listener) const override { if (!filter && !to_match_) return true; if (!filter || !to_match_) @@ -277,11 +264,11 @@ return true; } - virtual void DescribeTo(::std::ostream* os) const { + void DescribeTo(::std::ostream* os) const override { *os << "is probably the same url filter as " << &to_match_; } - virtual void DescribeNegationTo(::std::ostream* os) const { + void DescribeNegationTo(::std::ostream* os) const override { *os << "is definitely NOT the same url filter as " << &to_match_; } @@ -318,7 +305,7 @@ EXPECT_CALL(*download_manager_, Shutdown()); } - ~RemoveDownloadsTester() {} + ~RemoveDownloadsTester() = default; MockDownloadManager* download_manager() { return download_manager_; } @@ -337,7 +324,7 @@ BrowserContext::GetBrowsingDataRemover(browser_context_.get())); } - ~BrowsingDataRemoverImplTest() override {} + ~BrowsingDataRemoverImplTest() override = default; void TearDown() override { mock_policy_ = nullptr; @@ -1106,7 +1093,7 @@ public: explicit InspectableCompletionObserver(BrowsingDataRemover* remover) : BrowsingDataRemoverCompletionObserver(remover) {} - ~InspectableCompletionObserver() override {} + ~InspectableCompletionObserver() override = default; bool called() { return called_; } @@ -1236,10 +1223,10 @@ : parent_(parent), observer_(this) { observer_.Add(remover); } - ~Target() override {} + ~Target() override = default; void OnBrowsingDataRemoverDone() override { - parent_->SetLastCalledTarget(this); + parent_->last_called_targets_.push_back(this); } private: @@ -1249,28 +1236,23 @@ }; explicit MultipleTasksObserver(BrowsingDataRemover* remover) - : target_a_(this, remover), - target_b_(this, remover), - last_called_target_(nullptr) {} - ~MultipleTasksObserver() {} + : target_a_(this, remover), target_b_(this, remover) {} + ~MultipleTasksObserver() = default; - void ClearLastCalledTarget() { last_called_target_ = nullptr; } + void ClearLastCalledTarget() { last_called_targets_.clear(); } - Target* GetLastCalledTarget() { return last_called_target_; } + const std::vector<BrowsingDataRemover::Observer*> GetLastCalledTargets() { + return last_called_targets_; + } Target* target_a() { return &target_a_; } Target* target_b() { return &target_b_; } private: - void SetLastCalledTarget(Target* target) { - DCHECK(!last_called_target_) - << "Call ClearLastCalledTarget() before every removal task."; - last_called_target_ = target; - } Target target_a_; Target target_b_; - Target* last_called_target_; + std::vector<BrowsingDataRemover::Observer*> last_called_targets_; }; TEST_F(BrowsingDataRemoverImplTest, MultipleTasks) { @@ -1317,21 +1299,22 @@ // that is a private method, we must call the four public versions of // Remove.* instead. This also serves as a test that those methods are all // correctly reduced to RemoveInternal(). - if (!task.observer && task.filter_builder->IsEmptyBlacklist()) { + if (task.observers.empty() && task.filter_builder->IsEmptyBlacklist()) { remover->Remove(task.delete_begin, task.delete_end, task.remove_mask, task.origin_type_mask); } else if (task.filter_builder->IsEmptyBlacklist()) { remover->RemoveAndReply(task.delete_begin, task.delete_end, task.remove_mask, task.origin_type_mask, - task.observer); - } else if (!task.observer) { + task.observers[0]); + } else if (task.observers.empty()) { remover->RemoveWithFilter(task.delete_begin, task.delete_end, task.remove_mask, task.origin_type_mask, std::move(task.filter_builder)); } else { - remover->RemoveWithFilterAndReply( - task.delete_begin, task.delete_end, task.remove_mask, - task.origin_type_mask, std::move(task.filter_builder), task.observer); + remover->RemoveWithFilterAndReply(task.delete_begin, task.delete_end, + task.remove_mask, task.origin_type_mask, + std::move(task.filter_builder), + task.observers[0]); } } @@ -1346,7 +1329,7 @@ // Observers, if any, should have been called by now (since we call // observers on the same thread). - EXPECT_EQ(task.observer, observer.GetLastCalledTarget()); + EXPECT_EQ(task.observers, observer.GetLastCalledTargets()); // TODO(msramek): If BrowsingDataRemover took ownership of the last used // filter builder and exposed it, we could also test it here. Make it so. @@ -1361,11 +1344,60 @@ RunAllTasksUntilIdle(); } -// The previous test, BrowsingDataRemoverTest.MultipleTasks, tests that the -// tasks are not mixed up and they are executed in a correct order. However, -// the completion inhibitor kept synchronizing the execution in order to verify -// the parameters. This test demonstrates that even running the tasks without -// inhibition is executed correctly and doesn't crash. +// Scheduling multiple identical deletions should immediately execute the first +// deletion and merge all following deletions. +TEST_F(BrowsingDataRemoverImplTest, MultipleIdenticalTasks) { + BrowsingDataRemoverImpl* remover = static_cast<BrowsingDataRemoverImpl*>( + BrowserContext::GetBrowsingDataRemover(GetBrowserContext())); + EXPECT_FALSE(remover->is_removing()); + + std::unique_ptr<BrowsingDataFilterBuilder> filter_builder( + BrowsingDataFilterBuilder::Create(BrowsingDataFilterBuilder::WHITELIST)); + filter_builder->AddRegisterableDomain("example.com"); + + MultipleTasksObserver observer(remover); + BrowsingDataRemoverCompletionInhibitor completion_inhibitor(remover); + + std::list<BrowsingDataRemoverImpl::RemovalTask> tasks; + for (int i = 0; i < 10; i++) { + remover->RemoveWithFilterAndReply( + base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, + BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB, + BrowsingDataFilterBuilder::Create(BrowsingDataFilterBuilder::BLACKLIST), + observer.target_a()); + } + + EXPECT_TRUE(remover->is_removing()); + observer.ClearLastCalledTarget(); + + // Finish the task execution synchronously. + completion_inhibitor.BlockUntilNearCompletion(); + completion_inhibitor.ContinueToCompletion(); + + // Expect the first observer to be called. + EXPECT_EQ(1u, observer.GetLastCalledTargets().size()); + + EXPECT_TRUE(remover->is_removing()); + observer.ClearLastCalledTarget(); + + // Finish the task execution synchronously. + completion_inhibitor.BlockUntilNearCompletion(); + completion_inhibitor.ContinueToCompletion(); + + // Expect the remaining observer to be called by a batched deletion. + EXPECT_EQ(9u, observer.GetLastCalledTargets().size()); + + EXPECT_FALSE(remover->is_removing()); + + // Run clean up tasks. + RunAllTasksUntilIdle(); +} + +// BrowsingDataRemoverTest.MultipleTasks, tests that the tasks are not mixed up +// and they are executed in a correct order. However, the completion inhibitor +// kept synchronizing the execution in order to verify the parameters. +// This test demonstrates that even running the tasks without inhibition is +// executed correctly and doesn't crash. TEST_F(BrowsingDataRemoverImplTest, MultipleTasksInQuickSuccession) { BrowsingDataRemoverImpl* remover = static_cast<BrowsingDataRemoverImpl*>( BrowserContext::GetBrowsingDataRemover(GetBrowserContext()));
diff --git a/content/browser/frame_host/back_forward_cache_impl.cc b/content/browser/frame_host/back_forward_cache_impl.cc index eec411c2..6417dcb27 100644 --- a/content/browser/frame_host/back_forward_cache_impl.cc +++ b/content/browser/frame_host/back_forward_cache_impl.cc
@@ -127,7 +127,8 @@ FeatureToBit(WebSchedulerTrackedFeature::kWebXR) | FeatureToBit(WebSchedulerTrackedFeature::kSharedWorker) | FeatureToBit(WebSchedulerTrackedFeature::kWebXR) | - FeatureToBit(WebSchedulerTrackedFeature::kWebLocks); + FeatureToBit(WebSchedulerTrackedFeature::kWebLocks) | + FeatureToBit(WebSchedulerTrackedFeature::kWebHID); uint64_t result = kAlwaysDisallowedFeatures;
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc index 3bb71d4..78b8ba9 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -159,7 +159,6 @@ IPC_BEGIN_MESSAGE_MAP(RenderFrameProxyHost, msg) IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) - IPC_MESSAGE_HANDLER(FrameHostMsg_CheckCompleted, OnCheckCompleted) IPC_MESSAGE_HANDLER(FrameHostMsg_RouteMessageEvent, OnRouteMessageEvent) IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeOpener, OnDidChangeOpener) IPC_MESSAGE_HANDLER(FrameHostMsg_AdvanceFocus, OnAdvanceFocus) @@ -404,7 +403,7 @@ std::move(blob_url_loader_factory), params.user_gesture); } -void RenderFrameProxyHost::OnCheckCompleted() { +void RenderFrameProxyHost::CheckCompleted() { RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host(); target_rfh->GetAssociatedLocalFrame()->CheckCompleted(); }
diff --git a/content/browser/frame_host/render_frame_proxy_host.h b/content/browser/frame_host/render_frame_proxy_host.h index bcbd9482..ea41cfa 100644 --- a/content/browser/frame_host/render_frame_proxy_host.h +++ b/content/browser/frame_host/render_frame_proxy_host.h
@@ -143,12 +143,12 @@ void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override; void VisibilityChanged(blink::mojom::FrameVisibility visibility) override; void DidFocusFrame() override; + void CheckCompleted() override; private: // IPC Message handlers. void OnDetach(); void OnOpenURL(const FrameHostMsg_OpenURL_Params& params); - void OnCheckCompleted(); void OnRouteMessageEvent(const FrameMsg_PostMessage_Params& params); void OnDidChangeOpener(int32_t opener_routing_id); void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id);
diff --git a/content/browser/loader/file_url_loader_factory.cc b/content/browser/loader/file_url_loader_factory.cc index 9be5cbf..fc0ca8f2 100644 --- a/content/browser/loader/file_url_loader_factory.cc +++ b/content/browser/loader/file_url_loader_factory.cc
@@ -152,7 +152,7 @@ bool is_allowed_access) { // Though file:// is out of web standards, let's roughly follow the step 5 of // https://fetch.spec.whatwg.org/#main-fetch. - if (is_allowed_access || network::IsNavigationRequestMode(mode) || + if (is_allowed_access || mode == network::mojom::RequestMode::kNavigate || mode == network::mojom::RequestMode::kSameOrigin) { return network::mojom::FetchResponseType::kBasic; } else if (mode == network::mojom::RequestMode::kNoCors) {
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 269083b..a2c47a3 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -250,58 +250,43 @@ new_request->report_raw_headers = request_info->report_raw_headers; new_request->has_user_gesture = request_info->common_params->has_user_gesture; new_request->enable_load_timing = true; + new_request->mode = network::mojom::RequestMode::kNavigate; FrameTreeNode* frame_tree_node = FrameTreeNode::GloballyFindByID(frame_tree_node_id); if (request_info->is_main_frame) { - // `<portal>` acts like a top-level navigation, but we want to represent it - // as a nested navigation for the purposes of security checks like - // `Sec-Fetch-Mode`. - new_request->mode = + new_request->destination = frame_tree_node && WebContentsImpl::FromFrameTreeNode(frame_tree_node)->IsPortal() - ? network::mojom::RequestMode::kNavigateNestedFrame - : network::mojom::RequestMode::kNavigate; + ? network::mojom::RequestDestination::kIframe + : network::mojom::RequestDestination::kDocument; } else { - new_request->mode = network::mojom::RequestMode::kNavigateNestedFrame; - if (frame_tree_node && (frame_tree_node->frame_owner_element_type() == - blink::FrameOwnerElementType::kObject || - frame_tree_node->frame_owner_element_type() == - blink::FrameOwnerElementType::kEmbed)) { - new_request->mode = network::mojom::RequestMode::kNavigateNestedObject; + if (frame_tree_node) { + switch (frame_tree_node->frame_owner_element_type()) { + case blink::FrameOwnerElementType::kObject: + new_request->destination = + network::mojom::RequestDestination::kObject; + break; + case blink::FrameOwnerElementType::kEmbed: + new_request->destination = network::mojom::RequestDestination::kEmbed; + break; + case blink::FrameOwnerElementType::kIframe: + new_request->destination = + network::mojom::RequestDestination::kIframe; + break; + case blink::FrameOwnerElementType::kFrame: + new_request->destination = network::mojom::RequestDestination::kFrame; + break; + case blink::FrameOwnerElementType::kPortal: + case blink::FrameOwnerElementType::kNone: + NOTREACHED(); + break; + } + } else { + new_request->destination = network::mojom::RequestDestination::kDocument; } } - if (frame_tree_node) { - switch (frame_tree_node->frame_owner_element_type()) { - case blink::FrameOwnerElementType::kNone: - new_request->destination = - network::mojom::RequestDestination::kDocument; - break; - case blink::FrameOwnerElementType::kObject: - new_request->destination = network::mojom::RequestDestination::kObject; - break; - case blink::FrameOwnerElementType::kEmbed: - new_request->destination = network::mojom::RequestDestination::kEmbed; - break; - case blink::FrameOwnerElementType::kIframe: - new_request->destination = network::mojom::RequestDestination::kIframe; - break; - case blink::FrameOwnerElementType::kFrame: - new_request->destination = network::mojom::RequestDestination::kFrame; - break; - case blink::FrameOwnerElementType::kPortal: - // TODO(mkwst): "Portal"'s destination isn't actually defined at the - // moment. Let's assume it'll be similar to a frame until we decide - // otherwise. - // https://github.com/w3c/webappsec-fetch-metadata/issues/46 - new_request->destination = network::mojom::RequestDestination::kIframe; - break; - } - } else { - new_request->destination = network::mojom::RequestDestination::kDocument; - } - if (ui::PageTransitionIsWebTriggerable( request_info->common_params->transition)) { new_request->trusted_params->has_user_activation =
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc index e7aa4b5..51b8dcc 100644 --- a/content/browser/service_worker/embedded_worker_instance.cc +++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -26,6 +26,7 @@ #include "content/browser/service_worker/service_worker_content_settings_proxy_impl.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" +#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_script_loader_factory.h" #include "content/browser/url_loader_factory_getter.h" #include "content/browser/url_loader_factory_params_helper.h"
diff --git a/content/browser/service_worker/embedded_worker_instance_unittest.cc b/content/browser/service_worker/embedded_worker_instance_unittest.cc index 41f13b7..ad5da71b 100644 --- a/content/browser/service_worker/embedded_worker_instance_unittest.cc +++ b/content/browser/service_worker/embedded_worker_instance_unittest.cc
@@ -173,8 +173,9 @@ scoped_refptr<ServiceWorkerVersion> version) { auto provider_info = blink::mojom::ServiceWorkerProviderInfoForStartWorker::New(); - version->provider_host_ = ServiceWorkerProviderHost::CreateForServiceWorker( - context()->AsWeakPtr(), version, &provider_info); + version->provider_host_ = std::make_unique<ServiceWorkerProviderHost>( + provider_info->host_remote.InitWithNewEndpointAndPassReceiver(), + version, context()->AsWeakPtr()); return provider_info; }
diff --git a/content/browser/service_worker/fake_embedded_worker_instance_client.cc b/content/browser/service_worker/fake_embedded_worker_instance_client.cc index f6f1633..0302b50 100644 --- a/content/browser/service_worker/fake_embedded_worker_instance_client.cc +++ b/content/browser/service_worker/fake_embedded_worker_instance_client.cc
@@ -29,7 +29,7 @@ receiver) { receiver_.Bind(std::move(receiver)); receiver_.set_disconnect_handler( - base::BindOnce(&FakeEmbeddedWorkerInstanceClient::OnConnectionError, + base::BindOnce(&FakeEmbeddedWorkerInstanceClient::CallOnConnectionError, base::Unretained(this))); if (quit_closure_for_bind_) @@ -46,7 +46,7 @@ void FakeEmbeddedWorkerInstanceClient::Disconnect() { receiver_.reset(); - OnConnectionError(); + CallOnConnectionError(); } void FakeEmbeddedWorkerInstanceClient::StartWorker( @@ -105,7 +105,7 @@ // Destroys |this|. This matches the production implementation, which // calls OnStopped() from the worker thread and then posts task // to the EmbeddedWorkerInstanceClient to have it self-destruct. - OnConnectionError(); + CallOnConnectionError(); } void FakeEmbeddedWorkerInstanceClient::ResumeAfterDownload() { @@ -126,6 +126,11 @@ helper_->RemoveInstanceClient(this); } +void FakeEmbeddedWorkerInstanceClient::CallOnConnectionError() { + // Call OnConnectionError(), which subclasses can override. + OnConnectionError(); +} + void FakeEmbeddedWorkerInstanceClient::EvaluateScript() { host_->OnScriptEvaluationStart(); host_->OnStarted(blink::mojom::ServiceWorkerStartStatus::kNormalCompletion,
diff --git a/content/browser/service_worker/fake_embedded_worker_instance_client.h b/content/browser/service_worker/fake_embedded_worker_instance_client.h index db345fe..ab533b3 100644 --- a/content/browser/service_worker/fake_embedded_worker_instance_client.h +++ b/content/browser/service_worker/fake_embedded_worker_instance_client.h
@@ -57,9 +57,11 @@ return start_params_; } - void OnConnectionError(); + virtual void OnConnectionError(); private: + void CallOnConnectionError(); + // |helper_| owns |this|. EmbeddedWorkerTestHelper* const helper_;
diff --git a/content/browser/service_worker/service_worker_container_host.cc b/content/browser/service_worker/service_worker_container_host.cc index ee0935f..ed112ac 100644 --- a/content/browser/service_worker/service_worker_container_host.cc +++ b/content/browser/service_worker/service_worker_container_host.cc
@@ -16,6 +16,7 @@ #include "content/public/common/content_client.h" #include "content/public/common/origin_util.h" #include "mojo/public/cpp/bindings/callback_helpers.h" +#include "third_party/blink/public/common/features.h" namespace content { @@ -75,6 +76,67 @@ DISALLOW_COPY_AND_ASSIGN(PendingUpdateVersion); }; +// static +base::WeakPtr<ServiceWorkerContainerHost> +ServiceWorkerContainerHost::CreateForWindow( + base::WeakPtr<ServiceWorkerContextCore> context, + bool are_ancestors_secure, + int frame_tree_node_id, + mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> + host_receiver, + mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> + container_remote) { + DCHECK(context); + auto container_host = std::make_unique<ServiceWorkerContainerHost>( + blink::mojom::ServiceWorkerProviderType::kForWindow, are_ancestors_secure, + frame_tree_node_id, std::move(host_receiver), std::move(container_remote), + context); + + std::string client_uuid = container_host->client_uuid(); + base::WeakPtr<ServiceWorkerContainerHost> weak_ptr = + container_host->GetWeakPtr(); + context->RegisterContainerHostByClientID(client_uuid, + std::move(container_host)); + DCHECK(weak_ptr->receiver_.is_bound()); + weak_ptr->receiver_.set_disconnect_handler(base::BindOnce( + &ServiceWorkerContextCore::UnregisterContainerHostByClientID, context, + client_uuid)); + return weak_ptr; +} + +// static +base::WeakPtr<ServiceWorkerContainerHost> +ServiceWorkerContainerHost::CreateForWebWorker( + base::WeakPtr<ServiceWorkerContextCore> context, + int process_id, + blink::mojom::ServiceWorkerProviderType provider_type, + mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> + host_receiver, + mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> + container_remote) { + DCHECK(context); + using ServiceWorkerProviderType = blink::mojom::ServiceWorkerProviderType; + DCHECK((base::FeatureList::IsEnabled(blink::features::kPlzDedicatedWorker) && + provider_type == ServiceWorkerProviderType::kForDedicatedWorker) || + provider_type == ServiceWorkerProviderType::kForSharedWorker); + auto container_host = std::make_unique<ServiceWorkerContainerHost>( + provider_type, /*is_parent_frame_secure=*/true, + FrameTreeNode::kFrameTreeNodeInvalidId, std::move(host_receiver), + std::move(container_remote), context); + container_host->SetContainerProcessId(process_id); + + std::string client_uuid = container_host->client_uuid(); + base::WeakPtr<ServiceWorkerContainerHost> weak_ptr = + container_host->GetWeakPtr(); + context->RegisterContainerHostByClientID(client_uuid, + std::move(container_host)); + DCHECK(weak_ptr->receiver_.is_bound()); + weak_ptr->receiver_.set_disconnect_handler(base::BindOnce( + &ServiceWorkerContextCore::UnregisterContainerHostByClientID, context, + client_uuid)); + return weak_ptr; +} + ServiceWorkerContainerHost::ServiceWorkerContainerHost( blink::mojom::ServiceWorkerProviderType type, bool is_parent_frame_secure, @@ -83,7 +145,6 @@ host_receiver, mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> container_remote, - ServiceWorkerProviderHost* service_worker_host, base::WeakPtr<ServiceWorkerContextCore> context) : type_(type), create_time_(base::TimeTicks::Now()), @@ -96,7 +157,6 @@ frame_tree_node_id)), client_uuid_(IsContainerForClient() ? base::GenerateGUID() : std::string()), - service_worker_host_(service_worker_host), context_(std::move(context)) { DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK(context_); @@ -105,13 +165,10 @@ receiver_.Bind(std::move(host_receiver)); if (IsContainerForClient()) { - DCHECK(!service_worker_host_); DCHECK(container_remote); container_.Bind(std::move(container_remote)); - context_->RegisterContainerHostByClientID(client_uuid(), this); } else { DCHECK(IsContainerForServiceWorker()); - DCHECK(service_worker_host_); } } @@ -133,12 +190,8 @@ if (fetch_request_window_id_) FrameTreeNodeIdRegistry::GetInstance()->Remove(fetch_request_window_id_); - if (IsContainerForClient()) { - if (context_) - context_->UnregisterContainerHostByClientID(client_uuid()); - if (controller_) - controller_->OnControlleeDestroyed(client_uuid()); - } + if (IsContainerForClient() && controller_) + controller_->OnControlleeDestroyed(client_uuid()); // Remove |this| as an observer of ServiceWorkerRegistrations. // TODO(falken): Use ScopedObserver instead of this explicit call. @@ -777,11 +830,16 @@ SetControllerRegistration(nullptr, false /* notify_controllerchange */); // Set UUID to the new one. - if (context_) - context_->UnregisterContainerHostByClientID(client_uuid()); + std::string previous_client_uuid = client_uuid_; client_uuid_ = base::GenerateGUID(); - if (context_) - context_->RegisterContainerHostByClientID(client_uuid(), this); + if (context_) { + context_->UpdateContainerHostClientID(previous_client_uuid, client_uuid_); + // Update the disconnect handler, too. + DCHECK(receiver_.is_bound()); + receiver_.set_disconnect_handler(base::BindOnce( + &ServiceWorkerContextCore::UnregisterContainerHostByClientID, + context_, client_uuid_)); + } } SyncMatchingRegistrations(); @@ -948,6 +1006,14 @@ return controller_registration_.get(); } +void ServiceWorkerContainerHost::set_service_worker_host( + ServiceWorkerProviderHost* service_worker_host) { + DCHECK(IsContainerForServiceWorker()); + DCHECK(!service_worker_host_); + DCHECK(service_worker_host); + service_worker_host_ = service_worker_host; +} + ServiceWorkerProviderHost* ServiceWorkerContainerHost::service_worker_host() { DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK(IsContainerForServiceWorker());
diff --git a/content/browser/service_worker/service_worker_container_host.h b/content/browser/service_worker/service_worker_container_host.h index 682a1a09..c5af9197 100644 --- a/content/browser/service_worker/service_worker_container_host.h +++ b/content/browser/service_worker/service_worker_container_host.h
@@ -39,22 +39,46 @@ class WebContents; struct ServiceWorkerRegistrationInfo; -// ServiceWorkerContainerHost has a 1:1 correspondence to -// blink::ServiceWorkerContainer (i.e., navigator.serviceWorker) in the renderer -// process. +// ServiceWorkerContainerHost is the host of a service worker client (a window, +// dedicated worker, or shared worker) or service worker execution context in +// the renderer process. // -// ServiceWorkerContainerHost manages service worker JavaScript objects and -// service worker registration JavaScript objects, which are represented as -// ServiceWorkerObjectHost and ServiceWorkerRegistrationObjectHost respectively -// in the browser process, associated with the execution context where the -// container lives. +// Most of its functionality helps implement the web-exposed +// ServiceWorkerContainer interface (navigator.serviceWorker). The long-term +// goal is for it to be the host of ServiceWorkerContainer in the renderer, +// although currently only windows support ServiceWorkerContainers (see +// https://crbug.com/371690). // -// ServiceWorkerContainerHost is tentatively owned by ServiceWorkerProviderHost, -// and has the same lifetime with that. -// TODO(https://crbug.com/931087): Make an execution context host (i.e., -// RenderFrameHostImpl, DedicatedWorkerHost etc) own this. +// ServiceWorkerContainerHost is also responsible for handling service worker +// related things in the execution context where the container lives. For +// example, the container host manages service worker (registration) JavaScript +// object hosts, delivers messages to/from the service worker, and dispatches +// events on the container. // -// ServiceWorkerContainerHost lives on the service worker core thread. +// Ownership model and responsibilities of ServiceWorkerContainerHost are +// slightly different based on the type of the execution context that the +// container host serves: +// +// For service worker clients, ServiceWorkerContainerHost is owned by +// ServiceWorkerContextCore. The container host has a Mojo connection to the +// container in the renderer, and destruction of the container host happens upon +// disconnection of the Mojo pipe. +// +// For service worker clients, the container host works as a source of truth of +// a service worker client. +// +// Example: +// When a new service worker registration is created, the browser process +// iterates over all ServiceWorkerContainerHosts to find clients (frames, +// dedicated workers if PlzDedicatedWorker is enabled, and shared workers) with +// a URL inside the registration's scope, and has the container host watch the +// registration in order to resolve navigator.serviceWorker.ready once the +// registration settles, if need. +// +// For service worker execution contexts, ServiceWorkerContainerHost is owned +// by ServiceWorkerProviderHost, which in turn is owned by ServiceWorkerVersion. +// The container host and provider host are destructed when the service worker +// is stopped. class CONTENT_EXPORT ServiceWorkerContainerHost final : public blink::mojom::ServiceWorkerContainerHost, public ServiceWorkerRegistration::Listener { @@ -62,8 +86,31 @@ using ExecutionReadyCallback = base::OnceClosure; using WebContentsGetter = base::RepeatingCallback<WebContents*()>; - // |service_worker_host| must be non-null for service worker execution - // contexts, and null for service worker clients. + // Used to create a ServiceWorkerContainerHost for a window during a + // navigation. |are_ancestors_secure| should be true for main frames. + // Otherwise it is true iff all ancestor frames of this frame have a secure + // origin. |frame_tree_node_id| is FrameTreeNode id. |web_contents_getter| + // indicates the tab where the navigation is occurring. + static base::WeakPtr<ServiceWorkerContainerHost> CreateForWindow( + base::WeakPtr<ServiceWorkerContextCore> context, + bool are_ancestors_secure, + int frame_tree_node_id, + mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> + host_receiver, + mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> + container_remote); + + // Used for starting a web worker (dedicated worker or shared worker). Returns + // a container host for the worker. + static base::WeakPtr<ServiceWorkerContainerHost> CreateForWebWorker( + base::WeakPtr<ServiceWorkerContextCore> context, + int process_id, + blink::mojom::ServiceWorkerProviderType provider_type, + mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> + host_receiver, + mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> + container_remote); + // TODO(https://crbug.com/931087): Rename ServiceWorkerProviderType to // ServiceWorkerContainerType. ServiceWorkerContainerHost( @@ -74,7 +121,6 @@ host_receiver, mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> container_remote, - ServiceWorkerProviderHost* service_worker_host, base::WeakPtr<ServiceWorkerContextCore> context); ~ServiceWorkerContainerHost() override; @@ -185,7 +231,7 @@ // |registration_id|. void RemoveServiceWorkerRegistrationObjectHost(int64_t registration_id); - // For the container hosted on ServiceWorkerGlobalScope. + // For service worker execution contexts. // Returns an object info representing |self.serviceWorker|. The object // info holds a Mojo connection to the ServiceWorkerObjectHost for the // |serviceWorker| to ensure the host stays alive while the object info is @@ -377,6 +423,7 @@ ServiceWorkerRegistration* controller_registration() const; // For service worker execution contexts. + void set_service_worker_host(ServiceWorkerProviderHost* service_worker_host); ServiceWorkerProviderHost* service_worker_host(); // BackForwardCache: @@ -394,14 +441,6 @@ void EnterBackForwardCacheForTesting() { is_in_back_forward_cache_ = true; } void LeaveBackForwardCacheForTesting() { is_in_back_forward_cache_ = false; } - // TODO(https://crbug.com/931087): This getter is exposed to - // ServiceWorkerProviderHost::RegisterToContextCore() as a workaround during - // ServiceWorkerProviderHost separation. We should remove this. - mojo::AssociatedReceiver<blink::mojom::ServiceWorkerContainerHost>& - receiver() { - return receiver_; - } - base::WeakPtr<ServiceWorkerContainerHost> GetWeakPtr(); private:
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc index 2288870..c3f15d8 100644 --- a/content/browser/service_worker/service_worker_context_core.cc +++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -29,7 +29,6 @@ #include "content/browser/service_worker/service_worker_info.h" #include "content/browser/service_worker/service_worker_job_coordinator.h" #include "content/browser/service_worker/service_worker_process_manager.h" -#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_register_job.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/browser/service_worker/service_worker_version.h" @@ -239,7 +238,7 @@ ServiceWorkerContainerHost* ServiceWorkerContextCore::ContainerHostIterator::GetContainerHost() { DCHECK(!IsAtEnd()); - return container_host_iterator_->second; + return container_host_iterator_->second.get(); } void ServiceWorkerContextCore::ContainerHostIterator::Advance() { @@ -283,7 +282,6 @@ observer_list, ServiceWorkerContextWrapper* wrapper) : wrapper_(wrapper), - providers_(std::make_unique<ProviderByIdMap>()), container_host_by_uuid_(std::make_unique<ContainerHostByClientUUIDMap>()), storage_(ServiceWorkerStorage::Create(user_data_directory, this, @@ -307,7 +305,6 @@ ServiceWorkerContextCore* old_context, ServiceWorkerContextWrapper* wrapper) : wrapper_(wrapper), - providers_(old_context->providers_.release()), container_host_by_uuid_(old_context->container_host_by_uuid_.release()), storage_(ServiceWorkerStorage::Create(this, old_context->storage())), job_coordinator_(std::make_unique<ServiceWorkerJobCoordinator>(this)), @@ -327,18 +324,6 @@ job_coordinator_->ClearForShutdown(); } -void ServiceWorkerContextCore::AddProviderHost( - std::unique_ptr<ServiceWorkerProviderHost> host) { - DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); - int provider_id = host->provider_id(); - providers_->emplace(provider_id, std::move(host)); -} - -void ServiceWorkerContextCore::RemoveProviderHost(int provider_id) { - DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); - providers_->erase(provider_id); -} - std::unique_ptr<ServiceWorkerContextCore::ContainerHostIterator> ServiceWorkerContextCore::GetClientContainerHostIterator( const GURL& origin, @@ -404,10 +389,10 @@ void ServiceWorkerContextCore::RegisterContainerHostByClientID( const std::string& client_uuid, - ServiceWorkerContainerHost* container_host) { + std::unique_ptr<ServiceWorkerContainerHost> container_host) { DCHECK(container_host->IsContainerForClient()); DCHECK(!base::Contains(*container_host_by_uuid_, client_uuid)); - (*container_host_by_uuid_)[client_uuid] = container_host; + container_host_by_uuid_->emplace(client_uuid, std::move(container_host)); } void ServiceWorkerContextCore::UnregisterContainerHostByClientID( @@ -416,6 +401,16 @@ container_host_by_uuid_->erase(client_uuid); } +void ServiceWorkerContextCore::UpdateContainerHostClientID( + const std::string& current_client_uuid, + const std::string& new_client_uuid) { + DCHECK(base::Contains(*container_host_by_uuid_, current_client_uuid)); + std::unique_ptr<ServiceWorkerContainerHost> container_host = + std::move(container_host_by_uuid_->find(current_client_uuid)->second); + UnregisterContainerHostByClientID(current_client_uuid); + RegisterContainerHostByClientID(new_client_uuid, std::move(container_host)); +} + ServiceWorkerContainerHost* ServiceWorkerContextCore::GetContainerHostByClientID( const std::string& client_uuid) { @@ -423,7 +418,7 @@ if (found == container_host_by_uuid_->end()) return nullptr; DCHECK(found->second->IsContainerForClient()); - return found->second; + return found->second.get(); } void ServiceWorkerContextCore::RegisterServiceWorker(
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h index c278c4b3..c62ed58 100644 --- a/content/browser/service_worker/service_worker_context_core.h +++ b/content/browser/service_worker/service_worker_context_core.h
@@ -20,7 +20,6 @@ #include "base/observer_list_threadsafe.h" #include "content/browser/service_worker/service_worker_info.h" #include "content/browser/service_worker/service_worker_process_manager.h" -#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_registration_status.h" #include "content/browser/service_worker/service_worker_storage.h" #include "content/common/content_export.h" @@ -43,7 +42,6 @@ class ServiceWorkerContextCoreObserver; class ServiceWorkerContextWrapper; class ServiceWorkerJobCoordinator; -class ServiceWorkerProviderHost; class ServiceWorkerRegistration; class URLLoaderFactoryGetter; @@ -68,10 +66,8 @@ int64_t registration_id)>; using UnregistrationCallback = base::OnceCallback<void(blink::ServiceWorkerStatusCode status)>; - using ProviderByIdMap = - std::map<int, std::unique_ptr<ServiceWorkerProviderHost>>; using ContainerHostByClientUUIDMap = - std::map<std::string, ServiceWorkerContainerHost*>; + std::map<std::string, std::unique_ptr<ServiceWorkerContainerHost>>; // Directory for ServiceWorkerStorage and ServiceWorkerCacheManager. static const base::FilePath::CharType kServiceWorkerDirectory[]; @@ -158,11 +154,6 @@ return job_coordinator_.get(); } - // The context class owns the set of ProviderHosts. - void AddProviderHost( - std::unique_ptr<ServiceWorkerProviderHost> provider_host); - void RemoveProviderHost(int provider_id); - // Returns a ContainerHost iterator for all service worker clients for the // |origin|. If |include_reserved_clients| is true, this includes clients that // are not execution ready (i.e., for windows, the document has not yet been @@ -191,13 +182,12 @@ // Maintains a map from Client UUID to ServiceWorkerContainerHost for service // worker clients. |container_host| should not be for a service worker // execution context. - // (Note: instead of maintaining 2 maps we might be able to uniformly use - // UUID instead of process_id+provider_id elsewhere. For now I'm leaving - // these as provider_id is deeply wired everywhere) void RegisterContainerHostByClientID( const std::string& client_uuid, - ServiceWorkerContainerHost* container_host); + std::unique_ptr<ServiceWorkerContainerHost> container_host); void UnregisterContainerHostByClientID(const std::string& client_uuid); + void UpdateContainerHostClientID(const std::string& current_client_uuid, + const std::string& new_client_uuid); ServiceWorkerContainerHost* GetContainerHostByClientID( const std::string& client_uuid); @@ -358,12 +348,9 @@ // Bind() to hold a reference to |wrapper_| until |this| is fully destroyed. ServiceWorkerContextWrapper* wrapper_; - // |providers_| owns the provider hosts. - std::unique_ptr<ProviderByIdMap> providers_; - - // |container_host_by_uuid_| contains raw pointers to container hosts for - // service worker clients. This doesn't contain container hosts for service - // worker execution contexts. + // |container_host_by_uuid_| owns container hosts for service worker clients. + // Container hosts for service worker execution contexts are owned by + // ServiceWorkerProviderHost. std::unique_ptr<ContainerHostByClientUUIDMap> container_host_by_uuid_; std::unique_ptr<ServiceWorkerStorage> storage_;
diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc index 8a6e7009..7a4b2f7 100644 --- a/content/browser/service_worker/service_worker_context_unittest.cc +++ b/content/browser/service_worker/service_worker_context_unittest.cc
@@ -234,6 +234,12 @@ EmbeddedWorkerTestHelper* helper) : FakeEmbeddedWorkerInstanceClient(helper) {} + void OnConnectionError() override { + // Do nothing. This allows the object to stay until the test is over, so + // |events_| can be accessed even after the worker is stopped in the case of + // rejected install. + } + const std::vector<Message>& events() const { return events_; } protected: @@ -419,16 +425,16 @@ version->SetStatus(ServiceWorkerVersion::ACTIVATED); ServiceWorkerRemoteProviderEndpoint endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHostForWindow(helper_->mock_render_process_id(), true, - context()->AsWeakPtr(), &endpoint); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), true, + context()->AsWeakPtr(), &endpoint); - version->AddControllee(host->container_host()); + version->AddControllee(container_host.get()); base::RunLoop().RunUntilIdle(); TestServiceWorkerContextObserver observer(context_wrapper()); - version->RemoveControllee(host->container_host()->client_uuid()); + version->RemoveControllee(container_host->client_uuid()); base::RunLoop().RunUntilIdle(); ASSERT_EQ(1u, observer.events().size()); @@ -978,30 +984,30 @@ // Host1 : process_id=1, origin1. remote_endpoints.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host1 = CreateProviderHostForWindow( - kRenderProcessId1, true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoints.back()); - host1->container_host()->UpdateUrls(kOrigin1, - net::SiteForCookies::FromUrl(kOrigin1), - url::Origin::Create(kOrigin1)); + base::WeakPtr<ServiceWorkerContainerHost> container_host1 = + CreateContainerHostForWindow( + kRenderProcessId1, true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoints.back()); + container_host1->UpdateUrls(kOrigin1, net::SiteForCookies::FromUrl(kOrigin1), + url::Origin::Create(kOrigin1)); // Host2 : process_id=2, origin2. remote_endpoints.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host2 = CreateProviderHostForWindow( - kRenderProcessId2, true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoints.back()); - host2->container_host()->UpdateUrls(kOrigin2, - net::SiteForCookies::FromUrl(kOrigin2), - url::Origin::Create(kOrigin2)); + base::WeakPtr<ServiceWorkerContainerHost> container_host2 = + CreateContainerHostForWindow( + kRenderProcessId2, true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoints.back()); + container_host2->UpdateUrls(kOrigin2, net::SiteForCookies::FromUrl(kOrigin2), + url::Origin::Create(kOrigin2)); // Host3 : process_id=2, origin1. remote_endpoints.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host3 = CreateProviderHostForWindow( - kRenderProcessId2, true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoints.back()); - host3->container_host()->UpdateUrls(kOrigin1, - net::SiteForCookies::FromUrl(kOrigin1), - url::Origin::Create(kOrigin1)); + base::WeakPtr<ServiceWorkerContainerHost> container_host3 = + CreateContainerHostForWindow( + kRenderProcessId2, true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoints.back()); + container_host3->UpdateUrls(kOrigin1, net::SiteForCookies::FromUrl(kOrigin1), + url::Origin::Create(kOrigin1)); // Host4 : process_id=2, origin2, for ServiceWorker. blink::mojom::ServiceWorkerRegistrationOptions registration_opt; @@ -1017,16 +1023,19 @@ blink::mojom::ScriptType::kClassic, 1L /* version_id */, helper_->context()->AsWeakPtr()); remote_endpoints.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host4 = + // ServiceWorkrProviderHost creates ServiceWorkerContainerHost for a service + // worker execution context. + std::unique_ptr<ServiceWorkerProviderHost> provider_host4 = CreateProviderHostForServiceWorkerContext( kRenderProcessId2, true /* is_parent_frame_secure */, version.get(), context()->AsWeakPtr(), &remote_endpoints.back()); - EXPECT_NE(host4->provider_id(), blink::kInvalidServiceWorkerProviderId); + EXPECT_NE(provider_host4->provider_id(), + blink::kInvalidServiceWorkerProviderId); - ASSERT_TRUE(host1); - ASSERT_TRUE(host2); - ASSERT_TRUE(host3); - ASSERT_TRUE(host4); + ASSERT_TRUE(container_host1); + ASSERT_TRUE(container_host2); + ASSERT_TRUE(container_host3); + ASSERT_TRUE(provider_host4->container_host()); // Iterate over the client container hosts that belong to kOrigin1. std::set<ServiceWorkerContainerHost*> results; @@ -1037,11 +1046,11 @@ results.insert(it->GetContainerHost()); } EXPECT_EQ(2u, results.size()); - EXPECT_TRUE(base::Contains(results, host1->container_host())); - EXPECT_TRUE(base::Contains(results, host3->container_host())); + EXPECT_TRUE(base::Contains(results, container_host1.get())); + EXPECT_TRUE(base::Contains(results, container_host3.get())); - // Iterate over the container hosts that belong to kOrigin2. - // (This should not include host4 as it's not for controllee.) + // Iterate over the container hosts that belong to kOrigin2. This should not + // include provider_host4->container_host() as it's not for controllee. results.clear(); for (auto it = context()->GetClientContainerHostIterator( kOrigin2, true /* include_reserved_clients */, @@ -1050,12 +1059,11 @@ results.insert(it->GetContainerHost()); } EXPECT_EQ(1u, results.size()); - EXPECT_TRUE(base::Contains(results, host2->container_host())); + EXPECT_TRUE(base::Contains(results, container_host2.get())); - context()->RemoveProviderHost(host1->provider_id()); - context()->RemoveProviderHost(host2->provider_id()); - context()->RemoveProviderHost(host3->provider_id()); - context()->RemoveProviderHost(host4->provider_id()); + context()->UnregisterContainerHostByClientID(container_host1->client_uuid()); + context()->UnregisterContainerHostByClientID(container_host2->client_uuid()); + context()->UnregisterContainerHostByClientID(container_host3->client_uuid()); } class ServiceWorkerContextRecoveryTest
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc index e7aaffb..da7db7c 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -29,6 +29,7 @@ #include "content/browser/service_worker/service_worker_context_watcher.h" #include "content/browser/service_worker/service_worker_object_host.h" #include "content/browser/service_worker/service_worker_process_manager.h" +#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_quota_client.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/browser/storage_partition_impl.h"
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 c9a0d17..bc10d7b 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
@@ -118,10 +118,9 @@ // An empty host. remote_endpoints_.emplace_back(); - provider_host_ = CreateProviderHostForWindow( + container_host_ = CreateContainerHostForWindow( helper_->mock_render_process_id(), is_parent_frame_secure, helper_->context()->AsWeakPtr(), &remote_endpoints_.back()); - container_host_ = provider_host_->container_host()->GetWeakPtr(); } void TearDown() override { @@ -137,7 +136,6 @@ std::unique_ptr<EmbeddedWorkerTestHelper> helper_; scoped_refptr<ServiceWorkerRegistration> registration_; scoped_refptr<ServiceWorkerVersion> version_; - base::WeakPtr<ServiceWorkerProviderHost> provider_host_; base::WeakPtr<ServiceWorkerContainerHost> container_host_; net::URLRequestContext url_request_context_; net::TestDelegate url_request_delegate_; @@ -359,7 +357,7 @@ } // Test to not regress crbug/414118. -TEST_F(ServiceWorkerControlleeRequestHandlerTest, DeletedProviderHost) { +TEST_F(ServiceWorkerControlleeRequestHandlerTest, DeletedContainerHost) { // Store a registration so the call to FindRegistrationForDocument will read // from the database. version_->set_fetch_handler_existence( @@ -380,8 +378,8 @@ // Shouldn't crash if the ProviderHost is deleted prior to completion of // the database lookup. - context()->RemoveProviderHost(provider_host_->provider_id()); - EXPECT_FALSE(container_host_.get()); + context()->UnregisterContainerHostByClientID(container_host_->client_uuid()); + EXPECT_FALSE(container_host_); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(test_resources.loader()); }
diff --git a/content/browser/service_worker/service_worker_database.cc b/content/browser/service_worker/service_worker_database.cc index 4afc8c9..179e8877 100644 --- a/content/browser/service_worker/service_worker_database.cc +++ b/content/browser/service_worker/service_worker_database.cc
@@ -282,7 +282,9 @@ version_id(blink::mojom::kInvalidServiceWorkerVersionId), is_active(false), has_fetch_handler(false), - resources_total_size_bytes(0) {} + resources_total_size_bytes(0), + cross_origin_embedder_policy( + network::mojom::CrossOriginEmbedderPolicy::kNone) {} ServiceWorkerDatabase::RegistrationData::RegistrationData( const RegistrationData& other) = default; @@ -1549,6 +1551,19 @@ static_cast<blink::mojom::ServiceWorkerUpdateViaCache>(value); } + if (data.has_cross_origin_embedder_policy()) { + switch (data.cross_origin_embedder_policy()) { + case ServiceWorkerRegistrationData::NONE_OR_NOT_EXIST: + out->cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kNone; + break; + case ServiceWorkerRegistrationData::REQUIRE_CORP: + out->cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp; + break; + } + } + return ServiceWorkerDatabase::STATUS_OK; } @@ -1602,6 +1617,12 @@ ServiceWorkerRegistrationData_ServiceWorkerUpdateViaCacheType>( registration.update_via_cache)); + data.set_cross_origin_embedder_policy( + registration.cross_origin_embedder_policy == + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp + ? ServiceWorkerRegistrationData::REQUIRE_CORP + : ServiceWorkerRegistrationData::NONE_OR_NOT_EXIST); + std::string value; bool success = data.SerializeToString(&value); DCHECK(success);
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h index 9f812f49..70e7b09 100644 --- a/content/browser/service_worker/service_worker_database.h +++ b/content/browser/service_worker/service_worker_database.h
@@ -21,6 +21,7 @@ #include "base/sequence_checker.h" #include "base/time/time.h" #include "content/common/content_export.h" +#include "services/network/public/mojom/cross_origin_embedder_policy.mojom.h" #include "third_party/blink/public/mojom/service_worker/navigation_preload_state.mojom.h" #include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom.h" @@ -91,6 +92,8 @@ // Not populated until ServiceWorkerStorage::StoreRegistration is called. int64_t resources_total_size_bytes; + network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy; + RegistrationData(); RegistrationData(const RegistrationData& other); ~RegistrationData(); @@ -452,6 +455,8 @@ UserData_UninitializedDatabase); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, InvalidWebFeature); + FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, + NoCrossOriginEmbedderPolicy); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); };
diff --git a/content/browser/service_worker/service_worker_database.proto b/content/browser/service_worker/service_worker_database.proto index 7c7fb82c..a3ebdd6 100644 --- a/content/browser/service_worker/service_worker_database.proto +++ b/content/browser/service_worker/service_worker_database.proto
@@ -32,6 +32,10 @@ ALL = 1; NONE = 2; } + enum CrossOriginEmbedderPolicy { + NONE_OR_NOT_EXIST = 0; + REQUIRE_CORP = 1; + } required int64 registration_id = 1; required string scope_url = 2; @@ -72,6 +76,9 @@ // The time when the browser received the service worker main script, // serialized by Time::ToDeltaSinceWindowsEpoch(). optional int64 script_response_time = 16; + + optional CrossOriginEmbedderPolicy cross_origin_embedder_policy = 17 + [default = NONE_OR_NOT_EXIST]; } message ServiceWorkerResourceRecord {
diff --git a/content/browser/service_worker/service_worker_database_unittest.cc b/content/browser/service_worker/service_worker_database_unittest.cc index 96a6c8a9..5f555a1 100644 --- a/content/browser/service_worker/service_worker_database_unittest.cc +++ b/content/browser/service_worker/service_worker_database_unittest.cc
@@ -79,6 +79,8 @@ EXPECT_EQ(expected.resources_total_size_bytes, actual.resources_total_size_bytes); EXPECT_EQ(expected.script_response_time, actual.script_response_time); + EXPECT_EQ(expected.cross_origin_embedder_policy, + actual.cross_origin_embedder_policy); } void VerifyResourceRecords(const std::vector<Resource>& expected, @@ -463,6 +465,8 @@ data1.version_id = 1000; data1.resources_total_size_bytes = 100; data1.script_response_time = base::Time::FromJsTime(0); + data1.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kNone; std::vector<Resource> resources1; resources1.push_back(CreateResource(1, data1.script, 100)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -486,6 +490,8 @@ data2.version_id = 2000; data2.resources_total_size_bytes = 200; data2.script_response_time = base::Time::FromJsTime(42); + data2.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp; std::vector<Resource> resources2; resources2.push_back(CreateResource(2, data2.script, 200)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -509,6 +515,8 @@ data3.version_id = 3000; data3.resources_total_size_bytes = 300; data3.script_response_time = base::Time::FromJsTime(420); + data3.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kNone; std::vector<Resource> resources3; resources3.push_back(CreateResource(3, data3.script, 300)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -523,6 +531,8 @@ data4.version_id = 4000; data4.resources_total_size_bytes = 400; data4.script_response_time = base::Time::FromJsTime(4200); + data4.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp; std::vector<Resource> resources4; resources4.push_back(CreateResource(4, data4.script, 400)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -569,6 +579,8 @@ data1.script = URL(origin1, "/script1.js"); data1.version_id = 1000; data1.resources_total_size_bytes = 100; + data1.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kNone; std::vector<Resource> resources1; resources1.push_back(CreateResource(1, data1.script, 100)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -583,6 +595,8 @@ data2.version_id = 2000; data2.resources_total_size_bytes = 200; data2.update_via_cache = blink::mojom::ServiceWorkerUpdateViaCache::kNone; + data2.cross_origin_embedder_policy = + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp; std::vector<Resource> resources2; resources2.push_back(CreateResource(2, data2.script, 200)); ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, @@ -2236,4 +2250,34 @@ EXPECT_EQ(expect, registration.used_features); } +TEST(ServiceWorkerDatabaseTest, NoCrossOriginEmbedderPolicy) { + std::unique_ptr<ServiceWorkerDatabase> database(CreateDatabaseInMemory()); + + // Prepare a registration proto that doesn't have Cross Origin Embedder + // Policy. + ServiceWorkerRegistrationData data; + data.set_registration_id(1); + data.set_scope_url("https://example.com"); + data.set_script_url("https://example.com/sw"); + data.set_version_id(1); + data.set_is_active(true); + data.set_has_fetch_handler(true); + data.set_last_update_check_time( + base::Time::Now().ToDeltaSinceWindowsEpoch().InMicroseconds()); + + database->next_avail_registration_id_ = 2; + database->next_avail_version_id_ = 2; + + // Write the serialization. + std::string value; + ASSERT_TRUE(data.SerializeToString(&value)); + + // Parse the serialized data. The policy is kNone if it's not set. + RegistrationData registration; + ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK, + database->ParseRegistrationData(value, ®istration)); + EXPECT_EQ(network::mojom::CrossOriginEmbedderPolicy::kNone, + registration.cross_origin_embedder_policy); +} + } // namespace content
diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc index cb04424..1ed1949 100644 --- a/content/browser/service_worker/service_worker_job_unittest.cc +++ b/content/browser/service_worker/service_worker_job_unittest.cc
@@ -244,10 +244,11 @@ ServiceWorkerContainerHost* ServiceWorkerJobTest::CreateControllee() { remote_endpoints_.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), &remote_endpoints_.back()); - return host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( + 33 /* dummy render process id */, true /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), &remote_endpoints_.back()); + return container_host.get(); } TEST_F(ServiceWorkerJobTest, SameDocumentSameRegistration) { @@ -1065,11 +1066,11 @@ url::Origin::Create(in_scope)); // Make an in-scope reserved client. - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - ServiceWorkerContainerHost* reserved_client = - host_and_info->host->container_host(); + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> reserved_client = + host_and_info->host; reserved_client->UpdateUrls(in_scope, net::SiteForCookies::FromUrl(in_scope), url::Origin::Create(in_scope));
diff --git a/content/browser/service_worker/service_worker_navigation_loader_interceptor.cc b/content/browser/service_worker/service_worker_navigation_loader_interceptor.cc index 5666d13..6655dd6 100644 --- a/content/browser/service_worker/service_worker_navigation_loader_interceptor.cc +++ b/content/browser/service_worker/service_worker_navigation_loader_interceptor.cc
@@ -114,13 +114,10 @@ if (params.resource_type == ResourceType::kMainFrame || params.resource_type == ResourceType::kSubFrame) { - container_host = - ServiceWorkerProviderHost::CreateForWindow( - context_core->AsWeakPtr(), params.are_ancestors_secure, - params.frame_tree_node_id, std::move(host_receiver), - std::move(client_remote)) - ->container_host() - ->GetWeakPtr(); + container_host = ServiceWorkerContainerHost::CreateForWindow( + context_core->AsWeakPtr(), params.are_ancestors_secure, + params.frame_tree_node_id, std::move(host_receiver), + std::move(client_remote)); } else { DCHECK(params.resource_type == ResourceType::kWorker || params.resource_type == ResourceType::kSharedWorker); @@ -128,12 +125,9 @@ params.resource_type == ResourceType::kWorker ? blink::mojom::ServiceWorkerProviderType::kForDedicatedWorker : blink::mojom::ServiceWorkerProviderType::kForSharedWorker; - container_host = - ServiceWorkerProviderHost::CreateForWebWorker( - context_core->AsWeakPtr(), params.process_id, container_type, - std::move(host_receiver), std::move(client_remote)) - ->container_host() - ->GetWeakPtr(); + container_host = ServiceWorkerContainerHost::CreateForWebWorker( + context_core->AsWeakPtr(), params.process_id, container_type, + std::move(host_receiver), std::move(client_remote)); } DCHECK(container_host); handle_core->set_container_host(container_host);
diff --git a/content/browser/service_worker/service_worker_navigation_loader_unittest.cc b/content/browser/service_worker/service_worker_navigation_loader_unittest.cc index df4c567..eea8f05 100644 --- a/content/browser/service_worker/service_worker_navigation_loader_unittest.cc +++ b/content/browser/service_worker/service_worker_navigation_loader_unittest.cc
@@ -384,16 +384,13 @@ // caller can use functions like client_.RunUntilComplete() to wait for // completion. void StartRequest(std::unique_ptr<network::ResourceRequest> request) { - // Create a ServiceWorkerProviderHost and simulate what + // Create a ServiceWorkerContainerHost and simulate what // ServiceWorkerControlleeRequestHandler does to assign it a controller. if (!container_host_) { - container_host_ = - CreateProviderHostForWindow(helper_->mock_render_process_id(), - /*is_parent_frame_secure=*/true, - helper_->context()->AsWeakPtr(), - &provider_endpoints_) - ->container_host() - ->GetWeakPtr(); + container_host_ = CreateContainerHostForWindow( + helper_->mock_render_process_id(), + /*is_parent_frame_secure=*/true, helper_->context()->AsWeakPtr(), + &provider_endpoints_); container_host_->UpdateUrls(request->url, net::SiteForCookies::FromUrl(request->url), url::Origin::Create(request->url)); @@ -516,13 +513,10 @@ TEST_F(ServiceWorkerNavigationLoaderTest, NoActiveWorker) { base::HistogramTester histogram_tester; - // Make a provider host without a controller. - container_host_ = - CreateProviderHostForWindow( - helper_->mock_render_process_id(), /*is_parent_frame_secure=*/true, - helper_->context()->AsWeakPtr(), &provider_endpoints_) - ->container_host() - ->GetWeakPtr(); + // Make a container host without a controller. + container_host_ = CreateContainerHostForWindow( + helper_->mock_render_process_id(), /*is_parent_frame_secure=*/true, + helper_->context()->AsWeakPtr(), &provider_endpoints_); container_host_->UpdateUrls( GURL("https://example.com/"), net::SiteForCookies::FromUrl(GURL("https://example.com/")), @@ -955,7 +949,7 @@ TEST_F(ServiceWorkerNavigationLoaderTest, CancelNavigationDuringFetchEvent) { StartRequest(CreateRequest()); - // Delete the provider host during the request. The load should abort without + // Delete the container host during the request. The load should abort without // crashing. provider_endpoints_.host_remote()->reset(); base::RunLoop().RunUntilIdle();
diff --git a/content/browser/service_worker/service_worker_object_host_unittest.cc b/content/browser/service_worker/service_worker_object_host_unittest.cc index 09ffc09..45f2c4c 100644 --- a/content/browser/service_worker/service_worker_object_host_unittest.cc +++ b/content/browser/service_worker/service_worker_object_host_unittest.cc
@@ -169,9 +169,9 @@ return nullptr; } - void SetProviderHostRenderFrameId(ServiceWorkerProviderHost* host, - int render_frame_id) { - host->container_host()->frame_id_ = render_frame_id; + void SetContainerHostRenderFrameId(ServiceWorkerContainerHost* container_host, + int render_frame_id) { + container_host->frame_id_ = render_frame_id; } blink::mojom::ServiceWorkerRegistrationObjectInfoPtr @@ -217,12 +217,12 @@ registration_->SetInstallingVersion(version_); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> provider_host = - CreateProviderHostForWindow( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( helper_->mock_render_process_id(), true /* is_parent_frame_secure */, helper_->context()->AsWeakPtr(), &remote_endpoint); - provider_host->container_host()->UpdateUrls( - scope, net::SiteForCookies::FromUrl(scope), url::Origin::Create(scope)); + container_host->UpdateUrls(scope, net::SiteForCookies::FromUrl(scope), + url::Origin::Create(scope)); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr registration_info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), scope); // |version_| is the installing version of |registration_| now. @@ -358,7 +358,7 @@ auto* worker = helper_->AddNewPendingServiceWorker<MessageEventWorker>(helper_.get()); - // Prepare a ServiceWorkerProviderHost for a window client. A + // Prepare a ServiceWorkerContainerHost for a window client. A // WebContents/RenderFrameHost must be created too because it's needed for // DispatchExtendableMessageEvent to populate ExtendableMessageEvent#source. RenderViewHostTestEnabler rvh_test_enabler; @@ -367,12 +367,12 @@ nullptr)); RenderFrameHost* frame_host = web_contents->GetMainFrame(); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> provider_host = - CreateProviderHostForWindow( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( frame_host->GetProcess()->GetID(), true /* is_parent_frame_secure */, helper_->context()->AsWeakPtr(), &remote_endpoint); - SetProviderHostRenderFrameId(provider_host.get(), frame_host->GetRoutingID()); - ServiceWorkerContainerHost* container_host = provider_host->container_host(); + SetContainerHostRenderFrameId(container_host.get(), + frame_host->GetRoutingID()); container_host->UpdateUrls(scope, net::SiteForCookies::FromUrl(scope), url::Origin::Create(scope)); @@ -381,7 +381,7 @@ container_host->GetOrCreateServiceWorkerObjectHost(version_) ->CreateCompleteObjectInfoToSend(); ServiceWorkerObjectHost* object_host = - GetServiceWorkerObjectHost(container_host, version_->version_id()); + GetServiceWorkerObjectHost(container_host.get(), version_->version_id()); // Simulate postMessage() from the window client to the worker. blink::TransferableMessage message;
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc index fa38627..187f062 100644 --- a/content/browser/service_worker/service_worker_provider_host.cc +++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -13,7 +13,6 @@ #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/interface_provider_filtering.h" #include "content/browser/service_worker/service_worker_consts.h" -#include "content/browser/service_worker/service_worker_container_host.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/browser/webtransport/quic_transport_connector_impl.h" @@ -23,7 +22,6 @@ #include "content/public/common/child_process_host.h" #include "content/public/common/origin_util.h" #include "mojo/public/cpp/bindings/message.h" -#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/messaging/message_port_channel.h" #include "third_party/blink/public/common/service_worker/service_worker_utils.h" #include "third_party/blink/public/mojom/service_worker/service_worker_client.mojom.h" @@ -55,111 +53,27 @@ } // anonymous namespace -// static -base::WeakPtr<ServiceWorkerProviderHost> -ServiceWorkerProviderHost::CreateForWindow( - base::WeakPtr<ServiceWorkerContextCore> context, - bool are_ancestors_secure, - int frame_tree_node_id, - mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> - host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote) { - DCHECK(context); - auto host = base::WrapUnique(new ServiceWorkerProviderHost( - blink::mojom::ServiceWorkerProviderType::kForWindow, are_ancestors_secure, - frame_tree_node_id, std::move(host_receiver), std::move(container_remote), - /*running_hosted_version=*/nullptr, context)); - auto weak_ptr = host->GetWeakPtr(); - RegisterToContextCore(context, std::move(host)); - return weak_ptr; -} - -// static -base::WeakPtr<ServiceWorkerProviderHost> -ServiceWorkerProviderHost::CreateForServiceWorker( - base::WeakPtr<ServiceWorkerContextCore> context, - scoped_refptr<ServiceWorkerVersion> version, - blink::mojom::ServiceWorkerProviderInfoForStartWorkerPtr* - out_provider_info) { - auto host = base::WrapUnique(new ServiceWorkerProviderHost( - blink::mojom::ServiceWorkerProviderType::kForServiceWorker, - /*is_parent_frame_secure=*/true, FrameTreeNode::kFrameTreeNodeInvalidId, - (*out_provider_info)->host_remote.InitWithNewEndpointAndPassReceiver(), - /*container_remote=*/mojo::NullAssociatedRemote(), std::move(version), - context)); - auto weak_ptr = host->GetWeakPtr(); - RegisterToContextCore(context, std::move(host)); - return weak_ptr; -} - -// static -base::WeakPtr<ServiceWorkerProviderHost> -ServiceWorkerProviderHost::CreateForWebWorker( - base::WeakPtr<ServiceWorkerContextCore> context, - int process_id, - blink::mojom::ServiceWorkerProviderType provider_type, - mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> - host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote) { - using ServiceWorkerProviderType = blink::mojom::ServiceWorkerProviderType; - DCHECK((base::FeatureList::IsEnabled(blink::features::kPlzDedicatedWorker) && - provider_type == ServiceWorkerProviderType::kForDedicatedWorker) || - provider_type == ServiceWorkerProviderType::kForSharedWorker); - auto host = base::WrapUnique(new ServiceWorkerProviderHost( - provider_type, /*is_parent_frame_secure=*/true, - FrameTreeNode::kFrameTreeNodeInvalidId, std::move(host_receiver), - std::move(container_remote), /*running_hosted_version=*/nullptr, - context)); - host->container_host()->SetContainerProcessId(process_id); - - auto weak_ptr = host->GetWeakPtr(); - RegisterToContextCore(context, std::move(host)); - return weak_ptr; -} - -// static -void ServiceWorkerProviderHost::RegisterToContextCore( - base::WeakPtr<ServiceWorkerContextCore> context, - std::unique_ptr<ServiceWorkerProviderHost> host) { - DCHECK(host->container_host()->receiver().is_bound()); - host->container_host()->receiver().set_disconnect_handler( - base::BindOnce(&ServiceWorkerContextCore::RemoveProviderHost, context, - host->provider_id())); - context->AddProviderHost(std::move(host)); -} - ServiceWorkerProviderHost::ServiceWorkerProviderHost( - blink::mojom::ServiceWorkerProviderType type, - bool is_parent_frame_secure, - int frame_tree_node_id, mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote, scoped_refptr<ServiceWorkerVersion> running_hosted_version, base::WeakPtr<ServiceWorkerContextCore> context) : provider_id_(NextProviderId()), running_hosted_version_(std::move(running_hosted_version)), container_host_(std::make_unique<content::ServiceWorkerContainerHost>( - type, - is_parent_frame_secure, - frame_tree_node_id, + blink::mojom::ServiceWorkerProviderType::kForServiceWorker, + /*is_parent_frame_secure=*/true, + FrameTreeNode::kFrameTreeNodeInvalidId, std::move(host_receiver), - std::move(container_remote), - type == blink::mojom::ServiceWorkerProviderType::kForServiceWorker - ? this - : nullptr, + mojo::NullAssociatedRemote(), context)) { - DCHECK_NE(blink::mojom::ServiceWorkerProviderType::kUnknown, type); - if (type == blink::mojom::ServiceWorkerProviderType::kForServiceWorker) { - DCHECK(running_hosted_version_); - container_host_->UpdateUrls( - running_hosted_version_->script_url(), - net::SiteForCookies::FromUrl(running_hosted_version_->script_url()), - running_hosted_version_->script_origin()); - } + DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); + DCHECK(running_hosted_version_); + container_host_->set_service_worker_host(this); + container_host_->UpdateUrls( + running_hosted_version_->script_url(), + net::SiteForCookies::FromUrl(running_hosted_version_->script_url()), + running_hosted_version_->script_origin()); } ServiceWorkerProviderHost::~ServiceWorkerProviderHost() { @@ -177,31 +91,25 @@ ServiceWorkerVersion* ServiceWorkerProviderHost::running_hosted_version() const { - DCHECK(!running_hosted_version_ || - container_host_->IsContainerForServiceWorker()); + DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); + DCHECK(running_hosted_version_); return running_hosted_version_.get(); } -bool ServiceWorkerProviderHost::IsProviderForServiceWorker() const { - return container_host_->IsContainerForServiceWorker(); -} - void ServiceWorkerProviderHost::CompleteStartWorkerPreparation( int process_id, mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker> broker_receiver) { + DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK_EQ(ChildProcessHost::kInvalidUniqueID, worker_process_id_); DCHECK_NE(ChildProcessHost::kInvalidUniqueID, process_id); - DCHECK(IsProviderForServiceWorker()); - SetWorkerProcessId(process_id); - + worker_process_id_ = process_id; broker_receiver_.Bind(std::move(broker_receiver)); } void ServiceWorkerProviderHost::CreateQuicTransportConnector( mojo::PendingReceiver<blink::mojom::QuicTransportConnector> receiver) { DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); - DCHECK(IsProviderForServiceWorker()); RunOrPostTaskOnThread( FROM_HERE, BrowserThread::UI, base::BindOnce(&CreateQuicTransportConnectorImpl, worker_process_id_, @@ -215,9 +123,4 @@ return weak_factory_.GetWeakPtr(); } -void ServiceWorkerProviderHost::SetWorkerProcessId(int worker_process_id) { - DCHECK(IsProviderForServiceWorker()); - worker_process_id_ = worker_process_id; -} - } // namespace content
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h index 2b22864..47a69738 100644 --- a/content/browser/service_worker/service_worker_provider_host.h +++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -13,6 +13,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "content/browser/browser_interface_broker_impl.h" +#include "content/browser/service_worker/service_worker_container_host.h" #include "content/common/content_export.h" #include "content/public/browser/render_process_host.h" #include "mojo/public/cpp/bindings/associated_receiver.h" @@ -33,137 +34,41 @@ namespace content { -class ServiceWorkerContainerHost; class ServiceWorkerContextCore; class ServiceWorkerVersion; -// ServiceWorkerProviderHost is the browser-process representation of a -// renderer-process entity that can involve service workers. Currently, these -// entities are frames or workers. So basically, one ServiceWorkerProviderHost -// instance is the browser process's source of truth about one frame/worker in a -// renderer process, which the browser process uses when performing operations -// involving service workers. +// ServiceWorkerProviderHost is the host of a service worker execution context +// in the renderer process. One ServiceWorkerProviderHost instance hosts one +// service worker execution context instance. // // ServiceWorkerProviderHost lives on the service worker core thread, since all // nearly all browser process service worker machinery lives on the service // worker core thread. // -// Example: -// * A new service worker registration is created. The browser process loops -// over all ServiceWorkerProviderHosts to find clients (frames and shared -// workers) with a URL inside the registration's scope, and has the provider -// host watch the registration in order to resolve navigator.serviceWorker.ready -// once the registration settles, if neeed. -// -// "Provider" is a somewhat tricky term. The idea is that a provider is what -// attaches to a frame/worker and "provides" it with functionality related to -// service workers. This functionality is mostly granted by creating the -// ServiceWorkerProviderHost for this frame/worker, which, again, makes the -// frame/worker alive in the browser's service worker world. -// -// A provider host has a Mojo connection to the provider in the renderer. -// Destruction of the host happens upon disconnection of the Mojo pipe. -// -// There are two general types of providers: -// 1) those for service worker clients (windows or shared workers), and -// 2) those for service workers themselves. -// -// For client providers, there is a provider (ServiceWorkerProviderContext) per -// frame or shared worker in the renderer process. The lifetime of this host -// object is tied to the lifetime of the document or the worker. -// -// For service worker providers, there is a provider -// (ServiceWorkerContextClient) per running service worker in the renderer -// process. The lifetime of this host object is tied to the lifetime of the -// running service worker. -// -// A ServiceWorkerProviderHost is created in the following situations: -// -// 1) For a client created for a navigation (for both top-level and -// non-top-level frames), the provider host for the resulting document is -// pre-created by the browser process and the provider info is sent in the -// navigation commit IPC. -// -// 2) For web workers and for service workers, the provider host is -// created by the browser process and the provider info is sent in the start -// worker IPC message. -// // TODO(https://crbug.com/931087): Rename this to ServiceWorkerHost. class CONTENT_EXPORT ServiceWorkerProviderHost { public: - // Used to create a ServiceWorkerProviderHost for a window during a - // navigation. The ServiceWorkerProviderContext will later be created in the - // enderer, should the navigation succeed. |are_ancestors_secure| should be - // true for main frames. Otherwise it is true iff all ancestor frames of this - // frame have a secure origin. |frame_tree_node_id| is FrameTreeNode id. - // |web_contents_getter| indicates the tab where the navigation is occurring. - // - // The returned host stays alive as long as the corresponding host ptr for - // |host_request| stays alive. - // - // TODO(https://crbug.com/931087): ServiceWorkerProviderHost is not necessary - // for window clients. We should remove this creation function, and instead - // directly create ServiceWorkerContainerHost for the clients. - static base::WeakPtr<ServiceWorkerProviderHost> CreateForWindow( - base::WeakPtr<ServiceWorkerContextCore> context, - bool are_ancestors_secure, - int frame_tree_node_id, + ServiceWorkerProviderHost( mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote); - - // Used for starting a service worker. Returns a provider host for the service - // worker and partially fills |out_provider_info|. The host stays alive as - // long as this info stays alive (namely, as long as - // |out_provider_info->host_remote| stays alive). - // CompleteStartWorkerPreparation() must be called later to get a full info to - // send to the renderer. - static base::WeakPtr<ServiceWorkerProviderHost> CreateForServiceWorker( - base::WeakPtr<ServiceWorkerContextCore> context, - scoped_refptr<ServiceWorkerVersion> version, - blink::mojom::ServiceWorkerProviderInfoForStartWorkerPtr* - out_provider_info); - - // Used for starting a web worker (dedicated worker or shared worker). Returns - // a provider host for the worker. The host stays alive as long as the - // corresponding host for |host_receiver| stays alive. - // - // TODO(https://crbug.com/931087): ServiceWorkerProviderHost is not necessary - // for worker clients. We should remove this creation function, and instead - // directly create ServiceWorkerContainerHost for the clients. - static base::WeakPtr<ServiceWorkerProviderHost> CreateForWebWorker( - base::WeakPtr<ServiceWorkerContextCore> context, - int process_id, - blink::mojom::ServiceWorkerProviderType provider_type, - mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> - host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote); - + scoped_refptr<ServiceWorkerVersion> running_hosted_version, + base::WeakPtr<ServiceWorkerContextCore> context); ~ServiceWorkerProviderHost(); int provider_id() const { return provider_id_; } int worker_process_id() const { return worker_process_id_; } - // For service worker execution contexts. The version of the service worker. // This is nullptr when the worker is still starting up (until // CompleteStartWorkerPreparation() is called). ServiceWorkerVersion* running_hosted_version() const; - // TODO(https://crbug.com/931087): Remove this function in favor of the - // ServiceWorkerContainerHost::IsContainerForServiceWorker(). - bool IsProviderForServiceWorker() const; - - // For service worker execution contexts. Completes initialization of this - // provider host. It is called once a renderer process has been found to host - // the worker. + // Completes initialization of this provider host. It is called once a + // renderer process has been found to host the worker. void CompleteStartWorkerPreparation( int process_id, mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker> broker_receiver); - // For service worker execution contexts. void CreateQuicTransportConnector( mojo::PendingReceiver<blink::mojom::QuicTransportConnector> receiver); @@ -174,44 +79,22 @@ base::WeakPtr<ServiceWorkerProviderHost> GetWeakPtr(); private: - static void RegisterToContextCore( - base::WeakPtr<ServiceWorkerContextCore> context, - std::unique_ptr<ServiceWorkerProviderHost> host); - - ServiceWorkerProviderHost( - blink::mojom::ServiceWorkerProviderType type, - bool is_parent_frame_secure, - int frame_tree_node_id, - mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> - host_receiver, - mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> - container_remote, - scoped_refptr<ServiceWorkerVersion> running_hosted_version, - base::WeakPtr<ServiceWorkerContextCore> context); - - // For service worker execution contexts. Sets the process ID of the service - // worker execution context. - void SetWorkerProcessId(int process_id); - // Unique among all provider hosts. const int provider_id_; int worker_process_id_ = ChildProcessHost::kInvalidUniqueID; - // For service worker execution contexts. The ServiceWorkerVersion of the - // service worker this is a provider for. + // The instance of service worker this provider hosts. + // TODO(https://crbug.com/931087): Change this to a rawptr. const scoped_refptr<ServiceWorkerVersion> running_hosted_version_; - // For service worker execution contexts. BrowserInterfaceBrokerImpl<ServiceWorkerProviderHost, const ServiceWorkerVersionInfo&> broker_{this}; mojo::Receiver<blink::mojom::BrowserInterfaceBroker> broker_receiver_{ &broker_}; - // TODO(https://crbug.com/931087): Make an execution context host (e.g., - // RenderFrameHostImpl) own this container host. - std::unique_ptr<content::ServiceWorkerContainerHost> container_host_; + std::unique_ptr<ServiceWorkerContainerHost> container_host_; base::WeakPtrFactory<ServiceWorkerProviderHost> weak_factory_{this};
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 b4a48fa..57a9988d 100644 --- a/content/browser/service_worker/service_worker_provider_host_unittest.cc +++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
@@ -149,49 +149,51 @@ mojo::core::ProcessErrorCallback()); } - ServiceWorkerRemoteProviderEndpoint PrepareServiceWorkerProviderHost( + ServiceWorkerRemoteProviderEndpoint PrepareServiceWorkerContainerHost( const GURL& document_url) { ServiceWorkerRemoteProviderEndpoint remote_endpoint; net::SiteForCookies site_for_cookies = net::SiteForCookies::FromUrl(document_url); url::Origin top_frame_origin = url::Origin::Create(document_url); - CreateProviderHostInternal(document_url, site_for_cookies, top_frame_origin, - &remote_endpoint); + CreateContainerHostInternal(document_url, site_for_cookies, + top_frame_origin, &remote_endpoint); return remote_endpoint; } ServiceWorkerRemoteProviderEndpoint - PrepareServiceWorkerProviderHostWithSiteForCookies( + PrepareServiceWorkerContainerHostWithSiteForCookies( const GURL& document_url, const net::SiteForCookies& site_for_cookies, const base::Optional<url::Origin>& top_frame_origin) { ServiceWorkerRemoteProviderEndpoint remote_endpoint; - CreateProviderHostInternal(document_url, site_for_cookies, top_frame_origin, - &remote_endpoint); + CreateContainerHostInternal(document_url, site_for_cookies, + top_frame_origin, &remote_endpoint); return remote_endpoint; } - base::WeakPtr<ServiceWorkerProviderHost> CreateProviderHost( + base::WeakPtr<ServiceWorkerContainerHost> CreateContainerHost( const GURL& document_url) { net::SiteForCookies site_for_cookies = net::SiteForCookies::FromUrl(document_url); url::Origin top_frame_origin = url::Origin::Create(document_url); remote_endpoints_.emplace_back(); - return CreateProviderHostInternal(document_url, site_for_cookies, - top_frame_origin, - &remote_endpoints_.back()); + return CreateContainerHostInternal(document_url, site_for_cookies, + top_frame_origin, + &remote_endpoints_.back()); } - base::WeakPtr<ServiceWorkerProviderHost> - CreateProviderHostWithInsecureParentFrame(const GURL& document_url) { + base::WeakPtr<ServiceWorkerContainerHost> + CreateContainerHostWithInsecureParentFrame(const GURL& document_url) { remote_endpoints_.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - helper_->mock_render_process_id(), false /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), &remote_endpoints_.back()); - host->container_host()->UpdateUrls( - document_url, net::SiteForCookies::FromUrl(document_url), - url::Origin::Create(document_url)); - return host; + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), + false /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), + &remote_endpoints_.back()); + container_host->UpdateUrls(document_url, + net::SiteForCookies::FromUrl(document_url), + url::Origin::Create(document_url)); + return container_host; } void FinishNavigation(ServiceWorkerContainerHost* container_host) { @@ -325,17 +327,19 @@ std::vector<std::string> bad_messages_; private: - base::WeakPtr<ServiceWorkerProviderHost> CreateProviderHostInternal( + base::WeakPtr<ServiceWorkerContainerHost> CreateContainerHostInternal( const GURL& document_url, const net::SiteForCookies& site_for_cookies, const base::Optional<url::Origin>& top_frame_origin, ServiceWorkerRemoteProviderEndpoint* remote_endpoint) { - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - helper_->mock_render_process_id(), true /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), remote_endpoint); - host->container_host()->UpdateUrls(document_url, site_for_cookies, - top_frame_origin); - return host; + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), + true /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), + remote_endpoint); + container_host->UpdateUrls(document_url, site_for_cookies, + top_frame_origin); + return container_host; } DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHostTest); @@ -359,9 +363,8 @@ }; TEST_F(ServiceWorkerProviderHostTest, MatchRegistration) { - base::WeakPtr<ServiceWorkerProviderHost> provider_host = - CreateProviderHost(GURL("https://www.example.com/example1.html")); - ServiceWorkerContainerHost* container_host = provider_host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example1.html")); // Match registration should return the longest matching one. ASSERT_EQ(registration2_, container_host->MatchRegistration()); @@ -392,32 +395,30 @@ } TEST_F(ServiceWorkerProviderHostTest, ContextSecurity) { - base::WeakPtr<ServiceWorkerProviderHost> provider_host_secure_parent = - CreateProviderHost(GURL("https://www.example.com/example1.html")); - base::WeakPtr<ServiceWorkerProviderHost> provider_host_insecure_parent = - CreateProviderHostWithInsecureParentFrame( + base::WeakPtr<ServiceWorkerContainerHost> container_host_secure_parent = + CreateContainerHost(GURL("https://www.example.com/example1.html")); + base::WeakPtr<ServiceWorkerContainerHost> container_host_insecure_parent = + CreateContainerHostWithInsecureParentFrame( GURL("https://www.example.com/example1.html")); // Insecure document URL. - provider_host_secure_parent->container_host()->UpdateUrls( + container_host_secure_parent->UpdateUrls( GURL("http://host"), net::SiteForCookies::FromUrl(GURL("http://host")), url::Origin::Create(GURL("http://host"))); - EXPECT_FALSE(provider_host_secure_parent->container_host() - ->IsContextSecureForServiceWorker()); + EXPECT_FALSE(container_host_secure_parent->IsContextSecureForServiceWorker()); // Insecure parent frame. - provider_host_insecure_parent->container_host()->UpdateUrls( + container_host_insecure_parent->UpdateUrls( GURL("https://host"), net::SiteForCookies::FromUrl(GURL("https://host")), url::Origin::Create(GURL("https://host"))); - EXPECT_FALSE(provider_host_insecure_parent->container_host() - ->IsContextSecureForServiceWorker()); + EXPECT_FALSE( + container_host_insecure_parent->IsContextSecureForServiceWorker()); // Secure URL and parent frame. - provider_host_secure_parent->container_host()->UpdateUrls( + container_host_secure_parent->UpdateUrls( GURL("https://host"), net::SiteForCookies::FromUrl(GURL("https://host")), url::Origin::Create(GURL("https://host"))); - EXPECT_TRUE(provider_host_secure_parent->container_host() - ->IsContextSecureForServiceWorker()); + EXPECT_TRUE(container_host_secure_parent->IsContextSecureForServiceWorker()); // Exceptional service worker scheme. GURL url(std::string(kServiceWorkerScheme) + "://host"); @@ -425,24 +426,23 @@ EXPECT_TRUE(url.is_valid()); EXPECT_FALSE(IsOriginSecure(url)); EXPECT_TRUE(OriginCanAccessServiceWorkers(url)); - provider_host_secure_parent->container_host()->UpdateUrls( + container_host_secure_parent->UpdateUrls( url, net::SiteForCookies::FromUrl(url), origin); - EXPECT_TRUE(provider_host_secure_parent->container_host() - ->IsContextSecureForServiceWorker()); + EXPECT_TRUE(container_host_secure_parent->IsContextSecureForServiceWorker()); // Exceptional service worker scheme with insecure parent frame. - provider_host_insecure_parent->container_host()->UpdateUrls( + container_host_insecure_parent->UpdateUrls( url, net::SiteForCookies::FromUrl(url), origin); - EXPECT_FALSE(provider_host_insecure_parent->container_host() - ->IsContextSecureForServiceWorker()); + EXPECT_FALSE( + container_host_insecure_parent->IsContextSecureForServiceWorker()); } TEST_F(ServiceWorkerProviderHostTest, UpdateUrls_SameOriginRedirect) { const GURL url1("https://origin1.example.com/page1.html"); const GURL url2("https://origin1.example.com/page2.html"); - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHost(url1); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(url1); const std::string uuid1 = container_host->client_uuid(); EXPECT_EQ(url1, container_host->url()); EXPECT_TRUE(container_host->site_for_cookies().IsEquivalent( @@ -455,16 +455,16 @@ net::SiteForCookies::FromUrl(url2))); EXPECT_EQ(uuid1, container_host->client_uuid()); - EXPECT_EQ(container_host, context_->GetContainerHostByClientID( - container_host->client_uuid())); + EXPECT_EQ(container_host.get(), context_->GetContainerHostByClientID( + container_host->client_uuid())); } TEST_F(ServiceWorkerProviderHostTest, UpdateUrls_CrossOriginRedirect) { const GURL url1("https://origin1.example.com/page1.html"); const GURL url2("https://origin2.example.com/page2.html"); - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHost(url1); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(url1); const std::string uuid1 = container_host->client_uuid(); EXPECT_EQ(url1, container_host->url()); EXPECT_TRUE(container_host->site_for_cookies().IsEquivalent( @@ -478,8 +478,8 @@ EXPECT_NE(uuid1, container_host->client_uuid()); EXPECT_FALSE(context_->GetContainerHostByClientID(uuid1)); - EXPECT_EQ(container_host, context_->GetContainerHostByClientID( - container_host->client_uuid())); + EXPECT_EQ(container_host.get(), context_->GetContainerHostByClientID( + container_host->client_uuid())); } class MockServiceWorkerRegistration : public ServiceWorkerRegistration { @@ -510,16 +510,16 @@ }; TEST_F(ServiceWorkerProviderHostTest, RemoveProvider) { - // Create a provider host connected with the renderer process. - base::WeakPtr<ServiceWorkerProviderHost> provider_host = - CreateProviderHost(GURL("https://www.example.com/example1.html")); - EXPECT_TRUE(provider_host); + // Create a container host connected with the renderer process. + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example1.html")); + EXPECT_TRUE(container_host); // Disconnect the mojo pipe from the renderer side. ASSERT_TRUE(remote_endpoints_.back().host_remote()->is_bound()); remote_endpoints_.back().host_remote()->reset(); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(provider_host); + EXPECT_FALSE(container_host); } class MockServiceWorkerContainer : public blink::mojom::ServiceWorkerContainer { @@ -549,10 +549,10 @@ TEST_F(ServiceWorkerProviderHostTest, Controller) { // Create a host. - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); remote_endpoints_.emplace_back(); remote_endpoints_.back().BindForWindow(std::move(host_and_info->info)); @@ -569,10 +569,8 @@ version->SetStatus(ServiceWorkerVersion::ACTIVATED); registration1_->SetActiveVersion(version); - ServiceWorkerContainerHost* container_host = host->container_host(); - // Finish the navigation. - FinishNavigation(container_host); + FinishNavigation(container_host.get()); container_host->SetControllerRegistration( registration1_, false /* notify_controllerchange */); remote_endpoints_.back().host_remote()->get()->OnExecutionReady(); @@ -587,10 +585,10 @@ TEST_F(ServiceWorkerProviderHostTest, UncontrolledWithMatchingRegistration) { // Create a host. - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); remote_endpoints_.emplace_back(); remote_endpoints_.back().BindForWindow(std::move(host_and_info->info)); @@ -604,10 +602,8 @@ helper_->context()->AsWeakPtr()); registration1_->SetInstallingVersion(version); - ServiceWorkerContainerHost* container_host = host->container_host(); - // Finish the navigation. - FinishNavigation(container_host); + FinishNavigation(container_host.get()); // Promote the worker to active while navigation is still happening. registration1_->SetActiveVersion(version); base::RunLoop().RunUntilIdle(); @@ -629,7 +625,7 @@ SetBrowserClientForTesting(&test_browser_client); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHostWithSiteForCookies( + PrepareServiceWorkerContainerHostWithSiteForCookies( GURL("https://www.example.com/foo"), net::SiteForCookies::FromUrl(GURL("https://www.example.com/top")), url::Origin::Create(GURL("https://www.example.com"))); @@ -691,16 +687,17 @@ registration1_->SetActiveVersion(version); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerProviderHost> provider_host = CreateProviderHostForServiceWorkerContext( helper_->mock_render_process_id(), true /* is_parent_frame_secure */, version.get(), helper_->context()->AsWeakPtr(), &remote_endpoint); + ServiceWorkerContainerHost* container_host = provider_host->container_host(); ServiceWorkerTestContentBrowserClient test_browser_client; ContentBrowserClient* old_browser_client = SetBrowserClientForTesting(&test_browser_client); - EXPECT_FALSE(host->container_host()->AllowServiceWorker( + EXPECT_FALSE(container_host->AllowServiceWorker( GURL("https://www.example.com/scope"), GURL())); ASSERT_EQ(1ul, test_browser_client.logs().size()); @@ -717,7 +714,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_HTTPS) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kNone, Register(remote_endpoint.host_remote()->get(), @@ -727,7 +724,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_NonSecureTransportLocalhost) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("http://127.0.0.3:81/foo")); + PrepareServiceWorkerContainerHost(GURL("http://127.0.0.3:81/foo")); EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kNone, Register(remote_endpoint.host_remote()->get(), @@ -737,7 +734,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_InvalidScopeShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); Register(remote_endpoint.host_remote()->get(), GURL(""), @@ -747,7 +744,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_InvalidScriptShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); Register(remote_endpoint.host_remote()->get(), @@ -757,7 +754,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_NonSecureOriginShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("http://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("http://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); Register(remote_endpoint.host_remote()->get(), @@ -767,7 +764,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_CrossOriginShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); // Script has a different host @@ -806,7 +803,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_BadCharactersShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com")); ASSERT_TRUE(bad_messages_.empty()); Register(remote_endpoint.host_remote()->get(), @@ -842,7 +839,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_FileSystemDocumentShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost( + PrepareServiceWorkerContainerHost( GURL("filesystem:https://www.example.com/temporary/a")); ASSERT_TRUE(bad_messages_.empty()); @@ -865,7 +862,7 @@ TEST_F(ServiceWorkerProviderHostTest, Register_FileSystemScriptOrScopeShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost( + PrepareServiceWorkerContainerHost( GURL("https://www.example.com/temporary/")); ASSERT_TRUE(bad_messages_.empty()); @@ -887,7 +884,7 @@ TEST_F(ServiceWorkerProviderHostTest, EarlyContextDeletion) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); helper_->ShutdownContext(); @@ -901,7 +898,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistration_Success) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); const GURL kScope("https://www.example.com/"); EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kNone, @@ -918,7 +915,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistration_NotFoundShouldReturnNull) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info; EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kNone, @@ -929,7 +926,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistration_CrossOriginShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); GetRegistration(remote_endpoint.host_remote()->get(), @@ -939,7 +936,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistration_InvalidScopeShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); GetRegistration(remote_endpoint.host_remote()->get(), GURL("")); @@ -949,7 +946,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistration_NonSecureOriginShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("http://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("http://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); GetRegistration(remote_endpoint.host_remote()->get(), @@ -959,7 +956,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistrations_SecureOrigin) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("https://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("https://www.example.com/foo")); EXPECT_EQ(blink::mojom::ServiceWorkerErrorType::kNone, GetRegistrations(remote_endpoint.host_remote()->get())); @@ -968,7 +965,7 @@ TEST_F(ServiceWorkerProviderHostTest, GetRegistrations_NonSecureOriginShouldFail) { ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareServiceWorkerProviderHost(GURL("http://www.example.com/foo")); + PrepareServiceWorkerContainerHost(GURL("http://www.example.com/foo")); ASSERT_TRUE(bad_messages_.empty()); GetRegistrations(remote_endpoint.host_remote()->get()); @@ -992,35 +989,35 @@ client_remote.InitWithNewEndpointAndPassReceiver(); host_receiver = provider_info->host_remote.InitWithNewEndpointAndPassReceiver(); - base::WeakPtr<ServiceWorkerProviderHost> host = - ServiceWorkerProviderHost::CreateForWebWorker( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + ServiceWorkerContainerHost::CreateForWebWorker( context_->AsWeakPtr(), helper_->mock_render_process_id(), provider_type, std::move(host_receiver), std::move(client_remote)); - host->container_host()->UpdateUrls(url, net::SiteForCookies::FromUrl(url), - url::Origin::Create(url)); - EXPECT_FALSE(CanFindClientContainerHost(host->container_host())); - host->container_host()->CompleteWebWorkerPreparation( + container_host->UpdateUrls(url, net::SiteForCookies::FromUrl(url), + url::Origin::Create(url)); + EXPECT_FALSE(CanFindClientContainerHost(container_host.get())); + container_host->CompleteWebWorkerPreparation( network::mojom::CrossOriginEmbedderPolicy::kNone); - EXPECT_TRUE(CanFindClientContainerHost(host->container_host())); + EXPECT_TRUE(CanFindClientContainerHost(container_host.get())); } { - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); ServiceWorkerRemoteProviderEndpoint remote_endpoint; remote_endpoint.BindForWindow(std::move(host_and_info->info)); - FinishNavigation(host->container_host()); - EXPECT_FALSE(CanFindClientContainerHost(host->container_host())); + FinishNavigation(container_host.get()); + EXPECT_FALSE(CanFindClientContainerHost(container_host.get())); base::RunLoop run_loop; - host->container_host()->AddExecutionReadyCallback(run_loop.QuitClosure()); + container_host->AddExecutionReadyCallback(run_loop.QuitClosure()); remote_endpoint.host_remote()->get()->OnExecutionReady(); run_loop.Run(); - EXPECT_TRUE(CanFindClientContainerHost(host->container_host())); + EXPECT_TRUE(CanFindClientContainerHost(container_host.get())); } } @@ -1042,18 +1039,17 @@ // Tests the client phase transitions for a navigation. TEST_F(ServiceWorkerProviderHostTest, ClientPhaseForWindow) { - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); - ServiceWorkerContainerHost* container_host = host->container_host(); ServiceWorkerRemoteProviderEndpoint remote_endpoint; remote_endpoint.BindForWindow(std::move(host_and_info->info)); EXPECT_FALSE(container_host->is_response_committed()); EXPECT_FALSE(container_host->is_execution_ready()); - FinishNavigation(container_host); + FinishNavigation(container_host.get()); EXPECT_TRUE(container_host->is_response_committed()); EXPECT_FALSE(container_host->is_execution_ready()); @@ -1078,11 +1074,10 @@ client_remote.InitWithNewEndpointAndPassReceiver(); host_receiver = provider_info->host_remote.InitWithNewEndpointAndPassReceiver(); - base::WeakPtr<ServiceWorkerProviderHost> host = - ServiceWorkerProviderHost::CreateForWebWorker( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + ServiceWorkerContainerHost::CreateForWebWorker( helper_->context()->AsWeakPtr(), helper_->mock_render_process_id(), provider_type, std::move(host_receiver), std::move(client_remote)); - ServiceWorkerContainerHost* container_host = host->container_host(); EXPECT_FALSE(container_host->is_response_committed()); EXPECT_FALSE(container_host->is_execution_ready()); @@ -1132,11 +1127,12 @@ }; // Test that a client in BackForwardCache is not included -// when iterating over client provider hosts. If it were, it'd be undesirably +// when iterating over client container hosts. If it were, it'd be undesirably // exposed via the Clients API. void ServiceWorkerProviderHostTest::TestBackForwardCachedClientsAreNotExposed( blink::mojom::ServiceWorkerProviderType provider_type, const GURL& url) { + std::unique_ptr<ServiceWorkerProviderHost> provider_host; { // Create an active version. scoped_refptr<ServiceWorkerVersion> version = @@ -1146,34 +1142,32 @@ registration1_->SetActiveVersion(version); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHostForServiceWorkerContext( - helper_->mock_render_process_id(), - true /* is_parent_frame_secure */, version.get(), - helper_->context()->AsWeakPtr(), &remote_endpoint); - ASSERT_TRUE(host); + provider_host = CreateProviderHostForServiceWorkerContext( + helper_->mock_render_process_id(), true /* is_parent_frame_secure */, + version.get(), helper_->context()->AsWeakPtr(), &remote_endpoint); + ASSERT_TRUE(provider_host); } { - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); ServiceWorkerRemoteProviderEndpoint remote_endpoint; remote_endpoint.BindForWindow(std::move(host_and_info->info)); - FinishNavigation(host->container_host()); - EXPECT_FALSE(CanFindClientContainerHost(host->container_host())); + FinishNavigation(container_host.get()); + EXPECT_FALSE(CanFindClientContainerHost(container_host.get())); base::RunLoop run_loop; - host->container_host()->AddExecutionReadyCallback(run_loop.QuitClosure()); + container_host->AddExecutionReadyCallback(run_loop.QuitClosure()); remote_endpoint.host_remote()->get()->OnExecutionReady(); run_loop.Run(); - EXPECT_TRUE(CanFindClientContainerHost(host->container_host())); - host->container_host()->EnterBackForwardCacheForTesting(); - EXPECT_FALSE(CanFindClientContainerHost(host->container_host())); - host->container_host()->LeaveBackForwardCacheForTesting(); - EXPECT_TRUE(CanFindClientContainerHost(host->container_host())); + EXPECT_TRUE(CanFindClientContainerHost(container_host.get())); + container_host->EnterBackForwardCacheForTesting(); + EXPECT_FALSE(CanFindClientContainerHost(container_host.get())); + container_host->LeaveBackForwardCacheForTesting(); + EXPECT_TRUE(CanFindClientContainerHost(container_host.get())); } } @@ -1192,9 +1186,8 @@ // destroyed. TEST_F(ServiceWorkerProviderHostTest, UpdateServiceWorkerOnDestruction) { // Make a window. - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHost(GURL("https://www.example.com/example.html")); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example.html")); // Make an active version. auto version1 = base::MakeRefCounted<ServiceWorkerVersion>( @@ -1220,12 +1213,12 @@ ExpectUpdateIsNotScheduled(version1.get()); ExpectUpdateIsNotScheduled(version2.get()); - // Destroy the provider host. + // Destroy the container host. ASSERT_TRUE(remote_endpoints_.back().host_remote()->is_bound()); remote_endpoints_.back().host_remote()->reset(); base::RunLoop().RunUntilIdle(); - // The provider host's destructor should have scheduled the update. + // The container host's destructor should have scheduled the update. ExpectUpdateIsScheduled(version1.get()); ExpectUpdateIsScheduled(version2.get()); } @@ -1244,15 +1237,14 @@ registration1_->SetActiveVersion(version1); // Make a window. - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHost(GURL("https://www.example.com/example.html")); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example.html")); // Mark the service worker as needing update. Update should not be scheduled // yet. container_host->AddServiceWorkerToUpdate(version1); ExpectUpdateIsNotScheduled(version1.get()); - EXPECT_TRUE(HasVersionToUpdate(container_host)); + EXPECT_TRUE(HasVersionToUpdate(container_host.get())); // Send the hint from the renderer. Update should be scheduled. mojo::AssociatedRemote<blink::mojom::ServiceWorkerContainerHost>* @@ -1260,7 +1252,7 @@ (*host_remote)->HintToUpdateServiceWorker(); base::RunLoop().RunUntilIdle(); ExpectUpdateIsScheduled(version1.get()); - EXPECT_FALSE(HasVersionToUpdate(container_host)); + EXPECT_FALSE(HasVersionToUpdate(container_host.get())); } // Tests that the host receives a HintToUpdateServiceWorker message but @@ -1269,9 +1261,8 @@ TEST_F(ServiceWorkerProviderHostTest, HintToUpdateServiceWorkerButNoVersionToUpdate) { // Make a window. - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHost(GURL("https://www.example.com/example.html")); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example.html")); // Make an active version. auto version1 = base::MakeRefCounted<ServiceWorkerVersion>( @@ -1287,7 +1278,7 @@ // resource request, so AddServiceWorkerToUpdate() is not called. ExpectUpdateIsNotScheduled(version1.get()); - EXPECT_FALSE(HasVersionToUpdate(container_host)); + EXPECT_FALSE(HasVersionToUpdate(container_host.get())); // Send the hint from the renderer. Update should not be scheduled, since // AddServiceWorkerToUpdate() was not called. @@ -1296,7 +1287,7 @@ (*host_remote)->HintToUpdateServiceWorker(); base::RunLoop().RunUntilIdle(); ExpectUpdateIsNotScheduled(version1.get()); - EXPECT_FALSE(HasVersionToUpdate(container_host)); + EXPECT_FALSE(HasVersionToUpdate(container_host.get())); } TEST_F(ServiceWorkerProviderHostTest, HintToUpdateServiceWorkerMultiple) { @@ -1329,9 +1320,8 @@ registration3_->SetActiveVersion(version1); // Make a window. - base::WeakPtr<ServiceWorkerProviderHost> host = - CreateProviderHost(GURL("https://www.example.com/example.html")); - ServiceWorkerContainerHost* container_host = host->container_host(); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHost(GURL("https://www.example.com/example.html")); // Mark the service worker as needing update. Update should not be scheduled // yet. @@ -1341,7 +1331,7 @@ ExpectUpdateIsNotScheduled(version1.get()); ExpectUpdateIsNotScheduled(version2.get()); ExpectUpdateIsNotScheduled(version3.get()); - EXPECT_TRUE(HasVersionToUpdate(container_host)); + EXPECT_TRUE(HasVersionToUpdate(container_host.get())); // Pretend another page also used version3. version3->IncrementPendingUpdateHintCount(); @@ -1355,7 +1345,7 @@ ExpectUpdateIsScheduled(version1.get()); ExpectUpdateIsScheduled(version2.get()); ExpectUpdateIsNotScheduled(version3.get()); - EXPECT_FALSE(HasVersionToUpdate(container_host)); + EXPECT_FALSE(HasVersionToUpdate(container_host.get())); // Pretend the other page also finished for version3. version3->DecrementPendingUpdateHintCount();
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc index c5563cc6..e0cb94a 100644 --- a/content/browser/service_worker/service_worker_registration_unittest.cc +++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -316,16 +316,15 @@ options.scope = kScope; auto registration = base::MakeRefCounted<ServiceWorkerRegistration>( options, kRegistrationId, context()->AsWeakPtr()); - // Prepare a ServiceWorkerProviderHost. + // Prepare a ServiceWorkerContainerHost. ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> provider_host = - CreateProviderHostForWindow(helper_->mock_render_process_id(), - true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoint); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), + true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoint); auto registration_object_host = std::make_unique<ServiceWorkerRegistrationObjectHost>( - context()->AsWeakPtr(), provider_host->container_host(), - registration); + context()->AsWeakPtr(), container_host.get(), registration); // To enable the caller end point // |registration_object_host->remote_registration_| to make calls safely with // no need to pass |object_info_->receiver| through a message pipe endpoint. @@ -425,14 +424,14 @@ ASSERT_EQ(blink::ServiceWorkerStatusCode::kOk, status.value()); // Give the active version a controllee. - host_ = CreateProviderHostForWindow( + container_host_ = CreateContainerHostForWindow( helper_->mock_render_process_id(), true /* is_parent_frame_secure */, context()->AsWeakPtr(), &remote_endpoint_); DCHECK(remote_endpoint_.client_receiver()->is_valid()); DCHECK(remote_endpoint_.host_remote()->is_bound()); - host_->container_host()->UpdateUrls( - kUrl, net::SiteForCookies::FromUrl(kUrl), url::Origin::Create(kUrl)); - host_->container_host()->SetControllerRegistration( + container_host_->UpdateUrls(kUrl, net::SiteForCookies::FromUrl(kUrl), + url::Origin::Create(kUrl)); + container_host_->SetControllerRegistration( registration_, false /* notify_controllerchange */); // Setup the Mojo implementation fakes for the renderer-side service worker. @@ -497,16 +496,15 @@ bool devtools_should_be_attached() const { return GetParam(); } ServiceWorkerRegistration* registration() { return registration_.get(); } - ServiceWorkerProviderHost* controllee() { return host_.get(); } int inflight_request_id() const { return inflight_request_id_; } void AddControllee() { - controllee()->container_host()->SetControllerRegistration( + container_host_->SetControllerRegistration( registration(), false /* notify_controllerchange */); } void RemoveControllee() { - controllee()->container_host()->SetControllerRegistration( + container_host_->SetControllerRegistration( nullptr, false /* notify_controllerchange */); } @@ -562,7 +560,7 @@ FakeEmbeddedWorkerInstanceClient* version_2_client_ = nullptr; FakeServiceWorker* version_2_service_worker_ = nullptr; - base::WeakPtr<ServiceWorkerProviderHost> host_; + base::WeakPtr<ServiceWorkerContainerHost> container_host_; ServiceWorkerRemoteProviderEndpoint remote_endpoint_; int inflight_request_id_ = -1; @@ -932,18 +930,19 @@ return registration->id(); } - ServiceWorkerRemoteProviderEndpoint PrepareProviderHost( + ServiceWorkerRemoteProviderEndpoint PrepareContainerHost( const GURL& document_url, - base::WeakPtr<ServiceWorkerProviderHost>* out_host) { + base::WeakPtr<ServiceWorkerContainerHost>* out_container_host) { ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - helper_->mock_render_process_id(), true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoint); - host->container_host()->UpdateUrls( - document_url, net::SiteForCookies::FromUrl(document_url), - url::Origin::Create(document_url)); - if (out_host) - *out_host = host; + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), + true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoint); + container_host->UpdateUrls(document_url, + net::SiteForCookies::FromUrl(document_url), + url::Origin::Create(document_url)); + if (out_container_host) + *out_container_host = container_host; return remote_endpoint; } @@ -996,7 +995,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> @@ -1014,7 +1013,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> registration_host; blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = @@ -1034,9 +1033,9 @@ const GURL kScope("https://www.example.com/"); const GURL kScriptUrl("https://www.example.com/sw.js"); SetUpRegistration(kScope, kScriptUrl); - base::WeakPtr<ServiceWorkerProviderHost> provider_host; + base::WeakPtr<ServiceWorkerContainerHost> container_host; ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, &provider_host); + PrepareContainerHost(kScope, &container_host); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> @@ -1045,8 +1044,8 @@ ASSERT_TRUE(bad_messages_.empty()); GURL url("https://does.not.exist/"); - provider_host->container_host()->UpdateUrls( - url, net::SiteForCookies::FromUrl(url), url::Origin::Create(url)); + container_host->UpdateUrls(url, net::SiteForCookies::FromUrl(url), + url::Origin::Create(url)); CallUpdate(registration_host.get(), /*out_error_msg=*/nullptr); EXPECT_EQ(1u, bad_messages_.size()); } @@ -1057,7 +1056,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> @@ -1084,7 +1083,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> registration_host; @@ -1151,13 +1150,13 @@ version->SetStatus(ServiceWorkerVersion::ACTIVATED); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - helper_->mock_render_process_id(), true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoint); - host->container_host()->UpdateUrls(kScope, - net::SiteForCookies::FromUrl(kScope), - url::Origin::Create(kScope)); - version->AddControllee(host->container_host()); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(helper_->mock_render_process_id(), + true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoint); + container_host->UpdateUrls(kScope, net::SiteForCookies::FromUrl(kScope), + url::Origin::Create(kScope)); + version->AddControllee(container_host.get()); // Initially set |self_update_delay| to zero. registration->set_self_update_delay(base::TimeDelta()); @@ -1182,7 +1181,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> registration_host; blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = @@ -1210,9 +1209,9 @@ const GURL kScope("https://www.example.com/"); const GURL kScriptUrl("https://www.example.com/sw.js"); SetUpRegistration(kScope, kScriptUrl); - base::WeakPtr<ServiceWorkerProviderHost> provider_host; + base::WeakPtr<ServiceWorkerContainerHost> container_host; ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, &provider_host); + PrepareContainerHost(kScope, &container_host); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> @@ -1220,7 +1219,7 @@ registration_host.Bind(std::move(info->host_remote)); ASSERT_TRUE(bad_messages_.empty()); - provider_host->container_host()->UpdateUrls( + container_host->UpdateUrls( GURL("https://does.not.exist/"), net::SiteForCookies::FromUrl(GURL("https://does.not.exist/")), url::Origin::Create(GURL("https://does.not.exist/"))); @@ -1234,7 +1233,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); mojo::AssociatedRemote<blink::mojom::ServiceWorkerRegistrationObjectHost> @@ -1254,7 +1253,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); EXPECT_EQ(registration_id, info->registration_id); @@ -1338,7 +1337,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); EXPECT_EQ(registration_id, info->registration_id); @@ -1389,7 +1388,7 @@ const GURL kScriptUrl("https://www.example.com/sw.js"); int64_t registration_id = SetUpRegistration(kScope, kScriptUrl); ServiceWorkerRemoteProviderEndpoint remote_endpoint = - PrepareProviderHost(kScope, nullptr /* out_host */); + PrepareContainerHost(kScope, nullptr /* out_container_host */); blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info = GetRegistrationFromRemote(remote_endpoint.host_remote()->get(), kScope); EXPECT_EQ(registration_id, info->registration_id);
diff --git a/content/browser/service_worker/service_worker_script_loader_factory.cc b/content/browser/service_worker/service_worker_script_loader_factory.cc index d798d034..ccfe16d4 100644 --- a/content/browser/service_worker/service_worker_script_loader_factory.cc +++ b/content/browser/service_worker/service_worker_script_loader_factory.cc
@@ -33,7 +33,6 @@ provider_host_(provider_host), loader_factory_for_new_scripts_( std::move(loader_factory_for_new_scripts)) { - DCHECK(provider_host_->IsProviderForServiceWorker()); DCHECK(loader_factory_for_new_scripts_ || ServiceWorkerVersion::IsInstalled( provider_host_->running_hosted_version()->status()));
diff --git a/content/browser/service_worker/service_worker_script_loader_factory_unittest.cc b/content/browser/service_worker/service_worker_script_loader_factory_unittest.cc index ea03614..31de3c8 100644 --- a/content/browser/service_worker/service_worker_script_loader_factory_unittest.cc +++ b/content/browser/service_worker/service_worker_script_loader_factory_unittest.cc
@@ -50,7 +50,7 @@ version_.get(), context->AsWeakPtr(), &remote_endpoint_); factory_ = std::make_unique<ServiceWorkerScriptLoaderFactory>( - helper_->context()->AsWeakPtr(), provider_host_, + helper_->context()->AsWeakPtr(), provider_host_->GetWeakPtr(), helper_->url_loader_factory_getter()->GetNetworkFactory()); } @@ -79,7 +79,7 @@ GURL script_url_; scoped_refptr<ServiceWorkerRegistration> registration_; scoped_refptr<ServiceWorkerVersion> version_; - base::WeakPtr<ServiceWorkerProviderHost> provider_host_; + std::unique_ptr<ServiceWorkerProviderHost> provider_host_; ServiceWorkerRemoteProviderEndpoint remote_endpoint_; std::unique_ptr<ServiceWorkerScriptLoaderFactory> factory_; }; @@ -103,7 +103,7 @@ } TEST_F(ServiceWorkerScriptLoaderFactoryTest, NoProviderHost) { - helper_->context()->RemoveProviderHost(provider_host_->provider_id()); + provider_host_.reset(); network::TestURLLoaderClient client; mojo::PendingRemote<network::mojom::URLLoader> loader =
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc index f2cc310..0714354 100644 --- a/content/browser/service_worker/service_worker_storage.cc +++ b/content/browser/service_worker/service_worker_storage.cc
@@ -446,6 +446,7 @@ data.script_response_time = version->GetInfo().script_response_time; for (const blink::mojom::WebFeature feature : version->used_features()) data.used_features.insert(feature); + data.cross_origin_embedder_policy = version->cross_origin_embedder_policy(); ResourceList resources; version->script_cache_map()->GetResources(&resources); @@ -1663,6 +1664,8 @@ version->SetValidOriginTrialTokens(*data.origin_trial_tokens); version->set_used_features(data.used_features); + version->set_cross_origin_embedder_policy( + data.cross_origin_embedder_policy); } version->set_script_response_time_for_devtools(data.script_response_time);
diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc index e8ff91c5..5cc7e7f 100644 --- a/content/browser/service_worker/service_worker_storage_unittest.cc +++ b/content/browser/service_worker/service_worker_storage_unittest.cc
@@ -721,6 +721,8 @@ live_version->script_cache_map()->SetResources(resources); live_version->set_used_features( std::set<blink::mojom::WebFeature>(used_features)); + live_version->set_cross_origin_embedder_policy( + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp); live_registration->SetWaitingVersion(live_version); live_registration->set_last_update_check(kYesterday); EXPECT_EQ(blink::ServiceWorkerStatusCode::kOk, @@ -736,6 +738,9 @@ found_registration->resources_total_size_bytes()); EXPECT_EQ(used_features, found_registration->waiting_version()->used_features()); + EXPECT_EQ( + found_registration->waiting_version()->cross_origin_embedder_policy(), + network::mojom::CrossOriginEmbedderPolicy::kRequireCorp); found_registration = nullptr; // But FindRegistrationForScope is always async. @@ -1408,10 +1413,11 @@ registration_->scope().GetOrigin(), base::DoNothing()); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoint); - registration_->active_version()->AddControllee(host->container_host()); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(33 /* dummy render process id */, + true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoint); + registration_->active_version()->AddControllee(container_host.get()); // Deleting the registration should move the resources to the purgeable list // but keep them available. @@ -1426,7 +1432,7 @@ base::RunLoop loop; storage()->SetPurgingCompleteCallbackForTest(loop.QuitClosure()); registration_->active_version()->RemoveControllee( - host->container_host()->client_uuid()); + container_host->client_uuid()); registration_->active_version()->Doom(); loop.Run(); EXPECT_TRUE(GetPurgeableResourceIdsFromDB().empty()); @@ -1444,10 +1450,11 @@ registration_->scope().GetOrigin(), base::DoNothing()); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - context()->AsWeakPtr(), &remote_endpoint); - registration_->active_version()->AddControllee(host->container_host()); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow(33 /* dummy render process id */, + true /* is_parent_frame_secure */, + context()->AsWeakPtr(), &remote_endpoint); + registration_->active_version()->AddControllee(container_host.get()); // Deleting the registration should move the resources to the purgeable list // but keep them available. @@ -1579,10 +1586,11 @@ registration_->scope().GetOrigin(), base::DoNothing()); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), &remote_endpoint); - registration_->active_version()->AddControllee(host->container_host()); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( + 33 /* dummy render process id */, true /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), &remote_endpoint); + registration_->active_version()->AddControllee(container_host.get()); // Make an updated registration. scoped_refptr<ServiceWorkerVersion> live_version = new ServiceWorkerVersion( @@ -1613,7 +1621,7 @@ storage()->SetPurgingCompleteCallbackForTest(loop.QuitClosure()); scoped_refptr<ServiceWorkerVersion> old_version( registration_->active_version()); - old_version->RemoveControllee(host->container_host()->client_uuid()); + old_version->RemoveControllee(container_host->client_uuid()); registration_->ActivateWaitingVersionWhenReady(); EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, old_version->status());
diff --git a/content/browser/service_worker/service_worker_test_utils.cc b/content/browser/service_worker/service_worker_test_utils.cc index 56efbdb..390b766b 100644 --- a/content/browser/service_worker/service_worker_test_utils.cc +++ b/content/browser/service_worker/service_worker_test_utils.cc
@@ -249,34 +249,35 @@ host_remote_.Bind(std::move(info->host_remote)); } -ServiceWorkerProviderHostAndInfo::ServiceWorkerProviderHostAndInfo( - base::WeakPtr<ServiceWorkerProviderHost> host, +ServiceWorkerContainerHostAndInfo::ServiceWorkerContainerHostAndInfo( + base::WeakPtr<ServiceWorkerContainerHost> host, blink::mojom::ServiceWorkerProviderInfoForClientPtr info) : host(std::move(host)), info(std::move(info)) {} -ServiceWorkerProviderHostAndInfo::~ServiceWorkerProviderHostAndInfo() = default; +ServiceWorkerContainerHostAndInfo::~ServiceWorkerContainerHostAndInfo() = + default; -base::WeakPtr<ServiceWorkerProviderHost> CreateProviderHostForWindow( +base::WeakPtr<ServiceWorkerContainerHost> CreateContainerHostForWindow( int process_id, bool is_parent_frame_secure, base::WeakPtr<ServiceWorkerContextCore> context, ServiceWorkerRemoteProviderEndpoint* output_endpoint) { - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(context, is_parent_frame_secure); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(context, is_parent_frame_secure); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); output_endpoint->BindForWindow(std::move(host_and_info->info)); // In production code this is called from NavigationRequest in the browser // process right before navigation commit. - host->container_host()->OnBeginNavigationCommit( + container_host->OnBeginNavigationCommit( process_id, 1 /* route_id */, network::mojom::CrossOriginEmbedderPolicy::kNone); - return host; + return container_host; } -std::unique_ptr<ServiceWorkerProviderHostAndInfo> -CreateProviderHostAndInfoForWindow( +std::unique_ptr<ServiceWorkerContainerHostAndInfo> +CreateContainerHostAndInfoForWindow( base::WeakPtr<ServiceWorkerContextCore> context, bool are_ancestors_secure) { mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> @@ -286,8 +287,8 @@ auto info = blink::mojom::ServiceWorkerProviderInfoForClient::New(); info->client_receiver = client_remote.InitWithNewEndpointAndPassReceiver(); host_receiver = info->host_remote.InitWithNewEndpointAndPassReceiver(); - return std::make_unique<ServiceWorkerProviderHostAndInfo>( - ServiceWorkerProviderHost::CreateForWindow( + return std::make_unique<ServiceWorkerContainerHostAndInfo>( + ServiceWorkerContainerHost::CreateForWindow( context, are_ancestors_secure, FrameTreeNode::kFrameTreeNodeInvalidId, std::move(host_receiver), std::move(client_remote)), std::move(info)); @@ -326,7 +327,7 @@ run_loop.Run(); } -base::WeakPtr<ServiceWorkerProviderHost> +std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForServiceWorkerContext( int process_id, bool is_parent_frame_secure, @@ -335,10 +336,9 @@ ServiceWorkerRemoteProviderEndpoint* output_endpoint) { auto provider_info = blink::mojom::ServiceWorkerProviderInfoForStartWorker::New(); - base::WeakPtr<ServiceWorkerProviderHost> host = - ServiceWorkerProviderHost::CreateForServiceWorker( - std::move(context), base::WrapRefCounted(hosted_version), - &provider_info); + auto host = std::make_unique<ServiceWorkerProviderHost>( + provider_info->host_remote.InitWithNewEndpointAndPassReceiver(), + base::WrapRefCounted(hosted_version), std::move(context)); host->CompleteStartWorkerPreparation( process_id,
diff --git a/content/browser/service_worker/service_worker_test_utils.h b/content/browser/service_worker/service_worker_test_utils.h index bc29247a..93569dd 100644 --- a/content/browser/service_worker/service_worker_test_utils.h +++ b/content/browser/service_worker/service_worker_test_utils.h
@@ -112,34 +112,34 @@ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRemoteProviderEndpoint); }; -struct ServiceWorkerProviderHostAndInfo { - ServiceWorkerProviderHostAndInfo( - base::WeakPtr<ServiceWorkerProviderHost> host, +struct ServiceWorkerContainerHostAndInfo { + ServiceWorkerContainerHostAndInfo( + base::WeakPtr<ServiceWorkerContainerHost> host, blink::mojom::ServiceWorkerProviderInfoForClientPtr); - ~ServiceWorkerProviderHostAndInfo(); + ~ServiceWorkerContainerHostAndInfo(); - base::WeakPtr<ServiceWorkerProviderHost> host; + base::WeakPtr<ServiceWorkerContainerHost> host; blink::mojom::ServiceWorkerProviderInfoForClientPtr info; - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHostAndInfo); + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContainerHostAndInfo); }; -// Creates a provider host that finished navigation. Test code can typically use -// this function, but if more control is required -// CreateProviderHostAndInfoForWindow() can be used instead. -base::WeakPtr<ServiceWorkerProviderHost> CreateProviderHostForWindow( +// Creates a container host that finished navigation. Test code can typically +// use this function, but if more control is required +// CreateContainerHostAndInfoForWindow() can be used instead. +base::WeakPtr<ServiceWorkerContainerHost> CreateContainerHostForWindow( int process_id, bool is_parent_frame_secure, base::WeakPtr<ServiceWorkerContextCore> context, ServiceWorkerRemoteProviderEndpoint* output_endpoint); -// Creates a provider host that can be used for a navigation. -std::unique_ptr<ServiceWorkerProviderHostAndInfo> -CreateProviderHostAndInfoForWindow( +// Creates a container host that can be used for a navigation. +std::unique_ptr<ServiceWorkerContainerHostAndInfo> +CreateContainerHostAndInfoForWindow( base::WeakPtr<ServiceWorkerContextCore> context, bool are_ancestors_secure); -base::WeakPtr<ServiceWorkerProviderHost> +std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForServiceWorkerContext( int process_id, bool is_parent_frame_secure,
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index 74c1215..f940f32b 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -33,6 +33,7 @@ #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_installed_scripts_sender.h" +#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/common/service_worker/service_worker_utils.h" #include "content/public/browser/browser_thread.h" @@ -1692,8 +1693,10 @@ auto provider_info = blink::mojom::ServiceWorkerProviderInfoForStartWorker::New(); - provider_host_ = ServiceWorkerProviderHost::CreateForServiceWorker( - context(), base::WrapRefCounted(this), &provider_info); + DCHECK(!provider_host_); + provider_host_ = std::make_unique<ServiceWorkerProviderHost>( + provider_info->host_remote.InitWithNewEndpointAndPassReceiver(), + base::WrapRefCounted(this), context()); auto params = blink::mojom::EmbeddedWorkerStartParams::New(); params->service_worker_version_id = version_id_; @@ -2095,6 +2098,7 @@ receiver_.reset(); pending_external_requests_.clear(); worker_is_idle_on_renderer_ = true; + provider_host_.reset(); for (auto& observer : observers_) observer.OnRunningStateChanged(this); @@ -2265,6 +2269,7 @@ // service worker startup. DCHECK(registration); + DCHECK(provider_host_); service_worker_remote_->InitializeGlobalScope( std::move(service_worker_host_), provider_host_->container_host()
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index c969fd4..0272aff 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h
@@ -43,6 +43,7 @@ #include "mojo/public/cpp/bindings/pending_associated_remote.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" +#include "services/network/public/mojom/cross_origin_embedder_policy.mojom.h" #include "third_party/blink/public/common/origin_trials/trial_token_validator.h" #include "third_party/blink/public/common/service_worker/service_worker_status_code.h" #include "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom.h" @@ -513,6 +514,15 @@ return used_features_; } + void set_cross_origin_embedder_policy( + network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) { + cross_origin_embedder_policy_ = cross_origin_embedder_policy; + } + network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy() + const { + return cross_origin_embedder_policy_; + } + void set_script_response_time_for_devtools(base::Time response_time) { script_response_time_for_devtools_ = std::move(response_time); } @@ -875,6 +885,12 @@ blink::mojom::NavigationPreloadState navigation_preload_state_; ServiceWorkerMetrics::Site site_for_uma_; + // Cross-Origin-Embedder-Policy for the service worker script. This persists + // in the disk. kNone is set if this is a brand-new service worker whose main + // script is not loaded yet. + network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy_ = + network::mojom::CrossOriginEmbedderPolicy::kNone; + Status status_ = NEW; std::unique_ptr<EmbeddedWorkerInstance> embedded_worker_; std::vector<StatusCallback> start_callbacks_; @@ -932,7 +948,7 @@ // Keeps track of the provider hosting this running service worker for this // version. |provider_host_| is always valid as long as this version is // running. - base::WeakPtr<ServiceWorkerProviderHost> provider_host_; + std::unique_ptr<ServiceWorkerProviderHost> provider_host_; // |controllee_map_| and |bfcached_controllee_map_| should not share the same // controllee.
diff --git a/content/browser/service_worker/service_worker_version_browsertest.cc b/content/browser/service_worker/service_worker_version_browsertest.cc index f140770..7a948061 100644 --- a/content/browser/service_worker/service_worker_version_browsertest.cc +++ b/content/browser/service_worker/service_worker_version_browsertest.cc
@@ -459,13 +459,14 @@ ASSERT_TRUE( BrowserThread::CurrentlyOn(ServiceWorkerContext::GetCoreThreadId())); remote_endpoints_.emplace_back(); - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - wrapper()->context()->AsWeakPtr(), &remote_endpoints_.back()); + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( + 33 /* dummy render process id */, true /* is_parent_frame_secure */, + wrapper()->context()->AsWeakPtr(), &remote_endpoints_.back()); const GURL url = embedded_test_server()->GetURL("/service_worker/host"); - host->container_host()->UpdateUrls(url, net::SiteForCookies::FromUrl(url), - url::Origin::Create(url)); - host->container_host()->SetControllerRegistration( + container_host->UpdateUrls(url, net::SiteForCookies::FromUrl(url), + url::Origin::Create(url)); + container_host->SetControllerRegistration( registration_, false /* notify_controllerchange */); }
diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc index 66b4562b..4c3e4bd9 100644 --- a/content/browser/service_worker/service_worker_version_unittest.cc +++ b/content/browser/service_worker/service_worker_version_unittest.cc
@@ -174,17 +174,18 @@ version_->SetStatus(ServiceWorkerVersion::ACTIVATED); registration_->SetActiveVersion(version_); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - controllee_process_id, true /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), &remote_endpoint); - host->container_host()->UpdateUrls( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( + controllee_process_id, true /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), &remote_endpoint); + container_host->UpdateUrls( registration_->scope(), net::SiteForCookies::FromUrl(registration_->scope()), url::Origin::Create(registration_->scope())); - host->container_host()->SetControllerRegistration( + container_host->SetControllerRegistration( registration_, false /* notify_controllerchange */); EXPECT_TRUE(version_->HasControllee()); - EXPECT_TRUE(host->container_host()->controller()); + EXPECT_TRUE(container_host->controller()); return remote_endpoint; } @@ -426,16 +427,17 @@ version_->SetStatus(ServiceWorkerVersion::ACTIVATED); registration_->SetActiveVersion(version_); ServiceWorkerRemoteProviderEndpoint remote_endpoint; - base::WeakPtr<ServiceWorkerProviderHost> host = CreateProviderHostForWindow( - 33 /* dummy render process id */, true /* is_parent_frame_secure */, - helper_->context()->AsWeakPtr(), &remote_endpoint); - host->container_host()->UpdateUrls( + base::WeakPtr<ServiceWorkerContainerHost> container_host = + CreateContainerHostForWindow( + 33 /* dummy render process id */, true /* is_parent_frame_secure */, + helper_->context()->AsWeakPtr(), &remote_endpoint); + container_host->UpdateUrls( registration_->scope(), net::SiteForCookies::FromUrl(registration_->scope()), url::Origin::Create(registration_->scope())); - host->container_host()->SetControllerRegistration(registration_, false); + container_host->SetControllerRegistration(registration_, false); EXPECT_TRUE(version_->HasControllee()); - EXPECT_TRUE(host->container_host()->controller()); + EXPECT_TRUE(container_host->controller()); // Doom the version. version_->Doom(); @@ -443,7 +445,7 @@ // The controllee should have been removed. EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version_->status()); EXPECT_FALSE(version_->HasControllee()); - EXPECT_FALSE(host->container_host()->controller()); + EXPECT_FALSE(container_host->controller()); } TEST_F(ServiceWorkerVersionTest, SetDevToolsAttached) { @@ -1192,20 +1194,20 @@ // cause the client to have an invalid process id like we see in real // navigations. ServiceWorkerRemoteProviderEndpoint remote_endpoint; - std::unique_ptr<ServiceWorkerProviderHostAndInfo> host_and_info = - CreateProviderHostAndInfoForWindow(helper_->context()->AsWeakPtr(), - /*are_ancestors_secure=*/true); - base::WeakPtr<ServiceWorkerProviderHost> host = + std::unique_ptr<ServiceWorkerContainerHostAndInfo> host_and_info = + CreateContainerHostAndInfoForWindow(helper_->context()->AsWeakPtr(), + /*are_ancestors_secure=*/true); + base::WeakPtr<ServiceWorkerContainerHost> container_host = std::move(host_and_info->host); remote_endpoint.BindForWindow(std::move(host_and_info->info)); - host->container_host()->UpdateUrls( + container_host->UpdateUrls( registration_->scope(), net::SiteForCookies::FromUrl(registration_->scope()), url::Origin::Create(registration_->scope())); - host->container_host()->SetControllerRegistration( + container_host->SetControllerRegistration( registration_, false /* notify_controllerchange */); EXPECT_TRUE(version_->HasControllee()); - EXPECT_TRUE(host->container_host()->controller()); + EXPECT_TRUE(container_host->controller()); // RenderProcessHost should be notified of foreground worker. base::RunLoop().RunUntilIdle(); @@ -1214,13 +1216,12 @@ helper_->mock_render_process_host()->foreground_service_worker_count()); // This is necessary to make OnBeginNavigationCommit() work. - auto remote_controller = - host->container_host()->GetRemoteControllerServiceWorker(); + auto remote_controller = container_host->GetRemoteControllerServiceWorker(); // Now begin the navigation commit with the same process id used by the // worker. This should cause the worker to stop being considered foreground // priority. - host->container_host()->OnBeginNavigationCommit( + container_host->OnBeginNavigationCommit( version_->embedded_worker()->process_id(), /* render_frame_id = */ 1, network::mojom::CrossOriginEmbedderPolicy::kNone);
diff --git a/content/browser/worker_host/shared_worker_host_unittest.cc b/content/browser/worker_host/shared_worker_host_unittest.cc index fb26e20..bdbb602 100644 --- a/content/browser/worker_host/shared_worker_host_unittest.cc +++ b/content/browser/worker_host/shared_worker_host_unittest.cc
@@ -111,8 +111,8 @@ client_remote.InitWithNewEndpointAndPassReceiver(); host_receiver = provider_info->host_remote.InitWithNewEndpointAndPassReceiver(); - base::WeakPtr<ServiceWorkerProviderHost> service_worker_host = - ServiceWorkerProviderHost::CreateForWebWorker( + base::WeakPtr<ServiceWorkerContainerHost> service_worker_container_host = + ServiceWorkerContainerHost::CreateForWebWorker( helper_->context()->AsWeakPtr(), mock_render_process_host_.GetID(), blink::mojom::ServiceWorkerProviderType::kForSharedWorker, std::move(host_receiver), std::move(client_remote));
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 70388f74..1bafaa0 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -1230,10 +1230,6 @@ // out-of-process parent frame. IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad) -// Sent by a frame proxy to the browser when a child frame finishes loading, so -// that the corresponding RenderFrame can check whether its load has completed. -IPC_MESSAGE_ROUTED0(FrameHostMsg_CheckCompleted) - // Sent to the browser from a frame proxy to post a message to the frame's // active renderer. IPC_MESSAGE_ROUTED1(FrameHostMsg_RouteMessageEvent,
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc index f145876..186dd71 100644 --- a/content/renderer/render_frame_proxy.cc +++ b/content/renderer/render_frame_proxy.cc
@@ -706,10 +706,6 @@ delete this; } -void RenderFrameProxy::CheckCompleted() { - Send(new FrameHostMsg_CheckCompleted(routing_id_)); -} - void RenderFrameProxy::ForwardPostMessage( blink::WebLocalFrame* source_frame, blink::WebRemoteFrame* target_frame,
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h index 22634b8..4a65a0e 100644 --- a/content/renderer/render_frame_proxy.h +++ b/content/renderer/render_frame_proxy.h
@@ -175,7 +175,6 @@ // blink::WebRemoteFrameClient implementation: void FrameDetached(DetachType type) override; - void CheckCompleted() override; void ForwardPostMessage(blink::WebLocalFrame* sourceFrame, blink::WebRemoteFrame* targetFrame, blink::WebSecurityOrigin target,
diff --git a/content/test/data/linearized.pdf b/content/test/data/linearized.pdf new file mode 100644 index 0000000..acdf9c8 --- /dev/null +++ b/content/test/data/linearized.pdf Binary files differ
diff --git a/content/test/data/linearized.pdf.README b/content/test/data/linearized.pdf.README new file mode 100644 index 0000000..b25462db --- /dev/null +++ b/content/test/data/linearized.pdf.README
@@ -0,0 +1,14 @@ +linearized.pdf is a pdf test file that is: +1) linearized (what some pdf generating apps call "web optimized" or "Fast Web + View") +and +2) big enough to trigger chunked/range http requests when rendering the pdf in + the browser (and in browser tests :-). + +linearized.pdf test file was generated around January 2020 with the +following cmdlines: + $ find chromium/src/third_party/pdfium/core -name '*.h' -or -name '*.cc' + | sort | grep -v -i drm | grep -v -i priv \ + | xargs enscript -Ecpp -o - \ + | ps2pdf - tmp.pdf + $ qpdf --linearize tmp.pdf linearized.pdf
diff --git a/infra/config/buckets/ci.star b/infra/config/buckets/ci.star index 08506f4..68d762934 100644 --- a/infra/config/buckets/ci.star +++ b/infra/config/buckets/ci.star
@@ -1141,6 +1141,7 @@ 'pool_size': 20, 'tests': '*', }, + **kwargs ) fyi_celab_builder(
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index 9121ebe6..704ac45 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -7713,7 +7713,7 @@ name: "celab" cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" cipd_version: "refs/heads/master" - properties_j: "$build/goma:{\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}" + properties_j: "$build/goma:{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}" properties_j: "$kitchen:{\"devshell\":true,\"git_auth\":true}" properties_j: "exclude:\"chrome_only\"" properties_j: "mastername:\"chromium.fyi\""
diff --git a/ios/chrome/app/main_controller.h b/ios/chrome/app/main_controller.h index 2d359e1..210b994 100644 --- a/ios/chrome/app/main_controller.h +++ b/ios/chrome/app/main_controller.h
@@ -19,6 +19,7 @@ @class AppState; @class MetricsMediator; @protocol BrowsingDataCommands; +@protocol TabSwitcherDelegate; // The main controller of the application, owned by the MainWindow nib. Also // serves as the delegate for the app. Owns all the various top-level @@ -46,7 +47,8 @@ @property(nonatomic, weak) MetricsMediator* metricsMediator; // For temporary plumbing only. -@property(nonatomic, weak) id<ApplicationCommands> sceneController; +@property(nonatomic, weak) id<ApplicationCommands, TabSwitcherDelegate> + sceneController; @end
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index dd607da..5718e3f 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -289,7 +289,6 @@ @interface MainController () <AppURLLoadingServiceDelegate, BrowserStateStorageSwitching, PrefObserverDelegate, - TabSwitcherDelegate, WebStateListObserving> { IBOutlet UIWindow* _window; @@ -419,15 +418,6 @@ tabOpenedCompletion:(ProceduralBlock)tabOpenedCompletion; // Returns whether the restore infobar should be displayed. - (bool)mustShowRestoreInfobar; -// Begins the process of dismissing the tab switcher with the given current -// model, switching which BVC is suspended if necessary, but not updating the -// UI. The omnibox will be focused after the tab switcher dismissal is -// completed if |focusOmnibox| is YES. -- (void)beginDismissingTabSwitcherWithCurrentModel:(TabModel*)tabModel - focusOmnibox:(BOOL)focusOmnibox; -// Completes the process of dismissing the tab switcher, removing it from the -// screen and showing the appropriate BVC. -- (void)finishDismissingTabSwitcher; // Switch all global states for the given mode (normal or incognito). - (void)switchGlobalStateToMode:(ApplicationMode)mode; // Updates the local storage, cookie store, and sets the global state. @@ -1652,7 +1642,7 @@ otrTabModel:self.otrTabModel activeTabModel:self.currentTabModel]; self.tabSwitcherIsActive = YES; - [_tabSwitcher setDelegate:self]; + [_tabSwitcher setDelegate:self.sceneController]; [self.mainCoordinator showTabSwitcher:_tabSwitcher]; } @@ -1701,19 +1691,6 @@ return YES; } -#pragma mark - TabSwitcherDelegate - -- (void)tabSwitcher:(id<TabSwitcher>)tabSwitcher - shouldFinishWithActiveModel:(TabModel*)tabModel - focusOmnibox:(BOOL)focusOmnibox { - [self beginDismissingTabSwitcherWithCurrentModel:tabModel - focusOmnibox:focusOmnibox]; -} - -- (void)tabSwitcherDismissTransitionDidEnd:(id<TabSwitcher>)tabSwitcher { - [self finishDismissingTabSwitcher]; -} - #pragma mark - TabSwitcherDelegate helper methods - (void)beginDismissingTabSwitcherWithCurrentModel:(TabModel*)tabModel
diff --git a/ios/chrome/app/main_controller_guts.h b/ios/chrome/app/main_controller_guts.h index 829c8a8..c288e55 100644 --- a/ios/chrome/app/main_controller_guts.h +++ b/ios/chrome/app/main_controller_guts.h
@@ -83,6 +83,18 @@ completion:(ProceduralBlock)completion; - (void)showTabSwitcher; +// TabSwitcherDelegate helpers + +// Begins the process of dismissing the tab switcher with the given current +// model, switching which BVC is suspended if necessary, but not updating the +// UI. The omnibox will be focused after the tab switcher dismissal is +// completed if |focusOmnibox| is YES. +- (void)beginDismissingTabSwitcherWithCurrentModel:(TabModel*)tabModel + focusOmnibox:(BOOL)focusOmnibox; +// Completes the process of dismissing the tab switcher, removing it from the +// screen and showing the appropriate BVC. +- (void)finishDismissingTabSwitcher; + @end #endif // IOS_CHROME_APP_MAIN_CONTROLLER_GUTS_H_
diff --git a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.h b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.h index e6533e1..923ffe5 100644 --- a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.h +++ b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.h
@@ -37,7 +37,7 @@ base::FilePath GetPathToSaveTo() override; GURL GetNewTabURL() override; bool HasLastSession() override; - void GetLastSession(const sessions::GetLastSessionCallback& callback, + void GetLastSession(sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) override; ios::ChromeBrowserState* browser_state_;
diff --git a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm index 12b5a7c4..c76dd04 100644 --- a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm +++ b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm
@@ -136,7 +136,7 @@ } void IOSChromeTabRestoreServiceClient::GetLastSession( - const sessions::GetLastSessionCallback& callback, + sessions::GetLastSessionCallback callback, base::CancelableTaskTracker* tracker) { NOTREACHED(); }
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index 12507f9..03abeaaad 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -91,6 +91,7 @@ #import "ios/chrome/browser/ui/download/download_manager_coordinator.h" #import "ios/chrome/browser/ui/elements/activity_overlay_coordinator.h" #import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h" +#import "ios/chrome/browser/ui/find_bar/find_bar_coordinator.h" #import "ios/chrome/browser/ui/find_bar/find_bar_view_controller.h" #import "ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_animator.h" @@ -116,7 +117,6 @@ #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.h" #import "ios/chrome/browser/ui/payments/payment_request_manager.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_coordinator.h" -#include "ios/chrome/browser/ui/presenters/contained_presenter_delegate.h" #import "ios/chrome/browser/ui/presenters/vertical_animation_container.h" #import "ios/chrome/browser/ui/sad_tab/sad_tab_coordinator.h" #import "ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_coordinator.h" @@ -129,6 +129,7 @@ #import "ios/chrome/browser/ui/tabs/requirements/tab_strip_presentation.h" #import "ios/chrome/browser/ui/tabs/switch_to_tab_animation_view.h" #import "ios/chrome/browser/ui/tabs/tab_strip_legacy_coordinator.h" +#import "ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_coordinator_delegate.h" #import "ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_presenter.h" #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.h" #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.h" @@ -343,11 +344,9 @@ @interface BrowserViewController () <ActivityServicePresentation, BubblePresenterDelegate, CaptivePortalDetectorTabHelperDelegate, - ContainedPresenterDelegate, CRWWebStateDelegate, CRWWebStateObserver, DialogPresenterDelegate, - FindInPageResponseDelegate, FullscreenUIElement, InfobarPositioner, KeyCommandsPlumbing, @@ -364,6 +363,7 @@ SigninPresenter, SnapshotGeneratorDelegate, TabStripPresentation, + ToolbarAccessoryCoordinatorDelegate, ToolbarHeightProviderForFullscreen, WebStateListObserving, UIGestureRecognizerDelegate, @@ -519,8 +519,6 @@ // Whether BVC prefers to hide the status bar. This value is used to determine // the response from the |prefersStatusBarHidden| method. @property(nonatomic, assign) BOOL hideStatusBar; -// Used to display the Find In Page UI. Nil if not visible. -@property(nonatomic, strong) FindBarControllerIOS* findBarController; // Presenter used to display accessories over the toolbar (e.g. Find In Page). @property(nonatomic, strong) ToolbarAccessoryPresenter* toolbarAccessoryPresenter; @@ -557,6 +555,9 @@ // Coordinator for the popup menus. @property(nonatomic, strong) PopupMenuCoordinator* popupMenuCoordinator; +// Coordinator for find in page. +@property(nonatomic, strong) FindBarCoordinator* findBarCoordinator; + @property(nonatomic, strong) BubblePresenter* bubblePresenter; // Primary toolbar. @@ -667,18 +668,6 @@ - (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers atOffset:(CGFloat)headerOffset; -// Find Bar UI -// ----------- -// Update find bar with model data. If |shouldFocus| is set to YES, the text -// field will become first responder. -- (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus; -// Hide find bar. -- (void)hideFindBarWithAnimation:(BOOL)animate; -// Shows find bar. All text inside the Find Bar textfield will be selected. If -// |shouldFocus| is set to YES, the textfield is set to be first responder. -- (void)showFindBarWithAnimation:(BOOL)animate - shouldFocus:(BOOL)shouldFocus; - // Alerts // ------ // Shows a self-dismissing snackbar displaying |message|. @@ -1280,7 +1269,7 @@ auto* findHelper = FindTabHelper::FromWebState(webState); if (findHelper) { findHelper->StopFinding(^{ - [self updateFindBar:NO shouldFocus:NO]; + [self.findBarCoordinator hideFindBarWithAnimation:YES]; }); } } @@ -1678,7 +1667,7 @@ // updateToobar]; if (ShouldShowCompactToolbar(previousTraitCollection) != ShouldShowCompactToolbar()) { - [self hideFindBarWithAnimation:NO]; + [self.findBarCoordinator hideFindBarWithAnimation:NO]; } // Update the toolbar visibility. @@ -2371,7 +2360,7 @@ if (!self.inNewTabAnimation) { // Hide findbar. |updateToolbar| will restore the findbar later. - [self hideFindBarWithAnimation:NO]; + [self.findBarCoordinator hideFindBarWithAnimation:NO]; // Make new content visible, resizing it first as the orientation may // have changed from the last time it was displayed. @@ -2463,8 +2452,7 @@ auto* findHelper = FindTabHelper::FromWebState(webState); if (findHelper && findHelper->IsFindUIActive()) { - [self showFindBarWithAnimation:NO - shouldFocus:[self.findBarController isFocused]]; + [self.findBarCoordinator showFindBarAnimated:NO]; } BOOL hideToolbar = NO; @@ -2568,53 +2556,6 @@ return webState->GetView(); } -#pragma mark - Private Methods: Find Bar UI - -- (void)hideFindBarWithAnimation:(BOOL)animate { - [self.findBarController findBarViewWillHide]; - [self.toolbarAccessoryPresenter dismissAnimated:animate]; -} - -- (void)showFindBarWithAnimation:(BOOL)animate - shouldFocus:(BOOL)shouldFocus { - DCHECK(self.findBarController); - if (!self.toolbarAccessoryPresenter) { - self.toolbarAccessoryPresenter = - [[ToolbarAccessoryPresenter alloc] initWithIsIncognito:_isOffTheRecord]; - self.toolbarAccessoryPresenter.delegate = self; - self.toolbarAccessoryPresenter.baseViewController = self; - } - - self.toolbarAccessoryPresenter.presentedViewController = - self.findBarController.findBarViewController; - [self.toolbarAccessoryPresenter prepareForPresentation]; - [self.toolbarAccessoryPresenter presentAnimated:animate]; - [self updateFindBar:YES shouldFocus:shouldFocus]; -} - -- (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus { - // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK. - // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting - // in a crash. - if (!self.currentWebState) { - return; - } - FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); - if (helper && helper->IsFindUIActive()) { - if (initialUpdate && !_isOffTheRecord) { - helper->RestoreSearchTerm(); - } - - [self setFramesForHeaders:[self headerViews] - atOffset:[self currentHeaderOffset]]; - [self.findBarController updateView:helper->GetFindResult() - initialUpdate:initialUpdate - focusTextfield:shouldFocus]; - } else { - [self hideFindBarWithAnimation:YES]; - } -} - #pragma mark - Private Methods: Alerts - (void)showErrorAlertWithStringTitle:(NSString*)title @@ -3003,16 +2944,6 @@ [self.dispatcher showSavedPasswordsSettingsFromViewController:self]; } -#pragma mark - ContainedPresenterDelegate methods. - -- (void)containedPresenterDidPresent:(id<ContainedPresenter>)presenter { - [self.findBarController selectAllText]; -} - -- (void)containedPresenterDidDismiss:(id<ContainedPresenter>)presenter { - [self.findBarController findBarViewDidHide]; -} - #pragma mark - CRWWebStateDelegate methods. - (web::WebState*)webState:(web::WebState*)webState @@ -4114,25 +4045,29 @@ if (!self.canShowFindBar) return; - if (!self.findBarController) { - self.findBarController = - [[FindBarControllerIOS alloc] initWithIncognito:_isOffTheRecord]; - self.findBarController.dispatcher = self.dispatcher; + if (!self.toolbarAccessoryPresenter) { + self.toolbarAccessoryPresenter = + [[ToolbarAccessoryPresenter alloc] initWithIsIncognito:_isOffTheRecord]; + self.toolbarAccessoryPresenter.baseViewController = self; } - DCHECK(self.currentWebState); - FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); - DCHECK(!helper->IsFindUIActive()); - helper->SetResponseDelegate(self); - helper->SetFindUIActive(true); - [self showFindBarWithAnimation:YES shouldFocus:YES]; + if (!self.findBarCoordinator) { + self.findBarCoordinator = + [[FindBarCoordinator alloc] initWithBaseViewController:self + browser:self.browser]; + self.findBarCoordinator.presenter = self.toolbarAccessoryPresenter; + self.findBarCoordinator.delegate = self; + + [self.findBarCoordinator start]; + } + [self.findBarCoordinator startFindInPage]; } - (void)closeFindInPage { __weak BrowserViewController* weakSelf = self; if (self.currentWebState) { FindTabHelper::FromWebState(self.currentWebState)->StopFinding(^{ - [weakSelf updateFindBar:NO shouldFocus:NO]; + [weakSelf.findBarCoordinator hideFindBarWithAnimation:YES]; }); } } @@ -4141,13 +4076,14 @@ DCHECK(self.currentWebState); FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); __weak BrowserViewController* weakSelf = self; - helper->StartFinding([self.findBarController searchTerm], + helper->StartFinding([self.findBarCoordinator.findBarController searchTerm], ^(FindInPageModel* model) { BrowserViewController* strongSelf = weakSelf; if (!strongSelf) { return; } - [weakSelf.findBarController updateResultsCount:model]; + [strongSelf.findBarCoordinator.findBarController + updateResultsCount:model]; }); if (!_isOffTheRecord) @@ -4159,7 +4095,7 @@ // TODO(crbug.com/603524): Reshow find bar if necessary. FindTabHelper::FromWebState(self.currentWebState) ->ContinueFinding(FindTabHelper::FORWARD, ^(FindInPageModel* model) { - [self.findBarController updateResultsCount:model]; + [self.findBarCoordinator.findBarController updateResultsCount:model]; }); } @@ -4168,7 +4104,7 @@ // TODO(crbug.com/603524): Reshow find bar if necessary. FindTabHelper::FromWebState(self.currentWebState) ->ContinueFinding(FindTabHelper::REVERSE, ^(FindInPageModel* model) { - [self.findBarController updateResultsCount:model]; + [self.findBarCoordinator.findBarController updateResultsCount:model]; }); } @@ -4233,7 +4169,7 @@ // Dismiss the soft keyboard (if open). [[self viewForWebState:self.currentWebState] endEditing:NO]; // Dismiss Find in Page focus. - [self updateFindBar:NO shouldFocus:NO]; + [self.findBarCoordinator defocusFindBar]; if (type == PopupMenuCommandTypeToolsMenu) { [self.bubblePresenter toolsMenuDisplayed]; @@ -4270,16 +4206,6 @@ } } -#pragma mark - FindInPageResponseDelegate - -- (void)findDidFinishWithUpdatedModel:(FindInPageModel*)model { - [self.findBarController updateResultsCount:model]; -} - -- (void)findDidStop { - [self updateFindBar:NO shouldFocus:NO]; -} - #pragma mark - BrowserCommands helpers // Reloads the original url of the last non-redirect item (including non-history @@ -4335,7 +4261,7 @@ return; // Remove the find bar for now. - [self hideFindBarWithAnimation:NO]; + [self.findBarCoordinator hideFindBarWithAnimation:NO]; } - (void)webStateList:(WebStateList*)webStateList @@ -4612,7 +4538,7 @@ } else { // Hide UI accessories such as find bar and first visit overlays // for welcome page. - [self hideFindBarWithAnimation:NO]; + [self.findBarCoordinator hideFindBarWithAnimation:NO]; [self.infobarContainerCoordinator hideContainer:YES]; } } @@ -4785,6 +4711,14 @@ [[self view] addSubview:tabStripView]; } +#pragma mark - ToolbarAccessoryCoordinatorDelegate + +- (void)setHeadersForToolbarAccessoryCoordinator: + (ChromeCoordinator*)toolbarAccessoryCoordinator { + [self setFramesForHeaders:[self headerViews] + atOffset:[self currentHeaderOffset]]; +} + #pragma mark - ManageAccountsDelegate - (void)onManageAccounts {
diff --git a/ios/chrome/browser/ui/commands/browser_commands.h b/ios/chrome/browser/ui/commands/browser_commands.h index 4f8e420..a1aeffe2 100644 --- a/ios/chrome/browser/ui/commands/browser_commands.h +++ b/ios/chrome/browser/ui/commands/browser_commands.h
@@ -71,7 +71,7 @@ // Shows the Find In Page bar. - (void)showFindInPage; -// Close and disable Find In Page bar. +// Closes and disables the Find In Page bar. - (void)closeFindInPage; // Search the current tab for the query string in the Find In Page bar.
diff --git a/ios/chrome/browser/ui/find_bar/BUILD.gn b/ios/chrome/browser/ui/find_bar/BUILD.gn index 0ed8c75..5df40b0 100644 --- a/ios/chrome/browser/ui/find_bar/BUILD.gn +++ b/ios/chrome/browser/ui/find_bar/BUILD.gn
@@ -7,6 +7,8 @@ sources = [ "find_bar_controller_ios.h", "find_bar_controller_ios.mm", + "find_bar_coordinator.h", + "find_bar_coordinator.mm", "find_bar_view.h", "find_bar_view.mm", "find_bar_view_controller.h", @@ -20,12 +22,18 @@ "//base:i18n", "//components/strings", "//ios/chrome/app/strings", + "//ios/chrome/browser/browser_state", "//ios/chrome/browser/find_in_page", + "//ios/chrome/browser/main", "//ios/chrome/browser/ui/commands", + "//ios/chrome/browser/ui/coordinators:chrome_coordinators", "//ios/chrome/browser/ui/image_util", + "//ios/chrome/browser/ui/presenters", "//ios/chrome/browser/ui/resources:menu_shadow", + "//ios/chrome/browser/ui/toolbar/accessory", "//ios/chrome/browser/ui/toolbar/public", "//ios/chrome/browser/ui/util", + "//ios/chrome/browser/web_state_list", "//ios/chrome/common/colors", "//ios/chrome/common/ui_util", "//ios/third_party/material_components_ios",
diff --git a/ios/chrome/browser/ui/find_bar/find_bar_coordinator.h b/ios/chrome/browser/ui/find_bar/find_bar_coordinator.h new file mode 100644 index 0000000..4d25d76 --- /dev/null +++ b/ios/chrome/browser/ui/find_bar/find_bar_coordinator.h
@@ -0,0 +1,42 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_COORDINATOR_H_ +#define IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_COORDINATOR_H_ + +#import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h" + +@class FindBarControllerIOS; +@class ToolbarAccessoryPresenter; +@protocol ToolbarAccessoryCoordinatorDelegate; + +// Coordinator for the Find Bar and the Find In page feature. Currently, this +// is mostly a collection of code extracted from BrowserViewController, and not +// a good example of the ideal coordinator architecture. +@interface FindBarCoordinator : ChromeCoordinator + +// Presenter used to present the UI. +@property(nonatomic, strong) ToolbarAccessoryPresenter* presenter; + +@property(nonatomic, weak) id<ToolbarAccessoryCoordinatorDelegate> delegate; + +// Find bar controller object. This should probably be private, but is not to +// make the transition easier. +@property(nonatomic, strong) FindBarControllerIOS* findBarController; + +// Starts the Find In Page process. +- (void)startFindInPage; + +// Shows the Find Bar UI. +- (void)showFindBarAnimated:(BOOL)animated; + +// Hides the Find Bar UI. +- (void)hideFindBarWithAnimation:(BOOL)animated; + +// Defocuses the Find Bar text field. +- (void)defocusFindBar; + +@end + +#endif // IOS_CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/find_bar/find_bar_coordinator.mm b/ios/chrome/browser/ui/find_bar/find_bar_coordinator.mm new file mode 100644 index 0000000..6329294b --- /dev/null +++ b/ios/chrome/browser/ui/find_bar/find_bar_coordinator.mm
@@ -0,0 +1,122 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/find_bar/find_bar_coordinator.h" + +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/find_in_page/find_in_page_response_delegate.h" +#import "ios/chrome/browser/find_in_page/find_tab_helper.h" +#import "ios/chrome/browser/main/browser.h" +#import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/commands/command_dispatcher.h" +#import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h" +#import "ios/chrome/browser/ui/find_bar/find_bar_view_controller.h" +#include "ios/chrome/browser/ui/presenters/contained_presenter_delegate.h" +#import "ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_coordinator_delegate.h" +#import "ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_presenter.h" +#import "ios/chrome/browser/web_state_list/web_state_list.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface FindBarCoordinator () <FindInPageResponseDelegate, + ContainedPresenterDelegate> + +@end + +@implementation FindBarCoordinator + +- (void)start { + self.findBarController = [[FindBarControllerIOS alloc] + initWithIncognito:self.browserState->IsOffTheRecord()]; + + self.presenter.delegate = self; + + self.findBarController.dispatcher = + static_cast<id<BrowserCommands>>(self.browser->GetCommandDispatcher()); +} + +- (void)startFindInPage { + DCHECK(self.currentWebState); + FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); + DCHECK(!helper->IsFindUIActive()); + helper->SetResponseDelegate(self); + helper->SetFindUIActive(true); + + [self showFindBarAnimated:YES shouldFocus:YES]; +} + +- (void)showFindBarAnimated:(BOOL)animated { + [self showFindBarAnimated:animated + shouldFocus:[self.findBarController isFocused]]; +} + +- (void)showFindBarAnimated:(BOOL)animated shouldFocus:(BOOL)shouldFocus { + self.presenter.presentedViewController = + self.findBarController.findBarViewController; + + [self.presenter prepareForPresentation]; + [self.presenter presentAnimated:animated]; + + // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK. + // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting + // in a crash. + if (!self.currentWebState) { + return; + } + FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); + DCHECK(helper && helper->IsFindUIActive()); + if (!self.browserState->IsOffTheRecord()) { + helper->RestoreSearchTerm(); + } + [self.delegate setHeadersForToolbarAccessoryCoordinator:self]; + [self.findBarController updateView:helper->GetFindResult() + initialUpdate:YES + focusTextfield:shouldFocus]; +} + +- (void)hideFindBarWithAnimation:(BOOL)animated { + [self.findBarController findBarViewWillHide]; + [self.presenter dismissAnimated:animated]; +} + +- (void)defocusFindBar { + FindTabHelper* helper = FindTabHelper::FromWebState(self.currentWebState); + if (helper && helper->IsFindUIActive()) { + [self.findBarController updateView:helper->GetFindResult() + initialUpdate:NO + focusTextfield:NO]; + } +} + +#pragma mark - FindInPageResponseDelegate + +- (void)findDidFinishWithUpdatedModel:(FindInPageModel*)model { + [self.findBarController updateResultsCount:model]; +} + +- (void)findDidStop { + [self hideFindBarWithAnimation:YES]; +} + +#pragma mark - ContainedPresenterDelegate + +- (void)containedPresenterDidPresent:(id<ContainedPresenter>)presenter { + [self.findBarController selectAllText]; +} + +- (void)containedPresenterDidDismiss:(id<ContainedPresenter>)presenter { + [self.findBarController findBarViewDidHide]; +} + +#pragma mark - Private + +- (web::WebState*)currentWebState { + return self.browser->GetWebStateList() + ? self.browser->GetWebStateList()->GetActiveWebState() + : nullptr; +} + +@end
diff --git a/ios/chrome/browser/ui/main/scene_controller.h b/ios/chrome/browser/ui/main/scene_controller.h index 43291bc..ebc8a51 100644 --- a/ios/chrome/browser/ui/main/scene_controller.h +++ b/ios/chrome/browser/ui/main/scene_controller.h
@@ -9,11 +9,13 @@ #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/main/scene_state.h" +#import "ios/chrome/browser/ui/tab_grid/tab_switcher.h" @protocol MainControllerGuts; // The controller object for a scene. Reacts to scene state changes. -@interface SceneController : NSObject <SceneStateObserver, ApplicationCommands> +@interface SceneController + : NSObject <SceneStateObserver, ApplicationCommands, TabSwitcherDelegate> - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithSceneState:(SceneState*)sceneState
diff --git a/ios/chrome/browser/ui/main/scene_controller.mm b/ios/chrome/browser/ui/main/scene_controller.mm index ecf73cf..0636a75 100644 --- a/ios/chrome/browser/ui/main/scene_controller.mm +++ b/ios/chrome/browser/ui/main/scene_controller.mm
@@ -573,4 +573,17 @@ return self.mainController.mainBVC.dispatcher; } +#pragma mark - TabSwitcherDelegate + +- (void)tabSwitcher:(id<TabSwitcher>)tabSwitcher + shouldFinishWithActiveModel:(TabModel*)tabModel + focusOmnibox:(BOOL)focusOmnibox { + [self.mainController beginDismissingTabSwitcherWithCurrentModel:tabModel + focusOmnibox:focusOmnibox]; +} + +- (void)tabSwitcherDismissTransitionDidEnd:(id<TabSwitcher>)tabSwitcher { + [self.mainController finishDismissingTabSwitcher]; +} + @end
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm index a14b043..1f98e083 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -152,6 +152,9 @@ - (void)setText:(NSAttributedString*)text userTextLength:(size_t)userTextLength { DCHECK_LE(userTextLength, [text length]); + if (userTextLength > 0) { + [self exitPreEditState]; + } NSUInteger autocompleteLength = [text length] - userTextLength; [self setTextInternal:text autocompleteLength:autocompleteLength];
diff --git a/ios/chrome/browser/ui/settings/cells/BUILD.gn b/ios/chrome/browser/ui/settings/cells/BUILD.gn index dc6b2c6c..cdd974b 100644 --- a/ios/chrome/browser/ui/settings/cells/BUILD.gn +++ b/ios/chrome/browser/ui/settings/cells/BUILD.gn
@@ -8,8 +8,6 @@ "account_sign_in_item.mm", "byo_textfield_item.h", "byo_textfield_item.mm", - "clear_browsing_data_item.h", - "clear_browsing_data_item.mm", "copied_to_chrome_item.h", "copied_to_chrome_item.mm", "passphrase_error_item.h", @@ -85,7 +83,6 @@ testonly = true sources = [ "byo_textfield_item_unittest.mm", - "clear_browsing_data_item_unittest.mm", "copied_to_chrome_item_unittest.mm", "passphrase_error_item_unittest.mm", "search_engine_item_unittest.mm",
diff --git a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h b/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h deleted file mode 100644 index 96f1d69b..0000000 --- a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_CLEAR_BROWSING_DATA_ITEM_H_ -#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_CLEAR_BROWSING_DATA_ITEM_H_ - -#import "ios/chrome/browser/ui/settings/cells/settings_text_item.h" - -#include <memory> - -class BrowsingDataCounterWrapper; -enum class BrowsingDataRemoveMask; - -// Collection view item identifying a clear browsing data content view. -@interface ClearBrowsingDataItem : SettingsTextItem - -// Designated initializer with |counter| that can be nil. -- (instancetype)initWithType:(NSInteger)type - counter: - (std::unique_ptr<BrowsingDataCounterWrapper>)counter - NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE; - -// Restarts the counter (if defined). -- (void)restartCounter; - -// Mask of the data to be cleared. -@property(nonatomic, assign) BrowsingDataRemoveMask dataTypeMask; - -// Pref name associated with the item. -@property(nonatomic, assign) const char* prefName; - -// Whether this item has a data volume counter associated. -@property(nonatomic, readonly) BOOL hasCounter; - -@end - -#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_CLEAR_BROWSING_DATA_ITEM_H_
diff --git a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.mm b/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.mm deleted file mode 100644 index 922732e8..0000000 --- a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.mm +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h" - -#include "ios/chrome/browser/browsing_data/browsing_data_counter_wrapper.h" -#include "ios/chrome/browser/browsing_data/browsing_data_remove_mask.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@implementation ClearBrowsingDataItem { - // Wrapper around the data volume counter associated with the item. May be - // null if there is no counter or if the feature kNewClearBrowsingDataUI - // is disabled. - std::unique_ptr<BrowsingDataCounterWrapper> _counter; -} - -@synthesize dataTypeMask = _dataTypeMask; -@synthesize prefName = _prefName; - -- (instancetype)initWithType:(NSInteger)type - counter: - (std::unique_ptr<BrowsingDataCounterWrapper>)counter { - if ((self = [super initWithType:type])) { - _counter = std::move(counter); - } - return self; -} - -- (void)restartCounter { - if (_counter) - _counter->RestartCounter(); -} - -#pragma mark - Properties - -- (BOOL)hasCounter { - return _counter != nullptr; -} - -@end
diff --git a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item_unittest.mm deleted file mode 100644 index c9c4b46..0000000 --- a/ios/chrome/browser/ui/settings/cells/clear_browsing_data_item_unittest.mm +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h" - -#include "base/bind.h" -#include "base/strings/sys_string_conversions.h" -#include "components/browsing_data/core/browsing_data_utils.h" -#include "components/browsing_data/core/pref_names.h" -#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" -#include "ios/chrome/browser/browsing_data/browsing_data_counter_wrapper.h" -#include "ios/chrome/browser/browsing_data/cache_counter.h" -#include "ios/web/public/test/web_task_environment.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "testing/platform_test.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -class ClearDataItemTest : public PlatformTest { - protected: - void SetUp() override { - // Setup identity services. - TestChromeBrowserState::Builder builder; - browser_state_ = builder.Build(); - } - - std::unique_ptr<TestChromeBrowserState> browser_state_; - web::WebTaskEnvironment task_environment_; -}; - -// Test that if the counter is not set, then [item hasCounter] returns false. -TEST_F(ClearDataItemTest, ConfigureCellTestCounterNil) { - std::unique_ptr<BrowsingDataCounterWrapper> counter; - ClearBrowsingDataItem* item = - [[ClearBrowsingDataItem alloc] initWithType:0 counter:std::move(counter)]; - EXPECT_FALSE([item hasCounter]); -} - -} // namespace
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn b/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn index ebee360..bbda0175 100644 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn +++ b/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn
@@ -7,8 +7,6 @@ sources = [ "browsing_data_counter_wrapper_producer.h", "browsing_data_counter_wrapper_producer.mm", - "clear_browsing_data_collection_view_controller.h", - "clear_browsing_data_collection_view_controller.mm", "clear_browsing_data_consumer.h", "clear_browsing_data_local_commands.h", "clear_browsing_data_manager.h", @@ -68,7 +66,6 @@ configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ - "clear_browsing_data_collection_view_controller_unittest.mm", "clear_browsing_data_manager_unittest.mm", "time_range_selector_table_view_controller_unittest.mm", ]
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h deleted file mode 100644 index 05286bb0..0000000 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CLEAR_BROWSING_DATA_CLEAR_BROWSING_DATA_COLLECTION_VIEW_CONTROLLER_H_ -#define IOS_CHROME_BROWSER_UI_SETTINGS_CLEAR_BROWSING_DATA_CLEAR_BROWSING_DATA_COLLECTION_VIEW_CONTROLLER_H_ - -#import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h" - -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_consumer.h" - -namespace ios { -class ChromeBrowserState; -} // namespace ios - -@class ClearBrowsingDataManager; - -// CollectionView for clearing browsing data (including history, -// cookies, caches, passwords, and autofill). -@interface ClearBrowsingDataCollectionViewController - : SettingsRootCollectionViewController <ClearBrowsingDataConsumer> - -// "Default" convenience initializer that Users should in general make use of. -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState; - -// Designated initializer to allow dependency injection (in tests). -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - manager:(ClearBrowsingDataManager*)manager - NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithLayout:(UICollectionViewLayout*)layout - style:(CollectionViewControllerStyle)style - NS_UNAVAILABLE; - -@end - -#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CLEAR_BROWSING_DATA_CLEAR_BROWSING_DATA_COLLECTION_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.mm deleted file mode 100644 index 9f1ebea..0000000 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.mm +++ /dev/null
@@ -1,353 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h" - -#include <memory> -#include <string> - -#include "base/logging.h" -#include "base/mac/foundation_util.h" -#include "base/metrics/user_metrics.h" -#include "base/metrics/user_metrics_action.h" -#include "base/scoped_observer.h" -#include "base/strings/sys_string_conversions.h" -#include "components/prefs/pref_service.h" -#include "components/strings/grit/components_strings.h" -#include "ios/chrome/browser/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/browsing_data/browsing_data_counter_wrapper.h" -#include "ios/chrome/browser/browsing_data/browsing_data_features.h" -#include "ios/chrome/browser/browsing_data/browsing_data_remove_mask.h" -#include "ios/chrome/browser/browsing_data/browsing_data_remover.h" -#include "ios/chrome/browser/browsing_data/browsing_data_remover_factory.h" -#include "ios/chrome/browser/browsing_data/browsing_data_remover_observer.h" -#include "ios/chrome/browser/chrome_url_constants.h" -#import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" -#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" -#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" -#import "ios/chrome/browser/ui/commands/application_commands.h" -#import "ios/chrome/browser/ui/commands/browsing_data_commands.h" -#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" -#import "ios/chrome/browser/ui/elements/chrome_activity_overlay_coordinator.h" -#import "ios/chrome/browser/ui/icons/chrome_icon.h" -#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_constants.h" -#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.h" -#include "ios/chrome/browser/ui/util/ui_util.h" -#import "ios/chrome/browser/ui/util/uikit_ui_util.h" -#include "ios/chrome/grit/ios_chromium_strings.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ui/base/l10n/l10n_util_mac.h" -#include "url/gurl.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface ClearBrowsingDataCollectionViewController () { - ios::ChromeBrowserState* _browserState; // weak -} - -// TODO(crbug.com/850699): remove direct dependency and replace with -// delegate. -@property(nonatomic, readonly, strong) ClearBrowsingDataManager* dataManager; - -// Coordinator that managers an action sheet to clear browsing data. -@property(nonatomic, strong) ActionSheetCoordinator* actionSheetCoordinator; - -// Coordinator for displaying a modal overlay with native activity indicator to -// prevent the user from interacting with the page. -@property(nonatomic, strong) - ChromeActivityOverlayCoordinator* chromeActivityOverlayCoordinator; - -@end - -@implementation ClearBrowsingDataCollectionViewController -@synthesize actionSheetCoordinator = _actionSheetCoordinator; -@synthesize dataManager = _dataManager; - -#pragma mark Initialization - -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState { - ClearBrowsingDataManager* manager = [[ClearBrowsingDataManager alloc] - initWithBrowserState:browserState - listType:ClearBrowsingDataListType::kListTypeCollectionView]; - return [self initWithBrowserState:browserState manager:manager]; -} - -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - manager:(ClearBrowsingDataManager*)manager { - DCHECK(browserState); - UICollectionViewLayout* layout = [[MDCCollectionViewFlowLayout alloc] init]; - self = [super initWithLayout:layout - style:CollectionViewControllerStyleDefault]; - if (self) { - self.accessibilityTraits |= UIAccessibilityTraitButton; - - _browserState = browserState; - _dataManager = manager; - _dataManager.linkDelegate = self; - _dataManager.consumer = self; - - self.title = l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_TITLE); - self.collectionViewAccessibilityIdentifier = - kClearBrowsingDataViewAccessibilityIdentifier; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - [self loadModel]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.dataManager restartCounters:BrowsingDataRemoveMask::REMOVE_ALL]; -} - -#pragma mark CollectionViewController - -- (void)loadModel { - [super loadModel]; - [self.dataManager loadModel:self.collectionViewModel]; -} - -#pragma mark ClearBrowsingDataConsumer - -- (void)updateCellsForItem:(ListItem*)item { - [self reconfigureCellsForItems:@[ item ]]; - - // Relayout the cells to adapt to the new contents height. - [self.collectionView.collectionViewLayout invalidateLayout]; -} - -- (void)showBrowsingHistoryRemovedDialog { - NSString* title = - l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_TITLE); - NSString* message = l10n_util::GetNSString( - IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_DESCRIPTION); - - UIAlertController* alertController = - [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - - __weak ClearBrowsingDataCollectionViewController* weakSelf = self; - UIAlertAction* openMyActivityAction = [UIAlertAction - actionWithTitle: - l10n_util::GetNSString( - IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_OPEN_HISTORY_BUTTON) - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) { - [weakSelf openMyActivityLink]; - }]; - - UIAlertAction* okAction = [UIAlertAction - actionWithTitle:l10n_util::GetNSString( - IDS_IOS_CLEAR_BROWSING_DATA_HISTORY_NOTICE_OK_BUTTON) - style:UIAlertActionStyleCancel - handler:nil]; - [alertController addAction:openMyActivityAction]; - [alertController addAction:okAction]; - [self presentViewController:alertController animated:YES completion:nil]; -} - -- (void)removeBrowsingDataForBrowserState:(ios::ChromeBrowserState*)browserState - timePeriod:(browsing_data::TimePeriod)timePeriod - removeMask:(BrowsingDataRemoveMask)removeMask - completionBlock:(ProceduralBlock)completionBlock { - base::RecordAction( - base::UserMetricsAction("MobileClearBrowsingDataTriggeredFromLegacyUI")); - - // Show activity indicator modal while removal is happening. - self.chromeActivityOverlayCoordinator = - [[ChromeActivityOverlayCoordinator alloc] - initWithBaseViewController:self.navigationController]; - self.chromeActivityOverlayCoordinator.messageText = - l10n_util::GetNSStringWithFixup( - IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG); - [self.chromeActivityOverlayCoordinator start]; - - __weak ClearBrowsingDataCollectionViewController* weakSelf = self; - dispatch_time_t timeOneSecondLater = - dispatch_time(DISPATCH_TIME_NOW, (1 * NSEC_PER_SEC)); - void (^removeBrowsingDidFinishCompletionBlock)(void) = ^void() { - ClearBrowsingDataCollectionViewController* strongSelf = weakSelf; - if (!strongSelf) { - return; - } - - // Sometimes clear browsing data is really short - // (<1sec), so ensure that overlay displays for at - // least 1 second instead of looking like a glitch. - dispatch_after(timeOneSecondLater, dispatch_get_main_queue(), ^{ - [self.chromeActivityOverlayCoordinator stop]; - if (completionBlock) - completionBlock(); - }); - }; - [self.dispatcher - removeBrowsingDataForBrowserState:browserState - timePeriod:timePeriod - removeMask:removeMask - completionBlock:removeBrowsingDidFinishCompletionBlock]; -} - -#pragma mark UICollectionViewDelegate - -- (void)collectionView:(UICollectionView*)collectionView - didSelectItemAtIndexPath:(NSIndexPath*)indexPath { - [super collectionView:collectionView didSelectItemAtIndexPath:indexPath]; - NSInteger itemType = - [self.collectionViewModel itemTypeForIndexPath:indexPath]; - - switch (itemType) { - case ItemTypeTimeRange: { - UIViewController* controller = - [[TimeRangeSelectorTableViewController alloc] - initWithPrefs:_browserState->GetPrefs()]; - [self.navigationController pushViewController:controller animated:YES]; - break; - } - case ItemTypeDataTypeBrowsingHistory: - case ItemTypeDataTypeCookiesSiteData: - case ItemTypeDataTypeCache: - case ItemTypeDataTypeSavedPasswords: - case ItemTypeDataTypeAutofill: { - // Toggle the checkmark. - // TODO(crbug.com/631486): Custom checkmark animation to be implemented. - ClearBrowsingDataItem* clearDataItem = - base::mac::ObjCCastStrict<ClearBrowsingDataItem>( - [self.collectionViewModel itemAtIndexPath:indexPath]); - if (clearDataItem.accessoryType == MDCCollectionViewCellAccessoryNone) { - clearDataItem.accessoryType = MDCCollectionViewCellAccessoryCheckmark; - _browserState->GetPrefs()->SetBoolean(clearDataItem.prefName, true); - } else { - clearDataItem.accessoryType = MDCCollectionViewCellAccessoryNone; - _browserState->GetPrefs()->SetBoolean(clearDataItem.prefName, false); - } - [self reconfigureCellsForItems:@[ clearDataItem ]]; - break; - } - case ItemTypeClearBrowsingDataButton: - UICollectionViewCell* cell = - [collectionView cellForItemAtIndexPath:indexPath]; - [self presentClearBrowsingDataConfirmationDialog:cell]; - break; - } -} - -#pragma mark Clear browsing data - -// Displays an action sheet to the user confirming the clearing of user data. If -// the clearing is confirmed, clears the data. -- (void)presentClearBrowsingDataConfirmationDialog:(UICollectionViewCell*)cell { - BrowsingDataRemoveMask dataTypeMaskToRemove = - BrowsingDataRemoveMask::REMOVE_NOTHING; - NSArray* dataTypeItems = [self.collectionViewModel - itemsInSectionWithIdentifier:SectionIdentifierDataTypes]; - for (ClearBrowsingDataItem* dataTypeItem in dataTypeItems) { - DCHECK([dataTypeItem isKindOfClass:[ClearBrowsingDataItem class]]); - if (dataTypeItem.accessoryType == MDCCollectionViewCellAccessoryCheckmark) { - dataTypeMaskToRemove = dataTypeMaskToRemove | dataTypeItem.dataTypeMask; - } - } - self.actionSheetCoordinator = [self.dataManager - actionSheetCoordinatorWithDataTypesToRemove:dataTypeMaskToRemove - baseViewController:self - sourceRect:CGRectMake( - CGRectGetMidX(cell.frame), - CGRectGetMidY(cell.frame), - 1, 1) - sourceView:self.collectionView]; - if (self.actionSheetCoordinator) { - [self.actionSheetCoordinator start]; - } -} - -- (void)openMyActivityLink { - OpenNewTabCommand* openMyActivityCommand = - [OpenNewTabCommand commandWithURLFromChrome:GURL(kGoogleMyAccountURL)]; - [self.dispatcher closeSettingsUIAndOpenURL:openMyActivityCommand]; -} - -#pragma mark MDCCollectionViewStylingDelegate - -- (BOOL)collectionView:(UICollectionView*)collectionView - hidesInkViewAtIndexPath:(NSIndexPath*)indexPath { - NSInteger type = [self.collectionViewModel itemTypeForIndexPath:indexPath]; - switch (type) { - case ItemTypeFooterSavedSiteData: - case ItemTypeFooterGoogleAccount: - case ItemTypeFooterGoogleAccountAndMyActivity: - case ItemTypeFooterClearSyncAndSavedSiteData: - return YES; - default: - return NO; - } -} - -- (MDCCollectionViewCellStyle)collectionView:(UICollectionView*)collectionView - cellStyleForSection:(NSInteger)section { - NSInteger sectionIdentifier = - [self.collectionViewModel sectionIdentifierForSection:section]; - switch (sectionIdentifier) { - case SectionIdentifierGoogleAccount: - case SectionIdentifierClearSyncAndSavedSiteData: - case SectionIdentifierSavedSiteData: - // Display the footer in the default style with no "card" UI and no - // section padding. - return MDCCollectionViewCellStyleDefault; - default: - return self.styler.cellStyle; - } -} - -- (BOOL)collectionView:(UICollectionView*)collectionView - shouldHideItemBackgroundAtIndexPath:(NSIndexPath*)indexPath { - NSInteger sectionIdentifier = - [self.collectionViewModel sectionIdentifierForSection:indexPath.section]; - switch (sectionIdentifier) { - case SectionIdentifierGoogleAccount: - case SectionIdentifierClearSyncAndSavedSiteData: - case SectionIdentifierSavedSiteData: - // Display the Learn More footer without any background image or - // shadowing. - return YES; - default: - return NO; - } -} - -- (CGFloat)collectionView:(UICollectionView*)collectionView - cellHeightAtIndexPath:(NSIndexPath*)indexPath { - NSInteger sectionIdentifier = - [self.collectionViewModel sectionIdentifierForSection:indexPath.section]; - switch (sectionIdentifier) { - case SectionIdentifierGoogleAccount: - case SectionIdentifierClearSyncAndSavedSiteData: - case SectionIdentifierSavedSiteData: { - CollectionViewItem* item = - [self.collectionViewModel itemAtIndexPath:indexPath]; - return [MDCCollectionViewCell - cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds) - forItem:item]; - } - case SectionIdentifierDataTypes: { - ClearBrowsingDataItem* clearDataItem = - base::mac::ObjCCastStrict<ClearBrowsingDataItem>( - [self.collectionViewModel itemAtIndexPath:indexPath]); - return (clearDataItem.detailText.length > 0) - ? MDCCellDefaultTwoLineHeight - : MDCCellDefaultOneLineHeight; - } - default: - return MDCCellDefaultOneLineHeight; - } -} - -@end
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller_unittest.mm deleted file mode 100644 index 58f5c0f..0000000 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller_unittest.mm +++ /dev/null
@@ -1,261 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h" - -#include <memory> - -#include "base/bind.h" -#include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" -#include "base/strings/sys_string_conversions.h" -#include "components/browsing_data/core/browsing_data_utils.h" -#include "components/browsing_data/core/pref_names.h" -#include "components/pref_registry/pref_registry_syncable.h" -#include "components/sync/driver/test_sync_service.h" -#include "components/sync_preferences/pref_service_mock_factory.h" -#include "components/sync_preferences/pref_service_syncable.h" -#include "ios/chrome/browser/application_context.h" -#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" -#include "ios/chrome/browser/browsing_data/browsing_data_features.h" -#include "ios/chrome/browser/browsing_data/cache_counter.h" -#include "ios/chrome/browser/browsing_data/fake_browsing_data_remover.h" -#include "ios/chrome/browser/pref_names.h" -#include "ios/chrome/browser/prefs/browser_prefs.h" -#include "ios/chrome/browser/signin/authentication_service.h" -#include "ios/chrome/browser/signin/authentication_service_delegate_fake.h" -#include "ios/chrome/browser/signin/authentication_service_factory.h" -#include "ios/chrome/browser/sync/profile_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service_mock.h" -#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h" -#import "ios/chrome/browser/ui/settings/cells/settings_text_item.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/fake_browsing_data_counter_wrapper_producer.h" -#import "ios/chrome/common/string_util.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h" -#include "ios/web/public/test/web_task_environment.h" -#include "testing/gtest/include/gtest/gtest.h" -#import "testing/gtest_mac.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface ClearBrowsingDataCollectionViewController (ExposedForTesting) -- (NSString*)counterTextFromResult: - (const browsing_data::BrowsingDataCounter::Result&)result; -@end - -namespace { - -enum ItemEnum { - kDeleteBrowsingHistoryItem, - kDeleteCookiesItem, - kDeleteCacheItem, - kDeletePasswordsItem, - kDeleteFormDataItem -}; - -std::unique_ptr<KeyedService> CreateTestSyncService( - web::BrowserState* context) { - return std::make_unique<syncer::TestSyncService>(); -} - -std::unique_ptr<KeyedService> BuildMockSyncSetupService( - web::BrowserState* context) { - ios::ChromeBrowserState* browser_state = - ios::ChromeBrowserState::FromBrowserState(context); - return std::make_unique<SyncSetupServiceMock>( - ProfileSyncServiceFactory::GetForBrowserState(browser_state)); -} - -class ClearBrowsingDataCollectionViewControllerTest - : public CollectionViewControllerTest { - protected: - void SetUp() override { - CollectionViewControllerTest::SetUp(); - - // Setup identity services. - TestChromeBrowserState::Builder builder; - builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), - base::BindRepeating(&CreateTestSyncService)); - builder.AddTestingFactory(SyncSetupServiceFactory::GetInstance(), - base::BindRepeating(&BuildMockSyncSetupService)); - builder.AddTestingFactory( - AuthenticationServiceFactory::GetInstance(), - AuthenticationServiceFactory::GetDefaultFactory()); - - browser_state_ = builder.Build(); - - AuthenticationServiceFactory::CreateAndInitializeForBrowserState( - browser_state_.get(), - std::make_unique<AuthenticationServiceDelegateFake>()); - - ios::FakeChromeIdentityService::GetInstanceFromChromeProvider() - ->AddIdentities(@[ @"syncuser" ]); - - test_sync_service_ = static_cast<syncer::TestSyncService*>( - ProfileSyncServiceFactory::GetForBrowserState(browser_state_.get())); - - remover_ = std::make_unique<FakeBrowsingDataRemover>(); - } - - std::unique_ptr<sync_preferences::PrefServiceSyncable> CreatePrefService() { - sync_preferences::PrefServiceMockFactory factory; - scoped_refptr<user_prefs::PrefRegistrySyncable> registry( - new user_prefs::PrefRegistrySyncable); - std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs = - factory.CreateSyncable(registry.get()); - RegisterBrowserStatePrefs(registry.get()); - return prefs; - } - - CollectionViewController* InstantiateController() override { - ClearBrowsingDataManager* manager = [[ClearBrowsingDataManager alloc] - initWithBrowserState:browser_state_.get() - listType:ClearBrowsingDataListType:: - kListTypeCollectionView - browsingDataRemover:remover_.get() - browsingDataCounterWrapperProducer: - [[FakeBrowsingDataCounterWrapperProducer alloc] init]]; - return [[ClearBrowsingDataCollectionViewController alloc] - initWithBrowserState:browser_state_.get() - manager:manager]; - } - - void SelectItem(int item, int section) { - NSIndexPath* indexPath = [NSIndexPath indexPathForItem:item - inSection:section]; - [controller() collectionView:[controller() collectionView] - didSelectItemAtIndexPath:indexPath]; - } - - ChromeIdentity* fake_identity() { - return [ios::FakeChromeIdentityService::GetInstanceFromChromeProvider() - ->GetAllIdentities() firstObject]; - } - - web::WebTaskEnvironment task_environment_; - std::unique_ptr<TestChromeBrowserState> browser_state_; - syncer::TestSyncService* test_sync_service_; - std::unique_ptr<BrowsingDataRemover> remover_; -}; - -// Tests ClearBrowsingDataCollectionViewControllerTest is set up with all -// appropriate items and sections. -TEST_F(ClearBrowsingDataCollectionViewControllerTest, TestModel) { - test_sync_service_->SetDisableReasons( - syncer::SyncService::DISABLE_REASON_USER_CHOICE); - CreateController(); - CheckController(); - - int section_offset = 0; - if (IsNewClearBrowsingDataUIEnabled()) { - section_offset = 1; - } - - CheckTextCellTextWithId(IDS_IOS_CLEAR_BROWSING_HISTORY, 0 + section_offset, - 0); - CheckAccessoryType(MDCCollectionViewCellAccessoryCheckmark, - 0 + section_offset, 0); - CheckTextCellTextWithId(IDS_IOS_CLEAR_COOKIES, 0 + section_offset, 1); - CheckAccessoryType(MDCCollectionViewCellAccessoryCheckmark, - 0 + section_offset, 1); - CheckTextCellTextWithId(IDS_IOS_CLEAR_CACHE, 0 + section_offset, 2); - CheckAccessoryType(MDCCollectionViewCellAccessoryCheckmark, - 0 + section_offset, 2); - CheckTextCellTextWithId(IDS_IOS_CLEAR_SAVED_PASSWORDS, 0 + section_offset, 3); - CheckAccessoryType(MDCCollectionViewCellAccessoryNone, 0 + section_offset, 3); - CheckTextCellTextWithId(IDS_IOS_CLEAR_AUTOFILL, 0 + section_offset, 4); - CheckAccessoryType(MDCCollectionViewCellAccessoryNone, 0 + section_offset, 4); - - CheckTextCellTextWithId(IDS_IOS_CLEAR_BUTTON, 1 + section_offset, 0); - - CheckSectionFooterWithId(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_SAVED_SITE_DATA, - 2 + section_offset); -} - -TEST_F(ClearBrowsingDataCollectionViewControllerTest, - TestItemsSignedInSyncOff) { - AuthenticationServiceFactory::GetForBrowserState(browser_state_.get()) - ->SignIn(fake_identity()); - - test_sync_service_->SetDisableReasons( - syncer::SyncService::DISABLE_REASON_USER_CHOICE); - - CreateController(); - CheckController(); - - int section_offset = 0; - if (IsNewClearBrowsingDataUIEnabled()) { - EXPECT_EQ(5, NumberOfSections()); - EXPECT_EQ(1, NumberOfItemsInSection(0)); - section_offset = 1; - } else { - EXPECT_EQ(4, NumberOfSections()); - } - - EXPECT_EQ(5, NumberOfItemsInSection(0 + section_offset)); - EXPECT_EQ(1, NumberOfItemsInSection(1 + section_offset)); - - EXPECT_EQ(1, NumberOfItemsInSection(2 + section_offset)); - CheckSectionFooterWithId(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_ACCOUNT, - 2 + section_offset); - - EXPECT_EQ(1, NumberOfItemsInSection(3 + section_offset)); - CheckSectionFooterWithId(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_SAVED_SITE_DATA, - 3 + section_offset); -} - -TEST_F(ClearBrowsingDataCollectionViewControllerTest, - TestItemsSignedInSyncActiveHistoryOff) { - test_sync_service_->SetDisableReasons( - syncer::SyncService::DisableReasonSet()); - test_sync_service_->SetTransportState( - syncer::SyncService::TransportState::ACTIVE); - test_sync_service_->SetFirstSetupComplete(true); - test_sync_service_->SetActiveDataTypes(syncer::ModelTypeSet()); - test_sync_service_->SetIsUsingSecondaryPassphrase(true); - - AuthenticationServiceFactory::GetForBrowserState(browser_state_.get()) - ->SignIn(fake_identity()); - CreateController(); - CheckController(); - - int section_offset = 0; - if (IsNewClearBrowsingDataUIEnabled()) { - section_offset = 1; - } - - CheckSectionFooterWithId(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_ACCOUNT, - 2 + section_offset); - - CheckSectionFooterWithId( - IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_CLEAR_SYNC_AND_SAVED_SITE_DATA, - 3 + section_offset); -} - -TEST_F(ClearBrowsingDataCollectionViewControllerTest, TestUpdatePrefWithValue) { - CreateController(); - CheckController(); - PrefService* prefs = browser_state_->GetPrefs(); - - const int section_offset = IsNewClearBrowsingDataUIEnabled() ? 1 : 0; - - SelectItem(kDeleteBrowsingHistoryItem, 0 + section_offset); - EXPECT_FALSE(prefs->GetBoolean(browsing_data::prefs::kDeleteBrowsingHistory)); - SelectItem(kDeleteCookiesItem, 0 + section_offset); - EXPECT_FALSE(prefs->GetBoolean(browsing_data::prefs::kDeleteCookies)); - SelectItem(kDeleteCacheItem, 0 + section_offset); - EXPECT_FALSE(prefs->GetBoolean(browsing_data::prefs::kDeleteCache)); - SelectItem(kDeletePasswordsItem, 0 + section_offset); - EXPECT_TRUE(prefs->GetBoolean(browsing_data::prefs::kDeletePasswords)); - SelectItem(kDeleteFormDataItem, 0 + section_offset); - EXPECT_TRUE(prefs->GetBoolean(browsing_data::prefs::kDeleteFormData)); -} - -} // namespace
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm index 83dff0b8..2f77f372 100644 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm +++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm
@@ -41,7 +41,6 @@ #import "ios/chrome/browser/ui/icons/chrome_icon.h" #import "ios/chrome/browser/ui/list_model/list_model.h" #import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_constants.h" -#import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_item.h" #import "ios/chrome/browser/ui/settings/cells/legacy/legacy_settings_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/browsing_data_counter_wrapper_producer.h" @@ -199,18 +198,11 @@ ListItem* timeRangeItem = [self timeRangeItem]; [model addItem:timeRangeItem toSectionWithIdentifier:SectionIdentifierTimeRange]; - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - self.collectionViewTimeRangeItem = - base::mac::ObjCCastStrict<LegacySettingsDetailItem>(timeRangeItem); - } else { - DCHECK(self.listType == ClearBrowsingDataListType::kListTypeTableView); - self.tableViewTimeRangeItem = - base::mac::ObjCCastStrict<TableViewDetailIconItem>(timeRangeItem); - self.tableViewTimeRangeItem.useCustomSeparator = YES; - } + self.tableViewTimeRangeItem = + base::mac::ObjCCastStrict<TableViewDetailIconItem>(timeRangeItem); + self.tableViewTimeRangeItem.useCustomSeparator = YES; [self addClearBrowsingDataItemsToModel:model]; - [self addClearDataButtonToModel:model]; [self addSyncProfileItemsToModel:model]; } @@ -330,17 +322,6 @@ sourceBarButtonItem:sourceBarButtonItem]; } -- (void)addClearDataButtonToModel:(ListModel*)model { - if (self.listType == ClearBrowsingDataListType::kListTypeTableView) { - return; - } - // Clear Browsing Data button. - ListItem* clearButtonItem = [self clearButtonItem]; - [model addSectionWithIdentifier:SectionIdentifierClearBrowsingDataButton]; - [model addItem:clearButtonItem - toSectionWithIdentifier:SectionIdentifierClearBrowsingDataButton]; -} - // Add footers about user's account data. - (void)addSyncProfileItemsToModel:(ListModel*)model { // Google Account footer. @@ -409,35 +390,6 @@ #pragma mark Items -- (ListItem*)clearButtonItem { - ListItem* clearButtonItem; - // Create a SettingsTextItem for CollectionView models and a - // TableViewTextButtonItem for TableView models. - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - SettingsTextItem* collectionClearButtonItem = - [[SettingsTextItem alloc] initWithType:ItemTypeClearBrowsingDataButton]; - collectionClearButtonItem.text = - l10n_util::GetNSString(IDS_IOS_CLEAR_BUTTON); - collectionClearButtonItem.accessibilityTraits |= UIAccessibilityTraitButton; - collectionClearButtonItem.textColor = [UIColor colorNamed:kRedColor]; - collectionClearButtonItem.accessibilityIdentifier = - kClearBrowsingDataButtonIdentifier; - clearButtonItem = collectionClearButtonItem; - } else { - TableViewTextButtonItem* tableViewClearButtonItem = - [[TableViewTextButtonItem alloc] - initWithType:ItemTypeClearBrowsingDataButton]; - tableViewClearButtonItem.buttonText = - l10n_util::GetNSString(IDS_IOS_CLEAR_BUTTON); - tableViewClearButtonItem.buttonBackgroundColor = - [UIColor colorNamed:kRedColor]; - tableViewClearButtonItem.buttonAccessibilityIdentifier = - kClearBrowsingDataButtonIdentifier; - clearButtonItem = tableViewClearButtonItem; - } - return clearButtonItem; -} - // Creates item of type |itemType| with |mask| of data to be cleared if // selected, |prefName|, and |titleId| of item. - (ListItem*)clearDataItemWithType:(ClearBrowsingDataItemType)itemType @@ -445,89 +397,43 @@ mask:(BrowsingDataRemoveMask)mask prefName:(const char*)prefName { PrefService* prefs = self.browserState->GetPrefs(); - ListItem* clearDataItem; - // Create a ClearBrowsingDataItem for a CollectionView model and a - // TableViewClearBrowsingDataItem for a TableView model. - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - ClearBrowsingDataItem* collectionClearDataItem = - [[ClearBrowsingDataItem alloc] initWithType:itemType counter:nullptr]; - collectionClearDataItem.text = l10n_util::GetNSString(titleMessageID); - if (prefs->GetBoolean(prefName)) { - collectionClearDataItem.accessoryType = - MDCCollectionViewCellAccessoryCheckmark; - } - collectionClearDataItem.dataTypeMask = mask; - collectionClearDataItem.prefName = prefName; - collectionClearDataItem.accessibilityIdentifier = - [self accessibilityIdentifierFromItemType:itemType]; - if (itemType == ItemTypeDataTypeCookiesSiteData) { - // Because there is no counter for cookies, an explanatory text is - // displayed. - collectionClearDataItem.detailText = - l10n_util::GetNSString(IDS_DEL_COOKIES_COUNTER); - } else { - __weak ClearBrowsingDataManager* weakSelf = self; - __weak ClearBrowsingDataItem* weakCollectionClearDataItem = - collectionClearDataItem; - BrowsingDataCounterWrapper::UpdateUICallback callback = - base::BindRepeating(^( - const browsing_data::BrowsingDataCounter::Result& result) { - weakCollectionClearDataItem.detailText = - [weakSelf counterTextFromResult:result]; - [weakSelf.consumer updateCellsForItem:weakCollectionClearDataItem]; - }); - std::unique_ptr<BrowsingDataCounterWrapper> counter = - [self.counterWrapperProducer - createCounterWrapperWithPrefName:prefName - browserState:self.browserState - prefService:prefs - updateUiCallback:callback]; - _countersByMasks.emplace(mask, std::move(counter)); - } - clearDataItem = collectionClearDataItem; + TableViewClearBrowsingDataItem* clearDataItem = + [[TableViewClearBrowsingDataItem alloc] initWithType:itemType]; + clearDataItem.text = l10n_util::GetNSString(titleMessageID); + clearDataItem.checked = prefs->GetBoolean(prefName); + clearDataItem.accessibilityIdentifier = + [self accessibilityIdentifierFromItemType:itemType]; + clearDataItem.dataTypeMask = mask; + clearDataItem.prefName = prefName; + clearDataItem.useCustomSeparator = YES; + clearDataItem.checkedBackgroundColor = [[UIColor colorNamed:kBlueColor] + colorWithAlphaComponent:kSelectedBackgroundColorAlpha]; + clearDataItem.imageName = [_imageNamesByItemTypes + objectForKey:[NSNumber numberWithInteger:itemType]]; + if (itemType == ItemTypeDataTypeCookiesSiteData) { + // Because there is no counter for cookies, an explanatory text is + // displayed. + clearDataItem.detailText = l10n_util::GetNSString(IDS_DEL_COOKIES_COUNTER); } else { - TableViewClearBrowsingDataItem* tableViewClearDataItem = - [[TableViewClearBrowsingDataItem alloc] initWithType:itemType]; - tableViewClearDataItem.text = l10n_util::GetNSString(titleMessageID); - tableViewClearDataItem.checked = prefs->GetBoolean(prefName); - tableViewClearDataItem.accessibilityIdentifier = - [self accessibilityIdentifierFromItemType:itemType]; - tableViewClearDataItem.dataTypeMask = mask; - tableViewClearDataItem.prefName = prefName; - tableViewClearDataItem.useCustomSeparator = YES; - tableViewClearDataItem.checkedBackgroundColor = - [[UIColor colorNamed:kBlueColor] - colorWithAlphaComponent:kSelectedBackgroundColorAlpha]; - tableViewClearDataItem.imageName = [_imageNamesByItemTypes - objectForKey:[NSNumber numberWithInteger:itemType]]; - if (itemType == ItemTypeDataTypeCookiesSiteData) { - // Because there is no counter for cookies, an explanatory text is - // displayed. - tableViewClearDataItem.detailText = - l10n_util::GetNSString(IDS_DEL_COOKIES_COUNTER); - } else { - // Having a placeholder |detailText| helps reduce the observable - // row-height changes induced by the counter callbacks. - tableViewClearDataItem.detailText = @"\u00A0"; - __weak ClearBrowsingDataManager* weakSelf = self; - __weak TableViewClearBrowsingDataItem* weakTableClearDataItem = - tableViewClearDataItem; - BrowsingDataCounterWrapper::UpdateUICallback callback = - base::BindRepeating( - ^(const browsing_data::BrowsingDataCounter::Result& result) { - weakTableClearDataItem.detailText = - [weakSelf counterTextFromResult:result]; - [weakSelf.consumer updateCellsForItem:weakTableClearDataItem]; - }); - std::unique_ptr<BrowsingDataCounterWrapper> counter = - [self.counterWrapperProducer - createCounterWrapperWithPrefName:prefName - browserState:self.browserState - prefService:prefs - updateUiCallback:callback]; - _countersByMasks.emplace(mask, std::move(counter)); - } - clearDataItem = tableViewClearDataItem; + // Having a placeholder |detailText| helps reduce the observable + // row-height changes induced by the counter callbacks. + clearDataItem.detailText = @"\u00A0"; + __weak ClearBrowsingDataManager* weakSelf = self; + __weak TableViewClearBrowsingDataItem* weakTableClearDataItem = + clearDataItem; + BrowsingDataCounterWrapper::UpdateUICallback callback = base::BindRepeating( + ^(const browsing_data::BrowsingDataCounter::Result& result) { + weakTableClearDataItem.detailText = + [weakSelf counterTextFromResult:result]; + [weakSelf.consumer updateCellsForItem:weakTableClearDataItem]; + }); + std::unique_ptr<BrowsingDataCounterWrapper> counter = + [self.counterWrapperProducer + createCounterWrapperWithPrefName:prefName + browserState:self.browserState + prefService:prefs + updateUiCallback:callback]; + _countersByMasks.emplace(mask, std::move(counter)); } return clearDataItem; } @@ -539,28 +445,10 @@ } - (ListItem*)footerGoogleAccountItem { - ListItem* footerItem; - // Use CollectionViewFooterItem for CollectionView models and - // TableViewTextLinkItem for TableView models. - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - CollectionViewFooterItem* collectionFooterItem = - [[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooterGoogleAccount]; - collectionFooterItem.cellStyle = CollectionViewCellStyle::kUIKit; - collectionFooterItem.text = - l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_ACCOUNT); - UIImage* image = ios::GetChromeBrowserProvider() - ->GetBrandedImageProvider() - ->GetClearBrowsingDataAccountActivityImage(); - collectionFooterItem.image = image; - footerItem = collectionFooterItem; - } else { - TableViewTextLinkItem* tableViewFooterItem = [[TableViewTextLinkItem alloc] - initWithType:ItemTypeFooterGoogleAccount]; - tableViewFooterItem.text = - l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_ACCOUNT); - footerItem = tableViewFooterItem; - } + TableViewTextLinkItem* footerItem = + [[TableViewTextLinkItem alloc] initWithType:ItemTypeFooterGoogleAccount]; + footerItem.text = + l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_FOOTER_ACCOUNT); return footerItem; } @@ -601,62 +489,26 @@ titleID:(int)titleMessageID URL:(const char[])URL image:(UIImage*)image { - ListItem* footerItem; - // Use CollectionViewFooterItem for CollectionView models and - // TableViewTextLinkItem for TableView models. - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - CollectionViewFooterItem* collectionFooterItem = - [[CollectionViewFooterItem alloc] initWithType:itemType]; - collectionFooterItem.cellStyle = CollectionViewCellStyle::kUIKit; - collectionFooterItem.text = l10n_util::GetNSString(titleMessageID); - collectionFooterItem.linkURL = google_util::AppendGoogleLocaleParam( - GURL(URL), GetApplicationContext()->GetApplicationLocale()); - collectionFooterItem.linkDelegate = self.linkDelegate; - collectionFooterItem.image = image; - footerItem = collectionFooterItem; - } else { - TableViewTextLinkItem* tableViewFooterItem = - [[TableViewTextLinkItem alloc] initWithType:itemType]; - tableViewFooterItem.text = l10n_util::GetNSString(titleMessageID); - tableViewFooterItem.linkURL = google_util::AppendGoogleLocaleParam( - GURL(URL), GetApplicationContext()->GetApplicationLocale()); - footerItem = tableViewFooterItem; - } - + TableViewTextLinkItem* footerItem = + [[TableViewTextLinkItem alloc] initWithType:itemType]; + footerItem.text = l10n_util::GetNSString(titleMessageID); + footerItem.linkURL = google_util::AppendGoogleLocaleParam( + GURL(URL), GetApplicationContext()->GetApplicationLocale()); return footerItem; } - (ListItem*)timeRangeItem { - ListItem* timeRangeItem; - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - LegacySettingsDetailItem* collectionTimeRangeItem = - [[LegacySettingsDetailItem alloc] initWithType:ItemTypeTimeRange]; - collectionTimeRangeItem.text = l10n_util::GetNSString( - IDS_IOS_CLEAR_BROWSING_DATA_TIME_RANGE_SELECTOR_TITLE); - NSString* detailText = [TimeRangeSelectorTableViewController - timePeriodLabelForPrefs:self.browserState->GetPrefs()]; - DCHECK(detailText); - collectionTimeRangeItem.detailText = detailText; - collectionTimeRangeItem.accessoryType = - MDCCollectionViewCellAccessoryDisclosureIndicator; - collectionTimeRangeItem.accessibilityTraits |= UIAccessibilityTraitButton; - timeRangeItem = collectionTimeRangeItem; - } else { - DCHECK(self.listType == ClearBrowsingDataListType::kListTypeTableView); - TableViewDetailIconItem* tableTimeRangeItem = - [[TableViewDetailIconItem alloc] initWithType:ItemTypeTimeRange]; - tableTimeRangeItem.text = l10n_util::GetNSString( - IDS_IOS_CLEAR_BROWSING_DATA_TIME_RANGE_SELECTOR_TITLE); - NSString* detailText = [TimeRangeSelectorTableViewController - timePeriodLabelForPrefs:self.browserState->GetPrefs()]; - DCHECK(detailText); + TableViewDetailIconItem* timeRangeItem = + [[TableViewDetailIconItem alloc] initWithType:ItemTypeTimeRange]; + timeRangeItem.text = l10n_util::GetNSString( + IDS_IOS_CLEAR_BROWSING_DATA_TIME_RANGE_SELECTOR_TITLE); + NSString* detailText = [TimeRangeSelectorTableViewController + timePeriodLabelForPrefs:self.browserState->GetPrefs()]; + DCHECK(detailText); - tableTimeRangeItem.detailText = detailText; - tableTimeRangeItem.accessoryType = - UITableViewCellAccessoryDisclosureIndicator; - tableTimeRangeItem.accessibilityTraits |= UIAccessibilityTraitButton; - timeRangeItem = tableTimeRangeItem; - } + timeRangeItem.detailText = detailText; + timeRangeItem.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + timeRangeItem.accessibilityTraits |= UIAccessibilityTraitButton; return timeRangeItem; } @@ -820,14 +672,8 @@ DCHECK(preferenceName == browsing_data::prefs::kDeleteTimePeriod); NSString* detailText = [TimeRangeSelectorTableViewController timePeriodLabelForPrefs:self.browserState->GetPrefs()]; - if (self.listType == ClearBrowsingDataListType::kListTypeCollectionView) { - self.collectionViewTimeRangeItem.detailText = detailText; - [self.consumer updateCellsForItem:self.collectionViewTimeRangeItem]; - } else { - DCHECK(self.listType == ClearBrowsingDataListType::kListTypeTableView); - self.tableViewTimeRangeItem.detailText = detailText; - [self.consumer updateCellsForItem:self.tableViewTimeRangeItem]; - } + self.tableViewTimeRangeItem.detailText = detailText; + [self.consumer updateCellsForItem:self.tableViewTimeRangeItem]; } #pragma mark BrowsingDataRemoverObserving
diff --git a/ios/chrome/browser/ui/settings/privacy_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy_table_view_controller.mm index 4baaa28..f5caeae 100644 --- a/ios/chrome/browser/ui/settings/privacy_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/privacy_table_view_controller.mm
@@ -18,7 +18,6 @@ #import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_local_commands.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.h" #import "ios/chrome/browser/ui/settings/handoff_table_view_controller.h"
diff --git a/ios/chrome/browser/ui/toolbar/accessory/BUILD.gn b/ios/chrome/browser/ui/toolbar/accessory/BUILD.gn index 342b957..7f98ff9 100644 --- a/ios/chrome/browser/ui/toolbar/accessory/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/accessory/BUILD.gn
@@ -4,6 +4,7 @@ source_set("accessory") { sources = [ + "toolbar_accessory_coordinator_delegate.h", "toolbar_accessory_presenter.h", "toolbar_accessory_presenter.mm", ]
diff --git a/ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_coordinator_delegate.h b/ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_coordinator_delegate.h new file mode 100644 index 0000000..3d51b793 --- /dev/null +++ b/ios/chrome/browser/ui/toolbar/accessory/toolbar_accessory_coordinator_delegate.h
@@ -0,0 +1,17 @@ +// 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_TOOLBAR_ACCESSORY_TOOLBAR_ACCESSORY_COORDINATOR_DELEGATE_H_ +#define IOS_CHROME_BROWSER_UI_TOOLBAR_ACCESSORY_TOOLBAR_ACCESSORY_COORDINATOR_DELEGATE_H_ + +@class ChromeCoordinator; + +@protocol ToolbarAccessoryCoordinatorDelegate + +- (void)setHeadersForToolbarAccessoryCoordinator: + (ChromeCoordinator*)toolbarAccessoryCoordinator; + +@end + +#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_ACCESSORY_TOOLBAR_ACCESSORY_COORDINATOR_DELEGATE_H_
diff --git a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm index 8b79eea..d8357ef 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm
@@ -39,7 +39,6 @@ #import "ios/chrome/browser/ui/settings/cells/clear_browsing_data_constants.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" -#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_ui_constants.h" #import "ios/chrome/browser/ui/settings/credit_card_scanner/credit_card_scanner_view_controller.h" #import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h"
diff --git a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc index 49ff3d8..777c61cd 100644 --- a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc
@@ -882,7 +882,8 @@ bool do_streamon = false; // Enqueue all the inputs we can. const size_t old_inputs_queued = input_queue_->QueuedBuffersCount(); - while (!encoder_input_queue_.empty()) { + while (!encoder_input_queue_.empty() && + input_queue_->FreeBuffersCount() > 0) { // A null frame indicates a flush. if (encoder_input_queue_.front().frame == nullptr) { DVLOGF(3) << "All input frames needed to be flushed are enqueued."; @@ -910,8 +911,9 @@ break; } auto input_buffer = input_queue_->GetFreeBuffer(); - if (!input_buffer) - break; + // input_buffer cannot be base::nullopt since we checked for + // input_queue_->FreeBuffersCount() > 0 before entering the loop. + DCHECK(input_buffer); if (!EnqueueInputRecord(std::move(*input_buffer))) return; }
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc index 11af6fed..6dabd17d 100644 --- a/net/http/http_request_headers.cc +++ b/net/http/http_request_headers.cc
@@ -20,7 +20,13 @@ namespace net { +const char HttpRequestHeaders::kConnectMethod[] = "CONNECT"; const char HttpRequestHeaders::kGetMethod[] = "GET"; +const char HttpRequestHeaders::kHeadMethod[] = "HEAD"; +const char HttpRequestHeaders::kOptionsMethod[] = "OPTIONS"; +const char HttpRequestHeaders::kPostMethod[] = "POST"; +const char HttpRequestHeaders::kTraceMethod[] = "TRACE"; +const char HttpRequestHeaders::kTrackMethod[] = "TRACK"; const char HttpRequestHeaders::kAcceptCharset[] = "Accept-Charset"; const char HttpRequestHeaders::kAcceptEncoding[] = "Accept-Encoding"; const char HttpRequestHeaders::kAcceptLanguage[] = "Accept-Language";
diff --git a/net/http/http_request_headers.h b/net/http/http_request_headers.h index 3124ee7a..a923a2e0 100644 --- a/net/http/http_request_headers.h +++ b/net/http/http_request_headers.h
@@ -60,7 +60,13 @@ DISALLOW_COPY_AND_ASSIGN(Iterator); }; + static const char kConnectMethod[]; static const char kGetMethod[]; + static const char kHeadMethod[]; + static const char kOptionsMethod[]; + static const char kPostMethod[]; + static const char kTraceMethod[]; + static const char kTrackMethod[]; static const char kAcceptCharset[]; static const char kAcceptEncoding[];
diff --git a/services/device/nfc/android/java/src/org/chromium/device/nfc/NdefMessageUtils.java b/services/device/nfc/android/java/src/org/chromium/device/nfc/NdefMessageUtils.java index 82636231..a4d74dd 100644 --- a/services/device/nfc/android/java/src/org/chromium/device/nfc/NdefMessageUtils.java +++ b/services/device/nfc/android/java/src/org/chromium/device/nfc/NdefMessageUtils.java
@@ -155,8 +155,12 @@ } if (record.category == NdefRecordTypeCategory.EXTERNAL) { - if (isValidExternalType(record.recordType)) { - return createPlatformExternalRecord(record.recordType, record.id, record.data); + // It's impossible for a valid record to have non-empty |data| and non-null + // |payloadMessage| at the same time. + if (isValidExternalType(record.recordType) + && (record.data.length == 0 || record.payloadMessage == null)) { + return createPlatformExternalRecord( + record.recordType, record.id, record.data, record.payloadMessage); } throw new InvalidNdefMessageException(); } @@ -318,7 +322,7 @@ nfcRecord.category = NdefRecordTypeCategory.EXTERNAL; nfcRecord.recordType = type; nfcRecord.data = payload; - nfcRecord.payloadMessage = getNdefMessageFromPayload(payload); + nfcRecord.payloadMessage = getNdefMessageFromPayloadBytes(payload); return nfcRecord; } @@ -419,10 +423,17 @@ * Creates a TNF_EXTERNAL_TYPE android.nfc.NdefRecord. */ public static android.nfc.NdefRecord createPlatformExternalRecord( - String recordType, String id, byte[] payload) { + String recordType, String id, byte[] payload, NdefMessage payloadMessage) { // Already guaranteed by the caller. assert recordType != null && !recordType.isEmpty(); + // |payloadMessage| being non-null means this record has an NDEF message as its payload. + if (payloadMessage != null) { + // Should be guaranteed by the caller that |payload| is an empty byte array. + assert payload.length == 0; + payload = getBytesFromPayloadNdefMessage(payloadMessage); + } + // NFC Forum requires that the domain and type used in an external record are treated as // case insensitive, however Android intent filtering is always case sensitive. So we force // the domain and type to lower-case here and later we will compare in a case insensitive @@ -458,7 +469,7 @@ * Tries to construct a android.nfc.NdefMessage from the raw bytes |payload| then converts it to * a Mojo NdefMessage and returns. Returns null for anything wrong. */ - private static NdefMessage getNdefMessageFromPayload(byte[] payload) { + private static NdefMessage getNdefMessageFromPayloadBytes(byte[] payload) { try { android.nfc.NdefMessage payloadMessage = new android.nfc.NdefMessage(payload); return toNdefMessage(payloadMessage); @@ -466,4 +477,17 @@ } return null; } + + /** + * Tries to convert the Mojo NdefMessage |payloadMessage| to an android.nfc.NdefMessage then + * returns its raw bytes. Returns null for anything wrong. + */ + private static byte[] getBytesFromPayloadNdefMessage(NdefMessage payloadMessage) { + try { + android.nfc.NdefMessage message = toNdefMessage(payloadMessage); + return message.toByteArray(); + } catch (InvalidNdefMessageException e) { + } + return null; + } }
diff --git a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java index f411c1b4..a143e7e 100644 --- a/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java +++ b/services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java
@@ -183,19 +183,22 @@ if (!checkIfReady(callback)) return; if (!NdefMessageValidator.isValid(message)) { - callback.call(createError(NdefErrorType.INVALID_MESSAGE)); + callback.call(createError(NdefErrorType.INVALID_MESSAGE, + "Cannot push the message because it's invalid.")); return; } // Check NdefPushOptions that are not supported by Android platform. if (options.target == NdefPushTarget.PEER) { - callback.call(createError(NdefErrorType.NOT_SUPPORTED)); + callback.call(createError( + NdefErrorType.NOT_SUPPORTED, "The \"peer\" target is not supported yet.")); return; } // If previous pending push operation is not completed, cancel it. if (mPendingPushOperation != null) { - mPendingPushOperation.complete(createError(NdefErrorType.OPERATION_CANCELLED)); + mPendingPushOperation.complete(createError(NdefErrorType.OPERATION_CANCELLED, + "Push is cancelled due to a new push request.")); } mPendingPushOperation = new PendingPushOperation(message, options, callback); @@ -216,14 +219,17 @@ if (!checkIfReady(callback)) return; if (target == NdefPushTarget.PEER) { - callback.call(createError(NdefErrorType.NOT_SUPPORTED)); + callback.call(createError( + NdefErrorType.NOT_SUPPORTED, "The \"peer\" target is not supported yet.")); return; } if (mPendingPushOperation == null) { - callback.call(createError(NdefErrorType.CANNOT_CANCEL)); + callback.call(createError( + NdefErrorType.CANNOT_CANCEL, "No pending push operation to cancel.")); } else { - completePendingPushOperation(createError(NdefErrorType.OPERATION_CANCELLED)); + completePendingPushOperation(createError( + NdefErrorType.OPERATION_CANCELLED, "The push operation is already cancelled.")); callback.call(null); } } @@ -244,7 +250,8 @@ // report a bad message to Mojo but unfortunately Mojo bindings for Java does not support // this feature yet. So, we just passes back a generic error instead. if (mWatchers.indexOfKey(id) >= 0) { - callback.call(createError(NdefErrorType.NOT_READABLE)); + callback.call(createError(NdefErrorType.NOT_READABLE, + "Cannot start because the received scan request is duplicate.")); return; } mWatchers.put(id, options); @@ -264,7 +271,8 @@ if (!checkIfReady(callback)) return; if (mWatchers.indexOfKey(id) < 0) { - callback.call(createError(NdefErrorType.NOT_FOUND)); + callback.call( + createError(NdefErrorType.NOT_FOUND, "No pending scan operation to cancel.")); } else { mWatchers.remove(id); callback.call(null); @@ -282,7 +290,8 @@ if (!checkIfReady(callback)) return; if (mWatchers.size() == 0) { - callback.call(createError(NdefErrorType.NOT_FOUND)); + callback.call( + createError(NdefErrorType.NOT_FOUND, "No pending scan operation to cancel.")); } else { mWatchers.clear(); callback.call(null); @@ -347,9 +356,13 @@ /** * Helper method that creates NdefError object from NdefErrorType. */ - private NdefError createError(int errorType) { + private NdefError createError(int errorType, String errorMessage) { + // Guaranteed by callers. + assert errorMessage != null; + NdefError error = new NdefError(); error.errorType = errorType; + error.errorMessage = errorMessage; return error; } @@ -359,11 +372,11 @@ */ private NdefError checkIfReady() { if (!mHasPermission || mActivity == null) { - return createError(NdefErrorType.NOT_ALLOWED); + return createError(NdefErrorType.NOT_ALLOWED, "The operation is not allowed."); } else if (mNfcManager == null || mNfcAdapter == null) { - return createError(NdefErrorType.NOT_SUPPORTED); + return createError(NdefErrorType.NOT_SUPPORTED, "NFC is not supported."); } else if (!mNfcAdapter.isEnabled()) { - return createError(NdefErrorType.NOT_READABLE); + return createError(NdefErrorType.NOT_READABLE, "NFC setting is disabled."); } return null; } @@ -498,13 +511,16 @@ pendingPushOperationCompleted(null); } catch (InvalidNdefMessageException e) { Log.w(TAG, "Cannot write data to NFC tag. Invalid NdefMessage."); - pendingPushOperationCompleted(createError(NdefErrorType.INVALID_MESSAGE)); + pendingPushOperationCompleted(createError(NdefErrorType.INVALID_MESSAGE, + "Cannot push the message because it's invalid.")); } catch (TagLostException e) { - Log.w(TAG, "Cannot write data to NFC tag. Tag is lost."); - pendingPushOperationCompleted(createError(NdefErrorType.IO_ERROR)); + Log.w(TAG, "Cannot write data to NFC tag. Tag is lost: " + e.getMessage()); + pendingPushOperationCompleted(createError(NdefErrorType.IO_ERROR, + "Failed to write because the tag is lost: " + e.getMessage())); } catch (FormatException | IllegalStateException | IOException e) { - Log.w(TAG, "Cannot write data to NFC tag. IO_ERROR."); - pendingPushOperationCompleted(createError(NdefErrorType.IO_ERROR)); + Log.w(TAG, "Cannot write data to NFC tag: " + e.getMessage()); + pendingPushOperationCompleted(createError(NdefErrorType.IO_ERROR, + "Failed to write due to an IO error: " + e.getMessage())); } } @@ -544,21 +560,26 @@ NdefMessage webNdefMessage = NdefMessageUtils.toNdefMessage(message); notifyMatchingWatchers(webNdefMessage); } catch (UnsupportedEncodingException e) { - Log.w(TAG, "Cannot read data from NFC tag. Cannot convert to NdefMessage."); - notifyErrorToAllWatchers(NdefErrorType.INVALID_MESSAGE); + Log.w(TAG, + "Cannot read data from NFC tag. Cannot convert to NdefMessage:" + + e.getMessage()); + notifyErrorToAllWatchers(createError(NdefErrorType.INVALID_MESSAGE, + "Failed to decode the NdefMessage read from the tag: " + e.getMessage())); } catch (TagLostException e) { - Log.w(TAG, "Cannot read data from NFC tag. Tag is lost."); - notifyErrorToAllWatchers(NdefErrorType.IO_ERROR); + Log.w(TAG, "Cannot read data from NFC tag. Tag is lost: " + e.getMessage()); + notifyErrorToAllWatchers(createError(NdefErrorType.IO_ERROR, + "Failed to read because the tag is lost: " + e.getMessage())); } catch (FormatException | IllegalStateException | IOException e) { - Log.w(TAG, "Cannot read data from NFC tag. IO_ERROR."); - notifyErrorToAllWatchers(NdefErrorType.IO_ERROR); + Log.w(TAG, "Cannot read data from NFC tag. IO_ERROR: " + e.getMessage()); + notifyErrorToAllWatchers(createError(NdefErrorType.IO_ERROR, + "Failed to read due to an IO error: " + e.getMessage())); } } /** * Notify all active watchers that an error happened when trying to read the tag coming nearby. */ - private void notifyErrorToAllWatchers(int error) { + private void notifyErrorToAllWatchers(NdefError error) { for (int i = 0; i < mWatchers.size(); i++) { mClient.onError(error); } @@ -640,8 +661,10 @@ // This tag is not NDEF compatible. if (mTagHandler == null) { Log.w(TAG, "This tag is not NDEF compatible."); - notifyErrorToAllWatchers(NdefErrorType.NOT_SUPPORTED); - pendingPushOperationCompleted(createError(NdefErrorType.NOT_SUPPORTED)); + notifyErrorToAllWatchers( + createError(NdefErrorType.NOT_SUPPORTED, "This tag is not NDEF compatible.")); + pendingPushOperationCompleted( + createError(NdefErrorType.NOT_SUPPORTED, "This tag is not NDEF compatible.")); return; }
diff --git a/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java b/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java index 661c3d5..d82d7739c 100644 --- a/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java +++ b/services/device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java
@@ -335,7 +335,7 @@ // Test external record conversion. android.nfc.NdefMessage extNdefMessage = new android.nfc.NdefMessage( NdefMessageUtils.createPlatformExternalRecord(DUMMY_EXTERNAL_TYPE, DUMMY_RECORD_ID, - ApiCompatibilityUtils.getBytesUtf8(TEST_TEXT))); + ApiCompatibilityUtils.getBytesUtf8(TEST_TEXT), null /* payloadMessage */)); NdefMessage extMojoNdefMessage = NdefMessageUtils.toNdefMessage(extNdefMessage); assertEquals(1, extMojoNdefMessage.data.length); assertEquals(NdefRecordTypeCategory.EXTERNAL, extMojoNdefMessage.data[0].category); @@ -351,9 +351,9 @@ android.nfc.NdefRecord.createTextRecord(LANG_EN_US, TEST_TEXT)); byte[] payloadBytes = payloadMessage.toByteArray(); // Put |payloadBytes| as payload of an external record. - android.nfc.NdefMessage extNdefMessage1 = - new android.nfc.NdefMessage(NdefMessageUtils.createPlatformExternalRecord( - DUMMY_EXTERNAL_TYPE, DUMMY_RECORD_ID, payloadBytes)); + android.nfc.NdefMessage extNdefMessage1 = new android.nfc.NdefMessage( + NdefMessageUtils.createPlatformExternalRecord(DUMMY_EXTERNAL_TYPE, DUMMY_RECORD_ID, + payloadBytes, null /* payloadMessage */)); NdefMessage extMojoNdefMessage1 = NdefMessageUtils.toNdefMessage(extNdefMessage1); assertEquals(1, extMojoNdefMessage1.data.length); assertEquals(NdefRecordTypeCategory.EXTERNAL, extMojoNdefMessage1.data[0].category); @@ -375,7 +375,7 @@ */ @Test @Feature({"NFCTest"}) - public void testMojoToNdefConversion() throws InvalidNdefMessageException { + public void testMojoToNdefConversion() throws InvalidNdefMessageException, FormatException { // Test url record conversion. NdefRecord urlMojoNdefRecord = new NdefRecord(); urlMojoNdefRecord.category = NdefRecordTypeCategory.STANDARDIZED; @@ -526,6 +526,42 @@ assertEquals(DUMMY_RECORD_ID, new String(extNdefMessage.getRecords()[0].getId())); assertEquals(TEST_TEXT, new String(extNdefMessage.getRecords()[0].getPayload())); + // Test conversion for external records with the payload being a ndef message. + NdefRecord payloadMojoRecord = new NdefRecord(); + payloadMojoRecord.category = NdefRecordTypeCategory.STANDARDIZED; + payloadMojoRecord.recordType = NdefMessageUtils.RECORD_TYPE_URL; + payloadMojoRecord.id = DUMMY_RECORD_ID; + payloadMojoRecord.data = ApiCompatibilityUtils.getBytesUtf8(TEST_URL); + // Prepare an external record that embeds |payloadMojoRecord| in its payload. + NdefRecord extMojoNdefRecord1 = new NdefRecord(); + extMojoNdefRecord1.category = NdefRecordTypeCategory.EXTERNAL; + extMojoNdefRecord1.recordType = DUMMY_EXTERNAL_TYPE; + extMojoNdefRecord1.id = DUMMY_RECORD_ID; + // device.mojom.NDEFRecord.data is not allowed to be null, instead, empty byte array is just + // what's passed from Blink. + extMojoNdefRecord1.data = new byte[0]; + extMojoNdefRecord1.payloadMessage = createMojoNdefMessage(payloadMojoRecord); + // Do the conversion. + android.nfc.NdefMessage extNdefMessage1 = + NdefMessageUtils.toNdefMessage(createMojoNdefMessage(extMojoNdefRecord1)); + assertEquals(1, extNdefMessage1.getRecords().length); + assertEquals( + android.nfc.NdefRecord.TNF_EXTERNAL_TYPE, extNdefMessage1.getRecords()[0].getTnf()); + assertEquals(DUMMY_EXTERNAL_TYPE, new String(extNdefMessage1.getRecords()[0].getType())); + assertEquals(DUMMY_RECORD_ID, new String(extNdefMessage1.getRecords()[0].getId())); + // The payload raw bytes should be able to construct an ndef message containing an ndef + // record that has content corresponding with the original |payloadMojoRecord|. + android.nfc.NdefMessage payloadMessage = + new android.nfc.NdefMessage(extNdefMessage1.getRecords()[0].getPayload()); + assertNotNull(payloadMessage); + assertEquals(1, payloadMessage.getRecords().length); + assertEquals( + android.nfc.NdefRecord.TNF_WELL_KNOWN, payloadMessage.getRecords()[0].getTnf()); + assertEquals(new String(android.nfc.NdefRecord.RTD_URI), + new String(payloadMessage.getRecords()[0].getType())); + assertEquals(DUMMY_RECORD_ID, new String(payloadMessage.getRecords()[0].getId())); + assertEquals(TEST_URL, payloadMessage.getRecords()[0].toUri().toString()); + // Test EMPTY record conversion. NdefRecord emptyMojoNdefRecord = new NdefRecord(); emptyMojoNdefRecord.category = NdefRecordTypeCategory.STANDARDIZED; @@ -814,7 +850,7 @@ // Prepare the external type record. android.nfc.NdefMessage extNdefMessage = new android.nfc.NdefMessage( NdefMessageUtils.createPlatformExternalRecord(DUMMY_EXTERNAL_TYPE, DUMMY_RECORD_ID, - ApiCompatibilityUtils.getBytesUtf8(TEST_TEXT))); + ApiCompatibilityUtils.getBytesUtf8(TEST_TEXT), null /* payloadMessage */)); try { doReturn(extNdefMessage).when(mNfcTagHandler).read(); } catch (IOException | FormatException e) { @@ -969,7 +1005,9 @@ nfc.processPendingOperationsForTesting(null); // An error is notified. - verify(mNfcClient, times(1)).onError(NdefErrorType.NOT_SUPPORTED); + verify(mNfcClient, times(1)).onError(mErrorCaptor.capture()); + assertNotNull(mErrorCaptor.getValue()); + assertEquals(NdefErrorType.NOT_SUPPORTED, mErrorCaptor.getValue().errorType); // No watch. verify(mNfcClient, times(0)) .onWatch(mOnWatchCallbackCaptor.capture(), nullable(String.class), @@ -996,7 +1034,7 @@ nfc.processPendingOperationsForTesting(null); // An error is NOT notified. - verify(mNfcClient, times(0)).onError(NdefErrorType.NOT_SUPPORTED); + verify(mNfcClient, times(0)).onError(mErrorCaptor.capture()); // No watch. verify(mNfcClient, times(0)) .onWatch(mOnWatchCallbackCaptor.capture(), nullable(String.class), @@ -1025,7 +1063,9 @@ verify(mNfcClient, times(0)) .onWatch(mOnWatchCallbackCaptor.capture(), nullable(String.class), any(NdefMessage.class)); - verify(mNfcClient, times(1)).onError(NdefErrorType.IO_ERROR); + verify(mNfcClient, times(1)).onError(mErrorCaptor.capture()); + assertNotNull(mErrorCaptor.getValue()); + assertEquals(NdefErrorType.IO_ERROR, mErrorCaptor.getValue().errorType); } /**
diff --git a/services/device/public/mojom/nfc.mojom b/services/device/public/mojom/nfc.mojom index 251b020..d2b8602 100644 --- a/services/device/public/mojom/nfc.mojom +++ b/services/device/public/mojom/nfc.mojom
@@ -45,8 +45,12 @@ kLocal }; +// Used to notify errors when pushing/watching. struct NDEFError { NDEFErrorType error_type; + + // Detailed information about how/why the error happened. + string error_message; }; // https://w3c.github.io/web-nfc/#dom-ndefrecord @@ -156,5 +160,5 @@ // Sends |error| to all readers that are trying to read some data from the nfc // tag coming nearby. - OnError(NDEFErrorType error); + OnError(NDEFError error); };
diff --git a/services/network/cors/cors_url_loader.cc b/services/network/cors/cors_url_loader.cc index 5554f0a..2da1a9e 100644 --- a/services/network/cors/cors_url_loader.cc +++ b/services/network/cors/cors_url_loader.cc
@@ -429,9 +429,11 @@ // // We exclude navigation requests to keep the existing behavior. // TODO(yhirano): Reconsider this. - if (!IsNavigationRequestMode(request_.mode) && request_.request_initiator && + if (request_.mode != network::mojom::RequestMode::kNavigate && + request_.request_initiator && (fetch_cors_flag_ || - (request_.method != "GET" && request_.method != "HEAD"))) { + (request_.method != net::HttpRequestHeaders::kGetMethod && + request_.method != net::HttpRequestHeaders::kHeadMethod))) { if (tainted_) { request_.headers.SetHeader(net::HttpRequestHeaders::kOrigin, url::Origin().Serialize());
diff --git a/services/network/cors/cors_url_loader_factory.cc b/services/network/cors/cors_url_loader_factory.cc index aa8704a..e91b2db 100644 --- a/services/network/cors/cors_url_loader_factory.cc +++ b/services/network/cors/cors_url_loader_factory.cc
@@ -236,7 +236,8 @@ uint32_t options) { // CORS needs a proper origin (including a unique opaque origin). If the // request doesn't have one, CORS cannot work. - if (!request.request_initiator && !IsNavigationRequestMode(request.mode) && + if (!request.request_initiator && + request.mode != network::mojom::RequestMode::kNavigate && request.mode != mojom::RequestMode::kNoCors) { LOG(WARNING) << "|mode| is " << request.mode << ", but |request_initiator| is not set."; @@ -271,8 +272,6 @@ if (process_id_ != mojom::kBrowserProcessId) { switch (request.mode) { case mojom::RequestMode::kNavigate: - case mojom::RequestMode::kNavigateNestedFrame: - case mojom::RequestMode::kNavigateNestedObject: // Only the browser process can initiate navigations. This helps ensure // that a malicious/compromised renderer cannot bypass CORB by issuing // kNavigate, rather than kNoCors requests. (CORB should apply only to @@ -323,7 +322,11 @@ case InitiatorLockCompatibility::kIncorrectLock: // Requests from the renderer need to always specify a correct initiator. - NOTREACHED(); + // + // TODO(lukasza): https://crbug.com/1027173: Reintroduce NOTREACHED below + // after relaxing request initiator checks to account for requests issued + // by the PDF plugin. + // // TODO(lukasza): https://crbug.com/920634: Report bad message and return // false below. break; @@ -365,7 +368,7 @@ // We only support |kInclude| credentials mode with navigations. See also: // a note at https://fetch.spec.whatwg.org/#concept-request-credentials-mode. if (request.credentials_mode != mojom::CredentialsMode::kInclude && - IsNavigationRequestMode(request.mode)) { + request.mode == network::mojom::RequestMode::kNavigate) { LOG(WARNING) << "unsupported credentials mode on a navigation request"; mojo::ReportBadMessage( "CorsURLLoaderFactory: unsupported credentials mode on navigation");
diff --git a/services/network/cors/preflight_controller.cc b/services/network/cors/preflight_controller.cc index c646295..a6b0bae 100644 --- a/services/network/cors/preflight_controller.cc +++ b/services/network/cors/preflight_controller.cc
@@ -81,7 +81,7 @@ // Algorithm step 1 through 5 of the CORS-preflight fetch, // https://fetch.spec.whatwg.org/#cors-preflight-fetch. preflight_request->url = request.url; - preflight_request->method = "OPTIONS"; + preflight_request->method = net::HttpRequestHeaders::kOptionsMethod; preflight_request->priority = request.priority; preflight_request->fetch_request_context_type = request.fetch_request_context_type;
diff --git a/services/network/cross_origin_read_blocking.cc b/services/network/cross_origin_read_blocking.cc index e622444..836509a 100644 --- a/services/network/cross_origin_read_blocking.cc +++ b/services/network/cross_origin_read_blocking.cc
@@ -759,8 +759,6 @@ // valid CORS headers. switch (request_mode) { case mojom::RequestMode::kNavigate: - case mojom::RequestMode::kNavigateNestedFrame: - case mojom::RequestMode::kNavigateNestedObject: case mojom::RequestMode::kNoCors: case mojom::RequestMode::kSameOrigin: break;
diff --git a/services/network/expect_ct_reporter.cc b/services/network/expect_ct_reporter.cc index 438c6cd..cf7ab32 100644 --- a/services/network/expect_ct_reporter.cc +++ b/services/network/expect_ct_reporter.cc
@@ -22,6 +22,7 @@ #include "base/values.h" #include "net/base/load_flags.h" #include "net/cert/ct_serialization.h" +#include "net/http/http_request_headers.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/report_sender.h" #include "net/url_request/url_request_context.h" @@ -260,11 +261,12 @@ kExpectCTReporterTrafficAnnotation); url_request->SetLoadFlags(net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE); url_request->set_allow_credentials(false); - url_request->set_method("OPTIONS"); + url_request->set_method(net::HttpRequestHeaders::kOptionsMethod); net::HttpRequestHeaders extra_headers; extra_headers.SetHeader("Origin", "null"); - extra_headers.SetHeader("Access-Control-Request-Method", "POST"); + extra_headers.SetHeader("Access-Control-Request-Method", + net::HttpRequestHeaders::kPostMethod); extra_headers.SetHeader("Access-Control-Request-Headers", "content-type"); url_request->SetExtraRequestHeaders(extra_headers);
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index ae91c97..e18aa74 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -55,6 +55,7 @@ #include "net/http/http_auth_preferences.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h" +#include "net/http/http_request_headers.h" #include "net/http/http_server_properties.h" #include "net/http/http_transaction_factory.h" #include "net/proxy_resolution/proxy_config.h" @@ -1463,7 +1464,7 @@ } net::HttpRequestInfo request_info; request_info.url = url; - request_info.method = "GET"; + request_info.method = net::HttpRequestHeaders::kGetMethod; request_info.extra_headers.SetHeader(net::HttpRequestHeaders::kUserAgent, user_agent);
diff --git a/services/network/proxy_resolving_client_socket.cc b/services/network/proxy_resolving_client_socket.cc index 98b8351..6d057f0 100644 --- a/services/network/proxy_resolving_client_socket.cc +++ b/services/network/proxy_resolving_client_socket.cc
@@ -21,6 +21,7 @@ #include "net/base/privacy_mode.h" #include "net/http/http_auth_controller.h" #include "net/http/http_network_session.h" +#include "net/http/http_request_headers.h" #include "net/http/proxy_client_socket.h" #include "net/http/proxy_fallback.h" #include "net/log/net_log_source_type.h" @@ -241,7 +242,8 @@ // // TODO(https://crbug.com/1023439): Pass along a NetworkIsolationKey. return network_session_->proxy_resolution_service()->ResolveProxy( - url_, "POST", net::NetworkIsolationKey::Todo(), &proxy_info_, + url_, net::HttpRequestHeaders::kPostMethod, + net::NetworkIsolationKey::Todo(), &proxy_info_, base::BindRepeating(&ProxyResolvingClientSocket::OnIOComplete, base::Unretained(this)), &proxy_resolve_request_, net_log_);
diff --git a/services/network/public/cpp/cert_verifier/cert_net_fetcher_url_loader.cc b/services/network/public/cpp/cert_verifier/cert_net_fetcher_url_loader.cc index 13aa096..d02fbe2b 100644 --- a/services/network/public/cpp/cert_verifier/cert_net_fetcher_url_loader.cc +++ b/services/network/public/cpp/cert_verifier/cert_net_fetcher_url_loader.cc
@@ -75,6 +75,7 @@ #include "base/timer/timer.h" #include "net/base/load_flags.h" #include "net/cert/cert_net_fetcher.h" +#include "net/http/http_request_headers.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/redirect_info.h" #include "services/network/public/cpp/simple_url_loader.h" @@ -485,7 +486,7 @@ auto request = std::make_unique<network::ResourceRequest>(); request->url = request_params_->url; if (request_params_->http_method == HTTP_METHOD_POST) - request->method = "POST"; + request->method = net::HttpRequestHeaders::kPostMethod; request->credentials_mode = network::mojom::CredentialsMode::kOmit; url_loader_ = network::SimpleURLLoader::Create(std::move(request), traffic_annotation);
diff --git a/services/network/public/cpp/cors/cors.cc b/services/network/public/cpp/cors/cors.cc index 5473216c..f20d665 100644 --- a/services/network/public/cpp/cors/cors.cc +++ b/services/network/public/cpp/cors/cors.cc
@@ -35,11 +35,6 @@ const char kAsterisk[] = "*"; const char kLowerCaseTrue[] = "true"; -// TODO(toyoshim): Consider to move following const variables to -// //net/http/http_request_headers. -const char kHeadMethod[] = "HEAD"; -const char kPostMethod[] = "POST"; - // TODO(toyoshim): Consider to move the following method to // //net/base/mime_util, and expose to Blink platform/network in order to // replace the existing equivalent method in HTTPParser. @@ -265,7 +260,7 @@ bool ShouldCheckCors(const GURL& request_url, const base::Optional<url::Origin>& request_initiator, mojom::RequestMode request_mode) { - if (IsNavigationRequestMode(request_mode) || + if (request_mode == network::mojom::RequestMode::kNavigate || request_mode == network::mojom::RequestMode::kNoCors) { return false; } @@ -395,7 +390,8 @@ // "A CORS-safelisted method is a method that is `GET`, `HEAD`, or `POST`." std::string method_upper = base::ToUpperASCII(method); return method_upper == net::HttpRequestHeaders::kGetMethod || - method_upper == kHeadMethod || method_upper == kPostMethod; + method_upper == net::HttpRequestHeaders::kHeadMethod || + method_upper == net::HttpRequestHeaders::kPostMethod; } bool IsCorsSafelistedContentType(const std::string& media_type) { @@ -579,9 +575,10 @@ } bool IsForbiddenMethod(const std::string& method) { - const std::string lower_method = base::ToLowerASCII(method); - return lower_method == "trace" || lower_method == "track" || - lower_method == "connect"; + const std::string upper_method = base::ToUpperASCII(method); + return upper_method == net::HttpRequestHeaders::kConnectMethod || + upper_method == net::HttpRequestHeaders::kTraceMethod || + upper_method == net::HttpRequestHeaders::kTrackMethod; } bool IsOkStatus(int status) {
diff --git a/services/network/public/cpp/request_mode.cc b/services/network/public/cpp/request_mode.cc index 9aad5fb..805a7eae 100644 --- a/services/network/public/cpp/request_mode.cc +++ b/services/network/public/cpp/request_mode.cc
@@ -16,18 +16,10 @@ case network::mojom::RequestMode::kCorsWithForcedPreflight: return "cors"; case network::mojom::RequestMode::kNavigate: - case network::mojom::RequestMode::kNavigateNestedFrame: - case network::mojom::RequestMode::kNavigateNestedObject: return "navigate"; } NOTREACHED(); return ""; } -bool IsNavigationRequestMode(network::mojom::RequestMode mode) { - return mode == network::mojom::RequestMode::kNavigate || - mode == network::mojom::RequestMode::kNavigateNestedFrame || - mode == network::mojom::RequestMode::kNavigateNestedObject; -} - } // namespace network
diff --git a/services/network/public/cpp/request_mode.h b/services/network/public/cpp/request_mode.h index d53efeb..b011aa2 100644 --- a/services/network/public/cpp/request_mode.h +++ b/services/network/public/cpp/request_mode.h
@@ -15,9 +15,6 @@ COMPONENT_EXPORT(NETWORK_CPP) const char* RequestModeToString(network::mojom::RequestMode mode); -COMPONENT_EXPORT(NETWORK_CPP) -bool IsNavigationRequestMode(network::mojom::RequestMode mode); - } // namespace network #endif // SERVICES_NETWORK_PUBLIC_CPP_REQUEST_MODE_H_
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h index 8053136f..c41b1f2 100644 --- a/services/network/public/cpp/resource_request.h +++ b/services/network/public/cpp/resource_request.h
@@ -59,7 +59,7 @@ // See comments in network.mojom.URLRequest in url_loader.mojom for details // of each field. - std::string method = "GET"; + std::string method = net::HttpRequestHeaders::kGetMethod; GURL url; net::SiteForCookies site_for_cookies; bool attach_same_site_cookies = false;
diff --git a/services/network/public/cpp/simple_url_loader.cc b/services/network/public/cpp/simple_url_loader.cc index 3ce61ae3..75facd1 100644 --- a/services/network/public/cpp/simple_url_loader.cc +++ b/services/network/public/cpp/simple_url_loader.cc
@@ -1292,8 +1292,8 @@ const std::string& upload_content_type) { // Currently only allow a single string to be attached. DCHECK(!resource_request_->request_body); - DCHECK(resource_request_->method != "GET" && - resource_request_->method != "HEAD"); + DCHECK(resource_request_->method != net::HttpRequestHeaders::kGetMethod && + resource_request_->method != net::HttpRequestHeaders::kHeadMethod); resource_request_->request_body = new ResourceRequestBody(); @@ -1322,8 +1322,8 @@ // Currently only allow a single file to be attached. DCHECK(!resource_request_->request_body); - DCHECK(resource_request_->method != "GET" && - resource_request_->method != "HEAD"); + DCHECK(resource_request_->method != net::HttpRequestHeaders::kGetMethod && + resource_request_->method != net::HttpRequestHeaders::kHeadMethod); // Create an empty body to make DCHECKing that there's no upload body yet // simpler.
diff --git a/services/network/public/mojom/fetch_api.mojom b/services/network/public/mojom/fetch_api.mojom index 8d239c2..0ef0dba 100644 --- a/services/network/public/mojom/fetch_api.mojom +++ b/services/network/public/mojom/fetch_api.mojom
@@ -16,11 +16,6 @@ kCorsWithForcedPreflight, kNavigate, - // https://github.com/whatwg/fetch/issues/755 - kNavigateNestedFrame, - // https://github.com/w3c/webappsec-fetch-metadata/issues/37 - kNavigateNestedObject, - // Add a new type here, then update enums.xml. };
diff --git a/testing/buildbot/chromium.swarm.json b/testing/buildbot/chromium.swarm.json index 11420c6..2a88c633 100644 --- a/testing/buildbot/chromium.swarm.json +++ b/testing/buildbot/chromium.swarm.json
@@ -856,18 +856,6 @@ "script": "//testing/merge_scripts/standard_gtest_merge.py" }, "swarming": { - "can_use_on_swarming_builders": true, - "shards": 2 - }, - "test": "browser_tests", - "test_target": "//chrome/test:browser_tests" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { "can_use_on_swarming_builders": true }, "test": "content_browsertests", @@ -938,18 +926,6 @@ "script": "//testing/merge_scripts/standard_gtest_merge.py" }, "swarming": { - "can_use_on_swarming_builders": true, - "shards": 2 - }, - "test": "browser_tests", - "test_target": "//chrome/test:browser_tests" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { "can_use_on_swarming_builders": true }, "test": "content_browsertests",
diff --git a/testing/buildbot/filters/android.pie_arm64_rel.chrome_public_test_apk.filter b/testing/buildbot/filters/android.pie_arm64_rel.chrome_public_test_apk.filter index 0322c52..6efcdd4 100644 --- a/testing/buildbot/filters/android.pie_arm64_rel.chrome_public_test_apk.filter +++ b/testing/buildbot/filters/android.pie_arm64_rel.chrome_public_test_apk.filter
@@ -38,9 +38,6 @@ # crbug/836460 -org.chromium.chrome.browser.settings.autofill.AutofillProfilesFragmentTest.testKeyboardShownOnDpadCenter -# crbug/1036532 --org.chromium.chrome.browser.signin.SigninTest.testConsumerSignin - # crbug/1036545 -org.chromium.chrome.browser.suggestions.tile.TileGroupTest.testDismissTileUndo -org.chromium.chrome.browser.suggestions.tile.TileGroupTest.testDismissTileWithContextMenu
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 86d6c36..4cfbc7e 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -825,11 +825,6 @@ 'chromium_swarm_desktop_gtests': { 'base_unittests': {}, - 'browser_tests': { - 'swarming': { - 'shards': 2, - }, - }, 'content_browsertests': {}, 'content_unittests': {}, 'interactive_ui_tests': {},
diff --git a/third_party/blink/common/scheduler/web_scheduler_tracked_feature.cc b/third_party/blink/common/scheduler/web_scheduler_tracked_feature.cc index 2e40ece..fa4f2a6 100644 --- a/third_party/blink/common/scheduler/web_scheduler_tracked_feature.cc +++ b/third_party/blink/common/scheduler/web_scheduler_tracked_feature.cc
@@ -75,6 +75,8 @@ return "WebXR"; case WebSchedulerTrackedFeature::kWebLocks: return "WebLocks"; + case WebSchedulerTrackedFeature::kWebHID: + return "WebHID"; } }
diff --git a/third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h b/third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h index f67f287..25e6d38d 100644 --- a/third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h +++ b/third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h
@@ -75,9 +75,10 @@ kSharedWorker = 32, kWebLocks = 33, + kWebHID = 34, // NB: This enum is used in a bitmask, so kMaxValue must be less than 64. - kMaxValue = kWebLocks + kMaxValue = kWebHID }; static_assert(static_cast<uint32_t>(WebSchedulerTrackedFeature::kMaxValue) < 64,
diff --git a/third_party/blink/public/mojom/frame/frame.mojom b/third_party/blink/public/mojom/frame/frame.mojom index c48907d9..07a928e 100644 --- a/third_party/blink/public/mojom/frame/frame.mojom +++ b/third_party/blink/public/mojom/frame/frame.mojom
@@ -196,6 +196,11 @@ // Sent by the renderer when the frame becomes focused. DidFocusFrame(); + + // Use to notify a parent remote frame that a local child frame has finished + // loading. This will be forwarded to the renderer hosting the parent's local + // frame to see if the parent can be marked as completed loading. + CheckCompleted(); }; // Implemented in Blink, this interface defines frame-specific methods that will
diff --git a/third_party/blink/public/web/web_remote_frame_client.h b/third_party/blink/public/web/web_remote_frame_client.h index 9d0b537..723f07c 100644 --- a/third_party/blink/public/web/web_remote_frame_client.h +++ b/third_party/blink/public/web/web_remote_frame_client.h
@@ -27,10 +27,6 @@ // and release any resources associated with it. virtual void FrameDetached(DetachType) {} - // Notifies the remote frame to check whether it is done loading, after one - // of its children finishes loading. - virtual void CheckCompleted() {} - // Notifies the embedder that a postMessage was issued to a remote frame. virtual void ForwardPostMessage(WebLocalFrame* source_frame, WebRemoteFrame* target_frame,
diff --git a/third_party/blink/renderer/bindings/core/v8/generated.gni b/third_party/blink/renderer/bindings/core/v8/generated.gni index 60b88a6..d10a47e 100644 --- a/third_party/blink/renderer/bindings/core/v8/generated.gni +++ b/third_party/blink/renderer/bindings/core/v8/generated.gni
@@ -95,6 +95,8 @@ "$bindings_core_v8_output_dir/string_or_trusted_script_url.h", "$bindings_core_v8_output_dir/string_or_unrestricted_double_sequence.cc", "$bindings_core_v8_output_dir/string_or_unrestricted_double_sequence.h", + "$bindings_core_v8_output_dir/string_or_worker_options.cc", + "$bindings_core_v8_output_dir/string_or_worker_options.h", "$bindings_core_v8_output_dir/string_treat_null_as_empty_string_or_trusted_script.cc", "$bindings_core_v8_output_dir/string_treat_null_as_empty_string_or_trusted_script.h", "$bindings_core_v8_output_dir/usv_string_sequence_sequence_or_usv_string_usv_string_record_or_usv_string.cc",
diff --git a/third_party/blink/renderer/bindings/core/v8/script_value.h b/third_party/blink/renderer/bindings/core/v8/script_value.h index 791d655..1fee8ac 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_value.h +++ b/third_party/blink/renderer/bindings/core/v8/script_value.h
@@ -72,8 +72,10 @@ ScriptValue(v8::Isolate* isolate, v8::Local<v8::Value> value) : isolate_(isolate), - value_( - MakeGarbageCollected<WorldSafeV8ReferenceWrapper>(isolate, value)) { + value_(value.IsEmpty() + ? nullptr + : MakeGarbageCollected<WorldSafeV8ReferenceWrapper>(isolate, + value)) { DCHECK(isolate_); } @@ -81,7 +83,7 @@ ScriptValue(v8::Isolate* isolate, v8::MaybeLocal<T> value) : isolate_(isolate), value_(value.IsEmpty() - ? MakeGarbageCollected<WorldSafeV8ReferenceWrapper>() + ? nullptr : MakeGarbageCollected<WorldSafeV8ReferenceWrapper>( isolate, value.ToLocalChecked())) { @@ -141,7 +143,7 @@ return !value.IsEmpty() && value->IsObject(); } - bool IsEmpty() const { return !value_ || value_->IsEmpty(); } + bool IsEmpty() const { return !value_; } void Clear() { isolate_ = nullptr; @@ -161,31 +163,34 @@ void Trace(Visitor* visitor) { visitor->Trace(value_); } private: - // WorldSafeV8ReferenceWrapper wraps a WorldSafeV8Reference so that it can be - // used on both the stack and heaps. WorldSafeV8Reference cannot be used on - // the stack because the conservative scanning does not know how to trace + // WorldSafeV8ReferenceWrapper wraps a non-empty WorldSafeV8Reference so that + // it can be used on both the stack and heaps. + // + // TODO(1040038): Currently, WorldSafeV8Reference cannot be used on the stack + // because the conservative scanning does not know how to trace // TraceWrapperV8Reference. class CORE_EXPORT WorldSafeV8ReferenceWrapper : public GarbageCollected<WorldSafeV8ReferenceWrapper> { public: - WorldSafeV8ReferenceWrapper() = default; WorldSafeV8ReferenceWrapper(v8::Isolate* isolate, v8::Local<v8::Value> value) - : value_(isolate, value) {} + : value_(isolate, value) { + DCHECK(!value.IsEmpty()); + } virtual ~WorldSafeV8ReferenceWrapper() = default; void Trace(blink::Visitor* visitor) { visitor->Trace(value_); } v8::Local<v8::Value> Get(ScriptState* script_state) const { + DCHECK(!value_.IsEmpty()); return value_.Get(script_state); } v8::Local<v8::Value> GetAcrossWorld(ScriptState* script_state) const { + DCHECK(!value_.IsEmpty()); return value_.GetAcrossWorld(script_state); } - bool IsEmpty() const { return value_.IsEmpty(); } - bool operator==(const WorldSafeV8ReferenceWrapper& other) const { return value_ == other.value_; }
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py index 0d721c2..4123e4869 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
@@ -2496,6 +2496,131 @@ # ---------------------------------------------------------------------------- +# WrapperTypeInfo +# ---------------------------------------------------------------------------- + +# FN = function name +FN_GET_WRAPPER_TYPE_INFO = name_style.func("GetWrapperTypeInfo") + +# MN = member name +MN_WRAPPER_TYPE_INFO = name_style.member_var("wrapper_type_info_") + + +def make_wrapper_type_info(cg_context, function_name, member_var_name, + install_context_dependent_func_name): + assert isinstance(cg_context, CodeGenContext) + assert isinstance(function_name, str) + assert isinstance(member_var_name, str) + assert _is_none_or_str(install_context_dependent_func_name) + + func_def = CxxFuncDefNode( + name=function_name, + arg_decls=[], + return_type="constexpr WrapperTypeInfo*", + static=True) + func_def.set_base_template_vars(cg_context.template_bindings()) + func_def.body.append(TextNode("return &{};".format(member_var_name))) + + member_var_def = TextNode( + "static WrapperTypeInfo {};".format(member_var_name)) + + pattern = """\ +// Migration adapter +static v8::Local<v8::FunctionTemplate> DomTemplate( + v8::Isolate* isolate, + const DOMWrapperWorld& world) {{ + return V8DOMConfiguration::DomClassTemplate( + isolate, world, + const_cast<WrapperTypeInfo*>(${class_name}::GetWrapperTypeInfo()), + ${class_name}::InstallInterfaceTemplate); +}} + +WrapperTypeInfo ${class_name}::wrapper_type_info_{{ + gin::kEmbedderBlink, + DomTemplate, + {install_context_dependent_func}, + "${{class_like.identifier}}", + {wrapper_type_info_of_inherited}, + {wrapper_type_prototype}, + {wrapper_class_id}, + {active_script_wrappable_inheritance}, +}};""" + class_like = cg_context.class_like + install_context_dependent_func = ( + "${class_name}::InstallContextDependentAdapter" + if install_context_dependent_func_name else "nullptr") + if class_like.inherited: + wrapper_type_info_of_inherited = "{}::GetWrapperTypeInfo()".format( + v8_bridge_class_name(class_like.inherited)) + else: + wrapper_type_info_of_inherited = "nullptr" + wrapper_type_prototype = ("WrapperTypeInfo::kWrapperTypeObjectPrototype" + if isinstance(class_like, web_idl.Interface) else + "WrapperTypeInfo::kWrapperTypeNoPrototype") + wrapper_class_id = ("WrapperTypeInfo::kNodeClassId" + if class_like.does_implement("Node") else + "WrapperTypeInfo::kObjectClassId") + active_script_wrappable_inheritance = ( + "WrapperTypeInfo::kInheritFromActiveScriptWrappable" + if "ActiveScriptWrappable" in class_like.extended_attributes else + "WrapperTypeInfo::kNotInheritFromActiveScriptWrappable") + text = _format( + pattern, + install_context_dependent_func=install_context_dependent_func, + wrapper_type_info_of_inherited=wrapper_type_info_of_inherited, + wrapper_type_prototype=wrapper_type_prototype, + wrapper_class_id=wrapper_class_id, + active_script_wrappable_inheritance=active_script_wrappable_inheritance + ) + bridge_wrapper_type_info_def = TextNode(text) + + blink_class = blink_class_name(class_like) + pattern = ("const WrapperTypeInfo& {blink_class}::wrapper_type_info_ = " + "${class_name}::wrapper_type_info_;") + blink_wrapper_type_info_def = TextNode( + _format(pattern, blink_class=blink_class)) + + if "ActiveScriptWrappable" in class_like.extended_attributes: + pattern = """\ +// [ActiveScriptWrappable] +static_assert( + std::is_base_of<ActiveScriptWrappableBase, {blink_class}>::value, + "{blink_class} does not inherit from ActiveScriptWrappable<> despite " + "the IDL has [ActiveScriptWrappable] extended attribute."); +static_assert( + !std::is_same<decltype(&{blink_class}::HasPendingActivity), + decltype(&ScriptWrappable::HasPendingActivity)>::value, + "{blink_class} is not overriding hasPendingActivity() despite " + "the IDL has [ActiveScriptWrappable] extended attribute.");""" + else: + pattern = """\ +// non-[ActiveScriptWrappable] +static_assert( + !std::is_base_of<ActiveScriptWrappableBase, {blink_class}>::value, + "{blink_class} inherits from ActiveScriptWrappable<> without " + "[ActiveScriptWrappable] extended attribute."); +static_assert( + std::is_same<decltype(&{blink_class}::HasPendingActivity), + decltype(&ScriptWrappable::HasPendingActivity)>::value, + "{blink_class} is overriding hasPendingActivity() without " + "[ActiveScriptWrappable] extended attribute.");""" + check_active_script_wrappable = TextNode( + _format(pattern, blink_class=blink_class)) + + wrapper_type_info_def = ListNode([ + bridge_wrapper_type_info_def, + EmptyNode(), + blink_wrapper_type_info_def, + EmptyNode(), + check_active_script_wrappable, + ]) + wrapper_type_info_def.set_base_template_vars( + cg_context.template_bindings()) + + return func_def, member_var_def, wrapper_type_info_def + + +# ---------------------------------------------------------------------------- # Main functions # ---------------------------------------------------------------------------- @@ -2561,6 +2686,8 @@ final=True, export=component_export(api_component)) api_class_def.set_base_template_vars(cg_context.template_bindings()) + api_class_def.bottom_section.append( + TextNode("friend class {};".format(blink_class_name(interface)))) if is_cross_components: impl_class_def = CxxClassDefNode( impl_class_name, @@ -2689,6 +2816,16 @@ install_context_dependent_props_trampoline, ]) + # WrapperTypeInfo + (get_wrapper_type_info_def, wrapper_type_info_var_def, + wrapper_type_info_init) = make_wrapper_type_info( + cg_context, + FN_GET_WRAPPER_TYPE_INFO, + MN_WRAPPER_TYPE_INFO, + install_context_dependent_func_name=( + install_context_dependent_props_def + and FN_INSTALL_CONTEXT_DEPENDENT_PROPS)) + # Header part (copyright, include directives, and forward declarations) api_header_node.extend([ make_copyright_header(), @@ -2751,6 +2888,10 @@ "third_party/blink/renderer/platform/bindings/v8_interface_bridge.h", ]) api_header_node.accumulator.add_class_decl(blink_class_name(interface)) + api_source_node.accumulator.add_include_headers([ + interface.code_generator_info.blink_headers[0], + "third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h", + ]) if is_cross_components: impl_header_node.accumulator.add_include_headers([ api_header_path, @@ -2772,6 +2913,15 @@ if is_cross_components: impl_header_blink_ns.body.append(impl_class_def) + api_class_def.public_section.append(get_wrapper_type_info_def) + api_class_def.public_section.append(EmptyNode()) + api_class_def.private_section.append(wrapper_type_info_var_def) + api_class_def.private_section.append(EmptyNode()) + api_source_blink_ns.body.extend([ + wrapper_type_info_init, + EmptyNode(), + ]) + if is_cross_components: api_class_def.public_section.append(installer_function_trampolines) api_class_def.private_section.append(trampoline_var_defs)
diff --git a/third_party/blink/renderer/bindings/scripts/idl_definitions.py b/third_party/blink/renderer/bindings/scripts/idl_definitions.py index 34aab20..a5157f8a 100644 --- a/third_party/blink/renderer/bindings/scripts/idl_definitions.py +++ b/third_party/blink/renderer/bindings/scripts/idl_definitions.py
@@ -1008,6 +1008,10 @@ raise ValueError('[RaisesException] should not have a value on ' 'constructor operations') converted["RaisesException"] = 'Constructor' + elif name == "MeasureAs": + converted["MeasureAs"] = value + elif name == "Measure": + converted["Measure"] = None else: raise ValueError( '[{}] is not supported on constructor operations'.format(name))
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/code_generator_info.py b/third_party/blink/renderer/bindings/scripts/web_idl/code_generator_info.py index 959908b..4d296d6 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/code_generator_info.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/code_generator_info.py
@@ -5,8 +5,8 @@ # The list of attributes that CodeGeneratorInfo supports. CodeGeneratorInfo's # attributes are auto-generated from this list because they're boilerplated. _CODE_GENERATOR_INFO_ATTRIBUTES = ( - 'defined_in_mixin', - 'defined_in_partial', + 'defined_in_mixin', # [LegacyTreatAsPartialInterface] makes this False + 'defined_in_partial', # [LegacyTreatAsPartialInterface] makes this True 'blink_headers', 'property_implemented_as', 'receiver_implemented_as',
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py index 67cbc21..a32880d 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py
@@ -128,11 +128,17 @@ for old_ir in old_irs: new_ir = make_copy(old_ir) self._ir_map.add(new_ir) + is_partial = False + is_mixin = False + if "LegacyTreatAsPartialInterface" in new_ir.extended_attributes: + is_partial = True + elif hasattr(new_ir, "is_partial") and new_ir.is_partial: + is_partial = True + elif hasattr(new_ir, "is_mixin") and new_ir.is_mixin: + is_mixin = True for member in new_ir.iter_all_members(): - member.code_generator_info.set_defined_in_partial( - hasattr(new_ir, 'is_partial') and new_ir.is_partial) - member.code_generator_info.set_defined_in_mixin( - hasattr(new_ir, 'is_mixin') and new_ir.is_mixin) + member.code_generator_info.set_defined_in_partial(is_partial) + member.code_generator_info.set_defined_in_mixin(is_mixin) def _propagate_extattrs_per_idl_fragment(self): def propagate_extattr(extattr_key_and_attr_name,
diff --git a/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_3.idl b/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_3.idl index 9c2a8cf..06c0e46 100644 --- a/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_3.idl +++ b/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_3.idl
@@ -30,5 +30,5 @@ // Test for length > 0, non-overloaded constructor. interface TestInterfaceConstructor3 { - constructor(DOMString stringArg); + [MeasureAs=TestInterfaceConstructor3] constructor(DOMString stringArg); };
diff --git a/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_4.idl b/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_4.idl index ca78e24d..ea37683a 100644 --- a/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_4.idl +++ b/third_party/blink/renderer/bindings/tests/idls/core/test_interface_constructor_4.idl
@@ -5,7 +5,7 @@ // Test for overload resolution for the string-like USVString // argument. Also for constructor operations. interface TestInterfaceConstructor4 { - [CallWith=ScriptState, RaisesException] constructor(TestInterfaceConstructor4 testInterface4Arg); - [CallWith=ScriptState, RaisesException] constructor(USVString usvStringArg); + [CallWith=ScriptState, RaisesException, Measure] constructor(TestInterfaceConstructor4 testInterface4Arg); + [CallWith=ScriptState, RaisesException, Measure] constructor(USVString usvStringArg); [Custom] constructor(double doubleArg); };
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_3.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_3.cc index 3773147..f9a034e 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_3.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_3.cc
@@ -18,9 +18,11 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/platform/bindings/exception_messages.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/scheduler/public/cooperative_scheduling_manager.h" #include "third_party/blink/renderer/platform/wtf/get_ptr.h" @@ -88,6 +90,8 @@ CORE_EXPORT void ConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor3_Constructor"); + ExecutionContext* execution_context_for_measurement = CurrentExecutionContext(info.GetIsolate()); + UseCounter::Count(execution_context_for_measurement, WebFeature::kTestInterfaceConstructor3); if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError( info.GetIsolate(),
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_4.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_4.cc index cac9fddb..a5c00d1e 100644 --- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_4.cc +++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_4.cc
@@ -19,9 +19,11 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_test_interface_constructor_4.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/platform/bindings/exception_messages.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h" +#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/scheduler/public/cooperative_scheduling_manager.h" #include "third_party/blink/renderer/platform/wtf/get_ptr.h" @@ -134,6 +136,8 @@ CORE_EXPORT void ConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestInterfaceConstructor4_Constructor"); + ExecutionContext* execution_context_for_measurement = CurrentExecutionContext(info.GetIsolate()); + UseCounter::Count(execution_context_for_measurement, WebFeature::kV8TestInterfaceConstructor4_Constructor); if (!info.IsConstructCall()) { V8ThrowException::ThrowTypeError( info.GetIsolate(),
diff --git a/third_party/blink/renderer/core/animation/keyframe_effect.idl b/third_party/blink/renderer/core/animation/keyframe_effect.idl index ef8ef528..50694064 100644 --- a/third_party/blink/renderer/core/animation/keyframe_effect.idl +++ b/third_party/blink/renderer/core/animation/keyframe_effect.idl
@@ -33,11 +33,10 @@ enum CompositeOperation { "replace", "add", "accumulate" }; [ - Exposed=Window, - Measure + Exposed=Window ] interface KeyframeEffect : AnimationEffect { - [CallWith=ScriptState, RaisesException] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options); - [CallWith=ScriptState, RaisesException] constructor(KeyframeEffect source); + [CallWith=ScriptState, RaisesException, Measure] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options); + [CallWith=ScriptState, RaisesException, Measure] constructor(KeyframeEffect source); attribute Element? target; [RuntimeEnabled=WebAnimationsAPI, RaisesException=Setter] attribute CSSOMString? pseudoElement; [RuntimeEnabled=WebAnimationsAPI] attribute CompositeOperation composite;
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline.idl b/third_party/blink/renderer/core/animation/scroll_timeline.idl index 7ea3821..efda39d 100644 --- a/third_party/blink/renderer/core/animation/scroll_timeline.idl +++ b/third_party/blink/renderer/core/animation/scroll_timeline.idl
@@ -5,11 +5,10 @@ // https://wicg.github.io/scroll-animations/#scrolltimeline-interface [ - MeasureAs=ScrollTimelineConstructor, RuntimeEnabled=ScrollTimeline, Exposed=Window ] interface ScrollTimeline : AnimationTimeline { - [CallWith=Document, RaisesException] constructor(optional ScrollTimelineOptions options); + [CallWith=Document, RaisesException, MeasureAs=ScrollTimelineConstructor] constructor(optional ScrollTimelineOptions options); readonly attribute Element? scrollSource; readonly attribute ScrollDirection orientation; readonly attribute DOMString startScrollOffset;
diff --git a/third_party/blink/renderer/core/css/font_face.idl b/third_party/blink/renderer/core/css/font_face.idl index 5120c44..d22c927a 100644 --- a/third_party/blink/renderer/core/css/font_face.idl +++ b/third_party/blink/renderer/core/css/font_face.idl
@@ -39,11 +39,10 @@ [ ActiveScriptWrappable, - Exposed=(Window,Worker), - MeasureAs=FontFaceConstructor + Exposed=(Window,Worker) ] interface FontFace { // FIXME: This should be (DOMString or BinaryData), where BinaryData is typedef of (ArrayBuffer or ArrayBufferView) - [CallWith=ExecutionContext] constructor(DOMString family, (DOMString or ArrayBuffer or ArrayBufferView) source, optional FontFaceDescriptors descriptors); + [CallWith=ExecutionContext, MeasureAs=FontFaceConstructor] constructor(DOMString family, (DOMString or ArrayBuffer or ArrayBufferView) source, optional FontFaceDescriptors descriptors); [RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString family; [RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString style; [RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString weight;
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index d7b696d..4b014828 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -1645,7 +1645,7 @@ if (!layout_object) return; // Floating or out-of-flow elements do not affect whitespace siblings. - if (layout_object->IsFloatingOrOutOfFlowPositioned()) + if (!layout_object->AffectsWhitespaceSiblings()) return; layout_object = layout_object->Parent(); while (layout_object->IsAnonymous())
diff --git a/third_party/blink/renderer/core/css/style_engine_test.cc b/third_party/blink/renderer/core/css/style_engine_test.cc index 0acc0d3..76abff7 100644 --- a/third_party/blink/renderer/core/css/style_engine_test.cc +++ b/third_party/blink/renderer/core/css/style_engine_test.cc
@@ -1811,10 +1811,13 @@ UpdateAllLifecyclePhases(); StyleEngine& engine = GetStyleEngine(); + // If the Stats() were already enabled, we would not start with 0 counts. + EXPECT_FALSE(engine.Stats()); engine.SetStatsEnabled(true); StyleResolverStats* stats = engine.Stats(); ASSERT_TRUE(stats); + EXPECT_EQ(0u, stats->rules_fast_rejected); Element* div = GetDocument().QuerySelector("div"); ASSERT_TRUE(div);
diff --git a/third_party/blink/renderer/core/dom/abort_controller.idl b/third_party/blink/renderer/core/dom/abort_controller.idl index 4ebf5e7..f3f881c 100644 --- a/third_party/blink/renderer/core/dom/abort_controller.idl +++ b/third_party/blink/renderer/core/dom/abort_controller.idl
@@ -5,10 +5,9 @@ // https://dom.spec.whatwg.org/#interface-abortcontroller [ - Exposed=(Window,Worker), - Measure + Exposed=(Window,Worker) ] interface AbortController { - [CallWith=ExecutionContext] constructor(); + [CallWith=ExecutionContext, Measure] constructor(); [SameObject] readonly attribute AbortSignal signal; void abort();
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 7d3a4db..6ba1cc85 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -2927,7 +2927,7 @@ AttachPseudoElement(kPseudoIdFirstLetter, children_context); if (layout_object) { - if (!layout_object->IsFloatingOrOutOfFlowPositioned()) + if (layout_object->AffectsWhitespaceSiblings()) context.previous_in_flow = layout_object; } else { context.previous_in_flow = children_context.previous_in_flow;
diff --git a/third_party/blink/renderer/core/dom/whitespace_attacher.cc b/third_party/blink/renderer/core/dom/whitespace_attacher.cc index a4dbdb24..1c902de 100644 --- a/third_party/blink/renderer/core/dom/whitespace_attacher.cc +++ b/third_party/blink/renderer/core/dom/whitespace_attacher.cc
@@ -34,7 +34,7 @@ layout_object = prev_in_flow; // Only in-flow boxes affect subsequent whitespace. - if (layout_object && !layout_object->IsFloatingOrOutOfFlowPositioned()) + if (layout_object && layout_object->AffectsWhitespaceSiblings()) ReattachWhitespaceSiblings(layout_object); } @@ -102,7 +102,7 @@ SetLastTextNode(nullptr); return; } - if (layout_object->IsFloatingOrOutOfFlowPositioned()) + if (!layout_object->AffectsWhitespaceSiblings()) return; ReattachWhitespaceSiblings(layout_object); } @@ -136,7 +136,7 @@ if (sibling_layout_object) context.previous_in_flow = sibling_layout_object; } else if (sibling_layout_object && - !sibling_layout_object->IsFloatingOrOutOfFlowPositioned()) { + sibling_layout_object->AffectsWhitespaceSiblings()) { break; } context.next_sibling_valid = false; @@ -183,7 +183,7 @@ last_text_node_ = text; return; } - if (layout_object && !layout_object->IsFloatingOrOutOfFlowPositioned()) { + if (layout_object && layout_object->AffectsWhitespaceSiblings()) { last_text_node_ = nullptr; break; }
diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc index f260d0a4..c0dbf5f 100644 --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc
@@ -353,8 +353,6 @@ case RequestMode::kCors: case RequestMode::kCorsWithForcedPreflight: case RequestMode::kNavigate: - case RequestMode::kNavigateNestedFrame: - case RequestMode::kNavigateNestedObject: PerformNetworkError("Fetch API cannot load " + fetch_request_data_->Url().GetString() + ". Redirects to data: URL are allowed only when " @@ -378,8 +376,6 @@ tainting = FetchRequestData::kCorsTainting; break; case RequestMode::kNavigate: - case RequestMode::kNavigateNestedFrame: - case RequestMode::kNavigateNestedObject: LOG(FATAL); break; } @@ -589,7 +585,7 @@ if (fetch_request_data_->Origin()->CanReadContent(url) || (fetch_request_data_->IsolatedWorldOrigin() && fetch_request_data_->IsolatedWorldOrigin()->CanReadContent(url)) || - network::IsNavigationRequestMode(fetch_request_data_->Mode())) { + fetch_request_data_->Mode() == network::mojom::RequestMode::kNavigate) { // "The result of performing a scheme fetch using request." PerformSchemeFetch(exception_state); return; @@ -726,8 +722,6 @@ request.SetMode(fetch_request_data_->Mode()); break; case RequestMode::kNavigate: - case RequestMode::kNavigateNestedFrame: - case RequestMode::kNavigateNestedObject: // NetworkService (i.e. CorsURLLoaderFactory::IsSane) rejects kNavigate // requests coming from renderers, so using kSameOrigin here. // TODO(lukasza): Tweak CorsURLLoaderFactory::IsSane to accept kNavigate
diff --git a/third_party/blink/renderer/core/fetch/request.cc b/third_party/blink/renderer/core/fetch/request.cc index b4e9313..c5d4eef5 100644 --- a/third_party/blink/renderer/core/fetch/request.cc +++ b/third_party/blink/renderer/core/fetch/request.cc
@@ -283,7 +283,7 @@ // "If any of |init|'s members are present, then:" if (AreAnyMembersPresent(init)) { // "If |request|'s |mode| is "navigate", then set it to "same-origin". - if (network::IsNavigationRequestMode(request->Mode())) + if (request->Mode() == network::mojom::RequestMode::kNavigate) request->SetMode(network::mojom::RequestMode::kSameOrigin); // TODO(yhirano): Implement the following substep: @@ -735,8 +735,6 @@ case network::mojom::RequestMode::kCorsWithForcedPreflight: return "cors"; case network::mojom::RequestMode::kNavigate: - case network::mojom::RequestMode::kNavigateNestedFrame: - case network::mojom::RequestMode::kNavigateNestedObject: return "navigate"; } NOTREACHED();
diff --git a/third_party/blink/renderer/core/fileapi/file_reader_sync.idl b/third_party/blink/renderer/core/fileapi/file_reader_sync.idl index 1e20474..9f7d0281 100644 --- a/third_party/blink/renderer/core/fileapi/file_reader_sync.idl +++ b/third_party/blink/renderer/core/fileapi/file_reader_sync.idl
@@ -31,10 +31,9 @@ // https://w3c.github.io/FileAPI/#FileReaderSync [ - Exposed=(DedicatedWorker,SharedWorker), - Measure + Exposed=(DedicatedWorker,SharedWorker) ] interface FileReaderSync { - [CallWith=ExecutionContext] constructor(); + [CallWith=ExecutionContext, Measure] constructor(); [RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob); [RaisesException] DOMString readAsBinaryString(Blob blob); [RaisesException] DOMString readAsText(Blob blob, optional DOMString label);
diff --git a/third_party/blink/renderer/core/frame/remote_frame.cc b/third_party/blink/renderer/core/frame/remote_frame.cc index 8f83e4a..06490f4 100644 --- a/third_party/blink/renderer/core/frame/remote_frame.cc +++ b/third_party/blink/renderer/core/frame/remote_frame.cc
@@ -178,7 +178,7 @@ void RemoteFrame::CheckCompleted() { // Notify the client so that the corresponding LocalFrame can do the check. - Client()->CheckCompleted(); + GetRemoteFrameHostRemote().CheckCompleted(); } const RemoteSecurityContext* RemoteFrame::GetSecurityContext() const {
diff --git a/third_party/blink/renderer/core/frame/remote_frame_client.h b/third_party/blink/renderer/core/frame/remote_frame_client.h index a54101c..c5a8a32 100644 --- a/third_party/blink/renderer/core/frame/remote_frame_client.h +++ b/third_party/blink/renderer/core/frame/remote_frame_client.h
@@ -37,10 +37,6 @@ mojo::PendingRemote<mojom::blink::BlobURLToken>) = 0; unsigned BackForwardLength() override = 0; - // Notifies the remote frame to check whether it is done loading, after one - // of its children finishes loading. - virtual void CheckCompleted() = 0; - // Forwards a postMessage for a remote frame. virtual void ForwardPostMessage(MessageEvent*, scoped_refptr<const SecurityOrigin> target,
diff --git a/third_party/blink/renderer/core/frame/remote_frame_client_impl.cc b/third_party/blink/renderer/core/frame/remote_frame_client_impl.cc index 2e0089d..5d904d0 100644 --- a/third_party/blink/renderer/core/frame/remote_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/remote_frame_client_impl.cc
@@ -124,10 +124,6 @@ return 2; } -void RemoteFrameClientImpl::CheckCompleted() { - web_frame_->Client()->CheckCompleted(); -} - void RemoteFrameClientImpl::ForwardPostMessage( MessageEvent* event, scoped_refptr<const SecurityOrigin> target,
diff --git a/third_party/blink/renderer/core/frame/remote_frame_client_impl.h b/third_party/blink/renderer/core/frame/remote_frame_client_impl.h index 2620d58..fb7ff7963 100644 --- a/third_party/blink/renderer/core/frame/remote_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/remote_frame_client_impl.h
@@ -39,7 +39,6 @@ bool initiator_frame_is_ad, mojo::PendingRemote<mojom::blink::BlobURLToken>) override; unsigned BackForwardLength() override; - void CheckCompleted() override; void ForwardPostMessage(MessageEvent*, scoped_refptr<const SecurityOrigin> target, LocalFrame* source) const override;
diff --git a/third_party/blink/renderer/core/html/html_plugin_element.cc b/third_party/blink/renderer/core/html/html_plugin_element.cc index 4213805..bc8d0dc6 100644 --- a/third_party/blink/renderer/core/html/html_plugin_element.cc +++ b/third_party/blink/renderer/core/html/html_plugin_element.cc
@@ -228,7 +228,7 @@ ToLayoutImage(layout_object)->ImageResource(); image_resource->SetImageResource(image_loader_->GetContent()); } - if (!layout_object->IsFloatingOrOutOfFlowPositioned()) + if (layout_object->AffectsWhitespaceSiblings()) context.previous_in_flow = layout_object; dispose_view_ = false;
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer.idl b/third_party/blink/renderer/core/intersection_observer/intersection_observer.idl index 7ed4229db..bcb2028 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer.idl +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer.idl
@@ -8,10 +8,9 @@ [ Exposed=Window, - ActiveScriptWrappable, - MeasureAs=IntersectionObserver_Constructor + ActiveScriptWrappable ] interface IntersectionObserver { - [CallWith=ScriptState, RaisesException] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options); + [CallWith=ScriptState, RaisesException, MeasureAs=IntersectionObserver_Constructor] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options); readonly attribute Element? root; readonly attribute DOMString rootMargin; // https://github.com/WICG/IntersectionObserver/issues/114
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h index 8b0e431..37b7d2d1 100644 --- a/third_party/blink/renderer/core/layout/layout_object.h +++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -1884,6 +1884,14 @@ return (IsFloating() || IsOutOfFlowPositioned()); } + // Outside list markers are in-flow but behave kind of out-of-flowish. + // We include them here to prevent code like '<li> <ol></ol></li>' from + // generating an anonymous block box for the whitespace between the marker + // and the <ol>. + bool AffectsWhitespaceSiblings() const { + return !IsFloatingOrOutOfFlowPositioned() && !IsLayoutNGListMarker(); + } + bool HasReflection() const { return bitfields_.HasReflection(); } // The current selection state for an object. For blocks, the state refers to
diff --git a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.cc b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.cc index bd6ca64..471cbbf 100644 --- a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.cc +++ b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.cc
@@ -11,9 +11,14 @@ #include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_fragment.h" #include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_scope.h" #include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" namespace blink { +namespace { +const char kInvalidLayoutChild[] = "The LayoutChild is not valid."; +} // namespace + CustomLayoutChild::CustomLayoutChild(const CSSLayoutDefinition& definition, NGLayoutInputNode node) : node_(node), @@ -30,10 +35,9 @@ // possible for a web developer to hold onto a LayoutChild object after its // underlying LayoutObject has been destroyed). if (!node_ || !token_->IsValid()) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>(DOMExceptionCode::kInvalidStateError, - "The LayoutChild is not valid.")); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + kInvalidLayoutChild); + return ScriptPromise(); } auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); @@ -50,10 +54,9 @@ // possible for a web developer to hold onto a LayoutChild object after its // underlying LayoutObject has been destroyed). if (!node_ || !token_->IsValid()) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>(DOMExceptionCode::kInvalidStateError, - "The LayoutChild is not valid.")); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + kInvalidLayoutChild); + return ScriptPromise(); } // Serialize the provided data if needed.
diff --git a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h index 1703a5f..2736ca0 100644 --- a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h +++ b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_child.h
@@ -16,6 +16,7 @@ class CSSLayoutDefinition; class CustomLayoutConstraintsOptions; class CustomLayoutToken; +class ExceptionState; // Represents a "CSS box" for use by a web developer. This is passed into the // web developer defined layout and intrinsicSizes functions so that they can
diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.cc b/third_party/blink/renderer/core/loader/base_fetch_context.cc index c297d32..d633add 100644 --- a/third_party/blink/renderer/core/loader/base_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/base_fetch_context.cc
@@ -137,8 +137,8 @@ // On navigation cases, Context().GetSecurityOrigin() may return nullptr, so // the request's origin may be nullptr. // TODO(yhirano): Figure out if it's actually fine. - DCHECK(network::IsNavigationRequestMode(request_mode) || origin); - if (!network::IsNavigationRequestMode(request_mode) && + DCHECK(request_mode == network::mojom::RequestMode::kNavigate || origin); + if (request_mode != network::mojom::RequestMode::kNavigate && !resource_request.CanDisplay(url)) { if (reporting_policy == SecurityViolationReportingPolicy::kReport) { AddConsoleMessage(ConsoleMessage::Create(
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h index f9d3164..8060494 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -450,7 +450,6 @@ bool initiator_frame_is_ad, mojo::PendingRemote<mojom::blink::BlobURLToken>) override {} unsigned BackForwardLength() override { return 0; } - void CheckCompleted() override {} void ForwardPostMessage(MessageEvent*, scoped_refptr<const SecurityOrigin> target, LocalFrame* source_frame) const override {}
diff --git a/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc b/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc index b6ec121..b08ee44 100644 --- a/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc +++ b/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc
@@ -409,7 +409,7 @@ if (options_.grant_universal_access) { const auto request_mode = new_request.GetMode(); DCHECK(request_mode == network::mojom::RequestMode::kNoCors || - network::IsNavigationRequestMode(request_mode)); + request_mode == network::mojom::RequestMode::kNavigate); // Some callers, notablly flash, with |grant_universal_access| want to // have an origin matching with referrer. KURL referrer(request.ToResourceRequest().ReferrerString());
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl index b4ec26f..913e911 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl
@@ -7,10 +7,9 @@ [ Exposed=(Window,Worker), Transferable, - MeasureAs=OffscreenCanvas, RuntimeEnabled=SurfaceEmbeddingFeatures ] interface OffscreenCanvas : EventTarget { - [CallWith=ExecutionContext] constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height); + [CallWith=ExecutionContext, MeasureAs=OffscreenCanvas] constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height); attribute [EnforceRange] unsigned long width; attribute [EnforceRange] unsigned long height;
diff --git a/third_party/blink/renderer/core/resize_observer/resize_observer.idl b/third_party/blink/renderer/core/resize_observer/resize_observer.idl index 7d49c5c..67cb9c8d 100644 --- a/third_party/blink/renderer/core/resize_observer/resize_observer.idl +++ b/third_party/blink/renderer/core/resize_observer/resize_observer.idl
@@ -10,10 +10,9 @@ [ Exposed=Window, - ActiveScriptWrappable, - MeasureAs=ResizeObserver_Constructor + ActiveScriptWrappable ] interface ResizeObserver { - [CallWith=Document] constructor(ResizeObserverCallback callback); + [CallWith=Document, MeasureAs=ResizeObserver_Constructor] constructor(ResizeObserverCallback callback); void observe(Element target); void unobserve(Element target); void disconnect();
diff --git a/third_party/blink/renderer/core/streams/byte_length_queuing_strategy.idl b/third_party/blink/renderer/core/streams/byte_length_queuing_strategy.idl index 7a745a9..ac23897 100644 --- a/third_party/blink/renderer/core/streams/byte_length_queuing_strategy.idl +++ b/third_party/blink/renderer/core/streams/byte_length_queuing_strategy.idl
@@ -5,10 +5,9 @@ // https://streams.spec.whatwg.org/#blqs-class [ - Exposed=(Window,Worker,Worklet), - MeasureAs=ByteLengthQueuingStrategyConstructor + Exposed=(Window,Worker,Worklet) ] interface ByteLengthQueuingStrategy { - [CallWith=ScriptState] constructor([PermissiveDictionaryConversion] QueuingStrategyInit init); + [CallWith=ScriptState, MeasureAs=ByteLengthQueuingStrategyConstructor] constructor([PermissiveDictionaryConversion] QueuingStrategyInit init); [CallWith=ScriptState] readonly attribute any highWaterMark; // size is an accessor that returns a function.
diff --git a/third_party/blink/renderer/core/streams/count_queuing_strategy.idl b/third_party/blink/renderer/core/streams/count_queuing_strategy.idl index 321dcd6..fca10ee2 100644 --- a/third_party/blink/renderer/core/streams/count_queuing_strategy.idl +++ b/third_party/blink/renderer/core/streams/count_queuing_strategy.idl
@@ -5,10 +5,9 @@ // https://streams.spec.whatwg.org/#cqs-class [ - Exposed=(Window,Worker,Worklet), - MeasureAs=CountQueuingStrategyConstructor + Exposed=(Window,Worker,Worklet) ] interface CountQueuingStrategy { - [CallWith=ScriptState] constructor([PermissiveDictionaryConversion] QueuingStrategyInit init); + [CallWith=ScriptState, MeasureAs=CountQueuingStrategyConstructor] constructor([PermissiveDictionaryConversion] QueuingStrategyInit init); [CallWith=ScriptState] readonly attribute any highWaterMark; // size is an accessor that returns a function.
diff --git a/third_party/blink/renderer/core/streams/writable_stream.cc b/third_party/blink/renderer/core/streams/writable_stream.cc index cfb3fafb..86708e0 100644 --- a/third_party/blink/renderer/core/streams/writable_stream.cc +++ b/third_party/blink/renderer/core/streams/writable_stream.cc
@@ -124,6 +124,26 @@ Abort(script_state, this, reason.V8Value())); } +ScriptPromise WritableStream::close(ScriptState* script_state, + ExceptionState& exception_state) { + // https://streams.spec.whatwg.org/#ws-close + // 2. If ! IsWritableStreamLocked(this) is true, return a promise rejected + // with a TypeError exception. + if (IsLocked(this)) { + exception_state.ThrowTypeError("Cannot close a locked stream"); + return ScriptPromise(); + } + + // 3. If ! WritableStreamCloseQueuedOrInFlight(this) is true, return a promise + // rejected with a TypeError exception. + if (CloseQueuedOrInFlight(this)) { + exception_state.ThrowTypeError("Cannot close a closed or closing stream"); + return ScriptPromise(); + } + + return ScriptPromise(script_state, Close(script_state, this)); +} + WritableStreamDefaultWriter* WritableStream::getWriter( ScriptState* script_state, ExceptionState& exception_state) { @@ -324,6 +344,49 @@ return promise->V8Promise(script_state->GetIsolate()); } +v8::Local<v8::Promise> WritableStream::Close(ScriptState* script_state, + WritableStream* stream) { + // https://streams.spec.whatwg.org/#writable-stream-close + // 1. Let state be stream.[[state]]. + const auto state = stream->GetState(); + + // 2. If state is "closed" or "errored", return a promise rejected with a + // TypeError exception. + if (state == kClosed || state == kErrored) { + return PromiseReject(script_state, + CreateCannotActionOnStateStreamException( + script_state->GetIsolate(), "close", state)); + } + + // 3. Assert: state is "writable" or "erroring". + DCHECK(state == kWritable || state == kErroring); + + // 4. Assert: ! WritableStreamCloseQueuedOrInFlight(stream) is false. + DCHECK(!CloseQueuedOrInFlight(stream)); + + // 5. Let promise be a new promise. + auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state); + + // 6. Set stream.[[closeRequest]] to promise. + stream->SetCloseRequest(promise); + + // 7. Let writer be stream.[[writer]]. + WritableStreamDefaultWriter* writer = stream->writer_; + + // 8. If writer is not undefined, and stream.[[backpressure]] is true, and + // state is "writable", resolve writer.[[readyPromise]] with undefined. + if (writer && stream->HasBackpressure() && state == kWritable) { + writer->ReadyPromise()->ResolveWithUndefined(script_state); + } + + // 9. Perform ! WritableStreamDefaultControllerClose( + // stream.[[writableStreamController]]). + WritableStreamDefaultController::Close(script_state, stream->Controller()); + + // 10. Return promise. + return promise->V8Promise(script_state->GetIsolate()); +} + bool WritableStream::CloseQueuedOrInFlight(const WritableStream* stream) { // https://streams.spec.whatwg.org/#writable-stream-close-queued-or-in-flight // 1. If stream.[[closeRequest]] is undefined and @@ -725,6 +788,37 @@ writer_ = writer; } +// static +v8::Local<v8::String> WritableStream::CreateCannotActionOnStateStreamMessage( + v8::Isolate* isolate, + const char* action, + const char* state_name) { + return V8String(isolate, String::Format("Cannot %s a %s writable stream", + action, state_name)); +} + +// static +v8::Local<v8::Value> WritableStream::CreateCannotActionOnStateStreamException( + v8::Isolate* isolate, + const char* action, + State state) { + const char* state_name = nullptr; + switch (state) { + case WritableStream::kClosed: + state_name = "CLOSED"; + break; + + case WritableStream::kErrored: + state_name = "ERRORED"; + break; + + default: + NOTREACHED(); + } + return v8::Exception::TypeError( + CreateCannotActionOnStateStreamMessage(isolate, action, state_name)); +} + void WritableStream::Trace(Visitor* visitor) { visitor->Trace(close_request_); visitor->Trace(in_flight_write_request_);
diff --git a/third_party/blink/renderer/core/streams/writable_stream.h b/third_party/blink/renderer/core/streams/writable_stream.h index 0c1b506..70533b4 100644 --- a/third_party/blink/renderer/core/streams/writable_stream.h +++ b/third_party/blink/renderer/core/streams/writable_stream.h
@@ -84,6 +84,9 @@ ScriptPromise abort(ScriptState*, ExceptionState&); ScriptPromise abort(ScriptState*, ScriptValue reason, ExceptionState&); + // https://streams.spec.whatwg.org/#ws-close + ScriptPromise close(ScriptState*, ExceptionState&); + // https://streams.spec.whatwg.org/#ws-get-writer WritableStreamDefaultWriter* getWriter(ScriptState*, ExceptionState&); @@ -126,6 +129,8 @@ // https://streams.spec.whatwg.org/#writable-stream-add-write-request static v8::Local<v8::Promise> AddWriteRequest(ScriptState*, WritableStream*); + static v8::Local<v8::Promise> Close(ScriptState*, WritableStream*); + // https://streams.spec.whatwg.org/#writable-stream-close-queued-or-in-flight static bool CloseQueuedOrInFlight(const WritableStream*); @@ -204,6 +209,17 @@ void SetController(WritableStreamDefaultController*); void SetWriter(WritableStreamDefaultWriter*); + // Utility methods shared with other classes. + static v8::Local<v8::String> CreateCannotActionOnStateStreamMessage( + v8::Isolate*, + const char* action, + const char* state_name); + + static v8::Local<v8::Value> CreateCannotActionOnStateStreamException( + v8::Isolate*, + const char* action, + State); + void Trace(Visitor*) override; protected:
diff --git a/third_party/blink/renderer/core/streams/writable_stream.idl b/third_party/blink/renderer/core/streams/writable_stream.idl index f79e77e7..8cb0ff8 100644 --- a/third_party/blink/renderer/core/streams/writable_stream.idl +++ b/third_party/blink/renderer/core/streams/writable_stream.idl
@@ -4,12 +4,12 @@ // https://streams.spec.whatwg.org/#ws-class [ - Exposed=(Window,Worker,Worklet), - MeasureAs=WritableStreamConstructor + Exposed=(Window,Worker,Worklet) ] interface WritableStream { - [CallWith=ScriptState, RaisesException] constructor(optional any underlyingSink, optional any strategy); + [CallWith=ScriptState, RaisesException, MeasureAs=WritableStreamConstructor] constructor(optional any underlyingSink, optional any strategy); [NotEnumerable] readonly attribute boolean locked; [RaisesException, CallWith=ScriptState, NotEnumerable] Promise<void> abort( optional any reason); + [RaisesException, CallWith=ScriptState, NotEnumerable] Promise<void> close(); [RaisesException, CallWith=ScriptState, NotEnumerable] WritableStreamDefaultWriter getWriter(); };
diff --git a/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc b/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc index 764eb4c6..4bfadf7d 100644 --- a/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc +++ b/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc
@@ -30,35 +30,6 @@ verbed))); } -v8::Local<v8::String> CreateCannotActionOnStateStreamMessage( - v8::Isolate* isolate, - const char* action, - const char* state_name) { - return V8String(isolate, String::Format("Cannot %s a %s writable stream", - action, state_name)); -} - -v8::Local<v8::Value> CreateCannotActionOnStateStreamException( - v8::Isolate* isolate, - const char* action, - WritableStream::State state) { - const char* state_name = nullptr; - switch (state) { - case WritableStream::kClosed: - state_name = "CLOSED"; - break; - - case WritableStream::kErrored: - state_name = "ERRORED"; - break; - - default: - NOTREACHED(); - } - return v8::Exception::TypeError( - CreateCannotActionOnStateStreamMessage(isolate, action, state_name)); -} - } // namespace WritableStreamDefaultWriter* WritableStreamDefaultWriter::Create( @@ -427,13 +398,14 @@ if (WritableStream::CloseQueuedOrInFlight(stream)) { return PromiseReject( script_state, - v8::Exception::TypeError(CreateCannotActionOnStateStreamMessage( - isolate, "write to", "closing"))); + v8::Exception::TypeError( + WritableStream::CreateCannotActionOnStateStreamMessage( + isolate, "write to", "closing"))); } if (state == WritableStream::kClosed) { - return PromiseReject(script_state, - CreateCannotActionOnStateStreamException( - isolate, "write to", WritableStream::kClosed)); + return PromiseReject( + script_state, WritableStream::CreateCannotActionOnStateStreamException( + isolate, "write to", WritableStream::kClosed)); } // 9. If state is "erroring", return a promise rejected with @@ -523,42 +495,8 @@ // 2. Assert: stream is not undefined. DCHECK(stream); - // 3. Let state be stream.[[state]]. - const auto state = stream->GetState(); - - // 4. If state is "closed" or "errored", return a promise rejected with a - // TypeError exception. - if (state == WritableStream::kClosed || state == WritableStream::kErrored) { - return PromiseReject(script_state, - CreateCannotActionOnStateStreamException( - script_state->GetIsolate(), "close", state)); - } - - // 5. Assert: state is "writable" or "erroring". - DCHECK(state == WritableStream::kWritable || - state == WritableStream::kErroring); - - // 6. Assert: ! WritableStreamCloseQueuedOrInFlight(stream) is false. - DCHECK(!WritableStream::CloseQueuedOrInFlight(stream)); - - // 7. Let promise be a new promise. - auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state); - - // 8. Set stream.[[closeRequest]] to promise. - stream->SetCloseRequest(promise); - - // 9. If stream.[[backpressure]] is true and state is "writable", resolve - // writer.[[readyPromise]] with undefined. - if (stream->HasBackpressure() && state == WritableStream::kWritable) { - writer->ready_promise_->ResolveWithUndefined(script_state); - } - - // 10. Perform ! WritableStreamDefaultControllerClose( - // stream.[[writableStreamController]]). - WritableStreamDefaultController::Close(script_state, stream->Controller()); - - // 11. Return promise. - return promise->V8Promise(script_state->GetIsolate()); + // 3. Return ! WritableStreamClose(stream). + return WritableStream::Close(script_state, stream); } void WritableStreamDefaultWriter::EnsureClosedPromiseRejected(
diff --git a/third_party/blink/renderer/core/testing/fake_remote_frame_host.cc b/third_party/blink/renderer/core/testing/fake_remote_frame_host.cc index 7096fe2..034ae18 100644 --- a/third_party/blink/renderer/core/testing/fake_remote_frame_host.cc +++ b/third_party/blink/renderer/core/testing/fake_remote_frame_host.cc
@@ -21,6 +21,8 @@ void FakeRemoteFrameHost::DidFocusFrame() {} +void FakeRemoteFrameHost::CheckCompleted() {} + void FakeRemoteFrameHost::BindFrameHostReceiver( mojo::ScopedInterfaceEndpointHandle handle) { receiver_.Bind(mojo::PendingAssociatedReceiver<mojom::blink::RemoteFrameHost>(
diff --git a/third_party/blink/renderer/core/testing/fake_remote_frame_host.h b/third_party/blink/renderer/core/testing/fake_remote_frame_host.h index 9cb83cd..9173874d 100644 --- a/third_party/blink/renderer/core/testing/fake_remote_frame_host.h +++ b/third_party/blink/renderer/core/testing/fake_remote_frame_host.h
@@ -24,6 +24,7 @@ void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override; void VisibilityChanged(mojom::blink::FrameVisibility visibility) override; void DidFocusFrame() override; + void CheckCompleted() override; private: void BindFrameHostReceiver(mojo::ScopedInterfaceEndpointHandle handle);
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.cc b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.cc index 1b3bd49..ee76205 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.cc +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.cc
@@ -19,26 +19,31 @@ TrustedHTML* TrustedTypePolicy::createHTML(ScriptState* script_state, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { - return CreateHTML(script_state->GetIsolate(), input, exception_state); + return CreateHTML(script_state->GetIsolate(), input, args, exception_state); } TrustedScript* TrustedTypePolicy::createScript( ScriptState* script_state, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { - return CreateScript(script_state->GetIsolate(), input, exception_state); + return CreateScript(script_state->GetIsolate(), input, args, exception_state); } TrustedScriptURL* TrustedTypePolicy::createScriptURL( ScriptState* script_state, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { - return CreateScriptURL(script_state->GetIsolate(), input, exception_state); + return CreateScriptURL(script_state->GetIsolate(), input, args, + exception_state); } TrustedHTML* TrustedTypePolicy::CreateHTML(v8::Isolate* isolate, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { if (!policy_options_->createHTML()) { exception_state.ThrowTypeError( @@ -48,7 +53,7 @@ } v8::TryCatch try_catch(isolate); String html; - if (!policy_options_->createHTML()->Invoke(nullptr, input).To(&html)) { + if (!policy_options_->createHTML()->Invoke(nullptr, input, args).To(&html)) { DCHECK(try_catch.HasCaught()); exception_state.RethrowV8Exception(try_catch.Exception()); return nullptr; @@ -59,6 +64,7 @@ TrustedScript* TrustedTypePolicy::CreateScript( v8::Isolate* isolate, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { if (!policy_options_->createScript()) { exception_state.ThrowTypeError( @@ -68,7 +74,9 @@ } v8::TryCatch try_catch(isolate); String script; - if (!policy_options_->createScript()->Invoke(nullptr, input).To(&script)) { + if (!policy_options_->createScript() + ->Invoke(nullptr, input, args) + .To(&script)) { DCHECK(try_catch.HasCaught()); exception_state.RethrowV8Exception(try_catch.Exception()); return nullptr; @@ -79,6 +87,7 @@ TrustedScriptURL* TrustedTypePolicy::CreateScriptURL( v8::Isolate* isolate, const String& input, + const HeapVector<ScriptValue>& args, ExceptionState& exception_state) { if (!policy_options_->createScriptURL()) { exception_state.ThrowTypeError("Policy " + name_ + @@ -89,7 +98,7 @@ v8::TryCatch try_catch(isolate); String script_url; if (!policy_options_->createScriptURL() - ->Invoke(nullptr, input) + ->Invoke(nullptr, input, args) .To(&script_url)) { DCHECK(try_catch.HasCaught()); exception_state.RethrowV8Exception(try_catch.Exception());
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h index cf1e114..a2f4ad4 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h
@@ -24,18 +24,32 @@ public: TrustedTypePolicy(const String& policy_name, TrustedTypePolicyOptions*); - TrustedHTML* CreateHTML(v8::Isolate*, const String&, ExceptionState&); - TrustedScript* CreateScript(v8::Isolate*, const String&, ExceptionState&); + TrustedHTML* CreateHTML(v8::Isolate*, + const String&, + const HeapVector<ScriptValue>&, + ExceptionState&); + TrustedScript* CreateScript(v8::Isolate*, + const String&, + const HeapVector<ScriptValue>&, + ExceptionState&); TrustedScriptURL* CreateScriptURL(v8::Isolate*, const String&, + const HeapVector<ScriptValue>&, ExceptionState&); // IDL generates calls with ScriptState*, which contains the Isolate*. // These methods all call the Isolate* variant. - TrustedHTML* createHTML(ScriptState*, const String&, ExceptionState&); - TrustedScript* createScript(ScriptState*, const String&, ExceptionState&); + TrustedHTML* createHTML(ScriptState*, + const String&, + const HeapVector<ScriptValue>&, + ExceptionState&); + TrustedScript* createScript(ScriptState*, + const String&, + const HeapVector<ScriptValue>&, + ExceptionState&); TrustedScriptURL* createScriptURL(ScriptState*, const String&, + const HeapVector<ScriptValue>&, ExceptionState&); bool HasCreateHTML();
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl index f1767d8..cbd08ca 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl
@@ -11,7 +11,7 @@ RuntimeEnabled=TrustedDOMTypes ] interface TrustedTypePolicy { [Unforgeable] readonly attribute DOMString name; - [CallWith=ScriptState, RaisesException, Unforgeable] TrustedHTML createHTML(DOMString input); - [CallWith=ScriptState, RaisesException, Unforgeable] TrustedScript createScript(DOMString input); - [CallWith=ScriptState, RaisesException, Unforgeable] TrustedScriptURL createScriptURL(DOMString input); + [CallWith=ScriptState, RaisesException, Unforgeable] TrustedHTML createHTML(DOMString input, any... args); + [CallWith=ScriptState, RaisesException, Unforgeable] TrustedScript createScript(DOMString input, any... args); + [CallWith=ScriptState, RaisesException, Unforgeable] TrustedScriptURL createScriptURL(DOMString input, any... args); };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_options.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_options.idl index bec526d..e43366b 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_options.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_options.idl
@@ -8,9 +8,8 @@ CreateHTMLCallback createHTML; CreateScriptCallback createScript; CreateURLCallback createScriptURL; - CreateURLCallback createURL; }; -callback CreateHTMLCallback = DOMString? (DOMString input); -callback CreateScriptCallback = DOMString? (DOMString input); -callback CreateURLCallback = USVString? (DOMString input); +callback CreateHTMLCallback = DOMString? (DOMString input, any... args); +callback CreateScriptCallback = DOMString? (DOMString input, any... args); +callback CreateURLCallback = USVString? (DOMString input, any... args);
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc index ae483b3..58b1dff 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc +++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc
@@ -37,8 +37,11 @@ kTrustedScriptAssignment, kTrustedScriptURLAssignment, kTrustedHTMLAssignmentAndDefaultPolicyFailed, + kTrustedHTMLAssignmentAndNoDefaultPolicyExisted, kTrustedScriptAssignmentAndDefaultPolicyFailed, + kTrustedScriptAssignmentAndNoDefaultPolicyExisted, kTrustedScriptURLAssignmentAndDefaultPolicyFailed, + kTrustedScriptURLAssignmentAndNoDefaultPolicyExisted, kNavigateToJavascriptURL, kNavigateToJavascriptURLAndDefaultPolicyFailed, kScriptExecution, @@ -58,12 +61,21 @@ case kTrustedHTMLAssignmentAndDefaultPolicyFailed: return "This document requires 'TrustedHTML' assignment and the " "'default' policy failed to execute."; + case kTrustedHTMLAssignmentAndNoDefaultPolicyExisted: + return "This document requires 'TrustedHTML' assignment and no " + "'default' policy for 'TrustedHTML' has been defined."; case kTrustedScriptAssignmentAndDefaultPolicyFailed: return "This document requires 'TrustedScript' assignment and the " "'default' policy failed to execute."; + case kTrustedScriptAssignmentAndNoDefaultPolicyExisted: + return "This document requires 'TrustedScript' assignment and no " + "'default' policy for 'TrustedScript' has been defined."; case kTrustedScriptURLAssignmentAndDefaultPolicyFailed: return "This document requires 'TrustedScriptURL' assignment and the " "'default' policy failed to execute."; + case kTrustedScriptURLAssignmentAndNoDefaultPolicyExisted: + return "This document requires 'TrustedScriptURL' assignment and no " + "'default' policy for 'TrustedScriptURL' has been defined."; case kNavigateToJavascriptURL: return "This document requires 'TrustedScript' assignment. " "Navigating to a javascript:-URL is equivalent to a " @@ -201,8 +213,8 @@ return script; } - TrustedScript* result = - default_policy->CreateScript(doc->GetIsolate(), script, exception_state); + TrustedScript* result = default_policy->CreateScript( + doc->GetIsolate(), script, HeapVector<ScriptValue>(), exception_state); if (exception_state.HadException()) { exception_state.ClearException(); return String(); @@ -354,15 +366,16 @@ } if (!default_policy->HasCreateHTML()) { - if (TrustedTypeFail(kTrustedHTMLAssignmentAndDefaultPolicyFailed, + if (TrustedTypeFail(kTrustedHTMLAssignmentAndNoDefaultPolicyExisted, execution_context, exception_state, string)) { return g_empty_string; } else { return string; } } - TrustedHTML* result = default_policy->CreateHTML( - execution_context->GetIsolate(), string, exception_state); + TrustedHTML* result = + default_policy->CreateHTML(execution_context->GetIsolate(), string, + HeapVector<ScriptValue>(), exception_state); if (exception_state.HadException()) { return g_empty_string; } @@ -419,7 +432,7 @@ } if (!default_policy->HasCreateScript()) { - if (TrustedTypeFail(kTrustedScriptAssignmentAndDefaultPolicyFailed, + if (TrustedTypeFail(kTrustedScriptAssignmentAndNoDefaultPolicyExisted, execution_context, exception_state, potential_script)) { return g_empty_string; } else { @@ -427,7 +440,8 @@ } } TrustedScript* result = default_policy->CreateScript( - execution_context->GetIsolate(), potential_script, exception_state); + execution_context->GetIsolate(), potential_script, + HeapVector<ScriptValue>(), exception_state); DCHECK_EQ(!result, exception_state.HadException()); if (exception_state.HadException()) { return g_empty_string; @@ -474,7 +488,7 @@ } if (!default_policy->HasCreateScriptURL()) { - if (TrustedTypeFail(kTrustedScriptURLAssignmentAndDefaultPolicyFailed, + if (TrustedTypeFail(kTrustedScriptURLAssignmentAndNoDefaultPolicyExisted, execution_context, exception_state, string)) { return g_empty_string; } else { @@ -482,7 +496,8 @@ } } TrustedScriptURL* result = default_policy->CreateScriptURL( - execution_context->GetIsolate(), string, exception_state); + execution_context->GetIsolate(), string, HeapVector<ScriptValue>(), + exception_state); if (exception_state.HadException()) { return g_empty_string;
diff --git a/third_party/blink/renderer/core/workers/shared_worker.cc b/third_party/blink/renderer/core/workers/shared_worker.cc index f123241..4ca5ce3 100644 --- a/third_party/blink/renderer/core/workers/shared_worker.cc +++ b/third_party/blink/renderer/core/workers/shared_worker.cc
@@ -40,6 +40,7 @@ #include "third_party/blink/renderer/core/messaging/message_port.h" #include "third_party/blink/renderer/core/probe/core_probes.h" #include "third_party/blink/renderer/core/workers/shared_worker_client_holder.h" +#include "third_party/blink/renderer/core/workers/worker_options.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" @@ -67,13 +68,7 @@ SharedWorker* SharedWorker::Create(ExecutionContext* context, const String& url, - ExceptionState& exception_state) { - return SharedWorker::Create(context, url, /*name=*/String(), exception_state); -} - -SharedWorker* SharedWorker::Create(ExecutionContext* context, - const String& url, - const String& name, + const StringOrWorkerOptions& options, ExceptionState& exception_state) { DCHECK(IsMainThread()); @@ -111,14 +106,23 @@ script_url, blob_url_token.InitWithNewPipeAndPassReceiver()); } - // |name| should not be null according to the HTML spec, but the current impl - // wrongly allows it when |name| is omitted. See TODO comment in - // shared_worker.idl. - // TODO(nhiroki): Stop assigning null to |name| as a default value, and remove - // this hack. - String worker_name = ""; - if (!name.IsNull()) - worker_name = name; + String worker_name; + if (options.IsString()) { + worker_name = options.GetAsString(); + } else if (options.IsWorkerOptions()) { + WorkerOptions* worker_options = options.GetAsWorkerOptions(); + if (worker_options->type() == "module" && + !RuntimeEnabledFeatures::ModuleSharedWorkerEnabled()) { + exception_state.ThrowTypeError( + "Module scripts are not supported on SharedWorker yet. " + "(see https://crbug.com/824646)"); + return nullptr; + } + worker_name = worker_options->name(); + } else { + NOTREACHED(); + } + DCHECK(!worker_name.IsNull()); SharedWorkerClientHolder::From(*document)->Connect( worker, std::move(remote_port), script_url, std::move(blob_url_token),
diff --git a/third_party/blink/renderer/core/workers/shared_worker.h b/third_party/blink/renderer/core/workers/shared_worker.h index 8cf2c8b..5ff0a88 100644 --- a/third_party/blink/renderer/core/workers/shared_worker.h +++ b/third_party/blink/renderer/core/workers/shared_worker.h
@@ -33,6 +33,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_WORKERS_SHARED_WORKER_H_ #include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h" +#include "third_party/blink/renderer/bindings/core/v8/string_or_worker_options.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/workers/abstract_worker.h" #include "third_party/blink/renderer/platform/heap/handle.h" @@ -53,10 +54,7 @@ public: static SharedWorker* Create(ExecutionContext*, const String& url, - ExceptionState&); - static SharedWorker* Create(ExecutionContext*, - const String& url, - const String& name, + const StringOrWorkerOptions&, ExceptionState&); explicit SharedWorker(ExecutionContext*);
diff --git a/third_party/blink/renderer/core/workers/shared_worker.idl b/third_party/blink/renderer/core/workers/shared_worker.idl index 7d0577ce..6755fdf44 100644 --- a/third_party/blink/renderer/core/workers/shared_worker.idl +++ b/third_party/blink/renderer/core/workers/shared_worker.idl
@@ -36,9 +36,7 @@ // TODO(foolip): Exposed=(Window,Worker), RuntimeEnabled=SharedWorker ] interface SharedWorker : EventTarget { - // TODO(nhiroki): The second argument should be |optional (DOMString or - // WorkerOptions) options)|. - [CallWith=ExecutionContext, RaisesException] constructor(DOMString scriptURL, optional DOMString name); + [CallWith=ExecutionContext, RaisesException] constructor(DOMString scriptURL, optional (DOMString or WorkerOptions) options = {}); readonly attribute MessagePort port; };
diff --git a/third_party/blink/renderer/core/xml/xpath_evaluator.idl b/third_party/blink/renderer/core/xml/xpath_evaluator.idl index b4caf3c..595ed66 100644 --- a/third_party/blink/renderer/core/xml/xpath_evaluator.idl +++ b/third_party/blink/renderer/core/xml/xpath_evaluator.idl
@@ -25,10 +25,8 @@ // Blink, Gecko, Presto, WebKit and all have these APIs on both Document and the // constructable XPathEvaluator interface. -[ - Measure -] interface XPathEvaluator { - constructor(); +interface XPathEvaluator { + [Measure] constructor(); [Measure, RaisesException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null); [Measure] XPathNSResolver createNSResolver(Node nodeResolver);
diff --git a/third_party/blink/renderer/core/xml/xslt_processor.idl b/third_party/blink/renderer/core/xml/xslt_processor.idl index 9e7bfdb..f6ea356c 100644 --- a/third_party/blink/renderer/core/xml/xslt_processor.idl +++ b/third_party/blink/renderer/core/xml/xslt_processor.idl
@@ -31,10 +31,9 @@ // https://hg.mozilla.org/mozilla-central/file/012853bd80b7/dom/webidl/XSLTProcessor.webidl [ - RuntimeEnabled=XSLT, - MeasureAs=XSLTProcessor + RuntimeEnabled=XSLT ] interface XSLTProcessor { - [CallWith=Document] constructor(); + [CallWith=Document, MeasureAs=XSLTProcessor] constructor(); void importStylesheet(Node style); // TODO(foolip): In Gecko, the transformTo*() methods throw an exception in
diff --git a/third_party/blink/renderer/modules/animationworklet/worklet_animation.idl b/third_party/blink/renderer/modules/animationworklet/worklet_animation.idl index 2ce4e94..f893b44 100644 --- a/third_party/blink/renderer/modules/animationworklet/worklet_animation.idl +++ b/third_party/blink/renderer/modules/animationworklet/worklet_animation.idl
@@ -7,10 +7,9 @@ // TODO(840383): Accodring to the specification |effects| is optional and // defaults to null. Match that here. [ - MeasureAs=WorkletAnimationConstructor, RuntimeEnabled=AnimationWorklet ] interface WorkletAnimation { - [CallWith=ScriptState, RaisesException] constructor(DOMString animatorName, + [CallWith=ScriptState, RaisesException, MeasureAs=WorkletAnimationConstructor] constructor(DOMString animatorName, (AnimationEffect or sequence<AnimationEffect>) effects, optional (DocumentTimeline or ScrollTimeline) timeline, optional SerializedScriptValue options);
diff --git a/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.idl b/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.idl index 68bdcae..5cde86a2 100644 --- a/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.idl +++ b/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.idl
@@ -6,10 +6,9 @@ [ Exposed=(Window,Worker), - ActiveScriptWrappable, - Measure + ActiveScriptWrappable ] interface BroadcastChannel : EventTarget { - [CallWith=ExecutionContext, RaisesException] constructor(DOMString name); + [CallWith=ExecutionContext, RaisesException, Measure] constructor(DOMString name); readonly attribute DOMString name; [RaisesException, Measure] void postMessage(any message);
diff --git a/third_party/blink/renderer/modules/compression/compression_stream.idl b/third_party/blink/renderer/modules/compression/compression_stream.idl index e6f9a17..dd74ace 100644 --- a/third_party/blink/renderer/modules/compression/compression_stream.idl +++ b/third_party/blink/renderer/modules/compression/compression_stream.idl
@@ -1,8 +1,7 @@ [ - Exposed=(Window,Worker), - MeasureAs=CompressionStreamConstructor + Exposed=(Window,Worker) ] interface CompressionStream { - [CallWith=ScriptState, RaisesException] constructor(DOMString format); + [CallWith=ScriptState, RaisesException, MeasureAs=CompressionStreamConstructor] constructor(DOMString format); readonly attribute ReadableStream readable; readonly attribute WritableStream writable; };
diff --git a/third_party/blink/renderer/modules/compression/decompression_stream.idl b/third_party/blink/renderer/modules/compression/decompression_stream.idl index b76ae99..281d1dc 100644 --- a/third_party/blink/renderer/modules/compression/decompression_stream.idl +++ b/third_party/blink/renderer/modules/compression/decompression_stream.idl
@@ -1,8 +1,7 @@ [ - Exposed=(Window,Worker), - MeasureAs=DecompressionStreamConstructor + Exposed=(Window,Worker) ] interface DecompressionStream { - [CallWith=ScriptState, RaisesException] constructor(DOMString format); + [CallWith=ScriptState, RaisesException, MeasureAs=DecompressionStreamConstructor] constructor(DOMString format); readonly attribute ReadableStream readable; readonly attribute WritableStream writable; };
diff --git a/third_party/blink/renderer/modules/encoding/text_decoder.idl b/third_party/blink/renderer/modules/encoding/text_decoder.idl index 455c365..55a59040 100644 --- a/third_party/blink/renderer/modules/encoding/text_decoder.idl +++ b/third_party/blink/renderer/modules/encoding/text_decoder.idl
@@ -29,10 +29,9 @@ */ [ - Exposed=(Window,Worker), - MeasureAs=TextDecoderConstructor + Exposed=(Window,Worker) ] interface TextDecoder { - [RaisesException] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options); + [RaisesException, MeasureAs=TextDecoderConstructor] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options); readonly attribute DOMString encoding; readonly attribute boolean fatal; readonly attribute boolean ignoreBOM;
diff --git a/third_party/blink/renderer/modules/encoding/text_decoder_stream.idl b/third_party/blink/renderer/modules/encoding/text_decoder_stream.idl index 84cffc7a..4e475577 100644 --- a/third_party/blink/renderer/modules/encoding/text_decoder_stream.idl +++ b/third_party/blink/renderer/modules/encoding/text_decoder_stream.idl
@@ -4,10 +4,9 @@ // https://encoding.spec.whatwg.org/#interface-textdecoderstream [ - Exposed=(Window,Worker), - MeasureAs=TextDecoderStreamConstructor + Exposed=(Window,Worker) ] interface TextDecoderStream { - [CallWith=ScriptState, RaisesException] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options); + [CallWith=ScriptState, RaisesException, MeasureAs=TextDecoderStreamConstructor] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options); readonly attribute DOMString encoding; readonly attribute boolean fatal; readonly attribute boolean ignoreBOM;
diff --git a/third_party/blink/renderer/modules/encoding/text_encoder.idl b/third_party/blink/renderer/modules/encoding/text_encoder.idl index bd57aff..b9af61c1 100644 --- a/third_party/blink/renderer/modules/encoding/text_encoder.idl +++ b/third_party/blink/renderer/modules/encoding/text_encoder.idl
@@ -29,10 +29,9 @@ */ [ - Exposed=(Window,Worker), - MeasureAs=TextEncoderConstructor + Exposed=(Window,Worker) ] interface TextEncoder { - [CallWith=ExecutionContext, RaisesException] constructor(); + [CallWith=ExecutionContext, RaisesException, MeasureAs=TextEncoderConstructor] constructor(); readonly attribute DOMString encoding; [MeasureAs=TextEncoderEncode] Uint8Array encode(optional USVString input = ""); [MeasureAs=TextEncoderEncodeInto] TextEncoderEncodeIntoResult encodeInto(USVString source, Uint8Array destination);
diff --git a/third_party/blink/renderer/modules/encoding/text_encoder_stream.idl b/third_party/blink/renderer/modules/encoding/text_encoder_stream.idl index 7886cb0..e1829b6e 100644 --- a/third_party/blink/renderer/modules/encoding/text_encoder_stream.idl +++ b/third_party/blink/renderer/modules/encoding/text_encoder_stream.idl
@@ -4,10 +4,9 @@ // https://encoding.spec.whatwg.org/#interface-textencoderstream [ - Exposed=(Window,Worker), - MeasureAs=TextEncoderStreamConstructor + Exposed=(Window,Worker) ] interface TextEncoderStream { - [CallWith=ScriptState, RaisesException] constructor(); + [CallWith=ScriptState, RaisesException, MeasureAs=TextEncoderStreamConstructor] constructor(); readonly attribute DOMString encoding; readonly attribute ReadableStream readable; readonly attribute WritableStream writable;
diff --git a/third_party/blink/renderer/modules/hid/hid.cc b/third_party/blink/renderer/modules/hid/hid.cc index ce84096..d855bb70 100644 --- a/third_party/blink/renderer/modules/hid/hid.cc +++ b/third_party/blink/renderer/modules/hid/hid.cc
@@ -81,7 +81,11 @@ } // namespace -HID::HID(ExecutionContext& context) : ContextLifecycleObserver(&context) {} +HID::HID(ExecutionContext& context) + : ContextLifecycleObserver(&context), + feature_handle_for_scheduler_(context.GetScheduler()->RegisterFeature( + SchedulingPolicy::Feature::kWebHID, + {SchedulingPolicy::RecordMetricsForBackForwardCache()})) {} HID::~HID() { DCHECK(get_devices_promises_.IsEmpty());
diff --git a/third_party/blink/renderer/modules/hid/hid.h b/third_party/blink/renderer/modules/hid/hid.h index 8bc43fa..c5b96ea 100644 --- a/third_party/blink/renderer/modules/hid/hid.h +++ b/third_party/blink/renderer/modules/hid/hid.h
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h" namespace blink { @@ -72,6 +73,8 @@ HeapHashSet<Member<ScriptPromiseResolver>> get_devices_promises_; HeapHashSet<Member<ScriptPromiseResolver>> request_device_promises_; HeapHashMap<String, WeakMember<HIDDevice>> device_cache_; + FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle + feature_handle_for_scheduler_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture.idl b/third_party/blink/renderer/modules/imagecapture/image_capture.idl index b1ba5eca..d27b265 100644 --- a/third_party/blink/renderer/modules/imagecapture/image_capture.idl +++ b/third_party/blink/renderer/modules/imagecapture/image_capture.idl
@@ -6,10 +6,9 @@ [ ActiveScriptWrappable, - MeasureAs=ImageCaptureConstructor, Exposed=Window ] interface ImageCapture { - [CallWith=ExecutionContext, RaisesException] constructor(MediaStreamTrack track); + [CallWith=ExecutionContext, RaisesException, MeasureAs=ImageCaptureConstructor] constructor(MediaStreamTrack track); [ImplementedAs=videoStreamTrack] readonly attribute MediaStreamTrack track; [CallWith=ScriptState] Promise<PhotoCapabilities> getPhotoCapabilities();
diff --git a/third_party/blink/renderer/modules/native_file_system/file_system_directory_handle.idl b/third_party/blink/renderer/modules/native_file_system/file_system_directory_handle.idl index ff791d2e..3971a281 100644 --- a/third_party/blink/renderer/modules/native_file_system/file_system_directory_handle.idl +++ b/third_party/blink/renderer/modules/native_file_system/file_system_directory_handle.idl
@@ -16,6 +16,6 @@ [CallWith=ScriptState] Promise<void> removeEntry(USVString name, optional FileSystemRemoveOptions options); - [CallWith=ScriptState, Measure] + [CallWith=ScriptState, Measure, RaisesException] static Promise<FileSystemDirectoryHandle> getSystemDirectory(GetSystemDirectoryOptions options); };
diff --git a/third_party/blink/renderer/modules/native_file_system/file_system_file_handle.idl b/third_party/blink/renderer/modules/native_file_system/file_system_file_handle.idl index 712085d..907ec617 100644 --- a/third_party/blink/renderer/modules/native_file_system/file_system_file_handle.idl +++ b/third_party/blink/renderer/modules/native_file_system/file_system_file_handle.idl
@@ -11,6 +11,6 @@ ImplementedAs=NativeFileSystemFileHandle ] interface FileSystemFileHandle : FileSystemHandle { [CallWith=ScriptState] Promise<FileSystemWriter> createWriter(optional FileSystemCreateWriterOptions options); - [CallWith=ScriptState, RuntimeEnabled=WritableFileStream] Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWriterOptions options); - [CallWith=ScriptState] Promise<File> getFile(); + [CallWith=ScriptState, RuntimeEnabled=WritableFileStream, RaisesException] Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWriterOptions options); + [CallWith=ScriptState, RaisesException] Promise<File> getFile(); };
diff --git a/third_party/blink/renderer/modules/native_file_system/file_system_writer.idl b/third_party/blink/renderer/modules/native_file_system/file_system_writer.idl index 8fb8589..5f8787b 100644 --- a/third_party/blink/renderer/modules/native_file_system/file_system_writer.idl +++ b/third_party/blink/renderer/modules/native_file_system/file_system_writer.idl
@@ -10,7 +10,7 @@ RuntimeEnabled=NativeFileSystem ] interface FileSystemWriter { [CallWith=ScriptState, RaisesException] Promise<void> write(unsigned long long position, (BufferSource or Blob or USVString) data); - [CallWith=ScriptState] Promise<void> truncate(unsigned long long size); + [CallWith=ScriptState, RaisesException] Promise<void> truncate(unsigned long long size); - [CallWith=ScriptState] Promise<void> close(); + [CallWith=ScriptState, RaisesException] Promise<void> close(); };
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.cc b/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.cc index 490f58b..308dfd3 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.cc +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.cc
@@ -20,6 +20,7 @@ #include "third_party/blink/renderer/modules/native_file_system/native_file_system_directory_iterator.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_error.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/weborigin/security_origin.h" #include "third_party/blink/renderer/platform/wtf/functional.h" @@ -159,21 +160,18 @@ // static ScriptPromise NativeFileSystemDirectoryHandle::getSystemDirectory( ScriptState* script_state, - const GetSystemDirectoryOptions* options) { + const GetSystemDirectoryOptions* options, + ExceptionState& exception_state) { ExecutionContext* context = ExecutionContext::From(script_state); if (!context->GetSecurityOrigin()->CanAccessNativeFileSystem()) { if (context->GetSecurityContext().IsSandboxed(WebSandboxFlags::kOrigin)) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "System directory access is denied because the context is " - "sandboxed and lacks the 'allow-same-origin' flag.")); + exception_state.ThrowSecurityError( + "System directory access is denied because the context is " + "sandboxed and lacks the 'allow-same-origin' flag."); + return ScriptPromise(); } else { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "System directory access is denied.")); + exception_state.ThrowSecurityError("System directory access is denied."); + return ScriptPromise(); } }
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h b/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h index 8c037ea..add98285 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h
@@ -39,7 +39,8 @@ const FileSystemRemoveOptions*); static ScriptPromise getSystemDirectory(ScriptState*, - const GetSystemDirectoryOptions*); + const GetSystemDirectoryOptions*, + ExceptionState&); mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken> Transfer() override;
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.cc b/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.cc index 90f2903c..cf524623 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.cc +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.cc
@@ -15,6 +15,7 @@ #include "third_party/blink/renderer/modules/native_file_system/native_file_system_error.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_writable_file_stream.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_writer.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/file_metadata.h" #include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/wtf/functional.h" @@ -68,18 +69,18 @@ ScriptPromise NativeFileSystemFileHandle::createWritable( ScriptState* script_state, - const FileSystemCreateWriterOptions* options) { + const FileSystemCreateWriterOptions* options, + ExceptionState& exception_state) { DCHECK(RuntimeEnabledFeatures::WritableFileStreamEnabled()); + if (!mojo_ptr_) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); + } + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise result = resolver->Promise(); - if (!mojo_ptr_) { - resolver->Reject(MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); - return result; - } - mojo_ptr_->CreateFileWriter( options->keepExistingData(), WTF::Bind( @@ -103,16 +104,17 @@ return result; } -ScriptPromise NativeFileSystemFileHandle::getFile(ScriptState* script_state) { +ScriptPromise NativeFileSystemFileHandle::getFile( + ScriptState* script_state, + ExceptionState& exception_state) { + if (!mojo_ptr_) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); + } + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise result = resolver->Promise(); - if (!mojo_ptr_) { - resolver->Reject(MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); - return result; - } - mojo_ptr_->AsBlob(WTF::Bind( [](ScriptPromiseResolver* resolver, const String& name, NativeFileSystemErrorPtr result, const base::File::Info& info,
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h b/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h index e9cc5e5..7e75cfb 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h
@@ -27,8 +27,9 @@ ScriptPromise createWriter(ScriptState*, const FileSystemCreateWriterOptions* options); ScriptPromise createWritable(ScriptState*, - const FileSystemCreateWriterOptions* options); - ScriptPromise getFile(ScriptState*); + const FileSystemCreateWriterOptions* options, + ExceptionState&); + ScriptPromise getFile(ScriptState*, ExceptionState&); mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken> Transfer() override;
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_writable_file_stream.cc b/third_party/blink/renderer/modules/native_file_system/native_file_system_writable_file_stream.cc index 89392e4..0c156d9 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_writable_file_stream.cc +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_writable_file_stream.cc
@@ -76,7 +76,7 @@ WritableStreamDefaultWriter* writer = WritableStream::AcquireDefaultWriter(script_state, this, exception_state); if (exception_state.HadException()) - return ScriptPromise::Reject(script_state, exception_state); + return ScriptPromise(); auto* options = WriteParams::Create(); options->setType("truncate"); @@ -95,7 +95,7 @@ WritableStreamDefaultWriter* writer = WritableStream::AcquireDefaultWriter(script_state, this, exception_state); if (exception_state.HadException()) - return ScriptPromise::Reject(script_state, exception_state); + return ScriptPromise(); ScriptPromise promise = writer->close(script_state); @@ -110,7 +110,7 @@ WritableStreamDefaultWriter* writer = WritableStream::AcquireDefaultWriter(script_state, this, exception_state); if (exception_state.HadException()) - return ScriptPromise::Reject(script_state, exception_state); + return ScriptPromise(); auto* options = WriteParams::Create(); options->setType("seek");
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.cc b/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.cc index d66d20fc..df88dd6 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.cc +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.cc
@@ -66,16 +66,17 @@ BlobDataHandle::Create(std::move(blob_data), size)); } - return WriteBlob(script_state, position, blob); + return WriteBlob(script_state, position, blob, exception_state); } -ScriptPromise NativeFileSystemWriter::WriteBlob(ScriptState* script_state, - uint64_t position, - Blob* blob) { +ScriptPromise NativeFileSystemWriter::WriteBlob( + ScriptState* script_state, + uint64_t position, + Blob* blob, + ExceptionState& exception_state) { if (!writer_remote_ || pending_operation_) { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); } pending_operation_ = MakeGarbageCollected<ScriptPromiseResolver>(script_state); @@ -178,9 +179,8 @@ ReadableStream* stream, ExceptionState& exception_state) { if (!writer_remote_ || pending_operation_) { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); } DCHECK(!stream_loader_); @@ -203,12 +203,13 @@ return result; } -ScriptPromise NativeFileSystemWriter::truncate(ScriptState* script_state, - uint64_t size) { +ScriptPromise NativeFileSystemWriter::truncate( + ScriptState* script_state, + uint64_t size, + ExceptionState& exception_state) { if (!writer_remote_ || pending_operation_) { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); } pending_operation_ = MakeGarbageCollected<ScriptPromiseResolver>(script_state); @@ -219,11 +220,11 @@ return result; } -ScriptPromise NativeFileSystemWriter::close(ScriptState* script_state) { +ScriptPromise NativeFileSystemWriter::close(ScriptState* script_state, + ExceptionState& exception_state) { if (!writer_remote_ || pending_operation_) { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kInvalidStateError)); + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); + return ScriptPromise(); } pending_operation_ = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
diff --git a/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.h b/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.h index f7de9e0..84cc032 100644 --- a/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.h +++ b/third_party/blink/renderer/modules/native_file_system/native_file_system_writer.h
@@ -37,8 +37,8 @@ uint64_t position, const ArrayBufferOrArrayBufferViewOrBlobOrUSVString& data, ExceptionState&); - ScriptPromise truncate(ScriptState*, uint64_t size); - ScriptPromise close(ScriptState*); + ScriptPromise truncate(ScriptState*, uint64_t size, ExceptionState&); + ScriptPromise close(ScriptState*, ExceptionState&); void Trace(Visitor*) override; void ContextDestroyed(ExecutionContext*) override; @@ -46,7 +46,10 @@ private: class StreamWriterClient; - ScriptPromise WriteBlob(ScriptState*, uint64_t position, Blob*); + ScriptPromise WriteBlob(ScriptState*, + uint64_t position, + Blob*, + ExceptionState&); ScriptPromise WriteStream(ScriptState*, uint64_t position, ReadableStream* stream,
diff --git a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc index fbba94b..2e05bc8 100644 --- a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc +++ b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc
@@ -20,6 +20,7 @@ #include "third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_error.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_file_handle.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/wtf/functional.h" @@ -62,51 +63,42 @@ ScriptPromise WindowNativeFileSystem::chooseFileSystemEntries( ScriptState* script_state, LocalDOMWindow& window, - const ChooseFileSystemEntriesOptions* options) { + const ChooseFileSystemEntriesOptions* options, + ExceptionState& exception_state) { if (!window.IsCurrentlyDisplayedInFrame()) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError)); + exception_state.ThrowDOMException(DOMExceptionCode::kAbortError, ""); + return ScriptPromise(); } Document* document = window.document(); if (!document) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError)); + exception_state.ThrowDOMException(DOMExceptionCode::kAbortError, ""); + return ScriptPromise(); } if (!document->GetSecurityOrigin()->CanAccessNativeFileSystem()) { if (document->IsSandboxed(WebSandboxFlags::kOrigin)) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "Sandboxed documents aren't allowed to show a file picker.")); + exception_state.ThrowSecurityError( + "Sandboxed documents aren't allowed to show a file picker."); + return ScriptPromise(); } else { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "This document isn't allowed to show a file picker.")); + exception_state.ThrowSecurityError( + "This document isn't allowed to show a file picker."); + return ScriptPromise(); } } LocalFrame* local_frame = window.GetFrame(); if (!local_frame || local_frame->IsCrossOriginSubframe()) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "Cross origin sub frames aren't allowed to show a file picker.")); + exception_state.ThrowSecurityError( + "Cross origin sub frames aren't allowed to show a file picker."); + return ScriptPromise(); } if (!LocalFrame::HasTransientUserActivation(local_frame)) { - return ScriptPromise::RejectWithDOMException( - script_state, - MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "Must be handling a user gesture to show a file picker.")); + exception_state.ThrowSecurityError( + "Must be handling a user gesture to show a file picker."); + return ScriptPromise(); } Vector<mojom::blink::ChooseFileSystemEntryAcceptsOptionPtr> accepts;
diff --git a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.h b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.h index c72d8e3..8f4926a 100644 --- a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.h +++ b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.h
@@ -11,6 +11,7 @@ namespace blink { class ChooseFileSystemEntriesOptions; +class ExceptionState; class LocalDOMWindow; class ScriptPromise; class ScriptState; @@ -22,7 +23,8 @@ static ScriptPromise chooseFileSystemEntries( ScriptState*, LocalDOMWindow&, - const ChooseFileSystemEntriesOptions*); + const ChooseFileSystemEntriesOptions*, + ExceptionState&); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.idl b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.idl index e2b338d..ba6bea8 100644 --- a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.idl +++ b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.idl
@@ -8,7 +8,7 @@ RuntimeEnabled=NativeFileSystem, ImplementedAs=WindowNativeFileSystem ] partial interface Window { - [CallWith=ScriptState, Measure] + [CallWith=ScriptState, Measure, RaisesException] Promise<(FileSystemHandle or sequence<FileSystemHandle>)> chooseFileSystemEntries(optional ChooseFileSystemEntriesOptions options); };
diff --git a/third_party/blink/renderer/modules/nfc/ndef_reader.cc b/third_party/blink/renderer/modules/nfc/ndef_reader.cc index 1a23013d..5275f9c 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_reader.cc +++ b/third_party/blink/renderer/modules/nfc/ndef_reader.cc
@@ -34,7 +34,8 @@ void OnScanRequestCompleted(ScriptPromiseResolver* resolver, device::mojom::blink::NDEFErrorPtr error) { if (error) { - resolver->Reject(NDEFErrorTypeToDOMException(error->error_type)); + resolver->Reject( + NDEFErrorTypeToDOMException(error->error_type, error->error_message)); return; } resolver->Resolve(); @@ -166,10 +167,9 @@ MakeGarbageCollected<NDEFMessage>(message))); } -void NDEFReader::OnError(device::mojom::blink::NDEFErrorType error) { +void NDEFReader::OnError(const String& message) { ErrorEvent* event = ErrorEvent::Create( - NDEFErrorTypeToDOMException(error)->message(), - SourceLocation::Capture(GetExecutionContext()), nullptr); + message, SourceLocation::Capture(GetExecutionContext()), nullptr); DispatchEvent(*event); } @@ -177,11 +177,12 @@ // If |resolver_| has already settled this rejection is silently ignored. if (resolver_) { resolver_->Reject(NDEFErrorTypeToDOMException( - device::mojom::blink::NDEFErrorType::NOT_SUPPORTED)); + device::mojom::blink::NDEFErrorType::NOT_SUPPORTED, + "WebNFC feature is unavailable.")); } // Dispatches an error event. - OnError(device::mojom::blink::NDEFErrorType::NOT_SUPPORTED); + OnError("WebNFC feature is unavailable."); } void NDEFReader::ContextDestroyed(ExecutionContext*) {
diff --git a/third_party/blink/renderer/modules/nfc/ndef_reader.h b/third_party/blink/renderer/modules/nfc/ndef_reader.h index 0e6f664..ac5c24c4 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_reader.h +++ b/third_party/blink/renderer/modules/nfc/ndef_reader.h
@@ -50,7 +50,7 @@ // Called by NFCProxy for dispatching events. virtual void OnReading(const String& serial_number, const device::mojom::blink::NDEFMessage&); - virtual void OnError(device::mojom::blink::NDEFErrorType); + virtual void OnError(const String& message); // Called by NFCProxy for notification about connection error. void OnMojoConnectionError();
diff --git a/third_party/blink/renderer/modules/nfc/ndef_record.cc b/third_party/blink/renderer/modules/nfc/ndef_record.cc index ff77b9aa..4b9e0c4 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_record.cc +++ b/third_party/blink/renderer/modules/nfc/ndef_record.cc
@@ -237,27 +237,36 @@ bytes); } -static NDEFRecord* CreateExternalRecord(const String& record_type, - const String& id, - const NDEFRecordDataSource& data, - ExceptionState& exception_state) { - // TODO(https://crbug.com/520391): Add support in case of |data| being an - // NDEFMessageInit. - +static NDEFRecord* CreateExternalRecord( + const ExecutionContext* execution_context, + const String& record_type, + const String& id, + const NDEFRecordDataSource& data, + ExceptionState& exception_state) { // https://w3c.github.io/web-nfc/#dfn-map-external-data-to-ndef - if (!IsBufferSource(data)) { - exception_state.ThrowTypeError( - "The data for external type NDEFRecord must be a BufferSource."); - return nullptr; + if (IsBufferSource(data)) { + WTF::Vector<uint8_t> bytes; + if (!GetBytesOfBufferSource(data, &bytes, exception_state)) { + return nullptr; + } + return MakeGarbageCollected<NDEFRecord>( + device::mojom::NDEFRecordTypeCategory::kExternal, record_type, id, + bytes); + } else if (data.IsNDEFMessageInit()) { + NDEFMessage* payload_message = NDEFMessage::Create( + execution_context, data.GetAsNDEFMessageInit(), exception_state); + if (exception_state.HadException()) + return nullptr; + DCHECK(payload_message); + return MakeGarbageCollected<NDEFRecord>( + device::mojom::NDEFRecordTypeCategory::kExternal, record_type, id, + payload_message); } - WTF::Vector<uint8_t> bytes; - if (!GetBytesOfBufferSource(data, &bytes, exception_state)) { - return nullptr; - } - NDEFRecord* record = MakeGarbageCollected<NDEFRecord>( - device::mojom::NDEFRecordTypeCategory::kExternal, record_type, id, bytes); - return record; + exception_state.ThrowTypeError( + "The data for external type NDEFRecord must be a BufferSource or an " + "NDEFMessageInit."); + return nullptr; } } // namespace @@ -307,8 +316,8 @@ exception_state.ThrowTypeError("smart-poster type is not supported yet"); return nullptr; } else if (IsValidExternalType(record_type)) { - return CreateExternalRecord(record_type, init->id(), init->data(), - exception_state); + return CreateExternalRecord(execution_context, record_type, init->id(), + init->data(), exception_state); } else { // TODO(https://crbug.com/520391): Support local type records. } @@ -329,6 +338,20 @@ IsValidExternalType(record_type_)); } +NDEFRecord::NDEFRecord(device::mojom::NDEFRecordTypeCategory category, + const String& record_type, + const String& id, + NDEFMessage* payload_message) + : category_(category), + record_type_(record_type), + id_(id), + payload_message_(payload_message) { + DCHECK_EQ(category_ == device::mojom::NDEFRecordTypeCategory::kExternal, + IsValidExternalType(record_type_)); + DCHECK(record_type_ == "smart-poster" || + category_ == device::mojom::NDEFRecordTypeCategory::kExternal); +} + NDEFRecord::NDEFRecord(const String& id, const String& encoding, const String& lang,
diff --git a/third_party/blink/renderer/modules/nfc/ndef_record.h b/third_party/blink/renderer/modules/nfc/ndef_record.h index 4065ddd..e72e0769 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_record.h +++ b/third_party/blink/renderer/modules/nfc/ndef_record.h
@@ -29,15 +29,22 @@ ExceptionState&); explicit NDEFRecord(device::mojom::NDEFRecordTypeCategory, - const String& /* record_type */, - const String& /* id */, + const String& record_type, + const String& id, WTF::Vector<uint8_t>); + // For constructing an external type record or a "smart-poster" record whose + // payload is an NDEF message. + explicit NDEFRecord(device::mojom::NDEFRecordTypeCategory, + const String& record_type, + const String& id, + NDEFMessage*); + // Only for constructing "text" type record. The type category will be // device::mojom::NDEFRecordTypeCategory::kStandardized. - explicit NDEFRecord(const String& /* id */, - const String& /* encoding */, - const String& /* lang */, + explicit NDEFRecord(const String& id, + const String& encoding, + const String& lang, WTF::Vector<uint8_t>); // Only for constructing "text" type record from just a text. The type @@ -47,8 +54,8 @@ // Only for constructing "mime" type record. The type category will be // device::mojom::NDEFRecordTypeCategory::kStandardized. - explicit NDEFRecord(const String& /* id */, - const String& /* media_type */, + explicit NDEFRecord(const String& id, + const String& media_type, WTF::Vector<uint8_t>); explicit NDEFRecord(const device::mojom::blink::NDEFRecord&);
diff --git a/third_party/blink/renderer/modules/nfc/ndef_writer.cc b/third_party/blink/renderer/modules/nfc/ndef_writer.cc index 0405afe..8afb45b 100644 --- a/third_party/blink/renderer/modules/nfc/ndef_writer.cc +++ b/third_party/blink/renderer/modules/nfc/ndef_writer.cc
@@ -143,11 +143,12 @@ void NDEFWriter::OnMojoConnectionError() { nfc_proxy_.Clear(); - // If the mojo connection breaks, all push requests will be reject with a + // If the mojo connection breaks, all push requests will be rejected with a // default error. for (ScriptPromiseResolver* resolver : requests_) { resolver->Reject(NDEFErrorTypeToDOMException( - device::mojom::blink::NDEFErrorType::NOT_SUPPORTED)); + device::mojom::blink::NDEFErrorType::NOT_SUPPORTED, + "WebNFC feature is unavailable.")); } requests_.clear(); } @@ -183,10 +184,12 @@ requests_.erase(resolver); - if (error.is_null()) + if (error.is_null()) { resolver->Resolve(); - else - resolver->Reject(NDEFErrorTypeToDOMException(error->error_type)); + } else { + resolver->Reject( + NDEFErrorTypeToDOMException(error->error_type, error->error_message)); + } } } // namespace blink
diff --git a/third_party/blink/renderer/modules/nfc/nfc_proxy.cc b/third_party/blink/renderer/modules/nfc/nfc_proxy.cc index 2d1430b07..d89d4fe 100644 --- a/third_party/blink/renderer/modules/nfc/nfc_proxy.cc +++ b/third_party/blink/renderer/modules/nfc/nfc_proxy.cc
@@ -118,13 +118,13 @@ } } -void NFCProxy::OnError(device::mojom::blink::NDEFErrorType error) { +void NFCProxy::OnError(device::mojom::blink::NDEFErrorPtr error) { // Dispatch the event to all readers. We iterate on a copy of |readers_| // because a reader's onerror event handler may remove itself from |readers_| // just during the iteration process. ReaderMap copy = readers_; for (auto& pair : copy) { - pair.key->OnError(error); + pair.key->OnError(error->error_message); } }
diff --git a/third_party/blink/renderer/modules/nfc/nfc_proxy.h b/third_party/blink/renderer/modules/nfc/nfc_proxy.h index 50e7fcf..e8a7243 100644 --- a/third_party/blink/renderer/modules/nfc/nfc_proxy.h +++ b/third_party/blink/renderer/modules/nfc/nfc_proxy.h
@@ -60,7 +60,7 @@ void OnWatch(const Vector<uint32_t>&, const String&, device::mojom::blink::NDEFMessagePtr) override; - void OnError(device::mojom::blink::NDEFErrorType) override; + void OnError(device::mojom::blink::NDEFErrorPtr) override; void OnReaderRegistered(NDEFReader*, uint32_t watch_id,
diff --git a/third_party/blink/renderer/modules/nfc/nfc_proxy_test.cc b/third_party/blink/renderer/modules/nfc/nfc_proxy_test.cc index d6f5abc..4870eab3 100644 --- a/third_party/blink/renderer/modules/nfc/nfc_proxy_test.cc +++ b/third_party/blink/renderer/modules/nfc/nfc_proxy_test.cc
@@ -137,7 +137,7 @@ void CancelWatch(uint32_t id, CancelWatchCallback callback) override { if (watches_.erase(id) < 1) { std::move(callback).Run(device::mojom::blink::NDEFError::New( - device::mojom::blink::NDEFErrorType::NOT_FOUND)); + device::mojom::blink::NDEFErrorType::NOT_FOUND, "")); } else { std::move(callback).Run(nullptr); } @@ -242,7 +242,7 @@ // Make the fake NFC service return an error for the incoming watch request. nfc_service()->set_watch_error(device::mojom::blink::NDEFError::New( - device::mojom::blink::NDEFErrorType::NOT_READABLE)); + device::mojom::blink::NDEFErrorType::NOT_READABLE, "")); base::RunLoop loop; nfc_proxy->StartReading( reader, scan_options,
diff --git a/third_party/blink/renderer/modules/nfc/nfc_utils.cc b/third_party/blink/renderer/modules/nfc/nfc_utils.cc index 17f07945..79dcc3f 100644 --- a/third_party/blink/renderer/modules/nfc/nfc_utils.cc +++ b/third_party/blink/renderer/modules/nfc/nfc_utils.cc
@@ -34,36 +34,33 @@ } DOMException* NDEFErrorTypeToDOMException( - device::mojom::blink::NDEFErrorType error_type) { + device::mojom::blink::NDEFErrorType error_type, + const String& error_message) { switch (error_type) { case device::mojom::blink::NDEFErrorType::NOT_ALLOWED: return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNotAllowedError, "NFC operation not allowed."); + DOMExceptionCode::kNotAllowedError, error_message); case device::mojom::blink::NDEFErrorType::NOT_SUPPORTED: return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNotSupportedError, - "No NFC adapter or cannot establish connection."); + DOMExceptionCode::kNotSupportedError, error_message); case device::mojom::blink::NDEFErrorType::NOT_READABLE: return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNotReadableError, "NFC is not enabled."); + DOMExceptionCode::kNotReadableError, error_message); case device::mojom::blink::NDEFErrorType::NOT_FOUND: return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNotFoundError, - "Provided watch id cannot be found."); + DOMExceptionCode::kNotFoundError, error_message); case device::mojom::blink::NDEFErrorType::INVALID_MESSAGE: - return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSyntaxError, "Invalid NFC message was provided."); + return MakeGarbageCollected<DOMException>(DOMExceptionCode::kSyntaxError, + error_message); case device::mojom::blink::NDEFErrorType::OPERATION_CANCELLED: - return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kAbortError, "The NFC operation was cancelled."); + return MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError, + error_message); case device::mojom::blink::NDEFErrorType::CANNOT_CANCEL: return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNoModificationAllowedError, - "NFC operation cannot be cancelled."); + DOMExceptionCode::kNoModificationAllowedError, error_message); case device::mojom::blink::NDEFErrorType::IO_ERROR: - return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNetworkError, - "NFC data transfer error has occurred."); + return MakeGarbageCollected<DOMException>(DOMExceptionCode::kNetworkError, + error_message); } NOTREACHED(); // Don't need to handle the case after a NOTREACHED().
diff --git a/third_party/blink/renderer/modules/nfc/nfc_utils.h b/third_party/blink/renderer/modules/nfc/nfc_utils.h index 752c9f4..93cc67d 100644 --- a/third_party/blink/renderer/modules/nfc/nfc_utils.h +++ b/third_party/blink/renderer/modules/nfc/nfc_utils.h
@@ -18,7 +18,8 @@ const WTF::String& target); DOMException* NDEFErrorTypeToDOMException( - device::mojom::blink::NDEFErrorType error_type); + device::mojom::blink::NDEFErrorType error_type, + const String& error_message); } // namespace blink
diff --git a/third_party/blink/renderer/modules/notifications/notification.idl b/third_party/blink/renderer/modules/notifications/notification.idl index ef759ae..4d00d047 100644 --- a/third_party/blink/renderer/modules/notifications/notification.idl +++ b/third_party/blink/renderer/modules/notifications/notification.idl
@@ -42,10 +42,9 @@ [ ActiveScriptWrappable, Exposed=(Window,Worker), - MeasureAs=NotificationCreated, RuntimeEnabled=Notifications ] interface Notification : EventTarget { - [CallWith=ExecutionContext, RaisesException] constructor(DOMString title, optional NotificationOptions options); + [CallWith=ExecutionContext, RaisesException, MeasureAs=NotificationCreated] constructor(DOMString title, optional NotificationOptions options); [CallWith=ExecutionContext, MeasureAs=NotificationPermission] static readonly attribute NotificationPermission permission; // TODO(crbug.com/841185): |deprecatedCallback| is not nullable in the spec.
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.idl b/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.idl index 31f6708..7894ce1 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.idl
@@ -30,11 +30,10 @@ [ ActiveScriptWrappable, Exposed=Window, - Measure, SecureContext ] interface RTCIceTransport : EventTarget { // Constructor from https://w3c.github.io/webrtc-ice/#rtcicetransport* - [CallWith=ExecutionContext] constructor(); + [CallWith=ExecutionContext, Measure] constructor(); // TODO(github.com/w3c/webrtc-ice/issues/4): role is non-null in the // WebRTC-PC specification. [Measure] readonly attribute RTCIceRole? role;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.idl b/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.idl index 48da5c5d..54524edf 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.idl
@@ -14,11 +14,10 @@ // https://w3c.github.io/webrtc-quic/#quic-transport* [ Exposed=Window, - Measure, RuntimeEnabled=RTCQuicTransport, SecureContext ] interface RTCQuicTransport : EventTarget { - [CallWith=ExecutionContext, RaisesException] constructor(RTCIceTransport transport); + [CallWith=ExecutionContext, RaisesException, Measure] constructor(RTCIceTransport transport); [Measure] readonly attribute RTCIceTransport transport; [Measure] readonly attribute RTCQuicTransportState state; [Measure] readonly attribute unsigned short? maxDatagramLength;
diff --git a/third_party/blink/renderer/modules/presentation/presentation_connection.cc b/third_party/blink/renderer/modules/presentation/presentation_connection.cc index 7fd797b..683ac81 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_connection.cc +++ b/third_party/blink/renderer/modules/presentation/presentation_connection.cc
@@ -43,7 +43,7 @@ WTF::Vector<uint8_t>()); WTF::Vector<uint8_t>& data = message->get_data(); data.Append(static_cast<const uint8_t*>(buffer->Data()), - buffer->DeprecatedByteLengthAsUnsigned()); + base::checked_cast<wtf_size_t>(buffer->ByteLengthAsSizeT())); return message; } @@ -457,6 +457,15 @@ DCHECK(array_buffer->Buffer()); if (!CanSendMessage(exception_state)) return; + if (!base::CheckedNumeric<wtf_size_t>(array_buffer->ByteLengthAsSizeT()) + .IsValid()) { + static_assert( + 4294967295 == std::numeric_limits<wtf_size_t>::max(), + "Change the error message below if this static_assert fails."); + exception_state.ThrowRangeError( + "ArrayBuffer size exceeds the maximum supported size (4294967295)"); + return; + } messages_.push_back(MakeGarbageCollected<Message>(array_buffer)); HandleMessageQueue(); @@ -468,6 +477,16 @@ DCHECK(array_buffer_view); if (!CanSendMessage(exception_state)) return; + if (!base::CheckedNumeric<wtf_size_t>( + array_buffer_view.View()->byteLengthAsSizeT()) + .IsValid()) { + static_assert( + 4294967295 == std::numeric_limits<wtf_size_t>::max(), + "Change the error message below if this static_assert fails."); + exception_state.ThrowRangeError( + "ArrayBuffer size exceeds the maximum supported size (4294967295)"); + return; + } messages_.push_back( MakeGarbageCollected<Message>(array_buffer_view.View()->buffer())); @@ -629,7 +648,16 @@ DCHECK_EQ(messages_.front()->type, kMessageTypeBlob); DCHECK(buffer); DCHECK(buffer->Buffer()); - + if (!base::CheckedNumeric<wtf_size_t>(buffer->ByteLengthAsSizeT()) + .IsValid()) { + // TODO(crbug.com/1036565): generate error message? The problem is that the + // content of {buffer} is copied into a WTF::Vector, but a DOMArrayBuffer + // has a bigger maximum size than a WTF::Vector. Ignore the current failed + // blob item and continue with next items. + messages_.pop_front(); + blob_loader_.Clear(); + HandleMessageQueue(); + } // Send the loaded blob immediately here and continue processing the queue. SendMessageToTargetConnection(MakeBinaryMessage(buffer)); @@ -641,7 +669,7 @@ void PresentationConnection::DidFailLoadingBlob(FileErrorCode error_code) { DCHECK(!messages_.IsEmpty()); DCHECK_EQ(messages_.front()->type, kMessageTypeBlob); - // FIXME: generate error message? + // TODO(crbug.com/1036565): generate error message? // Ignore the current failed blob item and continue with next items. messages_.pop_front(); blob_loader_.Clear();
diff --git a/third_party/blink/renderer/modules/presentation/presentation_request.idl b/third_party/blink/renderer/modules/presentation/presentation_request.idl index 71c086c1..87f5b44 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_request.idl +++ b/third_party/blink/renderer/modules/presentation/presentation_request.idl
@@ -6,13 +6,12 @@ [ ActiveScriptWrappable, - MeasureAs=PresentationRequestConstructor, RuntimeEnabled=Presentation, SecureContext, Exposed=Window ] interface PresentationRequest : EventTarget { - [CallWith=ExecutionContext, RaisesException] constructor(USVString url); - [CallWith=ExecutionContext, RaisesException] constructor(sequence<USVString> urls); + [CallWith=ExecutionContext, RaisesException, MeasureAs=PresentationRequestConstructor] constructor(USVString url); + [CallWith=ExecutionContext, RaisesException, MeasureAs=PresentationRequestConstructor] constructor(sequence<USVString> urls); [CallWith=ScriptState, RaisesException, MeasureAs=PresentationRequestStart] Promise<PresentationConnection> start(); [CallWith=ScriptState, RaisesException, MeasureAs=PresentationRequestReconnect] Promise<PresentationConnection> reconnect(DOMString id); [CallWith=ScriptState, RaisesException, MeasureAs=PresentationRequestGetAvailability] Promise<PresentationAvailability> getAvailability();
diff --git a/third_party/blink/renderer/modules/quota/dom_error.idl b/third_party/blink/renderer/modules/quota/dom_error.idl index 9029bb2..768ac5d 100644 --- a/third_party/blink/renderer/modules/quota/dom_error.idl +++ b/third_party/blink/renderer/modules/quota/dom_error.idl
@@ -29,10 +29,8 @@ // https://dom.spec.whatwg.org/#domerror // FIXME: DOMError has been removed from the spec. crbug.com/460725 -[ - Measure -] interface DOMError { - constructor(DOMString name, optional DOMString message); +interface DOMError { + [Measure] constructor(DOMString name, optional DOMString message); [Measure] readonly attribute DOMString name; [Measure] readonly attribute DOMString message; };
diff --git a/third_party/blink/renderer/modules/sensor/absolute_orientation_sensor.idl b/third_party/blink/renderer/modules/sensor/absolute_orientation_sensor.idl index d68236b..8d00165 100644 --- a/third_party/blink/renderer/modules/sensor/absolute_orientation_sensor.idl +++ b/third_party/blink/renderer/modules/sensor/absolute_orientation_sensor.idl
@@ -7,8 +7,7 @@ [ SecureContext, - MeasureAs=AbsoluteOrientationSensorConstructor, Exposed=Window ] interface AbsoluteOrientationSensor : OrientationSensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=AbsoluteOrientationSensorConstructor] constructor(optional SpatialSensorOptions sensorOptions); };
diff --git a/third_party/blink/renderer/modules/sensor/accelerometer.idl b/third_party/blink/renderer/modules/sensor/accelerometer.idl index e2f40f2..fec8d8fe 100644 --- a/third_party/blink/renderer/modules/sensor/accelerometer.idl +++ b/third_party/blink/renderer/modules/sensor/accelerometer.idl
@@ -7,10 +7,9 @@ [ SecureContext, - MeasureAs=AccelerometerConstructor, Exposed=Window ] interface Accelerometer : Sensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=AccelerometerConstructor] constructor(optional SpatialSensorOptions sensorOptions); readonly attribute unrestricted double? x; readonly attribute unrestricted double? y; readonly attribute unrestricted double? z;
diff --git a/third_party/blink/renderer/modules/sensor/ambient_light_sensor.idl b/third_party/blink/renderer/modules/sensor/ambient_light_sensor.idl index 3cb8c02..b90cb7b 100644 --- a/third_party/blink/renderer/modules/sensor/ambient_light_sensor.idl +++ b/third_party/blink/renderer/modules/sensor/ambient_light_sensor.idl
@@ -8,9 +8,8 @@ [ RuntimeEnabled=SensorExtraClasses, SecureContext, - MeasureAs=AmbientLightSensorConstructor, Exposed=Window ] interface AmbientLightSensor : Sensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=AmbientLightSensorConstructor] constructor(optional SensorOptions sensorOptions); readonly attribute unrestricted double? illuminance; };
diff --git a/third_party/blink/renderer/modules/sensor/gyroscope.idl b/third_party/blink/renderer/modules/sensor/gyroscope.idl index 3a60305..13104c9 100644 --- a/third_party/blink/renderer/modules/sensor/gyroscope.idl +++ b/third_party/blink/renderer/modules/sensor/gyroscope.idl
@@ -7,10 +7,9 @@ [ SecureContext, - Exposed=Window, - MeasureAs=GyroscopeConstructor + Exposed=Window ] interface Gyroscope : Sensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=GyroscopeConstructor] constructor(optional SpatialSensorOptions sensorOptions); readonly attribute unrestricted double? x; readonly attribute unrestricted double? y; readonly attribute unrestricted double? z;
diff --git a/third_party/blink/renderer/modules/sensor/linear_acceleration_sensor.idl b/third_party/blink/renderer/modules/sensor/linear_acceleration_sensor.idl index 5a8e873..ce5d3b64 100644 --- a/third_party/blink/renderer/modules/sensor/linear_acceleration_sensor.idl +++ b/third_party/blink/renderer/modules/sensor/linear_acceleration_sensor.idl
@@ -7,8 +7,7 @@ [ SecureContext, - MeasureAs=LinearAccelerationSensorConstructor, Exposed=Window ] interface LinearAccelerationSensor : Accelerometer { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=LinearAccelerationSensorConstructor] constructor(optional SpatialSensorOptions sensorOptions); };
diff --git a/third_party/blink/renderer/modules/sensor/magnetometer.idl b/third_party/blink/renderer/modules/sensor/magnetometer.idl index 6f7d551..5a766c5 100644 --- a/third_party/blink/renderer/modules/sensor/magnetometer.idl +++ b/third_party/blink/renderer/modules/sensor/magnetometer.idl
@@ -8,10 +8,9 @@ [ Exposed=Window, RuntimeEnabled=SensorExtraClasses, - SecureContext, - MeasureAs=MagnetometerConstructor + SecureContext ] interface Magnetometer : Sensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=MagnetometerConstructor] constructor(optional SpatialSensorOptions sensorOptions); readonly attribute unrestricted double? x; readonly attribute unrestricted double? y; readonly attribute unrestricted double? z;
diff --git a/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.idl b/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.idl index 49e9ead..45e81a4f 100644 --- a/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.idl +++ b/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.idl
@@ -7,8 +7,7 @@ [ SecureContext, - MeasureAs=RelativeOrientationSensorConstructor, Exposed=Window ] interface RelativeOrientationSensor : OrientationSensor { - [CallWith=ExecutionContext, RaisesException] constructor(optional SpatialSensorOptions sensorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=RelativeOrientationSensorConstructor] constructor(optional SpatialSensorOptions sensorOptions); };
diff --git a/third_party/blink/renderer/modules/shapedetection/barcode_detector.idl b/third_party/blink/renderer/modules/shapedetection/barcode_detector.idl index c5ecf57..86cd51d6 100644 --- a/third_party/blink/renderer/modules/shapedetection/barcode_detector.idl +++ b/third_party/blink/renderer/modules/shapedetection/barcode_detector.idl
@@ -7,10 +7,9 @@ [ Exposed=(Window,Worker), SecureContext, - MeasureAs=ShapeDetection_BarcodeDetectorConstructor, RuntimeEnabled=ShapeDetection ] interface BarcodeDetector { - [CallWith=ExecutionContext, RaisesException] constructor(optional BarcodeDetectorOptions barcodeDetectorOptions); + [CallWith=ExecutionContext, RaisesException, MeasureAs=ShapeDetection_BarcodeDetectorConstructor] constructor(optional BarcodeDetectorOptions barcodeDetectorOptions); [CallWith=ScriptState] static Promise<sequence<BarcodeFormat>> getSupportedFormats(); [CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedBarcode>> detect(ImageBitmapSource image); };
diff --git a/third_party/blink/renderer/modules/shapedetection/face_detector.idl b/third_party/blink/renderer/modules/shapedetection/face_detector.idl index 2732177..7846321 100644 --- a/third_party/blink/renderer/modules/shapedetection/face_detector.idl +++ b/third_party/blink/renderer/modules/shapedetection/face_detector.idl
@@ -7,9 +7,8 @@ [ Exposed=(Window,Worker), SecureContext, - MeasureAs=ShapeDetection_FaceDetectorConstructor, RuntimeEnabled=ShapeDetection ] interface FaceDetector { - [CallWith=ExecutionContext] constructor(optional FaceDetectorOptions faceDetectorOptions); + [CallWith=ExecutionContext, MeasureAs=ShapeDetection_FaceDetectorConstructor] constructor(optional FaceDetectorOptions faceDetectorOptions); [CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image); };
diff --git a/third_party/blink/renderer/modules/shapedetection/text_detector.idl b/third_party/blink/renderer/modules/shapedetection/text_detector.idl index fd813c8..42f45c5 100644 --- a/third_party/blink/renderer/modules/shapedetection/text_detector.idl +++ b/third_party/blink/renderer/modules/shapedetection/text_detector.idl
@@ -7,9 +7,8 @@ [ Exposed=(Window,Worker), SecureContext, - MeasureAs=ShapeDetection_TextDetectorConstructor, RuntimeEnabled=ShapeDetection ] interface TextDetector { - [CallWith=ExecutionContext] constructor(); + [CallWith=ExecutionContext, MeasureAs=ShapeDetection_TextDetectorConstructor] constructor(); [CallWith=ScriptState, MeasureAs=ShapeDetectionAPI] Promise<sequence<DetectedText>> detect(ImageBitmapSource image); };
diff --git a/third_party/blink/renderer/modules/speech/speech_grammar.idl b/third_party/blink/renderer/modules/speech/speech_grammar.idl index 948885f3..bb8c993 100644 --- a/third_party/blink/renderer/modules/speech/speech_grammar.idl +++ b/third_party/blink/renderer/modules/speech/speech_grammar.idl
@@ -26,10 +26,9 @@ // https://w3c.github.io/speech-api/#speechgrammar [ - Measure, NoInterfaceObject ] interface SpeechGrammar { - constructor(); + [Measure] constructor(); [URL,CallWith=ScriptState] attribute DOMString src; attribute float weight; };
diff --git a/third_party/blink/renderer/modules/speech/speech_grammar_list.idl b/third_party/blink/renderer/modules/speech/speech_grammar_list.idl index f80f92e..44c2c43 100644 --- a/third_party/blink/renderer/modules/speech/speech_grammar_list.idl +++ b/third_party/blink/renderer/modules/speech/speech_grammar_list.idl
@@ -26,10 +26,9 @@ // https://w3c.github.io/speech-api/#speechgrammarlist [ - Measure, NoInterfaceObject ] interface SpeechGrammarList { - constructor(); + [Measure] constructor(); readonly attribute unsigned long length; [Measure] getter SpeechGrammar item(unsigned long index); [CallWith=ScriptState, Measure] void addFromUri(DOMString src, optional float weight);
diff --git a/third_party/blink/renderer/modules/speech/speech_recognition.idl b/third_party/blink/renderer/modules/speech/speech_recognition.idl index 7d0eeef..321fe39 100644 --- a/third_party/blink/renderer/modules/speech/speech_recognition.idl +++ b/third_party/blink/renderer/modules/speech/speech_recognition.idl
@@ -27,10 +27,9 @@ [ ActiveScriptWrappable, - Measure, NoInterfaceObject ] interface SpeechRecognition : EventTarget { - [CallWith=ExecutionContext] constructor(); + [CallWith=ExecutionContext, Measure] constructor(); // recognition parameters [Measure] attribute SpeechGrammarList grammars; attribute DOMString lang;
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl index 3f470a8..35607484 100644 --- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl +++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
@@ -25,10 +25,9 @@ // See https://webaudio.github.io/web-audio-api/#analysernode [ - Exposed=Window, - Measure + Exposed=Window ] interface AnalyserNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional AnalyserOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional AnalyserOptions options); [RaisesException=Setter] attribute unsigned long fftSize; readonly attribute unsigned long frequencyBinCount;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl index 11be73a..7491acde 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl +++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
@@ -28,10 +28,9 @@ // See https://webaudio.github.io/web-audio-api/#AudioBuffer [ - Exposed=Window, - Measure + Exposed=Window ] interface AudioBuffer { - [RaisesException] constructor(AudioBufferOptions options); + [RaisesException, Measure] constructor(AudioBufferOptions options); readonly attribute long length; // in sample-frames readonly attribute double duration; // in seconds readonly attribute float sampleRate; // in sample-frames per second
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.idl index e644690cc..38a0a36 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.idl +++ b/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.idl
@@ -27,10 +27,9 @@ // See https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode [ Exposed=Window, - ActiveScriptWrappable, - Measure + ActiveScriptWrappable ] interface AudioBufferSourceNode : AudioScheduledSourceNode { - [RaisesException] constructor(BaseAudioContext context, optional AudioBufferSourceOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional AudioBufferSourceOptions options); [RaisesException=Setter] attribute AudioBuffer? buffer; readonly attribute AudioParam playbackRate;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.idl b/third_party/blink/renderer/modules/webaudio/audio_context.idl index 86503e3a..d7a6f4b 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_context.idl +++ b/third_party/blink/renderer/modules/webaudio/audio_context.idl
@@ -33,10 +33,9 @@ // See https://webaudio.github.io/web-audio-api/#AudioContext [ Exposed=Window, - ActiveScriptWrappable, - Measure + ActiveScriptWrappable ] interface AudioContext : BaseAudioContext { - [CallWith=Document, RaisesException] constructor(optional AudioContextOptions contextOptions); + [CallWith=Document, RaisesException, Measure] constructor(optional AudioContextOptions contextOptions); [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendContext] Promise<void> suspend(); [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeContext] Promise<void> close(); [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeContext] Promise<void> resume();
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc index 72e7eb1..5a6dc3a4 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc
@@ -40,7 +40,13 @@ WorkerThread* thread) : WorkletGlobalScope(std::move(creation_params), thread->GetWorkerReportingProxy(), - thread) {} + thread) { + // Audio is prone to jank introduced by e.g. the garbage collector. Workers + // are generally put in a background mode (as they are non-visible). Audio is + // an exception here, requiring low-latency behavior similar to any visible + // state. + GetIsolate()->IsolateInForegroundNotification(); +} AudioWorkletGlobalScope::~AudioWorkletGlobalScope() = default;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.idl b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.idl index 0c99102..efe2b87e 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.idl +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.idl
@@ -6,10 +6,9 @@ [ Exposed=Window, - ActiveScriptWrappable, - MeasureAs=AudioWorkletNodeConstructor + ActiveScriptWrappable ] interface AudioWorkletNode : AudioNode { - [CallWith=ScriptState, RaisesException] constructor(BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options); + [CallWith=ScriptState, RaisesException, MeasureAs=AudioWorkletNodeConstructor] constructor(BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options); readonly attribute AudioParamMap parameters; readonly attribute MessagePort port; attribute EventHandler onprocessorerror;
diff --git a/third_party/blink/renderer/modules/webaudio/biquad_filter_node.idl b/third_party/blink/renderer/modules/webaudio/biquad_filter_node.idl index 6fd9ec3..a5628b5 100644 --- a/third_party/blink/renderer/modules/webaudio/biquad_filter_node.idl +++ b/third_party/blink/renderer/modules/webaudio/biquad_filter_node.idl
@@ -36,10 +36,9 @@ }; [ - Exposed=Window, - Measure + Exposed=Window ] interface BiquadFilterNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional BiquadFilterOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional BiquadFilterOptions options); attribute BiquadFilterType type; readonly attribute AudioParam frequency; // in Hertz
diff --git a/third_party/blink/renderer/modules/webaudio/channel_merger_node.idl b/third_party/blink/renderer/modules/webaudio/channel_merger_node.idl index c43093af..16e2b23 100644 --- a/third_party/blink/renderer/modules/webaudio/channel_merger_node.idl +++ b/third_party/blink/renderer/modules/webaudio/channel_merger_node.idl
@@ -28,8 +28,7 @@ // See https://webaudio.github.io/web-audio-api/#channelmergernode [ - Exposed=Window, - Measure + Exposed=Window ] interface ChannelMergerNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional ChannelMergerOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional ChannelMergerOptions options); };
diff --git a/third_party/blink/renderer/modules/webaudio/channel_splitter_node.idl b/third_party/blink/renderer/modules/webaudio/channel_splitter_node.idl index 7764685..34d42b7 100644 --- a/third_party/blink/renderer/modules/webaudio/channel_splitter_node.idl +++ b/third_party/blink/renderer/modules/webaudio/channel_splitter_node.idl
@@ -25,8 +25,7 @@ // See https://webaudio.github.io/web-audio-api/#channelsplitternode [ - Exposed=Window, - Measure + Exposed=Window ] interface ChannelSplitterNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional ChannelSplitterOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional ChannelSplitterOptions options); };
diff --git a/third_party/blink/renderer/modules/webaudio/constant_source_node.idl b/third_party/blink/renderer/modules/webaudio/constant_source_node.idl index 7f80264..4864e94 100644 --- a/third_party/blink/renderer/modules/webaudio/constant_source_node.idl +++ b/third_party/blink/renderer/modules/webaudio/constant_source_node.idl
@@ -5,9 +5,8 @@ // See https://webaudio.github.io/web-audio-api/#ConstantSourceNode [ Exposed=Window, - ActiveScriptWrappable, - Measure + ActiveScriptWrappable ] interface ConstantSourceNode : AudioScheduledSourceNode { - [RaisesException] constructor(BaseAudioContext context, optional ConstantSourceOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional ConstantSourceOptions options); readonly attribute AudioParam offset; };
diff --git a/third_party/blink/renderer/modules/webaudio/convolver_node.idl b/third_party/blink/renderer/modules/webaudio/convolver_node.idl index fb8e7f7f..b469bf0 100644 --- a/third_party/blink/renderer/modules/webaudio/convolver_node.idl +++ b/third_party/blink/renderer/modules/webaudio/convolver_node.idl
@@ -26,10 +26,9 @@ // A linear convolution effect // See https://webaudio.github.io/web-audio-api/#ConvolverNode [ - Exposed=Window, - Measure + Exposed=Window ] interface ConvolverNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional ConvolverOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional ConvolverOptions options); [RaisesException=Setter] attribute AudioBuffer? buffer; attribute boolean normalize; };
diff --git a/third_party/blink/renderer/modules/webaudio/delay_node.idl b/third_party/blink/renderer/modules/webaudio/delay_node.idl index 56443d3c..5e0b352 100644 --- a/third_party/blink/renderer/modules/webaudio/delay_node.idl +++ b/third_party/blink/renderer/modules/webaudio/delay_node.idl
@@ -25,9 +25,8 @@ // See https://webaudio.github.io/web-audio-api/#DelayNode [ - Exposed=Window, - Measure + Exposed=Window ] interface DelayNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional DelayOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional DelayOptions options); readonly attribute AudioParam delayTime; };
diff --git a/third_party/blink/renderer/modules/webaudio/dynamics_compressor_node.idl b/third_party/blink/renderer/modules/webaudio/dynamics_compressor_node.idl index 71110d04..2a0228f 100644 --- a/third_party/blink/renderer/modules/webaudio/dynamics_compressor_node.idl +++ b/third_party/blink/renderer/modules/webaudio/dynamics_compressor_node.idl
@@ -25,10 +25,9 @@ // See https://webaudio.github.io/web-audio-api/#dynamicscompressornode [ - Exposed=Window, - Measure + Exposed=Window ] interface DynamicsCompressorNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional DynamicsCompressorOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional DynamicsCompressorOptions options); readonly attribute AudioParam threshold; // in Decibels readonly attribute AudioParam knee; // in Decibels readonly attribute AudioParam ratio; // unit-less
diff --git a/third_party/blink/renderer/modules/webaudio/gain_node.idl b/third_party/blink/renderer/modules/webaudio/gain_node.idl index a77121e..4a93c48 100644 --- a/third_party/blink/renderer/modules/webaudio/gain_node.idl +++ b/third_party/blink/renderer/modules/webaudio/gain_node.idl
@@ -25,10 +25,9 @@ // See https://webaudio.github.io/web-audio-api/#gainnode [ - Exposed=Window, - Measure + Exposed=Window ] interface GainNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional GainOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional GainOptions options); // FIXME: eventually it will be interesting to remove the readonly restriction, but need to properly deal with thread safety here. readonly attribute AudioParam gain; };
diff --git a/third_party/blink/renderer/modules/webaudio/iir_filter_node.idl b/third_party/blink/renderer/modules/webaudio/iir_filter_node.idl index 16e02ac3..e39447cb 100644 --- a/third_party/blink/renderer/modules/webaudio/iir_filter_node.idl +++ b/third_party/blink/renderer/modules/webaudio/iir_filter_node.idl
@@ -4,10 +4,9 @@ // See https://webaudio.github.io/web-audio-api/#iirfilternode [ - Exposed=Window, - Measure + Exposed=Window ] interface IIRFilterNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, IIRFilterOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, IIRFilterOptions options); [RaisesException] void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
diff --git a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.idl b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.idl index a14ef36..1477fe6 100644 --- a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.idl +++ b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.idl
@@ -25,9 +25,8 @@ // See https://webaudio.github.io/web-audio-api/#mediaelementaudiosourcenode [ - Exposed=Window, - Measure + Exposed=Window ] interface MediaElementAudioSourceNode : AudioNode { - [RaisesException] constructor(AudioContext context, MediaElementAudioSourceOptions options); + [RaisesException, Measure] constructor(AudioContext context, MediaElementAudioSourceOptions options); [SameObject] readonly attribute HTMLMediaElement mediaElement; };
diff --git a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl index 5e2c1b5..4fc2a8c 100644 --- a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl +++ b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl
@@ -25,9 +25,8 @@ // See https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode [ - Exposed=Window, - Measure + Exposed=Window ] interface MediaStreamAudioDestinationNode : AudioNode { - [RaisesException] constructor(AudioContext context, optional AudioNodeOptions options); + [RaisesException, Measure] constructor(AudioContext context, optional AudioNodeOptions options); readonly attribute MediaStream stream; };
diff --git a/third_party/blink/renderer/modules/webaudio/media_stream_audio_source_node.idl b/third_party/blink/renderer/modules/webaudio/media_stream_audio_source_node.idl index 41066ae..c625691 100644 --- a/third_party/blink/renderer/modules/webaudio/media_stream_audio_source_node.idl +++ b/third_party/blink/renderer/modules/webaudio/media_stream_audio_source_node.idl
@@ -25,9 +25,8 @@ // See https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode [ - Measure, ActiveScriptWrappable ] interface MediaStreamAudioSourceNode : AudioNode { - [RaisesException] constructor(AudioContext context, MediaStreamAudioSourceOptions options); + [RaisesException, Measure] constructor(AudioContext context, MediaStreamAudioSourceOptions options); [SameObject, ImplementedAs=getMediaStream] readonly attribute MediaStream mediaStream; };
diff --git a/third_party/blink/renderer/modules/webaudio/offline_audio_context.idl b/third_party/blink/renderer/modules/webaudio/offline_audio_context.idl index 8dfd0ed..2aaba12 100644 --- a/third_party/blink/renderer/modules/webaudio/offline_audio_context.idl +++ b/third_party/blink/renderer/modules/webaudio/offline_audio_context.idl
@@ -25,11 +25,10 @@ // See https://webaudio.github.io/web-audio-api/#OfflineAudioContext [ - Exposed=Window, - Measure + Exposed=Window ] interface OfflineAudioContext : BaseAudioContext { - [CallWith=ExecutionContext, RaisesException] constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate); - [CallWith=ExecutionContext, RaisesException] constructor(OfflineAudioContextOptions options); + [CallWith=ExecutionContext, RaisesException, Measure] constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate); + [CallWith=ExecutionContext, RaisesException, Measure] constructor(OfflineAudioContextOptions options); // Offline rendering attribute EventHandler oncomplete; readonly attribute unsigned long length;
diff --git a/third_party/blink/renderer/modules/webaudio/oscillator_node.idl b/third_party/blink/renderer/modules/webaudio/oscillator_node.idl index e629f961..a5ca186 100644 --- a/third_party/blink/renderer/modules/webaudio/oscillator_node.idl +++ b/third_party/blink/renderer/modules/webaudio/oscillator_node.idl
@@ -34,10 +34,9 @@ // OscillatorNode is an audio generator of periodic waveforms. [ - Exposed=Window, - Measure + Exposed=Window ] interface OscillatorNode : AudioScheduledSourceNode { - [RaisesException] constructor(BaseAudioContext context, optional OscillatorOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional OscillatorOptions options); [RaisesException=Setter] attribute OscillatorType type;
diff --git a/third_party/blink/renderer/modules/webaudio/panner_node.idl b/third_party/blink/renderer/modules/webaudio/panner_node.idl index 47aa5352..fae1207 100644 --- a/third_party/blink/renderer/modules/webaudio/panner_node.idl +++ b/third_party/blink/renderer/modules/webaudio/panner_node.idl
@@ -36,10 +36,9 @@ }; [ - Exposed=Window, - Measure + Exposed=Window ] interface PannerNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional PannerOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional PannerOptions options); // Default model for stereo is equalpower. attribute PanningModelType panningModel;
diff --git a/third_party/blink/renderer/modules/webaudio/periodic_wave.idl b/third_party/blink/renderer/modules/webaudio/periodic_wave.idl index 640516c..90f38241 100644 --- a/third_party/blink/renderer/modules/webaudio/periodic_wave.idl +++ b/third_party/blink/renderer/modules/webaudio/periodic_wave.idl
@@ -26,8 +26,7 @@ // PeriodicWave represents a periodic audio waveform given by its Fourier coefficients. // See https://webaudio.github.io/web-audio-api/#periodicwave [ - Exposed=Window, - Measure + Exposed=Window ] interface PeriodicWave { - [RaisesException] constructor(BaseAudioContext context, optional PeriodicWaveOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional PeriodicWaveOptions options); };
diff --git a/third_party/blink/renderer/modules/webaudio/stereo_panner_node.idl b/third_party/blink/renderer/modules/webaudio/stereo_panner_node.idl index e7098f4..ebeb07f 100644 --- a/third_party/blink/renderer/modules/webaudio/stereo_panner_node.idl +++ b/third_party/blink/renderer/modules/webaudio/stereo_panner_node.idl
@@ -4,10 +4,9 @@ // See https://webaudio.github.io/web-audio-api/#stereopannernode [ - Exposed=Window, - Measure + Exposed=Window ] interface StereoPannerNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional StereoPannerOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional StereoPannerOptions options); readonly attribute AudioParam pan;
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl index c99982b..21da3dc 100644 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl +++ b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.idl
@@ -31,10 +31,9 @@ }; [ - Exposed=Window, - Measure + Exposed=Window ] interface WaveShaperNode : AudioNode { - [RaisesException] constructor(BaseAudioContext context, optional WaveShaperOptions options); + [RaisesException, Measure] constructor(BaseAudioContext context, optional WaveShaperOptions options); [RaisesException=Setter] attribute Float32Array? curve; attribute OverSampleType oversample; };
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc index 5364eb9..22b216c 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc
@@ -2180,12 +2180,8 @@ if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) return; GLuint data_length; - if (!base::CheckedNumeric<GLuint>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", - "provided data exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexImage2D", data, &data_length)) return; - } if (src_offset > data_length) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", "srcOffset is out of range"); @@ -2267,12 +2263,8 @@ if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) return; GLuint data_length; - if (!base::CheckedNumeric<GLuint>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", - "provided data exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexSubImage2D", data, &data_length)) return; - } if (src_offset > data_length) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", "srcOffset is out of range"); @@ -2336,12 +2328,8 @@ if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) return; GLuint data_length; - if (!base::CheckedNumeric<GLuint>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", - "provided data exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexImage3D", data, &data_length)) return; - } if (src_offset > data_length) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", "srcOffset is out of range"); @@ -2407,12 +2395,8 @@ if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) return; GLuint data_length; - if (!base::CheckedNumeric<GLuint>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", - "provided data exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexSubImage3D", data, &data_length)) return; - } if (src_offset > data_length) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", "srcOffset is out of range");
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index bb281df6..7cfd680 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -2185,12 +2185,8 @@ if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) return; GLsizei data_length; - if (!base::CheckedNumeric<GLsizei>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", - "src_length exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexImage2D", data, &data_length)) return; - } ContextGL()->CompressedTexImage2D(target, level, internalformat, width, height, border, data_length, data.View()->BaseAddressMaybeShared()); @@ -2212,12 +2208,8 @@ if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) return; GLsizei data_length; - if (!base::CheckedNumeric<GLsizei>(data.View()->byteLengthAsSizeT()) - .AssignIfValid(&data_length)) { - SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", - "src_length exceeds the maximum supported length"); + if (!ExtractDataLengthIfValid("compressedTexSubImage2D", data, &data_length)) return; - } ContextGL()->CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data_length, data.View()->BaseAddressMaybeShared());
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h index 976de54b..fd944fa 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
@@ -1511,6 +1511,21 @@ GLenum type, int64_t offset); + // Helper function to check if the byte length of {data} fits into an integer + // of type {T.} If so, the byte length is stored in {data_length}. + template <typename T> + bool ExtractDataLengthIfValid(const char* function_name, + MaybeShared<DOMArrayBufferView> data, + T* data_length) { + if (base::CheckedNumeric<T>(data.View()->byteLengthAsSizeT()) + .AssignIfValid(data_length)) { + return true; + } + SynthesizeGLError(GL_INVALID_VALUE, function_name, + "provided data exceeds the maximum supported length"); + return false; + } + // State updates and operations necessary before or at draw call time. virtual void OnBeforeDrawCall();
diff --git a/third_party/blink/renderer/modules/webgpu/BUILD.gn b/third_party/blink/renderer/modules/webgpu/BUILD.gn index e5c95a9..13e5ce0 100644 --- a/third_party/blink/renderer/modules/webgpu/BUILD.gn +++ b/third_party/blink/renderer/modules/webgpu/BUILD.gn
@@ -6,6 +6,8 @@ blink_modules_sources("webgpu") { sources = [ + "client_validation.cc", + "client_validation.h", "dawn_callback.h", "dawn_conversions.cc", "dawn_conversions.h",
diff --git a/third_party/blink/renderer/modules/webgpu/client_validation.cc b/third_party/blink/renderer/modules/webgpu/client_validation.cc new file mode 100644 index 0000000..aa46e4ba --- /dev/null +++ b/third_party/blink/renderer/modules/webgpu/client_validation.cc
@@ -0,0 +1,42 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/webgpu/client_validation.h" + +#include <dawn/webgpu.h> + +#include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_extent_3d_dict.h" +#include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_2d_dict.h" +#include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_3d_dict.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_texture_copy_view.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" + +namespace blink { + +bool ValidateCopySize(UnsignedLongSequenceOrGPUExtent3DDict& copy_size, + ExceptionState& exception_state) { + if (copy_size.IsUnsignedLongSequence() && + copy_size.GetAsUnsignedLongSequence().size() != 3) { + exception_state.ThrowRangeError("copySize length must be 3"); + return false; + } + return true; +} + +bool ValidateTextureCopyView(GPUTextureCopyView* texture_copy_view, + ExceptionState& exception_state) { + DCHECK(texture_copy_view); + + const UnsignedLongSequenceOrGPUOrigin3DDict origin = + texture_copy_view->origin(); + if (origin.IsUnsignedLongSequence() && + origin.GetAsUnsignedLongSequence().size() != 3) { + exception_state.ThrowRangeError( + "texture copy view origin length must be 3"); + return false; + } + return true; +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/client_validation.h b/third_party/blink/renderer/modules/webgpu/client_validation.h new file mode 100644 index 0000000..6da8833 --- /dev/null +++ b/third_party/blink/renderer/modules/webgpu/client_validation.h
@@ -0,0 +1,24 @@ +// 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 THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_CLIENT_VALIDATION_H_ +#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_CLIENT_VALIDATION_H_ + +#include <dawn/webgpu.h> + +// This file provides helpers for validating copy operation in WebGPU. + +namespace blink { + +class ExceptionState; +class GPUTextureCopyView; +class UnsignedLongSequenceOrGPUExtent3DDict; + +bool ValidateCopySize(UnsignedLongSequenceOrGPUExtent3DDict& copy_size, + ExceptionState& exception_state); +bool ValidateTextureCopyView(GPUTextureCopyView* texture_copy_view, + ExceptionState& exception_state); +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_CLIENT_VALIDATION_H_
diff --git a/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc b/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc index 875f99c..f3e8986 100644 --- a/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc +++ b/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc
@@ -11,6 +11,8 @@ #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_3d_dict.h" #include "third_party/blink/renderer/modules/webgpu/gpu_programmable_stage_descriptor.h" #include "third_party/blink/renderer/modules/webgpu/gpu_shader_module.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_texture.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_texture_copy_view.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { @@ -742,6 +744,20 @@ return dawn_origin; } +WGPUTextureCopyView AsDawnType(const GPUTextureCopyView* webgpu_view) { + DCHECK(webgpu_view); + DCHECK(webgpu_view->texture()); + + WGPUTextureCopyView dawn_view; + dawn_view.nextInChain = nullptr; + dawn_view.texture = webgpu_view->texture()->GetHandle(); + dawn_view.mipLevel = webgpu_view->mipLevel(); + dawn_view.arrayLayer = webgpu_view->arrayLayer(); + dawn_view.origin = AsDawnType(&webgpu_view->origin()); + + return dawn_view; +} + OwnedProgrammableStageDescriptor AsDawnType( const GPUProgrammableStageDescriptor* webgpu_stage) { DCHECK(webgpu_stage);
diff --git a/third_party/blink/renderer/modules/webgpu/dawn_conversions.h b/third_party/blink/renderer/modules/webgpu/dawn_conversions.h index 6fc8546..bff483d5 100644 --- a/third_party/blink/renderer/modules/webgpu/dawn_conversions.h +++ b/third_party/blink/renderer/modules/webgpu/dawn_conversions.h
@@ -22,6 +22,7 @@ class DoubleSequenceOrGPUColorDict; class GPUColorDict; class GPUProgrammableStageDescriptor; +class GPUTextureCopyView; class UnsignedLongSequenceOrGPUExtent3DDict; class UnsignedLongSequenceOrGPUOrigin3DDict; @@ -43,7 +44,7 @@ WGPUColor AsDawnType(const DoubleSequenceOrGPUColorDict*); WGPUExtent3D AsDawnType(const UnsignedLongSequenceOrGPUExtent3DDict*); WGPUOrigin3D AsDawnType(const UnsignedLongSequenceOrGPUOrigin3DDict*); - +WGPUTextureCopyView AsDawnType(const GPUTextureCopyView* webgpu_view); using OwnedProgrammableStageDescriptor = std::tuple<WGPUProgrammableStageDescriptor, std::unique_ptr<char[]>>; OwnedProgrammableStageDescriptor AsDawnType(
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc index 3d92ddf..1a3ca1af 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc
@@ -7,6 +7,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/double_sequence_or_gpu_color_dict.h" #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_extent_3d_dict.h" #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_3d_dict.h" +#include "third_party/blink/renderer/modules/webgpu/client_validation.h" #include "third_party/blink/renderer/modules/webgpu/dawn_conversions.h" #include "third_party/blink/renderer/modules/webgpu/gpu_buffer.h" #include "third_party/blink/renderer/modules/webgpu/gpu_buffer_copy_view.h" @@ -27,31 +28,6 @@ namespace blink { -bool ValidateCopySize(UnsignedLongSequenceOrGPUExtent3DDict& copy_size, - ExceptionState& exception_state) { - if (copy_size.IsUnsignedLongSequence() && - copy_size.GetAsUnsignedLongSequence().size() != 3) { - exception_state.ThrowRangeError("copySize length must be 3"); - return false; - } - return true; -} - -bool ValidateTextureCopyView(GPUTextureCopyView* texture_copy_view, - ExceptionState& exception_state) { - DCHECK(texture_copy_view); - - const UnsignedLongSequenceOrGPUOrigin3DDict origin = - texture_copy_view->origin(); - if (origin.IsUnsignedLongSequence() && - origin.GetAsUnsignedLongSequence().size() != 3) { - exception_state.ThrowRangeError( - "texture copy view origin length must be 3"); - return false; - } - return true; -} - WGPURenderPassColorAttachmentDescriptor AsDawnType( const GPURenderPassColorAttachmentDescriptor* webgpu_desc) { DCHECK(webgpu_desc); @@ -146,20 +122,6 @@ return dawn_view; } -WGPUTextureCopyView AsDawnType(const GPUTextureCopyView* webgpu_view) { - DCHECK(webgpu_view); - DCHECK(webgpu_view->texture()); - - WGPUTextureCopyView dawn_view; - dawn_view.nextInChain = nullptr; - dawn_view.texture = webgpu_view->texture()->GetHandle(); - dawn_view.mipLevel = webgpu_view->mipLevel(); - dawn_view.arrayLayer = webgpu_view->arrayLayer(); - dawn_view.origin = AsDawnType(&webgpu_view->origin()); - - return dawn_view; -} - WGPUCommandEncoderDescriptor AsDawnType( const GPUCommandEncoderDescriptor* webgpu_desc) { DCHECK(webgpu_desc);
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc index 77c042a..d74c90a 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc
@@ -8,17 +8,52 @@ #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_extent_3d_dict.h" #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_2d_dict.h" #include "third_party/blink/renderer/bindings/modules/v8/unsigned_long_sequence_or_gpu_origin_3d_dict.h" +#include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h" +#include "third_party/blink/renderer/modules/webgpu/client_validation.h" #include "third_party/blink/renderer/modules/webgpu/dawn_conversions.h" #include "third_party/blink/renderer/modules/webgpu/gpu_command_buffer.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_command_buffer_descriptor.h" #include "third_party/blink/renderer/modules/webgpu/gpu_device.h" #include "third_party/blink/renderer/modules/webgpu/gpu_fence.h" #include "third_party/blink/renderer/modules/webgpu/gpu_fence_descriptor.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_image_bitmap_copy_view.h" #include "third_party/blink/renderer/modules/webgpu/gpu_texture.h" #include "third_party/blink/renderer/modules/webgpu/gpu_texture_copy_view.h" +#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h" #include "third_party/blink/renderer/platform/heap/heap.h" namespace blink { +namespace { + +WGPUOrigin3D GPUOrigin2DToWGPUOrigin3D( + const UnsignedLongSequenceOrGPUOrigin2DDict* webgpu_origin) { + DCHECK(webgpu_origin); + + WGPUOrigin3D dawn_origin = {}; + + if (webgpu_origin->IsUnsignedLongSequence()) { + const Vector<uint32_t>& webgpu_origin_sequence = + webgpu_origin->GetAsUnsignedLongSequence(); + DCHECK_EQ(webgpu_origin_sequence.size(), 3UL); + dawn_origin.x = webgpu_origin_sequence[0]; + dawn_origin.y = webgpu_origin_sequence[1]; + dawn_origin.z = 0; + } else if (webgpu_origin->IsGPUOrigin2DDict()) { + const GPUOrigin2DDict* webgpu_origin_2d_dict = + webgpu_origin->GetAsGPUOrigin2DDict(); + dawn_origin.x = webgpu_origin_2d_dict->x(); + dawn_origin.y = webgpu_origin_2d_dict->y(); + dawn_origin.z = 0; + } else { + NOTREACHED(); + } + + return dawn_origin; +} + +} // anonymous namespace + GPUQueue::GPUQueue(GPUDevice* device, WGPUQueue queue) : DawnObject<WGPUQueue>(device, queue) {} @@ -66,12 +101,113 @@ GPUTextureCopyView* destination, UnsignedLongSequenceOrGPUExtent3DDict& copy_size, ExceptionState& exception_state) { - NOTIMPLEMENTED(); + if (!source->imageBitmap()) { + exception_state.ThrowTypeError("No valid imageBitmap"); + return; + } - // TODO(shaobo.yan@intel.com): Validate source copy size, format and dest copy - // size format - // TODO(shaobo.yan@intel.com): Implement sharing to staging texture path. - return; + // TODO(shaobo.yan@intel.com): only the same color format texture copy allowed + // now. Need to Explore compatible texture format copy. + if (!ValidateCopySize(copy_size, exception_state) || + !ValidateTextureCopyView(destination, exception_state)) { + return; + } + + scoped_refptr<StaticBitmapImage> image = source->imageBitmap()->BitmapImage(); + + // TODO(shaobo.yan@intel.com): Implement GPU copy path + if (image->IsTextureBacked()) { + NOTIMPLEMENTED(); + exception_state.ThrowTypeError( + "No support for texture backed imageBitmap yet."); + return; + } + + // TODO(shaobo.yan@intel.com) : Check that the destination GPUTexture has an + // appropriate format. Now only support texture format exactly the same. The + // compatible formats need to be defined in WebGPU spec. + + WGPUExtent3D dawn_copy_size = AsDawnType(©_size); + + // Extract imageBitmap attributes + WGPUOrigin3D origin_in_image_bitmap = + GPUOrigin2DToWGPUOrigin3D(&(source->origin())); + + // Validate origin value + if (static_cast<uint32_t>(image->width()) <= origin_in_image_bitmap.x || + static_cast<uint32_t>(image->height()) <= origin_in_image_bitmap.y) { + exception_state.ThrowRangeError( + "Copy origin is out of bounds of imageBitmap."); + return; + } + + // Validate the copy rect is inside the imageBitmap + if (image->width() - origin_in_image_bitmap.x < dawn_copy_size.width || + image->height() - origin_in_image_bitmap.y < dawn_copy_size.height) { + exception_state.ThrowRangeError( + "Copy rect is out of bounds of imageBitmap."); + return; + } + + // Prepare for uploading CPU data. + IntRect image_data_rect(origin_in_image_bitmap.x, origin_in_image_bitmap.y, + dawn_copy_size.width, dawn_copy_size.height); + const CanvasColorParams& color_params = + source->imageBitmap()->GetCanvasColorParams(); + WebGPUImageUploadSizeInfo info = + ComputeImageBitmapWebGPUUploadSizeInfo(image_data_rect, color_params); + + // Create a mapped buffer to receive image bitmap contents + WGPUBufferDescriptor buffer_desc; + buffer_desc.nextInChain = nullptr; + buffer_desc.label = nullptr; + buffer_desc.usage = WGPUBufferUsage_CopySrc; + buffer_desc.size = info.size_in_bytes; + + WGPUCreateBufferMappedResult result = + GetProcs().deviceCreateBufferMapped(device_->GetHandle(), &buffer_desc); + + if (!CopyBytesFromImageBitmapForWebGPU( + image, + base::span<uint8_t>(reinterpret_cast<uint8_t*>(result.data), + static_cast<size_t>(result.dataLength)), + image_data_rect, color_params)) { + exception_state.ThrowRangeError("Failed to copy image data"); + // Release the buffer. + GetProcs().bufferRelease(result.buffer); + return; + } + + GetProcs().bufferUnmap(result.buffer); + + // Start a B2T copy to move contents from buffer to destination texture + WGPUBufferCopyView dawn_intermediate; + dawn_intermediate.nextInChain = nullptr; + dawn_intermediate.buffer = result.buffer; + dawn_intermediate.offset = 0; + dawn_intermediate.rowPitch = info.wgpu_row_pitch; + dawn_intermediate.imageHeight = source->imageBitmap()->height(); + + WGPUTextureCopyView dawn_destination = AsDawnType(destination); + + WGPUCommandEncoderDescriptor encoder_desc = {}; + WGPUCommandEncoder encoder = GetProcs().deviceCreateCommandEncoder( + device_->GetHandle(), &encoder_desc); + GetProcs().commandEncoderCopyBufferToTexture( + encoder, &dawn_intermediate, &dawn_destination, &dawn_copy_size); + WGPUCommandBufferDescriptor dawn_desc_command = {}; + WGPUCommandBuffer commands = + GetProcs().commandEncoderFinish(encoder, &dawn_desc_command); + + // Don't need to add fence after this submit. Because if user want to use the + // texture to do copy or render, it will trigger another queue submit. Dawn + // will insert the necessary resource transitions. + GetProcs().queueSubmit(GetHandle(), 1, &commands); + + // Release intermediate resources. + GetProcs().commandBufferRelease(commands); + GetProcs().commandEncoderRelease(encoder); + GetProcs().bufferRelease(result.buffer); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.idl b/third_party/blink/renderer/modules/webgpu/gpu_queue.idl index fd6251e..417ab15 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.idl
@@ -11,4 +11,8 @@ GPUFence createFence(optional GPUFenceDescriptor descriptor = {}); void signal(GPUFence fence, unsigned long long signalValue); + [RaisesException] void copyImageBitmapToTexture( + GPUImageBitmapCopyView source, + GPUTextureCopyView destination, + GPUExtent3D copySize); };
diff --git a/third_party/blink/renderer/modules/websockets/websocket_stream.idl b/third_party/blink/renderer/modules/websockets/websocket_stream.idl index a6a4073..c7f7daa5 100644 --- a/third_party/blink/renderer/modules/websockets/websocket_stream.idl +++ b/third_party/blink/renderer/modules/websockets/websocket_stream.idl
@@ -7,10 +7,9 @@ [ Exposed=(Window,Worker), RuntimeEnabled=WebSocketStream, - ActiveScriptWrappable, - MeasureAs=WebSocketStreamConstructor + ActiveScriptWrappable ] interface WebSocketStream { - [CallWith=ScriptState, RaisesException] constructor(USVString url, optional WebSocketStreamOptions options); + [CallWith=ScriptState, RaisesException, MeasureAs=WebSocketStreamConstructor] constructor(USVString url, optional WebSocketStreamOptions options); readonly attribute USVString url; [CallWith=ScriptState] readonly attribute Promise<WebSocketConnection> connection; [CallWith=ScriptState] readonly attribute Promise<WebSocketCloseInfo> closed;
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_layer.idl b/third_party/blink/renderer/modules/xr/xr_webgl_layer.idl index accaea1..380da299 100644 --- a/third_party/blink/renderer/modules/xr/xr_webgl_layer.idl +++ b/third_party/blink/renderer/modules/xr/xr_webgl_layer.idl
@@ -8,10 +8,9 @@ [ SecureContext, Exposed=Window, - RuntimeEnabled=WebXR, - Measure + RuntimeEnabled=WebXR ] interface XRWebGLLayer { - [RaisesException] constructor(XRSession session, XRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); + [RaisesException, Measure] constructor(XRSession session, XRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); readonly attribute boolean antialias; readonly attribute boolean ignoreDepthValues;
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index 2dde69e09..d4e3b42 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -942,6 +942,8 @@ "graphics/gpu/shared_gpu_context.h", "graphics/gpu/webgl_image_conversion.cc", "graphics/gpu/webgl_image_conversion.h", + "graphics/gpu/webgpu_image_bitmap_handler.cc", + "graphics/gpu/webgpu_image_bitmap_handler.h", "graphics/gpu/webgpu_swap_buffer_provider.cc", "graphics/gpu/webgpu_swap_buffer_provider.h", "graphics/gpu/xr_frame_transport.cc", @@ -1822,6 +1824,7 @@ "graphics/gpu/drawing_buffer_test.cc", "graphics/gpu/shared_gpu_context_test.cc", "graphics/gpu/webgl_image_conversion_test.cc", + "graphics/gpu/webgpu_image_bitmap_handler_test.cc", "graphics/gpu/webgpu_swap_buffer_provider_test.cc", "graphics/graphics_context_test.cc", "graphics/lab_color_space_test.cc",
diff --git a/third_party/blink/renderer/platform/bindings/v8_interface_bridge.h b/third_party/blink/renderer/platform/bindings/v8_interface_bridge.h index 8d9f068..4ba91b1 100644 --- a/third_party/blink/renderer/platform/bindings/v8_interface_bridge.h +++ b/third_party/blink/renderer/platform/bindings/v8_interface_bridge.h
@@ -53,6 +53,18 @@ static T* ToBlinkUnsafe(v8::Local<v8::Object> receiver) { return ToScriptWrappable(receiver)->ToImpl<T>(); } + + // Migration adapter + static void InstallContextDependentAdapter( + v8::Local<v8::Context> context, + const DOMWrapperWorld& world, + v8::Local<v8::Object> instance_object, + v8::Local<v8::Object> prototype_object, + v8::Local<v8::Function> interface_object, + v8::Local<v8::FunctionTemplate> interface_template) { + V8T::InstallContextDependentProperties(context, world, instance_object, + prototype_object, interface_object); + } }; } // namespace bindings
diff --git a/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.cc b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.cc new file mode 100644 index 0000000..241c2c7 --- /dev/null +++ b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.cc
@@ -0,0 +1,82 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h" + +#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" + +namespace blink { + +namespace { +static constexpr uint64_t kDawnRowPitchAlignmentBits = 8; + +// Calculate row pitch for T2B/B2T copy +// TODO(shaobo.yan@intel.com): Using Dawn's constants once they are exposed +uint64_t AlignWebGPURowPitch(uint64_t bytesPerRow) { + return (((bytesPerRow - 1) >> kDawnRowPitchAlignmentBits) + 1) + << kDawnRowPitchAlignmentBits; +} + +} // anonymous namespace + +WebGPUImageUploadSizeInfo ComputeImageBitmapWebGPUUploadSizeInfo( + const IntRect& rect, + const CanvasColorParams& color_params) { + WebGPUImageUploadSizeInfo info; + uint64_t bytes_per_pixel = color_params.BytesPerPixel(); + + uint64_t row_pitch = AlignWebGPURowPitch(rect.Width() * bytes_per_pixel); + + // Currently, row pitch for buffer copy view in WebGPU is an uint32_t type + // value and the maximum value is std::numeric_limits<uint32_t>::max(). + DCHECK(row_pitch <= std::numeric_limits<uint32_t>::max()); + + info.wgpu_row_pitch = static_cast<uint32_t>(row_pitch); + info.size_in_bytes = row_pitch * rect.Height(); + + return info; +} + +bool CopyBytesFromImageBitmapForWebGPU(scoped_refptr<StaticBitmapImage> image, + base::span<uint8_t> dst, + const IntRect& rect, + const CanvasColorParams& color_params) { + DCHECK(image); + DCHECK_GT(dst.size(), static_cast<size_t>(0)); + DCHECK(image->width() - rect.X() >= rect.Width()); + DCHECK(image->height() - rect.Y() >= rect.Height()); + + WebGPUImageUploadSizeInfo wgpu_info = + ComputeImageBitmapWebGPUUploadSizeInfo(rect, color_params); + DCHECK_EQ(static_cast<uint64_t>(dst.size()), wgpu_info.size_in_bytes); + + // Prepare extract data from SkImage. + // TODO(shaobo.yan@intel.com): Make sure the data is in the correct format for + // copying to WebGPU + SkColorType color_type = + (color_params.GetSkColorType() == kRGBA_F16_SkColorType) + ? kRGBA_F16_SkColorType + : kRGBA_8888_SkColorType; + + // Read pixel request dst info. + SkImageInfo info = SkImageInfo::Make( + rect.Width(), rect.Height(), color_type, kUnpremul_SkAlphaType, + color_params.GetSkColorSpaceForSkSurfaces()); + + sk_sp<SkImage> sk_image = image->PaintImageForCurrentFrame().GetSkImage(); + + if (!sk_image) + return false; + + bool read_pixels_successful = sk_image->readPixels( + info, dst.data(), wgpu_info.wgpu_row_pitch, rect.X(), rect.Y()); + + if (!read_pixels_successful) { + return false; + } + + return true; +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h new file mode 100644 index 0000000..4f6c690 --- /dev/null +++ b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h
@@ -0,0 +1,32 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_ + +#include "base/containers/span.h" +#include "third_party/blink/renderer/platform/platform_export.h" +#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + +namespace blink { + +struct WebGPUImageUploadSizeInfo { + uint64_t size_in_bytes; + uint32_t wgpu_row_pitch; +}; + +class CanvasColorParams; +class IntRect; +class StaticBitmapImage; + +WebGPUImageUploadSizeInfo PLATFORM_EXPORT +ComputeImageBitmapWebGPUUploadSizeInfo(const IntRect& rect, + const CanvasColorParams& color_params); +bool PLATFORM_EXPORT +CopyBytesFromImageBitmapForWebGPU(scoped_refptr<StaticBitmapImage> image, + base::span<uint8_t> dst, + const IntRect& rect, + const CanvasColorParams& color_params); +} // namespace blink +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_
diff --git a/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler_test.cc b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler_test.cc new file mode 100644 index 0000000..f2c4766 --- /dev/null +++ b/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler_test.cc
@@ -0,0 +1,110 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h" + +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" + +namespace blink { + +static constexpr uint64_t kMaxArrayLength = 40000; + +class WebGPUImageBitmapHandlerTest : public testing::Test { + protected: + void SetUp() override {} + + void VerifyCopyBytesForWebGPU(uint64_t width, + uint64_t height, + SkImageInfo info, + CanvasColorParams param, + IntRect copyRect) { + const uint64_t content_length = width * height * param.BytesPerPixel(); + std::array<uint8_t, kMaxArrayLength> contents = {0}; + // Initialize contents. + for (size_t i = 0; i < content_length; ++i) { + contents[i] = i % std::numeric_limits<uint8_t>::max(); + } + + sk_sp<SkData> image_pixels = + SkData::MakeWithCopy(contents.data(), content_length); + scoped_refptr<StaticBitmapImage> image = + StaticBitmapImage::Create(std::move(image_pixels), info); + + WebGPUImageUploadSizeInfo wgpu_info = + ComputeImageBitmapWebGPUUploadSizeInfo(copyRect, param); + + const uint64_t result_length = wgpu_info.size_in_bytes; + std::array<uint8_t, kMaxArrayLength> results = {0}; + bool success = CopyBytesFromImageBitmapForWebGPU( + image, base::span<uint8_t>(results.data(), result_length), copyRect, + param); + ASSERT_EQ(success, true); + + // Compare content and results + uint32_t row_pitch = wgpu_info.wgpu_row_pitch; + uint32_t content_row_index = + (copyRect.Y() * width + copyRect.X()) * param.BytesPerPixel(); + uint32_t result_row_index = 0; + for (int i = 0; i < copyRect.Height(); ++i) { + EXPECT_EQ(0, + memcmp(&contents[content_row_index], &results[result_row_index], + copyRect.Width() * param.BytesPerPixel())); + content_row_index += width * param.BytesPerPixel(); + result_row_index += row_pitch; + } + } +}; + +// Test calculate size +TEST_F(WebGPUImageBitmapHandlerTest, VerifyGetWGPUResourceInfo) { + uint64_t imageWidth = 63; + uint64_t imageHeight = 1; + CanvasColorParams param(CanvasColorSpace::kSRGB, CanvasPixelFormat::kRGBA8, + OpacityMode::kNonOpaque); + + // Prebaked expected values. + uint32_t expected_row_pitch = 256; + uint64_t expected_size = 256; + + IntRect test_rect(0, 0, imageWidth, imageHeight); + WebGPUImageUploadSizeInfo info = + ComputeImageBitmapWebGPUUploadSizeInfo(test_rect, param); + ASSERT_EQ(expected_size, info.size_in_bytes); + ASSERT_EQ(expected_row_pitch, info.wgpu_row_pitch); +} + +// Copy full image bitmap test +TEST_F(WebGPUImageBitmapHandlerTest, VerifyCopyBytesFromImageBitmapForWebGPU) { + uint64_t imageWidth = 4; + uint64_t imageHeight = 2; + SkImageInfo info = SkImageInfo::Make( + imageWidth, imageHeight, SkColorType::kRGBA_8888_SkColorType, + SkAlphaType::kUnpremul_SkAlphaType, SkColorSpace::MakeSRGB()); + + IntRect image_data_rect(0, 0, imageWidth, imageHeight); + CanvasColorParams color_params(CanvasColorSpace::kSRGB, + CanvasPixelFormat::kRGBA8, + OpacityMode::kNonOpaque); + VerifyCopyBytesForWebGPU(imageWidth, imageHeight, info, color_params, + image_data_rect); +} + +// Copy sub image bitmap test +TEST_F(WebGPUImageBitmapHandlerTest, VerifyCopyBytesFromSubImageBitmap) { + uint64_t imageWidth = 63; + uint64_t imageHeight = 4; + SkImageInfo info = SkImageInfo::Make( + imageWidth, imageHeight, SkColorType::kRGBA_8888_SkColorType, + SkAlphaType::kUnpremul_SkAlphaType, SkColorSpace::MakeSRGB()); + + IntRect image_data_rect(2, 2, 60, 2); + CanvasColorParams color_params(CanvasColorSpace::kSRGB, + CanvasPixelFormat::kRGBA8, + OpacityMode::kNonOpaque); + VerifyCopyBytesForWebGPU(imageWidth, imageHeight, info, color_params, + image_data_rect); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator.h b/third_party/blink/renderer/platform/heap/heap_allocator.h index 9d150d78d..c1c3985 100644 --- a/third_party/blink/renderer/platform/heap/heap_allocator.h +++ b/third_party/blink/renderer/platform/heap/heap_allocator.h
@@ -126,8 +126,12 @@ static bool ExpandHashTableBacking(void*, size_t); static void TraceBackingStoreIfMarked(void* address) { - // Trace backing store elements only if backing store was marked. - if (HeapObjectHeader::FromPayload(address)->IsMarked()) { + // Trace backing store elements only if backing store was marked. The + // sweeper may be active on the backing store which requires atomic mark bit + // access. A precise filter is performed in + // MarkingVisitor::TraceMarkedBackingStore. + if (HeapObjectHeader::FromPayload(address) + ->IsMarked<HeapObjectHeader::AccessMode::kAtomic>()) { MarkingVisitor::TraceMarkedBackingStore(address); } }
diff --git a/third_party/blink/renderer/platform/heap/marking_visitor.cc b/third_party/blink/renderer/platform/heap/marking_visitor.cc index 8ed5a88..6082206b 100644 --- a/third_party/blink/renderer/platform/heap/marking_visitor.cc +++ b/third_party/blink/renderer/platform/heap/marking_visitor.cc
@@ -97,10 +97,16 @@ WeakCallback weak_callback, void* weak_callback_parameter) { RegisterBackingStoreReference(object_slot); + + // In case there's no object present, weakness processing is omitted. The GC + // relies on the fact that in such cases touching the weak data structure will + // strongify its references. if (!object) return; - RegisterWeakCallback(weak_callback, weak_callback_parameter); + // Register final weak processing of the backing store. + RegisterWeakCallback(weak_callback, weak_callback_parameter); + // Register ephemeron callbacks if necessary. if (weak_desc.callback) weak_table_worklist_.Push(weak_desc); }
diff --git a/third_party/blink/renderer/platform/heap/weakness_marking_test.cc b/third_party/blink/renderer/platform/heap/weakness_marking_test.cc index 2a8869b..4d8c1fb1 100644 --- a/third_party/blink/renderer/platform/heap/weakness_marking_test.cc +++ b/third_party/blink/renderer/platform/heap/weakness_marking_test.cc
@@ -198,6 +198,31 @@ EXPECT_NE(old_ephemeron_count, ephemeron_count); } +TEST_F(WeaknessMarkingTest, SwapIntoAlreadyProcessedWeakSet) { + // Regression test: https://crbug.com/1038623 + // + // Test ensures that an empty weak set that has already been marked sets up + // weakness callbacks. This is important as another backing may be swapped in + // at some point after marking it initially. + using WeakLinkedSet = HeapLinkedHashSet<WeakMember<IntegerObject>>; + Persistent<WeakLinkedSet> holder1(MakeGarbageCollected<WeakLinkedSet>()); + Persistent<WeakLinkedSet> holder2(MakeGarbageCollected<WeakLinkedSet>()); + holder1->insert(MakeGarbageCollected<IntegerObject>(1)); + IncrementalMarkingTestDriver driver(ThreadState::Current()); + driver.Start(); + driver.FinishSteps(); + holder1->Swap(*holder2.Get()); + driver.FinishGC(); +} + +TEST_F(WeaknessMarkingTest, EmptyEphemeronCollection) { + // Tests that an empty ephemeron collection does not crash in the GC when + // processing a non-existent backing store. + using Map = HeapHashMap<Member<IntegerObject>, WeakMember<IntegerObject>>; + Persistent<Map> map = MakeGarbageCollected<Map>(); + TestSupportingGC::PreciselyCollectGarbage(); +} + } // namespace weakness_marking_test } // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/cors/cors.cc b/third_party/blink/renderer/platform/loader/cors/cors.cc index a403a99..d82ae65 100644 --- a/third_party/blink/renderer/platform/loader/cors/cors.cc +++ b/third_party/blink/renderer/platform/loader/cors/cors.cc
@@ -392,7 +392,7 @@ const SecurityOrigin* initiator_origin, const SecurityOrigin* isolated_world_origin, network::mojom::RequestMode request_mode) { - if (network::IsNavigationRequestMode(request_mode) || + if (request_mode == network::mojom::RequestMode::kNavigate || request_mode == network::mojom::RequestMode::kNoCors) { return false; }
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.cc b/third_party/blink/renderer/platform/loader/fetch/resource.cc index a94e9665..6fe0c17 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource.cc
@@ -851,8 +851,6 @@ switch (new_mode) { case network::mojom::RequestMode::kNoCors: case network::mojom::RequestMode::kNavigate: - case network::mojom::RequestMode::kNavigateNestedFrame: - case network::mojom::RequestMode::kNavigateNestedObject: break; case network::mojom::RequestMode::kCors:
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 6f2d554..0e8b5e0 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1072,6 +1072,10 @@ status: "test", }, { + name: "ModuleSharedWorker", + status: "test", + }, + { name: "MojoJS", status: "test", },
diff --git a/third_party/blink/renderer/platform/scheduler/common/scheduling_policy.cc b/third_party/blink/renderer/platform/scheduler/common/scheduling_policy.cc index 24d577dd..08f58e5 100644 --- a/third_party/blink/renderer/platform/scheduler/common/scheduling_policy.cc +++ b/third_party/blink/renderer/platform/scheduler/common/scheduling_policy.cc
@@ -22,6 +22,7 @@ case Feature::kWebVR: case Feature::kWebXR: case Feature::kSharedWorker: + case Feature::kWebHID: return false; case Feature::kMainResourceHasCacheControlNoStore: case Feature::kMainResourceHasCacheControlNoCache:
diff --git a/third_party/blink/renderer/platform/wtf/hash_table.h b/third_party/blink/renderer/platform/wtf/hash_table.h index d198f512..541cbd6 100644 --- a/third_party/blink/renderer/platform/wtf/hash_table.h +++ b/third_party/blink/renderer/platform/wtf/hash_table.h
@@ -1989,6 +1989,14 @@ AsAtomicPtr(&table_)->store(tmp_table, std::memory_order_relaxed); Allocator::template BackingWriteBarrierForHashTable<HashTable>(table_); Allocator::template BackingWriteBarrierForHashTable<HashTable>(other.table_); + if (IsWeak<ValueType>::value) { + // Weak processing is omitted when no backing store is present. In case such + // an empty table is later on used it needs to be strongified. + if (table_) + Allocator::TraceBackingStoreIfMarked(table_); + if (other.table_) + Allocator::TraceBackingStoreIfMarked(other.table_); + } std::swap(table_size_, other.table_size_); std::swap(key_count_, other.key_count_); // std::swap does not work for bit fields.
diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set.h b/third_party/blink/renderer/platform/wtf/list_hash_set.h index 39fd2a0..062c6ac 100644 --- a/third_party/blink/renderer/platform/wtf/list_hash_set.h +++ b/third_party/blink/renderer/platform/wtf/list_hash_set.h
@@ -272,6 +272,55 @@ typename Allocator::AllocatorProvider allocator_provider_; }; +template <typename T> +class ListHashSetNodeBasePointer { + using NodeType = ListHashSetNodeBase<T>; + + public: + ListHashSetNodeBasePointer& operator=( + const ListHashSetNodeBasePointer& other) { + SetSafe(other); + return *this; + } + + template <typename U> + ListHashSetNodeBasePointer& operator=( + const ListHashSetNodeBasePointer<U>& other) { + SetSafe(other); + return *this; + } + + template <typename U> + ListHashSetNodeBasePointer& operator=(U* other) { + SetSafe(other); + return *this; + } + + ListHashSetNodeBasePointer& operator=(std::nullptr_t) { + SetSafe(nullptr); + return *this; + } + + NodeType* Get() const { return node_; } + explicit operator bool() const { return Get(); } + operator NodeType*() const { return Get(); } + NodeType* operator->() const { return Get(); } + NodeType& operator*() const { return *Get(); } + + private: + void SetSafe(NodeType* node) { + return AsAtomicPtr(&node_)->store(node, std::memory_order_relaxed); + } + NodeType* GetSafe() const { + return AsAtomicPtr(&node_)->load(std::memory_order_relaxed); + } + + NodeType* node_ = nullptr; + + template <typename ValueArg, typename AllocatorArg> + friend class ListHashSetNode; +}; + // ListHashSetNode has this base class to hold the members because the MSVC // compiler otherwise gets into circular template dependencies when trying to do // sizeof on a node. @@ -285,8 +334,8 @@ public: ValueArg value_; - ListHashSetNodeBase* prev_ = nullptr; - ListHashSetNodeBase* next_ = nullptr; + ListHashSetNodeBasePointer<ValueArg> prev_; + ListHashSetNodeBasePointer<ValueArg> next_; #if DCHECK_IS_ON() bool is_allocated_ = true; #endif @@ -463,15 +512,15 @@ if (WasAlreadyDestructed()) return; NodeAllocator::TraceValue(visitor, this); - visitor->Trace(Next()); - visitor->Trace(Prev()); + visitor->Trace(reinterpret_cast<ListHashSetNode*>(this->next_.GetSafe())); + visitor->Trace(reinterpret_cast<ListHashSetNode*>(this->prev_.GetSafe())); } ListHashSetNode* Next() const { - return reinterpret_cast<ListHashSetNode*>(this->next_); + return reinterpret_cast<ListHashSetNode*>(this->next_.Get()); } ListHashSetNode* Prev() const { - return reinterpret_cast<ListHashSetNode*>(this->prev_); + return reinterpret_cast<ListHashSetNode*>(this->prev_.Get()); } // Don't add fields here, the ListHashSetNodeBase and this should have the
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index 1dd36f1..96fc21d 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -2112,3 +2112,6 @@ [ Linux ] virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/content-index-origin-trial-interfaces.html [ Skip ] [ Mac ] virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/content-index-origin-trial-interfaces.html [ Skip ] crbug.com/626703 [ Win7 ] external/wpt/pointerevents/pointerevent_fractional_coordinates-manual.html [ Skip ] + +# These tests require a preferred dark color-scheme and are only run as virtual tests +external/wpt/css/css-color-adjust/rendering/dark-color-scheme/* [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 8241584..2fbe7b0 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3678,10 +3678,13 @@ crbug.com/1035708 external/wpt/css/css-pseudo/grammar-error-001.html [ Failure ] # ====== New tests from wpt-importer added here ====== -crbug.com/626703 [ Mac10.10 ] virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Timeout ] -crbug.com/626703 [ Retina ] virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/css/css-text-decor/text-decoration-subelements-002.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-text-decor/text-decoration-subelements-002.html [ Failure ] +crbug.com/626703 [ Win7 ] external/wpt/content-security-policy/object-src/object-src-no-url-allowed.html [ Timeout ] +crbug.com/626703 [ Win7 ] external/wpt/content-security-policy/plugin-types/plugintypes-nourl-allowed.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/css/css-text-decor/text-decoration-subelements-003.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-text-decor/text-decoration-subelements-003.html [ Failure ] crbug.com/626703 [ Mac10.11 ] virtual/cascade/external/wpt/css/css-paint-api/parse-input-arguments-018.https.html [ Failure ] -crbug.com/626703 [ Mac10.13 ] virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/infrastructure/reftest/reftest_match_and_mismatch-6.html [ Failure ] crbug.com/626703 [ Mac ] external/wpt/infrastructure/reftest/reftest_match_and_mismatch-6.html [ Failure ] crbug.com/626703 [ Win ] external/wpt/infrastructure/reftest/reftest_match_and_mismatch-6.html [ Failure ] @@ -7183,5 +7186,16 @@ crbug.com/963183 http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-1.js [ Pass Failure ] crbug.com/963183 http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-inline-with-sourceURL.js [ Pass Failure ] +crbug.com/1030086 external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html [ Pass Failure ] +crbug.com/1030086 external/wpt/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html [ Pass Failure ] + # Temporarily disabled to land Linkifier changes in DevTools crbug.com/963183 http/tests/devtools/jump-to-previous-editing-location.js [ Pass Failure ] + +# Temporarily disable to unblock WebRTC CL roll making it PASS a test +crbug.com/webrtc/11228 external/wpt/webrtc/RTCPeerConnection-mandatory-getStats.https.html [ Pass Failure ] +crbug.com/webrtc/11228 virtual/webrtc-wpt-plan-b/external/wpt/webrtc/RTCPeerConnection-mandatory-getStats.https.html [ Pass Failure ] + +# Sheriff 2020-01-08 +crbug.com/850170 virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Pass Timeout ] +crbug.com/1039643 [ Win ] external/wpt/content-security-policy/object-src/object-src-url-embed-allowed.html [ Pass Timeout ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 6b4c7b3..6dd11b6 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -532,6 +532,12 @@ "--enable-blink-features=ForcedColors"] }, { + "prefix": "dark-color-scheme", + "bases": ["external/wpt/css/css-color-adjust/rendering/dark-color-scheme"], + "args": ["--force-dark-mode", + "--enable-blink-features=CSSColorScheme"] + }, + { "prefix": "force-defer-script", "bases": ["defer-script"], "args": ["--enable-blink-features=ForceDeferScriptIntervention"]
diff --git a/third_party/blink/web_tests/WPTOverrideExpectations b/third_party/blink/web_tests/WPTOverrideExpectations index 0b74cf6..8996d5a54 100644 --- a/third_party/blink/web_tests/WPTOverrideExpectations +++ b/third_party/blink/web_tests/WPTOverrideExpectations
@@ -1007,9 +1007,8 @@ crbug.com/1030372 external/wpt/webdriver/tests/take_screenshot/iframe.py [ Failure ] # --- End triage from Dec.2 2019 -# This section is for all referrer-policy tests. There are lots and many of them are flaky, so we -# just blanket mark every single test as flaky. Since we don't include "Pass" as an expected status -# we can identify unexpected passes in waterfall runs. +# Referrer-policy tests had lots of refactoring going on recently. Tests below +# used to be flaky, but may not be anymore. Needs verification. external/wpt/referrer-policy/css-integration/child-css/external-import-stylesheet.html [ Failure Timeout ] external/wpt/referrer-policy/css-integration/child-css/internal-import-stylesheet.html [ Failure Timeout ] external/wpt/referrer-policy/css-integration/child-css/processing-instruction.html [ Failure Timeout ] @@ -1051,1594 +1050,3 @@ external/wpt/referrer-policy/generic/subresource-test/worker-messaging.html [ Failure Timeout ] external/wpt/referrer-policy/generic/subresource-test/xhr-messaging.html [ Failure Timeout ] external/wpt/referrer-policy/generic/unsupported-csp-referrer-directive.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer-when-downgrade/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/no-referrer/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/a-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/module-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/shared-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/worker-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/a-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/module-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/shared-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/worker-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/a-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/no-redirect/same-origin-upgrade.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/origin/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/fetch-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/module-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/shared-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/worker-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/xhr-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/a-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/img-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/script-tag/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/cross-origin.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/a-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/fetch-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/module-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/script-tag/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/shared-worker/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/worker-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/xhr-request/no-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/same-origin/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/same-origin-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/a-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/a-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/a-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/a-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/module-worker/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/shared-worker/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/worker-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/a-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/cross-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/a-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/module-worker/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/shared-worker/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/worker-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/no-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/same-insecure.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin-when-cross-origin/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/strict-origin/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/module-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/shared-worker/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/worker-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/a-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/fetch-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/img-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/script-tag/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/xhr-request/no-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unsafe-url/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/generic.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/attr-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/cross-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/fetch-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/fetch-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/fetch-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/iframe-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/iframe-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/iframe-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/img-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/module-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/module-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/script-tag/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/script-tag/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/script-tag/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/shared-worker/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/shared-worker/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/worker-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/worker-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/xhr-request/keep-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/xhr-request/no-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-http/xhr-request/swap-origin-redirect/insecure-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/a-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/fetch-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/fetch-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/fetch-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/iframe-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/iframe-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/iframe-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/img-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/img-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/img-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/script-tag/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/script-tag/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/script-tag/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/xhr-request/keep-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/xhr-request/no-redirect/upgrade-protocol.http.html [ Failure Timeout ] -external/wpt/referrer-policy/unset-referrer-policy/meta-referrer/same-origin/http-https/xhr-request/swap-origin-redirect/upgrade-protocol.http.html [ Failure Timeout ]
diff --git a/third_party/blink/web_tests/WebGPUExpectations b/third_party/blink/web_tests/WebGPUExpectations index 96c09f0..9094d7d5 100644 --- a/third_party/blink/web_tests/WebGPUExpectations +++ b/third_party/blink/web_tests/WebGPUExpectations
@@ -60,6 +60,9 @@ crbug.com/1014750 wpt_internal/webgpu/cts.html?worker=0&q=cts:validation/createView:it_is_invalid_to_use_a_texture_view_created_from_a_destroyed_texture= [ Failure ] crbug.com/1014750 wpt_internal/webgpu/cts.html?worker=1&q=cts:validation/createView:it_is_invalid_to_use_a_texture_view_created_from_a_destroyed_texture= [ Failure ] +crbug.com/966582 wpt_internal/webgpu/cts.html?worker=0&q=cts:copyImageBitmapToTexture: [ Failure ] +crbug.com/966582 wpt_internal/webgpu/cts.html?worker=1&q=cts:copyImageBitmapToTexture: [ Failure ] + # # Mac (Metal) specific #
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 578126c..bac8b7d 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
@@ -68647,6 +68647,42 @@ {} ] ], + "css/css-text-decor/text-decoration-subelements-001.html": [ + [ + "css/css-text-decor/text-decoration-subelements-001.html", + [ + [ + "/css/css-text-decor/reference/text-decoration-subelements-001-notref.html", + "!=" + ] + ], + {} + ] + ], + "css/css-text-decor/text-decoration-subelements-002.html": [ + [ + "css/css-text-decor/text-decoration-subelements-002.html", + [ + [ + "/css/css-text-decor/reference/text-decoration-subelements-002-ref.html", + "==" + ] + ], + {} + ] + ], + "css/css-text-decor/text-decoration-subelements-003.html": [ + [ + "css/css-text-decor/text-decoration-subelements-003.html", + [ + [ + "/css/css-text-decor/reference/text-decoration-subelements-003-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-text-decor/text-decoration-thickness-001.html": [ [ "css/css-text-decor/text-decoration-thickness-001.html", @@ -146268,6 +146304,15 @@ "css/css-text-decor/reference/text-decoration-style-recalc-ref.html": [ [] ], + "css/css-text-decor/reference/text-decoration-subelements-001-notref.html": [ + [] + ], + "css/css-text-decor/reference/text-decoration-subelements-002-ref.html": [ + [] + ], + "css/css-text-decor/reference/text-decoration-subelements-003-ref.html": [ + [] + ], "css/css-text-decor/reference/text-decoration-thickness-001-notref.html": [ [] ], @@ -182277,6 +182322,9 @@ "webgpu/suites/cts/command_buffer/render/storeop.spec.js": [ [] ], + "webgpu/suites/cts/copyImageBitmapToTexture.spec.js": [ + [] + ], "webgpu/suites/cts/examples.spec.js": [ [] ], @@ -184569,9 +184617,6 @@ "workers/constructors/SharedWorker/null": [ [] ], - "workers/constructors/SharedWorker/null-arguments-expected.txt": [ - [] - ], "workers/constructors/SharedWorker/null.headers": [ [] ], @@ -184920,9 +184965,6 @@ "workers/modules/resources/static-import-worker.js": [ [] ], - "workers/name-property-expected.txt": [ - [] - ], "workers/non-automated/application-cache-dedicated.html": [ [] ], @@ -185088,9 +185130,6 @@ "workers/semantics/xhr/support/006-1.js": [ [] ], - "workers/shared-worker-name-via-options-expected.txt": [ - [] - ], "workers/support/ErrorEvent-error.js": [ [] ], @@ -320616,6 +320655,10 @@ {} ], [ + "webgpu/cts.html?q=cts:copyImageBitmapToTexture:", + {} + ], + [ "webgpu/cts.html?q=cts:examples:", {} ], @@ -406190,6 +406233,18 @@ "30592b44cec51eb7f0835c7abc9aaafe7458ceff", "support" ], + "css/css-text-decor/reference/text-decoration-subelements-001-notref.html": [ + "9994674abeff3e644ac29afec64d1aece767ebdf", + "support" + ], + "css/css-text-decor/reference/text-decoration-subelements-002-ref.html": [ + "000a909ea58571bbd93c3826a3a66d72d499cc6c", + "support" + ], + "css/css-text-decor/reference/text-decoration-subelements-003-ref.html": [ + "5e229a9b72f65cc3863232a489ffe8dea17c8760", + "support" + ], "css/css-text-decor/reference/text-decoration-thickness-001-notref.html": [ "4e7db88ce5b41e28aa43fc339c35438855abb928", "support" @@ -406662,6 +406717,18 @@ "d4538e7c7b45356d08cf5dc90273b6aee77c49fa", "reftest" ], + "css/css-text-decor/text-decoration-subelements-001.html": [ + "d24749e66722aa6a627e5955f225327f729601f7", + "reftest" + ], + "css/css-text-decor/text-decoration-subelements-002.html": [ + "c3af8e62df553c10a27c0522fe619a56740eb729", + "reftest" + ], + "css/css-text-decor/text-decoration-subelements-003.html": [ + "4d808390703a70a935493f74014665bab982b139", + "reftest" + ], "css/css-text-decor/text-decoration-thickness-001.html": [ "8f314793f2634406c8ad5d3fa268bf56eb864406", "reftest" @@ -479547,7 +479614,7 @@ "testharness" ], "mediacapture-record/MediaRecorder-stop.html": [ - "5dd9aa637305f1ac65208b0e5f956831b8c22cb4", + "1cc18f4c854d368bf3508ade3bcfd3514ca409ec", "testharness" ], "mediacapture-record/OWNERS": [ @@ -527943,7 +528010,7 @@ "support" ], "webdriver/tests/take_screenshot/iframe.py": [ - "4cf8ad06b56d8f44af06550af4c4a1b7715b908b", + "66df6ec94935554340f916e4c2d9bb88012de1b5", "wdspec" ], "webdriver/tests/take_screenshot/screenshot.py": [ @@ -527959,7 +528026,7 @@ "support" ], "webgpu/cts.html": [ - "6099f7318f12dc784f4009f6e659df4247afba61", + "5c529e90401ce3523ab210739da616047c93c8eb", "testharness" ], "webgpu/framework/allowed_characters.js": [ @@ -528067,7 +528134,7 @@ "support" ], "webgpu/framework/version.js": [ - "9d1c0810c9d3c3dde6de9182c6aec0e12a5f70e7", + "8dd830276b92cd74c0a911ff5e328cbfb50e4463", "support" ], "webgpu/runtime/helper/options.js": [ @@ -528134,6 +528201,10 @@ "ae92995aa6b73eadd52b3342ff6737b91b413431", "support" ], + "webgpu/suites/cts/copyImageBitmapToTexture.spec.js": [ + "c9b07e83a81bad7b809c8b80f754ba3dbbe1f0e1", + "support" + ], "webgpu/suites/cts/examples.spec.js": [ "e57de1bfc8d9cf0c8d2264b77e68b56c6c2659f8", "support" @@ -528147,11 +528218,11 @@ "support" ], "webgpu/suites/cts/gpu_test.js": [ - "67429b9a2551628ab3c8623570dfdfb79104d385", + "cf52a6cacf82581d3d04aa28f01d057c8118957d", "support" ], "webgpu/suites/cts/index.js": [ - "9fb8395d5b52521d3bf392410fe7cd67c64afe03", + "e566792357a874aa3fb106479179c26c0357c188", "support" ], "webgpu/suites/cts/resource_init/sampled_texture_clear.spec.js": [ @@ -535274,10 +535345,6 @@ "5c38505b6c86594ad82fa87c701ba8e619299344", "support" ], - "workers/constructors/SharedWorker/null-arguments-expected.txt": [ - "7b56d68f76dd448ef1953ee9220a3c5e4b1c2deb", - "support" - ], "workers/constructors/SharedWorker/null-arguments.html": [ "c516eed21546c27bc36533a5dcaa8bbb5af893ea", "testharness" @@ -536122,10 +536189,6 @@ "48751dbe03bb0f7de23e26911ac7af5733c7d5f1", "support" ], - "workers/name-property-expected.txt": [ - "30d73f9b9d4b6e9a4e510d87a55f11f193eee631", - "support" - ], "workers/name-property.html": [ "ccc2a9de3a9c59acc19eefb247b1c92b78a52941", "testharness" @@ -536542,10 +536605,6 @@ "98e34cc3a69a17f31cf5b890744e5f9ca52559b5", "testharness" ], - "workers/shared-worker-name-via-options-expected.txt": [ - "f2bdb115de3cb52ff71816d0fc27dfd99900ab1d", - "support" - ], "workers/shared-worker-name-via-options.html": [ "1914d66db7489f6306c4365a4d7b7b9fb59fe00e", "testharness"
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-ref.html new file mode 100644 index 0000000..8cc4618 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-ref.html
@@ -0,0 +1,3 @@ +<!doctype html> +<title>CSS Test Reference</title> +<iframe width="600" height="400" src="support/dark-frame-ref.html"></iframe>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html new file mode 100644 index 0000000..ee0f006b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html
@@ -0,0 +1,6 @@ +<!doctype html> +<title>CSS Color Adjustment Test: Frames with a dark color-scheme should still be transparent</title> +<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-processing"> +<link rel="match" href="color-scheme-iframe-background-ref.html"> +<link rel="stylesheet" href="support/assert-preferred-dark.css"> +<iframe width="600" height="400" src="support/dark-frame.html"></iframe>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-root-background.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-root-background.html new file mode 100644 index 0000000..a636397 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-root-background.html
@@ -0,0 +1,15 @@ +<!doctype html> +<title>CSS Color Adjustment Test: color-scheme does not affect :root background</title> +<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-processing"> +<link rel="stylesheet" href="support/assert-preferred-dark.css"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + :root { color-scheme: dark } +</style> +<body></body> +<script> + test(() => { + assert_equals(getComputedStyle(document.documentElement).backgroundColor, "rgba(0, 0, 0, 0)"); + }, "Root element background should be transparent for dark color-scheme."); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/assert-preferred-dark.css b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/assert-preferred-dark.css new file mode 100644 index 0000000..73671b8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/assert-preferred-dark.css
@@ -0,0 +1,9 @@ +@media not all and (prefers-color-scheme: dark) { + :root { + background-color: red !important; + } + body::before { + font-size: 64px; + content: "Test must be run with preferred dark color scheme."; + } +}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-ref.html new file mode 100644 index 0000000..0975119f5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-ref.html
@@ -0,0 +1,5 @@ +<!doctype html> +<style> + p { color: green } +</style> +<p>This text should be green and the background should be the same as the top document.</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame.html new file mode 100644 index 0000000..11f88db --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame.html
@@ -0,0 +1,6 @@ +<!doctype html> +<style> + :root { color-scheme: dark } + p { color: green } +</style> +<p>This text should be green and the background should be the same as the top document.</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-001-notref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-001-notref.html new file mode 100644 index 0000000..9994674 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-001-notref.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Non-reference case for text-decoration with subelements</title> + <style> + p { + margin: 0; + padding: 1em; + } + div.wrapper { + font-size: 2em; + } + span, sub, sup { + text-decoration: underline; + } + </style> + </head> + <body> + <p>Test passes if there is a single uniform underline for all the text in each line, + <i>not</i> a separate underline for the superscripts: + </p> + <div class=wrapper> + <p><span>Einstein said that <i>e = mc<sup>2</sup></i>.</span></p> + <p><span>Is <i>a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup></i> ever true for <i>n</i> > 2?</span></p> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-002-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-002-ref.html new file mode 100644 index 0000000..000a909 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-002-ref.html
@@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Reference case for text-decoration with subelements</title> + <style> + div.wrapper { + font-size: 2em; + position: relative; + } + sup.baseline { + vertical-align: baseline; + } + .hide { + color: transparent; + } + div { + white-space: nowrap; + } + </style> + </head> + <body> + <p>Test passes if there is a single uniform underline for all the text in each line, + <i>not</i> a separate underline for the superscripts: + </p> + <div class=wrapper> + <div style="position: absolute; top: 1em;"> + <!-- We use position:absolute and overflow:hidden so that this element will be + shrink-wrapped to fit the width of its content, and clip the underline of + the descendant span to the width of this text. --> + <div style="position: absolute; overflow: hidden;">Einstein said that <i>e = mc<sup>2</sup></i>. + <div style="position: absolute; top: 0;"> + <!-- Generate a single continuous underline with the appropriate style + by underlining a span of transparent text; it will be too wide for the + actual test text, as we're not matching its mixture of font styles, + but then will be clipped to the shrink-wrap width of the abs-pos + containing block. --> + <span style="text-decoration: underline;"> + <span class=hide>Einstein said that e = mc2......</span></span> + <span class=hide><sup>2</sup></span><!-- to ensure baseline is consistent with testcase --> + </div> + </div> + </div> + <div style="position: absolute; top: 3em;"> + <div style="position: absolute; overflow: hidden;">Is <i>a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup></i> ever true for <i>n</i> > 2. + <div style="position: absolute; top: 0;"> + <span style="text-decoration: underline;"> + <span class=hide>Is an + bn = cn ever true for n > 2......</span></span> + <span class=hide><sup>n</sup></span><!-- to ensure baseline is consistent with testcase --> + </div> + </div> + </div> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-003-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-003-ref.html new file mode 100644 index 0000000..5e229a9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/reference/text-decoration-subelements-003-ref.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Reference case for text-decoration with subelements</title> + <style> + p { + margin: 0; + padding: 1em; + } + div.wrapper { + font-size: 2em; + } + div p { + position: absolute; + } + span.blue { + text-decoration: underline; + text-decoration: underline blue; + } + .hide { + color: transparent; + text-decoration: none; + } + sup.hide { + vertical-align: baseline; + } + sup.unhide { + color: initial; + text-decoration: underline; + text-decoration: underline green; + } + sup.strut { + color: transparent; + } + </style> + </head> + <body> + <p>Test passes if all the text below has a continuous blue underline, + and the raised word “underlined” has an <i>extra</i> green underline.</p> + <div class=wrapper> + <p style="position: absolute;"><span class=blue>All this text should be <sup class=hide>underlined</sup>.</span><sup class=strut>x</sup></p> + <p class=hide style="position: absolute;">All this text should be <sup class=unhide>underlined</sup>.</p> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-001.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-001.html new file mode 100644 index 0000000..d24749e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-001.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Test case for text-decoration with subelements</title> + <meta name="assert" content="for underlines and overlines the UA must use a single thickness and position on each line for the decorations deriving from a single decorating box"> + <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> + <link rel="author" title="Mozilla" href="https://www.mozilla.org"> + <link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-underline-position-property"> + <link rel="mismatch" href="reference/text-decoration-subelements-001-notref.html"> + <style> + p { + margin: 0; + padding: 1em; + } + div.wrapper { + font-size: 2em; + text-decoration: underline; + } + </style> + </head> + <body> + <p>Test passes if there is a single uniform underline for all the text in each line, + <i>not</i> a separate underline for the superscripts: + </p> + <div class=wrapper> + <p>Einstein said that <i>e = mc<sup>2</sup></i>.<br></p> + <p>Is <i>a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup></i> ever true for <i>n</i> > 2?</p> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-002.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-002.html new file mode 100644 index 0000000..c3af8e62d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-002.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Test case for text-decoration with subelements</title> + <meta name="assert" content="for underlines and overlines the UA must use a single thickness and position on each line for the decorations deriving from a single decorating box"> + <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> + <link rel="author" title="Mozilla" href="https://www.mozilla.org"> + <link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-underline-position-property"> + <link rel="match" href="reference/text-decoration-subelements-002-ref.html"> + <style> + div.wrapper { + font-size: 2em; + position: relative; + } + div.test { + text-decoration: underline; + position: absolute; + white-space: nowrap; + } + </style> + </head> + <body> + <p>Test passes if there is a single uniform underline for all the text in each line, + <i>not</i> a separate underline for the superscripts: + </p> + <div class=wrapper> + <div style="position: absolute; top: 1em;"> + <div class=test>Einstein said that <i>e = mc<sup>2</sup></i>.</div> + </div> + <div style="position: absolute; top: 3em;"> + <div class=test>Is <i>a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup></i> ever true for <i>n</i> > 2.</div> + </div> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-003.html b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-003.html new file mode 100644 index 0000000..4d80839 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text-decor/text-decoration-subelements-003.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Test case for text-decoration with subelements</title> + <meta name="assert" content="line decorations, if any, are added to the element"> + <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> + <link rel="author" title="Mozilla" href="https://www.mozilla.org"> + <link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-underline-position-property"> + <link rel="match" href="reference/text-decoration-subelements-003-ref.html"> + <style> + p { + margin: 0; + padding: 1em; + } + div.wrapper { + font-size: 2em; + text-decoration: underline; /* so browsers that don't accept the color will still show something */ + text-decoration: underline blue; + } + sup.test { + text-decoration: underline; + text-decoration: underline green; + } + </style> + </head> + <body> + <p>Test passes if all the text below has a continuous blue underline, + and the raised word “underlined” has an <i>extra</i> green underline.</p> + <div class=wrapper> + <p>All this text should be <sup class=test>underlined</sup>.</p> + </div> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/fetch/metadata/portal.tentative.https.sub.html b/third_party/blink/web_tests/external/wpt/fetch/metadata/portal.tentative.https.sub.html index 4e50b6b2..96067ae8 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/metadata/portal.tentative.https.sub.html +++ b/third_party/blink/web_tests/external/wpt/fetch/metadata/portal.tentative.https.sub.html
@@ -30,20 +30,20 @@ "site": "same-origin", "user": "", "mode": "navigate", - "dest": "document" + "dest": "iframe" }); create_test("{{hosts[][www]}}:{{ports[https][0]}}", { "site": "same-site", "user": "", "mode": "navigate", - "dest": "document" + "dest": "iframe" }); create_test("{{hosts[alt][www]}}:{{ports[https][0]}}", { "site": "cross-site", "user": "", "mode": "navigate", - "dest": "document" + "dest": "iframe" }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra-expected.txt b/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra-expected.txt deleted file mode 100644 index 72f317b..0000000 --- a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -FAIL Throwing name getter fails serialization assert_throws_exactly: function "() => { - worker.postMessage(badError); - }" did not throw -FAIL Errors sent across realms should preserve their type assert_equals: expected "TypeError" but got "Error" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structuredclone_0-expected.txt b/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structuredclone_0-expected.txt deleted file mode 100644 index 2cd6f08..0000000 --- a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structuredclone_0-expected.txt +++ /dev/null
@@ -1,44 +0,0 @@ -This is a testharness.js-based test. -PASS Primitive string is cloned -PASS Primitive integer is cloned -PASS Primitive floating point is cloned -PASS Primitive floating point (negative) is cloned -PASS Primitive number (hex) is cloned -PASS Primitive number (scientific) is cloned -PASS Primitive boolean is cloned -PASS Instance of Boolean is cloned -PASS Instance of Number is cloned -PASS Instance of String is cloned -PASS Instance of Date is cloned -PASS Instance of RegExp is cloned -PASS Value 'null' is cloned -PASS Value 'undefined' is cloned -PASS Object properties are cloned -PASS Prototype chains are not walked. -PASS Property descriptors of Objects are not cloned -PASS Cycles are preserved in Objects -PASS Identity of duplicates is preserved -PASS Property order is preserved -PASS Enumerable properties of Arrays are cloned -PASS Property descriptors of Arrays are not cloned -PASS Cycles are preserved in Arrays -PASS ImageData object can be cloned -PASS ImageData expandos are not cloned -PASS Window objects cannot be cloned -PASS Document objects cannot be cloned -PASS Empty Error objects can be cloned -PASS Error objects can be cloned -PASS EvalError objects can be cloned -PASS RangeError objects can be cloned -PASS ReferenceError objects can be cloned -PASS SyntaxError objects can be cloned -PASS TypeError objects can be cloned -PASS URIError objects can be cloned -FAIL URIError objects from other realms are treated as URIError assert_equals: Checking prototype expected object "URIError" but got object "Error" -FAIL Cloning a modified Error assert_equals: Checking prototype expected object "TypeError" but got object "SyntaxError" -PASS Error.message: getter is ignored when cloning -PASS Error.message: undefined property is stringified -PASS DOMException objects can be cloned -PASS DOMException objects created by the UA can be cloned -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/resources/chromium/nfc-mock.js b/third_party/blink/web_tests/external/wpt/resources/chromium/nfc-mock.js index 5cac21b..be86ded 100644 --- a/third_party/blink/web_tests/external/wpt/resources/chromium/nfc-mock.js +++ b/third_party/blink/web_tests/external/wpt/resources/chromium/nfc-mock.js
@@ -145,8 +145,11 @@ } function createNDEFError(type) { - return { error: type ? - new device.mojom.NDEFError({ errorType: type }) : null }; + return { + error: type ? + new device.mojom.NDEFError({errorType: type, errorMessage: ''}) : + null + }; } var WebNFCTest = (() => { @@ -357,7 +360,10 @@ simulateNonNDEFTagDiscovered() { // Notify NotSupportedError to all active readers. if (this.watchers_.length != 0) { - this.client_.onError(device.mojom.NDEFErrorType.NOT_SUPPORTED); + this.client_.onError(new device.mojom.NDEFError({ + errorType: device.mojom.NDEFErrorType.NOT_SUPPORTED, + errorMessage: '' + })); } // Reject the pending push with NotSupportedError. if (this.pending_promise_func_) {
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any-expected.txt deleted file mode 100644 index bd75d678..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -This is a testharness.js-based test. -PASS WritableStream.prototype.locked enforces a brand check -PASS WritableStream.prototype.abort enforces a brand check -FAIL WritableStream.prototype.close enforces a brand check Cannot read property 'apply' of undefined -PASS WritableStream.prototype.getWriter enforces a brand check -PASS WritableStreamDefaultWriter constructor enforces a brand check -PASS WritableStreamDefaultWriter.prototype.desiredSize enforces a brand check -PASS WritableStreamDefaultWriter.prototype.closed enforces a brand check -PASS WritableStreamDefaultWriter.prototype.ready enforces a brand check -PASS WritableStreamDefaultWriter.prototype.abort enforces a brand check -PASS WritableStreamDefaultWriter.prototype.write enforces a brand check -PASS WritableStreamDefaultWriter.prototype.close enforces a brand check -PASS WritableStreamDefaultWriter.prototype.releaseLock enforces a brand check -PASS WritableStreamDefaultController.prototype.error enforces a brand check -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.serviceworker-expected.txt deleted file mode 100644 index bd75d678..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.serviceworker-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -This is a testharness.js-based test. -PASS WritableStream.prototype.locked enforces a brand check -PASS WritableStream.prototype.abort enforces a brand check -FAIL WritableStream.prototype.close enforces a brand check Cannot read property 'apply' of undefined -PASS WritableStream.prototype.getWriter enforces a brand check -PASS WritableStreamDefaultWriter constructor enforces a brand check -PASS WritableStreamDefaultWriter.prototype.desiredSize enforces a brand check -PASS WritableStreamDefaultWriter.prototype.closed enforces a brand check -PASS WritableStreamDefaultWriter.prototype.ready enforces a brand check -PASS WritableStreamDefaultWriter.prototype.abort enforces a brand check -PASS WritableStreamDefaultWriter.prototype.write enforces a brand check -PASS WritableStreamDefaultWriter.prototype.close enforces a brand check -PASS WritableStreamDefaultWriter.prototype.releaseLock enforces a brand check -PASS WritableStreamDefaultController.prototype.error enforces a brand check -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.sharedworker-expected.txt deleted file mode 100644 index bd75d678..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.sharedworker-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -This is a testharness.js-based test. -PASS WritableStream.prototype.locked enforces a brand check -PASS WritableStream.prototype.abort enforces a brand check -FAIL WritableStream.prototype.close enforces a brand check Cannot read property 'apply' of undefined -PASS WritableStream.prototype.getWriter enforces a brand check -PASS WritableStreamDefaultWriter constructor enforces a brand check -PASS WritableStreamDefaultWriter.prototype.desiredSize enforces a brand check -PASS WritableStreamDefaultWriter.prototype.closed enforces a brand check -PASS WritableStreamDefaultWriter.prototype.ready enforces a brand check -PASS WritableStreamDefaultWriter.prototype.abort enforces a brand check -PASS WritableStreamDefaultWriter.prototype.write enforces a brand check -PASS WritableStreamDefaultWriter.prototype.close enforces a brand check -PASS WritableStreamDefaultWriter.prototype.releaseLock enforces a brand check -PASS WritableStreamDefaultController.prototype.error enforces a brand check -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.worker-expected.txt deleted file mode 100644 index bd75d678..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/brand-checks.any.worker-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -This is a testharness.js-based test. -PASS WritableStream.prototype.locked enforces a brand check -PASS WritableStream.prototype.abort enforces a brand check -FAIL WritableStream.prototype.close enforces a brand check Cannot read property 'apply' of undefined -PASS WritableStream.prototype.getWriter enforces a brand check -PASS WritableStreamDefaultWriter constructor enforces a brand check -PASS WritableStreamDefaultWriter.prototype.desiredSize enforces a brand check -PASS WritableStreamDefaultWriter.prototype.closed enforces a brand check -PASS WritableStreamDefaultWriter.prototype.ready enforces a brand check -PASS WritableStreamDefaultWriter.prototype.abort enforces a brand check -PASS WritableStreamDefaultWriter.prototype.write enforces a brand check -PASS WritableStreamDefaultWriter.prototype.close enforces a brand check -PASS WritableStreamDefaultWriter.prototype.releaseLock enforces a brand check -PASS WritableStreamDefaultController.prototype.error enforces a brand check -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any-expected.txt deleted file mode 100644 index 1ec4c49..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -This is a testharness.js-based test. -PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value -PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored -PASS when sink calls error synchronously while closing, the stream should not become errored -PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close -PASS releaseLock on a stream with a pending write in which the stream has been errored -PASS releaseLock on a stream with a pending close in which controller.error() was called -PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise -PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled -PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time -PASS returning a thenable from close() should work -PASS releaseLock() should not change the result of sync close() -PASS releaseLock() should not change the result of async close() -PASS close() should set state to CLOSED even if writer has detached -PASS the promise returned by async abort during close should resolve -PASS promises must fulfill/reject in the expected order on closure -PASS promises must fulfill/reject in the expected order on aborted closure -PASS promises must fulfill/reject in the expected order on aborted and errored closure -PASS close() should not reject until no sink methods are in flight -PASS ready promise should be initialised as fulfilled for a writer on a closed stream -FAIL close() on a writable stream should work ws.close is not a function -FAIL close() on a locked stream should reject ws.close is not a function -FAIL close() on an erroring stream should reject ws.close is not a function -FAIL close() on an errored stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on an closed stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on a stream with a pending close should reject ws.close is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.serviceworker-expected.txt deleted file mode 100644 index 1ec4c49..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.serviceworker-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -This is a testharness.js-based test. -PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value -PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored -PASS when sink calls error synchronously while closing, the stream should not become errored -PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close -PASS releaseLock on a stream with a pending write in which the stream has been errored -PASS releaseLock on a stream with a pending close in which controller.error() was called -PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise -PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled -PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time -PASS returning a thenable from close() should work -PASS releaseLock() should not change the result of sync close() -PASS releaseLock() should not change the result of async close() -PASS close() should set state to CLOSED even if writer has detached -PASS the promise returned by async abort during close should resolve -PASS promises must fulfill/reject in the expected order on closure -PASS promises must fulfill/reject in the expected order on aborted closure -PASS promises must fulfill/reject in the expected order on aborted and errored closure -PASS close() should not reject until no sink methods are in flight -PASS ready promise should be initialised as fulfilled for a writer on a closed stream -FAIL close() on a writable stream should work ws.close is not a function -FAIL close() on a locked stream should reject ws.close is not a function -FAIL close() on an erroring stream should reject ws.close is not a function -FAIL close() on an errored stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on an closed stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on a stream with a pending close should reject ws.close is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.sharedworker-expected.txt deleted file mode 100644 index 1ec4c49..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.sharedworker-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -This is a testharness.js-based test. -PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value -PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored -PASS when sink calls error synchronously while closing, the stream should not become errored -PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close -PASS releaseLock on a stream with a pending write in which the stream has been errored -PASS releaseLock on a stream with a pending close in which controller.error() was called -PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise -PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled -PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time -PASS returning a thenable from close() should work -PASS releaseLock() should not change the result of sync close() -PASS releaseLock() should not change the result of async close() -PASS close() should set state to CLOSED even if writer has detached -PASS the promise returned by async abort during close should resolve -PASS promises must fulfill/reject in the expected order on closure -PASS promises must fulfill/reject in the expected order on aborted closure -PASS promises must fulfill/reject in the expected order on aborted and errored closure -PASS close() should not reject until no sink methods are in flight -PASS ready promise should be initialised as fulfilled for a writer on a closed stream -FAIL close() on a writable stream should work ws.close is not a function -FAIL close() on a locked stream should reject ws.close is not a function -FAIL close() on an erroring stream should reject ws.close is not a function -FAIL close() on an errored stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on an closed stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on a stream with a pending close should reject ws.close is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.worker-expected.txt deleted file mode 100644 index 1ec4c49..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/close.any.worker-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -This is a testharness.js-based test. -PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value -PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored -PASS when sink calls error synchronously while closing, the stream should not become errored -PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close -PASS releaseLock on a stream with a pending write in which the stream has been errored -PASS releaseLock on a stream with a pending close in which controller.error() was called -PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise -PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled -PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time -PASS returning a thenable from close() should work -PASS releaseLock() should not change the result of sync close() -PASS releaseLock() should not change the result of async close() -PASS close() should set state to CLOSED even if writer has detached -PASS the promise returned by async abort during close should resolve -PASS promises must fulfill/reject in the expected order on closure -PASS promises must fulfill/reject in the expected order on aborted closure -PASS promises must fulfill/reject in the expected order on aborted and errored closure -PASS close() should not reject until no sink methods are in flight -PASS ready promise should be initialised as fulfilled for a writer on a closed stream -FAIL close() on a writable stream should work ws.close is not a function -FAIL close() on a locked stream should reject ws.close is not a function -FAIL close() on an erroring stream should reject ws.close is not a function -FAIL close() on an errored stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on an closed stream should reject promise_test: Unhandled rejection with value: object "TypeError: ws.close is not a function" -FAIL close() on a stream with a pending close should reject ws.close is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any-expected.txt index 8a7f4cb..0f5ae37 100644 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any-expected.txt
@@ -7,11 +7,11 @@ PASS WritableStream.prototype.locked should be a getter PASS WritableStream.prototype.abort should have standard properties FAIL WritableStream.prototype.abort should be a method assert_equals: abort should take 1 arguments expected 1 but got 0 -FAIL WritableStream.prototype.close should have standard properties Cannot destructure property 'configurable' of 'descriptor' as it is undefined. -FAIL WritableStream.prototype.close should be a method Cannot read property 'writable' of undefined +PASS WritableStream.prototype.close should have standard properties +PASS WritableStream.prototype.close should be a method PASS WritableStream.prototype.getWriter should have standard properties PASS WritableStream.prototype.getWriter should be a method -FAIL WritableStream.prototype should have exactly the expected properties assert_array_equals: WritableStream properties should match expected properties lengths differ, expected 5 got 4 +PASS WritableStream.prototype should have exactly the expected properties PASS WritableStreamDefaultController.prototype.constructor should have standard properties PASS WritableStreamDefaultController.prototype.constructor should be a constructor PASS WritableStreamDefaultController.prototype.error should have standard properties
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.serviceworker-expected.txt index 8a7f4cb..0f5ae37 100644 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.serviceworker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.serviceworker-expected.txt
@@ -7,11 +7,11 @@ PASS WritableStream.prototype.locked should be a getter PASS WritableStream.prototype.abort should have standard properties FAIL WritableStream.prototype.abort should be a method assert_equals: abort should take 1 arguments expected 1 but got 0 -FAIL WritableStream.prototype.close should have standard properties Cannot destructure property 'configurable' of 'descriptor' as it is undefined. -FAIL WritableStream.prototype.close should be a method Cannot read property 'writable' of undefined +PASS WritableStream.prototype.close should have standard properties +PASS WritableStream.prototype.close should be a method PASS WritableStream.prototype.getWriter should have standard properties PASS WritableStream.prototype.getWriter should be a method -FAIL WritableStream.prototype should have exactly the expected properties assert_array_equals: WritableStream properties should match expected properties lengths differ, expected 5 got 4 +PASS WritableStream.prototype should have exactly the expected properties PASS WritableStreamDefaultController.prototype.constructor should have standard properties PASS WritableStreamDefaultController.prototype.constructor should be a constructor PASS WritableStreamDefaultController.prototype.error should have standard properties
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.sharedworker-expected.txt index 8a7f4cb..0f5ae37 100644 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.sharedworker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.sharedworker-expected.txt
@@ -7,11 +7,11 @@ PASS WritableStream.prototype.locked should be a getter PASS WritableStream.prototype.abort should have standard properties FAIL WritableStream.prototype.abort should be a method assert_equals: abort should take 1 arguments expected 1 but got 0 -FAIL WritableStream.prototype.close should have standard properties Cannot destructure property 'configurable' of 'descriptor' as it is undefined. -FAIL WritableStream.prototype.close should be a method Cannot read property 'writable' of undefined +PASS WritableStream.prototype.close should have standard properties +PASS WritableStream.prototype.close should be a method PASS WritableStream.prototype.getWriter should have standard properties PASS WritableStream.prototype.getWriter should be a method -FAIL WritableStream.prototype should have exactly the expected properties assert_array_equals: WritableStream properties should match expected properties lengths differ, expected 5 got 4 +PASS WritableStream.prototype should have exactly the expected properties PASS WritableStreamDefaultController.prototype.constructor should have standard properties PASS WritableStreamDefaultController.prototype.constructor should be a constructor PASS WritableStreamDefaultController.prototype.error should have standard properties
diff --git a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.worker-expected.txt index 8a7f4cb..0f5ae37 100644 --- a/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.worker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/writable-streams/properties.any.worker-expected.txt
@@ -7,11 +7,11 @@ PASS WritableStream.prototype.locked should be a getter PASS WritableStream.prototype.abort should have standard properties FAIL WritableStream.prototype.abort should be a method assert_equals: abort should take 1 arguments expected 1 but got 0 -FAIL WritableStream.prototype.close should have standard properties Cannot destructure property 'configurable' of 'descriptor' as it is undefined. -FAIL WritableStream.prototype.close should be a method Cannot read property 'writable' of undefined +PASS WritableStream.prototype.close should have standard properties +PASS WritableStream.prototype.close should be a method PASS WritableStream.prototype.getWriter should have standard properties PASS WritableStream.prototype.getWriter should be a method -FAIL WritableStream.prototype should have exactly the expected properties assert_array_equals: WritableStream properties should match expected properties lengths differ, expected 5 got 4 +PASS WritableStream.prototype should have exactly the expected properties PASS WritableStreamDefaultController.prototype.constructor should have standard properties PASS WritableStreamDefaultController.prototype.constructor should be a constructor PASS WritableStreamDefaultController.prototype.error should have standard properties
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html index 8608bcc..a78b3db 100644 --- a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html +++ b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html
@@ -224,4 +224,18 @@ p.createURL(INPUTS.URL); }); }, "createScriptURL defined - calling undefined callbacks throws"); + + test(t => { + let p = window.trustedTypes.createPolicy('TestPolicyScriptURL10', { + createHTML: createHTMLJSWithThreeArguments, + createScript: createScriptJSWithThreeArguments, + createScriptURL: createScriptURLJSWithThreeArguments + }); + assert_equals("abc", p.createHTML("a", "b", "c").toString()); + assert_equals("abc", p.createScript("a", "b", "c").toString()); + assert_equals("abc", p.createScriptURL("a", "b", "c").toString()); + assert_equals("abundefined", p.createHTML("a", "b").toString()); + assert_equals("a123null", p.createScript("a", 123, null).toString()); + assert_equals("a[object Object]3.14", p.createScriptURL("a", {}, 3.14).toString()); + }, "Arbitrary number of arguments"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/support/helper.sub.js b/third_party/blink/web_tests/external/wpt/trusted-types/support/helper.sub.js index d13ad567..20f56c3 100644 --- a/third_party/blink/web_tests/external/wpt/trusted-types/support/helper.sub.js +++ b/third_party/blink/web_tests/external/wpt/trusted-types/support/helper.sub.js
@@ -24,6 +24,18 @@ return scripturl.replace("scripturl", "successful"); } +function createHTMLJSWithThreeArguments(html0, html1, html2) { + return html0 + html1 + html2; +} + +function createScriptJSWithThreeArguments(script0, script1, script2) { + return script0 + script1 + script2; +} + +function createScriptURLJSWithThreeArguments(scripturl0, scripturl1, scripturl2) { + return scripturl0 + scripturl1 + scripturl2; +} + function createHTML_policy(win, c) { return win.trustedTypes.createPolicy('SomeHTMLPolicyName' + c, { createHTML: createHTMLJS }); }
diff --git a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFRecord_constructor.https.html b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFRecord_constructor.https.html index 2da7ca9..0e0f1a7 100644 --- a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFRecord_constructor.https.html +++ b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFRecord_constructor.https.html
@@ -265,8 +265,8 @@ test(() => { assert_throws(new TypeError, () => new NDEFRecord( - createRecord('foo.eXamPle.com:bAr*-', "A string is not a BufferSource or NDEFMessage")), - 'Only BufferSource and NDEFMessage are allowed to be the record data.'); + createRecord('foo.eXamPle.com:bAr*-', "A string is not a BufferSource or NDEFMessageInit")), + 'Only BufferSource and NDEFMessageInit are allowed to be the record data.'); let buffer = new ArrayBuffer(4); new Uint8Array(buffer).set([1, 2, 3, 4]); @@ -294,6 +294,24 @@ assert_equals(record.toRecords(), null, 'toRecords() returns null if the payload is not an NDEF message.'); } + // Feed NDEFMessageInit. + { + const payload_message = createMessage([createTextRecord(test_text_data)]); + const record = new NDEFRecord(createRecord( + 'foo.eXamPle.com:bAr*-', payload_message, "dummy_record_id")); + assert_equals(record.recordType, 'foo.eXamPle.com:bAr*-', 'recordType'); + assert_equals(record.mediaType, null, 'mediaType'); + assert_equals(record.id, "dummy_record_id", 'id'); + const embedded_records = record.toRecords(); + assert_equals(embedded_records.length, 1, 'Only one embedded record.'); + // The only one embedded record has correct content. + assert_equals(embedded_records[0].recordType, 'text', 'recordType'); + assert_equals(embedded_records[0].mediaType, null, 'mediaType'); + assert_equals(embedded_records[0].id, test_record_id, 'id'); + const decoder = new TextDecoder(); + assert_equals(decoder.decode(embedded_records[0].data), test_text_data, + 'data has the same content with the original dictionary'); + } }, 'NDEFRecord constructor with external record type'); test(() => {
diff --git a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https-expected.txt b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https-expected.txt index 7c6b03b0..2b865d48 100644 --- a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https-expected.txt
@@ -14,6 +14,7 @@ PASS Test that WebNFC API is not accessible from iframe context. PASS NDEFWriter.push should succeed when NFC HW is enabled PASS NDEFWriter.push NDEFMessage containing text, mime, unknown, url, absolute-url and external records with default NDEFPushOptions. +PASS NDEFWriter.push NDEFMessage containing embedded records. PASS Test that NDEFWriter.push succeeds when message is DOMString. PASS Test that NDEFWriter.push succeeds when message is ArrayBuffer. PASS Test that NDEFWriter.push succeeds when message is ArrayBufferView.
diff --git a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https.html b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https.html index cb6b3941..bf7c1f8 100644 --- a/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https.html +++ b/third_party/blink/web_tests/external/wpt/web-nfc/NDEFWriter_push.https.html
@@ -290,6 +290,25 @@ and external records with default NDEFPushOptions."); nfc_test(async (t, mockNFC) => { + const payloadMessage = createMessage([createTextRecord(test_text_data)]); + // Prepare a message containing an external record that uses |payloadMessage| as its payload. + const message = createMessage([createRecord('example.com:payloadIsMessage', + payloadMessage)]); + + const writer = new NDEFWriter(); + await writer.push(message); + const pushed_message = mockNFC.pushedMessage(); + + // The mojom message received by mock nfc contains only the external type record. + assert_equals(pushed_message.data.length, 1); + assert_equals(pushed_message.data[0].recordType, 'example.com:payloadIsMessage', 'recordType'); + // The external type record's payload is from the original |payloadMessage|. + assert_array_equals(pushed_message.data[0].data, new Uint8Array(0), + 'payloadMessage is used instead'); + assertNDEFMessagesEqual(payloadMessage, pushed_message.data[0].payloadMessage); +}, "NDEFWriter.push NDEFMessage containing embedded records."); + +nfc_test(async (t, mockNFC) => { const writer = new NDEFWriter(); await writer.push(test_text_data); assertNDEFMessagesEqual(test_text_data, mockNFC.pushedMessage());
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/take_screenshot/iframe.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/take_screenshot/iframe.py index 4cf8ad0..66df6ec9 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/take_screenshot/iframe.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/take_screenshot/iframe.py
@@ -26,6 +26,23 @@ "GET", "session/{session_id}/screenshot".format(**vars(session))) +def test_always_captures_top_browsing_context(session): + iframe_content = "<style>body {{ margin: 0; }}</style>{}".format(DEFAULT_CONTENT) + session.url = inline("""{0}{1}""".format(DEFAULT_CSS_STYLE, iframe(iframe_content))) + + response = take_screenshot(session) + reference_screenshot = assert_success(response) + assert png_dimensions(reference_screenshot) == viewport_dimensions(session) + + frame = session.find.css("iframe", all=False) + session.switch_frame(frame) + + response = take_screenshot(session) + screenshot = assert_success(response) + + assert screenshot == reference_screenshot + + @pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"]) def test_source_origin(session, url, domain): session.url = inline("""{0}{1}""".format(DEFAULT_CSS_STYLE, DEFAULT_CONTENT))
diff --git a/third_party/blink/web_tests/external/wpt/webgpu/cts.html b/third_party/blink/web_tests/external/wpt/webgpu/cts.html index 6099f73..5c529e90 100644 --- a/third_party/blink/web_tests/external/wpt/webgpu/cts.html +++ b/third_party/blink/web_tests/external/wpt/webgpu/cts.html
@@ -66,6 +66,7 @@ <meta name=variant content='?q=cts:command_buffer/render/basic:'> <meta name=variant content='?q=cts:command_buffer/render/rendering:'> <meta name=variant content='?q=cts:command_buffer/render/storeop:'> +<meta name=variant content='?q=cts:copyImageBitmapToTexture:'> <meta name=variant content='?q=cts:examples:'> <meta name=variant content='?q=cts:fences:'> <meta name=variant content='?q=cts:resource_init/sampled_texture_clear:'>
diff --git a/third_party/blink/web_tests/external/wpt/webgpu/framework/version.js b/third_party/blink/web_tests/external/wpt/webgpu/framework/version.js index 9d1c0810..8dd8302 100644 --- a/third_party/blink/web_tests/external/wpt/webgpu/framework/version.js +++ b/third_party/blink/web_tests/external/wpt/webgpu/framework/version.js
@@ -1,3 +1,3 @@ // AUTO-GENERATED - DO NOT EDIT. See tools/gen_version. -export const version = '70754155a0bca2c24e3e3c249bab9ee3dd765a26'; +export const version = 'a5c59f8995f38843e332ff4d869a72f75d2f028d';
diff --git a/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/copyImageBitmapToTexture.spec.js b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/copyImageBitmapToTexture.spec.js new file mode 100644 index 0000000..c9b07e8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/copyImageBitmapToTexture.spec.js
@@ -0,0 +1,148 @@ +/** +* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts +**/ + +export const description = ` +copy imageBitmap To texture tests. +`; +import { TestGroup, pcombine, poptions } from '../../framework/index.js'; +import { GPUTest } from './gpu_test.js'; + +function calculateRowPitch(width, bytesPerPixel) { + const bytesPerRow = width * bytesPerPixel; // Rounds up to a multiple of 256 according to WebGPU requirements. + + return (bytesPerRow - 1 >> 8) + 1 << 8; +} + +class F extends GPUTest { + checkCopyImageBitmapResult(src, expected, width, height, bytesPerPixel) { + const exp = new Uint8Array(expected.buffer, expected.byteOffset, expected.byteLength); + const rowPitch = calculateRowPitch(width, bytesPerPixel); + const dst = this.createCopyForMapRead(src, rowPitch * height); + this.eventualAsyncExpectation(async niceStack => { + const actual = new Uint8Array((await dst.mapReadAsync())); + const check = this.checkBufferWithRowPitch(actual, exp, width, height, rowPitch, bytesPerPixel); + + if (check !== undefined) { + niceStack.message = check; + this.rec.fail(niceStack); + } + + dst.destroy(); + }); + } + + checkBufferWithRowPitch(actual, exp, width, height, rowPitch, bytesPerPixel) { + const lines = []; + let failedPixels = 0; + + for (let i = 0; i < height; ++i) { + const bytesPerRow = width * bytesPerPixel; + + for (let j = 0; j < bytesPerRow; ++j) { + const indexExp = j + i * bytesPerRow; + const indexActual = j + rowPitch * i; + + if (actual[indexActual] !== exp[indexExp]) { + if (failedPixels > 4) { + break; + } + + failedPixels++; + lines.push(`at [${indexExp}], expected ${exp[indexExp]}, got ${actual[indexActual]}`); + } + } + + if (failedPixels > 4) { + lines.push('... and more'); + break; + } + } + + return failedPixels > 0 ? lines.join('\n') : undefined; + } // Using drawImage to extract imageBitmap content. + + + imageBitmapToData(imageBitmap) { + const imageCanvas = document.createElement('canvas'); + imageCanvas.width = imageBitmap.width; + imageCanvas.height = imageBitmap.height; + const imageCanvasContext = imageCanvas.getContext('2d'); + + if (!imageCanvasContext) { + throw new Error('Cannot create canvas context for reading back contents from imageBitmap.'); + } + + imageCanvasContext.drawImage(imageBitmap, 0, 0, imageBitmap.width, imageBitmap.height); + return imageCanvasContext.getImageData(0, 0, imageBitmap.width, imageBitmap.height).data; + } + +} + +export const g = new TestGroup(F); +g.test('from ImageData', async t => { + const { + width, + height + } = t.params; // The texture format is rgba8uint, so the bytes per pixel is 4. + + const bytesPerPixel = 4; + const imagePixels = new Uint8ClampedArray(bytesPerPixel * width * height); + + for (let i = 0; i < width * height * bytesPerPixel; ++i) { + imagePixels[i] = i % 4 === 3 ? 255 : i % 256; + } + + const imageData = new ImageData(imagePixels, width, height); + const imageBitmap = await createImageBitmap(imageData); + const dst = t.device.createTexture({ + size: { + width: imageBitmap.width, + height: imageBitmap.height, + depth: 1 + }, + format: 'rgba8uint', + usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC + }); + t.device.defaultQueue.copyImageBitmapToTexture({ + imageBitmap, + origin: { + x: 0, + y: 0 + } + }, { + texture: dst + }, { + width: imageBitmap.width, + height: imageBitmap.height, + depth: 1 + }); + const data = t.imageBitmapToData(imageBitmap); + const rowPitchValue = calculateRowPitch(imageBitmap.width, bytesPerPixel); + const testBuffer = t.device.createBuffer({ + size: rowPitchValue * imageBitmap.height, + usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST + }); + const encoder = t.device.createCommandEncoder(); + encoder.copyTextureToBuffer({ + texture: dst, + mipLevel: 0, + origin: { + x: 0, + y: 0, + z: 0 + } + }, { + buffer: testBuffer, + rowPitch: rowPitchValue, + imageHeight: 0 + }, { + width: imageBitmap.width, + height: imageBitmap.height, + depth: 1 + }); + t.device.defaultQueue.submit([encoder.finish()]); + t.checkCopyImageBitmapResult(testBuffer, data, imageBitmap.width, imageBitmap.height, bytesPerPixel); +}).params(pcombine(poptions('width', [1, 2, 4, 15, 255, 256]), // +poptions('height', [1, 2, 4, 15, 255, 256]))); +//# sourceMappingURL=copyImageBitmapToTexture.spec.js.map \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/gpu_test.js b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/gpu_test.js index 67429b9..cf52a6ca 100644 --- a/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/gpu_test.js +++ b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/gpu_test.js
@@ -99,19 +99,23 @@ return this.device.createShaderModule({ code }); - } // TODO: add an expectContents for textures, which logs data: uris on failure + } - - expectContents(src, expected) { - const exp = new Uint8Array(expected.buffer, expected.byteOffset, expected.byteLength); - const size = expected.buffer.byteLength; + createCopyForMapRead(src, size) { const dst = this.device.createBuffer({ - size: expected.buffer.byteLength, + size, usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST }); const c = this.device.createCommandEncoder(); c.copyBufferToBuffer(src, 0, dst, 0, size); this.queue.submit([c.finish()]); + return dst; + } // TODO: add an expectContents for textures, which logs data: uris on failure + + + expectContents(src, expected) { + const exp = new Uint8Array(expected.buffer, expected.byteOffset, expected.byteLength); + const dst = this.createCopyForMapRead(src, expected.buffer.byteLength); this.eventualAsyncExpectation(async niceStack => { const actual = new Uint8Array((await dst.mapReadAsync())); const check = this.checkBuffer(actual, exp); @@ -153,7 +157,21 @@ failedPixels++; lines.push(`at [${i}], expected ${exp[i]}, got ${actual[i]}`); } - } + } // TODO: Could make a more convenient message, which could look like e.g.: + // + // Starting at offset 48, + // got 22222222 ABCDABCD 99999999 + // but expected 22222222 55555555 99999999 + // + // or + // + // Starting at offset 0, + // got 00000000 00000000 00000000 00000000 (... more) + // but expected 00FF00FF 00FF00FF 00FF00FF 00FF00FF (... more) + // + // Or, maybe these diffs aren't actually very useful (given we have the prints just above here), + // and we should remove them. More important will be logging of texture data in a visual format. + if (size <= 256 && failedPixels > 0) { const expHex = Array.from(exp).map(x => x.toString(16).padStart(2, '0')).join('');
diff --git a/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/index.js b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/index.js index 9fb8395d..e566792 100644 --- a/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/index.js +++ b/third_party/blink/web_tests/external/wpt/webgpu/suites/cts/index.js
@@ -54,6 +54,10 @@ "description": "renderPass store op test that drawn quad is either stored or cleared based on storeop" }, { + "path": "copyImageBitmapToTexture", + "description": "copy imageBitmap To texture tests." + }, + { "path": "examples", "description": "Examples of writing CTS tests with various features.\n\nStart here when looking for examples of basic framework usage." },
diff --git a/third_party/blink/web_tests/external/wpt/workers/constructors/SharedWorker/null-arguments-expected.txt b/third_party/blink/web_tests/external/wpt/workers/constructors/SharedWorker/null-arguments-expected.txt deleted file mode 100644 index 7b56d68..0000000 --- a/third_party/blink/web_tests/external/wpt/workers/constructors/SharedWorker/null-arguments-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL null as arguments assert_equals: second arg expected "" but got "null" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/workers/name-property-expected.txt b/third_party/blink/web_tests/external/wpt/workers/name-property-expected.txt deleted file mode 100644 index 30d73f9b..0000000 --- a/third_party/blink/web_tests/external/wpt/workers/name-property-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -PASS name property value for DedicatedWorkerGlobalScope -PASS name property is replaceable for DedicatedWorkerGlobalScope -PASS Declaring name as an accidental global must not cause a harness error for DedicatedWorkerGlobalScope -FAIL name property value for SharedWorkerGlobalScope assert_equals: expected "my name" but got "[object Object]" -PASS name property is replaceable for SharedWorkerGlobalScope -PASS Declaring name as an accidental global must not cause a harness error for SharedWorkerGlobalScope -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/workers/shared-worker-name-via-options-expected.txt b/third_party/blink/web_tests/external/wpt/workers/shared-worker-name-via-options-expected.txt deleted file mode 100644 index f2bdb115..0000000 --- a/third_party/blink/web_tests/external/wpt/workers/shared-worker-name-via-options-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL Test the name property of shared workers mixing constructor options and constructor strings Uncaught Error: assert_equals: expected "my name" but got "[object Object]" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker-expected.html b/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker-expected.html new file mode 100644 index 0000000..5227729 --- /dev/null +++ b/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker-expected.html
@@ -0,0 +1,23 @@ +<style> +::marker { + content: "[marker]"; +} +</style> + +<ul> + <li> + <ol> + <li>item</li> + <li>item</li> + </ol> + </li> +</ul> + +<ol> + <li> + <ol> + <li>item</li> + <li>item</li> + </ol> + </li> +</ol>
diff --git a/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker.html b/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker.html new file mode 100644 index 0000000..d54e7d6 --- /dev/null +++ b/third_party/blink/web_tests/fast/lists/nested-list-quirks-marker.html
@@ -0,0 +1,23 @@ +<style> +::marker { + content: "[marker]"; +} +</style> + +<ul> + <li> + <ol> + <li>item</li> + <li>item</li> + </ol> + </li> +</ul> + +<ol> + <li> + <ol> + <li>item</li> + <li>item</li> + </ol> + </li> +</ol>
diff --git a/third_party/blink/web_tests/http/tests/devtools/compiler-script-mapping.js b/third_party/blink/web_tests/http/tests/devtools/compiler-script-mapping.js index 2f286e1..eac4bd2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/compiler-script-mapping.js +++ b/third_party/blink/web_tests/http/tests/devtools/compiler-script-mapping.js
@@ -47,7 +47,7 @@ TestRunner.waitForUISourceCode('source2.js').then(secondUISourceCodeAdded); } - function secondUISourceCodeAdded(uiSourceCode) { + async function secondUISourceCodeAdded(uiSourceCode) { TestRunner.addResult('source2.js UISourceCode arrived'); var uiSourceCode1 = Workspace.workspace.uiSourceCodeForURL('http://127.0.0.1:8000/devtools/resources/source1.js'); @@ -60,11 +60,11 @@ SourcesTestRunner.checkUILocation(originalUISourceCode, 1, 200, uiLocation(script, 1, 200)); SourcesTestRunner.checkRawLocation( - script, 0, 48, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode1, 3, 10)[0]); + script, 0, 48, (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode1, 3, 10))[0]); SourcesTestRunner.checkRawLocation( - script, 1, 85, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode2, 1, 0)[0]); + script, 1, 85, (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode2, 1, 0))[0]); SourcesTestRunner.checkRawLocation( - script, 1, 140, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode2, 5, 2)[0]); + script, 1, 140, (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode2, 5, 2))[0]); TestRunner.addResult('Location checks passed. Requesting content'); uiSourceCode1.requestContent().then(didRequestContent1); @@ -112,11 +112,11 @@ TestRunner.waitForUISourceCode('source3.js').then(originalUISourceCodeAdded); } - function originalUISourceCodeAdded(uiSourceCode) { + async function originalUISourceCodeAdded(uiSourceCode) { TestRunner.addResult('source3.js UISourceCode arrived'); SourcesTestRunner.checkUILocation(uiSourceCode, 2, 4, uiLocation(script, 0, 18)); SourcesTestRunner.checkRawLocation( - script, 0, 18, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 2, 4)[0]); + script, 0, 18, (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 2, 4))[0]); TestRunner.addResult('Location checks passed. Requesting content'); uiSourceCode.requestContent().then(didRequestContent);
diff --git a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js index 29cd469..b43d88d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js +++ b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js
@@ -29,9 +29,9 @@ SourcesTestRunner.runDebuggerTestSuite([function testSetBreakpoint(next) { SourcesTestRunner.showScriptSource('add-elements.js', didShowSource); - function didShowSource(sourceFrame) { + async function didShowSource(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 14, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 14, '', true); SourcesTestRunner.waitUntilPaused(paused); TestRunner.evaluateInPage('setTimeout(clickButton, 0)'); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-external-change-breakpoints.js b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-external-change-breakpoints.js index 9a709e1..753b707c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-external-change-breakpoints.js +++ b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-external-change-breakpoints.js
@@ -23,7 +23,7 @@ await BindingsTestRunner.waitForBinding('foo.js'); var uiSourceCode = await TestRunner.waitForUISourceCode('foo.js', Workspace.projectTypes.FileSystem); var sourceFrame = await SourcesTestRunner.showUISourceCodePromise(uiSourceCode); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); const debuggerPlugin = SourcesTestRunner.debuggerPlugin(sourceFrame); await TestRunner.addSnifferPromise( debuggerPlugin, '_breakpointDecorationsUpdatedForTest');
diff --git a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints-on-reload.js b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints-on-reload.js index 85fef5b..70da08c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints-on-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints-on-reload.js
@@ -35,8 +35,8 @@ .then(sourceCode => SourcesTestRunner.showUISourceCodePromise(sourceCode)) .then(onSourceFrame); - function onSourceFrame(sourceFrame) { - SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); + async function onSourceFrame(sourceFrame) { + await SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); SourcesTestRunner.waitBreakpointSidebarPane(true).then(dumpBreakpointSidebarPane).then(next); } },
diff --git a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints.js b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints.js index acb26ff..3db85e02 100644 --- a/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints.js +++ b/third_party/blink/web_tests/http/tests/devtools/persistence/persistence-move-breakpoints.js
@@ -21,7 +21,7 @@ async function setBreakpointInFileSystemUISourceCode(next) { var uiSourceCode = await TestRunner.waitForUISourceCode('foo.js', Workspace.projectTypes.FileSystem); var sourceFrame = await SourcesTestRunner.showUISourceCodePromise(uiSourceCode); - SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); await SourcesTestRunner.waitBreakpointSidebarPane(); dumpBreakpointSidebarPane(); next();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-in-anonymous-script-with-two-targets.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-in-anonymous-script-with-two-targets.js index 332e48a..c0a35bab 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-in-anonymous-script-with-two-targets.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-in-anonymous-script-with-two-targets.js
@@ -23,7 +23,7 @@ await SourcesTestRunner.startDebuggerTestPromise(); TestRunner.evaluateInPageWithTimeout('testFunction()'); var sourceFrame = await waitForPausedUISourceCode(); - SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, '', true); + await SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, '', true); await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame); await SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame); SourcesTestRunner.completeDebuggerTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-in-multiple-workers.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-in-multiple-workers.js index 783b2c97..026cf3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-in-multiple-workers.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-in-multiple-workers.js
@@ -11,8 +11,8 @@ let workerSourceFrame = await SourcesTestRunner.showScriptSourcePromise('worker.js'); TestRunner.addResult('Set different breakpoints and dump them'); SourcesTestRunner.toggleBreakpoint(workerSourceFrame, 1, false); - SourcesTestRunner.createNewBreakpoint(workerSourceFrame, 2, 'a === 3', true); - SourcesTestRunner.createNewBreakpoint(workerSourceFrame, 3, '', false); + await SourcesTestRunner.createNewBreakpoint(workerSourceFrame, 2, 'a === 3', true); + await SourcesTestRunner.createNewBreakpoint(workerSourceFrame, 3, '', false); await SourcesTestRunner.waitDebuggerPluginBreakpoints(workerSourceFrame); SourcesTestRunner.dumpDebuggerPluginBreakpoints(workerSourceFrame);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-navigation.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-navigation.js index ecc4782..16f05bf3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-navigation.js
@@ -12,16 +12,16 @@ let sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.html'); TestRunner.addResult('Set different breakpoints in inline script and dump them'); SourcesTestRunner.toggleBreakpoint(sourceFrame, 3, false); - SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, 'a === 3', true); - SourcesTestRunner.createNewBreakpoint(sourceFrame, 6, '', false); + await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, 'a === 3', true); + await SourcesTestRunner.createNewBreakpoint(sourceFrame, 6, '', false); await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame); SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame); sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.js'); TestRunner.addResult('Set different breakpoints and dump them'); SourcesTestRunner.toggleBreakpoint(sourceFrame, 9, false); - SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, 'a === 3', true); - SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, '', false); + await SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, 'a === 3', true); + await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, '', false); await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame); SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js index e3dd122..8dba127 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js
@@ -12,8 +12,8 @@ let originalSourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.js'); TestRunner.addResult('Set different breakpoints and dump them'); SourcesTestRunner.toggleBreakpoint(originalSourceFrame, 9, false); - SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 10, 'a === 3', true); - SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 5, '', false); + await SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 10, 'a === 3', true); + await SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 5, '', false); await SourcesTestRunner.waitDebuggerPluginBreakpoints(originalSourceFrame); await SourcesTestRunner.waitUntilDebuggerPluginLoaded(originalSourceFrame); SourcesTestRunner.dumpDebuggerPluginBreakpoints(originalSourceFrame);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.js index ea00647..bd9d82c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.js
@@ -22,9 +22,9 @@ SourcesTestRunner.showScriptSource(testName, step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Main resource was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); UI.panels.sources._toggleBreakpointsActive(); TestRunner.reloadPage(step3); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-disable-add-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-disable-add-breakpoint.js index c72a78dc1..6eae0e6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-disable-add-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-disable-add-breakpoint.js
@@ -29,7 +29,7 @@ TestRunner.debuggerModel.removeEventListener( SDK.DebuggerModel.Events.DebuggerWasDisabled, step3, this); TestRunner.addResult('Debugger disabled.'); - SourcesTestRunner.setBreakpoint(testSourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(testSourceFrame, 3, '', true); TestRunner.addResult('Breakpoint added'); await TestRunner.debuggerModel._enableDebugger(); step4();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.js index e117bf16..b3764fd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.js
@@ -15,11 +15,11 @@ SourcesTestRunner.showScriptSource('source1.js', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { SourcesTestRunner.waitBreakpointSidebarPane() .then(waitUntilReady) .then(onBreakpointsReady); - SourcesTestRunner.setBreakpoint(sourceFrame, 14, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 14, '', true); function onBreakpointsReady() { SourcesTestRunner.dumpBreakpointSidebarPane('before reload:');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/dynamic-scripts-breakpoints.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/dynamic-scripts-breakpoints.js index c880aee..8144f7e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/dynamic-scripts-breakpoints.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/dynamic-scripts-breakpoints.js
@@ -32,12 +32,12 @@ breakpoints[i].lineNumber); } - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_addResolvedLocation', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 7, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 7, '', true); } function breakpointResolved(location) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/no-pause-on-disabled-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/no-pause-on-disabled-breakpoint.js index bd373e6..95cd577 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/no-pause-on-disabled-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/no-pause-on-disabled-breakpoint.js
@@ -21,7 +21,7 @@ await new Promise(resolve => SourcesTestRunner.resumeExecution(resolve)); TestRunner.addResult('Disable breakpoint'); - SourcesTestRunner.toggleBreakpoint(sourceFrame, 9, true); + await SourcesTestRunner.toggleBreakpoint(sourceFrame, 9, true); TestRunner.addResult('Run function and check that pause happens after function'); TestRunner.evaluateInPage('main(); debugger;//# sourceURL=test.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/nodejs-set-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/nodejs-set-breakpoint.js index abb22c2..6851094c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/nodejs-set-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/nodejs-set-breakpoint.js
@@ -17,11 +17,11 @@ await TestRunner.evaluateInPageAnonymously(functionText + sourceURL); SourcesTestRunner.showScriptSource('foobar.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_addResolvedLocation', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 1, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 1, '', true); } function breakpointResolved(location) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/set-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/set-breakpoint.js index f82e948..4881aef1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/set-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-breakpoints/set-breakpoint.js
@@ -68,9 +68,9 @@ SourcesTestRunner.showScriptSource( 'set-breakpoint.html', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { currentSourceFrame = sourceFrame; - SourcesTestRunner.setBreakpoint(currentSourceFrame, 7, '', true); + await SourcesTestRunner.setBreakpoint(currentSourceFrame, 7, '', true); SourcesTestRunner.waitUntilPaused(didPause); TestRunner.evaluateInPage('setTimeout(oneLineTestFunction2, 0)'); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-mute-exception.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-mute-exception.js index 5f3fbca..c9a6114 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-mute-exception.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-mute-exception.js
@@ -39,10 +39,10 @@ SourcesTestRunner.showScriptSource('test.js', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 10, 'false', true); - SourcesTestRunner.setBreakpoint(sourceFrame, 14, 'false', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 10, 'false', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 14, 'false', true); TestRunner.evaluateInPage('setTimeout(handleClick, 0)'); SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(step3); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/pause-in-internal-script.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/pause-in-internal-script.js index deee00ef..06f137d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/pause-in-internal-script.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/pause-in-internal-script.js
@@ -31,10 +31,10 @@ var breakpointFunctionFrame = null; - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { breakpointFunctionFrame = sourceFrame; TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 21, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 21, '', true); SourcesTestRunner.runTestFunctionAndWaitUntilPaused(didPause); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js index 5a96fb86..7f69795 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js
@@ -19,11 +19,11 @@ 'skip-pauses-until-reload.html', didShowScriptSource); } - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { TestRunner.addResult('Script source was shown.'); TestRunner.addResult('Set up breakpoints.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); - SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); TestRunner.addResult('Set up to pause on all exceptions.'); // FIXME: Test is flaky with PauseOnAllExceptions due to races in debugger. TestRunner.DebuggerAgent.setPauseOnExceptions(
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-document-write.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-document-write.js index 9ed47c23..5ff6641 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-document-write.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-document-write.js
@@ -19,9 +19,9 @@ 'debugger-step-into-document-write.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(completeTest); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-inlined-scripts.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-inlined-scripts.js index f93af84..c6930bad 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-inlined-scripts.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-into-inlined-scripts.js
@@ -19,9 +19,9 @@ 'debugger-step-into-inlined-scripts.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 6, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 6, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(completeTest); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-out-document-write.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-out-document-write.js index 7ce9992..d7112d1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-out-document-write.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-out-document-write.js
@@ -17,8 +17,8 @@ async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); - SourcesTestRunner.setBreakpoint(sourceFrame, 11, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 11, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(completeTest); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-document-write.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-document-write.js index e773aa29..45546803 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-document-write.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-document-write.js
@@ -19,9 +19,9 @@ 'debugger-step-over-document-write.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 3, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(completeTest); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-inlined-scripts.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-inlined-scripts.js index fe589c1e..297bd7f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-inlined-scripts.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-step/debugger-step-over-inlined-scripts.js
@@ -19,9 +19,9 @@ 'debugger-step-over-inlined-scripts.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 6, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 6, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(completeTest); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-2.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-2.js index d21688b..23dd800c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-2.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-2.js
@@ -34,7 +34,7 @@ formattedSourceFrame = panel.visibleView; await SourcesTestRunner.waitUntilDebuggerPluginLoaded( formattedSourceFrame); - SourcesTestRunner.setBreakpoint(formattedSourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(formattedSourceFrame, 3, '', true); SourcesTestRunner.waitBreakpointSidebarPane().then(evaluateF2); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-3.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-3.js index b17afeb9d..1e3b2054 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-3.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-formatter-breakpoints-3.js
@@ -33,7 +33,7 @@ var formattedSourceFrame = panel.visibleView; await SourcesTestRunner.waitUntilDebuggerPluginLoaded( formattedSourceFrame); - SourcesTestRunner.setBreakpoint(formattedSourceFrame, 3, '', true); + await SourcesTestRunner.setBreakpoint(formattedSourceFrame, 3, '', true); SourcesTestRunner.waitBreakpointSidebarPane().then(evaluateF2); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/anonymous-script-with-source-map-breakpoint.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/anonymous-script-with-source-map-breakpoint.js index fc962d6..81e6fe96e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/anonymous-script-with-source-map-breakpoint.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/anonymous-script-with-source-map-breakpoint.js
@@ -15,7 +15,7 @@ await SourcesTestRunner.waitUntilResumedPromise(); let sourceFrame = await SourcesTestRunner.showScriptSourcePromise('example.ts'); - SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 0, '', true); TestRunner.reloadPage(); SourcesTestRunner.waitUntilPausedAndDumpStackAndResume( () => SourcesTestRunner.completeDebuggerTest());
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts-fragment-id.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts-fragment-id.js index 26db448..9552ab2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts-fragment-id.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts-fragment-id.js
@@ -21,9 +21,9 @@ SourcesTestRunner.showScriptSource('inline-scripts.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 5, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 5, '', true); SourcesTestRunner.waitUntilPaused(step3); TestRunner.reloadPage(SourcesTestRunner.completeDebuggerTest.bind(SourcesTestRunner)); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts.js index bfe5a931..ba1855b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debug-inlined-scripts.js
@@ -21,11 +21,11 @@ SourcesTestRunner.showScriptSource('debug-inline-scripts.html', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Script source was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); - SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame).then(() => { TestRunner.reloadPage(() => SourcesTestRunner.completeDebuggerTest());
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-disable-enable.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-disable-enable.js index 38855c5..594601473 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-disable-enable.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-disable-enable.js
@@ -19,9 +19,9 @@ SourcesTestRunner.showScriptSource('debugger-disable-enable.js', step2); } - function step2(sourceFrame) { + async function step2(sourceFrame) { TestRunner.addResult('Main resource was shown.'); - SourcesTestRunner.setBreakpoint(sourceFrame, 11, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 11, '', true); TestRunner.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasDisabled, step3, this); TestRunner.debuggerModel._disableDebugger(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-breakpoints.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-breakpoints.js index e4b7934..a582e23 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-breakpoints.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-breakpoints.js
@@ -56,14 +56,14 @@ SourcesTestRunner.showScriptSource('edit-me-breakpoints.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { javaScriptSourceFrame = sourceFrame; uiSourceCode = sourceFrame._uiSourceCode; TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_didSetBreakpointInDebugger', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointResolved(callback, breakpointId, locations) { @@ -94,10 +94,10 @@ SourcesTestRunner.undoSourceEditing(javaScriptSourceFrame); } - function breakpointResolvedAgain() { + async function breakpointResolvedAgain() { dumpBreakpointStorageAndLocations(); TestRunner.addResult('Finally removing breakpoint:'); - SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); + await SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); dumpBreakpointStorageAndLocations(); next(); @@ -109,14 +109,14 @@ SourcesTestRunner.showScriptSource('edit-me-breakpoints.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { javaScriptSourceFrame = sourceFrame; uiSourceCode = sourceFrame._uiSourceCode; TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_didSetBreakpointInDebugger', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointResolved(callback, breakpointId, locations) { @@ -147,10 +147,10 @@ SourcesTestRunner.commitSource(javaScriptSourceFrame); } - function breakpointResolvedAgain() { + async function breakpointResolvedAgain() { dumpBreakpointStorageAndLocations(); TestRunner.addResult('Finally removing breakpoint:'); - SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); + await SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); dumpBreakpointStorageAndLocations(); next(); @@ -162,14 +162,14 @@ SourcesTestRunner.showScriptSource('edit-me-breakpoints.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { javaScriptSourceFrame = sourceFrame; uiSourceCode = sourceFrame._uiSourceCode; TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_didSetBreakpointInDebugger', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointResolved(callback, breakpointId, locations) { @@ -212,10 +212,10 @@ SourcesTestRunner.commitSource(javaScriptSourceFrame); } - function breakpointResolvedAgain() { + async function breakpointResolvedAgain() { dumpBreakpointStorageAndLocations(); TestRunner.addResult('Finally removing breakpoint:'); - SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); + await SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); dumpBreakpointStorageAndLocations(); next(); @@ -227,14 +227,14 @@ SourcesTestRunner.showScriptSource('edit-me-breakpoints.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { javaScriptSourceFrame = sourceFrame; uiSourceCode = sourceFrame._uiSourceCode; TestRunner.addResult('Setting breakpoint:'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_didSetBreakpointInDebugger', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointResolved(callback, breakpointId, locations) { @@ -277,10 +277,10 @@ SourcesTestRunner.commitSource(javaScriptSourceFrame); } - function breakpointResolvedAgain() { + async function breakpointResolvedAgain() { dumpBreakpointStorageAndLocations(); TestRunner.addResult('Finally removing breakpoint:'); - SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); + await SourcesTestRunner.removeBreakpoint(javaScriptSourceFrame, 2); dumpBreakpointStorageAndLocations(); next();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-no-reveal.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-no-reveal.js index 05892fd6..6ba6e28 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-no-reveal.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit-no-reveal.js
@@ -20,9 +20,9 @@ function testLiveEditWhenPausedDoesNotCauseCursorMove(oldText, newText, next) { SourcesTestRunner.showScriptSource('edit-me-when-paused-no-reveal.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { SourcesTestRunner.waitUntilPaused(paused); - SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); TestRunner.evaluateInPage('f1()', didEvaluateInPage); } @@ -54,9 +54,9 @@ function testLiveEditWhenPausedThenStepIntoCausesCursorMove(oldText, newText, next) { SourcesTestRunner.showScriptSource('edit-me-when-paused-no-reveal.js', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { SourcesTestRunner.waitUntilPaused(paused); - SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 8, '', true); TestRunner.evaluateInPage('f1()', didEvaluateInPage); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit.js index dd34400c..cc2707f3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/live-edit.js
@@ -101,7 +101,7 @@ await SourcesTestRunner.waitUntilDebuggerPluginLoaded(sourceFrame); SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame) .then(breakpointAdded); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointAdded() { @@ -132,7 +132,7 @@ await SourcesTestRunner.waitUntilDebuggerPluginLoaded(sourceFrame); SourcesTestRunner.waitDebuggerPluginBreakpoints(testSourceFrame) .then(breakpointAdded); - SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 2, '', true); } function breakpointAdded() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/resource-script-mapping.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/resource-script-mapping.js index 5d9511b1..3b4062f1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/resource-script-mapping.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/resource-script-mapping.js
@@ -36,7 +36,7 @@ } } - function onUISourceCode(uiSourceCode) { + async function onUISourceCode(uiSourceCode) { TestRunner.addResult('UISourceCode arrived'); scripts.sort((s1, s2) => { return s1.lineOffset - s2.lineOffset; @@ -48,7 +48,7 @@ var rawLocation = TestRunner.debuggerModel.createRawLocation(script, line, column); var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation); SourcesTestRunner.checkUILocation(uiSourceCode, line, column, uiLocation); - var reverseLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, line, column)[0]; + var reverseLocation = (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, line, column))[0]; SourcesTestRunner.checkRawLocation(script, line, column, reverseLocation); } TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/formatter-js.js b/third_party/blink/web_tests/http/tests/devtools/sources/formatter-js.js index adc0c70..983df39 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/formatter-js.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/formatter-js.js
@@ -19,24 +19,24 @@ var positions = []; for (var offset = originalContent.indexOf('{'); offset >= 0; offset = originalContent.indexOf('{', offset + 1)) positions.push(text.positionFromOffset(offset)); - var script = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0)[0].script(); + var script = (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0))[0].script(); TestRunner.addResult('Location mapping with formatted source:'); - dumpLocations(positions); + await dumpLocations(positions); Formatter.sourceFormatter.discardFormattedUISourceCode(formatData.formattedSourceCode); TestRunner.addResult('Location mapping without formatted source:'); - dumpLocations(positions); + await dumpLocations(positions); TestRunner.completeTest(); - function dumpLocations(positions) { + async function dumpLocations(positions) { for (var position of positions) { var rawLocation = TestRunner.debuggerModel.createRawLocation(script, position.lineNumber, position.columnNumber); var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation); - var reverseRawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations( - uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber)[0]; + var reverseRawLocation = (await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations( + uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber))[0]; TestRunner.addResult( `${rawLocation.lineNumber}:${rawLocation.columnNumber} -> ${uiLocation.lineNumber}:${ uiLocation.columnNumber}` +
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/inline-styles-scripts-locations.js b/third_party/blink/web_tests/http/tests/devtools/sources/inline-styles-scripts-locations.js index 3ebaf4f0..ad245b6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/inline-styles-scripts-locations.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/inline-styles-scripts-locations.js
@@ -30,18 +30,18 @@ async function dumpLocations(type, lineCount, source) { TestRunner.addResult(`Scanning ${lineCount} lines for ${type} locations. Note that location line/column numbers are zero-based.`); for (let line = 0; line < lineCount; ++line) { - const rawLocations = getLocations(line); + const rawLocations = await getLocations(line); if (rawLocations.length) { const results = rawLocations.map(async loc => `${loc.lineNumber}:${loc.columnNumber} (${await checkValidity(loc)})`); const rawLocationsString = (await Promise.all(results)).join(' '); TestRunner.addResult(`uiLocation ${line}:0 resolves to: ${rawLocationsString}`) } } - function getLocations(line) { + async function getLocations(line) { if (type === "css") return Bindings.cssWorkspaceBinding.uiLocationToRawLocations(source.uiLocation(line, 0)); if (type === "script") - return Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(source, line, 0); + return await Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(source, line, 0); return null; } async function checkValidity(location) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-1.js b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-1.js index 91794d3..9958359 100644 --- a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-1.js +++ b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-1.js
@@ -24,9 +24,9 @@ function testBreakpointsInOriginalAndFormattedSource(next) { SourcesTestRunner.showScriptSource('script-formatter-breakpoints-1.html', didShowScriptSource); - function didShowScriptSource(frame) { + async function didShowScriptSource(frame) { sourceFrame = frame; - SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); Promise.all([SourcesTestRunner.waitBreakpointSidebarPane(true), SourcesTestRunner.waitUntilPausedPromise()]) .then(pausedInF1); TestRunner.evaluateInPageWithTimeout('f1()');
diff --git a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-4.js b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-4.js index 9fe318b..ab390c6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-4.js +++ b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-4.js
@@ -23,12 +23,12 @@ function testBreakpointSetInOriginalAndRemovedInFormatted(next) { SourcesTestRunner.showScriptSource('script-formatter-breakpoints-4.html', didShowScriptSource); - function didShowScriptSource(sourceFrame) { + async function didShowScriptSource(sourceFrame) { TestRunner.addResult('Adding breakpoint.'); TestRunner.addSniffer( Bindings.BreakpointManager.ModelBreakpoint.prototype, '_addResolvedLocation', breakpointResolved); - SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); + await SourcesTestRunner.setBreakpoint(sourceFrame, 9, '', true); } function breakpointResolved() { @@ -43,7 +43,7 @@ var formattedSourceFrame = panel.visibleView; await SourcesTestRunner.waitUntilDebuggerPluginLoaded( formattedSourceFrame); - SourcesTestRunner.removeBreakpoint(formattedSourceFrame, 11); + await SourcesTestRunner.removeBreakpoint(formattedSourceFrame, 11); TestRunner.addResult('Unformatting.'); Formatter.sourceFormatter.discardFormattedUISourceCode(panel.visibleView.uiSourceCode()); var breakpoints = Bindings.breakpointManager._storage._setting.get();
diff --git a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-inline-with-sourceURL.js b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-inline-with-sourceURL.js index e87c8b3..4bddf71 100644 --- a/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-inline-with-sourceURL.js +++ b/third_party/blink/web_tests/http/tests/devtools/startup/sources/debugger/script-formatter-breakpoints-inline-with-sourceURL.js
@@ -25,9 +25,9 @@ async function testBreakpointsInOriginalAndFormattedSource(next) { SourcesTestRunner.showScriptSource('named-inline-script.js', didShowScriptSource); - function didShowScriptSource(frame) { + async function didShowScriptSource(frame) { sourceFrame = frame; - SourcesTestRunner.setBreakpoint(sourceFrame, 4, '', true); // Lines here are zero based. + await SourcesTestRunner.setBreakpoint(sourceFrame, 4, '', true); // Lines here are zero based. Promise.all([SourcesTestRunner.waitBreakpointSidebarPane(true), SourcesTestRunner.waitUntilPausedPromise()]) .then(pausedInFunctionInInlineScriptWithSourceURL); TestRunner.evaluateInPageWithTimeout('functionInInlineScriptWithSourceURL()'); @@ -63,9 +63,9 @@ SourcesTestRunner.waitBreakpointSidebarPane().then(onBreakpointsUpdated); } - function onBreakpointsUpdated() { + async function onBreakpointsUpdated() { SourcesTestRunner.dumpBreakpointSidebarPane('while paused after removing breakpoint in pretty printed and closing pretty printed'); - SourcesTestRunner.setBreakpoint(sourceFrame, 4, '', true); // Lines here are zero based. + await SourcesTestRunner.setBreakpoint(sourceFrame, 4, '', true); // Lines here are zero based. Promise.all([SourcesTestRunner.waitBreakpointSidebarPane(true), SourcesTestRunner.waitUntilPausedPromise()]) .then(pausedInFunctionInInlineScriptWithSourceURLThirdTime); TestRunner.evaluateInPageWithTimeout('functionInInlineScriptWithSourceURL()');
diff --git a/third_party/blink/web_tests/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt b/third_party/blink/web_tests/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt index 065c5bdb..9ed8918 100644 --- a/third_party/blink/web_tests/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt +++ b/third_party/blink/web_tests/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt
@@ -41,6 +41,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter @@ -99,6 +100,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index dae5fa91..952014e 100644 --- a/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/blink/web_tests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -3763,6 +3763,7 @@ attribute @@toStringTag getter locked method abort + method close method constructor method getWriter interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/http/tests/workers/resources/shared-worker-name.js b/third_party/blink/web_tests/http/tests/workers/resources/shared-worker-name.js index 21c703c..f18289c 100644 --- a/third_party/blink/web_tests/http/tests/workers/resources/shared-worker-name.js +++ b/third_party/blink/web_tests/http/tests/workers/resources/shared-worker-name.js
@@ -121,11 +121,11 @@ function test9() { - // Creating a worker with a null name should match an existing worker with name 'null' + // Creating a worker with a null name should match an existing worker with no name. var worker = new SharedWorker('resources/shared-worker-common.js', null); worker.port.postMessage("eval self.foo"); worker.port.onmessage = function(event) { - shouldBeEqual("creating worker with a null name", event.data, "self.foo: 5678"); + shouldBeEqual("creating worker with a null name", event.data, "self.foo: 1234"); nextTest(); } }
diff --git a/third_party/blink/web_tests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt b/third_party/blink/web_tests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt index 4fb804b1..c265ccd 100644 --- a/third_party/blink/web_tests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt +++ b/third_party/blink/web_tests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
@@ -260,6 +260,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter @@ -538,6 +539,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/virtual/dark-color-scheme/README.md b/third_party/blink/web_tests/virtual/dark-color-scheme/README.md new file mode 100644 index 0000000..76c7648 --- /dev/null +++ b/third_party/blink/web_tests/virtual/dark-color-scheme/README.md
@@ -0,0 +1,5 @@ +This suite runs the tests with + +--force-dark-mode --enable-blink-features=CSSColorScheme + +in order to render color-scheme tests with a preferred dark color-scheme
diff --git a/third_party/blink/web_tests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt b/third_party/blink/web_tests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt index b5b9564..0b72cb7 100644 --- a/third_party/blink/web_tests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt +++ b/third_party/blink/web_tests/virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/animationworklet-origin-trial-interfaces-worklet-scope-expected.txt
@@ -38,6 +38,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter @@ -93,6 +94,7 @@ CONSOLE MESSAGE: line 153: interface WritableStream CONSOLE MESSAGE: line 153: getter locked CONSOLE MESSAGE: line 153: method abort +CONSOLE MESSAGE: line 153: method close CONSOLE MESSAGE: line 153: method constructor CONSOLE MESSAGE: line 153: method getWriter CONSOLE MESSAGE: line 153: interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/blink/web_tests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index 154f302..da5a938 100644 --- a/third_party/blink/web_tests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -2647,6 +2647,7 @@ attribute @@toStringTag getter locked method abort + method close method constructor method getWriter interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt index 86dc8f71..4d3cfd6 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -2663,6 +2663,7 @@ [Worker] attribute @@toStringTag [Worker] getter locked [Worker] method abort +[Worker] method close [Worker] method constructor [Worker] method getWriter [Worker] interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt index bffcf9e..0b77cd9 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -8685,6 +8685,7 @@ attribute @@toStringTag getter locked method abort + method close method constructor method getWriter interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt index 9d139dba..0bc135c 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -2550,6 +2550,7 @@ [Worker] attribute @@toStringTag [Worker] getter locked [Worker] method abort +[Worker] method close [Worker] method constructor [Worker] method getWriter [Worker] interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt index 396f8b57..a0a8bdf 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -3815,6 +3815,7 @@ [Worker] attribute @@toStringTag [Worker] getter locked [Worker] method abort +[Worker] method close [Worker] method constructor [Worker] method getWriter [Worker] interface WritableStreamDefaultWriter
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 e51a216..9e99cb5 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
@@ -10976,6 +10976,7 @@ attribute @@toStringTag getter locked method abort + method close method constructor method getWriter interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt index 96ce92d5..12fc23c 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -3657,6 +3657,7 @@ [Worker] attribute @@toStringTag [Worker] getter locked [Worker] method abort +[Worker] method close [Worker] method constructor [Worker] method getWriter [Worker] interface WritableStreamDefaultWriter
diff --git a/third_party/blink/web_tests/external/wpt/fetch/metadata/appcache.tentative.https.sub.html b/third_party/blink/web_tests/wpt_internal/fetch/metadata/appcache.tentative.https.sub.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/fetch/metadata/appcache.tentative.https.sub.html rename to third_party/blink/web_tests/wpt_internal/fetch/metadata/appcache.tentative.https.sub.html
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/cts.html b/third_party/blink/web_tests/wpt_internal/webgpu/cts.html index 44e48c6f..73dba53 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/cts.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/cts.html
@@ -49,6 +49,7 @@ <meta name=variant content='?worker=0&q=cts:command_buffer/render/rendering:'> <meta name=variant content='?worker=0&q=cts:command_buffer/render/storeop:storeOp_controls_whether_1x1_drawn_quad_is_stored={"storeOp":"store"}'> <meta name=variant content='?worker=0&q=cts:command_buffer/render/storeop:storeOp_controls_whether_1x1_drawn_quad_is_stored={"storeOp":"clear"}'> +<meta name=variant content='?worker=0&q=cts:copyImageBitmapToTexture:'> <meta name=variant content='?worker=0&q=cts:examples:'> <meta name=variant content='?worker=0&q=cts:fences:'> <meta name=variant content='?worker=0&q=cts:validation/createBindGroup:binding_count_mismatch~'> @@ -141,6 +142,7 @@ <meta name=variant content='?worker=0&q=cts:validation/setViewport:'> <meta name=variant content='?worker=0&q=cts:validation/vertex_state:'> + <meta name=variant content='?worker=1&q=cts:buffers/create_mapped:'> <meta name=variant content='?worker=1&q=cts:buffers/map:'> <meta name=variant content='?worker=1&q=cts:buffers/map_detach:'> @@ -155,6 +157,7 @@ <meta name=variant content='?worker=1&q=cts:command_buffer/render/rendering:'> <meta name=variant content='?worker=1&q=cts:command_buffer/render/storeop:storeOp_controls_whether_1x1_drawn_quad_is_stored={"storeOp":"store"}'> <meta name=variant content='?worker=1&q=cts:command_buffer/render/storeop:storeOp_controls_whether_1x1_drawn_quad_is_stored={"storeOp":"clear"}'> +<meta name=variant content='?worker=1&q=cts:copyImageBitmapToTexture:'> <meta name=variant content='?worker=1&q=cts:examples:'> <meta name=variant content='?worker=1&q=cts:fences:'> <meta name=variant content='?worker=1&q=cts:validation/createBindGroup:binding_count_mismatch~'>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 2952195..832dad4 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -13877,6 +13877,16 @@ <int value="137457845" label="WEB_HISTORY_SERVICE"/> </enum> +<enum name="DayOfWeek"> + <int value="0" label="Sunday"/> + <int value="1" label="Monday"/> + <int value="2" label="Tuesday"/> + <int value="3" label="Wednesday"/> + <int value="4" label="Thursday"/> + <int value="5" label="Friday"/> + <int value="6" label="Saturday"/> +</enum> + <enum name="DCLayerResult"> <int value="0" label="Success"/> <int value="1" label="Failed unsupported quad (not recorded)"/> @@ -36285,6 +36295,7 @@ <int value="-1998927516" label="enable-md-settings"/> <int value="-1996233283" label="OmniboxGroupSuggestionsBySearchVsUrl:enabled"/> + <int value="-1993730028" label="CrostiniPortForwarding:enabled"/> <int value="-1990614981" label="StoragePressureUI:disabled"/> <int value="-1989747818" label="TabStripKeyboardFocus:disabled"/> <int value="-1985452239" label="SmartDim20190221:disabled"/> @@ -37228,6 +37239,7 @@ <int value="-871520682" label="AccessibilityInternalsPageImprovements:enabled"/> <int value="-870120067" label="EnableSearchBoxSelection:enabled"/> + <int value="-868138290" label="CrostiniPortForwarding:disabled"/> <int value="-867087281" label="enable-virtual-keyboard"/> <int value="-866993841" label="OfflinePagesCTV2:disabled"/> <int value="-864266073" label="cros-regions-mode"/> @@ -42691,6 +42703,21 @@ </int> </enum> +<enum name="Month"> + <int value="1" label="January"/> + <int value="2" label="Febuary"/> + <int value="3" label="March"/> + <int value="4" label="April"/> + <int value="5" label="May"/> + <int value="6" label="June"/> + <int value="7" label="July"/> + <int value="8" label="August"/> + <int value="9" label="September"/> + <int value="10" label="October"/> + <int value="11" label="November"/> + <int value="12" label="December"/> +</enum> + <enum name="MostVisitedTileIndex"> <summary> Index of a tile on the new tab page. This is only an enum so that the @@ -58998,6 +59025,14 @@ <int value="3" label="Large Downscale"/> </enum> +<enum name="SmartChargingReason"> + <int value="1" label="Charger plugged in"/> + <int value="2" label="Charger unplugged"/> + <int value="3" label="Periodic log"/> + <int value="4" label="Shutdown"/> + <int value="5" label="Suspend"/> +</enum> + <enum name="SmartLockAuthEventPasswordState"> <int value="0" label="Unknown state"/> <int value="1" label="No pairing"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 62cd8a4..ecb16ac 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -29858,8 +29858,9 @@ </histogram> <histogram base="true" name="CustomTabs.DetachedResourceRequest.Duration" - units="ms" expires_after="M81"> + units="ms" expires_after="M84"> <owner>lizeb@chromium.org</owner> + <owner>cct-team@google.com</owner> <summary> Time between the start of a detached resource request and its completion (failure or success). Android only. @@ -29867,8 +29868,9 @@ </histogram> <histogram name="CustomTabs.DetachedResourceRequest.FinalStatus" - enum="NetErrorCodes" expires_after="2020-02-16"> + enum="NetErrorCodes" expires_after="M84"> <owner>lizeb@chromium.org</owner> + <owner>cct-team@google.com</owner> <summary> Reports the final status of the detached request, including success. Recorded once per detached resource request. Android only. @@ -29876,8 +29878,9 @@ </histogram> <histogram base="true" name="CustomTabs.DetachedResourceRequest.RedirectsCount" - units="redirects" expires_after="2020-01-26"> + units="redirects" expires_after="M84"> <owner>lizeb@chromium.org</owner> + <owner>cct-team@google.com</owner> <summary> Number of redirects followed by a detached resource request until success or failure. Android only. @@ -30092,8 +30095,9 @@ </histogram> <histogram name="CustomTabs.ParallelRequestStatusOnStart" - enum="CustomTabsParallelRequestStatusOnStart" expires_after="2020-01-26"> + enum="CustomTabsParallelRequestStatusOnStart" expires_after="M84"> <owner>lizeb@chromium.org</owner> + <owner>cct-team@google.com</owner> <summary> Recorded only on Android. Whether a parallel request was requested by the calling application, and if so its initial status. Recorded once per handled @@ -49994,14 +49998,18 @@ </summary> </histogram> -<histogram name="Extensions.NetworkDelay" units="ms" expires_after="M81"> +<histogram name="Extensions.NetworkDelay" units="ms" expires_after="2020-12-31"> <owner>battre@chromium.org</owner> + <owner>karandeepb@chromium.org</owner> + <owner>extensions-core@chromium.org</owner> <summary>Time that network requests were blocked due to extensions.</summary> </histogram> <histogram name="Extensions.NetworkDelayPercentage" units="%" - expires_after="M81"> + expires_after="2020-12-31"> <owner>battre@chromium.org</owner> + <owner>karandeepb@chromium.org</owner> + <owner>extensions-core@chromium.org</owner> <summary> Percentage of total lifetime a network request was blocked due to an extension. @@ -108713,7 +108721,7 @@ </histogram> <histogram name="PasswordManager.FillingAssistance" - enum="PasswordManagerFillingAssistance" expires_after="2020-02-01"> + enum="PasswordManagerFillingAssistance" expires_after="2021-02-01"> <owner>dvadym@chromium.org</owner> <owner>battre@chromium.org</owner> <summary> @@ -138887,8 +138895,10 @@ </histogram> <histogram name="ServiceWorkerCache.CacheStorage" units="ms" - expires_after="M81"> + expires_after="2021-01-15"> <owner>dmurph@chromium.org</owner> + <owner>wanderview@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> <summary> The time to perform operations on the CacheStorage object in the ServiceWorker Cache API. @@ -138928,8 +138938,9 @@ </histogram> <histogram name="ServiceWorkerCache.ErrorStorageType" - enum="CacheStorageErrorStorageType" expires_after="M81"> + enum="CacheStorageErrorStorageType" expires_after="2021-01-15"> <owner>wanderview@chromium.org</owner> + <owner>chrome-owp-storage@google.com</owner> <summary> Records where the generic kErrorStorage value is triggered within the cache_storage code. @@ -142161,8 +142172,9 @@ </histogram> <histogram name="Signin.AndroidPopulateAccountCacheWaitingTime" units="ms" - expires_after="2020-02-16"> + expires_after="2020-08-16"> <owner>bsazonov@chromium.org</owner> + <owner>chrome-signin-team@google.com</owner> <summary> The time UI thread spent waiting for the list of accounts to be populated. </summary> @@ -153775,14 +153787,15 @@ </summary> </histogram> -<histogram name="Sync.USSMigrationFailure" enum="SyncModelTypes"> +<histogram name="Sync.USSMigrationFailure" enum="SyncModelTypes" + expires_after="2020-06-30"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <summary>Counts directory to USS migration failures per model type.</summary> </histogram> <histogram name="Sync.USSMigrationSuccess" enum="SyncModelTypes" - expires_after="M81"> + expires_after="2020-06-30"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <summary>Counts directory to USS migration successes per model type.</summary>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index fdccc24..e31407c 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -8319,6 +8319,135 @@ </metric> </event> +<event name="SmartCharging"> + <owner>thanhdng@chromium.org</owner> + <owner>jiameng@chromium.org</owner> + <summary> + Records user activities that are related to charging such as battery + percentage, time, device type, etc. + </summary> + <metric name="BatteryPercentage"> + <summary> + Percentage of the battery. + </summary> + </metric> + <metric name="BatteryPercentageBeforeLastCharge"> + <summary> + The percentage of the battery at the beginning of the last charge. + </summary> + </metric> + <metric name="BatteryPercentageOfLastCharge"> + <summary> + The percentage of the battery that the last charge reached. + </summary> + </metric> + <metric name="DayOfMonth"> + <summary> + Event's day of the month (e.g. 1-31) in local time zone. + </summary> + </metric> + <metric name="DayOfWeek" enum="DayOfWeek"> + <summary> + Event's day of the week in local time zone. Sunday is 0. + </summary> + </metric> + <metric name="DeviceMode"> + <summary> + Mode of the device (e.g. closed lid, tablet). + </summary> + </metric> + <metric name="DeviceType"> + <summary> + Type of the device (e.g. laptop, tablet). + </summary> + </metric> + <metric name="DurationOfLastCharge"> + <summary> + Duratioin of the last time the device was charged in minutes. + </summary> + </metric> + <metric name="DurationRecentAudioPlaying"> + <summary> + Duration of audio playing in the last 30 minutes (bucketized and in + minutes). + </summary> + </metric> + <metric name="DurationRecentVideoPlaying"> + <summary> + Duration of video playing in the last 30 minutes (bucketized and in + minutes). + </summary> + </metric> + <metric name="EventId"> + <summary> + A unique number that represent order of an event. + </summary> + </metric> + <metric name="HaltFromLastCharge" enum="Boolean"> + <summary> + Whether there's any shutdown/suspend actions between the last charge and + current event. + </summary> + </metric> + <metric name="Month" enum="Month"> + <summary> + Event's month (e.g. Jan-Dec) in local time zone. January is 1. + </summary> + </metric> + <metric name="NumRecentKeyEvents"> + <summary> + Number of key events in past 30 minutes. + </summary> + </metric> + <metric name="NumRecentMouseEvents"> + <summary> + Number of mouse events in past 30 minutes. + </summary> + </metric> + <metric name="NumRecentStylusEvents"> + <summary> + Number of stylus events in past 30 minutes. + </summary> + </metric> + <metric name="NumRecentTouchEvents"> + <summary> + Number of touch events in past 30 minutes. + </summary> + </metric> + <metric name="Reason" enum="SmartChargingReason"> + <summary> + Reason for the logging of an event. + </summary> + </metric> + <metric name="ScreenBrightnessPercent"> + <summary> + Brightness of the screen in percent. + </summary> + </metric> + <metric name="TimeOfTheDay"> + <summary> + Time of the event in minutes since midnight in the local time zone. + </summary> + </metric> + <metric name="TimeSinceLastCharge"> + <summary> + Time since the last time user unplugged the charger in minutes. + </summary> + </metric> + <metric name="TimezoneDifferenceFromLastCharge"> + <summary> + Timezone difference from the last charge. It is equal to current_timezone + - timezone_from_last_charge. The valid range of time zone value will be + -12 (UTC -12:00) to +14 (UTC +14:00). + </summary> + </metric> + <metric name="Voltage"> + <summary> + Charge voltage in mV. + </summary> + </metric> +</event> + <event name="SMSReceiver"> <owner>goto@chromium.org</owner> <owner>reillyg@chromium.org</owner>
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index 51980bb..5078ca1 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -664,7 +664,7 @@ # button click it to enable further scroll. This button would only be added # after we scrolled a bit. So can't wait for this button at the start. accepted_continue = False - for _ in xrange(25): + for _ in xrange(15): result = action_runner.EvaluateJavaScript( 'document.querySelectorAll(".Button-tertiary").length') if result and not accepted_continue:
diff --git a/ui/base/clipboard/BUILD.gn b/ui/base/clipboard/BUILD.gn index 57138fa8..0ef99650 100644 --- a/ui/base/clipboard/BUILD.gn +++ b/ui/base/clipboard/BUILD.gn
@@ -45,7 +45,7 @@ sources += [ "clipboard_format_type.h" ] } - defines = [ "IS_BASE_CLIPBOARD_TYPES_IMPL" ] + defines = [ "IS_UI_BASE_CLIPBOARD_TYPES_IMPL" ] deps = [ "//base", @@ -100,7 +100,7 @@ ] } - defines = [ "IS_BASE_CLIPBOARD_IMPL" ] + defines = [ "IS_UI_BASE_CLIPBOARD_IMPL" ] deps = [ "//base",
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h index 6e1d1d1..7196792d 100644 --- a/ui/base/clipboard/clipboard.h +++ b/ui/base/clipboard/clipboard.h
@@ -39,7 +39,8 @@ // - specifies an ordering in which to write types to the clipboard // (see PortableFormat). // - is generalized for all targets/operating systems. -class COMPONENT_EXPORT(BASE_CLIPBOARD) Clipboard : public base::ThreadChecker { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) Clipboard + : public base::ThreadChecker { public: static bool IsSupportedClipboardBuffer(ClipboardBuffer buffer) { switch (buffer) {
diff --git a/ui/base/clipboard/clipboard_android.h b/ui/base/clipboard/clipboard_android.h index 34b96d5..8b0440f 100644 --- a/ui/base/clipboard/clipboard_android.h +++ b/ui/base/clipboard/clipboard_android.h
@@ -43,11 +43,11 @@ int64_t GetLastModifiedTimeToJavaTime(JNIEnv* env); // Sets the callback called whenever the clipboard is modified. - COMPONENT_EXPORT(BASE_CLIPBOARD) + COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void SetModifiedCallback(ModifiedCallback cb); // Sets the last modified time without calling the above callback. - COMPONENT_EXPORT(BASE_CLIPBOARD) + COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void SetLastModifiedTimeWithoutRunningCallback(base::Time time); private:
diff --git a/ui/base/clipboard/clipboard_constants.h b/ui/base/clipboard/clipboard_constants.h index 1b4ebdc1..d493e6c 100644 --- a/ui/base/clipboard/clipboard_constants.h +++ b/ui/base/clipboard/clipboard_constants.h
@@ -21,33 +21,35 @@ namespace ui { // Platform-Neutral MIME type constants. -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeText[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeTextUtf8[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeURIList[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeDownloadURL[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeMozillaURL[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeHTML[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeRTF[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypePNG[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeText[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeTextUtf8[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeURIList[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) +extern const char kMimeTypeDownloadURL[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) +extern const char kMimeTypeMozillaURL[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeHTML[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeRTF[]; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypePNG[]; #if !defined(OS_MACOSX) -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeWebCustomData[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypeWebkitSmartPaste[]; -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern const char kMimeTypePepperCustomData[]; #else // MacOS-specific Uniform Type Identifiers. // Pickled data. -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern NSString* const kWebCustomDataPboardType; // Tells us if WebKit was the last to write to the pasteboard. There's no // actual data associated with this type. -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern NSString* const kWebSmartPastePboardType; // Pepper custom data format type. -COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) extern NSString* const kPepperCustomDataPboardType; #endif // defined(OS_MACOSX)
diff --git a/ui/base/clipboard/clipboard_format_type.h b/ui/base/clipboard/clipboard_format_type.h index 0d45d94d..741c064 100644 --- a/ui/base/clipboard/clipboard_format_type.h +++ b/ui/base/clipboard/clipboard_format_type.h
@@ -29,7 +29,7 @@ // Platform neutral holder for native data representation of a clipboard type. // Copyable and assignable, since this is an opaque value type. -struct COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) ClipboardFormatType { +struct COMPONENT_EXPORT(UI_BASE_CLIPBOARD_TYPES) ClipboardFormatType { ClipboardFormatType(); ~ClipboardFormatType();
diff --git a/ui/base/clipboard/clipboard_mac.h b/ui/base/clipboard/clipboard_mac.h index a5f86e28..6dea617 100644 --- a/ui/base/clipboard/clipboard_mac.h +++ b/ui/base/clipboard/clipboard_mac.h
@@ -17,7 +17,7 @@ namespace ui { -class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardMac : public Clipboard { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ClipboardMac : public Clipboard { private: FRIEND_TEST_ALL_PREFIXES(ClipboardMacTest, ReadImageRetina); FRIEND_TEST_ALL_PREFIXES(ClipboardMacTest, ReadImageNonRetina);
diff --git a/ui/base/clipboard/clipboard_monitor.h b/ui/base/clipboard/clipboard_monitor.h index bb03186..a1711f2a 100644 --- a/ui/base/clipboard/clipboard_monitor.h +++ b/ui/base/clipboard/clipboard_monitor.h
@@ -17,7 +17,7 @@ // A singleton instance to monitor and notify ClipboardObservers for clipboard // changes. -class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardMonitor { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ClipboardMonitor { public: static ClipboardMonitor* GetInstance();
diff --git a/ui/base/clipboard/clipboard_observer.h b/ui/base/clipboard/clipboard_observer.h index 99c1c5b..d630581 100644 --- a/ui/base/clipboard/clipboard_observer.h +++ b/ui/base/clipboard/clipboard_observer.h
@@ -11,7 +11,7 @@ namespace ui { // Observer that receives the notifications of clipboard change events. -class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardObserver { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ClipboardObserver { public: // Called when clipboard data is changed. virtual void OnClipboardDataChanged() = 0;
diff --git a/ui/base/clipboard/clipboard_util_mac.h b/ui/base/clipboard/clipboard_util_mac.h index 8901521..c65fd6d8 100644 --- a/ui/base/clipboard/clipboard_util_mac.h +++ b/ui/base/clipboard/clipboard_util_mac.h
@@ -16,9 +16,9 @@ // A publicly-used UTI for the name of a URL. It really should be in a system // header but isn't. -COMPONENT_EXPORT(BASE_CLIPBOARD) extern NSString* const kUTTypeURLName; +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) extern NSString* const kUTTypeURLName; -class COMPONENT_EXPORT(BASE_CLIPBOARD) UniquePasteboard +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) UniquePasteboard : public base::RefCounted<UniquePasteboard> { public: UniquePasteboard(); @@ -31,7 +31,7 @@ base::scoped_nsobject<NSPasteboard> pasteboard_; }; -class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardUtil { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ClipboardUtil { public: // Returns an NSPasteboardItem that represents the given |url|. // |url| must not be nil.
diff --git a/ui/base/clipboard/clipboard_util_win.h b/ui/base/clipboard/clipboard_util_win.h index 0a02c28..dc60fc8 100644 --- a/ui/base/clipboard/clipboard_util_win.h +++ b/ui/base/clipboard/clipboard_util_win.h
@@ -21,7 +21,7 @@ namespace ui { // Contains helper functions for working with the clipboard and IDataObjects. -class COMPONENT_EXPORT(BASE_CLIPBOARD) ClipboardUtil { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ClipboardUtil { public: ///////////////////////////////////////////////////////////////////////////// // These methods check to see if |data_object| has the requested type.
diff --git a/ui/base/clipboard/custom_data_helper.h b/ui/base/clipboard/custom_data_helper.h index fc1bf96..f4537272 100644 --- a/ui/base/clipboard/custom_data_helper.h +++ b/ui/base/clipboard/custom_data_helper.h
@@ -25,27 +25,27 @@ namespace ui { -COMPONENT_EXPORT(BASE_CLIPBOARD) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void ReadCustomDataTypes(const void* data, size_t data_length, std::vector<base::string16>* types); -COMPONENT_EXPORT(BASE_CLIPBOARD) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void ReadCustomDataForType(const void* data, size_t data_length, const base::string16& type, base::string16* result); -COMPONENT_EXPORT(BASE_CLIPBOARD) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void ReadCustomDataIntoMap( const void* data, size_t data_length, std::unordered_map<base::string16, base::string16>* result); -COMPONENT_EXPORT(BASE_CLIPBOARD) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void WriteCustomDataToPickle( const std::unordered_map<base::string16, base::string16>& data, base::Pickle* pickle); -COMPONENT_EXPORT(BASE_CLIPBOARD) +COMPONENT_EXPORT(UI_BASE_CLIPBOARD) void WriteCustomDataToPickle( const base::flat_map<base::string16, base::string16>& data, base::Pickle* pickle);
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h index 741de36..d0e5cfb 100644 --- a/ui/base/clipboard/scoped_clipboard_writer.h +++ b/ui/base/clipboard/scoped_clipboard_writer.h
@@ -27,7 +27,7 @@ // Upon deletion, the class atomically writes all data to the clipboard, // avoiding any potential race condition with other processes that are also // writing to the system clipboard. -class COMPONENT_EXPORT(BASE_CLIPBOARD) ScopedClipboardWriter { +class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter { public: // Create an instance that is a simple wrapper around the clipboard of the // given buffer.
diff --git a/ui/file_manager/file_manager/foreground/images/files/ui/search_clear_filled.svg b/ui/file_manager/file_manager/foreground/images/files/ui/search_clear_filled.svg new file mode 100644 index 0000000..e1b4145b --- /dev/null +++ b/ui/file_manager/file_manager/foreground/images/files/ui/search_clear_filled.svg
@@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M10 2c4.424 0 8 3.576 8 8 0 4.424-3.576 8-8 8-4.424 0-8-3.576-8-8 0-4.424 3.576-8 8-8zm2.1213 4.4645L10 8.5858 7.8787 6.4645 6.4645 7.8787 8.5858 10l-2.1213 2.1213 1.4142 1.4142L10 11.4142l2.1213 2.1213 1.4142-1.4142L11.4142 10l2.1213-2.1213-1.4142-1.4142z"/></svg> \ No newline at end of file
diff --git a/ui/file_manager/integration_tests/file_manager/quick_view.js b/ui/file_manager/integration_tests/file_manager/quick_view.js index ddb9ed9..8f77e41 100644 --- a/ui/file_manager/integration_tests/file_manager/quick_view.js +++ b/ui/file_manager/integration_tests/file_manager/quick_view.js
@@ -732,6 +732,61 @@ }; /** + * Tests opening Quick View containing an audio file that has an album art + * image in its metadata. + */ + testcase.openQuickViewAudioWithImageMetadata = async () => { + const caller = getCaller(); + + // Define a test file containing audio file with metadata. + const id3Audio = new TestEntryInfo({ + type: EntryType.FILE, + sourceFileName: 'id3Audio.mp3', + targetPath: 'id3Audio.mp3', + mimeType: 'audio/mpeg', + lastModifiedTime: 'December 25 2015, 11:16 PM', + nameText: 'id3Audio.mp3', + sizeText: '5KB', + typeText: 'id3 encoded MP3 audio', + }); + + /** + * The <webview> resides in the <files-safe-media> shadow DOM, which + * is a child of the #quick-view shadow DOM. + */ + const albumArtWebView = ['#quick-view', '#audio-artwork', 'webview']; + + // Open Files app on Downloads containing the audio test file. + const appId = + await setupAndWaitUntilReady(RootPath.DOWNLOADS, [id3Audio], []); + + // Open the file in Quick View. + await openQuickView(appId, id3Audio.nameText); + + // Wait for the Quick View <webview> to load and display its content. + function checkWebViewImageLoaded(elements) { + let haveElements = Array.isArray(elements) && elements.length === 1; + if (haveElements) { + haveElements = elements[0].styles.display.includes('block'); + } + if (!haveElements || elements[0].attributes.loaded !== '') { + return pending(caller, 'Waiting for <webview> to load.'); + } + return; + } + + // Wait until the <webview> has loaded the album image of the audio file. + await repeatUntil(async () => { + return checkWebViewImageLoaded(await remoteCall.callRemoteTestUtil( + 'deepQueryAllElements', appId, [albumArtWebView, ['display']])); + }); + + // Check: the audio album metadata should also be displayed. + const album = await getQuickViewMetadataBoxField(appId, 'Album'); + chrome.test.assertEq(album, 'OK Computer'); + }; + + /** * Tests opening Quick View containing an image. */ testcase.openQuickViewImage = async () => {
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/BrowserImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/BrowserImpl.java index 3628372..6fadce47 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/BrowserImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/BrowserImpl.java
@@ -108,6 +108,10 @@ return mViewController; } + public Context getContext() { + return mWindowAndroid.getContext().get(); + } + @Override public IProfile getProfile() { StrictModeWorkaround.apply();