diff --git a/AUTHORS b/AUTHORS index d1911a8..61c46e8 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -400,6 +400,7 @@ Ergun Erdogmus <erdogmusergun@gmail.com> Eric Ahn <byungwook.ahn@gmail.com> Eric Huang <ele828@gmail.com> +Eric Long <i@hack3r.moe> Eric Rescorla <ekr@rtfm.com> Erik Hill <erikghill@gmail.com> Erik Kurzinger <ekurzinger@gmail.com>
diff --git a/DEPS b/DEPS index fadb966..17c3e818 100644 --- a/DEPS +++ b/DEPS
@@ -304,7 +304,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. - 'src_internal_revision': '4e05864666c58f0cc169127b45bd44f103b594fc', + 'src_internal_revision': '342050dfbbbfe808eb799cd2fe817987cf111f57', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. @@ -312,11 +312,11 @@ # 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': '563bff0b6e7bc8dd9cac09321dbf9aa2c7fc6ed9', + 'v8_revision': '2a06d4e3534debe1294744c208e85d8c4f06d579', # 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': '8f6b295aac73fc2c6a2954778b6c701b9805ebbd', + 'angle_revision': 'a00babd8a64d4e7b983cdb450528c7f8ba70596f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -324,14 +324,14 @@ # 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': 'f98c54df162cd2a9324dad9e5b9453425311527d', + 'pdfium_revision': '3c0b08ceabaeb34ff741b2615451f6a73b3ccbab', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. # # Note this revision should be updated with # third_party/boringssl/roll_boringssl.py, not roll-dep. - 'boringssl_revision': '2db0eb3f96a5756298dcd7f9319e56a98585bd10', + 'boringssl_revision': '2fb5f9cb8feec2234952f6999af941ac48555710', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. @@ -383,7 +383,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. - 'chromium_variations_revision': 'c8c20e469d74f2293dd00320ae59437b281ce2ad', + 'chromium_variations_revision': 'e2f29f64474ebe519844379b4746e98d6ce254e4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. @@ -399,7 +399,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': '33a09fb44a6f593270589acfac482d9b275b389c', + 'devtools_frontend_revision': '6b13b7f0b3a0bdd36b26dee0b398e5d1cd8c1f43', # 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. @@ -423,7 +423,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': 'd5268798a2076b59f4cc5e386d3a87ce3d35dcaa', + 'dawn_revision': 'f22e61ff624c0c4b9b8961a49680ff0073960cfe', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -471,7 +471,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. - 'cros_components_revision': 'b17d398e7b03f3dbef6b7debee507396062b5f08', + 'cros_components_revision': 'f2d69fd1ec90a1e8a8571bc5e0e53337a126a60c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -479,7 +479,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. - 'libcxxabi_revision': 'a37a3aa431f132b02a58656f13984d51098330a2', + 'libcxxabi_revision': 'fc3fb0729ef1197d815bc6711f10640cc5cb9f2d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -1004,12 +1004,12 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '9e0c16ba7803a6362dc0f1504a171f38b08a8423', + 'f9eff279fd00590f59edbb76948b771ec10c9a36', 'condition': 'checkout_android and checkout_src_internal', }, 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + '2b7cfaa61f6bba49ecef7b8b050188c6a2103b66', + 'url': Var('chromium_git') + '/website.git' + '@' + '12e229a0a2a544144430dfa389933ccc869ad72b', }, 'src/ios/third_party/earl_grey2/src': { @@ -1163,7 +1163,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'v7Devo4icVeg_Fi4h6o1emunjka-gsVK2qENAz83sdMC', + 'version': '_KUCLJC7Jv_2FGvul65nK9A_bmVkPwBIXcE4dCqBf-QC', }, ], 'condition': 'checkout_android', @@ -1234,7 +1234,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_build_tools/manifest_merger', - 'version': 'tL_JG7yL7RqVT4RB2rD5aN3xhRGKPh-V87_YnzX_eSwC', + 'version': 'let00MLFVBLhc9quEKtUuTMxC_vL8cvLoxiRSF2M4nkC', }, ], 'condition': 'checkout_android', @@ -1460,13 +1460,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'f97b5e242423158b83bcd9ca518dbd3b13cd85d3', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '6708d95ec6d819098093cd57c746636a5bb9a4ea', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '7ff0acfea354b4043618f5d0b24c23b0f8fb829c', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '6c2eb915ee80cc23b728d9730e80427b3c21b8cf', 'condition': 'checkout_src_internal', }, @@ -1930,7 +1930,7 @@ Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '09a4f3ec842a8932341b195c5b01e141c8a16eb7', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + 'a74a035f778762b1c31ae1e9393eefdbf07be714', + Var('chromium_git') + '/openscreen' + '@' + 'c474965ed417600b6964f6d7ef4657c493dfc8a2', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '95fe35ffb383710a6e0567e958ead9a3b66e930c', @@ -1956,7 +1956,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'a056c122b9a4c09797d3f09fdf4671657ff98240', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'cb380924121f7b210ea622818a697c0348b0652d', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '8ef97ff3b7332e38e61b347a2fbed425a4617151', @@ -1993,7 +1993,7 @@ }, 'src/third_party/re2/src': - Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + 'b7e96b34c0945fccb8b5282404f82c7ab0843717', + Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + 'a67d6c1d5308b0950a91fed8e03e5c048d22d5cd', 'src/third_party/r8': { 'packages': [ @@ -2049,7 +2049,7 @@ Var('chromium_git') + '/external/github.com/google/snappy.git' + '@' + 'c9f9edf6d75bb065fa47468bf035e051a57bec7c', 'src/third_party/sqlite/src': - Var('chromium_git') + '/chromium/deps/sqlite.git' + '@' + '1ee793e63351333e2089d4b272e15574502ff0c2', + Var('chromium_git') + '/chromium/deps/sqlite.git' + '@' + '9e45bccab2b8de8140c1732b0ec490db0362f730', 'src/third_party/sqlite4java': { 'packages': [ @@ -2173,7 +2173,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '007e1015875a0a91794edbc14feb3ad5fe60f90b', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '7518ae9ac92f7020daa38de3fb87de9a5e875872', + Var('webrtc_git') + '/src.git' + '@' + '57c2f35cfc2da8b7b507709237a7fe9791fc64e0', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -4350,7 +4350,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '9026cbaf11679a8d8aaf6ae05dc7e8d016487961', + '5015c9cb9b8a8b5bd5dcfd6cbaa7b41e1d2af2d7', 'condition': 'checkout_src_internal', }, @@ -4410,7 +4410,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '777169d126a0d105da7e96ff3f5afcb2cb9482fb', + '54145af98bd28f2dad4c56e23740832d19980c64', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/android_webview/browser/aw_field_trials.cc b/android_webview/browser/aw_field_trials.cc index 1e2d67b..3bf55fc 100644 --- a/android_webview/browser/aw_field_trials.cc +++ b/android_webview/browser/aw_field_trials.cc
@@ -200,4 +200,9 @@ // TODO(crbug.com/40272633): Web MIDI permission prompt for all usage. aw_feature_overrides.DisableFeature(blink::features::kBlockMidiByDefault); + + // Disable device posture API as the framework implementation causes + // AwContents to leak in apps that don't call destroy(). + aw_feature_overrides.DisableFeature(blink::features::kDevicePosture); + aw_feature_overrides.DisableFeature(blink::features::kViewportSegments); }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java b/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java index 7f757f9..e3f3d75 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java +++ b/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
@@ -353,7 +353,7 @@ if (rect.bottom > screenBottom) { int oneThirdOfScreenHeight = mContainerViewHeight / 3; - if (rect.width() > 2 * oneThirdOfScreenHeight) { + if (rect.height() > 2 * oneThirdOfScreenHeight) { // If the rectangle is too tall to fit in the bottom two thirds // of the screen, place it at the top. scrollYDelta = rect.top - screenTop;
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 8d8b7b9..517bc49 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -998,6 +998,9 @@ "Optimize handling of static properties during animations."), Flag.baseFeature("LazyBindJsInjection"), Flag.baseFeature(AwFeatures.WEBVIEW_MUTE_AUDIO, "Enables WebView audio to be muted."), + Flag.baseFeature( + BlinkFeatures.CONCURRENT_VIEW_TRANSITIONS_SPA, + "Allows concurrent transitions in local frames rendered in the same process"), // Add new commandline switches and features above. The final entry should have a // trailing comma for cleaner diffs. };
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwPrerenderTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwPrerenderTest.java index 4f1e6e3..95bb389 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwPrerenderTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwPrerenderTest.java
@@ -37,7 +37,6 @@ import org.chromium.components.embedder_support.util.WebResourceResponseInfo; import org.chromium.content_public.browser.test.util.TestCallbackHelperContainer.OnPageStartedHelper; import org.chromium.content_public.browser.test.util.TestThreadUtils; -import org.chromium.content_public.common.ContentFeatures; import java.io.FileInputStream; import java.io.UnsupportedEncodingException; @@ -338,7 +337,7 @@ @Test @LargeTest @Feature({"AndroidWebView"}) - @Features.EnableFeatures({ContentFeatures.PRERENDER2_NO_VARY_SEARCH}) + @Features.EnableFeatures({BlinkFeatures.PRERENDER2_NO_VARY_SEARCH}) @Features.DisableFeatures({BlinkFeatures.PRERENDER2_MEMORY_CONTROLS}) public void testNoVarySearchHeader() throws Throwable { setPreloadingAllowed(PreloadingAllowedFlags.PRERENDER_ENABLED); @@ -370,7 +369,7 @@ @Test @LargeTest @Feature({"AndroidWebView"}) - @Features.EnableFeatures({ContentFeatures.PRERENDER2_NO_VARY_SEARCH}) + @Features.EnableFeatures({BlinkFeatures.PRERENDER2_NO_VARY_SEARCH}) @Features.DisableFeatures({BlinkFeatures.PRERENDER2_MEMORY_CONTROLS}) public void testNoVarySearchHeaderUnignorableSearchParam() throws Throwable { setPreloadingAllowed(PreloadingAllowedFlags.PRERENDER_ENABLED);
diff --git a/android_webview/nonembedded/component_updater/registration.cc b/android_webview/nonembedded/component_updater/registration.cc index 25bd290..cb34ceb 100644 --- a/android_webview/nonembedded/component_updater/registration.cc +++ b/android_webview/nonembedded/component_updater/registration.cc
@@ -98,7 +98,9 @@ std::make_unique<component_updater:: TrustTokenKeyCommitmentsComponentInstallerPolicy>( /* on_commitments_ready= */ base::BindRepeating( - [](const std::string& raw_commitments) { NOTREACHED(); }))); + [](const std::string& raw_commitments) { + NOTREACHED_IN_MIGRATION(); + }))); } base::RepeatingClosure barrier_closure = base::BarrierClosure(
diff --git a/android_webview/test/shared.gni b/android_webview/test/shared.gni index 44489b42..99df850 100644 --- a/android_webview/test/shared.gni +++ b/android_webview/test/shared.gni
@@ -41,6 +41,7 @@ "//components/policy/android:policy_java_test_support", "//content/public/android:content_java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_test_monitor_java", "//third_party/androidx_javascriptengine:javascriptengine_java", "//third_party/jni_zero:jni_zero_java", "//third_party/junit",
diff --git a/android_webview/test/shell/src/draw_fn/context_manager.cc b/android_webview/test/shell/src/draw_fn/context_manager.cc index 85de00a..99c14490 100644 --- a/android_webview/test/shell/src/draw_fn/context_manager.cc +++ b/android_webview/test/shell/src/draw_fn/context_manager.cc
@@ -458,7 +458,7 @@ protected: SkRect onGetBounds() override { return SkRect::MakeWH(width_, height_); } - void onDraw(SkCanvas*) override { NOTREACHED(); } + void onDraw(SkCanvas*) override { NOTREACHED_IN_MIGRATION(); } std::unique_ptr<GpuDrawHandler> onSnapGpuDrawHandler( GrBackendApi backend_api,
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java b/android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java index 7fc37944..c6e2cc9 100644 --- a/android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java +++ b/android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java
@@ -5,6 +5,7 @@ package org.chromium.android_webview.test; import androidx.annotation.CallSuper; +import androidx.test.InstrumentationRegistry; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; @@ -32,6 +33,9 @@ // This should match the definition in Android test runner scripts: bit.ly/3ynoREM private static final String MULTIPROCESS_TEST_NAME_SUFFIX = "__multiprocess_mode"; + private static final String ONLY_RUN_MULTI_PROCESS_MODE_FLAG = + "AwJUnit4ClassRunner.MultiProcessOnly"; + private final TestHook mWebViewMultiProcessHook = (targetContext, testMethod) -> { if (testMethod instanceof WebViewMultiProcessFrameworkMethod) { @@ -77,11 +81,18 @@ @Override protected List<FrameworkMethod> getChildren() { + boolean runSingleProcess = + !"true" + .equals( + InstrumentationRegistry.getArguments() + .getString(ONLY_RUN_MULTI_PROCESS_MODE_FLAG)); List<FrameworkMethod> result = new ArrayList<>(); for (FrameworkMethod method : computeTestMethods()) { switch (processModeForMethod(method)) { case SINGLE_PROCESS: - result.add(method); + if (runSingleProcess) { + result.add(method); + } break; case MULTI_PROCESS: result.add(new WebViewMultiProcessFrameworkMethod(method)); @@ -89,7 +100,9 @@ case SINGLE_AND_MULTI_PROCESS: default: result.add(new WebViewMultiProcessFrameworkMethod(method)); - result.add(method); + if (runSingleProcess) { + result.add(method); + } break; } }
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index b8a441f..8c0a90d 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1689,6 +1689,8 @@ "system/focus_mode/sounds/sound_section_view.h", "system/focus_mode/sounds/soundscape/soundscape_types.cc", "system/focus_mode/sounds/soundscape/soundscape_types.h", + "system/focus_mode/sounds/soundscape/soundscapes_downloader.cc", + "system/focus_mode/sounds/soundscape/soundscapes_downloader.h", "system/focus_mode/youtube_music/youtube_music_client.cc", "system/focus_mode/youtube_music/youtube_music_client.h", "system/focus_mode/youtube_music/youtube_music_controller.cc", @@ -3901,6 +3903,7 @@ "system/focus_mode/focus_mode_task_test_utils.h", "system/focus_mode/focus_mode_tray_unittest.cc", "system/focus_mode/sounds/soundscape/soundscape_types_unittest.cc", + "system/focus_mode/sounds/soundscape/soundscapes_downloader_unittest.cc", "system/geolocation/geolocation_controller_test_util.cc", "system/geolocation/geolocation_controller_test_util.h", "system/geolocation/geolocation_controller_unittest.cc",
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 4dfd9eac..c869e65 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -7876,6 +7876,9 @@ <message name="IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_RIGHT_CLICK_DISABLED" desc="The message shown to notify a user that the shortcut used to simulate a right-click using touchpad and keyboard is disabled."> The right-click shortcut is currently off </message> + <message name="IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_BATTERY_DESCRIPTION" translateable="false" desc="Label used in the first-time connection notification to show battery information for a connected bluetooth device."> + Battery level: <ph name="BATTERY_PERCENTAGE">$1<ex>98</ex></ph>% + </message> <message name="IDS_ASH_DEVICE_SETTINGS_SIX_PACK_KEY_INSERT" desc="Label for the Insert 6-pack key."> insert </message>
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index f36b7a2..3035e1c 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -2515,15 +2515,12 @@ base::FEATURE_DISABLED_BY_DEFAULT); // Enables or disables fingerprint quick unlock. +// Note, that this feature is set from session manager via +// command-line flag. BASE_FEATURE(kQuickUnlockFingerprint, "QuickUnlockFingerprint", base::FEATURE_DISABLED_BY_DEFAULT); -// Controls whether the PIN auto submit feature is enabled. -BASE_FEATURE(kQuickUnlockPinAutosubmit, - "QuickUnlockPinAutosubmit", - base::FEATURE_ENABLED_BY_DEFAULT); - // TODO(crbug.com/1104164) - Remove this once most // users have their preferences backfilled. // Controls whether the PIN auto submit backfill operation should be performed. @@ -2971,6 +2968,11 @@ // Enables or disables web API support for ChromeOS video conferencing. BASE_FEATURE(kVcWebApi, "VcWebApi", base::FEATURE_DISABLED_BY_DEFAULT); +// Enables versioned wallpaper info. +BASE_FEATURE(kVersionedWallpaperInfo, + "VersionedWallpaperInfo", + base::FEATURE_DISABLED_BY_DEFAULT); + // Enable or disable global preferences for skin tone and gender in the virtual // keyboard emoji picker. BASE_FEATURE(kVirtualKeyboardGlobalEmojiPreferences, @@ -2997,11 +2999,6 @@ "WallpaperGooglePhotosSharedAlbums", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables wallpaper info improvement. -BASE_FEATURE(kWallpaperInfoImprovement, - "WallpaperInfoImprovement", - base::FEATURE_DISABLED_BY_DEFAULT); - // Enable different wallpapers per desk. BASE_FEATURE(kWallpaperPerDesk, "WallpaperPerDesk", @@ -4272,10 +4269,6 @@ return base::FeatureList::IsEnabled(kQuickUnlockPinAutosubmitBackfill); } -bool IsPinAutosubmitFeatureEnabled() { - return base::FeatureList::IsEnabled(kQuickUnlockPinAutosubmit); -} - bool IsPipDoubleTapToResizeEnabled() { return base::FeatureList::IsEnabled(kPipDoubleTapToResize); } @@ -4592,6 +4585,10 @@ return base::FeatureList::IsEnabled(kVcWebApi) && IsVideoConferenceEnabled(); } +bool IsVersionWallpaperInfoEnabled() { + return base::FeatureList::IsEnabled(kVersionedWallpaperInfo); +} + bool IsWallpaperFastRefreshEnabled() { return base::FeatureList::IsEnabled(kWallpaperFastRefresh); } @@ -4600,10 +4597,6 @@ return base::FeatureList::IsEnabled(kWallpaperGooglePhotosSharedAlbums); } -bool IsWallpaperInfoImprovementEnabled() { - return base::FeatureList::IsEnabled(kWallpaperInfoImprovement); -} - bool IsWallpaperPerDeskEnabled() { return base::FeatureList::IsEnabled(kWallpaperPerDesk); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 3f125c12..6234b8b 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -768,7 +768,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kSmartReader); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kQuickAppAccessTestUI); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kQuickUnlockFingerprint); -COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kQuickUnlockPinAutosubmit); // TODO(crbug.com/1104164) - Remove this once most users have their preferences // backfilled. COMPONENT_EXPORT(ASH_CONSTANTS) @@ -903,6 +902,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kVcSegmentationModel); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kVcLightIntensity); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kVcWebApi); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kVersionedWallpaperInfo); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kFeatureManagementVideoConference); COMPONENT_EXPORT(ASH_CONSTANTS) @@ -915,7 +915,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWallpaperFastRefresh); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWallpaperGooglePhotosSharedAlbums); -COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWallpaperInfoImprovement); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWallpaperPerDesk); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWelcomeExperience); COMPONENT_EXPORT(ASH_CONSTANTS) @@ -1246,7 +1245,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPickerUpdateEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPickerFlipEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPinAutosubmitBackfillFeatureEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPinAutosubmitFeatureEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPipDoubleTapToResizeEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPipTuckEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLocalPrinterObservingEnabled(); @@ -1346,10 +1344,10 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsVcPortraitRelightEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsVcControlsUiFakeEffectsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsVcWebApiEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsVersionWallpaperInfoEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperFastRefreshEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperGooglePhotosSharedAlbumsEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperInfoImprovementEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperPerDeskEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWelcomeExperienceEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWelcomeTourChromeVoxSupported();
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index ddf191c..1ee81d5f 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -3842,7 +3842,7 @@ ~FontTestHelper() override { TearDown(); } // AshTestBase: - void TestBody() override { NOTREACHED(); } + void TestBody() override { NOTREACHED_IN_MIGRATION(); } }; bool IsTextSubpixelPositioningEnabled() {
diff --git a/ash/login/ui/login_auth_user_view_unittest.cc b/ash/login/ui/login_auth_user_view_unittest.cc index 9299ca32..457ded4 100644 --- a/ash/login/ui/login_auth_user_view_unittest.cc +++ b/ash/login/ui/login_auth_user_view_unittest.cc
@@ -139,19 +139,12 @@ nullptr; // Owned by test widget view hierarchy. }; -class LoginAuthUserViewUnittest : public LoginAuthUserViewTestBase, - /*autosubmit_feature*/ - public ::testing::WithParamInterface<bool> { +class LoginAuthUserViewUnittest : public LoginAuthUserViewTestBase { public: LoginAuthUserViewUnittest(const LoginAuthUserViewUnittest&) = delete; LoginAuthUserViewUnittest& operator=(const LoginAuthUserViewUnittest&) = delete; - static std::string ParamInfoToString( - testing::TestParamInfo<LoginAuthUserViewUnittest::ParamType> info) { - return info.param ? "AutosubmitEnabled" : "AutosubmitDisabled"; - } - protected: LoginAuthUserViewUnittest() = default; ~LoginAuthUserViewUnittest() override = default; @@ -159,33 +152,12 @@ // LoginTestBase: void SetUp() override { LoginAuthUserViewTestBase::SetUp(); - feature_list_.InitWithFeatureState(features::kQuickUnlockPinAutosubmit, - GetParam()); - InitializeViewForUser(CreateUser("user@domain.com")); - } -}; - -class LoginAuthUserViewAutosumbitUnittest : public LoginAuthUserViewTestBase { - public: - LoginAuthUserViewAutosumbitUnittest( - const LoginAuthUserViewAutosumbitUnittest&) = delete; - LoginAuthUserViewAutosumbitUnittest& operator=( - const LoginAuthUserViewAutosumbitUnittest&) = delete; - - protected: - LoginAuthUserViewAutosumbitUnittest() = default; - ~LoginAuthUserViewAutosumbitUnittest() override = default; - - // LoginTestBase: - void SetUp() override { - LoginAuthUserViewTestBase::SetUp(); - feature_list_.InitAndEnableFeature(features::kQuickUnlockPinAutosubmit); InitializeViewForUser(CreateUser("user@domain.com")); } }; // Verifies showing the PIN keyboard makes the user view grow. -TEST_P(LoginAuthUserViewUnittest, ShowingPinExpandsView) { +TEST_F(LoginAuthUserViewUnittest, ShowingPinExpandsView) { gfx::Size start_size = view_->size(); SetAuthMethods(LoginAuthUserView::AUTH_PASSWORD | LoginAuthUserView::AUTH_PIN); @@ -195,7 +167,7 @@ } // Verifies that an auth user that shows a password is opaque. -TEST_P(LoginAuthUserViewUnittest, ShowingPasswordForcesOpaque) { +TEST_F(LoginAuthUserViewUnittest, ShowingPasswordForcesOpaque) { LoginAuthUserView::TestApi auth_test(view_); LoginUserView::TestApi user_test(auth_test.user_view()); @@ -217,7 +189,7 @@ } // Verifies that password is cleared after AUTH_PASSWORD is disabled. -TEST_P(LoginAuthUserViewUnittest, +TEST_F(LoginAuthUserViewUnittest, PasswordClearedAfterAnimationIfPasswordDisabled) { LoginPasswordView::TestApi password_test(view_->password_view()); auto has_password = [&]() { @@ -240,7 +212,7 @@ EXPECT_FALSE(has_password()); } -TEST_P(LoginAuthUserViewUnittest, PasswordFieldChangeOnUpdateUser) { +TEST_F(LoginAuthUserViewUnittest, PasswordFieldChangeOnUpdateUser) { LoginAuthUserView::TestApi auth_test(view_); LoginPasswordView::TestApi password_test(auth_test.password_view()); @@ -263,7 +235,7 @@ ui::TEXT_INPUT_TYPE_PASSWORD); } -TEST_F(LoginAuthUserViewAutosumbitUnittest, ResetPinFieldOnUpdateUser) { +TEST_F(LoginAuthUserViewUnittest, ResetPinFieldOnUpdateUser) { LoginAuthUserView::TestApi auth_test(view_); LoginPinInputView* pin_input(auth_test.pin_input_view()); LoginPinInputView::TestApi pin_input_test_api(auth_test.pin_input_view()); @@ -288,7 +260,7 @@ // Tests that the appropriate InputFieldMode is used based on the exposed // length of the user's PIN. An exposed PIN length of zero (0) means that // auto submit is not being used. -TEST_P(LoginAuthUserViewUnittest, CorrectFieldModeForExposedPinLength) { +TEST_F(LoginAuthUserViewUnittest, CorrectFieldModeForExposedPinLength) { SetUserCount(1); for (int pin_length = 0; pin_length <= 64; pin_length++) { @@ -303,7 +275,7 @@ } // Tests the correctness of InputFieldMode::NONE -TEST_P(LoginAuthUserViewUnittest, ModesWithoutInputFields) { +TEST_F(LoginAuthUserViewUnittest, ModesWithoutInputFields) { LoginAuthUserView::TestApi auth_test(view_); LoginAuthUserView::AuthMethods methods_without_input[] = { LoginAuthUserView::AUTH_CHALLENGE_RESPONSE, @@ -319,7 +291,7 @@ // Tests the correctness of InputFieldMode::PASSWORD_ONLY. With only the // password field present and no PIN, the authentication call must // have 'authenticated_by_pin' as false. -TEST_P(LoginAuthUserViewUnittest, PasswordOnlyFieldMode) { +TEST_F(LoginAuthUserViewUnittest, PasswordOnlyFieldMode) { LoginAuthUserView::TestApi auth_test(view_); ui::test::EventGenerator* generator = GetEventGenerator(); auto client = std::make_unique<MockLoginScreenClient>(); @@ -350,7 +322,7 @@ * - Digits are correctly ignored when the field is set to read-only * - Submitting the credentials results in the correct auth call */ -TEST_P(LoginAuthUserViewUnittest, PinAndPasswordFieldModeCorrectness) { +TEST_F(LoginAuthUserViewUnittest, PinAndPasswordFieldModeCorrectness) { LoginAuthUserView::TestApi auth_test(view_); ui::test::EventGenerator* generator = GetEventGenerator(); auto client = std::make_unique<MockLoginScreenClient>(); @@ -394,7 +366,7 @@ * - Digits are correctly ignored when the field is set to read-only * - Submitting the last digit triggers the correct auth call */ -TEST_F(LoginAuthUserViewAutosumbitUnittest, PinWithToggleFieldModeCorrectness) { +TEST_F(LoginAuthUserViewUnittest, PinWithToggleFieldModeCorrectness) { LoginAuthUserView::TestApi auth_test(view_); auto client = std::make_unique<MockLoginScreenClient>(); LoginUserView* user_view(auth_test.user_view()); @@ -435,7 +407,7 @@ * mode that shows just the password field with the option to switch to PIN. * It is only available when the user has auto submit enabled. */ -TEST_F(LoginAuthUserViewAutosumbitUnittest, PwdWithToggleFieldModeCorrectness) { +TEST_F(LoginAuthUserViewUnittest, PwdWithToggleFieldModeCorrectness) { LoginAuthUserView::TestApi auth_test(view_); ui::test::EventGenerator* generator = GetEventGenerator(); auto client = std::make_unique<MockLoginScreenClient>(); @@ -467,11 +439,6 @@ base::RunLoop().RunUntilIdle(); } -INSTANTIATE_TEST_SUITE_P(LoginAuthUserViewTests, - LoginAuthUserViewUnittest, - testing::Bool(), // PIN autosubmit feature - LoginAuthUserViewUnittest::ParamInfoToString); - class LoginAuthUserViewOnlineUnittest : public LoginAuthUserViewTestBase, public ::testing::WithParamInterface<bool> {
diff --git a/ash/login/ui/login_pin_input_view.cc b/ash/login/ui/login_pin_input_view.cc index 0bfc701..0205423d 100644 --- a/ash/login/ui/login_pin_input_view.cc +++ b/ash/login/ui/login_pin_input_view.cc
@@ -192,8 +192,7 @@ } bool LoginPinInputView::IsAutosubmitSupported(int length) { - return features::IsPinAutosubmitFeatureEnabled() && - length >= kPinAutosubmitMinLength && length <= kPinAutosubmitMaxLength; + return length >= kPinAutosubmitMinLength && length <= kPinAutosubmitMaxLength; } void LoginPinInputView::Init(const OnPinSubmit& on_submit,
diff --git a/ash/public/cpp/message_center/oobe_notification_constants.h b/ash/public/cpp/message_center/oobe_notification_constants.h index e342152f..0c9c3a9 100644 --- a/ash/public/cpp/message_center/oobe_notification_constants.h +++ b/ash/public/cpp/message_center/oobe_notification_constants.h
@@ -11,6 +11,10 @@ inline constexpr static char kOOBELocaleSwitchNotificationId[] = "oobe.locale-switch-notification"; +// ID of the Gnubbby press notification that could be shown during the OOBE. +inline constexpr static char kOOBEGnubbyNotificationId[] = + "gnubby_notification"; + } // namespace ash #endif // ASH_PUBLIC_CPP_MESSAGE_CENTER_OOBE_NOTIFICATION_CONSTANTS_H_
diff --git a/ash/style/system_toast_style.cc b/ash/style/system_toast_style.cc index db35e08..83b61b0b 100644 --- a/ash/style/system_toast_style.cc +++ b/ash/style/system_toast_style.cc
@@ -35,7 +35,7 @@ #include "ui/views/highlight_border.h" #include "ui/views/layout/box_layout.h" -namespace ash { +namespace ash::deprecated { namespace { @@ -247,4 +247,4 @@ BEGIN_METADATA(SystemToastStyle) END_METADATA -} // namespace ash +} // namespace ash::deprecated
diff --git a/ash/style/system_toast_style.h b/ash/style/system_toast_style.h index 3cb1abfa..40dca0f08 100644 --- a/ash/style/system_toast_style.h +++ b/ash/style/system_toast_style.h
@@ -23,6 +23,11 @@ class ScopedA11yOverrideWindowSetter; class SystemShadow; +namespace deprecated { + +// DISCLAIMER: This view has been deprecated, please use `SystemToastView`. +// More details in go/system-toast-view. + // A view used to present Toasts. It has rounded corners and may have a // dismiss button if a `dismiss_text` is provided, and a `leading_icon` if one // is provided. The spacing surrounding the elements may change if the text has @@ -79,6 +84,8 @@ std::unique_ptr<ScopedA11yOverrideWindowSetter> scoped_a11y_overrider_; }; +} // namespace deprecated + } // namespace ash #endif // ASH_STYLE_SYSTEM_TOAST_STYLE_H_
diff --git a/ash/system/brightness/brightness_controller_chromeos.cc b/ash/system/brightness/brightness_controller_chromeos.cc index cda6ac4b..b4ac7e3a 100644 --- a/ash/system/brightness/brightness_controller_chromeos.cc +++ b/ash/system/brightness/brightness_controller_chromeos.cc
@@ -7,6 +7,7 @@ #include <optional> #include <utility> +#include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/login/login_screen_controller.h" #include "ash/login/ui/login_data_dispatcher.h" @@ -14,6 +15,7 @@ #include "ash/public/cpp/session/session_controller.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" +#include "ash/system/brightness_control_delegate.h" #include "ash/system/power/power_status.h" #include "base/metrics/histogram_functions.h" #include "base/strings/strcat.h" @@ -176,6 +178,44 @@ void BrightnessControllerChromeos::OnFocusPod(const AccountId& account_id) { active_account_id_ = account_id; + + if (features::IsBrightnessControlInSettingsEnabled()) { + RestoreBrightnessSettings(account_id); + } +} + +void BrightnessControllerChromeos::RestoreBrightnessSettings( + const AccountId& account_id) { + // TODO(cambickel): Check if this is the first time the user is logging in, + // and restore the value of ambient light sensor from the synced profile pref + // if it exists. + + // Get the user's stored preference for whether the ambient light sensor + // should be enabled. If there is no saved preference for the ambient light + // sensor value, set the ambient light sensor to be enabled to match the + // default behavior. + user_manager::KnownUser known_user(local_state_); + const bool ambient_light_sensor_enabled_for_account = + known_user + .FindBoolPath(account_id, prefs::kDisplayAmbientLightSensorEnabled) + .value_or(true); + + if (!ambient_light_sensor_enabled_for_account) { + // If the ambient light sensor is disabled, restore the user's preferred + // brightness level. + const std::optional<double> brightness_for_account = + known_user + .FindPath(account_id, + prefs::kInternalDisplayScreenBrightnessPercent) + ->GetIfDouble(); + if (brightness_for_account.has_value()) { + SetBrightnessPercent(brightness_for_account.value(), /*gradual=*/true, + BrightnessControlDelegate::BrightnessChangeSource:: + kRestoredFromUserPref); + } + } + + SetAmbientLightSensorEnabled(ambient_light_sensor_enabled_for_account); } void BrightnessControllerChromeos::OnActiveUserSessionChanged(
diff --git a/ash/system/brightness/brightness_controller_chromeos.h b/ash/system/brightness/brightness_controller_chromeos.h index 4b45f57..a2df2607 100644 --- a/ash/system/brightness/brightness_controller_chromeos.h +++ b/ash/system/brightness/brightness_controller_chromeos.h
@@ -81,6 +81,7 @@ private: void RecordHistogramForBrightnessAction(BrightnessAction brightness_action); void OnGetBrightnessAfterLogin(std::optional<double> brightness_percent); + void RestoreBrightnessSettings(const AccountId& account_id); raw_ptr<PrefService> local_state_; raw_ptr<SessionControllerImpl> session_controller_;
diff --git a/ash/system/brightness/brightness_controller_chromeos_unittest.cc b/ash/system/brightness/brightness_controller_chromeos_unittest.cc index cbb51f83..bd6d223 100644 --- a/ash/system/brightness/brightness_controller_chromeos_unittest.cc +++ b/ash/system/brightness/brightness_controller_chromeos_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/login/login_screen_controller.h" #include "ash/login/ui/login_data_dispatcher.h" @@ -13,7 +14,9 @@ #include "ash/system/brightness_control_delegate.h" #include "ash/system/power/power_status.h" #include "ash/test/ash_test_base.h" +#include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/time/time.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power_manager/backlight.pb.h" @@ -114,6 +117,7 @@ constexpr char kUserEmail[] = "user@example.com"; constexpr char kUserEmailSecondary[] = "user2@example.com"; +constexpr char kUserEmailTertiary[] = "user3@example.com"; constexpr double kInitialBrightness = 51.0; } // namespace @@ -141,6 +145,7 @@ protected: std::unique_ptr<base::HistogramTester> histogram_tester_; base::RunLoop run_loop_; + base::test::ScopedFeatureList scoped_feature_list_; void AdvanceClock(base::TimeDelta time) { task_environment()->AdvanceClock(time); @@ -155,6 +160,32 @@ power_manager_client()->set_screen_brightness_percent(brightness_percent); power_manager_client()->SendScreenBrightnessChanged(brightness_change); } + + void ExpectAmbientLightSensorEnabled(bool expected_value, + const std::string error_message) { + brightness_control_delegate()->GetAmbientLightSensorEnabled( + base::BindLambdaForTesting([expected_value, error_message]( + std::optional<bool> sensor_enabled) { + EXPECT_EQ(sensor_enabled.value(), expected_value) << error_message; + })); + } + + void ExpectBrightnessPercent(double expected_value, + const std::string error_message) { + brightness_control_delegate()->GetBrightnessPercent( + base::BindLambdaForTesting( + [expected_value, + error_message](std::optional<double> brightness_percent) { + EXPECT_EQ(brightness_percent.value(), expected_value) + << error_message; + })); + } + + // On the login screen, focus the given account. + void LoginScreenFocusAccount(const AccountId account_id) { + login_data_dispatcher()->NotifyFocusPod(account_id); + run_loop_.RunUntilIdle(); + } }; TEST_F(BrightnessControllerChromeosTest, Prefs_OnLoginScreen_MultipleUsers) { @@ -821,4 +852,236 @@ SetBacklightBrightnessRequest_Cause_USER_REQUEST_FROM_SETTINGS_APP); } +TEST_F(BrightnessControllerChromeosTest, + RestoreBrightnessSettingsFromPref_FlagEnabled) { + scoped_feature_list_.InitAndEnableFeature( + features::kEnableBrightnessControlInSettings); + + // Set initial ALS status and brightness level. + power_manager_client()->SetAmbientLightSensorEnabled(true); + power_manager_client()->set_screen_brightness_percent(kInitialBrightness); + + // Clear user sessions and reset to the primary login screen. + ClearLogin(); + + // On the login screen, focus the first user. + AccountId first_account = AccountId::FromUserEmail(kUserEmail); + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + true, "ALS should be enabled for first user by default."); + ExpectBrightnessPercent( + kInitialBrightness, + "Brightness should be unchanged for first user after initial focus."); + + // Then, focus the second user. + AccountId second_account = AccountId::FromUserEmail(kUserEmailSecondary); + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + true, "ALS should be enabled for second user by default."); + ExpectBrightnessPercent( + kInitialBrightness, + "Brightness should be unchanged for second user after initial focus."); + + // Switch back to the first user, then disable ALS by changing the brightness. + LoginScreenFocusAccount(first_account); + const double first_brightness_change_percent = 12.0; + brightness_control_delegate()->SetBrightnessPercent( + first_brightness_change_percent, /*gradual=*/false, + BrightnessControlDelegate::BrightnessChangeSource::kQuickSettings); + // Wait for callbacks to finish executing. + run_loop_.RunUntilIdle(); + ExpectAmbientLightSensorEnabled( + false, "ALS should be disabled for first user after brightness change."); + ExpectBrightnessPercent(first_brightness_change_percent, + "Brightness should be equal to the previously-set " + "value for the first user."); + + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled(true, + "ALS should be enabled for second user " + "despite being disabled for first user."); + ExpectBrightnessPercent( + first_brightness_change_percent, + "Brightness should remain the same after switching to the second user."); + + // Switch to a third user. + AccountId third_account = AccountId::FromUserEmail(kUserEmailTertiary); + LoginScreenFocusAccount(third_account); + ExpectAmbientLightSensorEnabled(true, + "ALS should be enabled for third user " + "despite being disabled for first user."); + ExpectBrightnessPercent( + first_brightness_change_percent, + "Brightness should remain the same after switching to the second user."); + + // Set the brightness for the third user. + const double second_brightness_change_percent = 77.0; + brightness_control_delegate()->SetBrightnessPercent( + second_brightness_change_percent, /*gradual=*/false, + BrightnessControlDelegate::BrightnessChangeSource::kQuickSettings); + // Wait for callbacks to finish executing. + run_loop_.RunUntilIdle(); + + ExpectAmbientLightSensorEnabled( + false, "ALS should be disabled for third user after brightness change."); + ExpectBrightnessPercent( + second_brightness_change_percent, + "Brightness for the third user should be equal to the last-set value."); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled(false, + "ALS should be disabled for first user after " + "switching back from second user."); + ExpectBrightnessPercent( + first_brightness_change_percent, + "Brightness should be equal to the previously-set value for the first " + "user, even after focusing the second user."); + + LoginScreenFocusAccount(third_account); + ExpectAmbientLightSensorEnabled(false, + "ALS should be disabled for third user after " + "switching back from first user."); + ExpectBrightnessPercent( + second_brightness_change_percent, + "Brightness should be restored to the previously-set value for the third " + "user, even after focusing the first user (which has its own set " + "brightness value)."); + + // Simulate a reboot, which resets the value of the ambient light sensor and + // the screen brightness. + ClearLogin(); + power_manager_client()->SetAmbientLightSensorEnabled(true); + power_manager_client()->set_screen_brightness_percent(kInitialBrightness); + + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + true, "After reboot, ALS should be still be enabled for second user."); + ExpectBrightnessPercent(kInitialBrightness, + "After reboot, brightness should be equal to the " + "initial value for the second user."); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + false, "After reboot, ALS should be still be disabled for first user."); + ExpectBrightnessPercent(first_brightness_change_percent, + "After reboot, brightness should be equal to the " + "previously-set value for the first user."); + + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + true, "After reboot, ALS should be still be enabled for second user."); + ExpectBrightnessPercent(first_brightness_change_percent, + "After switching to the second user (after reboot), " + "brightness should be equal to the " + "last value set (since auto-brightness is enabled)."); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + false, + "After reboot and after switching back from second user, ALS should be " + "still be disabled for first user."); + ExpectBrightnessPercent( + first_brightness_change_percent, + "After reboot, brightness should be equal to the previously-set value " + "for the first user, even after focusing the second user."); + + LoginScreenFocusAccount(third_account); + ExpectAmbientLightSensorEnabled( + false, "After reboot, ALS should be still be disabled for third user."); + ExpectBrightnessPercent(second_brightness_change_percent, + "After reboot, brightness should be equal to the " + "previously-set value for the third user, even after " + "focusing the first user."); +} + +TEST_F(BrightnessControllerChromeosTest, + RestoreBrightnessSettingsFromPref_FlagDisabled) { + scoped_feature_list_.InitAndDisableFeature( + features::kEnableBrightnessControlInSettings); + + // Set initial ALS status and brightness level. + power_manager_client()->SetAmbientLightSensorEnabled(true); + power_manager_client()->set_screen_brightness_percent(kInitialBrightness); + + // Clear user sessions and reset to the primary login screen. + ClearLogin(); + + // On the login screen, focus the first user. + AccountId first_account = AccountId::FromUserEmail(kUserEmail); + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + true, "ALS should be enabled for first user by default."); + ExpectBrightnessPercent( + kInitialBrightness, + "Brightness should be unchanged for first user after initial focus."); + + // Then, focus the second user. + AccountId second_account = AccountId::FromUserEmail(kUserEmailSecondary); + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + true, "ALS should be enabled for second user by default."); + ExpectBrightnessPercent( + kInitialBrightness, + "Brightness should be unchanged for second user after initial focus."); + + // Switch back to the first user, then disable ALS by changing the brightness. + LoginScreenFocusAccount(first_account); + const double brightness_change_percent = 12.0; + brightness_control_delegate()->SetBrightnessPercent( + brightness_change_percent, /*gradual=*/false, + BrightnessControlDelegate::BrightnessChangeSource::kQuickSettings); + // Wait for callbacks to finish executing. + run_loop_.RunUntilIdle(); + ExpectAmbientLightSensorEnabled( + false, "ALS should be disabled for first user after brightness change."); + ExpectBrightnessPercent(brightness_change_percent, + "Brightness should be equal to the previously-set " + "value for the first user."); + + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + false, + "ALS should be disabled for second user because the ALS value is not " + "being restored from prefs."); + ExpectBrightnessPercent(brightness_change_percent, + "After switching to the second user, the previous " + "brightness should not be restored."); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled(false, + "ALS should be disabled for first user after " + "switching back from second user."); + ExpectBrightnessPercent(brightness_change_percent, + "After switching back to the first user, the " + "previous brightness should not be restored."); + + // Simulate a reboot, which resets the value of the ambient light sensor and + // the screen brightness. + ClearLogin(); + power_manager_client()->SetAmbientLightSensorEnabled(true); + power_manager_client()->set_screen_brightness_percent(kInitialBrightness); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + true, "After reboot, ALS should be enabled for first user by default."); + ExpectBrightnessPercent(kInitialBrightness, + "After reboot, the brightness level should be equal " + "to the initial brightness for the first user."); + + LoginScreenFocusAccount(second_account); + ExpectAmbientLightSensorEnabled( + true, "After reboot, ALS should be enabled for second user by default."); + ExpectBrightnessPercent(kInitialBrightness, + "After reboot, the brightness level should be equal " + "to the initial brightness for the second user."); + + LoginScreenFocusAccount(first_account); + ExpectAmbientLightSensorEnabled( + true, "After reboot, ALS should be enabled for first user by default."); + ExpectBrightnessPercent(kInitialBrightness, + "After reboot, the brightness level should be equal " + "to the initial brightness for the first user (after " + "switching from the second user)."); +} + } // namespace ash
diff --git a/ash/system/brightness_control_delegate.h b/ash/system/brightness_control_delegate.h index 27555f4..46c1c63c 100644 --- a/ash/system/brightness_control_delegate.h +++ b/ash/system/brightness_control_delegate.h
@@ -28,7 +28,8 @@ kUnknown = 0, kQuickSettings = 1, kSettingsApp = 2, - kMaxValue = kSettingsApp, + kRestoredFromUserPref = 3, + kMaxValue = kRestoredFromUserPref, }; // Requests that the brightness be set to |percent|, in the range
diff --git a/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.cc b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.cc new file mode 100644 index 0000000..2878390 --- /dev/null +++ b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.cc
@@ -0,0 +1,152 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.h" + +#include "ash/shell.h" +#include "ash/shell_delegate.h" +#include "ash/system/focus_mode/sounds/soundscape/soundscape_types.h" +#include "base/functional/callback.h" +#include "base/memory/weak_ptr.h" +#include "base/task/sequenced_task_runner.h" +#include "base/task/task_runner.h" +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/cpp/shared_url_loader_factory.h" +#include "services/network/public/cpp/simple_url_loader.h" + +namespace ash { + +namespace { + +constexpr size_t kMaxDownloadBytes = 20 * 1024; + +SoundscapesDownloader::Urls ProductionConfiguration(const std::string& locale) { + SoundscapesDownloader::Urls configuration; + configuration.locale = locale; + configuration.host = GURL("https://gstatic.com/chromeos-focusmode/"); + configuration.config_path = "config.json"; + return configuration; +} + +constexpr net::NetworkTrafficAnnotationTag kFocusSoundsNetworkTag = + net::DefineNetworkTrafficAnnotation("focus_sounds_configuration", R"( + semantics { + sender: "Focus Sounds" + description: + "Retrieve the list of playlists, songs, and thumbnails for Focus" + "Sounds in Focus Mode. Songs may be played while a user is in" + "Focus Mode. Thumbnails may appear in the Focus Mode panel and in" + "Media Controls." + trigger: + "The Focus Mode panel is opened" + data: "None" + user_data { + type: NONE + } + internal { + contacts { + email: "focusmode-wmp@google.com" + } + } + destination: GOOGLE_OWNED_SERVICE + last_reviewed: "2024-04-26" + } + policy { + cookies_allowed: NO + setting: + "Cannot be disabled via settings." + policy_exception_justification: + "Not implemented yet. Feature is WIP." + })"); + +std::unique_ptr<network::SimpleURLLoader> CreateSimpleURLLoader( + const GURL& url) { + auto resource_request = std::make_unique<network::ResourceRequest>(); + resource_request->url = url; + resource_request->method = "GET"; + resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; + + return network::SimpleURLLoader::Create(std::move(resource_request), + kFocusSoundsNetworkTag); +} + +class SoundscapesDownloaderImpl : public SoundscapesDownloader { + public: + SoundscapesDownloaderImpl( + SoundscapesDownloader::Urls config, + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) + : configuration_(config), url_loader_factory_(url_loader_factory) {} + ~SoundscapesDownloaderImpl() override = default; + + void FetchConfiguration(ConfigurationCallback callback) override { + GURL destination = configuration_.host.Resolve(configuration_.config_path); + pending_request_ = CreateSimpleURLLoader(destination); + network::SimpleURLLoader::BodyAsStringCallback handler = + base::BindOnce(&SoundscapesDownloaderImpl::HandleConfigurationString, + weak_factory_.GetWeakPtr(), std::move(callback)); + pending_request_->DownloadToString(url_loader_factory_.get(), + std::move(handler), kMaxDownloadBytes); + } + + private: + void HandleConfigurationString(ConfigurationCallback callback, + std::optional<std::string> response_body) { + // Move the pending request here so it's deleted when this function ends. + std::unique_ptr<network::SimpleURLLoader> request = + std::move(pending_request_); + + if (!response_body) { + std::move(callback).Run(std::nullopt); + return; + } + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::BindOnce(&SoundscapeConfiguration::ParseConfiguration, + configuration_.locale, *response_body), + base::BindOnce(&SoundscapesDownloaderImpl::HandleParsedConfiguration, + weak_factory_.GetWeakPtr(), std::move(callback))); + } + + void HandleParsedConfiguration( + ConfigurationCallback callback, + std::optional<SoundscapeConfiguration> configuration) { + std::move(callback).Run(std::move(configuration)); + } + + std::unique_ptr<network::SimpleURLLoader> pending_request_; + SoundscapesDownloader::Urls configuration_; + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; + base::WeakPtrFactory<SoundscapesDownloaderImpl> weak_factory_{this}; +}; + +} // namespace + +SoundscapesDownloader::Urls::Urls() = default; +SoundscapesDownloader::Urls::Urls(const Urls&) = default; +SoundscapesDownloader::Urls::~Urls() = default; + +// static +std::unique_ptr<SoundscapesDownloader> SoundscapesDownloader::Create( + const std::string& locale) { + CHECK(!locale.empty()); + + return std::make_unique<SoundscapesDownloaderImpl>( + ProductionConfiguration(locale), + Shell::Get()->shell_delegate()->GetBrowserProcessUrlLoaderFactory()); +} + +// static +std::unique_ptr<SoundscapesDownloader> SoundscapesDownloader::CreateForTesting( + const SoundscapesDownloader::Urls& configuration, + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) { + return std::make_unique<SoundscapesDownloaderImpl>(configuration, + url_loader_factory); +} + +} // namespace ash
diff --git a/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.h b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.h new file mode 100644 index 0000000..6d03cb0 --- /dev/null +++ b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.h
@@ -0,0 +1,62 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_FOCUS_MODE_SOUNDS_SOUNDSCAPE_SOUNDSCAPES_DOWNLOADER_H_ +#define ASH_SYSTEM_FOCUS_MODE_SOUNDS_SOUNDSCAPE_SOUNDSCAPES_DOWNLOADER_H_ + +#include <optional> +#include <string> +#include <utility> + +#include "ash/ash_export.h" +#include "ash/system/focus_mode/sounds/soundscape/soundscape_types.h" +#include "base/functional/callback.h" +#include "base/memory/scoped_refptr.h" +#include "url/gurl.h" + +namespace network { +class SharedURLLoaderFactory; +} // namespace network + +namespace ash { + +// Downloads the configuration for the Soundscapes feature (playlists, tracks, +// and thumbnail data) from the server and returns the parsed result to the +// caller via callback. +class ASH_EXPORT SoundscapesDownloader { + public: + struct Urls { + Urls(); + Urls(const Urls&); + ~Urls(); + + std::string locale; + // URL root for soundscape resources. + GURL host; + // Path of the configuration json relative to `host`. + std::string config_path; + }; + + static std::unique_ptr<SoundscapesDownloader> Create( + const std::string& locale); + static std::unique_ptr<SoundscapesDownloader> CreateForTesting( + const Urls& origins, + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory); + + virtual ~SoundscapesDownloader() = default; + + // Returns the result of the request for the configuration. If the downloaded + // configuration is valid, the parsed representation is provided. If the + // download failed or the file failed to validate, nullopt is provided. + using ConfigurationCallback = + base::OnceCallback<void(std::optional<SoundscapeConfiguration>)>; + + // Starts the request for the configuration file. `callback` is invoked when + // the file is retrieved or we've given up. + virtual void FetchConfiguration(ConfigurationCallback callback) = 0; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_FOCUS_MODE_SOUNDS_SOUNDSCAPE_SOUNDSCAPES_DOWNLOADER_H_
diff --git a/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader_unittest.cc b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader_unittest.cc new file mode 100644 index 0000000..d248a57 --- /dev/null +++ b/ash/system/focus_mode/sounds/soundscape/soundscapes_downloader_unittest.cc
@@ -0,0 +1,162 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.h" + +#include "ash/system/focus_mode/sounds/soundscape/test/test_data.h" +#include "base/functional/bind.h" +#include "base/test/bind.h" +#include "base/test/task_environment.h" +#include "services/network/public/cpp/shared_url_loader_factory.h" +#include "services/network/test/test_url_loader_factory.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace ash { + +namespace { + +constexpr char kHost[] = "https://www.example.com"; +constexpr char kLocale[] = "en-US"; +constexpr char kValidPath[] = "/config.json"; + +// A simple SharedURLLoaderFactory implementation for tests. +class FakeSharedURLLoaderFactory : public network::SharedURLLoaderFactory { + public: + FakeSharedURLLoaderFactory() = default; + FakeSharedURLLoaderFactory(const FakeSharedURLLoaderFactory&) = delete; + FakeSharedURLLoaderFactory& operator=(const FakeSharedURLLoaderFactory&) = + delete; + + // network::mojom::URLLoaderFactory: + void Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver) + override { + test_url_loader_factory_.Clone(std::move(receiver)); + } + + void CreateLoaderAndStart( + mojo::PendingReceiver<network::mojom::URLLoader> loader, + int32_t request_id, + uint32_t options, + const network::ResourceRequest& request, + mojo::PendingRemote<network::mojom::URLLoaderClient> client, + const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) + override { + test_url_loader_factory_.CreateLoaderAndStart( + std::move(loader), request_id, options, request, std::move(client), + traffic_annotation); + } + + // network::SharedURLLoaderFactory: + std::unique_ptr<network::PendingSharedURLLoaderFactory> Clone() override { + NOTREACHED(); + return nullptr; + } + + network::TestURLLoaderFactory& test_url_loader_factory() { + return test_url_loader_factory_; + } + + private: + ~FakeSharedURLLoaderFactory() override = default; + network::TestURLLoaderFactory test_url_loader_factory_; +}; + +class SoundscapesDownloaderTest : public testing::Test { + public: + SoundscapesDownloaderTest() = default; + + void SetUp() override { + fake_url_loader_factory_ = + base::MakeRefCounted<FakeSharedURLLoaderFactory>(); + } + + SoundscapesDownloader::Urls MakeConfiguration(std::string_view path) { + SoundscapesDownloader::Urls config; + config.locale = std::string(kLocale); + config.host = GURL(kHost); + config.config_path = path; + return config; + } + + void ServeConfig(GURL url, + network::TestURLLoaderFactory& test_url_loader_factory) { + test_url_loader_factory.SimulateResponseForPendingRequest( + url.spec(), kTestConfig, net::HTTP_OK); + } + + void ServeNotFound(GURL url, + network::TestURLLoaderFactory& test_url_loader_factory) { + test_url_loader_factory.SimulateResponseForPendingRequest( + url.spec(), "", net::HTTP_NOT_FOUND); + } + + scoped_refptr<FakeSharedURLLoaderFactory> fake_url_loader_factory_; + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::ThreadPoolExecutionMode::ASYNC}; +}; + +TEST_F(SoundscapesDownloaderTest, Construct) { + auto downloader = SoundscapesDownloader::CreateForTesting( + MakeConfiguration(""), fake_url_loader_factory_); + EXPECT_TRUE(downloader); +} + +TEST_F(SoundscapesDownloaderTest, FetchFailure) { + auto downloader = SoundscapesDownloader::CreateForTesting( + MakeConfiguration(kValidPath), fake_url_loader_factory_); + + bool result = true; + SoundscapeConfiguration config; + + base::RunLoop run_loop; + downloader->FetchConfiguration(base::BindLambdaForTesting( + [&](std::optional<SoundscapeConfiguration> configuration) { + result = !!configuration; + if (result) { + config = std::move(*configuration); + } + run_loop.Quit(); + })); + + ServeNotFound(GURL(kHost).Resolve(kValidPath), + fake_url_loader_factory_->test_url_loader_factory()); + + run_loop.Run(); + + EXPECT_FALSE(result); +} + +TEST_F(SoundscapesDownloaderTest, FetchSuccess) { + auto downloader = SoundscapesDownloader::CreateForTesting( + MakeConfiguration(kValidPath), fake_url_loader_factory_); + + bool result = false; + SoundscapeConfiguration config; + base::RunLoop run_loop; + downloader->FetchConfiguration(base::BindLambdaForTesting( + [&](std::optional<SoundscapeConfiguration> configuration) { + result = !!configuration; + if (result) { + config = std::move(*configuration); + } + run_loop.Quit(); + })); + + ServeConfig(GURL(kHost).Resolve(kValidPath), + fake_url_loader_factory_->test_url_loader_factory()); + + run_loop.Run(); + EXPECT_TRUE(result); + + ASSERT_THAT(config.playlists, testing::SizeIs(4)); + EXPECT_THAT(config.playlists[2], + testing::Field(&SoundscapePlaylist::name, testing::Eq("Flow"))); + EXPECT_THAT(config.playlists[2], + testing::Field(&SoundscapePlaylist::tracks, testing::SizeIs(2))); +} + +} // namespace +} // namespace ash
diff --git a/ash/system/input_device_settings/input_device_settings_notification_controller.cc b/ash/system/input_device_settings/input_device_settings_notification_controller.cc index 407e2d1..7f46292 100644 --- a/ash/system/input_device_settings/input_device_settings_notification_controller.cc +++ b/ash/system/input_device_settings/input_device_settings_notification_controller.cc
@@ -475,6 +475,13 @@ return true; } +const std::u16string GetBatteryLevelMessage( + const mojom::BatteryInfo& battery_info) { + return l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_BATTERY_DESCRIPTION, + base::NumberToString16(battery_info.battery_percentage)); +} + } // namespace InputDeviceSettingsNotificationController:: @@ -914,6 +921,12 @@ const mojom::Mouse& mouse) { const auto peripheral_name = base::UTF8ToUTF16(mouse.name); const auto notification_id = GetMouseNotificationID(mouse.id); + const auto message = + mouse.battery_info.is_null() + ? l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_MOUSE_CUSTOMIZATION, + peripheral_name) + : GetBatteryLevelMessage(*mouse.battery_info); message_center::RichNotificationData rich_notification_data; rich_notification_data.buttons.emplace_back(l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_OPEN_SETTINGS_BUTTON)); @@ -921,10 +934,7 @@ message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_PERIPHERAL_CUSTOMIZATION_TITLE), - l10n_util::GetStringFUTF16( - IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_MOUSE_CUSTOMIZATION, - peripheral_name), - std::u16string(), GURL(), + message, std::u16string(), GURL(), message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT, kNotifierId, NotificationCatalogName::kInputDeviceSettings), @@ -941,6 +951,12 @@ const auto peripheral_name = base::UTF8ToUTF16(keyboard.name); const auto notification_id = GetWelcomeExperienceNotificationId( kKeyboardNotificationPrefix, keyboard.id); + const auto message = + keyboard.battery_info.is_null() + ? l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_KEYBOARD, + peripheral_name) + : GetBatteryLevelMessage(*keyboard.battery_info); message_center::RichNotificationData rich_notification_data; rich_notification_data.buttons.emplace_back(l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_OPEN_SETTINGS_BUTTON)); @@ -948,10 +964,7 @@ message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_KEYBOARD_TITLE), - l10n_util::GetStringFUTF16( - IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_KEYBOARD, - peripheral_name), - std::u16string(), GURL(), + message, std::u16string(), GURL(), message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT, kNotifierId, NotificationCatalogName::kInputDeviceSettings), @@ -966,6 +979,12 @@ void InputDeviceSettingsNotificationController:: ShowTouchpadSettingsNotification(const mojom::Touchpad& touchpad) { const auto peripheral_name = base::UTF8ToUTF16(touchpad.name); + const auto message = + touchpad.battery_info.is_null() + ? l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_TOUCHPAD, + peripheral_name) + : GetBatteryLevelMessage(*touchpad.battery_info); const auto notification_id = GetWelcomeExperienceNotificationId( kTouchpadNotificationPrefix, touchpad.id); message_center::RichNotificationData rich_notification_data; @@ -975,10 +994,7 @@ message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_TOUCHPAD_TITLE), - l10n_util::GetStringFUTF16( - IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_TOUCHPAD, - peripheral_name), - std::u16string(), GURL(), + message, std::u16string(), GURL(), message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT, kNotifierId, NotificationCatalogName::kInputDeviceSettings), @@ -994,6 +1010,12 @@ NotifyGraphicsTabletIsCustomizable( const mojom::GraphicsTablet& graphics_tablet) { const auto peripheral_name = base::UTF8ToUTF16(graphics_tablet.name); + const auto message = + graphics_tablet.battery_info.is_null() + ? l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_GRAPHICS_TABLET_CUSTOMIZATION, + peripheral_name) + : GetBatteryLevelMessage(*graphics_tablet.battery_info); const auto notification_id = GetGraphicsTabletNotificationID(graphics_tablet.id); message_center::RichNotificationData rich_notification_data; @@ -1003,10 +1025,7 @@ message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, l10n_util::GetStringUTF16( IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_PERIPHERAL_CUSTOMIZATION_GRAPHICS_TABLET_TITLE), - l10n_util::GetStringFUTF16( - IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_GRAPHICS_TABLET_CUSTOMIZATION, - peripheral_name), - std::u16string(), GURL(), + message, std::u16string(), GURL(), message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT, kNotifierId, NotificationCatalogName::kInputDeviceSettings),
diff --git a/ash/system/input_device_settings/input_device_settings_notification_controller_unittest.cc b/ash/system/input_device_settings/input_device_settings_notification_controller_unittest.cc index 298515a4..06ac2be 100644 --- a/ash/system/input_device_settings/input_device_settings_notification_controller_unittest.cc +++ b/ash/system/input_device_settings/input_device_settings_notification_controller_unittest.cc
@@ -901,4 +901,28 @@ "welcome_experience_pointing_stick_2")); } +TEST_F(InputDeviceSettingsNotificationControllerTest, + NotificationsForBluetoothDevicesDisplaysBatteryLevel) { + size_t expected_notification_count = 1; + mojom::MousePtr mojom_mouse = mojom::Mouse::New(); + mojom_mouse->device_key = "0001:0001"; + mojom_mouse->id = 1; + mojom_mouse->settings = mojom::MouseSettings::New(); + mojom_mouse->battery_info = + mojom::BatteryInfo::New(78, mojom::ChargeState::kDischarging); + + controller()->NotifyMouseFirstTimeConnected(*mojom_mouse); + EXPECT_EQ(expected_notification_count++, + message_center()->NotificationCount()); + const auto* notification = message_center()->FindVisibleNotificationById( + "peripheral_customization_mouse_1"); + ASSERT_TRUE(notification); + EXPECT_EQ( + l10n_util::GetStringFUTF16( + IDS_ASH_DEVICE_SETTINGS_NOTIFICATIONS_WELCOME_EXPERIENCE_BATTERY_DESCRIPTION, + base::NumberToString16( + mojom_mouse->battery_info->battery_percentage)), + notification->message()); +} + } // namespace ash
diff --git a/ash/system/notification_center/session_state_notification_blocker.cc b/ash/system/notification_center/session_state_notification_blocker.cc index a511176..6a71f26 100644 --- a/ash/system/notification_center/session_state_notification_blocker.cc +++ b/ash/system/notification_center/session_state_notification_blocker.cc
@@ -69,7 +69,7 @@ static const std::string_view kAllowedSystemNotificationIDs[] = { BatteryNotification::kNotificationId}; static const std::string_view kAllowedProfileBoundNotificationIDs[] = { - kOOBELocaleSwitchNotificationId}; + kOOBELocaleSwitchNotificationId, kOOBEGnubbyNotificationId}; for (const auto& id : kAllowedSystemNotificationIDs) { if (notification_id == id) {
diff --git a/ash/system/notification_center/session_state_notification_blocker_unittest.cc b/ash/system/notification_center/session_state_notification_blocker_unittest.cc index 16e351a..b2a9fae6 100644 --- a/ash/system/notification_center/session_state_notification_blocker_unittest.cc +++ b/ash/system/notification_center/session_state_notification_blocker_unittest.cc
@@ -362,6 +362,7 @@ kTestCases = { {BatteryNotification::kNotificationId, true}, {kOOBELocaleSwitchNotificationId, true}, + {kOOBEGnubbyNotificationId, true}, {"new-fancy-notification", false}, }; const SessionState kOOBEStates[] = {SessionState::OOBE,
diff --git a/ash/system/video_conference/bubble/set_camera_background_view.cc b/ash/system/video_conference/bubble/set_camera_background_view.cc index 41205e8..082e678 100644 --- a/ash/system/video_conference/bubble/set_camera_background_view.cc +++ b/ash/system/video_conference/bubble/set_camera_background_view.cc
@@ -471,8 +471,11 @@ // We don't want to show the SetCameraBackgroundView if there is no recently // used background; instead, the webui is shown. if (visible && recently_used_background_view_->children().empty()) { - controller_->CreateBackgroundImage(); - return; + // We need to double check that there is no background images. + GetCameraEffectsController()->GetRecentlyUsedBackgroundImages( + 1, base::BindOnce( + &SetCameraBackgroundView::OnGetRecentlyUsedBackgroundImages, + weak_factory_.GetWeakPtr())); } SetVisible(visible); @@ -485,12 +488,22 @@ } } +SetCameraBackgroundView::~SetCameraBackgroundView() = default; + bool SetCameraBackgroundView:: IsAnimationPlayingForCreateWithAiButtonForTesting() { return views::AsViewClass<CreateImageButton>(create_with_image_button_) ->IsAnimationPlaying(); } +void SetCameraBackgroundView::OnGetRecentlyUsedBackgroundImages( + const std::vector<BackgroundImageInfo>& background_images) { + // Directly open the VcBackgroundApp if no background image exists. + if (background_images.empty()) { + controller_->CreateBackgroundImage(); + } +} + BEGIN_METADATA(SetCameraBackgroundView) END_METADATA
diff --git a/ash/system/video_conference/bubble/set_camera_background_view.h b/ash/system/video_conference/bubble/set_camera_background_view.h index 2039138..1deebb5 100644 --- a/ash/system/video_conference/bubble/set_camera_background_view.h +++ b/ash/system/video_conference/bubble/set_camera_background_view.h
@@ -6,7 +6,9 @@ #define ASH_SYSTEM_VIDEO_CONFERENCE_BUBBLE_SET_CAMERA_BACKGROUND_VIEW_H_ #include "ash/ash_export.h" +#include "ash/system/camera/camera_effects_controller.h" #include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" @@ -26,16 +28,22 @@ VideoConferenceTrayController* controller); SetCameraBackgroundView(const SetCameraBackgroundView&) = delete; SetCameraBackgroundView& operator=(const SetCameraBackgroundView&) = delete; - ~SetCameraBackgroundView() override = default; + ~SetCameraBackgroundView() override; void SetBackgroundReplaceUiVisible(bool visible); bool IsAnimationPlayingForCreateWithAiButtonForTesting(); private: + void OnGetRecentlyUsedBackgroundImages( + const std::vector<CameraEffectsController::BackgroundImageInfo>& + background_images); + raw_ptr<VideoConferenceTrayController> controller_; raw_ptr<views::View> recently_used_background_view_; raw_ptr<views::View> create_with_image_button_; + + base::WeakPtrFactory<SetCameraBackgroundView> weak_factory_{this}; }; } // namespace ash::video_conference
diff --git a/ash/wallpaper/views/wallpaper_base_view.cc b/ash/wallpaper/views/wallpaper_base_view.cc index dbd8e124..a4ac8369 100644 --- a/ash/wallpaper/views/wallpaper_base_view.cc +++ b/ash/wallpaper/views/wallpaper_base_view.cc
@@ -47,10 +47,6 @@ gfx::ImageSkia wallpaper = controller->GetWallpaper(); WallpaperLayout layout = controller->GetWallpaperLayout(); - // Wallpapers with png format could be partially transparent. Fill the canvas - // with black to make it opaque before painting the wallpaper. - canvas->FillRect(GetLocalBounds(), SK_ColorBLACK); - if (wallpaper.isNull()) { return; } @@ -102,6 +98,10 @@ centered_layout_image_scale_.y() / image_scale); wallpaper_rect.set_x((width() - wallpaper_rect.width()) / 2); wallpaper_rect.set_y((height() - wallpaper_rect.height()) / 2); + // Fill background with black if wallpaper does not cover the entire view. + if (!wallpaper_rect.Contains(GetLocalBounds())) { + canvas->FillRect(GetLocalBounds(), SK_ColorBLACK); + } DrawWallpaper(wallpaper, gfx::Rect(wallpaper.size()), wallpaper_rect, flags, canvas); break;
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc index 378e4bb..058d102 100644 --- a/ash/wallpaper/wallpaper_controller_unittest.cc +++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -1248,10 +1248,12 @@ controller_->ShowWallpaperImage( image, CreateWallpaperInfo(WALLPAPER_LAYOUT_STRETCH), /*preview_mode=*/false, /*is_override=*/false); - EXPECT_TRUE(image.BackedBySameObjectAs(controller_->GetWallpaper())); + EXPECT_TRUE(gfx::test::AreImagesEqual(gfx::Image(controller_->GetWallpaper()), + gfx::Image(image))); RunAllTasksUntilIdle(); gfx::ImageSkia resized_image = controller_->GetWallpaper(); - EXPECT_FALSE(image.BackedBySameObjectAs(resized_image)); + EXPECT_FALSE(gfx::test::AreImagesEqual( + gfx::Image(controller_->GetWallpaper()), gfx::Image(image))); EXPECT_EQ(gfx::Size(320, 200).ToString(), resized_image.size().ToString()); // Load the original wallpaper again and check that we're still using the @@ -3877,15 +3879,14 @@ gfx::ImageSkia online_wallpaper = CreateImage(640, 480, online_wallpaper_color); EXPECT_NE(online_wallpaper_color, GetWallpaperColor()); + TestWallpaperControllerObserver observer(controller_); run_loop = std::make_unique<base::RunLoop>(); + observer.SetOnResizeCallback(run_loop->QuitClosure()); SetOnlineWallpaperFromImage( kAccountId1, kAssetId, online_wallpaper, kDummyUrl, TestWallpaperControllerClient::kDummyCollectionId, layout, /*preview_mode=*/true, /*from_user=*/true, kUnitId, - base::BindLambdaForTesting([&run_loop](bool success) { - EXPECT_TRUE(success); - run_loop->Quit(); - })); + base::BindLambdaForTesting([](bool success) { EXPECT_TRUE(success); })); run_loop->Run(); EXPECT_EQ(1, GetWallpaperCount()); EXPECT_EQ(online_wallpaper_color, GetWallpaperColor());
diff --git a/ash/wallpaper/wallpaper_utils/wallpaper_resizer.cc b/ash/wallpaper/wallpaper_utils/wallpaper_resizer.cc index 099b84a..4995826 100644 --- a/ash/wallpaper/wallpaper_utils/wallpaper_resizer.cc +++ b/ash/wallpaper/wallpaper_utils/wallpaper_resizer.cc
@@ -16,7 +16,13 @@ #include "base/task/thread_pool.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" +#include "cc/paint/color_filter.h" +#include "cc/paint/paint_flags.h" +#include "cc/paint/record_paint_canvas.h" +#include "third_party/skia/include/core/SkBlendMode.h" +#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkImage.h" +#include "ui/gfx/canvas.h" #include "ui/gfx/geometry/skia_conversions.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia_operations.h" @@ -33,13 +39,38 @@ constexpr int kDecodedWallpaperMetricMaxMB = 50; constexpr int kDecodedWallpaperMetricNumBuckets = 10; +// Wallpapers with png format could be partially transparent. Ensures image +// pixels are opaque before painting. +// +// If `generate_immediate_bitmap` is true, the return value is backed by an +// `SkBitmap`. If false, it's backed by a sequence of paint operations, which, +// when evaluated later in the graphics pipeline, will generate the exact same +// opaque image. +gfx::ImageSkia MakeOpaque(const gfx::ImageSkia& image_in, + bool generate_immediate_bitmap) { + cc::RecordPaintCanvas record_canvas; + gfx::Canvas canvas(&record_canvas, /*image_scale=*/1.f); + cc::PaintFlags flags; + + // Color filter ensures image pixels are opaque when drawn. + flags.setColorFilter(cc::ColorFilter::MakeBlend( + SkColor4f::FromColor(SK_ColorBLACK), SkBlendMode::kDstOver)); + canvas.DrawImageInt(image_in, 0, 0, flags); + gfx::ImageSkiaRep opaque_image_rep(record_canvas.ReleaseAsRecord(), + image_in.size(), + /*scale=*/1.f); + return generate_immediate_bitmap + ? gfx::ImageSkia::CreateFrom1xBitmap(opaque_image_rep.GetBitmap()) + : gfx::ImageSkia(opaque_image_rep); +} + // Resizes `image` to `target_size` using `layout`. // // NOTE: `image` is intentionally a copy to ensure it exists for the duration of // the function. -SkBitmap Resize(const gfx::ImageSkia image, - const gfx::Size& target_size, - WallpaperLayout layout) { +gfx::ImageSkia Resize(const gfx::ImageSkia image, + const gfx::Size& target_size, + WallpaperLayout layout) { base::AssertLongCPUWorkAllowed(); SkBitmap orig_bitmap = *image.bitmap(); @@ -82,9 +113,11 @@ break; } } - - new_bitmap.setImmutable(); - return new_bitmap; + // Generating the bitmap right now is both acceptable and desirable since it's + // on a blocking thread that can handle potentially long cpu work and ensures + // the opaque bitmap is only ever generated once. + return MakeOpaque(gfx::ImageSkia::CreateFrom1xBitmap(new_bitmap), + /*generate_immediate_bitmap=*/true); } } // namespace @@ -113,8 +146,13 @@ WallpaperResizer::WallpaperResizer(const gfx::ImageSkia& image, const gfx::Size& target_size, const WallpaperInfo& wallpaper_info) - : image_(image), - original_image_id_(GetImageId(image_)), + // Generating the opaque bitmap could potentially require long cpu work, + // which is not appropriate on the main thread. The bitmap will be + // generated later in the compositor on a more appropriate thread. This + // non-resized version of the `image_` is short-lived anyways and will be + // replaced with the resized opaque version imminently. + : image_(MakeOpaque(image, /*generate_immediate_bitmap=*/false)), + original_image_id_(GetImageId(image)), target_size_(target_size), wallpaper_info_(wallpaper_info), sequenced_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( @@ -142,21 +180,21 @@ } void WallpaperResizer::OnResizeFinished(base::OnceClosure on_resize_done, - const SkBitmap& resized_bitmap) { + gfx::ImageSkia resized_image) { static constexpr size_t kBytesPerMegabyte = 1024 * 1024; base::UmaHistogramCustomCounts( "Ash.Wallpaper.DecodedSizeMB", - base::ClampRound(static_cast<float>(resized_bitmap.computeByteSize()) / - kBytesPerMegabyte), + base::ClampRound( + static_cast<float>(resized_image.bitmap()->computeByteSize()) / + kBytesPerMegabyte), kDecodedWallpaperMetricMinMB, kDecodedWallpaperMetricMaxMB, kDecodedWallpaperMetricNumBuckets); - auto resized_image = gfx::ImageSkia::CreateFrom1xBitmap(resized_bitmap); DVLOG(2) << __func__ << " old=" << image_.size().ToString() << " new=" << resized_image.size().ToString() << " time=" << base::TimeTicks::Now() - start_calculation_time_; - image_ = resized_image; + image_ = std::move(resized_image); std::move(on_resize_done).Run(); }
diff --git a/ash/wallpaper/wallpaper_utils/wallpaper_resizer.h b/ash/wallpaper/wallpaper_utils/wallpaper_resizer.h index 0b6fd44..59667ab 100644 --- a/ash/wallpaper/wallpaper_utils/wallpaper_resizer.h +++ b/ash/wallpaper/wallpaper_utils/wallpaper_resizer.h
@@ -49,9 +49,9 @@ void StartResize(base::OnceClosure on_resize_done); private: - // Copies `resized_bitmap` to `image_` and runs callback `on_resize_done`. + // Copies `resized_image` to `image_` and runs callback `on_resize_done`. void OnResizeFinished(base::OnceClosure on_resize_done, - const SkBitmap& resized_bitmap); + gfx::ImageSkia resized_image); // Image that should currently be used for wallpaper. It initially // contains the original image and is updated to contain the resized
diff --git a/ash/wallpaper/wallpaper_utils/wallpaper_resizer_unittest.cc b/ash/wallpaper/wallpaper_utils/wallpaper_resizer_unittest.cc index 13d36e82..c1d7be3 100644 --- a/ash/wallpaper/wallpaper_utils/wallpaper_resizer_unittest.cc +++ b/ash/wallpaper/wallpaper_utils/wallpaper_resizer_unittest.cc
@@ -26,10 +26,10 @@ const int kTestImageHeight = 2; const int kTargetWidth = 1; const int kTargetHeight = 1; -const uint32_t kExpectedCenter = 0x02020202u; -const uint32_t kExpectedCenterCropped = 0x03030303u; -const uint32_t kExpectedStretch = 0x04040404u; -const uint32_t kExpectedTile = 0; +const uint32_t kExpectedCenter = 0xFF020202u; +const uint32_t kExpectedCenterCropped = 0xFF030303u; +const uint32_t kExpectedStretch = 0xFF040404u; +const uint32_t kExpectedTile = 0xFF000000u; gfx::ImageSkia CreateTestImage(const gfx::Size& size) { SkBitmap src;
diff --git a/ash/webui/diagnostics_ui/backend/session_log_handler_unittest.cc b/ash/webui/diagnostics_ui/backend/session_log_handler_unittest.cc index 3a0b310a..78cd6d43 100644 --- a/ash/webui/diagnostics_ui/backend/session_log_handler_unittest.cc +++ b/ash/webui/diagnostics_ui/backend/session_log_handler_unittest.cc
@@ -441,7 +441,7 @@ base::RunLoop run_loop; session_log_handler_->SetLogCreatedClosureForTest( - base::BindLambdaForTesting([]() { NOTREACHED(); })); + base::BindLambdaForTesting([]() { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ(0u, task_runner_->NumPendingTasks()); web_ui_.HandleReceivedMessage("saveSessionLog", args); EXPECT_EQ(1u, task_runner_->NumPendingTasks());
diff --git a/ash/webui/print_preview_cros/resources/js/data/destination_manager.ts b/ash/webui/print_preview_cros/resources/js/data/destination_manager.ts index 58b38a96..af53a665 100644 --- a/ash/webui/print_preview_cros/resources/js/data/destination_manager.ts +++ b/ash/webui/print_preview_cros/resources/js/data/destination_manager.ts
@@ -71,6 +71,7 @@ assert( !this.sessionContext, 'SessionContext should only be configured once'); this.sessionContext = sessionContext; + this.fetchInitialDestinations(); this.dispatchEvent( createCustomEvent(DESTINATION_MANAGER_SESSION_INITIALIZED)); } @@ -92,20 +93,6 @@ // Digital destinations can be added at creation and will be removed during // session initialization if not supported by policy. this.insertDigitalDestinations(); - - // Request initial data. - this.updateState(DestinationManagerState.FETCHING); - // TODO(b/323421684): Once the initial local destinations fetch completes - // update has initial destination set, determine relevant initial - // destination, and create the initial print ticket. If policy restricts - // fetching a destination type an empty destination list will be returned. - this.destinationProvider.getLocalDestinations().then( - (destinations: Destination[]): void => { - this.addOrUpdateDestinations(destinations); - this.updateActiveDestination(PDF_DESTINATION.id); - this.initialDestinationsLoaded = true; - this.updateState(DestinationManagerState.LOADED); - }); } // TODO(b/323421684): Returns true if initial fetch has returned @@ -184,6 +171,26 @@ this.destinations[index] = destination; } + // Requests destinations from backend and updates manager state to `FETCHING`. + // Once destinations have been stored, the state is updated to `LOADED` and + // attempts to select an initial destination. + private fetchInitialDestinations(): void { + assert(this.isSessionInitialized); + // Request initial data. + this.updateState(DestinationManagerState.FETCHING); + // TODO(b/323421684): Once the initial local destinations fetch completes + // update has initial destination set, determine relevant initial + // destination, and create the initial print ticket. If policy restricts + // fetching a destination type an empty destination list will be returned. + this.destinationProvider.getLocalDestinations().then( + (destinations: Destination[]): void => { + this.addOrUpdateDestinations(destinations); + this.initialDestinationsLoaded = true; + this.updateActiveDestination(PDF_DESTINATION.id); + this.updateState(DestinationManagerState.LOADED); + }); + } + // Insert hard-coded digital destinations into set of known destinations. // Function should only be called once per session. private insertDigitalDestinations(): void {
diff --git a/ash/webui/print_preview_cros/resources/js/destination_select.html b/ash/webui/print_preview_cros/resources/js/destination_select.html index 4d3b8f4..e1f1d351 100644 --- a/ash/webui/print_preview_cros/resources/js/destination_select.html +++ b/ash/webui/print_preview_cros/resources/js/destination_select.html
@@ -1,5 +1,5 @@ <style include="print-preview-cros-shared"></style> <!-- TODO(b/323585997): Replace with localized UI once design for loading is available. --> -<div id="loading" hidden="[[!showLoading]]">Loading</div> -<destination-dropdown hidden="[[showLoading]]"></destination-dropdown> \ No newline at end of file +<div id="loading" hidden="[[!showLoadingUi]]">Loading</div> +<destination-dropdown hidden="[[showLoadingUi]]"></destination-dropdown> \ No newline at end of file
diff --git a/ash/webui/print_preview_cros/resources/js/destination_select.ts b/ash/webui/print_preview_cros/resources/js/destination_select.ts index 12c8e5cf..9c3e1c1 100644 --- a/ash/webui/print_preview_cros/resources/js/destination_select.ts +++ b/ash/webui/print_preview_cros/resources/js/destination_select.ts
@@ -9,7 +9,7 @@ import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getTemplate} from './destination_select.html.js'; -import {DESTINATION_SELECT_SHOW_LOADING_CHANGED, DestinationSelectController} from './destination_select_controller.js'; +import {DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, DestinationSelectController} from './destination_select_controller.js'; /** * @fileoverview @@ -28,13 +28,13 @@ static get properties() { return { - showLoading: Boolean, + showLoadingUi: Boolean, }; } private controller: DestinationSelectController; private eventTracker = new EventTracker(); - private showLoading: boolean; + private showLoadingUi: boolean; override connectedCallback(): void { super.connectedCallback(); @@ -42,11 +42,11 @@ this.controller = new DestinationSelectController(this.eventTracker); this.eventTracker.add( - this.controller, DESTINATION_SELECT_SHOW_LOADING_CHANGED, + this.controller, DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, (e: Event): void => this.onDestinationSelectShowDropdownChanged(e)); // Initialize properties using the controller. - this.showLoading = this.controller.shouldShowLoading(); + this.showLoadingUi = this.controller.shouldShowLoadingUi(); } override disconnectedCallback(): void { @@ -58,9 +58,9 @@ return this.controller; } - // Updates UI on controller DESTINATION_SELECT_SHOW_LOADING_CHANGED event. + // Updates UI on controller DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED event. private onDestinationSelectShowDropdownChanged(_event: Event): void { - this.showLoading = this.controller.shouldShowLoading(); + this.showLoadingUi = this.controller.shouldShowLoadingUi(); } }
diff --git a/ash/webui/print_preview_cros/resources/js/destination_select_controller.ts b/ash/webui/print_preview_cros/resources/js/destination_select_controller.ts index 4673dbe..4ade1b86 100644 --- a/ash/webui/print_preview_cros/resources/js/destination_select_controller.ts +++ b/ash/webui/print_preview_cros/resources/js/destination_select_controller.ts
@@ -14,8 +14,8 @@ * `destination-select` element to update. */ -export const DESTINATION_SELECT_SHOW_LOADING_CHANGED = - 'destination-select.show-loading-changed'; +export const DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED = + 'destination-select.show-loading-ui-changed'; // DestinationSelectController defines functionality used to update the // `destination-select` element. @@ -38,7 +38,7 @@ // Returns whether destination manager has fetched initial destinations and // is initialized. - shouldShowLoading(): boolean { + shouldShowLoadingUi(): boolean { return !this.destinationManager.isSessionInitialized() || !this.destinationManager.hasLoadedAnInitialDestination(); } @@ -47,19 +47,19 @@ // state changes. private onDestinationManagerStateChanged(_event: Event): void { this.dispatchEvent( - createCustomEvent(DESTINATION_SELECT_SHOW_LOADING_CHANGED)); + createCustomEvent(DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED)); } // Handles notifying UI to update when destination manager // initialized state changes. private onDestinationManagerSessionInitialized(): void { this.dispatchEvent( - createCustomEvent(DESTINATION_SELECT_SHOW_LOADING_CHANGED)); + createCustomEvent(DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED)); } } declare global { interface HTMLElementEventMap { - [DESTINATION_SELECT_SHOW_LOADING_CHANGED]: CustomEvent<void>; + [DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED]: CustomEvent<void>; } }
diff --git a/ash/webui/shimless_rma/backend/external_app_dialog.cc b/ash/webui/shimless_rma/backend/external_app_dialog.cc index ee6c725..5b2e4712 100644 --- a/ash/webui/shimless_rma/backend/external_app_dialog.cc +++ b/ash/webui/shimless_rma/backend/external_app_dialog.cc
@@ -18,7 +18,6 @@ #include "components/permissions/permission_request_manager.h" #include "content/public/browser/console_message.h" #include "content/public/browser/file_select_listener.h" -#include "content/public/common/input/native_web_keyboard_event.h" #include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h" #include "ui/base/ui_base_types.h" #include "ui/display/display.h" @@ -113,12 +112,6 @@ } } -bool IsEscapeEvent(const content::NativeWebKeyboardEvent& event) { - return event.GetType() == - content::NativeWebKeyboardEvent::Type::kRawKeyDown && - event.windows_key_code == ui::VKEY_ESCAPE; -} - } // namespace ExternalAppDialog::InitParams::InitParams() = default; @@ -224,33 +217,6 @@ web_contents, request, std::move(callback), /*extension=*/nullptr); } -void ExternalAppDialog::EnterFullscreenModeForTab( - content::RenderFrameHost* requesting_frame, - const blink::mojom::FullscreenOptions& options) { - widget_->SetFullscreen(true); -} - -void ExternalAppDialog::ExitFullscreenModeForTab( - content::WebContents* web_contents) { - widget_->SetFullscreen(false); -} - -content::KeyboardEventProcessingResult -ExternalAppDialog::PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event) { - if (widget_->IsFullscreen() && IsEscapeEvent(event)) { - ExitFullscreenModeForTab(source); - return content::KeyboardEventProcessingResult::HANDLED; - } - return content::KeyboardEventProcessingResult::NOT_HANDLED; -} - -bool ExternalAppDialog::IsFullscreenForTabOrPending( - const content::WebContents* web_contents) { - return widget_->IsFullscreen(); -} - void ExternalAppDialog::OnDidAddMessageToConsole( content::RenderFrameHost* source_frame, blink::mojom::ConsoleMessageLevel log_level,
diff --git a/ash/webui/shimless_rma/backend/external_app_dialog.h b/ash/webui/shimless_rma/backend/external_app_dialog.h index c0ee6d2..58cf715 100644 --- a/ash/webui/shimless_rma/backend/external_app_dialog.h +++ b/ash/webui/shimless_rma/backend/external_app_dialog.h
@@ -12,7 +12,6 @@ #include "base/logging.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/web_contents_observer.h" #include "ui/web_dialogs/web_dialog_delegate.h" #include "url/gurl.h" @@ -88,15 +87,6 @@ content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) override; - void EnterFullscreenModeForTab( - content::RenderFrameHost* requesting_frame, - const blink::mojom::FullscreenOptions& options) override; - void ExitFullscreenModeForTab(content::WebContents* web_contents) override; - content::KeyboardEventProcessingResult PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event) override; - bool IsFullscreenForTabOrPending( - const content::WebContents* web_contents) override; // content::WebContentsObserver overrides: void OnDidAddMessageToConsole(
diff --git a/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc b/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc index 492cd10..e6414e3 100644 --- a/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc +++ b/ash/webui/shimless_rma/backend/shimless_rma_service_unittest.cc
@@ -2826,8 +2826,8 @@ const std::vector<rmad::GetStateReply> fake_states = {CreateStateReply( rmad::RmadState::kDeviceDestination, rmad::RMAD_ERROR_OK)}; fake_rmad_client_()->SetFakeStateReplies(std::move(fake_states)); - fake_rmad_client_()->check_state_callback = - base::BindRepeating([](const rmad::RmadState& state) { NOTREACHED(); }); + fake_rmad_client_()->check_state_callback = base::BindRepeating( + [](const rmad::RmadState& state) { NOTREACHED_IN_MIGRATION(); }); base::RunLoop run_loop; shimless_rma_provider_->GetCurrentState( base::BindLambdaForTesting([&](mojom::StateResultPtr state_result_ptr) {
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc index d019c78..335f297 100644 --- a/ash/wm/lock_state_controller.cc +++ b/ash/wm/lock_state_controller.cc
@@ -33,7 +33,9 @@ #include "ash/wm/window_restore/pine_constants.h" #include "ash/wm/window_restore/window_restore_metrics.h" #include "ash/wm/window_restore/window_restore_util.h" -#include "base/command_line.h" +#include "ash/wm/workspace/backdrop_controller.h" +#include "ash/wm/workspace/workspace_layout_manager.h" +#include "ash/wm/workspace_controller.h" #include "base/debug/crash_logging.h" #include "base/debug/dump_without_crashing.h" #include "base/files/file_path.h" @@ -174,7 +176,7 @@ // TODO(minch): Check whether the screenshot should be taken in kiosk mode. // Returns true if the pine screenshot should be taken on shutdown. -bool ShouldTakePineScreeshot() { +bool ShouldTakePineScreenshot() { auto* shell = Shell::Get(); // Do not take the pine screenshot if it is in overview mode, lock screen, // home launcher or pinned mode. @@ -829,7 +831,7 @@ void LockStateController::TakePineImageAndShutdown(bool cancelable_shutdown) { const base::FilePath file_path = GetShutdownPineImagePath(); - if (!ShouldTakePineScreeshot()) { + if (!ShouldTakePineScreenshot()) { DeletePineImage(pine_image_callback_for_test_, file_path); StartShutdownProcess(cancelable_shutdown); return; @@ -888,6 +890,14 @@ base::Unretained(this), cancelable_shutdown)); } + if (auto* workspace_controller = GetWorkspaceController( + desks_util::GetActiveDeskContainerForRoot(root))) { + if (BackdropController* backdrop_controller = + workspace_controller->layout_manager()->backdrop_controller()) { + backdrop_controller->HideOnTakingPineScreenshot(); + } + } + // Take the screenshot on the shutdown screenshot container, thus the float // and the always on top windows will be included in the screenshot as well. ui::GrabWindowSnapshot(
diff --git a/ash/wm/overview/overview_item.cc b/ash/wm/overview/overview_item.cc index 0704dd6b..17379bb 100644 --- a/ash/wm/overview/overview_item.cc +++ b/ash/wm/overview/overview_item.cc
@@ -1018,8 +1018,18 @@ // Do not update the overview item if the window is to be snapped into split // view. It will be removed from overview soon and will update overview grid // at that moment. - if (SplitViewController::Get(window)->IsWindowInTransitionalState(window)) + if (SplitViewController::Get(window)->IsWindowInTransitionalState(window)) { return; + } + + // During the `OnWindowParentChanged()`, there's a possibility that the parent + // window might be null, leading to the OverviewItem not being correctly added + // to the intended display. Early return here so that The `OverviewItem` can + // be added to the correct display when `OnWindowParentChanged()` is called + // again and the parent window is not null. + if (root_window_ != window->GetRootWindow()) { + return; + } if (reason == ui::PropertyChangeReason::NOT_FROM_ANIMATION) overview_item_view_->RefreshPreviewView();
diff --git a/ash/wm/overview/overview_session_unittest.cc b/ash/wm/overview/overview_session_unittest.cc index 5359150..3d40e40 100644 --- a/ash/wm/overview/overview_session_unittest.cc +++ b/ash/wm/overview/overview_session_unittest.cc
@@ -3864,6 +3864,101 @@ EXPECT_TRUE(IsWindowInItsCorrespondingOverviewGrid(window.get())); } +// Used to replicate the behavior of the Crostini app window, which would set +// the window bounds to its registered display on the window's visibility +// changed. See +// `AppServiceAppWindowCrostiniTracker::OnWindowVisibilityChanged()` for more +// details. +class CrostiniWindowVisibilityObserver : public aura::WindowObserver { + public: + explicit CrostiniWindowVisibilityObserver(aura::Window* window) + : window_(window) { + window->AddObserver(this); + } + + ~CrostiniWindowVisibilityObserver() override { + window_->RemoveObserver(this); + } + + // aura::WindowObserver: + void OnWindowVisibilityChanged(aura::Window* window, bool visible) override { + if (visible) { + auto current_display = + display::Screen::GetScreen()->GetDisplayNearestWindow(window); + const auto dst_display = + display::Screen::GetScreen()->GetPrimaryDisplay(); + window->SetBoundsInScreen( + gfx::Rect(dst_display.bounds().origin(), window->bounds().size()), + dst_display); + } + } + + private: + raw_ptr<aura::Window> window_; +}; + +// Test verifies that dragging a minimized Crostini window to an external +// display in Overview mode and then clicking to activate it doesn't cause a +// crash. The crash would typically occur due to the +// `AppServiceAppWindowCrostiniTracker` attempting to move the window back to +// its registered display, which triggers a `CHECK_EQ(root_window_, +// window->GetRootWindow())` crash in `OverviewItem::SetItemBounds()`. See +// http://b/334911238 for more details. +TEST_P(OverviewSessionTest, + NoCrashWhenSettingMinimizedOverviewItemBoundsOnAnotherDisplay) { + UpdateDisplay("1410x940,1411+0-2560x1440"); + display::DisplayManager* display_manager = Shell::Get()->display_manager(); + EXPECT_EQ(2U, display_manager->GetNumDisplays()); + const auto& displays = display_manager->active_display_list(); + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); + + const gfx::Point point_in_display2(2500, 500); + ASSERT_FALSE(displays[0].bounds().Contains(point_in_display2)); + ASSERT_TRUE(displays[1].bounds().Contains(point_in_display2)); + + std::unique_ptr<aura::Window> window( + CreateAppWindow(gfx::Rect(10, 10, 500, 300))); + + WMEvent minimize_event(WM_EVENT_MINIMIZE); + WindowState::Get(window.get())->OnWMEvent(&minimize_event); + ASSERT_TRUE(WindowState::Get(window.get())->IsMinimized()); + EXPECT_FALSE(window->IsVisible()); + EXPECT_EQ(0.f, window->layer()->GetTargetOpacity()); + + CrostiniWindowVisibilityObserver visibility_observer(window.get()); + + ToggleOverview(); + WaitForOverviewEntered(); + ASSERT_TRUE(IsInOverviewSession()); + + const auto& grids = GetOverviewSession()->grid_list(); + ASSERT_EQ(2u, grids.size()); + auto grid0 = grids[0].get(); + ASSERT_TRUE(grid0); + const auto& overview_items = grid0->window_list(); + ASSERT_EQ(overview_items.size(), 1u); + EXPECT_TRUE(IsWindowInItsCorrespondingOverviewGrid(window.get())); + + auto* event_generator = GetEventGenerator(); + auto* overview_item = overview_items[0].get(); + ASSERT_TRUE(overview_item); + DragItemToPoint(overview_item, point_in_display2, event_generator, + /*by_touch_gestures=*/false, /*drop=*/true); + EXPECT_TRUE(IsWindowInItsCorrespondingOverviewGrid(window.get())); + + // Verify that the windows are moved to the `displays[1]` properly. + display::Screen* screen = display::Screen::GetScreen(); + EXPECT_EQ(displays[1].id(), + screen->GetDisplayNearestWindow(window.get()).id()); + + event_generator->set_current_screen_location(gfx::ToRoundedPoint( + GetOverviewItemForWindow(window.get())->target_bounds().CenterPoint())); + + // Verify that there will be no crash when activating the minimized Crostini + // window. + event_generator->ClickLeftButton(); +} + // If you update the parameterisation of OverviewSessionTest also update the // parameterisation of OverviewRasterScaleTest below. INSTANTIATE_TEST_SUITE_P(
diff --git a/ash/wm/session_state_animator_impl.cc b/ash/wm/session_state_animator_impl.cc index 87acc54..1c385fa 100644 --- a/ash/wm/session_state_animator_impl.cc +++ b/ash/wm/session_state_animator_impl.cc
@@ -8,7 +8,6 @@ #include <utility> #include <vector> -#include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" #include "ash/utility/layer_copy_animator.h" #include "ash/wm/desks/desks_util.h" @@ -195,53 +194,6 @@ base::OnceClosure callback_; }; -bool IsLayerAnimated(ui::Layer* layer, - SessionStateAnimator::AnimationType type) { - switch (type) { - case SessionStateAnimator::ANIMATION_FADE_IN: - if (layer->GetTargetOpacity() < 0.9999) - return false; - break; - case SessionStateAnimator::ANIMATION_FADE_OUT: - if (layer->GetTargetOpacity() > 0.0001) - return false; - break; - case SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY: - if (layer->GetTargetOpacity() > 0.0001) - return false; - break; - case SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS: - if ((layer->GetTargetBrightness() < 0.9999) || - (layer->GetTargetGrayscale() < 0.9999)) - return false; - break; - case SessionStateAnimator::ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS: - if ((layer->GetTargetBrightness() > 0.0001) || - (layer->GetTargetGrayscale() > 0.0001)) - return false; - break; - case SessionStateAnimator::ANIMATION_DROP: - case SessionStateAnimator::ANIMATION_UNDO_LIFT: - // ToDo(antim) : check other effects - if (layer->GetTargetOpacity() < 0.9999) - return false; - break; - // ToDo(antim) : check other effects - case SessionStateAnimator::ANIMATION_LIFT: - if (layer->GetTargetOpacity() > 0.0001) - return false; - break; - case SessionStateAnimator::ANIMATION_RAISE_TO_SCREEN: - // ToDo(antim) : check other effects - if (layer->GetTargetOpacity() < 0.9999) - return false; - break; - case SessionStateAnimator::ANIMATION_COPY_LAYER: - return true; - } - return true; -} - void GetContainersInRootWindow(int container_mask, aura::Window* root_window, aura::Window::Windows* containers) { @@ -262,16 +214,12 @@ if (aura::Window* non_lock_screen_containers = Shell::GetContainer( root_window, kShellWindowId_NonLockScreenContainersContainer); non_lock_screen_containers) { - constexpr int ContainersToAnimate[] = { - kShellWindowId_HomeScreenContainer, - kShellWindowId_AlwaysOnTopContainer, - kShellWindowId_FloatContainer, - kShellWindowId_PipContainer, - kShellWindowId_SystemModalContainer, - }; - for (const int id : ContainersToAnimate) { + for (const int id : SessionStateAnimatorImpl:: + ContainersToAnimateInNonLockScreenContainer) { containers->push_back(Shell::GetContainer(root_window, id)); } + // The active desk container should be animated as well besides the ones + // inside `ContainersToAnimateInNonLockScreenContainer`. containers->push_back( desks_util::GetActiveDeskContainerForRoot(root_window)); } @@ -397,28 +345,6 @@ int sequences_completed_; }; -bool SessionStateAnimatorImpl::TestApi::ContainersAreAnimated( - int container_mask, - AnimationType type) const { - aura::Window::Windows containers; - animator_->GetContainers(container_mask, &containers); - for (aura::Window::Windows::const_iterator it = containers.begin(); - it != containers.end(); ++it) { - aura::Window* window = *it; - ui::Layer* layer = window->layer(); - if (!IsLayerAnimated(layer, type)) - return false; - } - return true; -} - -bool SessionStateAnimatorImpl::TestApi::RootWindowIsAnimated( - AnimationType type) const { - aura::Window* root_window = Shell::GetPrimaryRootWindow(); - ui::Layer* layer = root_window->layer(); - return IsLayerAnimated(layer, type); -} - SessionStateAnimatorImpl::SessionStateAnimatorImpl() = default; SessionStateAnimatorImpl::~SessionStateAnimatorImpl() = default;
diff --git a/ash/wm/session_state_animator_impl.h b/ash/wm/session_state_animator_impl.h index 3ddf655..b4030ada 100644 --- a/ash/wm/session_state_animator_impl.h +++ b/ash/wm/session_state_animator_impl.h
@@ -6,13 +6,14 @@ #define ASH_WM_SESSION_STATE_ANIMATOR_IMPL_H_ #include "ash/ash_export.h" +#include "ash/public/cpp/shell_window_ids.h" #include "ash/wm/session_state_animator.h" #include "base/memory/raw_ptr.h" #include "ui/aura/window.h" namespace ui { class LayerAnimationObserver; -} +} // namespace ui namespace ash { @@ -20,27 +21,12 @@ // out, shut down). class ASH_EXPORT SessionStateAnimatorImpl : public SessionStateAnimator { public: - // Helper class used by tests to access internal state. - class ASH_EXPORT TestApi { - public: - explicit TestApi(SessionStateAnimatorImpl* animator) - : animator_(animator) {} - - TestApi(const TestApi&) = delete; - TestApi& operator=(const TestApi&) = delete; - - // Returns true if containers of a given |container_mask| - // were last animated with |type| (probably; the analysis is fairly ad-hoc). - // |container_mask| is a bitfield of a Container. - bool ContainersAreAnimated(int container_mask, - SessionStateAnimator::AnimationType type) const; - - // Returns true if root window was last animated with |type| (probably; - // the analysis is fairly ad-hoc). - bool RootWindowIsAnimated(SessionStateAnimator::AnimationType type) const; - - private: - raw_ptr<SessionStateAnimatorImpl> animator_; // not owned + // Child containers of `NON_LOCK_SCREEN_CONTAINERS` should be animated on + // session state changes. + static constexpr int ContainersToAnimateInNonLockScreenContainer[] = { + kShellWindowId_HomeScreenContainer, kShellWindowId_AlwaysOnTopContainer, + kShellWindowId_FloatContainer, kShellWindowId_PipContainer, + kShellWindowId_SystemModalContainer, }; SessionStateAnimatorImpl();
diff --git a/ash/wm/session_state_animator_impl_unittest.cc b/ash/wm/session_state_animator_impl_unittest.cc index 589f3cd..535436c 100644 --- a/ash/wm/session_state_animator_impl_unittest.cc +++ b/ash/wm/session_state_animator_impl_unittest.cc
@@ -62,6 +62,16 @@ SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, &containers); EXPECT_TRUE(ParentHasWindowWithId( containers[0], kShellWindowId_NonLockScreenContainersContainer)); + // Verify the containers inside `NON_LOCK_SCREEN_CONTAINERS` be animated. + auto iter = std::find(containers.begin(), containers.end(), + desks_util::GetActiveDeskContainerForRoot(root_window)); + EXPECT_TRUE(iter != containers.end()); + for (const int id : + SessionStateAnimatorImpl::ContainersToAnimateInNonLockScreenContainer) { + iter = std::find(containers.begin(), containers.end(), + Shell::GetContainer(root_window, id)); + EXPECT_TRUE(iter != containers.end()); + } containers.clear();
diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc index b7ced8f6..4dd5da5 100644 --- a/ash/wm/system_modal_container_layout_manager.cc +++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -98,10 +98,7 @@ void SystemModalContainerLayoutManager::OnWillRemoveWindowFromLayout( aura::Window* child) { - child->RemoveObserver(this); - windows_to_center_.erase(child); - if (GetModalType(child) == ui::MODAL_TYPE_SYSTEM) - RemoveModalWindow(child); + StopObservingWindow(child); } void SystemModalContainerLayoutManager::SetChildBounds( @@ -134,6 +131,11 @@ } } +void SystemModalContainerLayoutManager::OnWindowDestroying( + aura::Window* window) { + StopObservingWindow(window); +} + //////////////////////////////////////////////////////////////////////////////// // SystemModalContainerLayoutManager, Keyboard::KeyboardControllerObserver // implementation: @@ -247,16 +249,22 @@ aura::Window* removed) { aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (aura::Window* root_window : root_windows) { - if (RootWindowController::ForWindow(root_window) - ->GetSystemModalLayoutManager(removed) - ->ActivateNextModalWindow()) { + // system modal layout manager can be nullptr in some cases. + auto* system_modal_layout_manager = + RootWindowController::ForWindow(root_window) + ->GetSystemModalLayoutManager(removed); + if (system_modal_layout_manager && + system_modal_layout_manager->ActivateNextModalWindow()) { return; } } for (aura::Window* root_window : root_windows) { - RootWindowController::ForWindow(root_window) - ->GetSystemModalLayoutManager(removed) - ->DestroyModalBackground(); + auto* system_modal_layout_manager = + RootWindowController::ForWindow(root_window) + ->GetSystemModalLayoutManager(removed); + if (system_modal_layout_manager) { + system_modal_layout_manager->DestroyModalBackground(); + } } } @@ -327,4 +335,14 @@ std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; } +void SystemModalContainerLayoutManager::StopObservingWindow( + aura::Window* window) { + window->RemoveObserver(this); + windows_to_center_.erase(window); + if (GetModalType(window) == ui::MODAL_TYPE_SYSTEM && + RemoveModalWindow(window)) { + OnModalWindowRemoved(window); + } +} + } // namespace ash
diff --git a/ash/wm/system_modal_container_layout_manager.h b/ash/wm/system_modal_container_layout_manager.h index 2986005..9ed866c 100644 --- a/ash/wm/system_modal_container_layout_manager.h +++ b/ash/wm/system_modal_container_layout_manager.h
@@ -57,6 +57,7 @@ void OnWindowPropertyChanged(aura::Window* window, const void* key, intptr_t old) override; + void OnWindowDestroying(aura::Window* window) override; // Overridden from KeyboardControllerObserver: void OnKeyboardOccludedBoundsChanged(const gfx::Rect& new_bounds) override; @@ -107,6 +108,12 @@ // Returns true if |bounds| is considered centered. bool IsBoundsCentered(const gfx::Rect& window_bounds) const; + // Called to stop observing `window`. It can be called when `window` is + // removed from the layout or `window` is about to be destroyed. `window` will + // also be removed from `windows_to_center_` and `modal_windows_` if it's in + // these lists. + void StopObservingWindow(aura::Window* window); + aura::Window* modal_window() { return !modal_windows_.empty() ? modal_windows_.back() : nullptr; }
diff --git a/ash/wm/workspace/backdrop_controller.cc b/ash/wm/workspace/backdrop_controller.cc index 3e5430a..f28004dd 100644 --- a/ash/wm/workspace/backdrop_controller.cc +++ b/ash/wm/workspace/backdrop_controller.cc
@@ -335,6 +335,10 @@ return nullptr; } +void BackdropController::HideOnTakingPineScreenshot() { + Hide(/*destroy=*/false, /*animate=*/false); +} + base::ScopedClosureRunner BackdropController::PauseUpdates() { DCHECK(!pause_update_);
diff --git a/ash/wm/workspace/backdrop_controller.h b/ash/wm/workspace/backdrop_controller.h index 9ed1baa0a..f39eb83 100644 --- a/ash/wm/workspace/backdrop_controller.h +++ b/ash/wm/workspace/backdrop_controller.h
@@ -79,6 +79,10 @@ // Returns the current visible top level window in the container. aura::Window* GetTopmostWindowWithBackdrop(); + // Hides the backdrop window for taking the pine screenshot in order to not + // include it in the screenshot. + void HideOnTakingPineScreenshot(); + aura::Window* backdrop_window() { return backdrop_window_; } aura::Window* window_having_backdrop() { return window_having_backdrop_; }
diff --git a/base/cpu_reduction_experiment.cc b/base/cpu_reduction_experiment.cc index d8291f3..66b43b29 100644 --- a/base/cpu_reduction_experiment.cc +++ b/base/cpu_reduction_experiment.cc
@@ -10,8 +10,6 @@ #include "base/dcheck_is_on.h" #include "base/feature_list.h" #include "base/rand_util.h" -#include "base/synchronization/lock.h" -#include "base/thread_annotations.h" namespace base { @@ -25,16 +23,16 @@ class CpuReductionExperimentSubSampler { public: - CpuReductionExperimentSubSampler() = default; + CpuReductionExperimentSubSampler() : counter_(base::RandUint64()) {} bool ShouldLogHistograms() { - AutoLock hold(lock_); - return sub_sampler_.ShouldSample(0.001); + // Relaxed memory order since no memory access depends on value. + uint64_t val = counter_.fetch_add(1, std::memory_order_relaxed); + return val % 1000 == 0; } private: - Lock lock_; - MetricsSubSampler sub_sampler_ GUARDED_BY(lock_); + std::atomic<uint64_t> counter_{0}; }; // Singleton instance of CpuReductionExperimentSubSampler. This is only set when
diff --git a/base/functional/concurrent_callbacks.h b/base/functional/concurrent_callbacks.h index 649911e2..f120743c 100644 --- a/base/functional/concurrent_callbacks.h +++ b/base/functional/concurrent_callbacks.h
@@ -13,6 +13,7 @@ #include "base/functional/callback.h" #include "base/location.h" #include "base/memory/raw_ptr.h" +#include "base/sequence_checker.h" #include "base/task/bind_post_task.h" #include "base/task/sequenced_task_runner.h" @@ -78,6 +79,7 @@ // Create a callback for the done callback to wait for. [[nodiscard]] OnceCallback<void(T)> CreateCallback() { CHECK(info_); + DCHECK_CALLED_ON_VALID_SEQUENCE(info_->sequence_checker_); ++info_->pending_; return info_run_callback_; } @@ -89,6 +91,7 @@ void Done(OnceCallback<void(Results)> done_callback, const Location& location = FROM_HERE) && { CHECK(info_); + DCHECK_CALLED_ON_VALID_SEQUENCE(info_->sequence_checker_); info_->done_callback_ = BindPostTask(SequencedTaskRunner::GetCurrentDefault(), std::move(done_callback), location); @@ -104,6 +107,7 @@ Info() = default; void Run(T value) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CHECK_GT(pending_, 0u); --pending_; results_.push_back(std::move(value)); @@ -112,9 +116,11 @@ } } - size_t pending_ = 0u; - Results results_; - OnceCallback<void(Results)> done_callback_; + size_t pending_ GUARDED_BY_CONTEXT(sequence_checker_) = 0u; + Results results_ GUARDED_BY_CONTEXT(sequence_checker_); + OnceCallback<void(Results)> done_callback_ + GUARDED_BY_CONTEXT(sequence_checker_); + SEQUENCE_CHECKER(sequence_checker_); }; RepeatingCallback<void(T)> info_run_callback_;
diff --git a/base/memory/shared_memory_mapping.cc b/base/memory/shared_memory_mapping.cc index 868493f..53938f46 100644 --- a/base/memory/shared_memory_mapping.cc +++ b/base/memory/shared_memory_mapping.cc
@@ -49,6 +49,7 @@ const UnguessableToken& guid, SharedMemoryMapper* mapper) : mapped_span_(mapped_span), size_(size), guid_(guid), mapper_(mapper) { + CHECK_LE(size_, mapped_span_.size()); // Note: except on Windows, `mapped_span_.size() == size_`. SharedMemoryTracker::GetInstance()->IncrementMemoryUsage(*this); }
diff --git a/base/memory/shared_memory_mapping.h b/base/memory/shared_memory_mapping.h index 42d53a1..165e78c 100644 --- a/base/memory/shared_memory_mapping.h +++ b/base/memory/shared_memory_mapping.h
@@ -74,9 +74,8 @@ size_t size, const UnguessableToken& guid, SharedMemoryMapper* mapper); - void* raw_memory_ptr() const { - return reinterpret_cast<void*>(mapped_span_.data()); - } + // Returns a span over the full mapped memory. + span<uint8_t> mapped_memory() const { return mapped_span_; } private: friend class SharedMemoryTracker; @@ -108,7 +107,7 @@ // Returns the base address of the read-only mapping. Returns nullptr for // invalid instances. - const void* memory() const { return raw_memory_ptr(); } + const void* memory() const { return mapped_memory().data(); } // Returns a pointer to a page-aligned const T if the mapping is valid and // large enough to contain a T, or nullptr otherwise. @@ -121,7 +120,7 @@ return nullptr; if (sizeof(T) > size()) return nullptr; - return static_cast<const T*>(raw_memory_ptr()); + return reinterpret_cast<const T*>(mapped_memory().data()); } // Returns a span of const T. The number of elements is autodeduced from the @@ -153,7 +152,12 @@ return span<const T>(); if (size() / sizeof(T) < count) return span<const T>(); - return span<const T>(static_cast<const T*>(raw_memory_ptr()), count); + // SAFETY: There is an internal invariant (enforced in the constructors) + // that `size() <= mapped_memory().size()`. `count` is the number of objects + // of type T that fit within size(), so the pointer given to span() points + // to at least that many T objects. + return UNSAFE_BUFFERS( + span(reinterpret_cast<const T*>(mapped_memory().data()), count)); } private: @@ -183,7 +187,7 @@ // Returns the base address of the writable mapping. Returns nullptr for // invalid instances. - void* memory() const { return raw_memory_ptr(); } + void* memory() const { return mapped_memory().data(); } // Returns a pointer to a page-aligned T if the mapping is valid and large // enough to contain a T, or nullptr otherwise. @@ -196,7 +200,7 @@ return nullptr; if (sizeof(T) > size()) return nullptr; - return static_cast<T*>(raw_memory_ptr()); + return reinterpret_cast<T*>(mapped_memory().data()); } // Returns a span of T. The number of elements is autodeduced from the size of @@ -227,7 +231,12 @@ return span<T>(); if (size() / sizeof(T) < count) return span<T>(); - return span<T>(static_cast<T*>(raw_memory_ptr()), count); + // SAFETY: There is an internal invariant (enforced in the constructors) + // that `size() <= mapped_memory().size()`. `count` is the number of objects + // of type T that fit within size(), so the pointer given to span() points + // to at least that many T objects. + return UNSAFE_BUFFERS( + span(reinterpret_cast<T*>(mapped_memory().data()), count)); } private: @@ -243,17 +252,7 @@ const UnguessableToken& guid, SharedMemoryMapper* mapper); - friend class DiscardableSharedMemory; - // Returns a span over the entire mapped memory, which may be more than the - // logical requested memory. Bytes outside of the logical size should not be - // used. - span<uint8_t> mapped_memory() const { - if (!IsValid()) { - return span<uint8_t>(); - } - return UNSAFE_BUFFERS( - span(static_cast<uint8_t*>(raw_memory_ptr()), mapped_size())); - } + friend class DiscardableSharedMemory; // Give access to mapped_memory(). }; } // namespace base
diff --git a/base/memory/shared_memory_tracker.cc b/base/memory/shared_memory_tracker.cc index 7021891d..05d0c89 100644 --- a/base/memory/shared_memory_tracker.cc +++ b/base/memory/shared_memory_tracker.cc
@@ -45,28 +45,28 @@ SharedMemoryTracker::GetOrCreateSharedMemoryDump( const SharedMemoryMapping& shared_memory, trace_event::ProcessMemoryDump* pmd) { - return GetOrCreateSharedMemoryDumpInternal(shared_memory.raw_memory_ptr(), - shared_memory.mapped_size(), - shared_memory.guid(), pmd); + return GetOrCreateSharedMemoryDumpInternal( + shared_memory.mapped_memory().data(), + shared_memory.mapped_memory().size(), shared_memory.guid(), pmd); } void SharedMemoryTracker::IncrementMemoryUsage( const SharedMemoryMapping& mapping) { AutoLock hold(usages_lock_); - DCHECK(usages_.find(mapping.raw_memory_ptr()) == usages_.end()); - usages_.emplace(mapping.raw_memory_ptr(), - UsageInfo(mapping.mapped_size(), mapping.guid())); + DCHECK(usages_.find(mapping.mapped_memory().data()) == usages_.end()); + usages_.emplace(mapping.mapped_memory().data(), + UsageInfo(mapping.mapped_memory().size(), mapping.guid())); } void SharedMemoryTracker::DecrementMemoryUsage( const SharedMemoryMapping& mapping) { AutoLock hold(usages_lock_); - const auto it = usages_.find(mapping.raw_memory_ptr()); + const auto it = usages_.find(mapping.mapped_memory().data()); // TODO(pbos): When removing this NotFatalUntil, use erase(it) below. We can't // do that now because if this CHECK is actually failing there'd be a memory // bug. CHECK(it != usages_.end(), base::NotFatalUntil::M125); - usages_.erase(mapping.raw_memory_ptr()); + usages_.erase(mapping.mapped_memory().data()); } SharedMemoryTracker::SharedMemoryTracker() {
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index 72aebc78..d3cbd654 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc
@@ -226,7 +226,10 @@ PickleIterator FieldTrial::FieldTrialEntry::GetPickleIterator() const { Pickle pickle = Pickle::WithUnownedBuffer( - span(GetPickledDataPtr(), checked_cast<size_t>(pickle_size))); + // TODO(crbug.com/40284755): FieldTrialEntry should be constructed with a + // span over the pickle memory. + UNSAFE_BUFFERS( + span(GetPickledDataPtr(), checked_cast<size_t>(pickle_size)))); return PickleIterator(pickle); }
diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc index 1237a29..ff79865 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc
@@ -32,6 +32,7 @@ #include "base/test/test_switches.h" #include "base/time/time.h" #include "base/values.h" +#include "build/build_config.h" #include "third_party/icu/source/i18n/unicode/timezone.h" namespace base { @@ -600,6 +601,7 @@ return false; } +#if BUILDFLAG(IS_FUCHSIA) // File::Flush() will call fsync(). This is important on Fuchsia to ensure // that the file is written to the disk - the system running under qemu will // shutdown shortly after the test completes. On Fuchsia fsync() times out @@ -618,6 +620,9 @@ } return false; +#else + return true; +#endif } TestResultsTracker::TestStatusMap
diff --git a/build/config/logging.gni b/build/config/logging.gni index 43125f8..9a1dbb4 100644 --- a/build/config/logging.gni +++ b/build/config/logging.gni
@@ -7,7 +7,7 @@ import("//build/config/dcheck_always_on.gni") declare_args() { - # Use LogErrorNotReached() for NOTREACHED(). + # Use LogErrorNotReached() for NOTREACHED_IN_MIGRATION(). enable_log_error_not_reached = is_chromeos_ash && !(is_debug || dcheck_always_on)
diff --git a/build/config/rust.gni b/build/config/rust.gni index e99d7d0..43ebdd5 100644 --- a/build/config/rust.gni +++ b/build/config/rust.gni
@@ -206,6 +206,8 @@ } else { rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix } + } else if (current_cpu == "riscv64") { + rust_abi_target = "riscv64gc-unknown-linux-gnu" } else { # Best guess for other future platforms. rust_abi_target = current_cpu + "-unknown-linux-gnu"
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc index b51eab7..6c3d579 100644 --- a/cc/trees/layer_tree_host_unittest_proxy.cc +++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -492,7 +492,9 @@ EndTest(); break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } } }; @@ -531,7 +533,9 @@ base::Unretained(this))); break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } }
diff --git a/chrome/VERSION b/chrome/VERSION index 1ddf5a9..cc138206 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=127 MINOR=0 -BUILD=6486 +BUILD=6487 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 0a7c7b7..857170e 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -343,7 +343,6 @@ "//chrome/android/features/keyboard_accessory:public_java", "//chrome/android/features/start_surface:java_resources", "//chrome/android/features/start_surface:public_java", - "//chrome/android/features/tab_ui:tab_suggestions_java", "//chrome/android/features/tab_ui/public:java", "//chrome/android/features/tab_ui/public:ui_java_resources", "//chrome/android/modules/cablev2_authenticator/public:java", @@ -513,6 +512,7 @@ "//chrome/browser/wallet/android:java", "//chrome/browser/webapps/android:java", "//chrome/browser/webauthn/android:java", + "//chrome/browser/webid:java", "//chrome/browser/xsurface:java", "//chrome/browser/xsurface_provider:dependency_provider_impl_java", "//chrome/browser/xsurface_provider:java", @@ -665,6 +665,7 @@ "//components/webxr/android:xr_java", "//components/zoom/android:java", "//content/public/android:content_java", + "//content/public/android:identity_credentials_java", "//content/public/common:common_java", "//device/gamepad:java", "//media/base/android:media_java", @@ -989,7 +990,6 @@ "//chrome/android/features/keyboard_accessory:internal_java", "//chrome/android/features/start_surface:java_resources", "//chrome/android/features/start_surface:public_java", - "//chrome/android/features/tab_ui:tab_suggestions_java", "//chrome/android/features/tab_ui/public:java", "//chrome/android/webapk/libs/client:client_java", "//chrome/android/webapk/libs/common:common_java", @@ -1198,6 +1198,7 @@ "//chrome/browser/wallet/android:junit", "//chrome/browser/webapps/android:java", "//chrome/browser/webauthn/android:java", + "//chrome/browser/webid:junit", "//chrome/browser/xsurface:java", "//chrome/browser/xsurface_provider:junit", "//chrome/test:sync_integration_test_support_java", @@ -1659,7 +1660,6 @@ "//chrome/android/features/start_surface:java_resources", "//chrome/android/features/start_surface:public_java", "//chrome/android/features/tab_ui:java_resources", - "//chrome/android/features/tab_ui:tab_suggestions_java", "//chrome/android/features/tab_ui:test_support_javalib", "//chrome/android/features/tab_ui/public:java", "//chrome/android/webapk/libs/client:client_java", @@ -3826,7 +3826,10 @@ sources += [ "java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java" ] } - public_deps = [ ":base_module_jni" ] + public_deps = [ + ":base_module_jni", + "//chrome/browser/webid:jni_headers", + ] } source_set("chrome_test_util") {
diff --git a/chrome/android/features/tab_ui/BUILD.gn b/chrome/android/features/tab_ui/BUILD.gn index 00bfaf5..fd2bc91 100644 --- a/chrome/android/features/tab_ui/BUILD.gn +++ b/chrome/android/features/tab_ui/BUILD.gn
@@ -47,7 +47,6 @@ "java/res/drawable/selected_tab_background.xml", "java/res/drawable/selected_tab_background_incognito.xml", "java/res/drawable/sleep_auto.xml", - "java/res/drawable/tab_cleanup_message_card_icon_bg.xml", "java/res/drawable/tab_grid_card_background.xml", "java/res/drawable/tab_grid_dialog_background.xml", "java/res/drawable/tab_grid_selection_list_icon.xml", @@ -127,7 +126,6 @@ deps = [ ":java_resources", - ":tab_suggestions_java", ":test_support_javalib", "//base:base_java", "//base:base_java_test_support", @@ -179,27 +177,6 @@ ] } -android_library("tab_suggestions_java") { - sources = [ - "java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContext.java", - "java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestion.java", - "java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionFeedback.java", - "java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestions.java", - "java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsObserver.java", - ] - - deps = [ - "//base:base_java", - "//chrome/browser/profiles/android:java", - "//chrome/browser/tab:java", - "//chrome/browser/tabmodel:java", - "//components/site_engagement/content/android:java", - "//content/public/android:content_full_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//url:gurl_java", - ] -} - android_library("test_support_javalib") { testonly = true resources_package = "org.chromium.chrome.tab_ui"
diff --git a/chrome/android/features/tab_ui/java/res/drawable/tab_cleanup_message_card_icon_bg.xml b/chrome/android/features/tab_ui/java/res/drawable/tab_cleanup_message_card_icon_bg.xml deleted file mode 100644 index 8c9fdd6..0000000 --- a/chrome/android/features/tab_ui/java/res/drawable/tab_cleanup_message_card_icon_bg.xml +++ /dev/null
@@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Copyright 2023 The Chromium Authors -Use of this source code is governed by a BSD-style license that can be -found in the LICENSE file. ---> - -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="92dp" - android:height="32dp" - android:viewportWidth="92" - android:viewportHeight="32"> - <path - android:pathData="M33.68,26.209C32.497,24.783 29.503,24.783 28.32,26.209C25.385,29.747 20.956,32 16,32C7.163,32 0,24.837 0,16C0,7.163 7.163,0 16,0C20.956,0 25.385,2.253 28.32,5.791C29.503,7.217 32.497,7.217 33.68,5.791C36.615,2.253 41.044,0 46,0C50.956,0 55.385,2.253 58.32,5.791C59.503,7.217 62.497,7.217 63.68,5.791C66.615,2.253 71.044,0 76,0C84.837,0 92,7.163 92,16C92,24.837 84.837,32 76,32C71.044,32 66.615,29.747 63.68,26.209C62.497,24.783 59.503,24.783 58.32,26.209C55.385,29.747 50.956,32 46,32C41.044,32 36.615,29.747 33.68,26.209Z" - android:fillColor="@macro/default_bg_color" - android:fillType="evenOdd"/> -</vector>
diff --git a/chrome/android/features/tab_ui/java/res/layout/tab_group_row.xml b/chrome/android/features/tab_ui/java/res/layout/tab_group_row.xml index 26945f8..b962fd2 100644 --- a/chrome/android/features/tab_ui/java/res/layout/tab_group_row.xml +++ b/chrome/android/features/tab_ui/java/res/layout/tab_group_row.xml
@@ -82,7 +82,6 @@ android:layout_width="@dimen/min_touch_target_size" android:layout_height="match_parent" android:background="@null" - android:importantForAccessibility="no" android:src="@drawable/ic_more_vert_24dp" app:tint="@color/default_icon_color_tint_list" />
diff --git a/chrome/android/features/tab_ui/java/res/values/dimens.xml b/chrome/android/features/tab_ui/java/res/values/dimens.xml index b7e9c6bc..20e4c48 100644 --- a/chrome/android/features/tab_ui/java/res/values/dimens.xml +++ b/chrome/android/features/tab_ui/java/res/values/dimens.xml
@@ -86,15 +86,6 @@ <dimen name="tab_hover_card_elevation">6dp</dimen> <dimen name="inactive_tab_hover_card_x_offset">16dp</dimen> - <!-- Dimens for tab cleanup promo message icon --> - <dimen name="tab_cleanup_promo_card_favicon_inset">8dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_height">32dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_width">92dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_end_1">32dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_start_2">30dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_end_2">62dp</dimen> - <dimen name="tab_cleanup_promo_card_icon_start_3">60dp</dimen> - <!-- Dimens for TabGroupParity features --> <dimen name="color_picker_color_item_size">24dp</dimen> <dimen name="color_picker_color_item_horizontal_padding">8dp</dimen>
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediator.java index 7ee6daa..97ec7c2 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediator.java
@@ -8,7 +8,6 @@ import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE; import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.IPH; import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.PRICE_MESSAGE; -import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.TAB_SUGGESTION; import android.content.Context; @@ -112,12 +111,6 @@ private PropertyModel buildModel(int messageType, MessageService.MessageData data) { switch (messageType) { - case TAB_SUGGESTION: - assert data instanceof TabSuggestionMessageService.TabSuggestionMessageData; - return TabSuggestionMessageCardViewModel.create( - mContext, - this::invalidateShownMessage, - (TabSuggestionMessageService.TabSuggestionMessageData) data); case IPH: assert data instanceof IphMessageService.IphMessageData; return IphMessageCardViewModel.create(
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java index 9af714a..0b1636c 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java
@@ -13,14 +13,13 @@ import java.lang.annotation.RetentionPolicy; /** - * Ideally, for each of the {@link MessageType} requires a MessageService class. This is the - * base class. All the concrete subclass should contain logic that convert the data from the + * Ideally, for each of the {@link MessageType} requires a MessageService class. This is the base + * class. All the concrete subclass should contain logic that convert the data from the * corresponding external service to a data structure that the TabGridMessageCardProvider * understands. */ public class MessageService { @IntDef({ - MessageType.TAB_SUGGESTION, MessageType.IPH, MessageType.PRICE_MESSAGE, MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE, @@ -30,12 +29,11 @@ @Retention(RetentionPolicy.SOURCE) public @interface MessageType { int FOR_TESTING = 0; - int TAB_SUGGESTION = 1; - int IPH = 2; - int PRICE_MESSAGE = 3; - int INCOGNITO_REAUTH_PROMO_MESSAGE = 4; - int ARCHIVED_TABS_MESSAGE = 5; - int ALL = 6; + int IPH = 1; + int PRICE_MESSAGE = 2; + int INCOGNITO_REAUTH_PROMO_MESSAGE = 3; + int ARCHIVED_TABS_MESSAGE = 4; + int ALL = 5; } /**
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProvider.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProvider.java deleted file mode 100644 index 1a0cb3c..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProvider.java +++ /dev/null
@@ -1,196 +0,0 @@ -// Copyright 2023 The Chromium Authors -// 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.tasks.tab_management; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; -import android.graphics.drawable.InsetDrawable; - -import androidx.appcompat.content.res.AppCompatResources; - -import org.chromium.base.Callback; -import org.chromium.base.Promise; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; -import org.chromium.chrome.browser.ui.favicon.FaviconHelper; -import org.chromium.chrome.browser.ui.favicon.FaviconHelper.DefaultFaviconHelper; -import org.chromium.chrome.browser.ui.favicon.FaviconUtils; -import org.chromium.chrome.tab_ui.R; -import org.chromium.components.browser_ui.widget.RoundedIconGenerator; -import org.chromium.url.GURL; - -/** - * A {@link MessageCardViewProperties#IconProvider} that obtains favicons asynchronously to create a - * composed icon for a LargeMessageCard. - */ -public class MultiFaviconIconProvider implements MessageCardView.IconProvider { - private final Context mContext; - private final DefaultFaviconHelper mDefaultFaviconHelper; - private final RoundedIconGenerator mIconGenerator; - private final Profile mProfile; - private final int mFaviconSize; - private final int mFaviconInset; - - private FaviconHelper mFaviconHelper; - private Callback<Drawable> mFinishedCallback; - private Promise<Drawable> mFaviconLeft = new Promise<Drawable>(); - private Promise<Drawable> mFaviconCentre = new Promise<Drawable>(); - private Promise<Drawable> mFaviconRight = new Promise<Drawable>(); - private boolean mIsFinished; - private Drawable mFinalIconDrawable; - private GURL mLeftIconUrl; - private GURL mCentreIconUrl; - private GURL mRightIconUrl; - - public MultiFaviconIconProvider(Context context, TabSuggestion tabSuggestion, Profile profile) { - this(context, tabSuggestion, profile, new FaviconHelper()); - } - - protected MultiFaviconIconProvider( - Context context, - TabSuggestion tabSuggestion, - Profile profile, - FaviconHelper faviconHelper) { - mContext = context; - mDefaultFaviconHelper = new DefaultFaviconHelper(); - mIconGenerator = FaviconUtils.createRoundedRectangleIconGenerator(mContext); - mFaviconHelper = faviconHelper; - mProfile = profile; - mFaviconSize = mContext.getResources().getDimensionPixelSize(R.dimen.default_favicon_size); - mFaviconInset = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_favicon_inset); - - // Take the first 3 tabs in TabSuggestion for icon assembly. - mLeftIconUrl = new GURL(tabSuggestion.getTabsInfo().get(0).url); - mCentreIconUrl = new GURL(tabSuggestion.getTabsInfo().get(1).url); - mRightIconUrl = new GURL(tabSuggestion.getTabsInfo().get(2).url); - } - - @Override - public void fetchIconDrawable(Callback<Drawable> callback) { - // Retrieve the cached icon drawable if it's available on subsequent invocations. - if (mFinalIconDrawable != null) { - callback.onResult(mFinalIconDrawable); - return; - } - - assert mFinishedCallback == null : "Callback drawable should not have a value."; - mFinishedCallback = callback; - startFetching(); - } - - private void destroy() { - mFaviconHelper.destroy(); - mFaviconHelper = null; - } - - private void startFetching() { - mFaviconLeft.then(this::maybeFinishFetching); - mFaviconCentre.then(this::maybeFinishFetching); - mFaviconRight.then(this::maybeFinishFetching); - - // Retrieve the favicon bitmaps and convert them to inset drawables. - mFaviconHelper.getLocalFaviconImageForURL( - mProfile, - mLeftIconUrl, - mFaviconSize, - (bitmap, url) -> retrieveFavicon(mFaviconLeft, bitmap, mLeftIconUrl)); - mFaviconHelper.getLocalFaviconImageForURL( - mProfile, - mCentreIconUrl, - mFaviconSize, - (bitmap, url) -> retrieveFavicon(mFaviconCentre, bitmap, mCentreIconUrl)); - mFaviconHelper.getLocalFaviconImageForURL( - mProfile, - mRightIconUrl, - mFaviconSize, - (bitmap, url) -> retrieveFavicon(mFaviconRight, bitmap, mRightIconUrl)); - } - - private void maybeFinishFetching(Drawable drawable) { - if (!mIsFinished - && mFaviconLeft.isFulfilled() - && mFaviconCentre.isFulfilled() - && mFaviconRight.isFulfilled()) { - finishFetching(); - mIsFinished = true; - } - } - - private void finishFetching() { - int iconHeight = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_height); - int iconWidth = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_width); - int iconEnd1 = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_end_1); - int iconStart2 = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_start_2); - int iconEnd2 = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_end_2); - int iconStart3 = - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_start_3); - - // Retrieve the background drawable. - Drawable bg = - AppCompatResources.getDrawable( - mContext, R.drawable.tab_cleanup_message_card_icon_bg); - - // Create the bitmap. - Bitmap bitmap = Bitmap.createBitmap(iconWidth, iconHeight, Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bitmap); - - // Set the background drawable. - bg.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); - bg.draw(canvas); - - // Arrange the favicon drawables. - mFaviconLeft.getResult().setBounds(0, 0, iconEnd1, canvas.getHeight()); - mFaviconLeft.getResult().draw(canvas); - mFaviconCentre.getResult().setBounds(iconStart2, 0, iconEnd2, canvas.getHeight()); - mFaviconCentre.getResult().draw(canvas); - mFaviconRight.getResult().setBounds(iconStart3, 0, canvas.getWidth(), canvas.getHeight()); - mFaviconRight.getResult().draw(canvas); - - // Set the finished icon drawable. - mFinalIconDrawable = new BitmapDrawable(mContext.getResources(), bitmap); - mFinishedCallback.onResult(mFinalIconDrawable); - - // Clean up. - mFinishedCallback = null; - destroy(); - } - - private void retrieveFavicon(Promise<Drawable> promise, Bitmap bitmap, GURL url) { - Drawable favicon = - new InsetDrawable( - FaviconUtils.getIconDrawableWithFilter( - bitmap, - url, - mIconGenerator, - mDefaultFaviconHelper, - mContext, - mFaviconSize), - mFaviconInset); - promise.fulfill(favicon); - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowView.java index 6b13c01..f925a60 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowView.java
@@ -7,6 +7,7 @@ import static org.chromium.components.browser_ui.widget.BrowserUiListMenuUtils.buildMenuListItem; import android.content.Context; +import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.text.TextUtils; @@ -66,13 +67,19 @@ } void setTitleData(Pair<String, Integer> titleData) { - String userTitle = titleData.first; - if (TextUtils.isEmpty(userTitle)) { - mTitleTextView.setText( - TabGroupTitleEditor.getDefaultTitle(getContext(), titleData.second)); - } else { - mTitleTextView.setText(userTitle); + String title = titleData.first; + if (TextUtils.isEmpty(title)) { + title = TabGroupTitleEditor.getDefaultTitle(getContext(), titleData.second); } + mTitleTextView.setText(title); + Resources resources = getResources(); + mListMenuButton.setContentDescription( + resources.getString(R.string.tab_group_menu_accessibility_text, title)); + + // Note that the subtitle will also be read for the row, as it just loops over visible text + // children. + mTitleTextView.setContentDescription( + resources.getString(R.string.tab_group_row_accessibility_text, title)); } void setCreationMillis(long creationMillis) {
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowViewUnitTest.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowViewUnitTest.java index dde7789f..4760a06 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowViewUnitTest.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupRowViewUnitTest.java
@@ -71,6 +71,7 @@ private ViewGroup mTabGroupStartIconParent; private TextView mTitleTextView; private TextView mSubtitleTextView; + private ListMenuButton mListMenuButton; private PropertyModel mPropertyModel; @Before @@ -85,6 +86,7 @@ mTabGroupStartIconParent = mTabGroupRowView.findViewById(R.id.tab_group_start_icon); mTitleTextView = mTabGroupRowView.findViewById(R.id.tab_group_title); mSubtitleTextView = mTabGroupRowView.findViewById(R.id.tab_group_subtitle); + mListMenuButton = mTabGroupRowView.findViewById(R.id.more); mTabGroupRowView.setTimeAgoResolverForTesting(mTimeAgoResolver); PropertyModelChangeProcessor.create( @@ -146,8 +148,7 @@ @SmallTest public void testOpenRunnableFromMenu() { remakeWithProperty(OPEN_RUNNABLE, mRunnable); - ListMenuButton menu = mTabGroupRowView.findViewById(R.id.more); - menu.showMenu(); + mListMenuButton.showMenu(); onView(withText("Open")).perform(click()); verify(mRunnable).run(); } @@ -156,8 +157,7 @@ @SmallTest public void testCloseRunnableFromMenu() { remakeWithProperty(DELETE_RUNNABLE, mRunnable); - ListMenuButton menu = mTabGroupRowView.findViewById(R.id.more); - menu.showMenu(); + mListMenuButton.showMenu(); onView(withText("Delete")).perform(click()); verify(mRunnable).run(); } @@ -230,4 +230,12 @@ mTabGroupRowView.resetOnBind(); assertNull(imageView.getDrawable()); } + + @Test + @SmallTest + public void testContentDescriptions() { + remakeWithProperty(TITLE_DATA, new Pair<>("Title", 3)); + assertEquals("Open Title", mTitleTextView.getContentDescription()); + assertEquals("Title tab group options", mListMenuButton.getContentDescription()); + } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManager.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManager.java index b377caf..8099d109c 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManager.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManager.java
@@ -64,9 +64,9 @@ if (filter.getRelatedTabCountForRootId(rootId) > 1) continue; } - TabGroupTitleUtils.deleteTabGroupTitle(rootId); + filter.deleteTabGroupTitle(rootId); if (ChromeFeatureList.sTabGroupParityAndroid.isEnabled()) { - TabGroupColorUtils.deleteTabGroupColor(rootId); + filter.deleteTabGroupColor(rootId); } if (ChromeFeatureList.sTabStripGroupCollapse.isEnabled()) { filter.deleteTabGroupCollapsed(rootId); @@ -122,10 +122,10 @@ filter.getRelatedTabCountForRootId(rootId) <= sizeThreshold; if (shouldDeleteVisualData) { if (title != null) { - TabGroupTitleUtils.deleteTabGroupTitle(rootId); + filter.deleteTabGroupTitle(rootId); } if (ChromeFeatureList.sTabGroupParityAndroid.isEnabled()) { - TabGroupColorUtils.deleteTabGroupColor(rootId); + filter.deleteTabGroupColor(rootId); } if (ChromeFeatureList.sTabStripGroupCollapse.isEnabled()) { filter.deleteTabGroupCollapsed(rootId); @@ -160,13 +160,13 @@ String title = TabGroupTitleUtils.getTabGroupTitle(oldRootId); if (title != null) { filter.setTabGroupTitle(newRootId, title); - TabGroupTitleUtils.deleteTabGroupTitle(oldRootId); + filter.deleteTabGroupTitle(oldRootId); } if (ChromeFeatureList.sTabGroupParityAndroid.isEnabled()) { int colorId = TabGroupColorUtils.getTabGroupColor(oldRootId); if (colorId != INVALID_COLOR_ID) { filter.setTabGroupColor(newRootId, colorId); - TabGroupColorUtils.deleteTabGroupColor(oldRootId); + filter.deleteTabGroupColor(oldRootId); } } if (ChromeFeatureList.sTabStripGroupCollapse.isEnabled()) {
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardViewModel.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardViewModel.java deleted file mode 100644 index a43048b8..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardViewModel.java +++ /dev/null
@@ -1,151 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management; - -import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_ALPHA; -import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_TYPE; -import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.ModelType.MESSAGE; - -import android.content.Context; - -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; -import org.chromium.chrome.tab_ui.R; -import org.chromium.ui.modelutil.PropertyModel; - -/** This is a util class for creating the property model of the TabSuggestionMessageCard. */ -public class TabSuggestionMessageCardViewModel { - /** - * Create a {@link PropertyModel} for TabSuggestionMessageCardView. - * - * @param context The {@link Context} to use. - * @param uiDismissActionProvider The {@link MessageCardView.DismissActionProvider} to set. - * @param data The {@link TabSuggestionMessageService.TabSuggestionMessageData} to use. - * @return A {@link PropertyModel} for the given {@code data}. - */ - public static PropertyModel create( - Context context, - MessageCardView.DismissActionProvider uiDismissActionProvider, - TabSuggestionMessageService.TabSuggestionMessageData data) { - // TODO(crbug.com/40073668): Add any missing accessibility or button descriptions. - String titleText = getTitleText(context, data.getActionType()); - String descriptionText = getDescriptionText(context, data); - String actionText = getActionText(context, data.getActionType()); - String secondaryActionText = getSecondaryActionText(context, data.getActionType()); - int iconWidth = getIconWidth(context, data.getActionType()); - int iconHeight = getIconHeight(context, data.getActionType()); - String dismissButtonContextDescription = - context.getString(R.string.accessibility_tab_suggestion_dismiss_button); - - return new PropertyModel.Builder(MessageCardViewProperties.ALL_KEYS) - .with( - MessageCardViewProperties.MESSAGE_TYPE, - MessageService.MessageType.TAB_SUGGESTION) - .with(MessageCardViewProperties.MESSAGE_IDENTIFIER, data.getActionType()) - .with(MessageCardViewProperties.ICON_WIDTH_IN_PIXELS, iconWidth) - .with(MessageCardViewProperties.ICON_HEIGHT_IN_PIXELS, iconHeight) - .with( - MessageCardViewProperties.ICON_PROVIDER, - data.createMultiFaviconIconProvider(context)) - .with(MessageCardViewProperties.UI_DISMISS_ACTION_PROVIDER, uiDismissActionProvider) - .with( - MessageCardViewProperties.MESSAGE_SERVICE_DISMISS_ACTION_PROVIDER, - data.getDismissActionProvider()) - .with( - MessageCardViewProperties.MESSAGE_SERVICE_ACTION_PROVIDER, - data.getReviewActionProvider()) - .with(MessageCardViewProperties.TITLE_TEXT, titleText) - .with(MessageCardViewProperties.DESCRIPTION_TEXT, descriptionText) - .with(MessageCardViewProperties.ACTION_TEXT, actionText) - .with(MessageCardViewProperties.SECONDARY_ACTION_TEXT, secondaryActionText) - .with( - MessageCardViewProperties.DISMISS_BUTTON_CONTENT_DESCRIPTION, - dismissButtonContextDescription) - .with(MessageCardViewProperties.IS_ICON_VISIBLE, true) - .with(MessageCardViewProperties.IS_INCOGNITO, false) - .with( - MessageCardViewProperties - .MESSAGE_CARD_VISIBILITY_CONTROL_IN_REGULAR_AND_INCOGNITO_MODE, - MessageCardViewProperties.MessageCardScope.REGULAR) - .with(CARD_TYPE, MESSAGE) - .with(CARD_ALPHA, 1f) - .build(); - } - - private static String getTitleText( - Context context, @TabSuggestion.TabSuggestionAction int suggestionActionType) { - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return context.getString(R.string.tab_cleanup_message_card_title); - default: - assert false : "Invalid TabSuggestionAction"; - return ""; - } - } - - private static String getDescriptionText( - Context context, TabSuggestionMessageService.TabSuggestionMessageData data) { - int suggestionActionType = data.getActionType(); - - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return context.getResources() - .getQuantityString( - R.plurals.tab_cleanup_message_card_subtitle, - data.getSize(), - data.getSize()); - default: - assert false : "Invalid TabSuggestionAction"; - return ""; - } - } - - private static String getActionText( - Context context, @TabSuggestion.TabSuggestionAction int suggestionActionType) { - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return context.getString(R.string.tab_cleanup_message_card_review_tabs_button); - default: - assert false : "Invalid TabSuggestionAction"; - return ""; - } - } - - private static String getSecondaryActionText( - Context context, @TabSuggestion.TabSuggestionAction int suggestionActionType) { - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return context.getString(R.string.tab_cleanup_message_card_close_tabs_button); - default: - assert false : "Invalid TabSuggestionAction"; - return ""; - } - } - - private static int getIconWidth( - Context context, @TabSuggestion.TabSuggestionAction int suggestionActionType) { - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return (int) - context.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_width); - default: - assert false : "Invalid TabSuggestionAction"; - return 0; - } - } - - private static int getIconHeight( - Context context, @TabSuggestion.TabSuggestionAction int suggestionActionType) { - switch (suggestionActionType) { - case TabSuggestion.TabSuggestionAction.CLOSE: - return (int) - context.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_height); - default: - assert false : "Invalid TabSuggestionAction"; - return 0; - } - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageService.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageService.java deleted file mode 100644 index d8a9490..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageService.java +++ /dev/null
@@ -1,249 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management; - -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.ACCEPTED; -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.DISMISSED; -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.NOT_CONSIDERED; - -import android.content.Context; - -import androidx.annotation.NonNull; -import androidx.annotation.VisibleForTesting; - -import org.chromium.base.Callback; -import org.chromium.base.supplier.Supplier; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModel; -import org.chromium.chrome.browser.tabmodel.TabModelFilter; -import org.chromium.chrome.browser.tabmodel.TabModelUtils; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabContext; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionsObserver; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * One of the concrete {@link MessageService} that only serve {@link MessageType#TAB_SUGGESTION}. - */ -public class TabSuggestionMessageService extends MessageService implements TabSuggestionsObserver { - private static boolean sSuggestionAvailableForTesting; - - /** This is the data type that this MessageService is serving to its Observer. */ - public class TabSuggestionMessageData implements MessageData { - private final TabSuggestion mTabSuggestion; - private final Callback<TabSuggestionFeedback> mTabSuggestionFeedback; - - public TabSuggestionMessageData( - TabSuggestion tabSuggestion, Callback<TabSuggestionFeedback> feedbackCallback) { - mTabSuggestion = tabSuggestion; - mTabSuggestionFeedback = feedbackCallback; - } - - /** - * @return The suggested tabs count. - */ - public int getSize() { - return mTabSuggestion.getTabsInfo().size(); - } - - /** - * @return The suggested action type. - */ - @TabSuggestion.TabSuggestionAction - public int getActionType() { - return mTabSuggestion.getAction(); - } - - /** - * @return The {@link MessageCardView.ReviewActionProvider} for the associated - * {@link TabSuggestion}. - */ - public MessageCardView.ReviewActionProvider getReviewActionProvider() { - return new MessageCardView.ReviewActionProvider() { - @Override - public void review() { - TabSuggestionMessageService.this.review(mTabSuggestion, mTabSuggestionFeedback); - } - }; - } - - /** - * @return The {@link MessageCardView.DismissActionProvider} for the associated - * {@link TabSuggestion}. - */ - public MessageCardView.DismissActionProvider getDismissActionProvider() { - return new MessageCardView.DismissActionProvider() { - @Override - public void dismiss(int messageType) { - TabSuggestionMessageService.this.dismiss( - mTabSuggestion, mTabSuggestionFeedback); - } - }; - } - - /** - * @return The class associated with handling the multi favicon icon provider for the large - * message card view. This includes building the background and fetching 3 favicons from - * the suggested tab list. - */ - public MultiFaviconIconProvider createMultiFaviconIconProvider(Context context) { - return new MultiFaviconIconProvider(context, mTabSuggestion, mProfile); - } - } - - private final Context mContext; - private final Profile mProfile; - private final Supplier<TabModelFilter> mCurrentTabModelFilterSupplier; - private final Supplier<TabListEditorCoordinator.TabListEditorController> - mTabListEditorControllerSupplier; - - public TabSuggestionMessageService( - Context context, - Profile profile, - Supplier<TabModelFilter> currentTabModelFilterSupplier, - Supplier<TabListEditorCoordinator.TabListEditorController> - tabListEditorControllerSupplier) { - super(MessageType.TAB_SUGGESTION); - mContext = context; - mProfile = profile; - mCurrentTabModelFilterSupplier = currentTabModelFilterSupplier; - mTabListEditorControllerSupplier = tabListEditorControllerSupplier; - } - - @VisibleForTesting - void review( - @NonNull TabSuggestion tabSuggestion, - @NonNull Callback<TabSuggestionFeedback> feedbackCallback) { - TabListEditorCoordinator.TabListEditorController tabListEditorController = - mTabListEditorControllerSupplier.get(); - assert tabListEditorController != null; - - tabListEditorController.configureToolbarWithMenuItems( - Collections.singletonList(getAction(tabSuggestion, feedbackCallback)), - getNavigationProvider(tabSuggestion, feedbackCallback)); - - tabListEditorController.show( - getTabListFromSuggestion(tabSuggestion), - tabSuggestion.getTabsInfo().size(), - /* recyclerViewPosition= */ null); - } - - @VisibleForTesting - TabListEditorAction getAction( - TabSuggestion tabSuggestion, Callback<TabSuggestionFeedback> feedbackCallback) { - TabListEditorAction action; - switch (tabSuggestion.getAction()) { - case TabSuggestion.TabSuggestionAction.CLOSE: - action = - TabListEditorCloseAction.createAction( - mContext, - TabListEditorAction.ShowMode.IF_ROOM, - TabListEditorAction.ButtonType.TEXT, - TabListEditorAction.IconPosition.END); - break; - default: - assert false; - return null; - } - - action.addActionObserver( - new TabListEditorAction.ActionObserver() { - @Override - public void preProcessSelectedTabs(List<Tab> selectedTabs) { - int totalTabCountBeforeProcess = - mCurrentTabModelFilterSupplier.get().getTabModel().getCount(); - List<Integer> selectedTabIds = new ArrayList<>(); - for (int i = 0; i < selectedTabs.size(); i++) { - selectedTabIds.add(selectedTabs.get(i).getId()); - } - accept( - selectedTabIds, - totalTabCountBeforeProcess, - tabSuggestion, - feedbackCallback); - } - }); - return action; - } - - @VisibleForTesting - TabListEditorCoordinator.TabListEditorNavigationProvider getNavigationProvider( - TabSuggestion tabSuggestion, - @NonNull Callback<TabSuggestionFeedback> feedbackCallback) { - return new TabListEditorCoordinator.TabListEditorNavigationProvider( - mContext, mTabListEditorControllerSupplier.get()) { - @Override - public void goBack() { - super.goBack(); - - feedbackCallback.onResult( - new TabSuggestionFeedback(tabSuggestion, DISMISSED, null, 0)); - } - }; - } - - private List<Tab> getTabListFromSuggestion(TabSuggestion tabSuggestion) { - List<Tab> tabs = new ArrayList<>(); - - List<TabContext.TabInfo> suggestedTabInfo = tabSuggestion.getTabsInfo(); - TabModel model = mCurrentTabModelFilterSupplier.get().getTabModel(); - for (int i = 0; i < suggestedTabInfo.size(); i++) { - int tabId = suggestedTabInfo.get(i).id; - Tab tab = TabModelUtils.getTabById(model, tabId); - if (tab == null) continue; - - tabs.add(tab); - } - return tabs; - } - - @VisibleForTesting - public void dismiss( - @NonNull TabSuggestion tabSuggestion, - @NonNull Callback<TabSuggestionFeedback> feedbackCallback) { - feedbackCallback.onResult( - new TabSuggestionFeedback(tabSuggestion, NOT_CONSIDERED, null, 0)); - } - - private void accept( - List<Integer> selectedTabIds, - int totalTabCount, - @NonNull TabSuggestion tabSuggestion, - @NonNull Callback<TabSuggestionFeedback> feedbackCallback) { - feedbackCallback.onResult( - new TabSuggestionFeedback(tabSuggestion, ACCEPTED, selectedTabIds, totalTabCount)); - } - - // TabSuggestionObserver implementations. - @Override - public void onNewSuggestion( - List<TabSuggestion> tabSuggestions, - Callback<TabSuggestionFeedback> tabSuggestionFeedback) { - if (tabSuggestions.size() == 0) return; - - assert tabSuggestionFeedback != null; - - sSuggestionAvailableForTesting = true; - for (TabSuggestion tabSuggestion : tabSuggestions) { - sendAvailabilityNotification( - new TabSuggestionMessageData(tabSuggestion, tabSuggestionFeedback)); - } - } - - @Override - public void onTabSuggestionInvalidated() { - sSuggestionAvailableForTesting = false; - sendInvalidNotification(); - } - - public static boolean isSuggestionAvailableForTesting() { - return sSuggestionAvailableForTesting; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java index 1512f51e..606cf90 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java
@@ -49,7 +49,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.chrome.browser.tasks.tab_management.TabListCoordinator.TabListMode; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionsOrchestrator; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.tab_ui.R; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; @@ -94,7 +93,6 @@ private final ModalDialogManager mModalDialogManager; private final TabSwitcherMessageManager mMessageManager; private final TabListEditorManager mTabListEditorManager; - private TabSuggestionsOrchestrator mTabSuggestionsOrchestrator; private ViewGroup mContainer; private TabCreatorManager mTabCreatorManager; private boolean mIsInitialized;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManager.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManager.java index ce44bf1..feb538a6 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManager.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManager.java
@@ -35,7 +35,6 @@ import org.chromium.chrome.browser.tasks.tab_management.PriceMessageService.PriceWelcomeMessageReviewActionProvider; import org.chromium.chrome.browser.tasks.tab_management.TabListCoordinator.TabListMode; import org.chromium.chrome.browser.tasks.tab_management.TabListEditorCoordinator.TabListEditorController; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionsOrchestrator; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.tab_ui.R; import org.chromium.ui.modaldialog.ModalDialogManager; @@ -133,8 +132,6 @@ private @Nullable Profile mProfile; private @Nullable IncognitoReauthManager mIncognitoReauthManager; - private @Nullable TabSuggestionsOrchestrator mTabSuggestionsOrchestrator; - private @Nullable TabSuggestionMessageService mTabSuggestionMessageService; private @Nullable PriceMessageService mPriceMessageService; private @Nullable IncognitoReauthPromoMessageService mIncognitoReauthPromoMessageService; private @Nullable ArchivedTabModelOrchestrator mArchivedTabModelOrchestrator; @@ -358,12 +355,6 @@ // Skip incrementing index if the message was not added. continue; } - } else if (messages.get(i).type == MessageService.MessageType.TAB_SUGGESTION) { - // TODO(crbug.com/40073668): Update to a mayAdd call checking show criteria - mTabListCoordinator.addSpecialListItem( - mCurrentTabModelFilterSupplier.get().index() + 1, - TabProperties.UiType.LARGE_MESSAGE, - messages.get(i).model); } else if (messages.get(i).type == MessageService.MessageType.ARCHIVED_TABS_MESSAGE) { // Always add the archived tabs message to the start. mTabListCoordinator.addSpecialListItem( @@ -421,8 +412,6 @@ TabProperties.UiType.LARGE_MESSAGE, MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE); mTabListCoordinator.removeSpecialListItem( - TabProperties.UiType.LARGE_MESSAGE, MessageService.MessageType.TAB_SUGGESTION); - mTabListCoordinator.removeSpecialListItem( TabProperties.UiType.CUSTOM_MESSAGE, MessageService.MessageType.ARCHIVED_TABS_MESSAGE); @@ -455,9 +444,6 @@ == MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE) { mTabListCoordinator.addSpecialListItemToEnd( TabProperties.UiType.LARGE_MESSAGE, messages.get(i).model); - } else if (messages.get(i).type == MessageService.MessageType.TAB_SUGGESTION) { - mTabListCoordinator.addSpecialListItemToEnd( - TabProperties.UiType.LARGE_MESSAGE, messages.get(i).model); } else { mTabListCoordinator.addSpecialListItemToEnd( TabProperties.UiType.MESSAGE, messages.get(i).model); @@ -508,8 +494,7 @@ private void dismissHandler(@MessageType int messageType) { if (messageType == MessageService.MessageType.PRICE_MESSAGE - || messageType == MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE - || messageType == MessageService.MessageType.TAB_SUGGESTION) { + || messageType == MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE) { mTabListCoordinator.removeSpecialListItem( TabProperties.UiType.LARGE_MESSAGE, messageType); } else {
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManagerUnitTest.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManagerUnitTest.java index b47b0a7..5dcb3c7 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManagerUnitTest.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMessageManagerUnitTest.java
@@ -191,10 +191,6 @@ .removeSpecialListItem( TabProperties.UiType.LARGE_MESSAGE, MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE); - verify(mTabListCoordinator) - .removeSpecialListItem( - TabProperties.UiType.LARGE_MESSAGE, - MessageService.MessageType.TAB_SUGGESTION); verify(mMessageUpdateObserver).onRemoveAllAppendedMessage(); } @@ -225,10 +221,6 @@ .removeSpecialListItem( TabProperties.UiType.LARGE_MESSAGE, MessageService.MessageType.INCOGNITO_REAUTH_PROMO_MESSAGE); - verify(mTabListCoordinator) - .removeSpecialListItem( - TabProperties.UiType.LARGE_MESSAGE, - MessageService.MessageType.TAB_SUGGESTION); verify(mMessageUpdateObserver).onRemoveAllAppendedMessage(); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/UndoGroupSnackbarController.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/UndoGroupSnackbarController.java index 0ca47e5c..6fed19b1 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/UndoGroupSnackbarController.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/UndoGroupSnackbarController.java
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; -import org.chromium.chrome.browser.tasks.tab_groups.TabGroupColorUtils; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilterObserver; import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; @@ -226,7 +225,7 @@ filter.deleteTabGroupTitle(rootId); if (ChromeFeatureList.sTabGroupParityAndroid.isEnabled()) { - TabGroupColorUtils.deleteTabGroupColor(rootId); + filter.deleteTabGroupColor(rootId); } if (ChromeFeatureList.sTabStripGroupCollapse.isEnabled()) { filter.deleteTabGroupCollapsed(rootId); @@ -237,7 +236,7 @@ private void undo(List<TabUndoInfo> data) { assert data.size() != 0; - TabGroupModelFilter tabGroupModelFilter = + TabGroupModelFilter filter = (TabGroupModelFilter) mTabModelSelector.getTabModelFilterProvider().getCurrentTabModelFilter(); TabUndoInfo firstInfo = data.get(0); @@ -249,7 +248,7 @@ // the group title for that rootID on undo since the destination group never had a group // title to begin with, and the merging tabs still have the original group title stored. if (firstInfo.destinationGroupTitle == null) { - tabGroupModelFilter.deleteTabGroupTitle(firstRootId); + filter.deleteTabGroupTitle(firstRootId); } if (ChromeFeatureList.sTabGroupParityAndroid.isEnabled()) { @@ -259,7 +258,7 @@ // destination rootID, as all tabs still currently share that ID before the undo // operation is performed. if (firstInfo.destinationGroupColorId == INVALID_COLOR_ID) { - TabGroupColorUtils.deleteTabGroupColor(firstRootId); + filter.deleteTabGroupColor(firstRootId); } } @@ -267,13 +266,13 @@ // need to restore that state. if (ChromeFeatureList.sTabStripGroupCollapse.isEnabled()) { if (firstInfo.destinationGroupTitleCollapsed) { - tabGroupModelFilter.setTabGroupCollapsed(firstRootId, true); + filter.setTabGroupCollapsed(firstRootId, true); } } for (int i = data.size() - 1; i >= 0; i--) { TabUndoInfo info = data.get(i); - tabGroupModelFilter.undoGroupedTab( + filter.undoGroupedTab( info.tab, info.tabOriginalIndex, info.tabOriginalRootId,
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContext.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContext.java deleted file mode 100644 index e82364e..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContext.java +++ /dev/null
@@ -1,223 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import android.text.TextUtils; - -import androidx.annotation.Nullable; - -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModelFilter; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** Represents a snapshot of the current tabs and tab groups. */ -public class TabContext { - /** Holds basic information about a tab group. */ - public static class TabGroupInfo { - public final int rootId; - public final List<TabInfo> tabs; - - public TabGroupInfo(int rootId, List<TabInfo> tabs) { - this.rootId = rootId; - this.tabs = Collections.unmodifiableList(tabs); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - if (other == null) return false; - if (other instanceof TabGroupInfo) { - TabGroupInfo otherGroupInfo = (TabGroupInfo) other; - return rootId == otherGroupInfo.rootId && tabs == null - ? otherGroupInfo.tabs == null - : tabs.equals(otherGroupInfo.tabs); - } - return false; - } - - @Override - public int hashCode() { - int result = 31 * (tabs == null ? 0 : tabs.hashCode()); - result = 31 * result + rootId; - return result; - } - } - - /** Holds basic information about a tab. */ - public static class TabInfo implements Comparable<TabInfo> { - // equals() and hashCode() only include url and id - public final String url; - public final long timestampMillis; - public final int id; - public final String title; - public final String originalUrl; - public final String visibleUrl; - public final boolean isIncognito; - - /** Constructs a new TabInfo object */ - protected TabInfo( - int id, - String title, - String url, - String originalUrl, - long timestampMillis, - String visibleUrl, - boolean isIncognito) { - this.id = id; - this.title = title; - this.url = url; - this.originalUrl = originalUrl; - this.timestampMillis = timestampMillis; - this.visibleUrl = visibleUrl; - this.isIncognito = isIncognito; - } - - /** Constructs a new non-incognito TabInfo object */ - protected TabInfo( - int id, - String title, - String url, - String originalUrl, - long timestampMillis, - String visibleUrl) { - this(id, title, url, originalUrl, timestampMillis, visibleUrl, false); - } - - /** Creates a new TabInfo object from {@link Tab} */ - public static TabInfo createFromTab(Tab tab) { - // TODO(crbug.com/40549331): convert TabInfo to GURL - return new TabInfo( - tab.getId(), - tab.getTitle(), - tab.getUrl().getSpec(), - tab.getOriginalUrl().getSpec(), - tab.getTimestampMillis(), - tab.getUrl().getSpec(), - tab.isIncognito()); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - if (other == null) return false; - if (other instanceof TabInfo) { - TabInfo otherTabInfo = (TabInfo) other; - return id == otherTabInfo.id && TextUtils.equals(url, otherTabInfo.url); - } - return false; - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + id; - result = 31 * result + url == null ? 0 : url.hashCode(); - return result; - } - - @Override - public int compareTo(TabInfo other) { - return Integer.compare(id, other.id); - } - } - - private final List<TabInfo> mUngroupedTabs; - private final List<TabGroupInfo> mTabGroups; - - protected TabContext(List<TabInfo> ungroupedTabs, List<TabGroupInfo> groups) { - mUngroupedTabs = Collections.unmodifiableList(ungroupedTabs); - mTabGroups = Collections.unmodifiableList(groups); - } - - public List<TabInfo> getUngroupedTabs() { - return mUngroupedTabs; - } - - public List<TabGroupInfo> getTabGroups() { - return mTabGroups; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - if (other == null) return false; - if (other instanceof TabContext) { - TabContext otherTabContext = (TabContext) other; - return (mTabGroups == null - ? otherTabContext.getTabGroups() == null - : mTabGroups.equals(otherTabContext.getTabGroups())) - && (mUngroupedTabs == null - ? otherTabContext.getUngroupedTabs() == null - : mUngroupedTabs.equals(otherTabContext.getUngroupedTabs())); - } - return false; - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (mTabGroups == null ? 0 : mTabGroups.hashCode()); - result = 31 * result + (mUngroupedTabs == null ? 0 : mUngroupedTabs.hashCode()); - return result; - } - - /** - * Creates an instance of TabContext based on the provided {@link TabModelFilter}. - * - * @param tabModelFilter The TabModelFilter for which the TabContext will be derived - * @return an instance of TabContext - */ - public static TabContext createCurrentContext(@Nullable TabModelFilter tabModelFilter) { - List<TabInfo> ungroupedTabs = new ArrayList<>(); - List<TabGroupInfo> existingGroups = new ArrayList<>(); - - // Examine each tab in the current model and either add it to the list of ungrouped tabs or - // add it to a group it belongs to. - int count = tabModelFilter == null ? 0 : tabModelFilter.getCount(); - for (int i = 0; i < count; i++) { - Tab currentTab = tabModelFilter.getTabAt(i); - - assert currentTab != null : "currentTab should not be null"; - - // TODO(crbug.com/40729994): Investigate the NPE. - if (currentTab == null) continue; - - List<Tab> relatedTabs = tabModelFilter.getRelatedTabList(currentTab.getId()); - - if (relatedTabs.size() > 1) { - List<Tab> nonClosingTabs = getNonClosingTabs(relatedTabs); - existingGroups.add( - new TabGroupInfo( - currentTab.getRootId(), createTabInfoList(nonClosingTabs))); - } else { - if (currentTab.isClosing()) continue; - ungroupedTabs.add(TabInfo.createFromTab(currentTab)); - } - } - - return new TabContext(ungroupedTabs, existingGroups); - } - - private static List<Tab> getNonClosingTabs(List<Tab> tabs) { - List<Tab> nonClosingTabs = new ArrayList<>(); - for (int i = 0; i < tabs.size(); i++) { - Tab tab = tabs.get(i); - if (tab.isClosing()) continue; - nonClosingTabs.add(tab); - } - return nonClosingTabs; - } - - private static List<TabInfo> createTabInfoList(List<Tab> tabs) { - List<TabInfo> tabInfoList = new ArrayList<>(); - for (Tab tab : tabs) { - tabInfoList.add(TabInfo.createFromTab(tab)); - } - return tabInfoList; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestion.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestion.java deleted file mode 100644 index 3600315..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestion.java +++ /dev/null
@@ -1,78 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import androidx.annotation.IntDef; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.util.Collections; -import java.util.List; - -/** Represents the output of the {@link TabSuggestions} pipeline. */ -public final class TabSuggestion { - /** Types of Suggestion Actions */ - @IntDef({TabSuggestion.TabSuggestionAction.CLOSE}) - @Retention(RetentionPolicy.SOURCE) - public @interface TabSuggestionAction { - int CLOSE = 0; - } - - private final List<TabContext.TabInfo> mTabsInfo; - private final @TabSuggestionAction int mAction; - private final String mProviderName; - private final Integer mTabGroupId; - - public TabSuggestion( - List<TabContext.TabInfo> tabsInfo, - @TabSuggestionAction int action, - String providerName) { - this(tabsInfo, action, providerName, null); - } - - public TabSuggestion( - List<TabContext.TabInfo> tabsInfo, - @TabSuggestionAction int action, - String providerName, - Integer tabGroupId) { - mTabsInfo = - tabsInfo == null ? Collections.emptyList() : Collections.unmodifiableList(tabsInfo); - mAction = action; - mProviderName = providerName; - mTabGroupId = tabGroupId; - } - - /** Returns the list of the suggested tabs */ - public List<TabContext.TabInfo> getTabsInfo() { - return mTabsInfo; - } - - /** Returns the suggested action */ - public @TabSuggestionAction int getAction() { - return mAction; - } - - /** Returns the provider's name */ - public String getProviderName() { - return mProviderName; - } - - /** - * Checks if the suggestion is for an existing group - * @return true if the suggestion updates an existing group - */ - public boolean hasExistingGroupId() { - return getExistingTabGroupId() != null; - } - - /** - * If the suggestion is for an existing group, this will return the group id. Call @{link - * hasExistingGroupId} before calling this getter. - * @return existing group Id - */ - public Integer getExistingTabGroupId() { - return mTabGroupId; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionFeedback.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionFeedback.java deleted file mode 100644 index e76cfd7..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionFeedback.java +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import androidx.annotation.IntDef; - -import java.util.List; - -/** Feedback acquired from the user about a {@link TabSuggestion} */ -public class TabSuggestionFeedback { - @IntDef({ - TabSuggestionFeedback.TabSuggestionResponse.NOT_CONSIDERED, - TabSuggestionFeedback.TabSuggestionResponse.DISMISSED, - TabSuggestionResponse.ACCEPTED - }) - public @interface TabSuggestionResponse { - /** User did not consider tab suggestion at all */ - int NOT_CONSIDERED = 0; - - /** User considered tab suggestion, but dismissed it */ - int DISMISSED = 1; - - /** User considered tab suggestion and accepted it */ - int ACCEPTED = 2; - } - - public final TabSuggestion tabSuggestion; - public final @TabSuggestionResponse int tabSuggestionResponse; - public final List<Integer> selectedTabIds; - public final int totalTabCount; - - /** - * @param tabSuggestion tab suggestion feedback is provided for - * @param tabSuggestionResponse user response - see {@link TabSuggestionResponse} - * @param selectedTabIds final tab ids selected across all tabs (the user can edit - * tabs among the suggestion to accept or reject and can add tabs outside the suggestion) - * @param totalTabCount total number of tabs in the tab model - */ - public TabSuggestionFeedback( - TabSuggestion tabSuggestion, - @TabSuggestionResponse int tabSuggestionResponse, - List<Integer> selectedTabIds, - int totalTabCount) { - this.tabSuggestion = tabSuggestion; - this.tabSuggestionResponse = tabSuggestionResponse; - this.selectedTabIds = selectedTabIds; - this.totalTabCount = totalTabCount; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestions.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestions.java deleted file mode 100644 index f98e423..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestions.java +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -/** Interface for the Tab Suggestions framework. */ -public interface TabSuggestions { - /** - * Adds an observer - * @param tabSuggestionsObserver observer which is notified when new suggestions are available - */ - void addObserver(TabSuggestionsObserver tabSuggestionsObserver); - - /** - * Removes an observer - * @param tabSuggestionsObserver observer which is notified when new suggestions are available - */ - void removeObserver(TabSuggestionsObserver tabSuggestionsObserver); -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsClientFetcher.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsClientFetcher.java deleted file mode 100644 index 5a23d179..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsClientFetcher.java +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import org.chromium.base.Callback; - -import java.util.ArrayList; -import java.util.List; - -/** - * Implements {@link TabSuggestionsFetcher}. Abstracts the details of - * communicating with all known client-side {@link TabSuggestionProvider} - */ -public final class TabSuggestionsClientFetcher implements TabSuggestionsFetcher { - - /** - * Acquires suggestions for which tabs to close based on client side - * heuristics. - */ - public TabSuggestionsClientFetcher() {} - - @Override - public void fetch(TabContext tabContext, Callback<TabSuggestionsFetcherResults> callback) { - List<TabSuggestion> retList = new ArrayList<>(); - - callback.onResult(new TabSuggestionsFetcherResults(retList, tabContext)); - } - - @Override - public boolean isEnabled() { - return true; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcher.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcher.java deleted file mode 100644 index 26f075f..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcher.java +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import org.chromium.base.Callback; - -/** Defines the interface for suggestion fetchers. */ -public interface TabSuggestionsFetcher { - /** - * Acquires suggestions for closing tabs based on client side heuristics - * and returns the result in a callback - * @param tabContext snapshot of current tab and tab groups - * @param callback callback the results are returned in - */ - void fetch(TabContext tabContext, Callback<TabSuggestionsFetcherResults> callback); - - /** Returns true if the Fetcher is enabled. */ - boolean isEnabled(); -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcherResults.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcherResults.java deleted file mode 100644 index 46ca5c8..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcherResults.java +++ /dev/null
@@ -1,26 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import java.util.List; - -/** - * Represents results for recommendations regarding whether Tabs should be - * closed. - */ -public class TabSuggestionsFetcherResults { - public final List<TabSuggestion> tabSuggestions; - public final TabContext tabContext; - - /** - * Results from Tab suggestions fetcher - * @param tabSuggestions tabs suggested to be closed - * @param tabContext snapshot of current tab and tab groups - */ - TabSuggestionsFetcherResults(List<TabSuggestion> tabSuggestions, TabContext tabContext) { - this.tabSuggestions = tabSuggestions; - this.tabContext = tabContext; - } -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsObserver.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsObserver.java deleted file mode 100644 index 39ebeab..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsObserver.java +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import org.chromium.base.Callback; - -import java.util.List; - -/** Observes when new Tab Suggestions become available */ -public interface TabSuggestionsObserver { - /** - * Notify when we have new Tab Suggestions - * @param tabSuggestions tab suggestions acquired - * @param tabSuggestionFeedback callback for providing feedback on the suggestions - */ - void onNewSuggestion( - List<TabSuggestion> tabSuggestions, - Callback<TabSuggestionFeedback> tabSuggestionFeedback); - - /** Notify when a {@link TabContext} is no longer valid/representative of the user's tabs. */ - void onTabSuggestionInvalidated(); -}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java deleted file mode 100644 index 9c97225..0000000 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java +++ /dev/null
@@ -1,289 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import android.content.Context; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.os.SystemClock; - -import androidx.annotation.VisibleForTesting; - -import org.chromium.base.ContextUtils; -import org.chromium.base.Log; -import org.chromium.base.ObserverList; -import org.chromium.base.ResettersForTesting; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.base.metrics.RecordUserAction; -import org.chromium.base.supplier.Supplier; -import org.chromium.chrome.browser.flags.ChromeFeatureList; -import org.chromium.chrome.browser.tabmodel.TabModelFilter; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion.TabSuggestionAction; - -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * Represents the entry point for the TabSuggestions component. Responsible for registering and - * invoking the different {@link TabSuggestionsFetcher}. - */ -public class TabSuggestionsOrchestrator implements TabSuggestions { - public static final String TAB_SUGGESTIONS_UMA_PREFIX = "TabSuggestionsOrchestrator"; - private static final String LAST_TIMESTAMP_KEY = "LastTimestamp"; - private static final String BACKOFF_COUNT_KEY = "BackoffCountKey"; - private static final String BACKOFF_IDX_KEY = "BackoffIdxKey"; - private static final long[] BACKOFF_AMOUNTS = { - TimeUnit.MINUTES.toMillis(1), - TimeUnit.MINUTES.toMillis(30), - TimeUnit.HOURS.toMillis(1), - TimeUnit.HOURS.toMillis(2), - TimeUnit.HOURS.toMillis(12), - TimeUnit.DAYS.toMillis(1), - TimeUnit.DAYS.toMillis(2), - TimeUnit.DAYS.toMillis(7), - TimeUnit.DAYS.toMillis(10) - }; - private static final String TAG = "TabSuggestDetailed"; - private static final int MIN_CLOSE_SUGGESTIONS_THRESHOLD = 3; - private static final String SHARED_PREFERENCES_ID = "TabsuggestionsPreferences"; - - private static final int MIN_TIME_BETWEEN_PREFETCHES_DEFAULT_MS = 30000; - - protected TabSuggestionFeedback mTabSuggestionFeedback; - private final SharedPreferences mSharedPreferences; - private List<TabSuggestionsFetcher> mTabSuggestionsFetchers; - private List<TabSuggestion> mPrefetchedResults = new LinkedList<>(); - private TabContext mPrefetchedTabContext; - private Supplier<TabModelFilter> mCurrentTabModelFilterSupplier; - private ObserverList<TabSuggestionsObserver> mTabSuggestionsObservers; - private int mRemainingFetchers; - private long mNextPrefetchTime; - private int mMinTimeBetweenPrefetchesMs = MIN_TIME_BETWEEN_PREFETCHES_DEFAULT_MS; - - public TabSuggestionsOrchestrator( - Context context, Supplier<TabModelFilter> currentTabModelFilterSupplier) { - this( - context, - currentTabModelFilterSupplier, - ContextUtils.getApplicationContext() - .getSharedPreferences(SHARED_PREFERENCES_ID, Context.MODE_PRIVATE)); - } - - @VisibleForTesting - TabSuggestionsOrchestrator( - Context context, - Supplier<TabModelFilter> currentTabModelFilterSupplier, - SharedPreferences sharedPreferences) { - mCurrentTabModelFilterSupplier = currentTabModelFilterSupplier; - mTabSuggestionsFetchers = new LinkedList<>(); - mTabSuggestionsFetchers.add(new TabSuggestionsClientFetcher()); - mTabSuggestionsObservers = new ObserverList<>(); - mSharedPreferences = sharedPreferences; - } - - protected void setFetchersForTesting() { - mTabSuggestionsFetchers = new LinkedList<>(); - TabSuggestionsClientFetcher testingFetcher = new TabSuggestionsClientFetcher(); - mTabSuggestionsFetchers.add(testingFetcher); - } - - @VisibleForTesting - protected static List<TabSuggestion> aggregateResults(List<TabSuggestion> tabSuggestions) { - List<TabSuggestion> aggregated = new LinkedList<>(); - for (TabSuggestion tabSuggestion : tabSuggestions) { - switch (tabSuggestion.getAction()) { - case TabSuggestion.TabSuggestionAction.CLOSE: - if (tabSuggestion.getTabsInfo().size() >= MIN_CLOSE_SUGGESTIONS_THRESHOLD) { - aggregated.add(tabSuggestion); - } - break; - default: - android.util.Log.e( - TAG, String.format("Unknown action: %d", tabSuggestion.getAction())); - break; - } - } - // TODO(crbug.com/40132207): Sort the suggestion based on priority. - Collections.sort(aggregated, (t1, t2) -> Integer.compare(t1.getAction(), t2.getAction())); - return aggregated; - } - - /** - * Acquire suggestions and store so suggestions are available for the UI - * thread on demand. - */ - protected void prefetchSuggestions() { - if (isBackoffEnabled()) { - return; - } - long time = SystemClock.elapsedRealtime(); - if (time < mNextPrefetchTime) { - return; - } - mNextPrefetchTime = - time - + ChromeFeatureList.getFieldTrialParamByFeatureAsInt( - ChromeFeatureList.ARCHIVE_TAB_SERVICE, - "min_time_between_prefetches", - mMinTimeBetweenPrefetchesMs); - performPrefetch(); - } - - @VisibleForTesting - protected void performPrefetch() { - TabContext tabContext = - TabContext.createCurrentContext(mCurrentTabModelFilterSupplier.get()); - synchronized (mPrefetchedResults) { - mRemainingFetchers = 0; - mPrefetchedTabContext = tabContext; - mPrefetchedResults = new LinkedList<>(); - for (TabSuggestionsFetcher tabSuggestionsFetcher : mTabSuggestionsFetchers) { - if (tabSuggestionsFetcher.isEnabled()) { - mRemainingFetchers++; - tabSuggestionsFetcher.fetch(tabContext, res -> prefetchCallback(res)); - } - } - } - } - - protected void setMinTimeBetweenPreFetchesForTesting(int minTimeBetweenPrefetchesMs) { - var oldValue = mMinTimeBetweenPrefetchesMs; - mMinTimeBetweenPrefetchesMs = minTimeBetweenPrefetchesMs; - ResettersForTesting.register(() -> mMinTimeBetweenPrefetchesMs = oldValue); - } - - private boolean isBackoffEnabled() { - // TODO(crbug.com/40118562) expand to record/read and respond - // to close/group separately and determine if we can use - // shared prefs folder. - synchronized (mSharedPreferences) { - long lastTimestamp = mSharedPreferences.getLong(LAST_TIMESTAMP_KEY, -1); - // No lastTimestamp means no dismissals have been recorded, so we - // don't backoff - if (lastTimestamp == -1) { - return false; - } - long backoffCount = mSharedPreferences.getLong(BACKOFF_COUNT_KEY, -1); - // If counting down from the backoff amount is finished i.e. the count - // is below 0, enough time has elapsed and suggestions can be provided - // again - if (backoffCount <= 0) { - return false; - } - long currentTime = System.currentTimeMillis(); - // Decrement time elapsed since last update to the backoff count - backoffCount -= currentTime - lastTimestamp; - Editor editor = mSharedPreferences.edit(); - editor.putLong(LAST_TIMESTAMP_KEY, currentTime); - editor.putLong(BACKOFF_COUNT_KEY, backoffCount); - editor.apply(); - // If the backoff count is above zero, continue to wait - // and don't provide suggestions - return backoffCount > 0; - } - } - - private void recordDismissalBackoff() { - synchronized (mSharedPreferences) { - int backoffIdx = - Math.min( - mSharedPreferences.getInt(BACKOFF_IDX_KEY, 0), - BACKOFF_AMOUNTS.length - 1); - Editor editor = mSharedPreferences.edit(); - editor.putLong(BACKOFF_COUNT_KEY, BACKOFF_AMOUNTS[backoffIdx]); - editor.putInt(BACKOFF_IDX_KEY, backoffIdx + 1); - editor.putLong(LAST_TIMESTAMP_KEY, System.currentTimeMillis()); - editor.apply(); - } - } - - private void prefetchCallback(TabSuggestionsFetcherResults suggestions) { - synchronized (mPrefetchedResults) { - // If the tab context has changed since the fetchers were used, - // we simply ignore the result as it is no longer relevant. - if (suggestions.tabContext.equals(mPrefetchedTabContext)) { - mRemainingFetchers--; - mPrefetchedResults.addAll(suggestions.tabSuggestions); - if (mRemainingFetchers == 0) { - for (TabSuggestionsObserver tabSuggestionsObserver : mTabSuggestionsObservers) { - tabSuggestionsObserver.onNewSuggestion( - aggregateResults(mPrefetchedResults), - res -> onTabSuggestionFeedback(res)); - } - } - } - } - } - - @Override - public void addObserver(TabSuggestionsObserver tabSuggestionsObserver) { - mTabSuggestionsObservers.addObserver(tabSuggestionsObserver); - } - - @Override - public void removeObserver(TabSuggestionsObserver tabSuggestionsObserver) { - mTabSuggestionsObservers.removeObserver(tabSuggestionsObserver); - } - - public void onTabSuggestionFeedback(TabSuggestionFeedback tabSuggestionFeedback) { - if (tabSuggestionFeedback == null) { - Log.e(TAG, "TabSuggestionFeedback is null"); - return; - } - - String suffix = ""; - switch (tabSuggestionFeedback.tabSuggestion.getAction()) { - case TabSuggestionAction.CLOSE: - suffix = "Closing"; - break; - default: - assert false : "Unknown TabSuggestion action"; - } - - // Record TabSuggestionFeedback for testing purposes - mTabSuggestionFeedback = tabSuggestionFeedback; - - switch (tabSuggestionFeedback.tabSuggestionResponse) { - case TabSuggestionFeedback.TabSuggestionResponse.NOT_CONSIDERED: - RecordUserAction.record("TabsSuggestions.NotConsidered." + suffix); - recordDismissalBackoff(); - return; - case TabSuggestionFeedback.TabSuggestionResponse.ACCEPTED: - RecordUserAction.record("TabsSuggestions.Considered.Accepted." + suffix); - break; - case TabSuggestionFeedback.TabSuggestionResponse.DISMISSED: - RecordUserAction.record("TabsSuggestions.Considered.Dismissed." + suffix); - return; - default: - assert false : "Unknown TabSuggestionResponse"; - } - - Set<Integer> suggestedTabIds = new HashSet<>(); - for (TabContext.TabInfo tabInfo : tabSuggestionFeedback.tabSuggestion.getTabsInfo()) { - suggestedTabIds.add(tabInfo.id); - } - - int numSelectFromSuggestion = 0; - int numSelectOutsideSuggestion = 0; - for (int selectedTabId : tabSuggestionFeedback.selectedTabIds) { - if (suggestedTabIds.contains(selectedTabId)) { - numSelectFromSuggestion++; - } else { - numSelectOutsideSuggestion++; - } - } - int numChanged = - tabSuggestionFeedback.tabSuggestion.getTabsInfo().size() - - numSelectFromSuggestion - + numSelectOutsideSuggestion; - // This was previously TabsSuggestions.Close.NumSuggestionsChanged. - RecordHistogram.recordCount100Histogram( - "Tabs.Suggestions.NumSuggestionsChanged." + suffix, numChanged); - } -}
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd index ee760c9..307db5e 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd
@@ -405,23 +405,6 @@ <ph name="NUMBER_OF_TABS">%1$s<ex>2</ex></ph> tabs seem related. Group them? </message> - <!-- Tab Cleanup strings --> - <message name="IDS_TAB_CLEANUP_MESSAGE_CARD_TITLE" desc="Header for the Tab Cleanup message card where a user can review suggested tabs to close before closing or just close them outright."> - Want to close old tabs? - </message> - <message name="IDS_TAB_CLEANUP_MESSAGE_CARD_SUBTITLE" desc="Subtitle for the Tab Cleanup message card that indicates the number of suggested tabs a user can review to close before closing or just close them outright."> - {TABS_COUNT, plural, - =1 {You have <ph name="TABS_COUNT_ONE">%1$s<ex>1</ex></ph> tab you haven't used recently} - other {You have <ph name="TABS_COUNT_MANY">%1$s<ex>8</ex></ph> tabs you haven't used recently} - } - </message> - <message name="IDS_TAB_CLEANUP_MESSAGE_CARD_REVIEW_TABS_BUTTON" desc="Button text where a user can review suggested tabs to close before closing."> - Review tabs - </message> - <message name="IDS_TAB_CLEANUP_MESSAGE_CARD_CLOSE_TABS_BUTTON" desc="Button text where a user can close suggested tabs without reviewing them."> - Close without reviewing - </message> - <!-- Accessibility strings for Tab Suggestion --> <message name="IDS_ACCESSIBILITY_TAB_SUGGESTION_REVIEW_BUTTON" desc="The accessibility text to read when the text button 'Review' is focused. The 'Review' button is shown next to the message 'X of your tabs haven't been used lately. Close them?', or 'X tabs seem related. Group them?'. User uses that text button to enter a selection mode where they can see the suggested tabs to close or to group, see the rest of their open tabs, and choose what tabs to close or to group."> Review the suggestions. @@ -802,6 +785,12 @@ <message name="IDS_OPEN_TAB_GROUP_MENU_ITEM" desc="Menu item to open a more detailed view of a tab group."> Open </message> + <message name="IDS_TAB_GROUP_ROW_ACCESSIBILITY_TEXT" desc="Content description for accessibility to describe action of tapping on a tab group row."> + Open <ph name="TITLE_OF_GROUP">%s<ex>shopping</ex></ph> + </message> + <message name="IDS_TAB_GROUP_MENU_ACCESSIBILITY_TEXT" desc="Content description for accessibility to describe the action of tapping on the more menu button."> + <ph name="TITLE_OF_GROUP">%s<ex>shopping</ex></ph> tab group options + </message> <!-- Tabs Settings Strings --> <message name="IDS_TABS_SETTINGS_TITLE" desc="A title to show in the top toolbar when the Tabs settings page is open.">
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_CLOSE_TABS_BUTTON.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_CLOSE_TABS_BUTTON.png.sha1 deleted file mode 100644 index 16154a91..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_CLOSE_TABS_BUTTON.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -6f0b90ba447b44f400a519d4932c7c6709bf1299 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_REVIEW_TABS_BUTTON.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_REVIEW_TABS_BUTTON.png.sha1 deleted file mode 100644 index 16154a91..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_REVIEW_TABS_BUTTON.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -6f0b90ba447b44f400a519d4932c7c6709bf1299 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_SUBTITLE.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_SUBTITLE.png.sha1 deleted file mode 100644 index 7f00720..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_SUBTITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -99fee78ba460d197531a6c90ce5e5ca00df4b528 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_TITLE.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_TITLE.png.sha1 deleted file mode 100644 index 7f00720..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_CLEANUP_MESSAGE_CARD_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -99fee78ba460d197531a6c90ce5e5ca00df4b528 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_MENU_ACCESSIBILITY_TEXT.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_MENU_ACCESSIBILITY_TEXT.png.sha1 new file mode 100644 index 0000000..8e99524 --- /dev/null +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_MENU_ACCESSIBILITY_TEXT.png.sha1
@@ -0,0 +1 @@ +5e43e2549ed1b8cb092798f8e340a70467ef7c88 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_ROW_ACCESSIBILITY_TEXT.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_ROW_ACCESSIBILITY_TEXT.png.sha1 new file mode 100644 index 0000000..8e99524 --- /dev/null +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_ROW_ACCESSIBILITY_TEXT.png.sha1
@@ -0,0 +1 @@ +5e43e2549ed1b8cb092798f8e340a70467ef7c88 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderTest.java index 09267bc9..9a5f00e 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderTest.java
@@ -33,7 +33,6 @@ import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -96,13 +95,10 @@ private MessageCardProviderCoordinator mCoordinator; private MessageService mTestingService; - private MessageService mSuggestionService; private MessageService mPriceService; private MessageCardView.DismissActionProvider mUiDismissActionProvider = (messageType) -> {}; - @Mock private TabSuggestionMessageService.TabSuggestionMessageData mTabSuggestionMessageData; - @Mock private PriceMessageService.PriceMessageData mPriceMessageData; @Mock private Profile mProfile; @@ -163,84 +159,14 @@ view.addView(mRecyclerView); mTestingService = new MessageService(MessageService.MessageType.FOR_TESTING); - mSuggestionService = - new MessageService(MessageService.MessageType.TAB_SUGGESTION); mPriceService = new MessageService(MessageService.MessageType.PRICE_MESSAGE); mCoordinator = new MessageCardProviderCoordinator( getActivity(), () -> mProfile, mUiDismissActionProvider); mCoordinator.subscribeMessageService(mTestingService); - mCoordinator.subscribeMessageService(mSuggestionService); mCoordinator.subscribeMessageService(mPriceService); }); - - when(mTabSuggestionMessageData.getActionType()) - .thenReturn(TabSuggestion.TabSuggestionAction.CLOSE); - } - - @Test - @SmallTest - public void testShowingTabSuggestionMessage() { - when(mTabSuggestionMessageData.getSize()).thenReturn(SUGGESTED_TAB_COUNT); - TestThreadUtils.runOnUiThreadBlocking( - () -> { - mSuggestionService.sendAvailabilityNotification(mTabSuggestionMessageData); - mRecyclerView.startShowing(false); - }); - - CriteriaHelper.pollUiThread( - () -> mRecyclerView.getVisibility() == View.VISIBLE && mFinishedShowing.get()); - - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - } - - @Test - @SmallTest - public void testReviewTabSuggestionMessage() { - AtomicBoolean reviewed = new AtomicBoolean(); - when(mTabSuggestionMessageData.getSize()).thenReturn(SUGGESTED_TAB_COUNT); - when(mTabSuggestionMessageData.getReviewActionProvider()) - .thenReturn(() -> reviewed.set(true)); - - TestThreadUtils.runOnUiThreadBlocking( - () -> { - mSuggestionService.sendAvailabilityNotification(mTabSuggestionMessageData); - mRecyclerView.startShowing(false); - }); - - CriteriaHelper.pollUiThread( - () -> mRecyclerView.getVisibility() == View.VISIBLE && mFinishedShowing.get()); - - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - - assertFalse(reviewed.get()); - onView(withId(R.id.action_button)).perform(click()); - assertTrue(reviewed.get()); - } - - @Test - @SmallTest - public void testDismissTabSuggestionMessage() { - AtomicBoolean dismissed = new AtomicBoolean(); - when(mTabSuggestionMessageData.getSize()).thenReturn(SUGGESTED_TAB_COUNT); - when(mTabSuggestionMessageData.getDismissActionProvider()) - .thenReturn((type) -> dismissed.set(true)); - - TestThreadUtils.runOnUiThreadBlocking( - () -> { - mSuggestionService.sendAvailabilityNotification(mTabSuggestionMessageData); - mRecyclerView.startShowing(false); - }); - - CriteriaHelper.pollUiThread( - () -> mRecyclerView.getVisibility() == View.VISIBLE && mFinishedShowing.get()); - - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - - assertFalse(dismissed.get()); - onView(withId(R.id.close_button)).perform(click()); - assertTrue(dismissed.get()); } @Test
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIncognitoReauthPromoTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIncognitoReauthPromoTest.java index 3ecde77..ce7071c 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIncognitoReauthPromoTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIncognitoReauthPromoTest.java
@@ -31,7 +31,6 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CriteriaHelper; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.DoNotBatch; import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.Restriction; @@ -82,7 +81,6 @@ @Test @MediumTest - @DisabledTest(message = "https://crbug.com/1510419") public void testIncognitoReauthPromoShown() { final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); @@ -96,7 +94,6 @@ @Test @MediumTest - @DisabledTest(message = "https://crbug.com/1510419") public void testSnackBarShown_WhenClickingReviewActionProvider() { final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); @@ -127,7 +124,6 @@ @Test @MediumTest - @DisabledTest(message = "https://crbug.com/1510419") public void testIncognitoPromoNotShownInRegularMode_WhenTogglingFromIncognito() { final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); @@ -146,7 +142,6 @@ @Test @MediumTest - @DisabledTest(message = "https://crbug.com/1510419") public void testIncognitoReauthPromo_NoThanks_HidesTheCard() { final ChromeTabbedActivity cta = mActivityTestRule.getActivity();
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java deleted file mode 100644 index 47c8a699..0000000 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java +++ /dev/null
@@ -1,282 +0,0 @@ -// Copyright 2020 The Chromium Authors -// 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.tasks.tab_management; - -import static androidx.test.espresso.Espresso.onView; -import static androidx.test.espresso.action.ViewActions.click; -import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; -import static androidx.test.espresso.assertion.ViewAssertions.matches; -import static androidx.test.espresso.matcher.ViewMatchers.assertThat; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withParent; -import static androidx.test.espresso.matcher.ViewMatchers.withText; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.core.AllOf.allOf; - -import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE; -import static org.chromium.ui.test.util.ViewUtils.onViewWaiting; - -import androidx.test.filters.MediumTest; -import androidx.test.platform.app.InstrumentationRegistry; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.chromium.base.ThreadUtils; -import org.chromium.base.test.util.CallbackHelper; -import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.CriteriaHelper; -import org.chromium.base.test.util.DisabledTest; -import org.chromium.base.test.util.Features.DisableFeatures; -import org.chromium.base.test.util.Features.EnableFeatures; -import org.chromium.base.test.util.Restriction; -import org.chromium.chrome.browser.flags.ChromeFeatureList; -import org.chromium.chrome.browser.flags.ChromeSwitches; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabLaunchType; -import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver; -import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; -import org.chromium.chrome.test.R; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.ui.test.util.UiRestriction; - -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -/** End-to-end tests for TabSuggestion. */ -@RunWith(ChromeJUnit4ClassRunner.class) -@Restriction({UiRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) -@EnableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study"}) -// Disable TAB_TO_GTS_ANIMATION to make it less flaky. When animation is enabled, the suggestion -// cards will be removed temporarily, then append again. -// TODO(crbug.com/40238208): The message cards aren't shown the first time when entering GTS -// with Start surface enabled. -@DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION, ChromeFeatureList.START_SURFACE_ANDROID}) -@CommandLineFlags.Add({ - ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, - "force-fieldtrials=Study/Group" -}) -public class TabSuggestionMessageCardTest { - private static final String BASE_PARAMS = - "force-fieldtrial-params=" - + "Study.Group:baseline_tab_suggestions/true/enable_launch_polish/true" - + "/min_time_between_prefetches/0/thumbnail_aspect_ratio/1.0"; - private static final String ENABLE_CLOSE_SUGGESTION_PARAM = - "/baseline_archive_tab_service/true"; - private static final String ENABLE_GROUP_SUGGESTION_PARAM = - "/baseline_group_tab_suggestions/true"; - - @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); - - private final TabListEditorTestingRobot mTabListEditorTestingRobot = - new TabListEditorTestingRobot(); - private final String mClosingSuggestionMessage = - "3 of your tabs haven't been used lately. Close them?"; - private final String mGroupingSuggestionMessage = "3 tabs seem related. Group them?"; - - private void createBlankBackgroundTabs(int numTabs) { - for (int i = 0; i < numTabs; i++) { - mActivityTestRule - .getActivity() - .getTabCreator(false) - .createNewTab( - new LoadUrlParams("about:blank"), - TabLaunchType.FROM_LONGPRESS_BACKGROUND, - null); - } - } - - private void createBlankForegroundTabs(int numTabs) { - for (int i = 0; i < numTabs; i++) { - mActivityTestRule - .getActivity() - .getTabCreator(false) - .createNewTab( - new LoadUrlParams("about:blank"), TabLaunchType.FROM_CHROME_UI, null); - } - } - - private CallbackHelper mPaintedCallback = new CallbackHelper(); - - @Before - public void setUp() throws ExecutionException { - mActivityTestRule.startMainActivityOnBlankPage(); - ThreadUtils.runOnUiThreadBlocking( - () -> - new TabModelSelectorTabObserver( - mActivityTestRule.getActivity().getTabModelSelector()) { - @Override - public void didFirstVisuallyNonEmptyPaint(Tab tab) { - mPaintedCallback.notifyCalled(); - } - }); - - // TabObserver#didFirstVisuallyNonEmptyPaint will invalidate and fetch for new suggestion. - // Create one foreground tab and one background tab to ensure mPaintedCallback only call - // once to make the tests less flaky. - InstrumentationRegistry.getInstrumentation() - .runOnMainSync(() -> createBlankForegroundTabs(1)); - InstrumentationRegistry.getInstrumentation() - .runOnMainSync(() -> createBlankBackgroundTabs(1)); - assertThat( - "TabModelSelector should have total of 3 tabs", - mActivityTestRule.getActivity().getTabModelSelector().getTotalTabCount(), - is(3)); - - try { - mPaintedCallback.waitForCallback(0); - } catch (TimeoutException ex) { - Assert.fail("Never received tab painted event"); - } - } - - private void enteringTabSwitcherAndVerifySuggestionIsShown(String suggestionText) { - TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity()); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - onView(allOf(withParent(withId(R.id.tab_grid_message_item)), withText(suggestionText))) - .check(matches(isDisplayed())); - } - - private void reviewSuggestion() { - onView(allOf(withId(R.id.action_button), withParent(withId(R.id.tab_grid_message_item)))) - .perform(click()); - mTabListEditorTestingRobot.resultRobot.verifyTabListEditorIsVisible(); - } - - private void acceptSuggestion(int id) { - mTabListEditorTestingRobot.resultRobot.verifyTabListEditorIsVisible(); - mTabListEditorTestingRobot.actionRobot.clickToolbarActionView(id); - mTabListEditorTestingRobot.resultRobot.verifyTabListEditorIsHidden(); - } - - private void dismissSuggestion(boolean isReviewed) { - if (isReviewed) { - mTabListEditorTestingRobot.resultRobot.verifyTabListEditorIsVisible(); - mTabListEditorTestingRobot.actionRobot.clickToolbarNavigationButton(); - mTabListEditorTestingRobot.resultRobot.verifyTabListEditorIsHidden(); - } else { - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - onView(allOf(withId(R.id.close_button), withParent(withId(R.id.tab_grid_message_item)))) - .perform(click()); - } - } - - @Test - @MediumTest - @DisabledTest(message = "https://crbug.com/1441919") - @CommandLineFlags.Add({BASE_PARAMS + ENABLE_CLOSE_SUGGESTION_PARAM}) - public void closeTabSuggestionReviewedAndAccepted() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - enteringTabSwitcherAndVerifySuggestionIsShown(mClosingSuggestionMessage); - reviewSuggestion(); - acceptSuggestion(R.id.tab_list_editor_close_menu_item); - - onViewWaiting(allOf(withParent(withId(R.id.snackbar)), withText("3 tabs closed"))); - } - - @Test - @MediumTest - @DisabledTest(message = "https://crbug.com/1458843") - @CommandLineFlags.Add({BASE_PARAMS + ENABLE_CLOSE_SUGGESTION_PARAM}) - public void closeTabSuggestionReviewedAndDismissed() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - enteringTabSwitcherAndVerifySuggestionIsShown(mClosingSuggestionMessage); - reviewSuggestion(); - dismissSuggestion(true); - - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @CommandLineFlags.Add({ - BASE_PARAMS + ENABLE_GROUP_SUGGESTION_PARAM + ENABLE_CLOSE_SUGGESTION_PARAM - }) - @DisabledTest( - message = - "crbug.com/1085452 Enable this test and remove the one below if the" - + "bug is resolved") - public void groupAndCloseTabSuggestionDismissedAndShowNext() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - enteringTabSwitcherAndVerifySuggestionIsShown(mGroupingSuggestionMessage); - dismissSuggestion(false); - onView( - allOf( - withParent(withId(R.id.tab_grid_message_item)), - withText(mClosingSuggestionMessage))) - .check(matches(isDisplayed())); - dismissSuggestion(false); - - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @DisabledTest(message = "crbug.com/1085452") - @CommandLineFlags.Add({ - BASE_PARAMS + ENABLE_GROUP_SUGGESTION_PARAM + ENABLE_CLOSE_SUGGESTION_PARAM - }) - public void groupAndCloseTabSuggestionDismissedAndShowNext_temp() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity()); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - - dismissSuggestion(false); - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - dismissSuggestion(false); - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @CommandLineFlags.Add({ - BASE_PARAMS + ENABLE_GROUP_SUGGESTION_PARAM + ENABLE_CLOSE_SUGGESTION_PARAM - }) - @DisabledTest(message = "crbug.com/1085452 Enable this test if the bug is resolved") - public void groupAndCloseTabSuggestionReviewDismissedAndShowNext() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - enteringTabSwitcherAndVerifySuggestionIsShown(mGroupingSuggestionMessage); - reviewSuggestion(); - dismissSuggestion(true); - onView( - allOf( - withParent(withId(R.id.tab_grid_message_item)), - withText(mClosingSuggestionMessage))) - .check(matches(isDisplayed())); - reviewSuggestion(); - dismissSuggestion(true); - - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @CommandLineFlags.Add({ - BASE_PARAMS + ENABLE_GROUP_SUGGESTION_PARAM + ENABLE_CLOSE_SUGGESTION_PARAM - }) - @DisabledTest(message = "crbug.com/1085452 Enable this test if the bug is resolved") - public void groupAndCloseTabSuggestionAccepted() { - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - - enteringTabSwitcherAndVerifySuggestionIsShown(mGroupingSuggestionMessage); - reviewSuggestion(); - acceptSuggestion(R.id.tab_list_editor_group_menu_item); - - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } -}
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutTest.java index 18a7bfc0..1bfc503e6 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutTest.java
@@ -51,7 +51,6 @@ import android.content.Context; import android.content.res.ColorStateList; -import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.drawable.GradientDrawable; @@ -63,7 +62,6 @@ import android.widget.TextView; import androidx.annotation.Nullable; -import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.test.core.app.ApplicationProvider; @@ -142,7 +140,6 @@ import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.test.util.DisableAnimationsTestRule; import org.chromium.ui.test.util.UiRestriction; -import org.chromium.ui.test.util.ViewUtils; import org.chromium.ui.util.ColorUtils; import org.chromium.ui.widget.ViewLookupCachingFrameLayout; @@ -153,7 +150,6 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; -import java.util.Locale; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; @@ -966,236 +962,6 @@ } @Test - @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1458026 for RefactorDisabled") - public void testTabSuggestionMessageCard_dismiss() throws InterruptedException { - prepareTabs(3, 0, null); - - // TODO(meiliang): Avoid using static variable for tracking state, - // TabSuggestionMessageService.isSuggestionAvailableForTesting(). Instead, we can add a - // mock/fake MessageObserver to track the availability of the suggestions. - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - enterGTSWithThumbnailChecking(); - - // TODO(meiliang): Avoid using static variable for tracking state, - // TabSwitcherMessageManager::hasAppendedMessagesForTesting. Instead, we can query the - // number - // of items that the inner model of the TabSwitcher has. - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - ViewUtils.onViewWaiting(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - onView(allOf(withId(R.id.close_button), withParent(withId(R.id.tab_grid_message_item)))) - .perform(click()); - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1447282 for refactor disabled case.") - public void testTabSuggestionMessageCard_review() throws InterruptedException { - prepareTabs(3, 0, null); - - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - enterGTSWithThumbnailChecking(); - - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - ViewUtils.onViewWaiting(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - ViewUtils.onViewWaiting( - allOf( - withId(R.id.action_button), - withParent(withId(R.id.tab_grid_message_item)))) - .perform(click()); - - TabListEditorTestingRobot tabListEditorTestingRobot = new TabListEditorTestingRobot(); - tabListEditorTestingRobot.resultRobot.verifyTabListEditorIsVisible(); - - Espresso.pressBack(); - tabListEditorTestingRobot.resultRobot.verifyTabListEditorIsHidden(); - } - - @Test - @MediumTest - @Feature("TabSuggestion") - @DisabledTest(message = "https://crbug.com/1230107, crbug.com/1130621") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - public void testShowOnlyOneTabSuggestionMessageCard_withSoftCleanup() - throws InterruptedException { - verifyOnlyOneTabSuggestionMessageCardIsShowing(); - } - - @Test - @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1198484, crbug.com/1130621") - public void testShowOnlyOneTabSuggestionMessageCard_withHardCleanup() - throws InterruptedException { - verifyOnlyOneTabSuggestionMessageCardIsShowing(); - } - - @Test - @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1311825") - public void testTabSuggestionMessageCardDismissAfterTabClosing() throws InterruptedException { - prepareTabs(3, 0, mUrl); - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - enterGTSWithThumbnailChecking(); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - ViewUtils.onViewWaiting(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - - closeFirstTabInTabSwitcher(mActivityTestRule.getActivity()); - - CriteriaHelper.pollUiThread( - () -> !TabSuggestionMessageService.isSuggestionAvailableForTesting()); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(2))); - - onView(tabSwitcherViewMatcher()) - .check( - TabUiTestHelper.ChildrenCountAssertion.havingTabSuggestionMessageCardCount( - 0)); - onView(withId(R.id.tab_grid_message_item)).check(doesNotExist()); - } - - @Test - @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ - ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", - ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" - }) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1326533") - public void testTabSuggestionMessageCard_orientation() throws InterruptedException { - ChromeTabbedActivity cta = mActivityTestRule.getActivity(); - prepareTabs(3, 0, null); - View parentView = cta.getCompositorViewHolderForTesting(); - - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - enterGTSWithThumbnailChecking(); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - - // Force portrait mode since the device can be wrongly in landscape. See crbug/1063639. - ActivityTestUtils.rotateActivityToOrientation(cta, Configuration.ORIENTATION_PORTRAIT); - CriteriaHelper.pollUiThread(() -> parentView.getHeight() > parentView.getWidth()); - - // Ensure the message card is visible so we can get its view holder. - onView(tabSwitcherViewMatcher()) - .perform(RecyclerViewActions.scrollToPosition(3)) - .check(MessageCardWidthAssertion.checkMessageItemSpanSize(3, 2)); - - ActivityTestUtils.rotateActivityToOrientation(cta, Configuration.ORIENTATION_LANDSCAPE); - CriteriaHelper.pollUiThread(() -> parentView.getHeight() < parentView.getWidth()); - - // Ensure the message card is visible so we can get its view holder. - onView(tabSwitcherViewMatcher()) - .perform(RecyclerViewActions.scrollToPosition(3)) - .check(MessageCardWidthAssertion.checkMessageItemSpanSize(3, 3)); - ActivityTestUtils.clearActivityOrientation(mActivityTestRule.getActivity()); - } - - private static class MessageCardWidthAssertion implements ViewAssertion { - private int mIndex; - private int mSpanCount; - - public static MessageCardWidthAssertion checkMessageItemSpanSize(int index, int spanCount) { - return new MessageCardWidthAssertion(index, spanCount); - } - - public MessageCardWidthAssertion(int index, int spanCount) { - mIndex = index; - mSpanCount = spanCount; - } - - @Override - public void check(View view, NoMatchingViewException noMatchException) { - if (noMatchException != null) throw noMatchException; - float tabListPadding = TabUiThemeProvider.getTabGridCardMargin(view.getContext()); - float messageCardMargin = - TabUiThemeProvider.getMessageCardMarginDimension(view.getContext()); - - assertTrue(view instanceof RecyclerView); - RecyclerView recyclerView = (RecyclerView) view; - GridLayoutManager layoutManager = (GridLayoutManager) recyclerView.getLayoutManager(); - assertEquals(mSpanCount, layoutManager.getSpanCount()); - - RecyclerView.ViewHolder messageItemViewHolder = - recyclerView.findViewHolderForAdapterPosition(mIndex); - assertNotNull(messageItemViewHolder); - assertEquals(TabProperties.UiType.MESSAGE, messageItemViewHolder.getItemViewType()); - View messageItemView = messageItemViewHolder.itemView; - - // The message card item width should always be recyclerView width minus padding and - // margin. - assertEquals( - recyclerView.getWidth() - 2 * tabListPadding - 2 * messageCardMargin, - (float) messageItemView.getWidth(), - 1.0f); - } - } - - @Test @LargeTest @EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study"}) @DisabledTest(message = "https://crbug.com/1122657") @@ -1516,67 +1282,6 @@ @Test @MediumTest - @Feature("TabSuggestion") - @EnableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study"}) - @DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION}) - @CommandLineFlags.Add({ - BASE_PARAMS - + "/baseline_tab_suggestions/true" - + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" - }) - @DisabledTest(message = "https://crbug.com/1449985") - public void testTabGroupManualSelection_AfterReviewTabSuggestion() throws InterruptedException { - ChromeTabbedActivity cta = mActivityTestRule.getActivity(); - TabListEditorTestingRobot robot = new TabListEditorTestingRobot(); - createTabs(cta, false, 3); - - // Review closing tab suggestion. - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - // Entering GTS with thumbnail checking here is trying to reduce flakiness that is caused by - // the TabContextObserver. TabContextObserver listens to - // TabObserver#didFirstVisuallyNonEmptyPaint and invalidates the suggestion. Do the - // thumbnail checking here is to ensure the suggestion is valid when entering tab switcher. - enterGTSWithThumbnailChecking(); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - onView(withId(R.id.tab_grid_message_item)).check(matches(isDisplayed())); - onView(allOf(withId(R.id.action_button), withParent(withId(R.id.tab_grid_message_item)))) - .perform(click()); - - robot.resultRobot - .verifyTabListEditorIsVisible() - .verifyToolbarActionViewEnabled(R.id.tab_list_editor_close_menu_item); - - robot.actionRobot.clickToolbarActionView(R.id.tab_list_editor_close_menu_item); - robot.resultRobot.verifyTabListEditorIsHidden(); - CriteriaHelper.pollUiThread( - () -> { - Criteria.checkThat( - mActivityTestRule.getActivity().getCurrentTabModel().getCount(), - Matchers.is(0)); - }); - - // Show Manual Selection Mode. - createTabs(cta, false, 3); - - TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity()); - enterTabListEditor(cta); - robot.resultRobot.verifyTabListEditorIsVisible(); - - // Group first two tabs. - robot.actionRobot.clickItemAtAdapterPosition(0); - robot.actionRobot.clickItemAtAdapterPosition(1); - robot.actionRobot.clickToolbarMenuButton().clickToolbarMenuItem("Group tabs"); - - // Exit manual selection mode, back to tab switcher. - robot.resultRobot.verifyTabListEditorIsHidden(); - onViewWaiting(withText("2 tabs grouped")); - } - - @Test - @MediumTest @EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study"}) @DisabledTest(message = "crbug.com/1187320 This doesn't work with FeedV2 and crbug.com/1096295") public void testActivityCanBeGarbageCollectedAfterFinished() { @@ -3083,33 +2788,6 @@ outputStream.close(); } - private void verifyOnlyOneTabSuggestionMessageCardIsShowing() throws InterruptedException { - String suggestionMessageTemplate = - mActivityTestRule - .getActivity() - .getString(R.string.tab_suggestion_close_stale_message); - String suggestionMessage = - String.format(Locale.getDefault(), suggestionMessageTemplate, "3"); - prepareTabs(3, 0, mUrl); - CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); - CriteriaHelper.pollUiThread( - () -> Criteria.checkThat(getTabCountInCurrentTabModel(), Matchers.is(3))); - - enterGTSWithThumbnailChecking(); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - onView(allOf(withText(suggestionMessage), withParent(withId(R.id.tab_grid_message_item)))) - .check(matches(isDisplayed())); - leaveGTSAndVerifyThumbnailsAreReleased(); - - // With soft or hard clean up depends on the soft-cleanup-delay and cleanup-delay params. - enterGTSWithThumbnailChecking(); - CriteriaHelper.pollUiThread(TabSwitcherMessageManager::hasAppendedMessagesForTesting); - // This will fail with error "matched multiple views" when there is more than one suggestion - // message card. - onView(allOf(withText(suggestionMessage), withParent(withId(R.id.tab_grid_message_item)))) - .check(matches(isDisplayed())); - } - private Matcher<View> tabSwitcherViewMatcher() { return allOf( isDescendantOfA(
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediatorUnitTest.java index 573fec9..9b05c4d 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediatorUnitTest.java
@@ -25,7 +25,6 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tasks.tab_management.PriceMessageService.PriceMessageType; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; import org.chromium.chrome.tab_ui.R; import org.chromium.ui.modelutil.PropertyModel; @@ -48,8 +47,6 @@ @Mock private Profile mProfileMock; @Mock private Profile mIncognitoProfileMock; - @Mock private TabSuggestionMessageService.TabSuggestionMessageData mTabSuggestionMessageData; - @Mock private PriceMessageService.PriceMessageData mPriceMessageData; @Mock private Supplier<Profile> mProfileSupplier; @@ -74,15 +71,6 @@ private void enqueueMessageItem(@MessageService.MessageType int type, int tabSuggestionAction) { switch (type) { - case MessageService.MessageType.TAB_SUGGESTION: - when(mContext.getResources()).thenReturn(mResourcesMock); - when(mTabSuggestionMessageData.getSize()).thenReturn(SUGGESTED_TAB_COUNT); - when(mTabSuggestionMessageData.getActionType()).thenReturn(tabSuggestionAction); - when(mTabSuggestionMessageData.getDismissActionProvider()) - .thenReturn((messageType) -> {}); - when(mTabSuggestionMessageData.getReviewActionProvider()).thenReturn(() -> {}); - mMediator.messageReady(type, mTabSuggestionMessageData); - break; case MessageService.MessageType.PRICE_MESSAGE: when(mPriceMessageData.getPriceDrop()).thenReturn(null); when(mPriceMessageData.getDismissActionProvider()).thenReturn((messageType) -> {}); @@ -106,8 +94,7 @@ @Test public void getMessageItemsTest() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.FOR_TESTING, TESTING_ACTION); Assert.assertEquals(1, mMediator.getMessageItems().size()); Assert.assertTrue(mMediator.getReadyMessageItemsForTesting().isEmpty()); @@ -116,8 +103,7 @@ @Test public void getMessageItemsTest_TwoDifferentTypeMessage() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.PRICE_MESSAGE, -1); Assert.assertEquals(1, mMediator.getMessageItems().size()); Assert.assertTrue(mMediator.getReadyMessageItemsForTesting().isEmpty()); @@ -132,20 +118,19 @@ @Test public void getMessageItemsTest_OneMessageForEachMessageType() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.PRICE_MESSAGE, -1); enqueueMessageItem(MessageService.MessageType.FOR_TESTING, TESTING_ACTION); List<MessageCardProviderMediator.Message> messages = mMediator.getMessageItems(); Assert.assertEquals(2, messages.size()); - Assert.assertEquals(MessageService.MessageType.TAB_SUGGESTION, messages.get(0).type); + Assert.assertEquals(MessageService.MessageType.PRICE_MESSAGE, messages.get(0).type); Assert.assertEquals(MessageService.MessageType.FOR_TESTING, messages.get(1).type); Assert.assertEquals(2, mMediator.getShownMessageItemsForTesting().size()); Assert.assertTrue( mMediator .getShownMessageItemsForTesting() - .containsKey(MessageService.MessageType.TAB_SUGGESTION)); + .containsKey(MessageService.MessageType.PRICE_MESSAGE)); Assert.assertTrue( mMediator .getShownMessageItemsForTesting() @@ -246,19 +231,18 @@ @Test public void invalidate_allMessages() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.PRICE_MESSAGE, -1); - mMediator.messageInvalidate(MessageService.MessageType.TAB_SUGGESTION); + mMediator.messageInvalidate(MessageService.MessageType.PRICE_MESSAGE); Assert.assertFalse( mMediator .getReadyMessageItemsForTesting() - .containsKey(MessageService.MessageType.TAB_SUGGESTION)); + .containsKey(MessageService.MessageType.PRICE_MESSAGE)); Assert.assertFalse( mMediator .getShownMessageItemsForTesting() - .containsKey(MessageService.MessageType.TAB_SUGGESTION)); + .containsKey(MessageService.MessageType.PRICE_MESSAGE)); // Testing multiple Messages has the same type. enqueueMessageItem(MessageService.MessageType.FOR_TESTING, TESTING_ACTION); @@ -277,21 +261,20 @@ @Test public void invalidate_shownMessage() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.PRICE_MESSAGE, -1); mMediator.getMessageItems(); - mMediator.invalidateShownMessage(MessageService.MessageType.TAB_SUGGESTION); + mMediator.invalidateShownMessage(MessageService.MessageType.PRICE_MESSAGE); verify(mUiDismissActionProvider).dismiss(anyInt()); Assert.assertFalse( mMediator .getShownMessageItemsForTesting() - .containsKey(MessageService.MessageType.TAB_SUGGESTION)); + .containsKey(MessageService.MessageType.PRICE_MESSAGE)); Assert.assertFalse( mMediator .getReadyMessageItemsForTesting() - .containsKey(MessageService.MessageType.TAB_SUGGESTION)); + .containsKey(MessageService.MessageType.PRICE_MESSAGE)); // Testing multiple Messages has the same type. enqueueMessageItem(MessageService.MessageType.FOR_TESTING, TESTING_ACTION); @@ -310,48 +293,6 @@ } @Test - public void buildModel_ForClosingTabSuggestion() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); - - PropertyModel model = - mMediator - .getReadyMessageItemsForTesting() - .get(MessageService.MessageType.TAB_SUGGESTION) - .get(0) - .model; - Assert.assertEquals( - MessageService.MessageType.TAB_SUGGESTION, - model.get(MessageCardViewProperties.MESSAGE_TYPE)); - Assert.assertEquals( - mContext.getString(R.string.tab_cleanup_message_card_title), - model.get(MessageCardViewProperties.TITLE_TEXT)); - Assert.assertEquals( - mContext.getResources() - .getQuantityString( - R.plurals.tab_cleanup_message_card_subtitle, - SUGGESTED_TAB_COUNT, - SUGGESTED_TAB_COUNT), - model.get(MessageCardViewProperties.DESCRIPTION_TEXT)); - Assert.assertEquals( - mContext.getString(R.string.tab_cleanup_message_card_review_tabs_button), - model.get(MessageCardViewProperties.ACTION_TEXT)); - Assert.assertEquals( - mContext.getString(R.string.tab_cleanup_message_card_close_tabs_button), - model.get(MessageCardViewProperties.SECONDARY_ACTION_TEXT)); - Assert.assertEquals( - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_width), - model.get(MessageCardViewProperties.ICON_WIDTH_IN_PIXELS)); - Assert.assertEquals( - (int) - mContext.getResources() - .getDimension(R.dimen.tab_cleanup_promo_card_icon_height), - model.get(MessageCardViewProperties.ICON_HEIGHT_IN_PIXELS)); - } - - @Test public void buildModel_ForPriceMessage() { String titleText = "Price drop spotted"; doReturn(titleText).when(mContext).getString(R.string.price_drop_spotted_title); @@ -416,8 +357,7 @@ @Test public void getMessageItemsTest_UpdateIncognito() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.IPH, -1); PropertyModel messageModel = mMediator.getMessageItems().get(0).model; Assert.assertFalse(messageModel.get(MessageCardViewProperties.IS_INCOGNITO)); @@ -429,18 +369,14 @@ @Test public void getNextMessageItemForTypeTest_UpdateIncognito() { - enqueueMessageItem( - MessageService.MessageType.TAB_SUGGESTION, TabSuggestion.TabSuggestionAction.CLOSE); + enqueueMessageItem(MessageService.MessageType.IPH, -1); PropertyModel messageModel = - mMediator.getNextMessageItemForType(MessageService.MessageType.TAB_SUGGESTION) - .model; + mMediator.getNextMessageItemForType(MessageService.MessageType.IPH).model; Assert.assertFalse(messageModel.get(MessageCardViewProperties.IS_INCOGNITO)); doReturn(mIncognitoProfileMock).when(mProfileSupplier).get(); - messageModel = - mMediator.getNextMessageItemForType(MessageService.MessageType.TAB_SUGGESTION) - .model; + messageModel = mMediator.getNextMessageItemForType(MessageService.MessageType.IPH).model; Assert.assertTrue(messageModel.get(MessageCardViewProperties.IS_INCOGNITO)); }
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProviderUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProviderUnitTest.java deleted file mode 100644 index 9a5df36..0000000 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProviderUnitTest.java +++ /dev/null
@@ -1,136 +0,0 @@ -// Copyright 2023 The Chromium Authors -// 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.tasks.tab_management; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.notNull; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.drawable.Drawable; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.robolectric.RuntimeEnvironment; -import org.robolectric.annotation.Config; -import org.robolectric.shadows.ShadowLooper; - -import org.chromium.base.Callback; -import org.chromium.base.ContextUtils; -import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.base.test.util.JniMocker; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabContext; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; -import org.chromium.chrome.browser.ui.favicon.FaviconHelper; -import org.chromium.chrome.browser.ui.favicon.FaviconHelper.FaviconImageCallback; -import org.chromium.chrome.browser.ui.favicon.FaviconHelperJni; -import org.chromium.url.JUnitTestGURLs; - -import java.util.ArrayList; -import java.util.List; - -/** Unit tests for {@link MultiFaviconIconProvider}. */ -@RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE) -public class MultiFaviconIconProviderUnitTest { - Context mContext; - - @Rule public JniMocker jniMocker = new JniMocker(); - @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); - - @Mock FaviconHelper.Natives mFaviconHelperJniMock; - @Mock Profile mProfile; - @Mock Tab mTab; - @Mock Callback<Drawable> mCallback; - @Mock Drawable mDrawable; - - @Captor ArgumentCaptor<FaviconImageCallback> mLeftDrawableCaptor; - @Captor ArgumentCaptor<FaviconImageCallback> mCentreDrawableCaptor; - @Captor ArgumentCaptor<FaviconImageCallback> mRightDrawableCaptor; - - private MultiFaviconIconProvider mProvider; - private FaviconHelper mFaviconHelper; - private ShadowLooper mShadowLooper; - - @Before - public void setUp() { - mContext = RuntimeEnvironment.application; - ContextUtils.initApplicationContextForTests(mContext); - - when(mFaviconHelperJniMock.init()).thenReturn(1L); - jniMocker.mock(FaviconHelperJni.TEST_HOOKS, mFaviconHelperJniMock); - mFaviconHelper = new FaviconHelper(); - mShadowLooper = ShadowLooper.shadowMainLooper(); - - List<TabContext.TabInfo> suggestedTabInfo = new ArrayList<>(); - when(mTab.getUrl()).thenReturn(JUnitTestGURLs.URL_1); - when(mTab.getOriginalUrl()).thenReturn(JUnitTestGURLs.URL_1); - suggestedTabInfo.add(TabContext.TabInfo.createFromTab(mTab)); - when(mTab.getUrl()).thenReturn(JUnitTestGURLs.URL_2); - when(mTab.getOriginalUrl()).thenReturn(JUnitTestGURLs.URL_2); - suggestedTabInfo.add(TabContext.TabInfo.createFromTab(mTab)); - when(mTab.getUrl()).thenReturn(JUnitTestGURLs.URL_3); - when(mTab.getOriginalUrl()).thenReturn(JUnitTestGURLs.URL_3); - suggestedTabInfo.add(TabContext.TabInfo.createFromTab(mTab)); - TabSuggestion tabSuggestion = - new TabSuggestion(suggestedTabInfo, TabSuggestion.TabSuggestionAction.CLOSE, ""); - - mProvider = new MultiFaviconIconProvider(mContext, tabSuggestion, mProfile, mFaviconHelper); - } - - @Test - public void testFetchIconDrawable() { - Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); - - mProvider.fetchIconDrawable(mCallback); - mShadowLooper.idle(); - - verify(mFaviconHelperJniMock) - .getLocalFaviconImageForURL( - eq(1L), - any(), - eq(JUnitTestGURLs.URL_1), - anyInt(), - mLeftDrawableCaptor.capture()); - verify(mFaviconHelperJniMock) - .getLocalFaviconImageForURL( - eq(1L), - any(), - eq(JUnitTestGURLs.URL_2), - anyInt(), - mCentreDrawableCaptor.capture()); - verify(mFaviconHelperJniMock) - .getLocalFaviconImageForURL( - eq(1L), - any(), - eq(JUnitTestGURLs.URL_3), - anyInt(), - mRightDrawableCaptor.capture()); - - mLeftDrawableCaptor.getValue().onFaviconAvailable(bitmap, JUnitTestGURLs.URL_1); - mShadowLooper.idle(); - verify(mCallback, never()).onResult(any()); - mCentreDrawableCaptor.getValue().onFaviconAvailable(bitmap, JUnitTestGURLs.URL_2); - mShadowLooper.idle(); - verify(mCallback, never()).onResult(any()); - mRightDrawableCaptor.getValue().onFaviconAvailable(bitmap, JUnitTestGURLs.URL_3); - mShadowLooper.idle(); - verify(mCallback).onResult(notNull()); - } -}
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManagerUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManagerUnitTest.java index 6c737b4..9f23187 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManagerUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupVisualDataManagerUnitTest.java
@@ -5,6 +5,8 @@ package org.chromium.chrome.browser.tasks.tab_management; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; @@ -84,13 +86,7 @@ @Mock private TabModelSelector mTabModelSelector; @Mock private TabModelFilterProvider mTabModelFilterProvider; @Mock private SharedPreferences mSharedPreferencesTitle; - @Mock private SharedPreferences.Editor mEditorTitle; - @Mock private SharedPreferences.Editor mPutStringEditorTitle; - @Mock private SharedPreferences.Editor mRemoveEditorTitle; @Mock private SharedPreferences mSharedPreferencesColor; - @Mock private SharedPreferences.Editor mEditorColor; - @Mock private SharedPreferences.Editor mPutIntEditorColor; - @Mock private SharedPreferences.Editor mRemoveEditorColor; @Captor private ArgumentCaptor<TabModelObserver> mTabModelObserverCaptor; @Captor private ArgumentCaptor<TabGroupModelFilterObserver> mTabGroupModelFilterObserverCaptor; @@ -142,20 +138,10 @@ doReturn(mSharedPreferencesTitle) .when(mContext) .getSharedPreferences(TAB_GROUP_TITLES_FILE_NAME, Context.MODE_PRIVATE); - doReturn(mEditorTitle).when(mSharedPreferencesTitle).edit(); - doReturn(mRemoveEditorTitle).when(mEditorTitle).remove(any(String.class)); - doReturn(mPutStringEditorTitle) - .when(mEditorTitle) - .putString(any(String.class), any(String.class)); doReturn(mSharedPreferencesColor) .when(mContext) .getSharedPreferences(TAB_GROUP_COLORS_FILE_NAME, Context.MODE_PRIVATE); - doReturn(mEditorColor).when(mSharedPreferencesColor).edit(); - doReturn(mRemoveEditorColor).when(mEditorColor).remove(any(String.class)); - doReturn(mPutIntEditorColor) - .when(mEditorColor) - .putInt(any(String.class), any(Integer.class)); ContextUtils.initApplicationContextForTests(mContext); } @@ -184,10 +170,8 @@ .onFinishingMultipleTabClosure(List.of(mTab1), /* canRestore= */ true); // Verify that the title and color were not deleted. - verify(mEditorTitle, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle, never()).apply(); - verify(mEditorColor, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor, never()).apply(); + verify(mTabGroupModelFilter, never()).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter, never()).deleteTabGroupColor(TAB1_ID); } @Test @@ -207,10 +191,8 @@ .onFinishingMultipleTabClosure(List.of(mTab2), /* canRestore= */ true); // Verify that the title and color were not deleted. - verify(mEditorTitle, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle, never()).apply(); - verify(mEditorColor, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor, never()).apply(); + verify(mTabGroupModelFilter, never()).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter, never()).deleteTabGroupColor(TAB1_ID); } @Test @@ -231,10 +213,8 @@ .onFinishingMultipleTabClosure(List.of(mTab2), /* canRestore= */ true); // Verify that the title and color were deleted. - verify(mEditorTitle).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle).apply(); - verify(mEditorColor).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB1_ID); } @Test @@ -254,10 +234,8 @@ .onFinishingMultipleTabClosure(List.of(mTab2), /* canRestore= */ true); // Verify that the title and color were not deleted. - verify(mEditorTitle, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle, never()).apply(); - verify(mEditorColor, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor, never()).apply(); + verify(mTabGroupModelFilter, never()).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter, never()).deleteTabGroupColor(TAB1_ID); doReturn(LazyOneshotSupplier.fromValue(Set.of(TAB3_ID, TAB4_ID))) .when(mTabGroupModelFilter) @@ -267,10 +245,8 @@ .onFinishingMultipleTabClosure(List.of(mTab1), /* canRestore= */ true); // Verify that the title and color were deleted. - verify(mEditorTitle).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle).apply(); - verify(mEditorColor).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB1_ID); verify(mTabGroupModelFilter).deleteTabGroupCollapsed(TAB1_ID); } @@ -291,10 +267,8 @@ .onFinishingMultipleTabClosure(List.of(mTab1, mTab2), /* canRestore= */ true); // Verify that the title and color were deleted. - verify(mEditorTitle).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle).apply(); - verify(mEditorColor).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB1_ID); verify(mTabGroupModelFilter).deleteTabGroupCollapsed(TAB1_ID); } @@ -321,10 +295,8 @@ // The title of the source group will not be deleted until the merge is committed, after // SnackbarController#onDismissNoAction is called for the UndoGroupSnackbarController. - verify(mEditorTitle, never()).putString(eq(String.valueOf(TAB3_ID)), eq(CUSTOMIZED_TITLE1)); - verify(mRemoveEditorTitle, never()).apply(); - verify(mEditorColor, never()).putInt(eq(String.valueOf(TAB3_ID)), eq(COLOR1_ID)); - verify(mRemoveEditorColor, never()).apply(); + verify(mTabGroupModelFilter, never()).setTabGroupTitle(eq(TAB3_ID), anyString()); + verify(mTabGroupModelFilter, never()).setTabGroupColor(eq(TAB3_ID), anyInt()); } @Test @@ -392,10 +364,8 @@ mTabGroupModelFilterObserverCaptor.getValue().willMoveTabOutOfGroup(mTab1, TAB2_ID); // Verify that the title and color were deleted. - verify(mEditorTitle).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle).apply(); - verify(mEditorColor).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB1_ID); verify(mTabGroupModelFilter).deleteTabGroupCollapsed(TAB1_ID); } @@ -426,10 +396,8 @@ mTabGroupModelFilterObserverCaptor.getValue().willMoveTabOutOfGroup(mTab1, TAB1_ID); // Verify that the title and color were not deleted. - verify(mEditorTitle, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle, never()).apply(); - verify(mEditorColor, never()).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor, never()).apply(); + verify(mTabGroupModelFilter, never()).deleteTabGroupTitle(TAB1_ID); + verify(mTabGroupModelFilter, never()).deleteTabGroupColor(TAB1_ID); verify(mTabGroupModelFilter, never()).deleteTabGroupCollapsed(TAB1_ID); // Mock that TITLE1 and COLOR1_ID are associated with the group of TAB1_ID. @@ -446,10 +414,8 @@ mTabGroupModelFilterObserverCaptor.getValue().willMoveTabOutOfGroup(mTab2, TAB1_ID); // Verify that the title and color were deleted. - verify(mEditorTitle).remove(eq(String.valueOf(TAB2_ID))); - verify(mRemoveEditorTitle).apply(); - verify(mEditorColor).remove(eq(String.valueOf(TAB2_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB2_ID); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB2_ID); verify(mTabGroupModelFilter).deleteTabGroupCollapsed(TAB2_ID); } @@ -470,11 +436,9 @@ mTabGroupModelFilterObserverCaptor.getValue().didChangeGroupRootId(TAB1_ID, TAB2_ID); // The stored title should be assigned to the new root id. - verify(mEditorTitle).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorTitle).apply(); + verify(mTabGroupModelFilter).deleteTabGroupTitle(TAB1_ID); verify(mTabGroupModelFilter).setTabGroupTitle(eq(TAB2_ID), eq(CUSTOMIZED_TITLE1)); - verify(mEditorColor).remove(eq(String.valueOf(TAB1_ID))); - verify(mRemoveEditorColor).apply(); + verify(mTabGroupModelFilter).deleteTabGroupColor(TAB1_ID); verify(mTabGroupModelFilter).setTabGroupColor(eq(TAB2_ID), eq(COLOR1_ID)); verify(mTabGroupModelFilter).deleteTabGroupCollapsed(TAB1_ID); verify(mTabGroupModelFilter).setTabGroupCollapsed(TAB2_ID, true);
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java index 4463c70..75b0eac 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java
@@ -36,8 +36,8 @@ import static org.chromium.chrome.browser.flags.ChromeFeatureList.START_SURFACE_ANDROID; import static org.chromium.chrome.browser.tasks.tab_management.MessageCardViewProperties.MESSAGE_TYPE; import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.FOR_TESTING; +import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.IPH; import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.PRICE_MESSAGE; -import static org.chromium.chrome.browser.tasks.tab_management.MessageService.MessageType.TAB_SUGGESTION; import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.CARD_TYPE; import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.ModelType.MESSAGE; import static org.chromium.chrome.browser.tasks.tab_management.TabListModel.CardProperties.ModelType.OTHERS; @@ -2390,7 +2390,7 @@ PropertyModel model = mock(PropertyModel.class); int expectedMessageType = FOR_TESTING; - int wrongMessageType = TAB_SUGGESTION; + int wrongMessageType = PRICE_MESSAGE; when(model.get(CARD_TYPE)).thenReturn(MESSAGE); when(model.get(MESSAGE_TYPE)).thenReturn(expectedMessageType); mMediator.addSpecialItemToModel(0, TabProperties.UiType.MESSAGE, model); @@ -2409,7 +2409,7 @@ PropertyModel model = mock(PropertyModel.class); int expectedMessageType = PRICE_MESSAGE; - int wrongMessageType = TAB_SUGGESTION; + int wrongMessageType = IPH; when(model.get(CARD_TYPE)).thenReturn(MESSAGE); when(model.get(MESSAGE_TYPE)).thenReturn(expectedMessageType); mMediator.addSpecialItemToModel(0, TabProperties.UiType.LARGE_MESSAGE, model);
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageServiceUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageServiceUnitTest.java deleted file mode 100644 index 36f17ea..0000000 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageServiceUnitTest.java +++ /dev/null
@@ -1,259 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.ACCEPTED; -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.DISMISSED; -import static org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback.TabSuggestionResponse.NOT_CONSIDERED; - -import android.content.Context; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InOrder; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.robolectric.RuntimeEnvironment; - -import org.chromium.base.Callback; -import org.chromium.base.ContextUtils; -import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.base.test.util.JniMocker; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.profiles.ProfileJni; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModel; -import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; -import org.chromium.chrome.browser.tasks.tab_management.TabListEditorAction.ActionDelegate; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabContext; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestion; -import org.chromium.chrome.browser.tasks.tab_management.suggestions.TabSuggestionFeedback; -import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; - -/** Unit tests for {@link TabSuggestionMessageService}. */ -@SuppressWarnings({"ResultOfMethodCallIgnored", "ArraysAsListWithZeroOrOneArgument"}) -@RunWith(BaseRobolectricTestRunner.class) -public class TabSuggestionMessageServiceUnitTest { - private static final int TAB1_ID = 456; - private static final int TAB2_ID = 789; - private static final int TAB3_ID = 123; - private static final int POSITION1 = 0; - private static final int POSITION2 = 1; - private static final int POSITION3 = 2; - private static final int TAB1_ROOT_ID = TAB1_ID; - private static final int TAB2_ROOT_ID = TAB2_ID; - private static final int TAB3_ROOT_ID = TAB2_ID; - - private Tab mTab1; - private Tab mTab2; - private Tab mTab3; - - private TabSuggestionMessageService mMessageService; - - @Rule public JniMocker mocker = new JniMocker(); - @Mock public Profile.Natives mMockProfileNatives; - - Context mContext; - @Mock Profile mProfile; - @Mock TabModel mTabModel; - @Mock TabGroupModelFilter mTabGroupModelFilter; - @Mock TabListEditorCoordinator.TabListEditorController mTabListEditorController; - @Mock Callback<TabSuggestionFeedback> mTabSuggestionFeedbackCallback; - @Mock MessageService.MessageObserver mMessageObserver; - @Mock SelectionDelegate<Integer> mSelectionDelegate; - @Mock ActionDelegate mActionDelegate; - - @Captor ArgumentCaptor<TabSuggestionFeedback> mTabSuggestionFeedbackCallbackArgumentCaptor; - - @Before - public void setUp() { - mContext = RuntimeEnvironment.application; - ContextUtils.initApplicationContextForTests(mContext); - - // After setUp there are three tabs in TabModel. - MockitoAnnotations.initMocks(this); - mocker.mock(ProfileJni.TEST_HOOKS, mMockProfileNatives); - - // Set up Tabs. - mTab1 = TabUiUnitTestUtils.prepareTab(TAB1_ID, TAB1_ROOT_ID, ""); - mTab2 = TabUiUnitTestUtils.prepareTab(TAB2_ID, TAB2_ROOT_ID, ""); - mTab3 = TabUiUnitTestUtils.prepareTab(TAB3_ID, TAB3_ROOT_ID, ""); - - // Set up TabModel. - doReturn(3).when(mTabModel).getCount(); - doReturn(mTab1).when(mTabModel).getTabAt(POSITION1); - doReturn(mTab2).when(mTabModel).getTabAt(POSITION2); - doReturn(mTab3).when(mTabModel).getTabAt(POSITION3); - doReturn(mTab1).when(mTabModel).getTabById(TAB1_ID); - doReturn(mTab2).when(mTabModel).getTabById(TAB2_ID); - doReturn(mTab3).when(mTabModel).getTabById(TAB3_ID); - - // Set up TabModelFilter. - doReturn(mTabModel).when(mTabGroupModelFilter).getTabModel(); - - // Set up MessageService.MessageObserver - doNothing().when(mMessageObserver).messageReady(anyInt(), any()); - doNothing().when(mMessageObserver).messageInvalidate(anyInt()); - - mMessageService = - new TabSuggestionMessageService( - mContext, - mProfile, - () -> mTabGroupModelFilter, - () -> mTabListEditorController); - mMessageService.addObserver(mMessageObserver); - } - - // Tests for Close suggestions. - @Test - public void testReviewHandler_closeSuggestion() { - TabSuggestion tabSuggestion = - prepareTabSuggestion( - Arrays.asList(mTab1, mTab2), TabSuggestion.TabSuggestionAction.CLOSE); - - mMessageService.review(tabSuggestion, mTabSuggestionFeedbackCallback); - verify(mTabListEditorController).configureToolbarWithMenuItems(any(), any()); - verify(mTabListEditorController).show(eq(Arrays.asList(mTab1, mTab2)), eq(2), eq(null)); - - tabSuggestion = - prepareTabSuggestion( - Arrays.asList(mTab1, mTab3), TabSuggestion.TabSuggestionAction.CLOSE); - mMessageService.review(tabSuggestion, mTabSuggestionFeedbackCallback); - verify(mTabListEditorController).show(eq(Arrays.asList(mTab1, mTab3)), eq(2), eq(null)); - } - - @Test - public void testClosingSuggestionActionHandler() { - List<Tab> suggestedTabs = Arrays.asList(mTab1, mTab2); - List<Integer> suggestedTabIds = Arrays.asList(TAB1_ID, TAB2_ID); - TabSuggestion tabSuggestion = - prepareTabSuggestion(suggestedTabs, TabSuggestion.TabSuggestionAction.CLOSE); - - assertEquals(3, mTabModel.getCount()); - - LinkedHashSet<Integer> tabSet = new LinkedHashSet<>(); - tabSet.add(TAB1_ID); - tabSet.add(TAB2_ID); - doReturn(tabSet).when(mSelectionDelegate).getSelectedItems(); - TabListEditorAction action = - mMessageService.getAction(tabSuggestion, mTabSuggestionFeedbackCallback); - action.configure( - () -> mTabGroupModelFilter, - mSelectionDelegate, - mActionDelegate, - /* editorSupportsActionOnRelatedTabs= */ false); - action.perform(); - - verify(mTabGroupModelFilter).closeMultipleTabs(eq(suggestedTabs), eq(true), eq(false)); - verify(mTabSuggestionFeedbackCallback) - .onResult(mTabSuggestionFeedbackCallbackArgumentCaptor.capture()); - - TabSuggestionFeedback capturedFeedback = - mTabSuggestionFeedbackCallbackArgumentCaptor.getValue(); - assertEquals(tabSuggestion, capturedFeedback.tabSuggestion); - assertEquals(ACCEPTED, capturedFeedback.tabSuggestionResponse); - assertEquals(suggestedTabIds, capturedFeedback.selectedTabIds); - assertEquals(3, capturedFeedback.totalTabCount); - } - - @Test - public void testClosingSuggestionNavigationHandler() { - List<Tab> suggestedTabs = Arrays.asList(mTab1, mTab2); - TabSuggestion tabSuggestion = - prepareTabSuggestion(suggestedTabs, TabSuggestion.TabSuggestionAction.CLOSE); - - TabListEditorCoordinator.TabListEditorNavigationProvider navigationProvider = - mMessageService.getNavigationProvider( - tabSuggestion, mTabSuggestionFeedbackCallback); - navigationProvider.goBack(); - - verify(mTabSuggestionFeedbackCallback) - .onResult(mTabSuggestionFeedbackCallbackArgumentCaptor.capture()); - TabSuggestionFeedback capturedFeedback = - mTabSuggestionFeedbackCallbackArgumentCaptor.getValue(); - assertEquals(tabSuggestion, capturedFeedback.tabSuggestion); - assertEquals(DISMISSED, capturedFeedback.tabSuggestionResponse); - } - - @Test - public void testDismiss() { - List<Tab> suggestedTabs = Arrays.asList(mTab1, mTab2); - TabSuggestion tabSuggestion = - prepareTabSuggestion(suggestedTabs, TabSuggestion.TabSuggestionAction.CLOSE); - - mMessageService.dismiss(tabSuggestion, mTabSuggestionFeedbackCallback); - - verify(mTabSuggestionFeedbackCallback) - .onResult(mTabSuggestionFeedbackCallbackArgumentCaptor.capture()); - TabSuggestionFeedback capturedFeedback = - mTabSuggestionFeedbackCallbackArgumentCaptor.getValue(); - assertEquals(tabSuggestion, capturedFeedback.tabSuggestion); - assertEquals(NOT_CONSIDERED, capturedFeedback.tabSuggestionResponse); - } - - @Test - public void testInvalidatedSuggestion() { - mMessageService.onTabSuggestionInvalidated(); - verify(mMessageObserver).messageInvalidate(anyInt()); - } - - @Test - public void testNewSuggestions() { - InOrder inOrder = Mockito.inOrder(mMessageObserver); - - mMessageService.onNewSuggestion(Collections.EMPTY_LIST, mTabSuggestionFeedbackCallback); - inOrder.verify(mMessageObserver, never()).messageReady(anyInt(), any()); - - TabSuggestion tabSuggestion = - prepareTabSuggestion( - Arrays.asList(mTab1, mTab2), TabSuggestion.TabSuggestionAction.CLOSE); - mMessageService.onNewSuggestion( - Arrays.asList(tabSuggestion), mTabSuggestionFeedbackCallback); - inOrder.verify(mMessageObserver).messageReady(anyInt(), any()); - - TabSuggestion tabSuggestion2 = - prepareTabSuggestion( - Arrays.asList(mTab1, mTab2), TabSuggestion.TabSuggestionAction.CLOSE); - - mMessageService.onNewSuggestion( - Arrays.asList(tabSuggestion, tabSuggestion2), mTabSuggestionFeedbackCallback); - inOrder.verify(mMessageObserver, times(2)) - .messageReady( - eq(MessageService.MessageType.TAB_SUGGESTION), - any(TabSuggestionMessageService.TabSuggestionMessageData.class)); - } - - private TabSuggestion prepareTabSuggestion( - List<Tab> suggestedTab, @TabSuggestion.TabSuggestionAction int actionCode) { - List<TabContext.TabInfo> suggestedTabInfo = new ArrayList<>(); - for (int i = 0; i < suggestedTab.size(); i++) { - TabContext.TabInfo tabInfo = TabContext.TabInfo.createFromTab(suggestedTab.get(i)); - suggestedTabInfo.add(tabInfo); - } - - return new TabSuggestion(suggestedTabInfo, actionCode, ""); - } -}
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContextTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContextTest.java deleted file mode 100644 index 2779835..0000000 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContextTest.java +++ /dev/null
@@ -1,173 +0,0 @@ -// Copyright 2019 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.robolectric.annotation.Config; - -import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.base.test.util.Features; -import org.chromium.base.test.util.JniMocker; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.profiles.ProfileJni; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tabmodel.TabModelFilter; -import org.chromium.content_public.browser.WebContents; -import org.chromium.url.GURL; -import org.chromium.url.JUnitTestGURLs; - -import java.util.Arrays; -import java.util.List; - -/** Tests functionality related to TabContext */ -@SuppressWarnings({"ResultOfMethodCallIgnored", "ArraysAsListWithZeroOrOneArgument"}) -@RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE) -public class TabContextTest { - private static final int TAB_0_ID = 0; - private static final int RELATED_TAB_0_ID = 1; - private static final int RELATED_TAB_1_ID = 2; - private static final int NEW_TAB_1_ID = 3; - private static final int NEW_TAB_2_ID = 4; - - @Rule public TestRule mProcessor = new Features.JUnitProcessor(); - - @Rule public JniMocker mocker = new JniMocker(); - - @Mock public Profile.Natives mMockProfileNatives; - - @Mock private TabModelFilter mTabModelFilter; - - private Tab mTab0 = - mockTab( - TAB_0_ID, - 6, - "mock_title_tab_0", - JUnitTestGURLs.URL_1, - JUnitTestGURLs.URL_1, - 100); - private Tab mRelatedTab0 = - mockTab( - RELATED_TAB_0_ID, - 6, - "mock_title_related_tab_0", - JUnitTestGURLs.URL_2, - JUnitTestGURLs.URL_2, - 200); - private Tab mRelatedTab1 = - mockTab( - RELATED_TAB_1_ID, - 6, - "mock_title_related_tab_1", - JUnitTestGURLs.URL_3, - JUnitTestGURLs.URL_3, - 300); - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - mocker.mock(ProfileJni.TEST_HOOKS, mMockProfileNatives); - } - - private static Tab mockTab( - int id, int rootId, String title, GURL url, GURL originalUrl, long timestampMillis) { - Tab tab = mock(Tab.class); - doReturn(id).when(tab).getId(); - doReturn(rootId).when(tab).getRootId(); - doReturn(title).when(tab).getTitle(); - doReturn(url).when(tab).getUrl(); - doReturn(originalUrl).when(tab).getOriginalUrl(); - WebContents webContents = mock(WebContents.class); - doReturn(GURL.emptyGURL()).when(webContents).getVisibleUrl(); - doReturn(webContents).when(tab).getWebContents(); - doReturn(timestampMillis).when(tab).getTimestampMillis(); - return tab; - } - - /** Test finding related tabs */ - @Test - public void testRelatedTabsExist() { - doReturn(mTab0).when(mTabModelFilter).getTabAt(eq(TAB_0_ID)); - doReturn(1).when(mTabModelFilter).getCount(); - doReturn(Arrays.asList(mTab0, mRelatedTab0, mRelatedTab1)) - .when(mTabModelFilter) - .getRelatedTabList(eq(TAB_0_ID)); - TabContext tabContext = TabContext.createCurrentContext(mTabModelFilter); - Assert.assertEquals(tabContext.getUngroupedTabs().size(), 0); - List<TabContext.TabGroupInfo> tabGroupInfo = tabContext.getTabGroups(); - Assert.assertEquals(1, tabGroupInfo.size()); - List<TabContext.TabInfo> groupedTabs = tabGroupInfo.get(0).tabs; - Assert.assertEquals(3, groupedTabs.size()); - Assert.assertEquals(TAB_0_ID, groupedTabs.get(0).id); - Assert.assertEquals(RELATED_TAB_0_ID, groupedTabs.get(1).id); - Assert.assertEquals(RELATED_TAB_1_ID, groupedTabs.get(2).id); - } - - /** Test finding no related tabs */ - @Test - public void testFindNoRelatedTabs() { - doReturn(mTab0).when(mTabModelFilter).getTabAt(eq(TAB_0_ID)); - doReturn(1).when(mTabModelFilter).getCount(); - doReturn(Arrays.asList(mTab0)).when(mTabModelFilter).getRelatedTabList(eq(TAB_0_ID)); - TabContext tabContext = TabContext.createCurrentContext(mTabModelFilter); - Assert.assertEquals(tabContext.getUngroupedTabs().size(), 1); - List<TabContext.TabGroupInfo> tabGroups = tabContext.getTabGroups(); - Assert.assertEquals(0, tabGroups.size()); - List<TabContext.TabInfo> ungroupedTabs = tabContext.getUngroupedTabs(); - Assert.assertEquals(1, ungroupedTabs.size()); - Assert.assertEquals(TAB_0_ID, ungroupedTabs.get(0).id); - } - - @Test - public void testExcludeClosingTabs() { - Tab newTab1 = - mockTab(NEW_TAB_1_ID, NEW_TAB_1_ID, "", GURL.emptyGURL(), GURL.emptyGURL(), 0); - Tab newTab2 = - mockTab(NEW_TAB_2_ID, NEW_TAB_2_ID, "", GURL.emptyGURL(), GURL.emptyGURL(), 0); - doReturn(mTab0).when(mTabModelFilter).getTabAt(eq(TAB_0_ID)); - doReturn(newTab1).when(mTabModelFilter).getTabAt(eq(TAB_0_ID + 1)); - doReturn(newTab2).when(mTabModelFilter).getTabAt(eq(TAB_0_ID + 2)); - doReturn(3).when(mTabModelFilter).getCount(); - doReturn(Arrays.asList(mTab0, mRelatedTab0, mRelatedTab1)) - .when(mTabModelFilter) - .getRelatedTabList(eq(TAB_0_ID)); - doReturn(Arrays.asList(newTab1)).when(mTabModelFilter).getRelatedTabList(eq(NEW_TAB_1_ID)); - doReturn(Arrays.asList(newTab2)).when(mTabModelFilter).getRelatedTabList(eq(NEW_TAB_2_ID)); - - TabContext tabContext = TabContext.createCurrentContext(mTabModelFilter); - Assert.assertEquals(2, tabContext.getUngroupedTabs().size()); - Assert.assertEquals(1, tabContext.getTabGroups().size()); - Assert.assertEquals(3, tabContext.getTabGroups().get(0).tabs.size()); - - // close newTab1 - doReturn(true).when(newTab1).isClosing(); - tabContext = TabContext.createCurrentContext(mTabModelFilter); - Assert.assertEquals(1, tabContext.getUngroupedTabs().size()); - - // close mTab0 - doReturn(true).when(mTab0).isClosing(); - tabContext = TabContext.createCurrentContext(mTabModelFilter); - Assert.assertEquals(1, tabContext.getTabGroups().size()); - Assert.assertEquals(2, tabContext.getTabGroups().get(0).tabs.size()); - } - - @Test - public void testNoCrashOnNullFilter() { - TabContext tabContext = TabContext.createCurrentContext(null); - Assert.assertEquals(0, tabContext.getUngroupedTabs().size()); - Assert.assertEquals(0, tabContext.getTabGroups().size()); - } -}
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionTest.java deleted file mode 100644 index cc6887c..0000000 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionTest.java +++ /dev/null
@@ -1,65 +0,0 @@ -// Copyright 2020 The Chromium Authors -// 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.tasks.tab_management.suggestions; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.runner.RunWith; -import org.mockito.MockitoAnnotations; -import org.robolectric.annotation.Config; - -import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.base.test.util.Features; - -import java.util.Arrays; - -/** Tests functionality related to TabContext */ -@RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE) -public class TabSuggestionTest { - private static final @TabSuggestion.TabSuggestionAction int TAB_SUGGESTION_ACTION = - TabSuggestion.TabSuggestionAction.CLOSE; - private static final String PROVIDER_NAME = "providerName"; - private static final int TAB_GROUP_ID = 1; - private static final int ID = 1; - private static final String TITLE = "title"; - private static final String TAB_URL = "url"; - private static final String ORIGINAL_URL = "original_url"; - private static final long TIMESTAMP = 4352345L; - private static final String VISIBLE_URL = "visible_url"; - private static final TabContext.TabInfo TAB_INFO = - new TabContext.TabInfo(ID, TITLE, TAB_URL, ORIGINAL_URL, TIMESTAMP, VISIBLE_URL); - - @Rule public TestRule mProcessor = new Features.JUnitProcessor(); - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testNonEmptySuggestions() { - TabSuggestion tabSuggestion = - new TabSuggestion( - Arrays.asList(TAB_INFO), - TAB_SUGGESTION_ACTION, - PROVIDER_NAME, - TAB_GROUP_ID); - Assert.assertNotNull(tabSuggestion.getTabsInfo()); - Assert.assertEquals(tabSuggestion.getTabsInfo().size(), 1); - Assert.assertEquals(tabSuggestion.getTabsInfo().get(0), TAB_INFO); - } - - @Test - public void testNullSuggestions() { - TabSuggestion tabSuggestion = - new TabSuggestion(null, TAB_SUGGESTION_ACTION, PROVIDER_NAME, TAB_GROUP_ID); - Assert.assertNotNull(tabSuggestion.getTabsInfo()); - Assert.assertEquals(tabSuggestion.getTabsInfo().size(), 0); - } -}
diff --git a/chrome/android/features/tab_ui/tab_management_java_sources.gni b/chrome/android/features/tab_ui/tab_management_java_sources.gni index f7dfb5d2..9bd0dd46b 100644 --- a/chrome/android/features/tab_ui/tab_management_java_sources.gni +++ b/chrome/android/features/tab_ui/tab_management_java_sources.gni
@@ -60,7 +60,6 @@ "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewProperties.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewUtils.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MessageService.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProvider.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/MultiThumbnailCardProvider.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/PriceCardView.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/PriceMessageCardViewModel.java", @@ -134,8 +133,6 @@ "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabStripSnapshotter.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabStripViewBinder.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardViewModel.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageService.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherConstants.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherIphController.java", @@ -153,10 +150,6 @@ "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneMediator.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherResetHandler.java", "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiMetricsHelper.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsClientFetcher.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcher.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsFetcherResults.java", - "//chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java", ] tab_management_test_java_sources = [ @@ -179,7 +172,6 @@ "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListContainerViewBinderTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListEditorMenuTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListEditorTestingRobot.java", - "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutPerfTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayoutTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMultiWindowTest.java", @@ -222,7 +214,6 @@ "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/IphMessageServiceUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderMediatorUnitTest.java", - "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/MultiFaviconIconProviderUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/PriceMessageServiceUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediatorUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallbackUnitTest.java", @@ -244,11 +235,8 @@ "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListEditorUngroupActionUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabStripSnapshotterTest.java", - "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageServiceUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediatorUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabUiFeatureUtilitiesUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabUiMetricsHelperUnitTest.java", "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabUiUnitTestUtils.java", - "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabContextTest.java", - "//chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionTest.java", ]
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java index 01a91cd..aa72a6fc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java
@@ -272,7 +272,8 @@ /** * @return Whether the Panel is in full width size. */ - protected boolean isFullWidthSizePanel() { + @Override + public boolean isFullWidthSizePanel() { return doesMatchFullWidthCriteria(getFullscreenWidth()); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java index 470d746c..634a43a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java
@@ -9,7 +9,12 @@ public interface OverlayPanelStateProvider { /** An observer to be notified of changes to the overlay panel. */ interface Observer { - /** Called when the {@link OverlayPanel.PanelState} state of the Overlay Panel changes. */ + /** + * Called when the {@link OverlayPanel.PanelState} state of the Overlay Panel changes. + * + * @param state The {@link OverlayPanel.PanelState} of the overlay panel. + * @param color The background color of the overlay panel. + */ default void onOverlayPanelStateChanged( @OverlayPanel.PanelState int state, @ColorInt int color) {} } @@ -27,4 +32,10 @@ * @param observer The observer to remove. */ void removeObserver(Observer observer); + + /** + * @return True if the overlay panel covers the full width of the screen, false if the panel + * only partially extends across the screen. + */ + boolean isFullWidthSizePanel(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java index 736fbf28b..0d8f18a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java
@@ -44,12 +44,14 @@ * the screen. */ public interface Observer { - void onBottomAttachedColorChanged(@Nullable @ColorInt Integer color); + void onBottomAttachedColorChanged( + @Nullable @ColorInt Integer color, boolean forceShowDivider); } private boolean mBottomNavbarPresent; private final ObserverList<Observer> mObservers; private @Nullable @ColorInt Integer mBottomAttachedColor; + private boolean mShouldShowDivider; private final BottomSheetController mBottomSheetController; private boolean mBottomSheetVisible; @@ -68,6 +70,7 @@ private @Nullable @ColorInt Integer mOverlayPanelColor; private boolean mOverlayPanelVisible; private boolean mOverlayPanelPeeked; + private boolean mOverlayPanelCoversFullWidth; private Optional<OmniboxSuggestionsVisualState> mOmniboxSuggestionsVisualState; private boolean mOmniboxSuggestionsVisible; @@ -174,15 +177,21 @@ @Nullable @ColorInt Integer bottomAttachedColor = mBottomNavbarPresent ? calculateBottomAttachedColor() : null; - if (mBottomAttachedColor == null && bottomAttachedColor == null) { + boolean shouldShowDivider = mBottomNavbarPresent && shouldShowDivider(); + if (mBottomAttachedColor == null + && bottomAttachedColor == null + && shouldShowDivider == mShouldShowDivider) { return; } - if (mBottomAttachedColor != null && mBottomAttachedColor.equals(bottomAttachedColor)) { + if (mBottomAttachedColor != null + && mBottomAttachedColor.equals(bottomAttachedColor) + && shouldShowDivider == mShouldShowDivider) { return; } mBottomAttachedColor = bottomAttachedColor; + mShouldShowDivider = shouldShowDivider; for (Observer observer : mObservers) { - observer.onBottomAttachedColorChanged(mBottomAttachedColor); + observer.onBottomAttachedColorChanged(mBottomAttachedColor, mShouldShowDivider); } } @@ -209,6 +218,20 @@ return null; } + /** The divider should be visible for partial width bottom-attached UI. */ + private boolean shouldShowDivider() { + if (mBottomSheetVisible) { + return !mBottomSheetController.isFullWidth(); + } + if (mOverlayPanelVisible) { + return !mOverlayPanelStateProvider.isFullWidthSizePanel(); + } + if (mSnackbarVisible) { + return !mSnackbarStateProvider.isFullWidth(); + } + return false; + } + // Browser Controls (Tab group UI, Read Aloud) @Override
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 c194c295..6d1dc41 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
@@ -88,6 +88,7 @@ private @Nullable Tab mActiveTab; private TabObserver mTabObserver; @Nullable private @ColorInt Integer mBottomAttachedUiColor; + private boolean mForceShowDivider; private ValueAnimator mNavbarColorTransitionAnimation; @@ -186,7 +187,7 @@ new EmptyTabObserver() { @Override public void onBackgroundColorChanged(Tab tab, int color) { - updateNavigationBarColor(getBottomInset()); + updateNavigationBarColor(getBottomInset(), /* forceShowDivider= */ false); } }; mFullscreenObserver = @@ -216,7 +217,8 @@ mEdgeToEdgeController = controller; mEdgeToEdgeChangeObserver = (bottomInset) -> { - updateNavigationBarColor(bottomInset); + updateNavigationBarColor( + bottomInset, /* forceShowDivider= */ false); }; mEdgeToEdgeController.registerObserver(mEdgeToEdgeChangeObserver); }; @@ -255,9 +257,10 @@ } @Override - public void onBottomAttachedColorChanged(@Nullable @ColorInt Integer color) { + public void onBottomAttachedColorChanged( + @Nullable @ColorInt Integer color, boolean forceShowDivider) { mBottomAttachedUiColor = color; - updateNavigationBarColor(); + updateNavigationBarColor(null, /* forceShowDivider= */ forceShowDivider); } /** @@ -305,11 +308,11 @@ if (mActiveTab != null) mActiveTab.removeObserver(mTabObserver); mActiveTab = activeTab; if (mActiveTab != null) mActiveTab.addObserver(mTabObserver); - updateNavigationBarColor(getBottomInset()); + updateNavigationBarColor(getBottomInset(), /* forceShowDivider= */ false); } @SuppressLint("NewApi") - private void updateNavigationBarColor(@Nullable Integer bottomInset) { + private void updateNavigationBarColor(@Nullable Integer bottomInset, boolean forceShowDivider) { boolean toEdge = bottomInset != null && bottomInset != 0; boolean forceDarkNavigation = mTabModelSelector.isIncognitoSelected(); @@ -320,10 +323,13 @@ final @ColorInt int newNavigationBarColor = toEdge ? Color.TRANSPARENT : getNavigationBarColor(mForceDarkNavigationBarColor); - if (mNavigationBarColor == newNavigationBarColor) return; + if (mNavigationBarColor == newNavigationBarColor && mForceShowDivider == forceShowDivider) { + return; + } @ColorInt int currentNavigationBarColor = mNavigationBarColor; mNavigationBarColor = newNavigationBarColor; + mForceShowDivider = forceShowDivider; if (ChromeFeatureList.sNavBarColorMatchesTabBackground.isEnabled() && !toEdge) { animateNavigationBarColor(currentNavigationBarColor, newNavigationBarColor); @@ -333,7 +339,7 @@ if (toEdge) return; setNavigationBarDividerColor( - getNavigationBarDividerColor(mForceDarkNavigationBarColor)); + getNavigationBarDividerColor(mForceDarkNavigationBarColor, false)); UiUtils.setNavigationBarIconColor( mRootView, !mForceDarkNavigationBarColor && mLightNavigationBar); } @@ -357,7 +363,13 @@ currentNavigationBarColor, newNavigationBarColor, fraction); mWindow.setNavigationBarColor(blendedColor); - setNavigationBarDividerColor(blendedColor); + if (mForceShowDivider) { + setNavigationBarDividerColor( + getNavigationBarDividerColor( + mForceDarkNavigationBarColor, mForceShowDivider)); + } else { + setNavigationBarDividerColor(blendedColor); + } UiUtils.setNavigationBarIconColor( mRootView, ColorUtils.isHighLuminance( @@ -368,7 +380,7 @@ @SuppressLint("NewApi") private void updateNavigationBarColor() { - updateNavigationBarColor(null); + updateNavigationBarColor(null, /* forceShowDivider= */ false); } @SuppressLint("NewApi") @@ -394,7 +406,7 @@ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { mWindow.setNavigationBarDividerColor( applyCurrentScrimToColor( - getNavigationBarDividerColor(mForceDarkNavigationBarColor))); + getNavigationBarDividerColor(mForceDarkNavigationBarColor, false))); } // Adjust the color of navigation bar icons based on color state of the navigation bar. @@ -413,7 +425,6 @@ if (useActiveTabColor()) { return mActiveTab.getBackgroundColor(); } - return forceDarkNavigationBar ? mContext.getColor(R.color.toolbar_background_primary_dark) : SemanticColorUtils.getBottomSystemNavColor(mWindow.getContext()); @@ -421,11 +432,11 @@ @VisibleForTesting @ColorInt - int getNavigationBarDividerColor(boolean forceDarkNavigationBar) { - if (useBottomAttachedUiColor()) { + int getNavigationBarDividerColor(boolean forceDarkNavigationBar, boolean forceShowDivider) { + if (!forceShowDivider && useBottomAttachedUiColor()) { return mBottomAttachedUiColor; } - if (useActiveTabColor()) { + if (!forceShowDivider && useActiveTabColor()) { return mActiveTab.getBackgroundColor(); } return forceDarkNavigationBar
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/desktop_windowing/AppHeaderCoordinatorBrowserTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/desktop_windowing/AppHeaderCoordinatorBrowserTest.java index e9fcfe9..b904f44 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/desktop_windowing/AppHeaderCoordinatorBrowserTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/desktop_windowing/AppHeaderCoordinatorBrowserTest.java
@@ -330,8 +330,6 @@ public void testRecreateActivitiesInDesktopWindow() { // Assume that the current activity enters desktop windowing mode. ChromeTabbedActivity firstActivity = mActivityTestRule.getActivity(); - AppHeaderUtils.setAppInDesktopWindowForTesting(true); - firstActivity = ApplicationTestUtils.recreateActivity(firstActivity); triggerDesktopWindowingModeChange(firstActivity, true); // Create a new (desktop) window, that should gain focus and cause the first activity to @@ -352,7 +350,8 @@ // Trigger activity recreation in desktop windowing mode (an app theme change for eg. would // trigger this). - firstActivity = ApplicationTestUtils.recreateActivity(firstActivity); + mActivityTestRule.recreateActivity(); + firstActivity = mActivityTestRule.getActivity(); secondActivity = ApplicationTestUtils.recreateActivity(secondActivity); // Activity recreation will send an #onTopResumedActivityChanged(false) signal as the
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/shape_detection/ShapeDetectionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/shape_detection/ShapeDetectionTest.java index 85759c8..0cfe30eb6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/shape_detection/ShapeDetectionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/shape_detection/ShapeDetectionTest.java
@@ -21,10 +21,10 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; -import org.chromium.chrome.test.util.ChromeRestriction; import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.browser.TabTitleObserver; import org.chromium.net.test.EmbeddedTestServer; +import org.chromium.ui.test.util.GmsCoreVersionRestriction; import java.util.concurrent.TimeoutException; @@ -48,7 +48,7 @@ @CommandLineFlags.Add("enable-experimental-web-platform-features") @Feature({"ShapeDetection"}) @LargeTest - @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES) + @Restriction(GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_2020W02) @DisabledTest(message = "https://crbug.com/1139470") public void testBarcodeDetection() throws TimeoutException { EmbeddedTestServer testServer = @@ -67,7 +67,7 @@ @CommandLineFlags.Add("enable-experimental-web-platform-features") @Feature({"ShapeDetection"}) @LargeTest - @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES) + @Restriction(GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_2020W02) public void testTextDetection() throws TimeoutException { EmbeddedTestServer testServer = EmbeddedTestServer.createAndStartServer(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java index 5dc5ea3..3988514 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java
@@ -58,7 +58,6 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.R; import org.chromium.chrome.test.util.ActivityTestUtils; -import org.chromium.chrome.test.util.ChromeRestriction; import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule; import org.chromium.chrome.test.util.browser.signin.SigninTestRule; import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; @@ -71,6 +70,7 @@ import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.test.util.BlankUiTestActivity; import org.chromium.ui.test.util.DeviceRestriction; +import org.chromium.ui.test.util.GmsCoreVersionRestriction; import org.chromium.ui.test.util.ViewUtils; /** Integration tests for the re-FRE. */ @@ -83,7 +83,7 @@ // re-enabled once the new sign-in flow is implemented for automotive. @Restriction({ DeviceRestriction.RESTRICTION_TYPE_NON_AUTO, - ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES + GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_2020W02 }) public class UpgradePromoIntegrationTest { @Rule
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardDeviceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardDeviceTest.java index ccce45ec..edeb0405 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardDeviceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardDeviceTest.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.vr; import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import androidx.test.filters.MediumTest; @@ -20,7 +19,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.VrCardboardTestRuleUtils; @@ -64,7 +62,6 @@ /** Tests that reported WebXR capabilities match expectations. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testWebXrCapabilities() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardInputTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardInputTest.java index 73a6ba6..e5c6e7e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardInputTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardInputTest.java
@@ -6,7 +6,6 @@ import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; import static org.chromium.chrome.browser.vr.XrTestFramework.POLL_TIMEOUT_SHORT_MS; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import android.os.SystemClock; import android.view.MotionEvent; @@ -25,7 +24,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.VrCardboardTestRuleUtils; @@ -135,7 +133,6 @@ */ @Test @MediumTest - @Restriction(RESTRICTION_TYPE_VIEWER_NON_DAYDREAM) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testScreenTapsRegistered_WebXr() { @@ -165,7 +162,6 @@ */ @Test @MediumTest - @Restriction(RESTRICTION_TYPE_VIEWER_NON_DAYDREAM) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testTransientScreenTapsRegistered_WebXr() { @@ -213,7 +209,6 @@ */ @Test @MediumTest - @Restriction(RESTRICTION_TYPE_VIEWER_NON_DAYDREAM) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testWebXrInputSourceWithoutGamepad() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java index 38032ba..2d4f3a4 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java
@@ -7,7 +7,6 @@ import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; import static org.chromium.chrome.browser.vr.XrTestFramework.POLL_TIMEOUT_LONG_MS; import static org.chromium.chrome.browser.vr.XrTestFramework.POLL_TIMEOUT_SHORT_MS; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import androidx.test.filters.MediumTest; @@ -22,7 +21,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.VrCardboardTestRuleUtils; @@ -69,7 +67,6 @@ /** Tests that denying permission blocks the session from being created. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testPermissionDenyFailsSessionCreation() { mWebXrVrPermissionTestFramework.setPermissionPromptAction( @@ -93,7 +90,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testVrPermissionPersistance() { mWebXrVrPermissionTestFramework.loadFileAndAwaitInitialization( @@ -112,7 +108,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testPermissionNotNeededForInline() { mWebXrVrPermissionTestFramework.setPermissionPromptExpected(false); @@ -130,7 +125,6 @@ /** Tests that granted permissions persist after a page reload. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testPermissionPersistsAfterReload() { mWebXrVrPermissionTestFramework.loadFileAndAwaitInitialization(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardQrCodeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardQrCodeTest.java index 113cc108..249b64fc 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardQrCodeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardQrCodeTest.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.vr; import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import androidx.test.filters.MediumTest; @@ -21,7 +20,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.VrCardboardTestRuleUtils; @@ -67,7 +65,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testQrCodeScannerIsNotLaunchedWhenEnteringVrSession() throws Exception { @@ -93,7 +90,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testQrCodeScannerIsLaunchedWhenEnteringVrSession() throws Exception {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTabTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTabTest.java index 70af303..b7fa4de 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTabTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTabTest.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.vr; import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import androidx.test.filters.MediumTest; @@ -20,7 +19,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.util.VrCardboardTestRuleUtils; import org.chromium.chrome.test.ChromeActivityTestRule; @@ -61,7 +59,6 @@ /** Tests that non-focused tabs don't get WebXR rAFs called. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR"}) public void testPoseDataUnfocusedTab_WebXr() { testPoseDataUnfocusedTabImpl("webxr_test_pose_data_unfocused_tab", mWebXrVrTestFramework);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTransitionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTransitionTest.java index a8ad511..92bc32b6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTransitionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardTransitionTest.java
@@ -7,7 +7,6 @@ import static org.chromium.chrome.browser.vr.XrTestFramework.PAGE_LOAD_TIMEOUT_S; import static org.chromium.chrome.browser.vr.XrTestFramework.POLL_CHECK_INTERVAL_SHORT_MS; import static org.chromium.chrome.browser.vr.XrTestFramework.POLL_TIMEOUT_SHORT_MS; -import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM; import androidx.test.filters.MediumTest; @@ -24,7 +23,6 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisabledTest; -import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.PermissionUtils; @@ -71,7 +69,6 @@ /** Tests that WebXR is not exposed if the flag is not on. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"disable-features=WebXR"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testWebXrDisabledWithoutFlagSet() { @@ -84,7 +81,6 @@ /** Tests that the omnibox reappears after exiting an immersive session. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testControlsVisibleAfterExitingVr_WebXr() throws InterruptedException { @@ -116,7 +112,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testWindowRafStopsFiringWhilePresenting_WebXr() throws InterruptedException { @@ -133,7 +128,6 @@ /** Tests that window.rAF continues to fire when we have a non-immersive session. */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testWindowRafFiresDuringNonImmersiveSession() { @@ -149,7 +143,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) @DisabledTest(message = "https://crbug.com/1229236") @@ -170,7 +163,6 @@ */ @Test @MediumTest - @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @CommandLineFlags.Add({"enable-features=WebXR,Cardboard"}) // TODO(crbug.com/40791908): Re-enable this test on all activity types once // WAA/CCT versions no longer fail consistently.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/PwaRestoreBottomSheetIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/PwaRestoreBottomSheetIntegrationTest.java index f909204..0b38a2c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/PwaRestoreBottomSheetIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/PwaRestoreBottomSheetIntegrationTest.java
@@ -19,6 +19,7 @@ import android.view.ViewGroup; import android.widget.CheckBox; +import androidx.test.espresso.Espresso; import androidx.test.filters.SmallTest; import org.junit.After; @@ -239,6 +240,38 @@ @Test @SmallTest @Feature({"PwaRestore"}) + public void testBackButton() { + // This test opens the dialog, clicks the Review button to expand the bottom sheet dialog + // and then presses the Back in the OS twice to see what happens (first click should + // navigate back to the initial dialog state, second click closes the dialog). + + Assert.assertTrue(setTestAppsForRestoring(sDefaultApps, sDefaultLastUsed)); + + // Ensure the promo dialog shows. + setAppsAvailableAndPromoStage(true, DisplayStage.SHOW_PROMO); + + mActivityTestRule.startMainActivityFromLauncher(); + + // Verify we're in initial state for the dialog. + assertDialogShown(true); + onViewWaiting(withText("Restore your web apps")).check(matches(isDisplayed())); + + // Go to PWA list mode. + onView(withId(R.id.review_button)).perform(click()); + onViewWaiting(withText("Web apps used in the last month")).check(matches(isDisplayed())); + + // Pressing the Back button in Android once should bring us to the initial dialog state. + Espresso.pressBack(); + onViewWaiting(withText("Restore your web apps")).check(matches(isDisplayed())); + + // Pressing the Back button again should close the bottom sheet. + Espresso.pressBack(); + assertDialogShown(false); + } + + @Test + @SmallTest + @Feature({"PwaRestore"}) public void testClickForwarding() { Assert.assertTrue(setTestAppsForRestoring(sDefaultApps, sDefaultLastUsed));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webid/DigitalCredentialProviderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webid/DigitalCredentialProviderTest.java index e0ccc7c..54989e190 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webid/DigitalCredentialProviderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webid/DigitalCredentialProviderTest.java
@@ -33,7 +33,6 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.content_public.browser.ContentFeatureList; import org.chromium.content_public.browser.test.util.DOMUtils; -import org.chromium.content_public.browser.test.util.DigitalCredentialProviderUtils; import org.chromium.content_public.browser.test.util.DigitalCredentialProviderUtils.MockIdentityCredentialsDelegate; import org.chromium.content_public.browser.test.util.JavaScriptUtils; import org.chromium.net.test.EmbeddedTestServer; @@ -63,7 +62,7 @@ mActivityTestRule.getEmbeddedTestServerRule().setServerUsesHttps(true); mActivityTestRule.startMainActivityOnBlankPage(); mTestServer = mActivityTestRule.getTestServer(); - DigitalCredentialProviderUtils.setDelegateForTesting(mDelegate); + DigitalIdentityProvider.setDelegateForTesting(mDelegate); } @Test
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java index 8074c57..e71dbe7 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java
@@ -107,120 +107,168 @@ .thenReturn(BOTTOM_SHEET_YELLOW); when(mBottomSheetContentCyanBackground.getBackgroundColor()).thenReturn(BOTTOM_SHEET_CYAN); + when(mBottomSheetController.isFullWidth()).thenReturn(true); + when(mSnackbarManager.isFullWidth()).thenReturn(true); + + mContextualSearchManagerSupplier.set(mContextualSearchManager); + mOverlayPanelStateProviderSupplier.set(mOverlayPanelStateProvider); + when(mOverlayPanelStateProvider.isFullWidthSizePanel()).thenReturn(true); + mColorChangeObserver = new MockColorChangeObserver(); mBottomAttachedUiObserver.addObserver(mColorChangeObserver); } @Test public void testAdaptsColorToBrowserControls() { - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Show bottom controls. mBottomAttachedUiObserver.onBottomControlsBackgroundColorChanged(BROWSER_CONTROLS_COLOR); mBottomAttachedUiObserver.onBottomControlsHeightChanged(BOTTOM_CONTROLS_HEIGHT, 0); - mColorChangeObserver.assertColor(BROWSER_CONTROLS_COLOR); + mColorChangeObserver.assertState(BROWSER_CONTROLS_COLOR, false); // Scroll off bottom controls partway. mBottomAttachedUiObserver.onControlsOffsetChanged( 0, 0, BOTTOM_CONTROLS_HEIGHT / 2, 0, false); - mColorChangeObserver.assertColor(BROWSER_CONTROLS_COLOR); + mColorChangeObserver.assertState(BROWSER_CONTROLS_COLOR, false); // Scroll off bottom controls fully. mBottomAttachedUiObserver.onControlsOffsetChanged(0, 0, BOTTOM_CONTROLS_HEIGHT, 0, false); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Scroll bottom controls back. mBottomAttachedUiObserver.onControlsOffsetChanged(0, 0, 0, 0, false); - mColorChangeObserver.assertColor(BROWSER_CONTROLS_COLOR); + mColorChangeObserver.assertState(BROWSER_CONTROLS_COLOR, false); // Hide bottom controls. mBottomAttachedUiObserver.onBottomControlsHeightChanged(0, 0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); } @Test public void testAdaptsColorToSnackbars() { - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Set only the snackbar color. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ false, SNACKBAR_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Show the snackbar. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ true, SNACKBAR_COLOR); - mColorChangeObserver.assertColor(SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, false); // Hide the snackbar. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ false, /* color= */ null); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); + } + + @Test + public void testAdaptsColorToSnackbars_doesNotCoverFullWidth() { + when(mSnackbarManager.isFullWidth()).thenReturn(false); + mColorChangeObserver.assertState(null, false); + + // Set only the snackbar color. + mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ false, SNACKBAR_COLOR); + mColorChangeObserver.assertState(null, false); + + // Show the snackbar. + mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ true, SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, true); + + // Hide the snackbar. + mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ false, /* color= */ null); + mColorChangeObserver.assertState(null, false); } @Test public void testSetOverlayPanelObserver() { - setOverlayPanelObserver(); verify(mOverlayPanelStateProvider).addObserver(eq(mBottomAttachedUiObserver)); mOverlayPanelStateProviderSupplier.set(null); verify(mOverlayPanelStateProvider).removeObserver(eq(mBottomAttachedUiObserver)); } - private void setOverlayPanelObserver() { - mContextualSearchManagerSupplier.set(mContextualSearchManager); - mOverlayPanelStateProviderSupplier.set(mOverlayPanelStateProvider); - } - @Test public void testAdaptsColorToOverlayPanel() { mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(OVERLAY_PANEL_COLOR, false); mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.EXPANDED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.MAXIMIZED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(OVERLAY_PANEL_COLOR, false); mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); + } + + @Test + public void testAdaptsColorToOverlayPanel_doesNotCoverFullWidth() { + when(mOverlayPanelStateProvider.isFullWidthSizePanel()).thenReturn(false); + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(null, false); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(OVERLAY_PANEL_COLOR, true); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(null, false); } @Test public void testAdaptsColorToBottomSheet() { mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentNullBackground); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onSheetOpened(0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onSheetClosed(0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentCyanBackground); mBottomAttachedUiObserver.onSheetOpened(0); - mColorChangeObserver.assertColor(BOTTOM_SHEET_CYAN); + mColorChangeObserver.assertState(BOTTOM_SHEET_CYAN, false); mBottomAttachedUiObserver.onSheetClosed(0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentYellowBackground); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onSheetOpened(0); - mColorChangeObserver.assertColor(BOTTOM_SHEET_YELLOW); + mColorChangeObserver.assertState(BOTTOM_SHEET_YELLOW, false); mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentCyanBackground); - mColorChangeObserver.assertColor(BOTTOM_SHEET_CYAN); + mColorChangeObserver.assertState(BOTTOM_SHEET_CYAN, false); mBottomAttachedUiObserver.onSheetClosed(0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); + } + + @Test + public void testAdaptsColorToBottomSheet_doesNotCoverFullWidth() { + when(mBottomSheetController.isFullWidth()).thenReturn(false); + + mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentYellowBackground); + mColorChangeObserver.assertState(null, false); + + mBottomAttachedUiObserver.onSheetOpened(0); + mColorChangeObserver.assertState(BOTTOM_SHEET_YELLOW, true); + mBottomAttachedUiObserver.onSheetClosed(0); + mColorChangeObserver.assertState(null, false); } @Test @@ -230,99 +278,97 @@ // Navbar is present at the bottom. when(mInsetObserver.getLastRawWindowInsets()).thenReturn(BOTTOM_NAV_BAR_INSETS); mBottomAttachedUiObserver.onInsetChanged(0, 0, 0, 0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Show a snackbar to set a color. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ true, SNACKBAR_COLOR); - mColorChangeObserver.assertColor(SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, false); // Shift navbar to the side. when(mInsetObserver.getLastRawWindowInsets()).thenReturn(SIDE_NAV_BAR_INSETS); mBottomAttachedUiObserver.onInsetChanged(0, 0, 0, 0); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Return navbar to the bottom. when(mInsetObserver.getLastRawWindowInsets()).thenReturn(BOTTOM_NAV_BAR_INSETS); mBottomAttachedUiObserver.onInsetChanged(0, 0, 0, 0); - mColorChangeObserver.assertColor(SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, false); // Hide the snackbar. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ false, SNACKBAR_COLOR); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); } @Test public void testAdaptsColorToOmniboxSuggestions() { - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onOmniboxSuggestionsBackgroundColorChanged( OMNIBOX_SUGGESTIONS_COLOR); mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(true); - mColorChangeObserver.assertColor(OMNIBOX_SUGGESTIONS_COLOR); + mColorChangeObserver.assertState(OMNIBOX_SUGGESTIONS_COLOR, false); mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(false); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); mBottomAttachedUiObserver.onOmniboxSuggestionsBackgroundColorChanged( OMNIBOX_SUGGESTIONS_COLOR_2); mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(true); - mColorChangeObserver.assertColor(OMNIBOX_SUGGESTIONS_COLOR_2); + mColorChangeObserver.assertState(OMNIBOX_SUGGESTIONS_COLOR_2, false); mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(false); - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); } @Test public void testColorPrioritization() { - mColorChangeObserver.assertColor(null); + mColorChangeObserver.assertState(null, false); // Show the snackbar. mBottomAttachedUiObserver.onSnackbarStateChanged(/* isShowing= */ true, SNACKBAR_COLOR); - mColorChangeObserver.assertColor(SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, false); // Show bottom controls. mBottomAttachedUiObserver.onBottomControlsBackgroundColorChanged(BROWSER_CONTROLS_COLOR); mBottomAttachedUiObserver.onBottomControlsHeightChanged(BOTTOM_CONTROLS_HEIGHT, 0); - mColorChangeObserver.assertColor(BROWSER_CONTROLS_COLOR); + mColorChangeObserver.assertState(BROWSER_CONTROLS_COLOR, false); // Show overlay panel. mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(OVERLAY_PANEL_COLOR, false); // Show bottom sheet. mBottomAttachedUiObserver.onSheetContentChanged(mBottomSheetContentYellowBackground); mBottomAttachedUiObserver.onSheetOpened(0); - mColorChangeObserver.assertColor(BOTTOM_SHEET_YELLOW); + mColorChangeObserver.assertState(BOTTOM_SHEET_YELLOW, false); // Show omnibox suggestions. mBottomAttachedUiObserver.onOmniboxSuggestionsBackgroundColorChanged( OMNIBOX_SUGGESTIONS_COLOR); mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(true); - mColorChangeObserver.assertColor(OMNIBOX_SUGGESTIONS_COLOR); + mColorChangeObserver.assertState(OMNIBOX_SUGGESTIONS_COLOR, false); // Hide omnibox suggestions. mBottomAttachedUiObserver.onOmniboxSuggestionsVisibilityChanged(false); - mColorChangeObserver.assertColor(BOTTOM_SHEET_YELLOW); + mColorChangeObserver.assertState(BOTTOM_SHEET_YELLOW, false); // Hide bottom sheet. mBottomAttachedUiObserver.onSheetClosed(0); - mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertState(OVERLAY_PANEL_COLOR, false); // Hide overlay panel. mBottomAttachedUiObserver.onOverlayPanelStateChanged( OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); - mColorChangeObserver.assertColor(BROWSER_CONTROLS_COLOR); + mColorChangeObserver.assertState(BROWSER_CONTROLS_COLOR, false); // Hide bottom controls - should fall back to the snackbar color. mBottomAttachedUiObserver.onBottomControlsHeightChanged(0, 0); - mColorChangeObserver.assertColor(SNACKBAR_COLOR); + mColorChangeObserver.assertState(SNACKBAR_COLOR, false); } @Test public void testDestroy() { - setOverlayPanelObserver(); - mBottomAttachedUiObserver.destroy(); verify(mOmniboxSuggestionsVisualState) .setOmniboxSuggestionsVisualStateObserver(eq(Optional.empty())); @@ -335,14 +381,22 @@ private static class MockColorChangeObserver implements BottomAttachedUiObserver.Observer { private @Nullable @ColorInt Integer mColor; + private boolean mForceShowDivider; @Override - public void onBottomAttachedColorChanged(@Nullable Integer color) { + public void onBottomAttachedColorChanged( + @Nullable Integer color, boolean forceShowDivider) { mColor = color; + mForceShowDivider = forceShowDivider; } - public void assertColor(@Nullable @ColorInt Integer expectedColor) { + private void assertState( + @Nullable @ColorInt Integer expectedColor, boolean expectedForceShowDivider) { assertEquals("Incorrect bottom attached color.", expectedColor, mColor); + assertEquals( + "Incorrect value for forceShowDivider.", + expectedForceShowDivider, + mForceShowDivider); } } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorControllerUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorControllerUnitTest.java index a44f27a..94e4f54 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorControllerUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorControllerUnitTest.java
@@ -7,6 +7,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; @@ -23,7 +26,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; +import org.robolectric.annotation.Implementation; +import org.robolectric.annotation.Implements; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.test.BaseRobolectricTestRunner; @@ -35,9 +42,23 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController; +import org.chromium.components.browser_ui.styles.SemanticColorUtils; @RunWith(BaseRobolectricTestRunner.class) +@Config( + manifest = Config.NONE, + shadows = {TabbedNavigationBarColorControllerUnitTest.ShadowSemanticColorUtils.class}) public class TabbedNavigationBarColorControllerUnitTest { + @Implements(SemanticColorUtils.class) + static class ShadowSemanticColorUtils { + @Implementation + public static int getBottomSystemNavDividerColor(Context context) { + return NAV_DIVIDER_COLOR; + } + } + + private static final int NAV_DIVIDER_COLOR = Color.LTGRAY; + private TabbedNavigationBarColorController mNavColorController; @Mock private Window mWindow; @Mock private View mDecorView; @@ -103,7 +124,7 @@ assertEquals( "Incorrect nav bar divider color.", Color.BLUE, - mNavColorController.getNavigationBarDividerColor(false)); + mNavColorController.getNavigationBarDividerColor(false, false)); } @Test @@ -113,7 +134,7 @@ when(mLayoutManager.getActiveLayoutType()).thenReturn(LayoutType.BROWSING); mNavColorController.updateActiveTabForTesting(); - mNavColorController.onBottomAttachedColorChanged(Color.RED); + mNavColorController.onBottomAttachedColorChanged(Color.RED, false); assertTrue( "Should be using the bottom attached UI color.", mNavColorController.getUseBottomAttachedUiColorForTesting()); @@ -124,9 +145,9 @@ assertEquals( "The nav bar divider color should be the bottom attached UI color.", Color.RED, - mNavColorController.getNavigationBarDividerColor(false)); + mNavColorController.getNavigationBarDividerColor(false, false)); - mNavColorController.onBottomAttachedColorChanged(null); + mNavColorController.onBottomAttachedColorChanged(null, false); assertFalse( "Should no longer be using the bottom attached UI color.", mNavColorController.getUseBottomAttachedUiColorForTesting()); @@ -137,7 +158,32 @@ assertEquals( "The nav bar divider color should match the tab background.", Color.BLUE, - mNavColorController.getNavigationBarDividerColor(false)); + mNavColorController.getNavigationBarDividerColor(false, false)); + } + + @Test + public void testMatchBottomAttachedColor_forceShowDivider() { + ChromeFeatureList.sNavBarColorMatchesTabBackground.setForTesting(true); + when(mTab.getBackgroundColor()).thenReturn(Color.BLUE); + when(mLayoutManager.getActiveLayoutType()).thenReturn(LayoutType.BROWSING); + mNavColorController.updateActiveTabForTesting(); + Mockito.clearInvocations(mWindow); + + mNavColorController.onBottomAttachedColorChanged(Color.RED, true); + verify(mWindow, atLeastOnce()).setNavigationBarDividerColor(eq(NAV_DIVIDER_COLOR)); + } + + @Test + public void testGetNavigationBarDividerColor() { + ChromeFeatureList.sNavBarColorMatchesTabBackground.setForTesting(true); + assertEquals( + "The nav bar divider color should be the bottom attached UI color.", + NAV_DIVIDER_COLOR, + mNavColorController.getNavigationBarDividerColor(false, true)); + assertEquals( + "The nav bar divider color should match the tab background.", + mContext.getColor(R.color.bottom_system_nav_divider_color_light), + mNavColorController.getNavigationBarDividerColor(true, true)); } @Test
diff --git a/chrome/android/profiles/arm.newest.txt b/chrome/android/profiles/arm.newest.txt index 566dc4e49..1544ca1 100644 --- a/chrome/android/profiles/arm.newest.txt +++ b/chrome/android/profiles/arm.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-127.0.6484.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-arm-127.0.6485.0_rc-r2-merged.afdo.bz2
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index d5c7001..ae0f9aa 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-127.0.6484.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-127.0.6485.0_rc-r2-merged.afdo.bz2
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index b5645c7..ab356b7b 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -3547,6 +3547,10 @@ desc="Status text for a download item that is being checked for malware."> Checking for malware... </message> + <message name="IDS_DOWNLOAD_LOCAL_DECRYPTION_PROMPT_ALERT" + desc="Accessible alert announced when a local decryption prompt appears on a suspicious archive"> + <ph name="FILENAME">$1<ex>bla.exe</ex></ph> may be dangerous. Add a password if you want Chrome to verify it or you can download it directly. + </message> <!-- Web App Window Title string --> <message name="IDS_WEB_APP_WITH_APP_TITLE" desc="Title of the web app window with app_title."> @@ -9672,6 +9676,40 @@ </if> </if> + <!--IOS Desktop address promo strings--> + <if expr="_google_chrome"> + <if expr="not is_android"> + <if expr="use_titlecase"> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_TITLE" desc="In Title Case: The title for the iOS desktop address promo bubble letting users know their address is saved."> + Your Address Is Saved + </message> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_TITLE" desc="In Title Case: The title for the footer of the iOS desktop address promo bubble suggesting to users that they can use their addresses on their iOS devices."> + Use This Address On Your iPhone + </message> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_BUTTON_DECLINE" desc="In Title Case: The text inside the button allowing the user to decline."> + No Thanks + </message> + </if> + <if expr="not use_titlecase"> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_TITLE" desc="The title for the iOS desktop address promo bubble letting users know their address is saved."> + Your address is saved + </message> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_TITLE" desc="The title for the footer of the iOS desktop address promo bubble suggesting to users that they can use their addresses on their iOS devices."> + Use this address on your iPhone + </message> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_BUTTON_DECLINE" desc="The text inside the button allowing the user to decline."> + No thanks + </message> + </if> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_SUBTITLE" desc="The subtitle for the iOS desktop address promo bubble which lets the user know they can access their saved addresses."> + You can access it in your Saved Addresses. + </message> + <message name="IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_DESCRIPTION_QR" desc="The description for the iOS desktop address promo bubble footer which lets the user know how to use their saved addresses on their phone: follow the QR code, download Chrome for iOS and sign in to their account."> + Download Chrome with this QR code, and sign in to your Google Account. + </message> + </if> + </if> + <!--Accessible name/action strings--> <message name="IDS_ACCESSIBLE_INCOGNITO_WINDOW_TITLE_FORMAT" desc="The format for the accessible title of an Incognito window"> <ph name="WINDOW_TITLE">$1</ph> (Incognito) @@ -16847,6 +16885,9 @@ <message name="IDS_LENS_OVERLAY_TRANSLATE" desc="Command in the Lens Overlay context menu to translate text."> Translate </message> + <message name="IDS_LENS_OVERLAY_INFO_BUTTON_LABEL" desc="Text that is shown in the tooltip of the info button in the Lens Overlay."> + Learn more + </message> <message name="IDS_LENS_OVERLAY_INITIAL_TOAST_MESSAGE" desc="Text that is shown in the Lens Overlay education bubble when starting the feature. Informs the user to tap an object or drag over the screen to select a region to search with Google Lens."> Click or drag anywhere to search with Lens </message>
diff --git a/chrome/app/generated_resources_grd/IDS_DOWNLOAD_LOCAL_DECRYPTION_PROMPT_ALERT.png.sha1 b/chrome/app/generated_resources_grd/IDS_DOWNLOAD_LOCAL_DECRYPTION_PROMPT_ALERT.png.sha1 new file mode 100644 index 0000000..8699cb5 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_DOWNLOAD_LOCAL_DECRYPTION_PROMPT_ALERT.png.sha1
@@ -0,0 +1 @@ +85e1b0331e5842686841e5f4ca350a9d372599ba \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_BUTTON_DECLINE.png.sha1 b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_BUTTON_DECLINE.png.sha1 new file mode 100644 index 0000000..653c4cb --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_BUTTON_DECLINE.png.sha1
@@ -0,0 +1 @@ +d0c421db423bd563ef6fa2c59bcf163d4d61ef2a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_DESCRIPTION_QR.png.sha1 b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_DESCRIPTION_QR.png.sha1 new file mode 100644 index 0000000..653c4cb --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_DESCRIPTION_QR.png.sha1
@@ -0,0 +1 @@ +d0c421db423bd563ef6fa2c59bcf163d4d61ef2a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_TITLE.png.sha1 new file mode 100644 index 0000000..653c4cb --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_FOOTER_TITLE.png.sha1
@@ -0,0 +1 @@ +d0c421db423bd563ef6fa2c59bcf163d4d61ef2a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_SUBTITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_SUBTITLE.png.sha1 new file mode 100644 index 0000000..653c4cb --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_SUBTITLE.png.sha1
@@ -0,0 +1 @@ +d0c421db423bd563ef6fa2c59bcf163d4d61ef2a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_TITLE.png.sha1 new file mode 100644 index 0000000..653c4cb --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_IOS_DESKTOP_ADDRESS_PROMO_BUBBLE_TITLE.png.sha1
@@ -0,0 +1 @@ +d0c421db423bd563ef6fa2c59bcf163d4d61ef2a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_LENS_OVERLAY_INFO_BUTTON_LABEL.png.sha1 b/chrome/app/generated_resources_grd/IDS_LENS_OVERLAY_INFO_BUTTON_LABEL.png.sha1 new file mode 100644 index 0000000..50df613d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_LENS_OVERLAY_INFO_BUTTON_LABEL.png.sha1
@@ -0,0 +1 @@ +48941b5721708febeba8a52a5e0548d8a0022373 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 1d702e50..84abe3a 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -6237,6 +6237,22 @@ <message name="IDS_SETTINGS_APP_NOTIFICATIONS_DO_NOT_DISTURB_TOGGLE_TITLE" desc="The label for the notfications Do Not Disturb toggle that lets the user silence all app notifications."> Do Not Disturb </message> + <message name="IDS_SETTINGS_APP_PARENTAL_CONTROLS_ACCESS_DIALOG_TITLE" desc="The title of the Parental Controls PIN verification dialog which lets the user access the App Parental Controls subpage."> + Enter your PIN for parental controls + </message> + <message name="IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_SUBTITLE" desc="The subtitle of the dialog which lets the user set up a PIN for App Parental Controls."> + Use this PIN to change parental controls settings. + If you forget the PIN, powerwash this device and set up again. + </message> + <message name="IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_TITLE" desc="The title of the dialog which lets the user set up a PIN for App Parental Controls."> + Set up your PIN + </message> + <message name="IDS_SETTINGS_APP_PARENTAL_CONTROLS_CONFIRM_PIN_TITLE" desc="The title of the dialog which lets the user confirm a PIN for App Parental Controls."> + Confirm your PIN + </message> + <message name="IDS_SETTINGS_APP_PARENTAL_CONTROLS_FORGOT_PIN_LINK_NAME" desc="The name of the link which sends the user to an article with instructions to follow in the case of a forgotten App Parental Controls PIN."> + Forgot PIN? + </message> <message name="IDS_OS_SETTINGS_REVAMP_APP_NOTIFICATIONS_DO_NOT_DISTURB_TOGGLE_DESCRIPTION" desc="The text description of the Do Not Disturb toggle within help icon tooltip."> Notifications won't pop up on the screen. You can still see notifications by clicking the Do Not Disturb icon on the bottom right of your screen. </message>
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_ACCESS_DIALOG_TITLE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_ACCESS_DIALOG_TITLE.png.sha1 new file mode 100644 index 0000000..c9cfd33 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_ACCESS_DIALOG_TITLE.png.sha1
@@ -0,0 +1 @@ +31a9d03f11d17e2c871a010b30ef5a1f5bf35c55 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_SUBTITLE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_SUBTITLE.png.sha1 new file mode 100644 index 0000000..c93a894d --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_SUBTITLE.png.sha1
@@ -0,0 +1 @@ +f1f239f9fac508a40a7b46dc30b0dd5a97cf4665 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_TITLE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_TITLE.png.sha1 new file mode 100644 index 0000000..c93a894d --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_TITLE.png.sha1
@@ -0,0 +1 @@ +f1f239f9fac508a40a7b46dc30b0dd5a97cf4665 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CONFIRM_PIN_TITLE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CONFIRM_PIN_TITLE.png.sha1 new file mode 100644 index 0000000..8c7a8813 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_CONFIRM_PIN_TITLE.png.sha1
@@ -0,0 +1 @@ +4d7925610c58097dfa1dd1a218dab8c978de2224 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_FORGOT_PIN_LINK_NAME.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_FORGOT_PIN_LINK_NAME.png.sha1 new file mode 100644 index 0000000..75ab6db --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_APP_PARENTAL_CONTROLS_FORGOT_PIN_LINK_NAME.png.sha1
@@ -0,0 +1 @@ +3de72a8452159622adebf61c06d8e8e210c5e310 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index f71855d..8a26cd3 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3523,6 +3523,8 @@ "webauthn/android/chrome_webauthn_client_android.h", "webauthn/android/webauthn_request_delegate_android.cc", "webauthn/android/webauthn_request_delegate_android.h", + "webid/digital_identity_provider_android.cc", + "webid/digital_identity_provider_android.h", ] public_deps += [ "//chrome/android/features/dev_ui:buildflags",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 9a95561a..cceedcf 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -6131,7 +6131,6 @@ flag_descriptions::kAnimateSuggestionsListAppearanceDescription, kOsAndroid, FEATURE_VALUE_TYPE(omnibox::kAnimateSuggestionsListAppearance)}, - {"omnibox-actions-in-suggest", flag_descriptions::kOmniboxActionsInSuggestName, flag_descriptions::kOmniboxActionsInSuggestDescription, kOsAndroid, @@ -6145,6 +6144,11 @@ kOmniboxAnswerActionsVariants, "OmniboxBundledExperimentV1")}, + {"omnibox-asynchronous-view-inflation", + flag_descriptions::kOmniboxAsyncViewInflationName, + flag_descriptions::kOmniboxAsyncViewInflationDescription, kOsAndroid, + FEATURE_VALUE_TYPE(omnibox::kOmniboxAsyncViewInflation)}, + #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_WIN) {"omnibox-on-device-head-suggestions",
diff --git a/chrome/browser/apps/app_shim/app_shim_termination_manager.cc b/chrome/browser/apps/app_shim/app_shim_termination_manager.cc index 1b85adb3..896818f 100644 --- a/chrome/browser/apps/app_shim/app_shim_termination_manager.cc +++ b/chrome/browser/apps/app_shim/app_shim_termination_manager.cc
@@ -43,7 +43,7 @@ AppShimTerminationManagerImpl(const AppShimTerminationManagerImpl&) = delete; AppShimTerminationManagerImpl& operator=( const AppShimTerminationManagerImpl&) = delete; - ~AppShimTerminationManagerImpl() override { NOTREACHED(); } + ~AppShimTerminationManagerImpl() override { NOTREACHED_IN_MIGRATION(); } // AppShimTerminationManager: void MaybeTerminate() override {
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index c0b621b..6dfce6f 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -2041,10 +2041,6 @@ "login/screens/osauth/enter_old_password_screen.h", "login/screens/osauth/factor_setup_success_screen.cc", "login/screens/osauth/factor_setup_success_screen.h", - "login/screens/osauth/gaia_password_changed_screen.cc", - "login/screens/osauth/gaia_password_changed_screen.h", - "login/screens/osauth/gaia_password_changed_screen_legacy.cc", - "login/screens/osauth/gaia_password_changed_screen_legacy.h", "login/screens/osauth/local_data_loss_warning_screen.cc", "login/screens/osauth/local_data_loss_warning_screen.h", "login/screens/osauth/local_password_setup_screen.cc", @@ -2708,14 +2704,6 @@ "policy/invalidation/affiliated_invalidation_service_provider.h", "policy/invalidation/affiliated_invalidation_service_provider_impl.cc", "policy/invalidation/affiliated_invalidation_service_provider_impl.h", - "policy/local_user_files/file_location_utils.cc", - "policy/local_user_files/file_location_utils.h", - "policy/local_user_files/local_files_cleanup.cc", - "policy/local_user_files/local_files_cleanup.h", - "policy/local_user_files/observer.cc", - "policy/local_user_files/observer.h", - "policy/local_user_files/policy_utils.cc", - "policy/local_user_files/policy_utils.h", "policy/login/login_profile_policy_provider.cc", "policy/login/login_profile_policy_provider.h", "policy/login/wildcard_login_checker.cc", @@ -2921,6 +2909,18 @@ "policy/server_backed_state/server_backed_device_state.h", "policy/server_backed_state/server_backed_state_keys_broker.cc", "policy/server_backed_state/server_backed_state_keys_broker.h", + "policy/skyvault/drive_upload_observer.cc", + "policy/skyvault/drive_upload_observer.h", + "policy/skyvault/file_location_utils.cc", + "policy/skyvault/file_location_utils.h", + "policy/skyvault/local_files_cleanup.cc", + "policy/skyvault/local_files_cleanup.h", + "policy/skyvault/observer.cc", + "policy/skyvault/observer.h", + "policy/skyvault/odfs_skyvault_uploader.cc", + "policy/skyvault/odfs_skyvault_uploader.h", + "policy/skyvault/policy_utils.cc", + "policy/skyvault/policy_utils.h", "policy/status_collector/activity_storage.cc", "policy/status_collector/activity_storage.h", "policy/status_collector/app_info_generator.cc", @@ -5650,6 +5650,7 @@ "crostini/throttle/crostini_active_window_throttle_observer_unittest.cc", "crostini/throttle/crostini_throttle_unittest.cc", "customization/customization_document_unittest.cc", + "dbus/arc_tracing_service_provider_unittest.cc", "dbus/chrome_features_service_provider_unittest.cc", "dbus/dlp_files_policy_service_provider_unittest.cc", "dbus/encrypted_reporting_service_provider_unittest.cc",
diff --git a/chrome/browser/ash/app_list/app_service/app_service_app_item_browsertest.cc b/chrome/browser/ash/app_list/app_service/app_service_app_item_browsertest.cc index 6c3b185d..fb7f81e 100644 --- a/chrome/browser/ash/app_list/app_service/app_service_app_item_browsertest.cc +++ b/chrome/browser/ash/app_list/app_service/app_service_app_item_browsertest.cc
@@ -301,7 +301,7 @@ // Verify that a launch no longer occurs. web_app::WebAppLaunchProcess::SetOpenApplicationCallbackForTesting( base::BindLambdaForTesting( - [](apps::AppLaunchParams params) { NOTREACHED(); })); + [](apps::AppLaunchParams params) { NOTREACHED_IN_MIGRATION(); })); app_item.PerformActivate(ui::EF_NONE); }
diff --git a/chrome/browser/ash/arc/video/gpu_arc_video_service_host.cc b/chrome/browser/ash/arc/video/gpu_arc_video_service_host.cc index 4f77ed0..968b6773 100644 --- a/chrome/browser/ash/arc/video/gpu_arc_video_service_host.cc +++ b/chrome/browser/ash/arc/video/gpu_arc_video_service_host.cc
@@ -91,7 +91,9 @@ void Decode(mojom::BitstreamBufferPtr bitstream_buffer) override { NOTREACHED_IN_MIGRATION(); } - void AssignPictureBuffers(uint32_t count) override { NOTREACHED(); } + void AssignPictureBuffers(uint32_t count) override { + NOTREACHED_IN_MIGRATION(); + } void ImportBufferForPicture(int32_t picture_buffer_id, mojom::HalPixelFormat format, mojo::ScopedHandle handle, @@ -99,9 +101,11 @@ mojom::BufferModifierPtr modifier) override { NOTREACHED_IN_MIGRATION(); } - void ReusePictureBuffer(int32_t picture_buffer_id) override { NOTREACHED(); } - void Flush(FlushCallback callback) override { NOTREACHED(); } - void Reset(ResetCallback callback) override { NOTREACHED(); } + void ReusePictureBuffer(int32_t picture_buffer_id) override { + NOTREACHED_IN_MIGRATION(); + } + void Flush(FlushCallback callback) override { NOTREACHED_IN_MIGRATION(); } + void Reset(ResetCallback callback) override { NOTREACHED_IN_MIGRATION(); } private: mojo::RemoteSet<mojom::VideoDecodeClient> clients_;
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index ca851d82..bfe7704 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -139,6 +139,8 @@ "environment_provider.h", "extension_info_private_ash.cc", "extension_info_private_ash.h", + "extension_printer_service_ash.cc", + "extension_printer_service_ash.h", "eye_dropper_ash.cc", "eye_dropper_ash.h", "feedback_ash.cc",
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.cc b/chrome/browser/ash/crosapi/crosapi_ash.cc index d8e29025..bcee36b 100644 --- a/chrome/browser/ash/crosapi/crosapi_ash.cc +++ b/chrome/browser/ash/crosapi/crosapi_ash.cc
@@ -56,6 +56,7 @@ #include "chrome/browser/ash/crosapi/embedded_accessibility_helper_client_ash.h" #include "chrome/browser/ash/crosapi/emoji_picker_ash.h" #include "chrome/browser/ash/crosapi/extension_info_private_ash.h" +#include "chrome/browser/ash/crosapi/extension_printer_service_ash.h" #include "chrome/browser/ash/crosapi/eye_dropper_ash.h" #include "chrome/browser/ash/crosapi/feedback_ash.h" #include "chrome/browser/ash/crosapi/field_trial_service_ash.h" @@ -155,6 +156,7 @@ #include "chromeos/crosapi/mojom/device_local_account_extension_service.mojom.h" #include "chromeos/crosapi/mojom/drive_integration_service.mojom.h" #include "chromeos/crosapi/mojom/embedded_accessibility_helper.mojom.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" #include "chromeos/crosapi/mojom/eye_dropper.mojom.h" #include "chromeos/crosapi/mojom/feedback.mojom.h" #include "chromeos/crosapi/mojom/file_change_service_bridge.mojom.h" @@ -264,6 +266,8 @@ std::make_unique<EmbeddedAccessibilityHelperClientAsh>()), emoji_picker_ash_(std::make_unique<EmojiPickerAsh>()), extension_info_private_ash_(std::make_unique<ExtensionInfoPrivateAsh>()), + extension_printer_service_ash_( + std::make_unique<ExtensionPrinterServiceAsh>()), eye_dropper_ash_(std::make_unique<EyeDropperAsh>()), feedback_ash_(std::make_unique<FeedbackAsh>()), field_trial_service_ash_(std::make_unique<FieldTrialServiceAsh>()), @@ -623,6 +627,11 @@ extension_info_private_ash_->BindReceiver(std::move(receiver)); } +void CrosapiAsh::BindExtensionPrinterService( + mojo::PendingReceiver<mojom::ExtensionPrinterService> receiver) { + extension_printer_service_ash_->BindReceiver(std::move(receiver)); +} + void CrosapiAsh::BindExtensionPublisher( mojo::PendingReceiver<mojom::AppPublisher> receiver) { Profile* profile = ProfileManager::GetPrimaryUserProfile();
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.h b/chrome/browser/ash/crosapi/crosapi_ash.h index fb7a5fa..1e57892 100644 --- a/chrome/browser/ash/crosapi/crosapi_ash.h +++ b/chrome/browser/ash/crosapi/crosapi_ash.h
@@ -11,6 +11,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/crosapi/crosapi_id.h" +#include "chrome/browser/ash/crosapi/extension_printer_service_ash.h" #include "chrome/browser/ash/smart_reader/smart_reader_manager_ash.h" #include "chromeos/crosapi/mojom/cros_display_config.mojom.h" #include "chromeos/crosapi/mojom/crosapi.mojom.h" @@ -81,6 +82,7 @@ class EmbeddedAccessibilityHelperClientAsh; class EmojiPickerAsh; class ExtensionInfoPrivateAsh; +class ExtensionPrinterServiceAsh; class EyeDropperAsh; class FeedbackAsh; class FieldTrialServiceAsh; @@ -256,6 +258,8 @@ mojo::PendingReceiver<mojom::EmojiPicker> receiver) override; void BindExtensionInfoPrivate( mojo::PendingReceiver<mojom::ExtensionInfoPrivate> receiver) override; + void BindExtensionPrinterService( + mojo::PendingReceiver<mojom::ExtensionPrinterService> receiver) override; void BindExtensionPublisher( mojo::PendingReceiver<mojom::AppPublisher> receiver) override; void BindEyeDropper( @@ -522,6 +526,10 @@ return extension_info_private_ash_.get(); } + ExtensionPrinterServiceAsh* extension_printer_service_ash() { + return extension_printer_service_ash_.get(); + } + FileSystemAccessCloudIdentifierProviderAsh* file_system_access_cloud_identifier_provider_ash() { return file_system_access_cloud_identifier_provider_ash_.get(); @@ -704,6 +712,7 @@ embedded_accessibility_helper_client_ash_; std::unique_ptr<EmojiPickerAsh> emoji_picker_ash_; std::unique_ptr<ExtensionInfoPrivateAsh> extension_info_private_ash_; + std::unique_ptr<ExtensionPrinterServiceAsh> extension_printer_service_ash_; std::unique_ptr<EyeDropperAsh> eye_dropper_ash_; std::unique_ptr<FeedbackAsh> feedback_ash_; std::unique_ptr<FieldTrialServiceAsh> field_trial_service_ash_;
diff --git a/chrome/browser/ash/crosapi/crosapi_util.cc b/chrome/browser/ash/crosapi/crosapi_util.cc index 0e95754..c98477f 100644 --- a/chrome/browser/ash/crosapi/crosapi_util.cc +++ b/chrome/browser/ash/crosapi/crosapi_util.cc
@@ -97,6 +97,7 @@ #include "chromeos/crosapi/mojom/embedded_accessibility_helper.mojom.h" #include "chromeos/crosapi/mojom/emoji_picker.mojom.h" #include "chromeos/crosapi/mojom/extension_info_private.mojom.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" #include "chromeos/crosapi/mojom/eye_dropper.mojom.h" #include "chromeos/crosapi/mojom/feedback.mojom.h" #include "chromeos/crosapi/mojom/file_change_service_bridge.mojom.h" @@ -424,7 +425,7 @@ return {T::Uuid_, T::Version_}; } -static_assert(crosapi::mojom::Crosapi::Version_ == 138, +static_assert(crosapi::mojom::Crosapi::Version_ == 139, "If you add a new crosapi, please add it to " "kInterfaceVersionEntries below."); @@ -477,6 +478,7 @@ MakeInterfaceVersionEntry<crosapi::mojom::EditorPanelManager>(), MakeInterfaceVersionEntry<crosapi::mojom::EmojiPicker>(), MakeInterfaceVersionEntry<crosapi::mojom::ExtensionInfoPrivate>(), + MakeInterfaceVersionEntry<crosapi::mojom::ExtensionPrinterService>(), MakeInterfaceVersionEntry<crosapi::mojom::EyeDropper>(), MakeInterfaceVersionEntry<crosapi::mojom::Feedback>(), MakeInterfaceVersionEntry<crosapi::mojom::FieldTrialService>(),
diff --git a/chrome/browser/ash/crosapi/extension_printer_service_ash.cc b/chrome/browser/ash/crosapi/extension_printer_service_ash.cc new file mode 100644 index 0000000..a0acba92 --- /dev/null +++ b/chrome/browser/ash/crosapi/extension_printer_service_ash.cc
@@ -0,0 +1,98 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/crosapi/extension_printer_service_ash.h" + +#include <memory> +#include <utility> + +#include "base/logging.h" +#include "base/unguessable_token.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" + +namespace crosapi { + +ExtensionPrinterServiceAsh::ExtensionPrinterServiceAsh() = default; + +ExtensionPrinterServiceAsh::~ExtensionPrinterServiceAsh() = default; + +void ExtensionPrinterServiceAsh::BindReceiver( + mojo::PendingReceiver<mojom::ExtensionPrinterService> pending_receiver) { + receivers_.Add(this, std::move(pending_receiver)); +} + +bool ExtensionPrinterServiceAsh::HasProvider() const { + return service_provider_.is_bound() && service_provider_.is_connected(); +} + +void ExtensionPrinterServiceAsh::ClearPendingRequests() { + // Clear pending get printers requests if any. + pending_printers_added_callbacks_.clear(); + pending_get_printers_done_callbacks_.clear(); + + weak_ptr_factory_.InvalidateWeakPtrs(); +} + +void ExtensionPrinterServiceAsh::RegisterServiceProvider( + mojo::PendingRemote<mojom::ExtensionPrinterServiceProvider> provider) { + VLOG(1) << "ExtensionPrinterServiceAsh::RegisterServiceProvider()"; + service_provider_ = + mojo::Remote<mojom::ExtensionPrinterServiceProvider>(std::move(provider)); + service_provider_.set_disconnect_handler(base::BindOnce( + &ExtensionPrinterServiceAsh::ExtensionPrinterServiceProviderDisconnected, + weak_ptr_factory_.GetWeakPtr())); +} + +void ExtensionPrinterServiceAsh::PrintersAdded( + const base::UnguessableToken& request_id, + base::Value::List printers, + bool is_done) { + VLOG(1) << "ExtensionPrinterServiceAsh::PrintersAdded():" << " request_id=" + << request_id.ToString() << " printers.size()=" << printers.size() + << " done=" << is_done; + + if (!printers.empty() && + pending_printers_added_callbacks_.contains(request_id)) { + pending_printers_added_callbacks_[request_id].Run(std::move(printers)); + } + + if (!is_done) { + return; + } + // Calls the done callback and clear the caches for the request_id. + if (pending_get_printers_done_callbacks_.contains(request_id)) { + std::move(pending_get_printers_done_callbacks_[request_id]).Run(); + pending_get_printers_done_callbacks_.erase(request_id); + } + pending_printers_added_callbacks_.erase(request_id); +} + +void ExtensionPrinterServiceAsh::ExtensionPrinterServiceProviderDisconnected() { + VLOG(1) << "ExtensionPrinterServiceProviderDisconnected()"; + + ClearPendingRequests(); +} + +void ExtensionPrinterServiceAsh::StartGetPrinters( + AddedPrintersCallback added_printers_callback, + GetPrintersDoneCallback done_callback) { + // Checks whether there is any ExtensionPrinterServiceProvider registered. + if (!HasProvider()) { + LOG(WARNING) << "StartGetPrinters: none ExtensionPrinterServiceProvider"; + std::move(done_callback).Run(); + return; + } + + // Generates a request_id and caches the callbacks. + base::UnguessableToken request_id = base::UnguessableToken::Create(); + pending_printers_added_callbacks_[request_id] = + std::move(added_printers_callback); + pending_get_printers_done_callbacks_[request_id] = std::move(done_callback); + + VLOG(1) << "ExtensionPrinterServiceAsh::StartGetPrinters():" << " request_id=" + << request_id.ToString(); + service_provider_->DispatchGetPrintersRequest(request_id); +} + +} // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/extension_printer_service_ash.h b/chrome/browser/ash/crosapi/extension_printer_service_ash.h new file mode 100644 index 0000000..2e0739b --- /dev/null +++ b/chrome/browser/ash/crosapi/extension_printer_service_ash.h
@@ -0,0 +1,82 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_CROSAPI_EXTENSION_PRINTER_SERVICE_ASH_H_ +#define CHROME_BROWSER_ASH_CROSAPI_EXTENSION_PRINTER_SERVICE_ASH_H_ + +// Copyright 2024 The Chromium 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 <vector> + +#include "base/memory/weak_ptr.h" +#include "base/unguessable_token.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver_set.h" + +namespace crosapi { + +// Bridge between ash-chrome's ExtensionPrinterHandlerAdapterAsh and +// lacros-chrome's ExtensionPrinterServiceProvider. +class ExtensionPrinterServiceAsh : public mojom::ExtensionPrinterService { + public: + using AddedPrintersCallback = + base::RepeatingCallback<void(base::Value::List printers)>; + using GetPrintersDoneCallback = base::OnceClosure; + + ExtensionPrinterServiceAsh(); + ExtensionPrinterServiceAsh(const ExtensionPrinterServiceAsh&) = delete; + ExtensionPrinterServiceAsh& operator=(const ExtensionPrinterServiceAsh&) = + delete; + ~ExtensionPrinterServiceAsh() override; + + void BindReceiver( + mojo::PendingReceiver<mojom::ExtensionPrinterService> pending_receiver); + + // mojom::ExtensionPrinterService: + void RegisterServiceProvider( + mojo::PendingRemote<mojom::ExtensionPrinterServiceProvider> provider) + override; + void PrintersAdded(const base::UnguessableToken& request_id, + base::Value::List printers, + bool is_done) override; + + // Called when an ExtensionPrinterServiceProvider is disconnected. + void ExtensionPrinterServiceProviderDisconnected(); + + void StartGetPrinters(AddedPrintersCallback added_printers_callback, + GetPrintersDoneCallback done_callback); + + private: + friend class ExtensionPrinterServiceAshBrowserTest; + + // Returns true iff there is any registered ExtensionPrinterServiceProvider. + bool HasProvider() const; + void ClearPendingRequests(); + + // Supports any number of connections. + mojo::ReceiverSet<mojom::ExtensionPrinterService> receivers_; + + // The ExtensionPrinterServiceProvider from Lacros. The + // ExtensionPrinterServiceProvider only supports Lacros primary profile for + // extension printer service. + mojo::Remote<mojom::ExtensionPrinterServiceProvider> service_provider_; + // Keeps a mapping between request_id and the corresponding + // AddedPrintersCallback. + std::map<base::UnguessableToken, AddedPrintersCallback> + pending_printers_added_callbacks_; + // Keeps a mapping between request_id and the corresponding + // GetPrintersDoneCallback. + std::map<base::UnguessableToken, GetPrintersDoneCallback> + pending_get_printers_done_callbacks_; + + base::WeakPtrFactory<ExtensionPrinterServiceAsh> weak_ptr_factory_{this}; +}; + +} // namespace crosapi + +#endif // CHROME_BROWSER_ASH_CROSAPI_EXTENSION_PRINTER_SERVICE_ASH_H_
diff --git a/chrome/browser/ash/crosapi/extension_printer_service_ash_browsertest.cc b/chrome/browser/ash/crosapi/extension_printer_service_ash_browsertest.cc new file mode 100644 index 0000000..2363f61 --- /dev/null +++ b/chrome/browser/ash/crosapi/extension_printer_service_ash_browsertest.cc
@@ -0,0 +1,170 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/crosapi/extension_printer_service_ash.h" + +#include <memory> +#include <utility> + +#include "base/logging.h" +#include "base/test/repeating_test_future.h" +#include "base/test/test_future.h" +#include "base/test/values_test_util.h" +#include "base/unguessable_token.h" +#include "base/values.h" +#include "chrome/browser/ash/crosapi/crosapi_ash.h" +#include "chrome/browser/ash/crosapi/crosapi_manager.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" +#include "content/public/test/browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace crosapi { + +namespace { + +ExtensionPrinterServiceAsh* ExtensionPrinterService() { + return CrosapiManager::Get()->crosapi_ash()->extension_printer_service_ash(); +} + +base::Value::List CreateTestPrintersSet1() { + return base::test::ParseJsonList(R"( + [ { + "description": "A virtual printer for testing", + "extensionId": "jbljdigmdjodgkcllikhggoepmmffba1", + "extensionName": "Test Printer Provider", + "id": "jbljdigmdjodgkcllikhggoepmmffba1:test-printer-01", + "name": "Test Printer 01" + }, { + "description": "A virtual printer for testing", + "extensionId": "jbljdigmdjodgkcllikhggoepmmffba1", + "extensionName": "Test Printer Provider", + "id": "jbljdigmdjodgkcllikhggoepmmffba1:test-printer-02", + "name": "Test Printer 02" + } ] + )"); +} + +base::Value::List CreateTestPrintersSet2() { + return base::test::ParseJsonList(R"( + [ { + "description": "A virtual printer for testing", + "extensionId": "jbljdigmdjodgkcllikhggoepmmffba2", + "extensionName": "Test Printer Provider", + "id": "jbljdigmdjodgkcllikhggoepmmffba2:test-printer-03", + "name": "Test Printer 03" + }] + )"); +} + +class FakeExtensionPrinterServiceProvider + : public mojom::ExtensionPrinterServiceProvider { + public: + void DispatchGetPrintersRequest( + const ::base::UnguessableToken& request_id) override { + ExtensionPrinterServiceAsh* service = ExtensionPrinterService(); + + service->PrintersAdded(request_id, CreateTestPrintersSet1(), + /*is_done=*/false); + service->PrintersAdded(request_id, CreateTestPrintersSet2(), + /*is_done=*/false); + + // Signals that no more printers will be reported. + service->PrintersAdded(request_id, base::Value::List(), + /*is_done=*/true); + } + + mojo::Receiver<mojom::ExtensionPrinterServiceProvider> receiver_{this}; +}; + +} // namespace + +class ExtensionPrinterServiceAshBrowserTest : public InProcessBrowserTest { + public: + ExtensionPrinterServiceAshBrowserTest() = default; + + void VerifyProvider() { + ExtensionPrinterServiceAsh* service = ExtensionPrinterService(); + EXPECT_TRUE(service->HasProvider()); + } + + private: + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + + ExtensionPrinterService()->BindReceiver( + extension_printer_service_remote_.BindNewPipeAndPassReceiver()); + + extension_printer_service_remote_->RegisterServiceProvider( + fake_provider_.receiver_.BindNewPipeAndPassRemote()); + extension_printer_service_remote_.FlushForTesting(); + } + + FakeExtensionPrinterServiceProvider fake_provider_; + mojo::Remote<mojom::ExtensionPrinterService> + extension_printer_service_remote_; +}; + +// Verifies that a service provider is registered. +IN_PROC_BROWSER_TEST_F(ExtensionPrinterServiceAshBrowserTest, + RegisterServiceProvider) { + VerifyProvider(); +} + +// Verifies that StartGetPrinters can receive printers from multiple extensions. +IN_PROC_BROWSER_TEST_F(ExtensionPrinterServiceAshBrowserTest, + StartGetPrinters) { + base::test::RepeatingTestFuture<base::Value::List> printers_added_future; + base::test::TestFuture<void> done_future; + + ExtensionPrinterService()->StartGetPrinters( + printers_added_future.GetCallback(), done_future.GetCallback()); + + // Verifies the first set of printers from extension 1. + const base::Value::List& printers_set1 = printers_added_future.Take(); + EXPECT_EQ(printers_set1.size(), 2u); + + const base::Value::Dict& printer1 = printers_set1[0].GetDict(); + base::ExpectDictStringValue("A virtual printer for testing", printer1, + "description"); + base::ExpectDictStringValue("jbljdigmdjodgkcllikhggoepmmffba1", printer1, + "extensionId"); + base::ExpectDictStringValue("Test Printer Provider", printer1, + "extensionName"); + base::ExpectDictStringValue( + "jbljdigmdjodgkcllikhggoepmmffba1:test-printer-01", printer1, "id"); + base::ExpectDictStringValue("Test Printer 01", printer1, "name"); + + const base::Value::Dict& printer2 = printers_set1[1].GetDict(); + base::ExpectDictStringValue("A virtual printer for testing", printer2, + "description"); + base::ExpectDictStringValue("jbljdigmdjodgkcllikhggoepmmffba1", printer2, + "extensionId"); + base::ExpectDictStringValue("Test Printer Provider", printer2, + "extensionName"); + base::ExpectDictStringValue( + "jbljdigmdjodgkcllikhggoepmmffba1:test-printer-02", printer2, "id"); + base::ExpectDictStringValue("Test Printer 02", printer2, "name"); + + // Verifies the second set of printers from extension 2. + const base::Value::List& printers_set2 = printers_added_future.Take(); + EXPECT_EQ(printers_set2.size(), 1u); + + const base::Value::Dict& printer3 = printers_set2[0].GetDict(); + base::ExpectDictStringValue("A virtual printer for testing", printer3, + "description"); + base::ExpectDictStringValue("jbljdigmdjodgkcllikhggoepmmffba2", printer3, + "extensionId"); + base::ExpectDictStringValue("Test Printer Provider", printer3, + "extensionName"); + base::ExpectDictStringValue( + "jbljdigmdjodgkcllikhggoepmmffba2:test-printer-03", printer3, "id"); + base::ExpectDictStringValue("Test Printer 03", printer3, "name"); + + // Verifies that the GetPrintersDoneCallback is invoked when no more printers + // will be reported. + EXPECT_TRUE(done_future.Wait()); +} + +} // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/feedback_ash.cc b/chrome/browser/ash/crosapi/feedback_ash.cc index 31e08b57..f040d4b 100644 --- a/chrome/browser/ash/crosapi/feedback_ash.cc +++ b/chrome/browser/ash/crosapi/feedback_ash.cc
@@ -38,6 +38,8 @@ return feedback::kFeedbackSourceQuickOffice; case mojom::LacrosFeedbackSource::kFeedbackSourceAI: return feedback::kFeedbackSourceAI; + case mojom::LacrosFeedbackSource::kFeedbackSourceLensOverlay: + return feedback::kFeedbackSourceLensOverlay; case mojom::LacrosFeedbackSource::kUnknown: return feedback::kFeedbackSourceUnknownLacrosSource; }
diff --git a/chrome/browser/ash/dbus/arc_tracing_service_provider.cc b/chrome/browser/ash/dbus/arc_tracing_service_provider.cc index d4a322e..259671b 100644 --- a/chrome/browser/ash/dbus/arc_tracing_service_provider.cc +++ b/chrome/browser/ash/dbus/arc_tracing_service_provider.cc
@@ -71,6 +71,12 @@ FROM_HERE, std::move(handler_)); } +std::unique_ptr<arc::OverviewTracingHandler> +ArcTracingServiceProvider::NewHandler() { + return std::make_unique<arc::OverviewTracingHandler>( + arc::OverviewTracingHandler::ArcWindowFocusChangeCb()); +} + void ArcTracingServiceProvider::StartTrace( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { @@ -91,8 +97,7 @@ "Expect max trace time as type double in seconds")); return; } - auto handler = std::make_unique<arc::OverviewTracingHandler>( - arc::OverviewTracingHandler::ArcWindowFocusChangeCb()); + auto handler = NewHandler(); auto max_trace_time = base::Seconds(max_trace_seconds); if (max_trace_time < base::Seconds(1)) { @@ -116,7 +121,7 @@ handler_->set_start_build_model_cb( base::BindRepeating(&ArcTracingServiceProvider::AddStatusMessage, weak_ptr_factory_.GetWeakPtr(), "Building model...")); - handler_->StartTracing(base::FilePath("/tmp"), max_trace_time); + handler_->StartTracing(trace_outdir_, max_trace_time); auto response = dbus::Response::FromMethodCall(method_call); dbus::MessageWriter writer(response.get());
diff --git a/chrome/browser/ash/dbus/arc_tracing_service_provider.h b/chrome/browser/ash/dbus/arc_tracing_service_provider.h index ec70720..382ec7f7 100644 --- a/chrome/browser/ash/dbus/arc_tracing_service_provider.h +++ b/chrome/browser/ash/dbus/arc_tracing_service_provider.h
@@ -38,6 +38,10 @@ ~ArcTracingServiceProvider() override; + void set_trace_outdir_for_testing(const base::FilePath& trace_outdir) { + trace_outdir_ = trace_outdir; + } + // CrosDBusService::ServiceProviderInterface: void Start(scoped_refptr<dbus::ExportedObject> exported_object) override; @@ -57,6 +61,10 @@ void StartTrace(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender); + // Supplies a new tracing handler for a trace that is just about to begin. + // Virtual so that tests can supply a testable subclass. + virtual std::unique_ptr<arc::OverviewTracingHandler> NewHandler(); + // Responds with (Gets) the messages in the circular log buffer, oldest first. void GetStatus(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender); @@ -67,6 +75,9 @@ // The last few status messages. std::deque<std::string> msgs_; + // Where finished traces are saved. + base::FilePath trace_outdir_{"/tmp"}; + // Keep this last so that all weak pointers will be invalidated at the // beginning of destruction. base::WeakPtrFactory<ArcTracingServiceProvider> weak_ptr_factory_{this};
diff --git a/chrome/browser/ash/dbus/arc_tracing_service_provider_unittest.cc b/chrome/browser/ash/dbus/arc_tracing_service_provider_unittest.cc new file mode 100644 index 0000000..515a040 --- /dev/null +++ b/chrome/browser/ash/dbus/arc_tracing_service_provider_unittest.cc
@@ -0,0 +1,230 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/dbus/arc_tracing_service_provider.h" + +#include <memory> +#include <utility> + +#include "ash/components/arc/test/arc_task_window_builder.h" +#include "base/files/scoped_temp_dir.h" +#include "base/strings/stringprintf.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/test_file_util.h" +#include "chrome/browser/ash/arc/tracing/overview_tracing_handler.h" +#include "chrome/browser/ash/arc/tracing/test/overview_tracing_test_base.h" +#include "chrome/browser/ash/arc/tracing/test/overview_tracing_test_handler.h" +#include "chromeos/ash/components/dbus/services/service_provider_test_helper.h" +#include "chromeos/dbus/missive/missive_client.h" +#include "components/exo/surface.h" +#include "content/public/test/browser_task_environment.h" +#include "dbus/exported_object.h" +#include "dbus/message.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/service_constants.h" + +using ::testing::_; +using ::testing::ElementsAre; +using ::testing::Eq; + +namespace ash { +namespace { + +class TestProvider : public ArcTracingServiceProvider { + public: + // Supplies the handler used for the next trace, used by tests to prepare the + // handler before the trace begins. + arc::OverviewTracingTestHandler* GetOrCreateNextHandler() { + if (!next_handler_) { + next_handler_ = std::make_unique<arc::OverviewTracingTestHandler>( + arc::OverviewTracingHandler::ArcWindowFocusChangeCb()); + } + return next_handler_.get(); + } + + private: + std::unique_ptr<arc::OverviewTracingHandler> NewHandler() override { + // Make sure a handler is ready to go - ignore return. + GetOrCreateNextHandler(); + + return std::move(next_handler_); + } + + std::unique_ptr<arc::OverviewTracingTestHandler> next_handler_; +}; + +class ArcTracingServiceProviderTest : public arc::OverviewTracingTestBase { + protected: + void SetUp() override { + arc::OverviewTracingTestBase::SetUp(); + + chromeos::MissiveClient::InitializeFake(); + + provider_ = std::make_unique<TestProvider>(); + + CHECK(trace_outdir_.CreateUniqueTempDir()); + provider_->set_trace_outdir_for_testing(trace_outdir_.GetPath()); + } + + void SetupForRequest(std::string_view method_name) { + test_helper_.SetUp(arc::tracing::kArcTracingServiceName, + dbus::ObjectPath(arc::tracing::kArcTracingServicePath), + arc::tracing::kArcTracingInterfaceName, + std::string(method_name), provider_.get()); + } + + std::string InvokeStartMethod(double max_time_seconds) { + SetupForRequest(arc::tracing::kArcTracingStartMethod); + dbus::MethodCall call{arc::tracing::kArcTracingInterfaceName, + arc::tracing::kArcTracingStartMethod}; + dbus::MessageWriter writer{&call}; + writer.AppendDouble(max_time_seconds); + auto response = test_helper_.CallMethod(&call); + + dbus::MessageReader reader{response.get()}; + std::string response_msg; + CHECK(reader.PopString(&response_msg)); + test_helper_.TearDown(); + return response_msg; + } + + std::string InvokeGetStatusMethod() { + SetupForRequest(arc::tracing::kArcTracingGetStatusMethod); + dbus::MethodCall call{arc::tracing::kArcTracingInterfaceName, + arc::tracing::kArcTracingGetStatusMethod}; + dbus::MessageWriter writer{&call}; + auto response = test_helper_.CallMethod(&call); + + dbus::MessageReader reader{response.get()}; + std::vector<std::string> response_msgs; + std::string msg; + while (reader.PopString(&msg)) { + response_msgs.emplace_back(std::move(msg)); + } + test_helper_.TearDown(); + return base::JoinString(response_msgs, "\n"); + } + + void TearDown() override { + provider_.reset(); + chromeos::MissiveClient::Shutdown(); + arc::OverviewTracingTestBase::TearDown(); + } + + std::unique_ptr<TestProvider> provider_; + base::ScopedTempDir trace_outdir_; + ServiceProviderTestHelper test_helper_; +}; + +// The times and timezones in each test below were chosen arbitrarily to +// verify we are formatting the times via the correct API and not ignoring +// timezone settings. + +TEST_F(ArcTracingServiceProviderTest, StartTraceAndGetStatus) { + SetTimeZone("Asia/Chongqing"); + auto* handler = provider_->GetOrCreateNextHandler(); + + base::Time time_base; + ASSERT_TRUE(base::Time::FromString("2023-11-15 08:43:20 +0800", &time_base)); + handler->set_now(time_base + base::Seconds(2)); + handler->set_trace_time_base(time_base); + + exo::Surface s; + auto arc_widget = arc::ArcTaskWindowBuilder() + .SetTaskId(22) + .SetPackageName("org.funstuff.client") + .SetShellRootSurface(&s) + .BuildOwnsNativeWidget(); + + auto max_time = base::Seconds(5); + arc_widget->Show(); + ASSERT_EQ("Trace started", InvokeStartMethod(max_time.InSecondsF())); + + EXPECT_EQ("Trace started", InvokeGetStatusMethod()); + + handler->StartTracingOnControllerRespond(); + + // Fast forward past the max tracing interval. This will stop the trace at the + // end of the fast-forward, which is 400ms after the timeout. + FastForwardClockAndTaskQueue(handler, max_time + base::Milliseconds(400)); + + // Pass results from trace controller to handler. + handler->StopTracingOnControllerRespond( + std::make_unique<std::string>(arc::kBasicSystrace)); + + task_environment()->RunUntilIdle(); + + EXPECT_EQ(base::StringPrintf(R"(Trace started +Building model... +Tracing model is ready: %s/overview_tracing_arctaskwindowdefaulttitle_2023-11-15_08-43-22.json)", + trace_outdir_.GetPath().value().c_str()), + InvokeGetStatusMethod()); +} + +TEST_F(ArcTracingServiceProviderTest, StopTraceByLosingFocus) { + SetTimeZone("Europe/Madrid"); + auto* handler = provider_->GetOrCreateNextHandler(); + base::Time time_base; + ASSERT_TRUE(base::Time::FromString("2024-01-12 12:30:00 +0100", &time_base)); + handler->set_now(time_base + base::Hours(1)); + handler->set_trace_time_base(time_base); + + exo::Surface s; + auto arc_widget = arc::ArcTaskWindowBuilder() + .SetTaskId(22) + .SetPackageName("org.funstuff.client") + .SetShellRootSurface(&s) + .BuildOwnsNativeWidget(); + + auto max_time = base::Seconds(5); + arc_widget->Show(); + ASSERT_EQ("Trace started", InvokeStartMethod(max_time.InSecondsF())); + + EXPECT_EQ("Trace started", InvokeGetStatusMethod()); + + handler->StartTracingOnControllerRespond(); + + // Fast forward to before the max tracing interval. This alone does not stop + // the test. + FastForwardClockAndTaskQueue(handler, max_time - base::Seconds(1)); + + // Minimizing window will lose focus and stop the trace. + arc_widget->Minimize(); + + // Pass results from trace controller to handler. + handler->StopTracingOnControllerRespond( + std::make_unique<std::string>(arc::kBasicSystrace)); + + task_environment()->RunUntilIdle(); + + EXPECT_EQ(base::StringPrintf(R"(Trace started +Building model... +Tracing model is ready: %s/overview_tracing_arctaskwindowdefaulttitle_2024-01-12_13-30-00.json)", + trace_outdir_.GetPath().value().c_str()), + InvokeGetStatusMethod()); +} + +TEST_F(ArcTracingServiceProviderTest, FailedStart) { + auto* handler = provider_->GetOrCreateNextHandler(); + // Arbitrary times - we don't actually use them because a model file is not + // generated, but at least make the times non-zero. + handler->set_now(base::Time::FromSecondsSinceUnixEpoch(1'700'009'000)); + provider_->GetOrCreateNextHandler()->set_trace_time_base( + base::Time::FromSecondsSinceUnixEpoch(1'700'000'000)); + + exo::Surface s; + auto arc_widget = arc::ArcTaskWindowBuilder() + .SetTaskId(22) + .SetPackageName("org.funstuff.client") + .SetShellRootSurface(&s) + .BuildOwnsNativeWidget(); + + ASSERT_EQ("ARC window isn't active", InvokeStartMethod(5)); + + EXPECT_EQ("", InvokeGetStatusMethod()); +} + +} // namespace +} // namespace ash
diff --git a/chrome/browser/ash/extensions/file_manager/DEPS b/chrome/browser/ash/extensions/file_manager/DEPS index dee01be..3a634f6 100644 --- a/chrome/browser/ash/extensions/file_manager/DEPS +++ b/chrome/browser/ash/extensions/file_manager/DEPS
@@ -31,7 +31,7 @@ "+chrome/browser/ash/login/ui", "+chrome/browser/ash/plugin_vm", "+chrome/browser/ash/policy/dlp", - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", "+chrome/browser/ash/profiles", "+chrome/browser/ash/smb_client", "+chrome/browser/browser_process.h",
diff --git a/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc b/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc index 03ca51c..b27c81b 100644 --- a/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc +++ b/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc
@@ -368,8 +368,10 @@ reason.type = drivefs::mojom::DialogReason::Type::kEnableDocsOffline; reason.path = base::FilePath("a"); event_router_.DisplayConfirmDialog( - reason, base::BindLambdaForTesting( - [&](drivefs::mojom::DialogResult result) { NOTREACHED(); })); + reason, + base::BindLambdaForTesting([&](drivefs::mojom::DialogResult result) { + NOTREACHED_IN_MIGRATION(); + })); Unmount(); event_router_.OnDialogResult(drivefs::mojom::DialogResult::kAccept);
diff --git a/chrome/browser/ash/extensions/file_manager/event_router.h b/chrome/browser/ash/extensions/file_manager/event_router.h index 2ef22ab..7c3af8fe 100644 --- a/chrome/browser/ash/extensions/file_manager/event_router.h +++ b/chrome/browser/ash/extensions/file_manager/event_router.h
@@ -31,7 +31,7 @@ #include "chrome/browser/ash/guest_os/guest_os_share_path.h" #include "chrome/browser/ash/guest_os/public/guest_os_mount_provider.h" #include "chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry.h" -#include "chrome/browser/ash/policy/local_user_files/observer.h" +#include "chrome/browser/ash/policy/skyvault/observer.h" #include "chrome/common/extensions/api/file_manager_private.h" #include "chromeos/ash/components/settings/timezone_settings.h" #include "chromeos/dbus/dlp/dlp_client.h"
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc b/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc index c8477cef..bf7a6414 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_file_system.cc
@@ -70,7 +70,7 @@ #include "chrome/browser/ash/policy/dlp/dlp_files_controller_ash.h" #include "chrome/browser/ash/policy/dlp/files_policy_notification_manager.h" #include "chrome/browser/ash/policy/dlp/files_policy_notification_manager_factory.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/policy/dlp/dlp_file_destination.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h"
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_misc.cc b/chrome/browser/ash/extensions/file_manager/private_api_misc.cc index 3659f1a..da8ce9f 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_misc.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_misc.cc
@@ -43,7 +43,7 @@ #include "chrome/browser/ash/fileapi/recent_model_factory.h" #include "chrome/browser/ash/guest_os/guest_os_share_path.h" #include "chrome/browser/ash/guest_os/public/guest_os_service.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/upload_office_to_cloud/upload_office_to_cloud.h"
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_util.cc b/chrome/browser/ash/extensions/file_manager/private_api_util.cc index a895f3b..08f4dd4 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_util.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_util.cc
@@ -35,7 +35,7 @@ #include "chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry.h" #include "chrome/browser/ash/guest_os/public/guest_os_service.h" #include "chrome/browser/ash/guest_os/public/types.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/file_manager_private.h" #include "chromeos/ash/components/drivefs/drivefs_pinning_manager.h"
diff --git a/chrome/browser/ash/file_manager/DEPS b/chrome/browser/ash/file_manager/DEPS index 7c9baf0..b244769 100644 --- a/chrome/browser/ash/file_manager/DEPS +++ b/chrome/browser/ash/file_manager/DEPS
@@ -34,7 +34,7 @@ "+chrome/browser/ash/plugin_vm", "+chrome/browser/ash/policy/core", "+chrome/browser/ash/policy/dlp", - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", "+chrome/browser/ash/profiles", "+chrome/browser/ash/settings", "+chrome/browser/ash/smb_client",
diff --git a/chrome/browser/ash/file_manager/trash_common_util.cc b/chrome/browser/ash/file_manager/trash_common_util.cc index 1198250..f454d84 100644 --- a/chrome/browser/ash/file_manager/trash_common_util.cc +++ b/chrome/browser/ash/file_manager/trash_common_util.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/ash/file_manager/volume_manager.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "components/prefs/pref_service.h" namespace file_manager::trash {
diff --git a/chrome/browser/ash/file_manager/volume_manager.cc b/chrome/browser/ash/file_manager/volume_manager.cc index f453de6..e47be94 100644 --- a/chrome/browser/ash/file_manager/volume_manager.cc +++ b/chrome/browser/ash/file_manager/volume_manager.cc
@@ -36,7 +36,7 @@ #include "chrome/browser/ash/file_manager/snapshot_manager.h" #include "chrome/browser/ash/file_manager/volume_manager_factory.h" #include "chrome/browser/ash/file_manager/volume_manager_observer.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" #include "chrome/common/chrome_features.h"
diff --git a/chrome/browser/ash/file_manager/volume_manager.h b/chrome/browser/ash/file_manager/volume_manager.h index bb29af41..d95f4d1c 100644 --- a/chrome/browser/ash/file_manager/volume_manager.h +++ b/chrome/browser/ash/file_manager/volume_manager.h
@@ -26,7 +26,7 @@ #include "chrome/browser/ash/file_system_provider/observer.h" #include "chrome/browser/ash/file_system_provider/service.h" #include "chrome/browser/ash/guest_os/public/types.h" -#include "chrome/browser/ash/policy/local_user_files/observer.h" +#include "chrome/browser/ash/policy/skyvault/observer.h" #include "components/prefs/pref_change_registrar.h" #include "components/storage_monitor/removable_storage_observer.h" #include "services/device/public/mojom/mtp_manager.mojom.h"
diff --git a/chrome/browser/ash/growth/campaigns_manager_client_impl.cc b/chrome/browser/ash/growth/campaigns_manager_client_impl.cc index 9c239a4a..b662134 100644 --- a/chrome/browser/ash/growth/campaigns_manager_client_impl.cc +++ b/chrome/browser/ash/growth/campaigns_manager_client_impl.cc
@@ -36,6 +36,8 @@ #include "components/component_updater/ash/component_manager_ash.h" #include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/tracker.h" +#include "components/language/core/browser/pref_names.h" +#include "components/prefs/pref_service.h" #include "components/variations/synthetic_trials.h" namespace { @@ -100,9 +102,20 @@ } const std::string& CampaignsManagerClientImpl::GetApplicationLocale() const { + // User selected locale, then resolved using + // `l10n_util::CheckAndResolveLocale` to a platform locale. + // For example: `en-IN` will be resolved to `en-GB`. return g_browser_process->GetApplicationLocale(); } +const std::string& CampaignsManagerClientImpl::GetUserLocale() const { + // The locale as selected by the user, such as "en-IN". This is different + // from `GetApplication` locale which is actually platform locale that + // resolved using `l10n_util::CheckAndResolveLocale`. + return GetProfile()->GetPrefs()->GetString( + language::prefs::kApplicationLocale); +} + const base::Version& CampaignsManagerClientImpl::GetDemoModeAppVersion() const { auto* demo_session = ash::DemoSession::Get(); CHECK(demo_session);
diff --git a/chrome/browser/ash/growth/campaigns_manager_client_impl.h b/chrome/browser/ash/growth/campaigns_manager_client_impl.h index 1dad5c8..93267942 100644 --- a/chrome/browser/ash/growth/campaigns_manager_client_impl.h +++ b/chrome/browser/ash/growth/campaigns_manager_client_impl.h
@@ -41,6 +41,7 @@ bool IsCloudGamingDevice() const override; bool IsFeatureAwareDevice() const override; const std::string& GetApplicationLocale() const override; + const std::string& GetUserLocale() const override; const base::Version& GetDemoModeAppVersion() const override; growth::ActionMap GetCampaignsActions() override; void RegisterSyntheticFieldTrial(const std::optional<int> study_id,
diff --git a/chrome/browser/ash/growth/campaigns_manager_session.cc b/chrome/browser/ash/growth/campaigns_manager_session.cc index c96c2bd..5d8708a 100644 --- a/chrome/browser/ash/growth/campaigns_manager_session.cc +++ b/chrome/browser/ash/growth/campaigns_manager_session.cc
@@ -81,7 +81,9 @@ auto* campaigns_manager = growth::CampaignsManager::Get(); CHECK(campaigns_manager); - campaigns_manager->SetTrigger(growth::TriggeringType::kAppOpened); + + growth::Trigger trigger(growth::TriggerType::kAppOpened); + campaigns_manager->SetTrigger(std::move(trigger)); MaybeTriggerSlot(growth::Slot::kNudge); MaybeTriggerSlot(growth::Slot::kNotification); @@ -94,7 +96,9 @@ auto* campaigns_manager = growth::CampaignsManager::Get(); CHECK(campaigns_manager); - campaigns_manager->SetTrigger(growth::TriggeringType::kCampaignsLoaded); + + growth::Trigger trigger(growth::TriggerType::kCampaignsLoaded); + campaigns_manager->SetTrigger(std::move(trigger)); MaybeTriggerSlot(growth::Slot::kNudge); MaybeTriggerSlot(growth::Slot::kNotification);
diff --git a/chrome/browser/ash/guest_os/public/DEPS b/chrome/browser/ash/guest_os/public/DEPS index 0f4d73a..7bb540d 100644 --- a/chrome/browser/ash/guest_os/public/DEPS +++ b/chrome/browser/ash/guest_os/public/DEPS
@@ -19,7 +19,7 @@ "+chrome/browser/ash/crostini", "+chrome/browser/ash/file_manager", "+chrome/browser/ash/guest_os", - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", "+chrome/browser/ash/profiles", "+chrome/browser/extensions/api/terminal", "+chrome/browser/profiles",
diff --git a/chrome/browser/ash/guest_os/public/guest_os_mount_provider.cc b/chrome/browser/ash/guest_os/public/guest_os_mount_provider.cc index cc412fed..e73d54c 100644 --- a/chrome/browser/ash/guest_os/public/guest_os_mount_provider.cc +++ b/chrome/browser/ash/guest_os/public/guest_os_mount_provider.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/ash/file_manager/volume_manager.h" #include "chrome/browser/ash/guest_os/infra/cached_callback.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/profiles/profile.h" #include "chromeos/ash/components/disks/disk_mount_manager.h" #include "storage/browser/file_system/external_mount_points.h"
diff --git a/chrome/browser/ash/login/existing_user_controller.cc b/chrome/browser/ash/login/existing_user_controller.cc index 88f5dcb..d1a40a7 100644 --- a/chrome/browser/ash/login/existing_user_controller.cc +++ b/chrome/browser/ash/login/existing_user_controller.cc
@@ -1293,22 +1293,6 @@ PerformLoginFinishedActions(true /* start auto login timer */); } -void ExistingUserController::MigrateUserData(const std::string& old_password) { - // LoginPerformer instance has state of the user so it should exist. - if (login_performer_.get()) { - VLOG(1) << "Migrate the existing cryptohome to new password."; - login_performer_->RecoverEncryptedData(old_password); - } -} - -void ExistingUserController::ResyncUserData() { - // LoginPerformer instance has state of the user so it should exist. - if (login_performer_.get()) { - VLOG(1) << "Create a new cryptohome and resync user data."; - login_performer_->ResyncEncryptedData(); - } -} - void ExistingUserController::StartAutoLoginTimer() { auto session_state = session_manager::SessionManager::Get()->session_state(); if (is_login_in_progress_ ||
diff --git a/chrome/browser/ash/login/existing_user_controller.h b/chrome/browser/ash/login/existing_user_controller.h index b3b94b75..bafebaa 100644 --- a/chrome/browser/ash/login/existing_user_controller.h +++ b/chrome/browser/ash/login/existing_user_controller.h
@@ -85,14 +85,6 @@ // Cancels current password changed flow. void CancelPasswordChangedFlow(); - // Decrypt cryptohome using user provided `old_password` and migrate to new - // password. - void MigrateUserData(const std::string& old_password); - - // Ignore password change, remove existing cryptohome and force full sync of - // user data. - void ResyncUserData(); - // Resumes login process once local authentication is completed. void ResumeAfterLocalAuthentication(std::unique_ptr<UserContext>); // Invoked if login process was cancelled at local authentication.
diff --git a/chrome/browser/ash/login/oobe_interactive_ui_test.cc b/chrome/browser/ash/login/oobe_interactive_ui_test.cc index 5e37853a..1a47977e 100644 --- a/chrome/browser/ash/login/oobe_interactive_ui_test.cc +++ b/chrome/browser/ash/login/oobe_interactive_ui_test.cc
@@ -490,7 +490,7 @@ delegate_->OnLoadSuccess(base::Value(std::move(response_dict))); } - void Retry() override { NOTREACHED(); } + void Retry() override { NOTREACHED_IN_MIGRATION(); } private: const raw_ptr<apps::RecommendAppsFetcherDelegate> delegate_;
diff --git a/chrome/browser/ash/login/quick_unlock/pin_backend.cc b/chrome/browser/ash/login/quick_unlock/pin_backend.cc index bf5be74..f0759b2 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_backend.cc +++ b/chrome/browser/ash/login/quick_unlock/pin_backend.cc
@@ -246,8 +246,7 @@ BoolCallback did_set) { // Immediate false if the PIN length isn't supported, or when the feature // isdisabled. - if (!features::IsPinAutosubmitFeatureEnabled() || - pin.length() > kPinAutosubmitMaxPinLength) { + if (pin.length() > kPinAutosubmitMaxPinLength) { PostResponse(std::move(did_set), false); return; } @@ -408,11 +407,6 @@ int PinBackend::GetExposedPinLength(const AccountId& account_id) { user_manager::KnownUser known_user(g_browser_process->local_state()); - if (!features::IsPinAutosubmitFeatureEnabled()) { - // Clear the exposed length if the feature was disabled. - known_user.SetUserPinLength(account_id, 0); - return 0; - } // Clear the pin length in local state if auto-submit got disabled, for // example, via policy. Disabling auto submit through Settings clears it @@ -495,9 +489,6 @@ void PinBackend::UpdatePinAutosubmitOnSet(const AccountId& account_id, size_t pin_length) { - if (!features::IsPinAutosubmitFeatureEnabled()) - return; - user_manager::KnownUser known_user(g_browser_process->local_state()); // A PIN is being set when the auto submit feature is present. This user // does not need to be backfilled. @@ -522,8 +513,6 @@ } void PinBackend::UpdatePinAutosubmitOnRemove(const AccountId& account_id) { - if (!features::IsPinAutosubmitFeatureEnabled()) - return; user_manager::KnownUser known_user(g_browser_process->local_state()); known_user.SetUserPinLength(account_id, 0); PrefService(account_id)->ClearPref(::prefs::kPinUnlockAutosubmitEnabled); @@ -532,9 +521,6 @@ void PinBackend::UpdatePinAutosubmitOnSuccessfulTryAuth( const AccountId& account_id, size_t pin_length) { - if (!features::IsPinAutosubmitFeatureEnabled()) - return; - // Backfill the auto submit preference if the PIN that was authenticated was // set before the auto submit feature existed. PinAutosubmitBackfill(account_id, pin_length); @@ -550,8 +536,7 @@ void PinBackend::PinAutosubmitBackfill(const AccountId& account_id, size_t pin_length) { - if (!features::IsPinAutosubmitBackfillFeatureEnabled() || - !features::IsPinAutosubmitFeatureEnabled()) { + if (!features::IsPinAutosubmitBackfillFeatureEnabled()) { return; }
diff --git a/chrome/browser/ash/login/quick_unlock/quick_unlock_utils.cc b/chrome/browser/ash/login/quick_unlock/quick_unlock_utils.cc index 45071aa..f2b93f0 100644 --- a/chrome/browser/ash/login/quick_unlock/quick_unlock_utils.cc +++ b/chrome/browser/ash/login/quick_unlock/quick_unlock_utils.cc
@@ -217,9 +217,7 @@ registry->RegisterIntegerPref(prefs::kPinUnlockMaximumLength, 0); registry->RegisterBooleanPref(prefs::kPinUnlockWeakPinsAllowed, true); - // Register as true by default only when the feature is enabled. - registry->RegisterBooleanPref(::prefs::kPinUnlockAutosubmitEnabled, - features::IsPinAutosubmitFeatureEnabled()); + registry->RegisterBooleanPref(::prefs::kPinUnlockAutosubmitEnabled, true); } bool IsPinDisabledByPolicy(PrefService* pref_service, Purpose purpose) {
diff --git a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.cc b/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.cc deleted file mode 100644 index bc05dce..0000000 --- a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.cc +++ /dev/null
@@ -1,285 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h" - -#include <memory> -#include <optional> -#include <string> -#include <utility> - -#include "ash/public/cpp/reauth_reason.h" -#include "base/check.h" -#include "base/check_op.h" -#include "base/functional/bind.h" -#include "base/logging.h" -#include "base/memory/weak_ptr.h" -#include "base/metrics/histogram_functions.h" -#include "base/values.h" -#include "chrome/browser/ash/login/oobe_screen.h" -#include "chrome/browser/ash/login/reauth_stats.h" -#include "chrome/browser/ash/login/screens/base_screen.h" -#include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ash/profiles/signin_profile_handler.h" -#include "chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h" -#include "chromeos/ash/components/cryptohome/auth_factor.h" -#include "chromeos/ash/components/cryptohome/error_util.h" -#include "chromeos/ash/components/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/ash/components/login/auth/auth_factor_editor.h" -#include "chromeos/ash/components/login/auth/auth_performer.h" -#include "chromeos/ash/components/login/auth/mount_performer.h" -#include "chromeos/ash/components/login/auth/public/authentication_error.h" -#include "components/device_event_log/device_event_log.h" -#include "components/user_manager/user_manager.h" - -// TODO(b/274018437): Remove after figuring out the root cause of the bug -#undef ENABLED_VLOG_LEVEL -#define ENABLED_VLOG_LEVEL 1 - -namespace ash { -namespace { - -constexpr const char kUserActionCancelLogin[] = "cancel"; -constexpr const char kUserActionResyncData[] = "resync"; -constexpr const char kUserActionMigrateUserData[] = "migrate-user-data"; -constexpr const char kUserActionSetupRecovery[] = "setup-recovery"; -constexpr const char kUserActionDontSetupRecovery[] = "no-recovery"; - -void RecordScreenAction(GaiaPasswordChangedScreen::UserAction value) { - base::UmaHistogramEnumeration("OOBE.GaiaPasswordChangedScreen.UserActions", - value); -} - -} // namespace - -// static -std::string GaiaPasswordChangedScreen::GetResultString(Result result) { - // LINT.IfChange(UsageMetrics) - switch (result) { - case Result::CANCEL: - return "Cancel"; - case Result::CONTINUE_LOGIN: - return "ContinueLogin"; - case Result::RECREATE_USER: - return "RecreateUser"; - case Result::CRYPTOHOME_ERROR: - return "CryptohomeError"; - } - // LINT.ThenChange(//tools/metrics/histograms/metadata/oobe/histograms.xml) -} - -GaiaPasswordChangedScreen::GaiaPasswordChangedScreen( - const ScreenExitCallback& exit_callback, - base::WeakPtr<GaiaPasswordChangedView> view) - : BaseScreen(GaiaPasswordChangedView::kScreenId, - OobeScreenPriority::DEFAULT), - view_(std::move(view)), - exit_callback_(exit_callback) {} - -GaiaPasswordChangedScreen::~GaiaPasswordChangedScreen() = default; - -void GaiaPasswordChangedScreen::ShowImpl() { - VLOG(1) << "GaiaPasswordChangedScreen::ShowImpl"; - DCHECK(context()->user_context); - if (view_) - view_->Show(context()->user_context->GetAccountId().GetUserEmail()); - auth_performer_ = std::make_unique<AuthPerformer>(UserDataAuthClient::Get()); - factor_editor_ = - std::make_unique<AuthFactorEditor>(UserDataAuthClient::Get()); - mount_performer_ = std::make_unique<MountPerformer>(); - // Store password obtained during online authentication. - // It will be either used to replace old password or - // be restored as main key in re-creating user flow. - DCHECK(!context()->user_context->HasReplacementKey()); - context()->user_context->SaveKeyForReplacement(); -} - -void GaiaPasswordChangedScreen::HideImpl() { - VLOG(1) << "GaiaPasswordChangedScreen::HideImpl"; - DCHECK(!auth_performer_); - DCHECK(!factor_editor_); - DCHECK(!mount_performer_); -} - -void GaiaPasswordChangedScreen::OnUserAction(const base::Value::List& args) { - const std::string& action_id = args[0].GetString(); - VLOG(1) << "GaiaPasswordChangedScreen::OnUserAction " - << "action_id= " << action_id; - if (action_id == kUserActionCancelLogin) { - RecordScreenAction(UserAction::kCancel); - CancelPasswordChangedFlow(); - } else if (action_id == kUserActionResyncData) { - RecreateUser(); - } else if (action_id == kUserActionSetupRecovery) { - // TODO(b/257225574): Currently setting up recovery requires profile. - // Actually add recovery when we migrate from quick_unlock as - // UserContext storage. - LOG(FATAL) << "Setting up recovery is not implemented yet"; - } else if (action_id == kUserActionDontSetupRecovery) { - // Auth session is authenticated, password is updated, just exit screen. - FinishWithResult(Result::CONTINUE_LOGIN); - } else if (action_id == kUserActionMigrateUserData) { - CHECK_EQ(args.size(), 2u); - const std::string& old_password = args[1].GetString(); - AttemptAuthentication(old_password); - } else { - BaseScreen::OnUserAction(args); - } -} - -void GaiaPasswordChangedScreen::AttemptAuthentication( - const std::string& old_password) { - VLOG(1) << "GaiaPasswordChangedScreen::AttemptAuthentication " - << "auth_performer_= " << auth_performer_.get(); - RecordScreenAction(UserAction::kMigrateUserData); - DCHECK(!context()->user_context->GetAuthSessionId().empty()); - auto* factor = - context()->user_context->GetAuthFactorsConfiguration().FindFactorByType( - cryptohome::AuthFactorType::kPassword); - DCHECK(factor); - auth_performer_->AuthenticateWithPassword( - factor->ref().label().value(), old_password, - std::move(context()->user_context), - base::BindOnce(&GaiaPasswordChangedScreen::OnPasswordAuthentication, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreen::OnPasswordAuthentication( - std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error) { - context()->user_context = std::move(user_context); - if (error.has_value()) { - if (cryptohome::ErrorMatches( - error->get_cryptohome_error(), - user_data_auth::CRYPTOHOME_ERROR_AUTHORIZATION_KEY_FAILED)) { - RecordScreenAction(UserAction::kIncorrectOldPassword); - view_->ShowWrongPasswordError(); - return; - } - // TODO(b/239420684): Send an error to the UI. - FinishWithResult(Result::CRYPTOHOME_ERROR); - return; - } - - // Auth session is authenticated, update password to one stored in context. - factor_editor_->ReplaceContextKey( - std::move(context()->user_context), - base::BindOnce(&GaiaPasswordChangedScreen::OnPasswordUpdated, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreen::OnPasswordUpdated( - std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error) { - context()->user_context = std::move(user_context); - if (error.has_value()) { - // TODO(b/239420684): Send an error to the UI. - FinishWithResult(Result::CRYPTOHOME_ERROR); - return; - } - // We currently need to use this to determine Recovery factor eligibility. - factor_editor_->GetAuthFactorsConfiguration( - std::move(context()->user_context), - base::BindOnce(&GaiaPasswordChangedScreen::OnGetConfiguration, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreen::OnGetConfiguration( - std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error) { - context()->user_context = std::move(user_context); - if (error.has_value()) { - // TODO(b/239420684): Send an error to the UI. - FinishWithResult(Result::CRYPTOHOME_ERROR); - return; - } - - // TODO(b/257225574): Currently setting up recovery requires profile. - // Actually add recovery when we migrate from quick_unlock as - // UserContext storage. - bool can_set_recovery = false; - - if (can_set_recovery) { - auto factors_config = - context()->user_context->GetAuthFactorsConfiguration(); - can_set_recovery &= factors_config.get_supported_factors().Has( - cryptohome::AuthFactorType::kRecovery) && - (!factors_config.HasConfiguredFactor( - cryptohome::AuthFactorType::kRecovery)); - } - - if (!can_set_recovery) { - // Auth session is authenticated, password is updated, report the success. - FinishWithResult(Result::CONTINUE_LOGIN); - return; - } - view_->SuggestRecovery(); -} - -void GaiaPasswordChangedScreen::RecreateUser() { - LOGIN_LOG(USER) << "Re-creating user."; - VLOG(1) << "GaiaPasswordChangedScreen::RecreateUser " - << "mount_performer_= " << mount_performer_.get(); - RecordScreenAction(UserAction::kResyncUserData); - mount_performer_->RemoveUserDirectory( - std::move(context()->user_context), - base::BindOnce(&GaiaPasswordChangedScreen::OnRemovedUserDirectory, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreen::OnRemovedUserDirectory( - std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error) { - context()->user_context = std::move(user_context); - if (error.has_value()) { - LOGIN_LOG(ERROR) << "Failed to remove user home directory"; - // TODO(b/239420684): Send an error to the UI. - FinishWithResult(Result::CRYPTOHOME_ERROR); - return; - } - // Force user to go through onboarding again, so that they have - // consistent experience. - // Do not notify about removal, as we are still inside the login - // flow. Otherwise, GAIA screen might be shown (if this user was - // the only user on the device). - // TODO(b/270040728): Use `RemoveUserFromList` once internal architecture - // allows better solution. - user_manager::UserManager::Get()->RemoveUserFromListForRecreation( - context()->user_context->GetAccountId()); - // Now that user is deleted, reset everything in UserContext - // related to cryptohome state. - context()->user_context->ResetAuthSessionIds(); - context()->user_context->ClearAuthFactorsConfiguration(); - // Move online password back so that it can be used as key. - // See `ShowImpl()` to see where it was stored. - context()->user_context->ReuseReplacementKey(); - FinishWithResult(Result::RECREATE_USER); -} - -void GaiaPasswordChangedScreen::CancelPasswordChangedFlow() { - if (context()->user_context->GetAccountId().is_valid()) { - RecordReauthReason(context()->user_context->GetAccountId(), - ReauthReason::kPasswordUpdateSkipped); - } - SigninProfileHandler::Get()->ClearSigninProfile( - base::BindOnce(&GaiaPasswordChangedScreen::OnCookiesCleared, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreen::OnCookiesCleared() { - FinishWithResult(Result::CANCEL); -} - -void GaiaPasswordChangedScreen::FinishWithResult(Result result) { - VLOG(1) << "GaiaPasswordChangedScreen::FinishWithResult " - << "result= " << static_cast<int>(result); - weak_factory_.InvalidateWeakPtrs(); - auth_performer_.reset(); - factor_editor_.reset(); - mount_performer_.reset(); - exit_callback_.Run(result); -} - -} // namespace ash
diff --git a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h b/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h deleted file mode 100644 index 64c5576e..0000000 --- a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h +++ /dev/null
@@ -1,101 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_H_ -#define CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_H_ - -#include <memory> -#include <optional> -#include <string> - -#include "base/functional/callback.h" -#include "base/memory/weak_ptr.h" -#include "base/values.h" -#include "chrome/browser/ash/login/screens/base_screen.h" -#include "chrome/browser/ash/login/wizard_context.h" -#include "chromeos/ash/components/login/auth/public/authentication_error.h" - -namespace ash { - -class AuthFactorEditor; -class AuthPerformer; -class GaiaPasswordChangedView; -class MountPerformer; - -// Controller for the tpm error screen. -class GaiaPasswordChangedScreen : public BaseScreen { - public: - using TView = GaiaPasswordChangedView; - - enum class Result { - CANCEL, - CONTINUE_LOGIN, - RECREATE_USER, - CRYPTOHOME_ERROR, - }; - - static std::string GetResultString(Result result); - - using ScreenExitCallback = base::RepeatingCallback<void(Result result)>; - - explicit GaiaPasswordChangedScreen( - const ScreenExitCallback& exit_callback, - base::WeakPtr<GaiaPasswordChangedView> view); - GaiaPasswordChangedScreen(const GaiaPasswordChangedScreen&) = delete; - GaiaPasswordChangedScreen& operator=(const GaiaPasswordChangedScreen&) = - delete; - ~GaiaPasswordChangedScreen() override; - - // This enum is tied directly to a UMA enum defined in - // //tools/metrics/histograms/enums.xml, and should always reflect it (do not - // change one without changing the other). Entries should be never modified - // or deleted. Only additions possible. - enum class UserAction { - kResyncUserData = 0, - kMigrateUserData = 1, - kCancel = 2, - kIncorrectOldPassword = 3, - kIgnoreRecovery = 4, - kSetupRecovery = 5, - kMaxValue = kSetupRecovery - }; - - private: - // BaseScreen: - void ShowImpl() override; - void HideImpl() override; - void OnUserAction(const base::Value::List& args) override; - - void FinishWithResult(Result result); - - void AttemptAuthentication(const std::string& old_password); - void OnPasswordAuthentication(std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error); - void OnGetConfiguration(std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error); - void OnPasswordUpdated(std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error); - void RecreateUser(); - void OnRemovedUserDirectory(std::unique_ptr<UserContext> user_context, - std::optional<AuthenticationError> error); - - void CancelPasswordChangedFlow(); - void OnCookiesCleared(); - - // Used for authentication attempt, cleared upon screen exit. - std::unique_ptr<AuthPerformer> auth_performer_; - // Used for changing password, cleared upon screen exit. - std::unique_ptr<AuthFactorEditor> factor_editor_; - // Used for deleting home directory, cleared upon screen exit. - std::unique_ptr<MountPerformer> mount_performer_; - - base::WeakPtr<GaiaPasswordChangedView> view_; - ScreenExitCallback exit_callback_; - - base::WeakPtrFactory<GaiaPasswordChangedScreen> weak_factory_{this}; -}; - -} // namespace ash - -#endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_H_
diff --git a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.cc b/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.cc deleted file mode 100644 index f9e434b..0000000 --- a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.cc +++ /dev/null
@@ -1,124 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h" - -#include <string> -#include <utility> - -#include "ash/public/cpp/reauth_reason.h" -#include "base/check.h" -#include "base/check_op.h" -#include "base/functional/bind.h" -#include "base/memory/weak_ptr.h" -#include "base/metrics/histogram_functions.h" -#include "base/values.h" -#include "chrome/browser/ash/login/oobe_screen.h" -#include "chrome/browser/ash/login/reauth_stats.h" -#include "chrome/browser/ash/login/screens/base_screen.h" -#include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ash/profiles/signin_profile_handler.h" -#include "chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h" - -namespace ash { -namespace { - -constexpr const char kUserActionCancelLogin[] = "cancel"; -constexpr const char kUserActionResyncData[] = "resync"; -constexpr const char kUserActionMigrateUserData[] = "migrate-user-data"; - -void RecordScreenAction(GaiaPasswordChangedScreenLegacy::UserAction value) { - base::UmaHistogramEnumeration("OOBE.GaiaPasswordChangedScreen.UserActions", - value); -} - -} // namespace - -// static -std::string GaiaPasswordChangedScreenLegacy::GetResultString(Result result) { - switch (result) { - case Result::CANCEL: - return "Cancel"; - case Result::MIGRATE: - return "Migrate"; - case Result::RESYNC: - return "Resync"; - } -} - -GaiaPasswordChangedScreenLegacy::GaiaPasswordChangedScreenLegacy( - const ScreenExitCallback& exit_callback, - base::WeakPtr<GaiaPasswordChangedView> view) - : BaseScreen(GaiaPasswordChangedView::kScreenId, - OobeScreenPriority::DEFAULT), - view_(std::move(view)), - exit_callback_(exit_callback) {} - -GaiaPasswordChangedScreenLegacy::~GaiaPasswordChangedScreenLegacy() = default; - -void GaiaPasswordChangedScreenLegacy::ShowImpl() { - DCHECK(account_id_.is_valid()); - if (view_) { - view_->Show(account_id_.GetUserEmail(), show_error_); - } -} - -void GaiaPasswordChangedScreenLegacy::HideImpl() { - account_id_.clear(); - show_error_ = false; -} - -void GaiaPasswordChangedScreenLegacy::Configure(const AccountId& account_id, - bool after_incorrect_attempt) { - DCHECK(account_id.is_valid()); - account_id_ = account_id; - show_error_ = after_incorrect_attempt; - if (after_incorrect_attempt) { - RecordScreenAction(UserAction::kIncorrectOldPassword); - } -} - -void GaiaPasswordChangedScreenLegacy::OnUserAction( - const base::Value::List& args) { - const std::string& action_id = args[0].GetString(); - - if (action_id == kUserActionCancelLogin) { - RecordScreenAction(UserAction::kCancel); - CancelPasswordChangedFlow(); - } else if (action_id == kUserActionResyncData) { - RecordScreenAction(UserAction::kResyncUserData); - // LDH will pass control to ExistingUserController to proceed with clearing - // cryptohome. - exit_callback_.Run(Result::RESYNC); - } else if (action_id == kUserActionMigrateUserData) { - CHECK_EQ(args.size(), 2u); - const std::string& old_password = args[1].GetString(); - MigrateUserData(old_password); - } else { - BaseScreen::OnUserAction(args); - } -} - -void GaiaPasswordChangedScreenLegacy::MigrateUserData( - const std::string& old_password) { - RecordScreenAction(UserAction::kMigrateUserData); - // LDH will pass control to ExistingUserController to proceed with updating - // cryptohome keys. - LoginDisplayHost::default_host()->MigrateUserData(old_password); -} - -void GaiaPasswordChangedScreenLegacy::CancelPasswordChangedFlow() { - if (account_id_.is_valid()) { - RecordReauthReason(account_id_, ReauthReason::kPasswordUpdateSkipped); - } - SigninProfileHandler::Get()->ClearSigninProfile( - base::BindOnce(&GaiaPasswordChangedScreenLegacy::OnCookiesCleared, - weak_factory_.GetWeakPtr())); -} - -void GaiaPasswordChangedScreenLegacy::OnCookiesCleared() { - exit_callback_.Run(Result::CANCEL); -} - -} // namespace ash
diff --git a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h b/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h deleted file mode 100644 index f2ba8e57..0000000 --- a/chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h +++ /dev/null
@@ -1,79 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_LEGACY_H_ -#define CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_LEGACY_H_ - -#include <string> - -#include "base/functional/callback.h" -#include "base/memory/weak_ptr.h" -#include "base/values.h" -#include "chrome/browser/ash/login/screens/base_screen.h" -#include "components/account_id/account_id.h" - -namespace ash { - -class GaiaPasswordChangedView; - -// Controller for the tpm error screen. -class GaiaPasswordChangedScreenLegacy : public BaseScreen { - public: - using TView = GaiaPasswordChangedView; - - enum class Result { - CANCEL = 0, - RESYNC = 1, - MIGRATE = 2, - }; - - static std::string GetResultString(Result result); - - using ScreenExitCallback = base::RepeatingCallback<void(Result result)>; - - explicit GaiaPasswordChangedScreenLegacy( - const ScreenExitCallback& exit_callback, - base::WeakPtr<GaiaPasswordChangedView> view); - GaiaPasswordChangedScreenLegacy(const GaiaPasswordChangedScreenLegacy&) = - delete; - GaiaPasswordChangedScreenLegacy& operator=( - const GaiaPasswordChangedScreenLegacy&) = delete; - ~GaiaPasswordChangedScreenLegacy() override; - - // This enum is tied directly to a UMA enum defined in - // //tools/metrics/histograms/enums.xml, and should always reflect it (do not - // change one without changing the other). Entries should be never modified - // or deleted. Only additions possible. - enum class UserAction { - kResyncUserData = 0, - kMigrateUserData = 1, - kCancel = 2, - kIncorrectOldPassword = 3, - kMaxValue = kIncorrectOldPassword - }; - - void Configure(const AccountId& account_id, bool after_incorrect_attempt); - - private: - // BaseScreen: - void ShowImpl() override; - void HideImpl() override; - void OnUserAction(const base::Value::List& args) override; - - void MigrateUserData(const std::string& old_password); - void CancelPasswordChangedFlow(); - void OnCookiesCleared(); - - AccountId account_id_; - bool show_error_ = false; - - base::WeakPtr<GaiaPasswordChangedView> view_; - ScreenExitCallback exit_callback_; - - base::WeakPtrFactory<GaiaPasswordChangedScreenLegacy> weak_factory_{this}; -}; - -} // namespace ash - -#endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_GAIA_PASSWORD_CHANGED_SCREEN_LEGACY_H_
diff --git a/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.cc b/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.cc index 8dc8dd2..80f3421 100644 --- a/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.cc +++ b/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.cc
@@ -4,9 +4,16 @@ #include "chrome/browser/ash/login/screens/personalized_recommend_apps_screen.h" +#include <algorithm> +#include <unordered_map> +#include <unordered_set> + #include "ash/constants/ash_switches.h" #include "chrome/browser/ash/arc/arc_util.h" #include "chrome/browser/ash/login/login_pref_names.h" +#include "chrome/browser/ash/login/oobe_apps_service/oobe_apps_discovery_service.h" +#include "chrome/browser/ash/login/oobe_apps_service/oobe_apps_discovery_service_factory.h" +#include "chrome/browser/ash/login/oobe_apps_service/oobe_apps_types.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile.h" @@ -21,6 +28,7 @@ constexpr const char kUserActionNext[] = "next"; constexpr const char kUserActionSkip[] = "skip"; constexpr const char kUserActionBack[] = "back"; +constexpr const char kNoUseCasesSelectedIDName[] = "oobe_other"; } // namespace @@ -90,13 +98,167 @@ return; } - // TODO(b/339789465) : get the list of apps and categories - // user selected and generate the data for the screen - // map[category]: list<Apps> + raw_ptr<OobeAppsDiscoveryService> oobe_apps_discovery_service_ = + OobeAppsDiscoveryServiceFactory::GetForProfile( + ProfileManager::GetActiveUserProfile()); + oobe_apps_discovery_service_->GetAppsAndUseCases( + base::BindOnce(&PersonalizedRecommendAppsScreen::OnResponseReceived, + weak_factory_.GetWeakPtr())); view_->Show(); } +void PersonalizedRecommendAppsScreen::OnResponseReceived( + const std::vector<OOBEAppDefinition>& app_infos, + const std::vector<OOBEDeviceUseCase>& use_cases, + AppsFetchingResult result) { + if (result != AppsFetchingResult::kSuccess) { + LOG(ERROR) + << "Got an error when fetched cached data from the OOBE Apps Service"; + exit_callback_.Run(Result::kNotApplicable); + } + + if (app_infos.empty()) { + LOG(ERROR) << "Empty set of apps received from the server"; + exit_callback_.Run(Result::kNotApplicable); + } + + if (use_cases.empty()) { + LOG(ERROR) << "Empty set of use-cases received from the server"; + exit_callback_.Run(Result::kNotApplicable); + } + + // Save locally into the screen class to retrieve data needed for the + // installation after the user's selection. + app_infos_ = app_infos; + + // This code performs the following steps to prepare recommended app data for + // the WebUI: + // + // 1. Loads Selected Use Cases: + // - Retrieves the user's selected device use case IDs from their + // preferences. + // - Sorts them according to the server-defined order for consistent + // display and prioritization. + // - If no use cases are selected, inserts a special "zero use cases + // selected" use case as the first element. + // + // 2. Maps Apps to Use Cases: + // - Creates a map (`apps_to_use_cases`) where keys are app IDs and + // values are lists of corresponding use case IDs. + // + // 3. Creates WebUI-Ready App Data: + // - Generates a final map (`apps_dict`) associating use case names + // with their lists of recommended apps. + // - Filters out duplicate apps using a set (`used_apps_uuids`) to ensure + // each app appears only once in the results. + // - If an app is associated with multiple selected use cases, the + // server-defined order determines the primary use case for display. + PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); + const base::Value::List& selected_use_cases_ids = + prefs->GetList(prefs::kOobeCategoriesSelected).Clone(); + + std::vector<OOBEDeviceUseCase> selected_use_cases; + + // Gathers selected use-cases from saved IDs and sorts them according to the + // server-side order. + // This order determines both the display sequence to the user and the + // preferred use-case for apps associated with multiple use-cases. + for (const auto& selected_use_case_id : selected_use_cases_ids) { + auto it = std::find_if( + use_cases.cbegin(), use_cases.cend(), + [&selected_use_case_id](const OOBEDeviceUseCase& use_case) { + return use_case.GetID() == selected_use_case_id.GetString(); + }); + if (it != use_cases.end()) { + selected_use_cases.push_back(*it); + } + } + + std::sort(selected_use_cases.begin(), selected_use_cases.end()); + + // Add a special use-case ID that is used specifically for the case when no + // device use-cases were selected on the previous screen. + if (selected_use_cases.empty()) { + if (use_cases.front().GetID() != kNoUseCasesSelectedIDName) { + LOG(ERROR) << "Got: " << use_cases.front().GetID() + << " use-case as zero index one, expected: " + << kNoUseCasesSelectedIDName << ", server data is malformed" + << ", skipping recommend apps screen"; + exit_callback_.Run(Result::kNotApplicable); + return; + } + selected_use_cases.emplace_back(use_cases.front()); + } + + std::unordered_map<std::string, std::vector<OOBEAppDefinition>> + apps_to_use_cases; + + for (const auto& app : app_infos) { + std::vector<std::string> tags = app.GetTags(); + // TODO: Remove this logic once server side data is finalized and updated. + // There should be no apps with zero tags, but for now we will add all such + // apps into a special "zero use-cases selected" group, which is displayed + // when user skips device-use case screen. + if (tags.empty()) { + tags.emplace_back(use_cases.front().GetID()); + } + + for (const auto& tag : tags) { + auto it = apps_to_use_cases.find(tag); + if (it == apps_to_use_cases.end()) { + apps_to_use_cases[tag] = std::vector<OOBEAppDefinition>{app}; + + } else { + it->second.emplace_back(app); + } + } + } + + // We should show app only once in the whole list even if multiple use-cases + // are attached to that app. + // We use server-side ordering to decide in which use-case app should be shown + // in case multiple attached use-cases were selected by the user. + std::unordered_set<std::string> used_apps_uuids; + + // We pass a map of use_case_name` -> list of apps to the screen's WebUI. + base::Value::Dict apps_dict; + + for (const auto& selected_use_case : selected_use_cases) { + base::Value::List apps_list; + DCHECK(apps_to_use_cases.find(selected_use_case.GetID()) != + apps_to_use_cases.end()); + for (const auto& app : apps_to_use_cases[selected_use_case.GetID()]) { + if (used_apps_uuids.find(app.GetAppGroupUUID()) != + used_apps_uuids.end()) { + continue; + } + used_apps_uuids.insert(app.GetAppGroupUUID()); + + base::Value::Dict app_dict( + base::Value::Dict() + .Set("appId", base::Value(app.GetAppGroupUUID())) + .Set("name", base::Value(app.GetName())) + // TODO: Propagate app's subtitle when it will be available on the + // server. + .Set("package_name", base::Value(app.GetPackageId()->ToString())) + .Set("icon", base::Value(app.GetIconURL())) + .Set("selected", base::Value(false))); + + apps_list.Append(std::move(app_dict)); + } + + if (!apps_list.empty()) { + // Map a name of use-case to the list of filetered apps. + apps_dict.Set(selected_use_case.GetLabel(), std::move(apps_list)); + } + } + + if (view_) { + view_->SetCategoriesAppsMapData(std::move(apps_dict)); + } +} + void PersonalizedRecommendAppsScreen::HideImpl() {} void PersonalizedRecommendAppsScreen::OnUserAction(
diff --git a/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.h b/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.h index ceb91dc..775fbf6 100644 --- a/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.h +++ b/chrome/browser/ash/login/screens/personalized_recommend_apps_screen.h
@@ -10,6 +10,8 @@ #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" +#include "chrome/browser/ash/login/oobe_apps_service/oobe_apps_discovery_service.h" +#include "chrome/browser/ash/login/oobe_apps_service/oobe_apps_types.h" #include "chrome/browser/ash/login/screens/base_screen.h" namespace ash { @@ -44,8 +46,16 @@ void HideImpl() override; void OnUserAction(const base::Value::List& args) override; + void OnResponseReceived(const std::vector<OOBEAppDefinition>& app_infos, + const std::vector<OOBEDeviceUseCase>& use_cases, + AppsFetchingResult result); + + std::vector<OOBEAppDefinition> app_infos_; + base::WeakPtr<PersonalizedRecommendAppsScreenView> view_; ScreenExitCallback exit_callback_; + + base::WeakPtrFactory<PersonalizedRecommendAppsScreen> weak_factory_{this}; }; } // namespace ash
diff --git a/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc b/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc index 5daf49bc..ab796f26 100644 --- a/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc
@@ -123,7 +123,7 @@ EXPECT_FALSE(started_); started_ = true; } - void Retry() override { NOTREACHED(); } + void Retry() override { NOTREACHED_IN_MIGRATION(); } protected: const raw_ptr<apps::RecommendAppsFetcherDelegate> delegate_;
diff --git a/chrome/browser/ash/login/ui/fake_login_display_host.cc b/chrome/browser/ash/login/ui/fake_login_display_host.cc index 090c812..373654e 100644 --- a/chrome/browser/ash/login/ui/fake_login_display_host.cc +++ b/chrome/browser/ash/login/ui/fake_login_display_host.cc
@@ -137,10 +137,6 @@ void FakeLoginDisplayHost::CancelPasswordChangedFlow() {} -void FakeLoginDisplayHost::MigrateUserData(const std::string& old_password) {} - -void FakeLoginDisplayHost::ResyncUserData() {} - bool FakeLoginDisplayHost::HandleAccelerator(LoginAcceleratorAction action) { return false; }
diff --git a/chrome/browser/ash/login/ui/fake_login_display_host.h b/chrome/browser/ash/login/ui/fake_login_display_host.h index dc5e98d..b5dd5983 100644 --- a/chrome/browser/ash/login/ui/fake_login_display_host.h +++ b/chrome/browser/ash/login/ui/fake_login_display_host.h
@@ -60,8 +60,6 @@ void SetShelfButtonsEnabled(bool enabled) override; void UpdateOobeDialogState(OobeDialogState state) override; void CancelPasswordChangedFlow() override; - void MigrateUserData(const std::string& old_password) override; - void ResyncUserData() override; bool HandleAccelerator(LoginAcceleratorAction action) override; void HandleDisplayCaptivePortal() override; void UpdateAddUserButtonStatus() override;
diff --git a/chrome/browser/ash/login/ui/login_display_host.h b/chrome/browser/ash/login/ui/login_display_host.h index bd2e84e..0edf00d9 100644 --- a/chrome/browser/ash/login/ui/login_display_host.h +++ b/chrome/browser/ash/login/ui/login_display_host.h
@@ -196,14 +196,6 @@ // Cancels current password changed flow. virtual void CancelPasswordChangedFlow() = 0; - // Decrypt cryptohome using user provided `old_password` and migrate to new - // password. - virtual void MigrateUserData(const std::string& old_password) = 0; - - // Ignore password change, remove existing cryptohome and force full sync of - // user data. - virtual void ResyncUserData() = 0; - // Handles an accelerator action. // Returns `true` if the accelerator was handled. virtual bool HandleAccelerator(LoginAcceleratorAction action) = 0;
diff --git a/chrome/browser/ash/login/ui/login_display_host_common.cc b/chrome/browser/ash/login/ui/login_display_host_common.cc index 93c0b13..a4aa6317e 100644 --- a/chrome/browser/ash/login/ui/login_display_host_common.cc +++ b/chrome/browser/ash/login/ui/login_display_host_common.cc
@@ -449,18 +449,6 @@ OnCancelPasswordChangedFlow(); } -void LoginDisplayHostCommon::MigrateUserData(const std::string& old_password) { - if (GetExistingUserController()) { - GetExistingUserController()->MigrateUserData(old_password); - } -} - -void LoginDisplayHostCommon::ResyncUserData() { - if (GetExistingUserController()) { - GetExistingUserController()->ResyncUserData(); - } -} - bool LoginDisplayHostCommon::HandleAccelerator(LoginAcceleratorAction action) { if (action == LoginAcceleratorAction::kShowFeedback) { login_feedback_ = std::make_unique<LoginFeedback>(
diff --git a/chrome/browser/ash/login/ui/login_display_host_common.h b/chrome/browser/ash/login/ui/login_display_host_common.h index 119c098..3cc4410 100644 --- a/chrome/browser/ash/login/ui/login_display_host_common.h +++ b/chrome/browser/ash/login/ui/login_display_host_common.h
@@ -62,8 +62,6 @@ const AccountId& account_id, const std::optional<user_manager::UserType>& user_type) final; void CancelPasswordChangedFlow() final; - void MigrateUserData(const std::string& old_password) final; - void ResyncUserData() final; void AddWizardCreatedObserverForTests( base::RepeatingClosure on_created) final; base::WeakPtr<quick_start::TargetDeviceBootstrapController>
diff --git a/chrome/browser/ash/login/ui/mock_login_display_host.h b/chrome/browser/ash/login/ui/mock_login_display_host.h index 89bd07e..f6e993c2 100644 --- a/chrome/browser/ash/login/ui/mock_login_display_host.h +++ b/chrome/browser/ash/login/ui/mock_login_display_host.h
@@ -70,8 +70,6 @@ (const AccountId&, const std::optional<user_manager::UserType>&), (override)); MOCK_METHOD(void, CancelPasswordChangedFlow, (), (override)); - MOCK_METHOD(void, MigrateUserData, (const std::string&), (override)); - MOCK_METHOD(void, ResyncUserData, (), (override)); MOCK_METHOD(bool, HandleAccelerator, (LoginAcceleratorAction action),
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index 23fc2653..1109167 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -101,8 +101,6 @@ #include "chrome/browser/ash/login/screens/osauth/cryptohome_recovery_setup_screen.h" #include "chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h" #include "chrome/browser/ash/login/screens/osauth/factor_setup_success_screen.h" -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h" -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h" #include "chrome/browser/ash/login/screens/osauth/local_data_loss_warning_screen.h" #include "chrome/browser/ash/login/screens/osauth/local_password_setup_screen.h" #include "chrome/browser/ash/login/screens/osauth/osauth_error_screen.h" @@ -182,7 +180,6 @@ #include "chrome/browser/ui/webui/ash/login/family_link_notice_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/fingerprint_setup_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_info_screen_handler.h" -#include "chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gesture_navigation_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/guest_tos_screen_handler.h" @@ -379,7 +376,6 @@ bool IsContextNeededForScreen(OobeScreenId screen_id) { return screen_id == SamlConfirmPasswordView::kScreenId || screen_id == CryptohomeRecoveryScreenView::kScreenId || - screen_id == GaiaPasswordChangedView::kScreenId || screen_id == LocalDataLossWarningScreenView::kScreenId; } @@ -840,11 +836,6 @@ append(std::make_unique<InstallAttributesErrorScreen>( oobe_ui->GetView<InstallAttributesErrorScreenHandler>()->AsWeakPtr())); - append(std::make_unique<GaiaPasswordChangedScreen>( - base::BindRepeating(&WizardController::OnPasswordChangeScreenExit, - weak_factory_.GetWeakPtr()), - oobe_ui->GetView<GaiaPasswordChangedScreenHandler>()->AsWeakPtr())); - append(std::make_unique<FamilyLinkNoticeScreen>( oobe_ui->GetView<FamilyLinkNoticeScreenHandler>()->AsWeakPtr(), base::BindRepeating(&WizardController::OnFamilyLinkNoticeScreenExit, @@ -1070,13 +1061,6 @@ GetLoginDisplayHost()->StartSignInScreen(); } -// TODO(b/315829727): remove now unused codepath. -void WizardController::ShowGaiaPasswordChangedScreen( - std::unique_ptr<UserContext> user_context) { - wizard_context_->user_context = std::move(user_context); - SetCurrentScreen(GetScreen<GaiaPasswordChangedScreen>()); -} - void WizardController::ShowGaiaInfoScreen() { SetCurrentScreen(GetScreen(GaiaInfoScreenView::kScreenId)); } @@ -1596,48 +1580,6 @@ } } -void WizardController::OnPasswordChangeLegacyScreenExit( - GaiaPasswordChangedScreenLegacy::Result result) { - OnScreenExit(GaiaPasswordChangedView::kScreenId, - GaiaPasswordChangedScreenLegacy::GetResultString(result)); - switch (result) { - case GaiaPasswordChangedScreenLegacy::Result::CANCEL: - LoginDisplayHost::default_host()->CancelPasswordChangedFlow(); - break; - case GaiaPasswordChangedScreenLegacy::Result::RESYNC: - LoginDisplayHost::default_host()->ResyncUserData(); - break; - case GaiaPasswordChangedScreenLegacy::Result::MIGRATE: - NOTREACHED_IN_MIGRATION(); - } -} - -void WizardController::OnPasswordChangeScreenExit( - GaiaPasswordChangedScreen::Result result) { - OnScreenExit(GaiaPasswordChangedView::kScreenId, - GaiaPasswordChangedScreen::GetResultString(result)); - switch (result) { - case GaiaPasswordChangedScreen::Result::CANCEL: - LoginDisplayHost::default_host()->CancelPasswordChangedFlow(); - break; - case GaiaPasswordChangedScreen::Result::CONTINUE_LOGIN: - ash::LoginDisplayHost::default_host() - ->GetExistingUserController() - ->LoginAuthenticated(std::move(wizard_context_->user_context)); - break; - case GaiaPasswordChangedScreen::Result::RECREATE_USER: { - std::unique_ptr<UserContext> context = - std::move(wizard_context_->user_context); - ash::LoginDisplayHost::default_host()->CompleteLogin(*context); - break; - } - case GaiaPasswordChangedScreen::Result::CRYPTOHOME_ERROR: - // TODO(b/239420684): Send an error to the UI. - NOTREACHED_IN_MIGRATION(); - LoginDisplayHost::default_host()->CancelPasswordChangedFlow(); - } -} - void WizardController::OnEduCoexistenceLoginScreenExit( EduCoexistenceLoginScreen::Result result) { OnScreenExit(EduCoexistenceLoginScreen::kScreenId, @@ -3223,7 +3165,6 @@ ShowLocalPasswordSetupScreen(); } else if (screen_id == TpmErrorView::kScreenId || screen_id == InstallAttributesErrorView::kScreenId || - screen_id == GaiaPasswordChangedView::kScreenId || screen_id == FamilyLinkNoticeView::kScreenId || screen_id == GaiaView::kScreenId || screen_id == UserCreationView::kScreenId ||
diff --git a/chrome/browser/ash/login/wizard_controller.h b/chrome/browser/ash/login/wizard_controller.h index 7d8ffcb45b..c9dd83c 100644 --- a/chrome/browser/ash/login/wizard_controller.h +++ b/chrome/browser/ash/login/wizard_controller.h
@@ -62,8 +62,6 @@ #include "chrome/browser/ash/login/screens/osauth/cryptohome_recovery_setup_screen.h" #include "chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h" #include "chrome/browser/ash/login/screens/osauth/factor_setup_success_screen.h" -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h" -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h" #include "chrome/browser/ash/login/screens/osauth/local_data_loss_warning_screen.h" #include "chrome/browser/ash/login/screens/osauth/local_password_setup_screen.h" #include "chrome/browser/ash/login/screens/osauth/osauth_error_screen.h" @@ -341,8 +339,6 @@ void ShowChoobeScreen(); void ShowTouchpadScrollScreen(); void ShowDisplaySizeScreen(); - // TODO(b/315829727): remove now unused codepath. - void ShowGaiaPasswordChangedScreen(std::unique_ptr<UserContext> user_context); void ShowDrivePinningScreen(); void ShowGaiaInfoScreen(); void ShowAddChildScreen(); @@ -443,9 +439,6 @@ void OnFamilyLinkNoticeScreenExit(FamilyLinkNoticeScreen::Result result); void OnOnlineAuthenticationScreenExit(OnlineAuthenticationScreen::Result); void OnUserAllowlistCheckScreenExit(UserAllowlistCheckScreen::Result); - void OnPasswordChangeLegacyScreenExit( - GaiaPasswordChangedScreenLegacy::Result result); - void OnPasswordChangeScreenExit(GaiaPasswordChangedScreen::Result result); void OnSignInFatalErrorScreenExit(); void OnEduCoexistenceLoginScreenExit( EduCoexistenceLoginScreen::Result result);
diff --git a/chrome/browser/ash/notifications/gnubby_notification.cc b/chrome/browser/ash/notifications/gnubby_notification.cc index bb1dcf9..b3e6ce3 100644 --- a/chrome/browser/ash/notifications/gnubby_notification.cc +++ b/chrome/browser/ash/notifications/gnubby_notification.cc
@@ -6,6 +6,7 @@ #include <string> +#include "ash/public/cpp/message_center/oobe_notification_constants.h" #include "ash/public/cpp/notification_utils.h" #include "base/location.h" #include "chrome/browser/notifications/notification_display_service.h" @@ -47,9 +48,8 @@ message_center::SystemNotificationWarningLevel::NORMAL; GnubbyNotification::notification_prompt_ = ash::CreateSystemNotificationPtr( - message_center::NOTIFICATION_TYPE_SIMPLE, - GnubbyNotification::kNotificationID, title, message, std::u16string(), - GURL(), message_center::NotifierId(), + message_center::NOTIFICATION_TYPE_SIMPLE, kOOBEGnubbyNotificationId, + title, message, std::u16string(), GURL(), message_center::NotifierId(), message_center::RichNotificationData(), new message_center::HandleNotificationClickDelegate( base::BindRepeating(&GnubbyNotification::DismissNotification, @@ -75,8 +75,7 @@ void GnubbyNotification::DismissNotification() { GnubbyNotification::notificationActive = false; - SystemNotificationHelper::GetInstance()->Close( - GnubbyNotification::kNotificationID); + SystemNotificationHelper::GetInstance()->Close(kOOBEGnubbyNotificationId); } } // namespace ash
diff --git a/chrome/browser/ash/notifications/gnubby_notification.h b/chrome/browser/ash/notifications/gnubby_notification.h index 8bac71b..59f0c2bb 100644 --- a/chrome/browser/ash/notifications/gnubby_notification.h +++ b/chrome/browser/ash/notifications/gnubby_notification.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_ASH_NOTIFICATIONS_GNUBBY_NOTIFICATION_H_ #define CHROME_BROWSER_ASH_NOTIFICATIONS_GNUBBY_NOTIFICATION_H_ +#include "ash/public/cpp/message_center/oobe_notification_constants.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/notifications/notification_display_service.h" @@ -42,7 +43,6 @@ private: std::unique_ptr<message_center::Notification> notification_prompt_; std::unique_ptr<base::OneShotTimer> update_dismiss_notification_timer_; - const std::string kNotificationID = "gnubby_notification"; bool notificationActive = false; base::WeakPtrFactory<GnubbyNotification> weak_ptr_factory_{this};
diff --git a/chrome/browser/ash/policy/core/DEPS b/chrome/browser/ash/policy/core/DEPS index c353d19..9bcb2f27 100644 --- a/chrome/browser/ash/policy/core/DEPS +++ b/chrome/browser/ash/policy/core/DEPS
@@ -27,7 +27,7 @@ "+chrome/browser/ash/policy/external_data", "+chrome/browser/ash/policy/handlers", "+chrome/browser/ash/policy/invalidation", - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", "+chrome/browser/ash/policy/login", "+chrome/browser/ash/policy/networking", "+chrome/browser/ash/policy/off_hours",
diff --git a/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash.cc b/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash.cc index 98c9c51a..01152840 100644 --- a/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash.cc +++ b/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash.cc
@@ -27,10 +27,10 @@ #include "chrome/browser/ash/login/users/affiliation.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/core/policy_oauth2_token_fetcher.h" -#include "chrome/browser/ash/policy/local_user_files/local_files_cleanup.h" #include "chrome/browser/ash/policy/login/wildcard_login_checker.h" #include "chrome/browser/ash/policy/remote_commands/user_commands_factory_ash.h" #include "chrome/browser/ash/policy/reporting/arc_app_install_event_log_uploader.h" +#include "chrome/browser/ash/policy/skyvault/local_files_cleanup.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/enterprise/reporting/report_scheduler_desktop.h"
diff --git a/chrome/browser/ash/policy/handlers/DEPS b/chrome/browser/ash/policy/handlers/DEPS index 021c4c09..372275d 100644 --- a/chrome/browser/ash/policy/handlers/DEPS +++ b/chrome/browser/ash/policy/handlers/DEPS
@@ -27,7 +27,7 @@ "+chrome/browser/ash/notifications", "+chrome/browser/ash/plugin_vm", "+chrome/browser/ash/policy/core", - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", "+chrome/browser/ash/policy/login", "+chrome/browser/ash/profiles", "+chrome/browser/ash/settings",
diff --git a/chrome/browser/ash/policy/handlers/screen_capture_location_policy_handler.cc b/chrome/browser/ash/policy/handlers/screen_capture_location_policy_handler.cc index 35d4f80..0c1c101f 100644 --- a/chrome/browser/ash/policy/handlers/screen_capture_location_policy_handler.cc +++ b/chrome/browser/ash/policy/handlers/screen_capture_location_policy_handler.cc
@@ -9,7 +9,7 @@ #include "ash/constants/ash_pref_names.h" #include "base/values.h" -#include "chrome/browser/ash/policy/local_user_files/file_location_utils.h" +#include "chrome/browser/ash/policy/skyvault/file_location_utils.h" #include "chrome/common/chrome_features.h" #include "components/policy/core/browser/policy_error_map.h" #include "components/policy/core/common/policy_map.h"
diff --git a/chrome/browser/ash/policy/local_user_files/DEPS b/chrome/browser/ash/policy/skyvault/DEPS similarity index 95% rename from chrome/browser/ash/policy/local_user_files/DEPS rename to chrome/browser/ash/policy/skyvault/DEPS index 21fa8891..f7dfece0 100644 --- a/chrome/browser/ash/policy/local_user_files/DEPS +++ b/chrome/browser/ash/policy/skyvault/DEPS
@@ -5,7 +5,7 @@ # This directory is in //chrome, which violates the rule above. Allow this # directory to #include its own files. - "+chrome/browser/ash/policy/local_user_files", + "+chrome/browser/ash/policy/skyvault", # Existing dependencies within //chrome. There is an active effort to # refactor //chrome/browser/ash to break these dependencies; see b/332804822.
diff --git a/chrome/browser/ash/policy/local_user_files/OWNERS b/chrome/browser/ash/policy/skyvault/OWNERS similarity index 100% rename from chrome/browser/ash/policy/local_user_files/OWNERS rename to chrome/browser/ash/policy/skyvault/OWNERS
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.cc b/chrome/browser/ash/policy/skyvault/drive_upload_observer.cc similarity index 98% rename from chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.cc rename to chrome/browser/ash/policy/skyvault/drive_upload_observer.cc index 69b8f6e7..e22eccd 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.cc +++ b/chrome/browser/ash/policy/skyvault/drive_upload_observer.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/ui/webui/ash/cloud_upload/drive_upload_observer.h" +#include "chrome/browser/ash/policy/skyvault/drive_upload_observer.h" #include "chrome/browser/ash/file_manager/delete_io_task.h" #include "chrome/browser/ash/file_manager/fileapi_util.h"
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.h b/chrome/browser/ash/policy/skyvault/drive_upload_observer.h similarity index 94% rename from chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.h rename to chrome/browser/ash/policy/skyvault/drive_upload_observer.h index 1e1ad5e..9e9bd02 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer.h +++ b/chrome/browser/ash/policy/skyvault/drive_upload_observer.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_UI_WEBUI_ASH_CLOUD_UPLOAD_DRIVE_UPLOAD_OBSERVER_H_ -#define CHROME_BROWSER_UI_WEBUI_ASH_CLOUD_UPLOAD_DRIVE_UPLOAD_OBSERVER_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_DRIVE_UPLOAD_OBSERVER_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_DRIVE_UPLOAD_OBSERVER_H_ #include "base/files/file_path.h" #include "base/functional/callback.h" @@ -111,4 +111,4 @@ } // namespace ash::cloud_upload -#endif // CHROME_BROWSER_UI_WEBUI_ASH_CLOUD_UPLOAD_DRIVE_UPLOAD_OBSERVER_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_DRIVE_UPLOAD_OBSERVER_H_
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer_browsertest.cc b/chrome/browser/ash/policy/skyvault/drive_upload_observer_browsertest.cc similarity index 99% rename from chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer_browsertest.cc rename to chrome/browser/ash/policy/skyvault/drive_upload_observer_browsertest.cc index 1107051..800df121 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_observer_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/drive_upload_observer_browsertest.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/ui/webui/ash/cloud_upload/drive_upload_observer.h" +#include "chrome/browser/ash/policy/skyvault/drive_upload_observer.h" #include "base/files/file_util.h" #include "base/path_service.h"
diff --git a/chrome/browser/ash/policy/local_user_files/file_location_utils.cc b/chrome/browser/ash/policy/skyvault/file_location_utils.cc similarity index 95% rename from chrome/browser/ash/policy/local_user_files/file_location_utils.cc rename to chrome/browser/ash/policy/skyvault/file_location_utils.cc index 5592618..7f7a1105 100644 --- a/chrome/browser/ash/policy/local_user_files/file_location_utils.cc +++ b/chrome/browser/ash/policy/skyvault/file_location_utils.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/ash/policy/local_user_files/file_location_utils.h" +#include "chrome/browser/ash/policy/skyvault/file_location_utils.h" #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/path_util.h" @@ -44,8 +44,8 @@ } // namespace -// The location string may have Google Drive or Microsoft Drive placeholders, but -// only in the beginning, so checking that if found - at start. +// The location string may have Google Drive or Microsoft Drive placeholders, +// but only in the beginning, so checking that if found - at start. bool IsValidLocationString(const std::string& str) { const size_t google_drive_position = str.find(kGoogleDrivePolicyVariableName); if (google_drive_position != std::string::npos &&
diff --git a/chrome/browser/ash/policy/local_user_files/file_location_utils.h b/chrome/browser/ash/policy/skyvault/file_location_utils.h similarity index 73% rename from chrome/browser/ash/policy/local_user_files/file_location_utils.h rename to chrome/browser/ash/policy/skyvault/file_location_utils.h index 9b0fb71..2f27ed5e 100644 --- a/chrome/browser/ash/policy/local_user_files/file_location_utils.h +++ b/chrome/browser/ash/policy/skyvault/file_location_utils.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_ASH_POLICY_LOCAL_USER_FILES_FILE_LOCATION_UTILS_H_ -#define CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_FILE_LOCATION_UTILS_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_FILE_LOCATION_UTILS_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_FILE_LOCATION_UTILS_H_ #include <string> @@ -20,4 +20,4 @@ } // namespace policy::local_user_files -#endif // CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_FILE_LOCATION_UTILS_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_FILE_LOCATION_UTILS_H_
diff --git a/chrome/browser/ash/policy/local_user_files/file_location_utils_browsertest.cc b/chrome/browser/ash/policy/skyvault/file_location_utils_browsertest.cc similarity index 97% rename from chrome/browser/ash/policy/local_user_files/file_location_utils_browsertest.cc rename to chrome/browser/ash/policy/skyvault/file_location_utils_browsertest.cc index d2734e24..af27701 100644 --- a/chrome/browser/ash/policy/local_user_files/file_location_utils_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/file_location_utils_browsertest.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/ash/policy/local_user_files/file_location_utils.h" +#include "chrome/browser/ash/policy/skyvault/file_location_utils.h" #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/path_util.h"
diff --git a/chrome/browser/ash/policy/local_user_files/local_files_cleanup.cc b/chrome/browser/ash/policy/skyvault/local_files_cleanup.cc similarity index 88% rename from chrome/browser/ash/policy/local_user_files/local_files_cleanup.cc rename to chrome/browser/ash/policy/skyvault/local_files_cleanup.cc index f98d839..e21102e 100644 --- a/chrome/browser/ash/policy/local_user_files/local_files_cleanup.cc +++ b/chrome/browser/ash/policy/skyvault/local_files_cleanup.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/policy/local_user_files/local_files_cleanup.h" +#include "chrome/browser/ash/policy/skyvault/local_files_cleanup.h" #include <optional> #include <string> #include "base/logging.h" #include "base/metrics/histogram_macros.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" namespace policy::local_user_files {
diff --git a/chrome/browser/ash/policy/local_user_files/local_files_cleanup.h b/chrome/browser/ash/policy/skyvault/local_files_cleanup.h similarity index 78% rename from chrome/browser/ash/policy/local_user_files/local_files_cleanup.h rename to chrome/browser/ash/policy/skyvault/local_files_cleanup.h index 7c2b5a2..b0352ed4 100644 --- a/chrome/browser/ash/policy/local_user_files/local_files_cleanup.h +++ b/chrome/browser/ash/policy/skyvault/local_files_cleanup.h
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_LOCAL_FILES_CLEANUP_H_ -#define CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_LOCAL_FILES_CLEANUP_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_LOCAL_FILES_CLEANUP_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_LOCAL_FILES_CLEANUP_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/ash/policy/local_user_files/observer.h" +#include "chrome/browser/ash/policy/skyvault/observer.h" #include "chrome/browser/chromeos/extensions/login_screen/login/cleanup/files_cleanup_handler.h" namespace policy::local_user_files { @@ -37,4 +37,4 @@ } // namespace policy::local_user_files -#endif // CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_LOCAL_FILES_CLEANUP_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_LOCAL_FILES_CLEANUP_H_
diff --git a/chrome/browser/ash/policy/local_user_files/local_files_cleanup_browsertest.cc b/chrome/browser/ash/policy/skyvault/local_files_cleanup_browsertest.cc similarity index 96% rename from chrome/browser/ash/policy/local_user_files/local_files_cleanup_browsertest.cc rename to chrome/browser/ash/policy/skyvault/local_files_cleanup_browsertest.cc index cbc25de..efd4396 100644 --- a/chrome/browser/ash/policy/local_user_files/local_files_cleanup_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/local_files_cleanup_browsertest.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/ash/policy/local_user_files/local_files_cleanup.h" +#include "chrome/browser/ash/policy/skyvault/local_files_cleanup.h" #include "base/files/file_path.h" #include "base/files/file_util.h"
diff --git a/chrome/browser/ash/policy/local_user_files/observer.cc b/chrome/browser/ash/policy/skyvault/observer.cc similarity index 92% rename from chrome/browser/ash/policy/local_user_files/observer.cc rename to chrome/browser/ash/policy/skyvault/observer.cc index 5c840be8..a76f42d 100644 --- a/chrome/browser/ash/policy/local_user_files/observer.cc +++ b/chrome/browser/ash/policy/skyvault/observer.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/ash/policy/local_user_files/observer.h" +#include "chrome/browser/ash/policy/skyvault/observer.h" #include "base/check_is_test.h" #include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/ash/policy/local_user_files/observer.h b/chrome/browser/ash/policy/skyvault/observer.h similarity index 75% rename from chrome/browser/ash/policy/local_user_files/observer.h rename to chrome/browser/ash/policy/skyvault/observer.h index 9d0a4d7..35af3bc 100644 --- a/chrome/browser/ash/policy/local_user_files/observer.h +++ b/chrome/browser/ash/policy/skyvault/observer.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_ASH_POLICY_LOCAL_USER_FILES_OBSERVER_H_ -#define CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_OBSERVER_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_OBSERVER_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_OBSERVER_H_ #include "components/prefs/pref_change_registrar.h" @@ -24,4 +24,4 @@ } // namespace policy::local_user_files -#endif // CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_OBSERVER_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_OBSERVER_H_
diff --git a/chrome/browser/ash/policy/local_user_files/observer_browsertest.cc b/chrome/browser/ash/policy/skyvault/observer_browsertest.cc similarity index 96% rename from chrome/browser/ash/policy/local_user_files/observer_browsertest.cc rename to chrome/browser/ash/policy/skyvault/observer_browsertest.cc index 1b82c4ec..16eadd3 100644 --- a/chrome/browser/ash/policy/local_user_files/observer_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/observer_browsertest.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/ash/policy/local_user_files/observer.h" +#include "chrome/browser/ash/policy/skyvault/observer.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.cc b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.cc similarity index 98% rename from chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.cc rename to chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.cc index c3ce2c7d..5326927 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.cc +++ b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.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/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.h" +#include "chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.h" #include "chrome/browser/ash/file_manager/copy_or_move_io_task.h" #include "chrome/browser/ash/file_manager/fileapi_util.h"
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.h b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.h similarity index 92% rename from chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.h rename to chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.h index f1d0c42a260..04067d5ed 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.h +++ b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.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_UI_WEBUI_ASH_CLOUD_UPLOAD_ODFS_SKYVAULT_UPLOADER_H_ -#define CHROME_BROWSER_UI_WEBUI_ASH_CLOUD_UPLOAD_ODFS_SKYVAULT_UPLOADER_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_ODFS_SKYVAULT_UPLOADER_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_ODFS_SKYVAULT_UPLOADER_H_ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" @@ -86,4 +86,4 @@ } // namespace ash::cloud_upload -#endif // CHROME_BROWSER_UI_WEBUI_ASH_CLOUD_UPLOAD_ODFS_SKYVAULT_UPLOADER_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_ODFS_SKYVAULT_UPLOADER_H_
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader_browsertest.cc b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader_browsertest.cc similarity index 98% rename from chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader_browsertest.cc rename to chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader_browsertest.cc index cb6e92dc..6ca698a 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader_browsertest.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/ui/webui/ash/cloud_upload/odfs_skyvault_uploader.h" +#include "chrome/browser/ash/policy/skyvault/odfs_skyvault_uploader.h" #include "base/files/file_util.h" #include "base/path_service.h"
diff --git a/chrome/browser/ash/policy/local_user_files/policy_utils.cc b/chrome/browser/ash/policy/skyvault/policy_utils.cc similarity index 90% rename from chrome/browser/ash/policy/local_user_files/policy_utils.cc rename to chrome/browser/ash/policy/skyvault/policy_utils.cc index 3449824..d59c286 100644 --- a/chrome/browser/ash/policy/local_user_files/policy_utils.cc +++ b/chrome/browser/ash/policy/skyvault/policy_utils.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/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "base/feature_list.h" #include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/ash/policy/local_user_files/policy_utils.h b/chrome/browser/ash/policy/skyvault/policy_utils.h similarity index 62% rename from chrome/browser/ash/policy/local_user_files/policy_utils.h rename to chrome/browser/ash/policy/skyvault/policy_utils.h index bc282a21..4899cb6 100644 --- a/chrome/browser/ash/policy/local_user_files/policy_utils.h +++ b/chrome/browser/ash/policy/skyvault/policy_utils.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_ASH_POLICY_LOCAL_USER_FILES_POLICY_UTILS_H_ -#define CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_POLICY_UTILS_H_ +#ifndef CHROME_BROWSER_ASH_POLICY_SKYVAULT_POLICY_UTILS_H_ +#define CHROME_BROWSER_ASH_POLICY_SKYVAULT_POLICY_UTILS_H_ namespace policy::local_user_files { @@ -13,4 +13,4 @@ } // namespace policy::local_user_files -#endif // CHROME_BROWSER_ASH_POLICY_LOCAL_USER_FILES_POLICY_UTILS_H_ +#endif // CHROME_BROWSER_ASH_POLICY_SKYVAULT_POLICY_UTILS_H_
diff --git a/chrome/browser/ash/policy/local_user_files/policy_utils_browsertest.cc b/chrome/browser/ash/policy/skyvault/policy_utils_browsertest.cc similarity index 97% rename from chrome/browser/ash/policy/local_user_files/policy_utils_browsertest.cc rename to chrome/browser/ash/policy/skyvault/policy_utils_browsertest.cc index c44d1a1..9cf3a8f 100644 --- a/chrome/browser/ash/policy/local_user_files/policy_utils_browsertest.cc +++ b/chrome/browser/ash/policy/skyvault/policy_utils_browsertest.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/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include <tuple>
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc index 21ce42c7..4a94ad0 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_sea_pen_provider_impl_unittest.cc
@@ -411,7 +411,7 @@ base::BindLambdaForTesting( [](std::optional<std::vector< ash::personalization_app::mojom::SeaPenThumbnailPtr>>, - manta::MantaStatusCode) { NOTREACHED(); })); + manta::MantaStatusCode) { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ("SearchWallpaper exceeded maximum text length", bad_message_observer.WaitForBadMessage())
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc index 9781ec8..98c9eb84 100644 --- a/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc
@@ -376,7 +376,8 @@ wallpaper_provider_remote()->SelectWallpaper( image_info.asset_id, /*preview_mode=*/false, - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + base::BindLambdaForTesting( + [](bool success) { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ("Invalid request to set wallpaper", bad_message_observer.WaitForBadMessage()); @@ -562,8 +563,8 @@ test_wallpaper_controller()->set_can_set_user_wallpaper(false); mojo::test::BadMessageObserver bad_message_observer; wallpaper_provider_remote()->SetDailyRefreshCollectionId( - collection_id, - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + collection_id, base::BindLambdaForTesting( + [](bool success) { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ("Invalid request to set wallpaper", bad_message_observer.WaitForBadMessage()); } @@ -817,8 +818,9 @@ // Test selecting a wallpaper before fetching the enterprise setting. wallpaper_provider_remote()->SelectGooglePhotosPhoto( "OmnisVirLupus", ash::WallpaperLayout::WALLPAPER_LAYOUT_CENTER_CROPPED, - /*preview_mode=*/false, - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + /*preview_mode=*/false, base::BindLambdaForTesting([](bool success) { + NOTREACHED_IN_MIGRATION(); + })); EXPECT_EQ( "Cannot call `SelectGooglePhotosPhoto()` without confirming that the " "Google Photos enterprise setting is enabled.", @@ -835,8 +837,9 @@ mojo::test::BadMessageObserver bad_message_observer; wallpaper_provider_remote()->SelectGooglePhotosPhoto( "OmnisVirLupus", ash::WallpaperLayout::WALLPAPER_LAYOUT_CENTER_CROPPED, - /*preview_mode=*/false, - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + /*preview_mode=*/false, base::BindLambdaForTesting([](bool success) { + NOTREACHED_IN_MIGRATION(); + })); EXPECT_EQ( "Cannot call `SelectGooglePhotosPhoto()` without confirming that the " "Google Photos enterprise setting is enabled.", @@ -848,8 +851,8 @@ // Test selecting an album before fetching the enterprise setting. mojo::test::BadMessageObserver bad_message_observer; wallpaper_provider_remote()->SelectGooglePhotosAlbum( - "OmnisVirLupus", - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + "OmnisVirLupus", base::BindLambdaForTesting( + [](bool success) { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ( "Rejected attempt to set Google Photos wallpaper while disabled via " "enterprise setting.", @@ -884,8 +887,8 @@ FetchGooglePhotosEnabled(); mojo::test::BadMessageObserver bad_message_observer; wallpaper_provider_remote()->SelectGooglePhotosAlbum( - "OmnisVirLupus", - base::BindLambdaForTesting([](bool success) { NOTREACHED(); })); + "OmnisVirLupus", base::BindLambdaForTesting( + [](bool success) { NOTREACHED_IN_MIGRATION(); })); EXPECT_EQ("Invalid request to select google photos album", bad_message_observer.WaitForBadMessage()); }
diff --git a/chrome/browser/chrome_browser_main_parts_lacros.cc b/chrome/browser/chrome_browser_main_parts_lacros.cc index 41efcbe..83205ef8 100644 --- a/chrome/browser/chrome_browser_main_parts_lacros.cc +++ b/chrome/browser/chrome_browser_main_parts_lacros.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/lacros/metrics_reporting_observer.h" #include "chrome/browser/lacros/prefs_ash_observer.h" #include "chrome/browser/metrics/metrics_reporting_state.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.h" #include "chrome/common/chrome_switches.h" #include "chromeos/lacros/dbus/lacros_dbus_helper.h" #include "chromeos/startup/browser_params_proxy.h" @@ -86,6 +87,9 @@ // Initialize TtsPlatform so that TtsPlatformImplLacros can observe the // ProfileManager for OnProfileAdded event before the profile is loaded. content::TtsPlatform::GetInstance(); + // Initialize ExtensionPrinterServiceSetupLacros so that it can observe the + // ProfileManager for OnProfileAdded event before the profile is loaded. + printing::ExtensionPrinterServiceSetupLacros::GetInstance(); } void ChromeBrowserMainPartsLacros::PostProfileInit(Profile* profile,
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 7d1bb94..56804ce 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -487,6 +487,7 @@ #include "chrome/browser/flags/android/chrome_feature_list.h" #include "chrome/browser/ui/android/tab_model/tab_model_list.h" #include "chrome/browser/ui/webid/digital_identity_safety_interstitial_bridge_android.h" +#include "chrome/browser/webid/digital_identity_provider_android.h" #include "chrome/common/chrome_descriptors.h" #include "components/browser_ui/accessibility/android/font_size_prefs_android.h" #include "components/crash/content/browser/child_exit_observer_android.h" @@ -7870,6 +7871,11 @@ base::BindOnce(&RunDigitalIdentityCallback, std::move(bridge), std::move(callback))); } + +std::unique_ptr<content::DigitalIdentityProvider> +ChromeContentBrowserClient::CreateDigitalIdentityProvider() { + return std::make_unique<DigitalIdentityProviderAndroid>(); +} #endif bool ChromeContentBrowserClient::SuppressDifferentOriginSubframeJSDialogs(
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index fc8cadd..4fda00e 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -31,6 +31,7 @@ #include "components/safe_browsing/content/browser/web_api_handshake_checker.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/content_browser_client.h" +#include "content/public/browser/digital_identity_provider.h" #include "content/public/browser/legacy_tech_cookie_issue_details.h" #include "content/public/browser/web_contents.h" #include "content/public/common/alternative_error_page_override_info.mojom-forward.h" @@ -910,6 +911,9 @@ const url::Origin& origin, bool is_only_requesting_age, DigitalIdentityInterstitialCallback callback) override; + + std::unique_ptr<content::DigitalIdentityProvider> + CreateDigitalIdentityProvider() override; #endif #if !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/component_updater/chrome_component_updater_configurator.cc b/chrome/browser/component_updater/chrome_component_updater_configurator.cc index e08f611e..763920e 100644 --- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc +++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
@@ -303,7 +303,6 @@ : std::nullopt; } -// TODO(crbug.com/40286829): Consolidate the cache path getters. std::optional<base::FilePath> ChromeConfigurator::GetBackgroundDownloaderCache() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc b/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc index b3db1dc..c470d83 100644 --- a/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc +++ b/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc
@@ -57,7 +57,7 @@ namespace component_updater { -// TODO(crbug.com/40815428): add tests for pinning enforcement. +// TODO(crbug.com/341136041): add tests for pinning enforcement. class PKIMetadataComponentUpdaterTest : public InProcessBrowserTest, public testing::WithParamInterface<CTEnforcement>,
diff --git a/chrome/browser/compose/chrome_compose_client.cc b/chrome/browser/compose/chrome_compose_client.cc index 8efdce1..b0acd79 100644 --- a/chrome/browser/compose/chrome_compose_client.cc +++ b/chrome/browser/compose/chrome_compose_client.cc
@@ -129,7 +129,8 @@ url::Origin::Create(GURL(chrome::kChromeUIUntrustedComposeUrl))) { debug_session_ = std::make_unique<ComposeSession>( &GetWebContents(), GetModelExecutor(), GetModelQualityLogsUploader(), - GetSessionId(), GetInnerTextProvider(), autofill::FieldRendererId(-1)); + GetSessionId(), GetInnerTextProvider(), autofill::FieldRendererId(-1), + this); debug_session_->set_collect_inner_text(false); debug_session_->set_fre_complete( pref_service_->GetBoolean(prefs::kPrefHasCompletedComposeFRE)); @@ -328,7 +329,7 @@ auto new_session = std::make_unique<ComposeSession>( &GetWebContents(), GetModelExecutor(), GetModelQualityLogsUploader(), GetSessionId(), GetInnerTextProvider(), - trigger_field.global_id().renderer_id, std::move(callback)); + trigger_field.global_id().renderer_id, this, std::move(callback)); current_session = new_session.get(); sessions_.insert_or_assign(active_compose_ids_.value().first, std::move(new_session)); @@ -547,6 +548,7 @@ } void ChromeComposeClient::DisableProactiveNudge() { + nudge_tracker_.OnUserDisabledNudge(/*single_site_only=*/false); proactive_nudge_enabled_.SetValue(false); } @@ -562,6 +564,7 @@ } void ChromeComposeClient::AddSiteToNeverPromptList(const url::Origin& origin) { + nudge_tracker_.OnUserDisabledNudge(/*single_site_only=*/true); ScopedDictPrefUpdate update(pref_service_, prefs::kProactiveNudgeDisabledSitesWithTime); update->Set(origin.Serialize(), base::TimeToValue(base::Time::Now())); @@ -580,6 +583,14 @@ return allow_context_menu; } +void ChromeComposeClient::OnSessionComplete( + autofill::FieldRendererId field_renderer_id, + compose::ComposeSessionCloseReason close_reason, + const compose::ComposeSessionEvents& events) { + nudge_tracker_.ComposeSessionCompleted(field_renderer_id, close_reason, + events); +} + void ChromeComposeClient::OnAfterFocusOnFormField( autofill::AutofillManager& manager, autofill::FormGlobalId form, @@ -662,6 +673,8 @@ page_ukm_tracker_ = std::make_unique<compose::PageUkmTracker>( page.GetMainDocument().GetPageUkmSourceId()); + nudge_tracker_.Clear(); + compose::ComposeTextUsageLogger::GetOrCreateForCurrentDocument( &page.GetMainDocument()); }
diff --git a/chrome/browser/compose/chrome_compose_client.h b/chrome/browser/compose/chrome_compose_client.h index 4f0effc..e0fd554 100644 --- a/chrome/browser/compose/chrome_compose_client.h +++ b/chrome/browser/compose/chrome_compose_client.h
@@ -50,6 +50,7 @@ public autofill::AutofillManager::Observer, public compose::mojom::ComposeClientUntrustedPageHandler, public compose::ProactiveNudgeTracker::Delegate, + public ComposeSession::Observer, public InnerTextProvider { public: using EntryPoint = autofill::AutofillComposeDelegate::UiEntryPoint; @@ -74,6 +75,11 @@ void OpenProactiveNudgeSettings() override; void AddSiteToNeverPromptList(const url::Origin& origin) override; + // ComposeSession::Observer: + void OnSessionComplete(autofill::FieldRendererId field_renderer_id, + compose::ComposeSessionCloseReason close_reason, + const compose::ComposeSessionEvents& events) override; + // autofill::AutofillManager::Observer: // Used to observe field focus changes so that the saved state notification // is only shown when an autofill suggestion will not be shown on another
diff --git a/chrome/browser/compose/chrome_compose_client_unittest.cc b/chrome/browser/compose/chrome_compose_client_unittest.cc index 6a335dc..5be802d 100644 --- a/chrome/browser/compose/chrome_compose_client_unittest.cc +++ b/chrome/browser/compose/chrome_compose_client_unittest.cc
@@ -9,6 +9,7 @@ #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" +#include "base/run_loop.h" #include "base/strings/utf_string_conversion_utils.h" #include "base/test/bind.h" #include "base/test/gmock_callback_support.h" @@ -19,7 +20,9 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" +#include "base/time/time.h" #include "chrome/browser/compose/compose_enabling.h" +#include "chrome/browser/segmentation_platform/segmentation_platform_service_factory.h" #include "chrome/common/compose/compose.mojom.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/browser_with_test_window_test.h" @@ -38,6 +41,8 @@ #include "components/optimization_guide/proto/features/compose.pb.h" #include "components/optimization_guide/proto/model_execution.pb.h" #include "components/optimization_guide/proto/model_quality_service.pb.h" +#include "components/segmentation_platform/public/constants.h" +#include "components/segmentation_platform/public/testing/mock_segmentation_platform_service.h" #include "components/ukm/test_ukm_recorder.h" #include "components/unified_consent/pref_names.h" #include "content/public/browser/navigation_entry.h" @@ -61,11 +66,14 @@ OptimizationGuideModelExecutionResultStreamingCallback; using optimization_guide::OptimizationGuideModelStreamingExecutionResult; using optimization_guide::StreamingResponse; +using segmentation_platform::MockSegmentationPlatformService; namespace { const uint64_t kSessionIdHigh = 1234; const uint64_t kSessionIdLow = 5678; +const segmentation_platform::TrainingRequestId kTrainingRequestId = + segmentation_platform::TrainingRequestId(456); constexpr char kTypeURL[] = "type.googleapis.com/optimization_guide.proto.ComposeResponse"; @@ -161,6 +169,15 @@ scoped_compose_enabled_ = ComposeEnabling::ScopedEnableComposeForTesting(); BrowserWithTestWindowTest::SetUp(); + segmentation_platform::SegmentationPlatformServiceFactory::GetInstance() + ->SetTestingFactory( + GetProfile(), + base::BindLambdaForTesting([](content::BrowserContext* context) { + std::unique_ptr<KeyedService> result = + std::make_unique<MockSegmentationPlatformService>(); + return result; + })); + scoped_feature_list_.InitWithFeatures( {compose::features::kEnableCompose, optimization_guide::features::kOptimizationGuideModelExecution}, @@ -211,10 +228,25 @@ LogAiDataRequest>(), nullptr)))); }))); + + ON_CALL(GetSegmentationPlatformService(), + GetClassificationResult(_, _, _, _)) + .WillByDefault(testing::WithArg<3>(testing::Invoke( + [](segmentation_platform::ClassificationResultCallback callback) { + auto result = segmentation_platform::ClassificationResult( + segmentation_platform::PredictionStatus::kSucceeded); + result.request_id = kTrainingRequestId; + result.ordered_labels = { + segmentation_platform::kComposePrmotionLabelShow}; + std::move(callback).Run(result); + }))); + test_timer_ = std::make_unique<base::ScopedMockElapsedTimersForTest>(); } void TearDown() override { + // Clear default actions for safe teardown. + testing::Mock::VerifyAndClear(&GetSegmentationPlatformService()); client_ = nullptr; scoped_feature_list_.Reset(); ukm_recorder_.reset(); @@ -327,6 +359,12 @@ field_data().set_selected_text(selection.substr(0, max_length)); } + MockSegmentationPlatformService& GetSegmentationPlatformService() { + return *static_cast<MockSegmentationPlatformService*>( + segmentation_platform::SegmentationPlatformServiceFactory:: + GetForProfile(GetProfile())); + } + protected: optimization_guide::proto::ComposePageMetadata ComposePageMetadata() { optimization_guide::proto::ComposePageMetadata page_metadata; @@ -736,6 +774,55 @@ ukm::builders::Compose_PageEvents::kProactiveNudgeShownName, 0))); } +TEST_F(ChromeComposeClientTest, TestProactiveNudgeEngagementIsRecorded) { + // Enable and trigger the proactive nudge. + compose::Config& config = compose::GetMutableConfigForTesting(); + config.proactive_nudge_enabled = true; + config.proactive_nudge_show_probability = 1.0; + config.proactive_nudge_delay = base::Microseconds(1); + config.proactive_nudge_segmentation = true; + + autofill::FormData form_data; + form_data.url = web_contents()->GetPrimaryMainFrame()->GetLastCommittedURL(); + form_data.fields = {autofill::test::CreateTestFormField( + "label0", "name0", "value0", autofill::FormControlType::kTextArea)}; + + autofill::FormFieldData selected_field_data = form_data.fields[0]; + selected_field_data.set_origin( + web_contents()->GetPrimaryMainFrame()->GetLastCommittedOrigin()); + const autofill::AutofillSuggestionTriggerSource trigger_source = + autofill::AutofillSuggestionTriggerSource::kTextFieldDidChange; + + while (!client().ShouldTriggerPopup(selected_field_data, trigger_source)) { + task_environment()->RunUntilIdle(); + } + + // Simulate clicking on the nudge to open compose. + ShowDialogAndBindMojoWithFieldData( + selected_field_data, base::NullCallback(), + autofill::AutofillComposeDelegate::UiEntryPoint::kAutofillPopup); + + base::test::TestFuture<segmentation_platform::TrainingLabels> training_labels; + EXPECT_CALL(GetSegmentationPlatformService(), + CollectTrainingData( + segmentation_platform::proto::SegmentId:: + OPTIMIZATION_TARGET_SEGMENTATION_COMPOSE_PROMOTION, + kTrainingRequestId, _, _)) + .Times(1) + .WillOnce(testing::WithArg<2>(testing::Invoke( + [&](auto labels) { training_labels.SetValue(labels); }))); + + client().CloseUI(compose::mojom::CloseReason::kInsertButton); + + // Trigger session deletion and verify that the engagement is recorded. + NavigateAndCommitActiveTab(GURL("about:blank")); + EXPECT_EQ(training_labels.Get().output_metric, + std::make_pair("Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + compose::ProactiveNudgeDerivedEngagement:: + kAcceptedComposeSuggestion))); +} + TEST_F(ChromeComposeClientTest, TestShouldTriggerProactiveNudgeDisabledUKM) { autofill::FormData form_data; form_data.url = web_contents()->GetPrimaryMainFrame()->GetLastCommittedURL();
diff --git a/chrome/browser/compose/compose_session.cc b/chrome/browser/compose/compose_session.cc index 29fdd416..ea012aa7 100644 --- a/chrome/browser/compose/compose_session.cc +++ b/chrome/browser/compose/compose_session.cc
@@ -202,6 +202,7 @@ base::Token session_id, InnerTextProvider* inner_text, autofill::FieldRendererId node_id, + Observer* observer, ComposeCallback callback) : executor_(executor), handler_receiver_(this), @@ -214,6 +215,7 @@ close_reason_(compose::ComposeSessionCloseReason::kEndedImplicitly), final_status_(optimization_guide::proto::FinalStatus::STATUS_UNSPECIFIED), web_contents_(web_contents), + observer_(observer), collect_inner_text_( base::FeatureList::IsEnabled(compose::features::kComposeInnerText)), inner_text_caller_(inner_text), @@ -261,6 +263,10 @@ std::optional<compose::EvalLocation> eval_location = compose::GetEvalLocationFromEvents(session_events_); + if (observer_) { + observer_->OnSessionComplete(node_id_, close_reason_, session_events_); + } + if (session_events_.fre_dialog_shown_count > 0 && (!fre_complete_ || session_events_.fre_completed_in_session)) { compose::LogComposeFirstRunSessionCloseReason(fre_close_reason_);
diff --git a/chrome/browser/compose/compose_session.h b/chrome/browser/compose/compose_session.h index 3aab636..34b6ab28 100644 --- a/chrome/browser/compose/compose_session.h +++ b/chrome/browser/compose/compose_session.h
@@ -76,6 +76,13 @@ // form field on which it was triggered. using ComposeCallback = base::OnceCallback<void(const std::u16string&)>; + class Observer { + public: + virtual void OnSessionComplete( + autofill::FieldRendererId node_id, + compose::ComposeSessionCloseReason close_reason, + const compose::ComposeSessionEvents& events) = 0; + }; ComposeSession( content::WebContents* web_contents, optimization_guide::OptimizationGuideModelExecutor* executor, @@ -83,6 +90,7 @@ base::Token session_id, InnerTextProvider* inner_text, autofill::FieldRendererId node_id, + Observer* observer, ComposeCallback callback = base::NullCallback()); ~ComposeSession() override; @@ -335,6 +343,8 @@ // `this`. raw_ptr<content::WebContents> web_contents_; + raw_ptr<Observer> observer_; + // A callback to Autofill that triggers filling the field. ComposeCallback callback_;
diff --git a/chrome/browser/compose/proactive_nudge_tracker.cc b/chrome/browser/compose/proactive_nudge_tracker.cc index 4467608..5ee3e82c 100644 --- a/chrome/browser/compose/proactive_nudge_tracker.cc +++ b/chrome/browser/compose/proactive_nudge_tracker.cc
@@ -4,11 +4,69 @@ #include "chrome/browser/compose/proactive_nudge_tracker.h" +#include <memory> + +#include "base/functional/callback_helpers.h" +#include "components/compose/core/browser/compose_metrics.h" #include "components/compose/core/browser/config.h" #include "components/segmentation_platform/public/constants.h" namespace compose { +// Tracks user engagement as a result of the nudge. +class ProactiveNudgeTracker::EngagementTracker { + public: + EngagementTracker( + autofill::FieldRendererId field_renderer_id, + segmentation_platform::TrainingRequestId training_request_id, + ProactiveNudgeTracker* nudge_tracker) + : field_renderer_id_(field_renderer_id), + training_request_id_(training_request_id), + nudge_tracker_(nudge_tracker) {} + EngagementTracker(const EngagementTracker&) = delete; + EngagementTracker& operator=(const EngagementTracker&) = delete; + + ~EngagementTracker() { + ReportIfFirst(ProactiveNudgeDerivedEngagement::kIgnored); + } + + void ComposeSessionCompleted(ComposeSessionCloseReason session_close_reason, + const compose::ComposeSessionEvents& events) { + if (events.inserted_results) { + ReportIfFirst( + ProactiveNudgeDerivedEngagement::kAcceptedComposeSuggestion); + } else if (events.compose_count > 0) { + ReportIfFirst( + ProactiveNudgeDerivedEngagement::kGeneratedComposeSuggestion); + } else { + ReportIfFirst(ProactiveNudgeDerivedEngagement::kOpenedComposeMinimalUse); + } + } + + void UserDisabledNudge(bool single_site_only) { + if (single_site_only) { + ReportIfFirst( + ProactiveNudgeDerivedEngagement::kNudgeDisabledOnSingleSite); + } else { + ReportIfFirst(ProactiveNudgeDerivedEngagement::kNudgeDisabledOnAllSites); + } + } + + private: + void ReportIfFirst(ProactiveNudgeDerivedEngagement engagement) { + if (reported_) { + return; + } + nudge_tracker_->CollectTrainingData(training_request_id_, engagement); + reported_ = true; + } + + bool reported_ = false; + autofill::FieldRendererId field_renderer_id_; + segmentation_platform::TrainingRequestId training_request_id_; + raw_ptr<ProactiveNudgeTracker> nudge_tracker_; +}; + ProactiveNudgeTracker::State::State() = default; ProactiveNudgeTracker::State::~State() = default; @@ -27,7 +85,11 @@ InitializationPolicy::kObservePreexistingManagers); } -ProactiveNudgeTracker::~ProactiveNudgeTracker() = default; +ProactiveNudgeTracker::~ProactiveNudgeTracker() { + // Destroy all engagement trackers first to ensure CollectTrainingData() is + // called before other parts of this class are destroyed. + engagement_trackers_.clear(); +} bool ProactiveNudgeTracker::ProactiveNudgeRequestedForFormField( const autofill::FormFieldData& field_to_track) { @@ -61,8 +123,6 @@ segmentation_platform::kComposePromotionKey, options, nullptr, base::BindOnce(&ProactiveNudgeTracker::GotClassificationResult, weak_ptr_factory_.GetWeakPtr(), state_->AsWeakPtr())); - } else { - state_->segmentation_result = true; } base::TimeDelta delay = compose::GetComposeConfig().proactive_nudge_delay; @@ -74,7 +134,7 @@ &ProactiveNudgeTracker::ShowTimerElapsed); } - if (state_->segmentation_result && state_->timer_complete) { + if (ShouldShow(*state_)) { // If the timer is 0-duration and no segmentation result is required, then // just transition to Shown state directly before returning true. state_->show_state = ShowState::kShown; @@ -83,10 +143,27 @@ return false; } +bool ProactiveNudgeTracker::ShouldShow(const State& state) { + if (!state.timer_complete) { + return false; + } + if (!compose::GetComposeConfig().proactive_nudge_segmentation) { + return true; + } + return state.segmentation_result && + state.segmentation_result->ordered_labels[0] == + segmentation_platform::kComposePrmotionLabelShow; +} + void ProactiveNudgeTracker::FocusChangedInPage() { ResetState(); } +void ProactiveNudgeTracker::Clear() { + engagement_trackers_.clear(); + ResetState(); +} + void ProactiveNudgeTracker::OnAfterFocusOnFormField( autofill::AutofillManager& manager, autofill::FormGlobalId form, @@ -127,12 +204,20 @@ void ProactiveNudgeTracker::MaybeShowProactiveNudge() { DVLOG(2) << "ProactiveNudgeTracker: MaybeShowProactiveNudge "; - if (state_ && state_->segmentation_result.value_or(false) && - state_->timer_complete) { - // Transition to the SHOWN state. - delegate_->ShowProactiveNudge(state_->form, state_->field); - state_->show_state = ShowState::kCanBeShown; + if (!state_ || !ShouldShow(*state_)) { + return; } + + // Transition to the SHOWN state. + + if (state_->segmentation_result) { + engagement_trackers_[state_->field.renderer_id] = + std::make_unique<EngagementTracker>( + state_->field.renderer_id, state_->segmentation_result->request_id, + this); + } + delegate_->ShowProactiveNudge(state_->form, state_->field); + state_->show_state = ShowState::kCanBeShown; } void ProactiveNudgeTracker::GotClassificationResult( @@ -148,14 +233,46 @@ ResetState(); return; } - state->segmentation_result = result.ordered_labels[0] == - segmentation_platform::kComposePrmotionLabelShow; + state->segmentation_result = std::move(result); + MaybeShowProactiveNudge(); } +void ProactiveNudgeTracker::CollectTrainingData( + const segmentation_platform::TrainingRequestId training_request_id, + ProactiveNudgeDerivedEngagement engagement) { + segmentation_platform::TrainingLabels training_labels; + // TODO(harringtond): Add UMA for Compose.ProactiveNudge.DerivedEngagement. + training_labels.output_metric = + std::make_pair("Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>(engagement)); + segmentation_service_->CollectTrainingData( + segmentation_platform::proto::SegmentId:: + OPTIMIZATION_TARGET_SEGMENTATION_COMPOSE_PROMOTION, + training_request_id, training_labels, base::DoNothing()); +} + bool ProactiveNudgeTracker::MatchesCurrentField(autofill::FormGlobalId form, autofill::FieldGlobalId field) { return state_ && state_->form == form && state_->field == field; } +void ProactiveNudgeTracker::ComposeSessionCompleted( + autofill::FieldRendererId field_renderer_id, + ComposeSessionCloseReason session_close_reason, + const compose::ComposeSessionEvents& events) { + auto iter = engagement_trackers_.find(field_renderer_id); + if (iter != engagement_trackers_.end()) { + iter->second->ComposeSessionCompleted(session_close_reason, events); + engagement_trackers_.erase(iter); + } +} + +void ProactiveNudgeTracker::OnUserDisabledNudge(bool single_site_only) { + for (auto& iter : engagement_trackers_) { + iter.second->UserDisabledNudge(single_site_only); + } + engagement_trackers_.clear(); +} + } // namespace compose
diff --git a/chrome/browser/compose/proactive_nudge_tracker.h b/chrome/browser/compose/proactive_nudge_tracker.h index 41e2b10..0d0f962 100644 --- a/chrome/browser/compose/proactive_nudge_tracker.h +++ b/chrome/browser/compose/proactive_nudge_tracker.h
@@ -5,14 +5,18 @@ #ifndef CHROME_BROWSER_COMPOSE_PROACTIVE_NUDGE_TRACKER_H_ #define CHROME_BROWSER_COMPOSE_PROACTIVE_NUDGE_TRACKER_H_ +#include <map> +#include <memory> #include <optional> #include <string> +#include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" #include "components/autofill/content/browser/scoped_autofill_managers_observation.h" #include "components/autofill/core/browser/ui/suggestion.h" #include "components/autofill/core/common/unique_ids.h" +#include "components/compose/core/browser/compose_metrics.h" #include "components/segmentation_platform/public/segmentation_platform_service.h" namespace compose { @@ -57,7 +61,8 @@ autofill::FormGlobalId form; autofill::FieldGlobalId field; std::u16string initial_text_value; - std::optional<bool> segmentation_result = std::nullopt; + std::optional<segmentation_platform::ClassificationResult> + segmentation_result = std::nullopt; base::OneShotTimer timer; bool timer_complete = false; @@ -88,12 +93,20 @@ void FocusChangedInPage(); + void Clear(); + + void ComposeSessionCompleted(autofill::FieldRendererId field_renderer_id, + ComposeSessionCloseReason session_close_reason, + const compose::ComposeSessionEvents& events); + void OnUserDisabledNudge(bool single_site_only); + // autofill::AutofillManager::Observer: void OnAfterFocusOnFormField(autofill::AutofillManager& manager, autofill::FormGlobalId form, autofill::FieldGlobalId field) override; private: + class EngagementTracker; bool SegmentationStateIsValid(); void ResetState(); void ShowTimerElapsed(); @@ -103,9 +116,16 @@ void MaybeShowProactiveNudge(); bool MatchesCurrentField(autofill::FormGlobalId form, autofill::FieldGlobalId field); + void CollectTrainingData( + const segmentation_platform::TrainingRequestId training_request_id, + ProactiveNudgeDerivedEngagement engagement); + bool ShouldShow(const State& state); std::unique_ptr<State> state_; + std::map<autofill::FieldRendererId, std::unique_ptr<EngagementTracker>> + engagement_trackers_; + raw_ptr<segmentation_platform::SegmentationPlatformService> segmentation_service_; raw_ptr<Delegate> delegate_;
diff --git a/chrome/browser/compose/proactive_nudge_tracker_unittest.cc b/chrome/browser/compose/proactive_nudge_tracker_unittest.cc index 4166b353..38ea9a3 100644 --- a/chrome/browser/compose/proactive_nudge_tracker_unittest.cc +++ b/chrome/browser/compose/proactive_nudge_tracker_unittest.cc
@@ -4,48 +4,69 @@ #include "chrome/browser/compose/proactive_nudge_tracker.h" +#include <memory> + #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "components/autofill/core/common/autofill_test_utils.h" #include "components/autofill/core/common/form_field_data.h" #include "components/autofill/core/common/unique_ids.h" +#include "components/compose/core/browser/compose_metrics.h" #include "components/compose/core/browser/config.h" #include "components/segmentation_platform/public/constants.h" #include "components/segmentation_platform/public/testing/mock_segmentation_platform_service.h" +#include "components/segmentation_platform/public/trigger.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using testing::_; namespace compose { +namespace { + +using base::test::TestFuture; +using testing::_; +const autofill::FieldRendererId kFieldRendererId(123); +const autofill::FieldRendererId kFieldRendererId2(4); + +segmentation_platform::TrainingRequestId TrainingRequestId( + int request_number = 0) { + return segmentation_platform::TrainingRequestId(request_number + 456); +} + +autofill::FormFieldData CreateTestFormFieldData( + autofill::FieldRendererId renderer_id = kFieldRendererId) { + autofill::FormFieldData f; + f.set_host_frame(autofill::test::MakeLocalFrameToken()); + f.set_renderer_id(renderer_id); + f.set_value(u"FormFieldDataInitialValue"); + return f; +} class MockProactiveNudgeTrackerDelegate : public ProactiveNudgeTracker::Delegate { public: MOCK_METHOD(void, ShowProactiveNudge, - (autofill::FormGlobalId, autofill::FieldGlobalId), - (override)); + (autofill::FormGlobalId, autofill::FieldGlobalId)); }; -class ProactiveNudgeTrackerTest : public testing::TestWithParam<bool> { +class ProactiveNudgeTrackerTestBase : public testing::Test { public: - ProactiveNudgeTrackerTest() = default; + ProactiveNudgeTrackerTestBase() = default; - ProactiveNudgeTrackerTest(const ProactiveNudgeTrackerTest&) = delete; - ProactiveNudgeTrackerTest& operator=(const ProactiveNudgeTrackerTest&) = - delete; + ProactiveNudgeTrackerTestBase(const ProactiveNudgeTrackerTestBase&) = delete; + ProactiveNudgeTrackerTestBase& operator=( + const ProactiveNudgeTrackerTestBase&) = delete; - ~ProactiveNudgeTrackerTest() override = default; + ~ProactiveNudgeTrackerTestBase() override = default; - void SetUp() override { - testing::TestWithParam<bool>::SetUp(); + void SetUpNudgeTrackerTest(bool use_segmentation) { compose::GetMutableConfigForTesting().proactive_nudge_segmentation = - GetParam(); + use_segmentation; nudge_tracker_ = std::make_unique<ProactiveNudgeTracker>( &segmentation_service_, &delegate_); - if (uses_segmentation()) { + if (use_segmentation) { SetSegmentationResult(); } else { EXPECT_CALL(segmentation_service(), GetClassificationResult(_, _, _, _)) @@ -54,7 +75,6 @@ } void TearDown() override { - testing::TestWithParam<bool>::TearDown(); compose::ResetConfigForTesting(); } @@ -68,21 +88,14 @@ } ProactiveNudgeTracker& nudge_tracker() { return *nudge_tracker_; } - autofill::FormFieldData CreateTestFormFieldData() { - autofill::FormFieldData f; - f.set_host_frame(autofill::test::MakeLocalFrameToken()); - f.set_renderer_id(autofill::FieldRendererId(123)); - f.set_value(u"FormFieldDataInitialValue"); - return f; - } - void SetSegmentationResult(std::string label = "Show") { ON_CALL(segmentation_service(), GetClassificationResult(_, _, _, _)) .WillByDefault(testing::WithArg<3>(testing::Invoke( - [label]( + [label, this]( segmentation_platform::ClassificationResultCallback callback) { auto result = segmentation_platform::ClassificationResult( segmentation_platform::PredictionStatus::kSucceeded); + result.request_id = TrainingRequestId(training_request_number_++); result.ordered_labels = {label}; std::move(callback).Run(result); }))); @@ -100,8 +113,6 @@ }))); } - bool uses_segmentation() { return GetParam(); } - private: base::test::SingleThreadTaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; @@ -112,6 +123,21 @@ testing::NiceMock<segmentation_platform::MockSegmentationPlatformService> segmentation_service_; std::unique_ptr<ProactiveNudgeTracker> nudge_tracker_; + int training_request_number_ = 0; +}; + +class ProactiveNudgeTrackerTest : public ProactiveNudgeTrackerTestBase, + public testing::WithParamInterface<bool> { + public: + ProactiveNudgeTrackerTest() = default; + + ~ProactiveNudgeTrackerTest() override = default; + + void SetUp() override { + ProactiveNudgeTrackerTestBase::SetUpNudgeTrackerTest(uses_segmentation()); + } + + bool uses_segmentation() { return GetParam(); } }; TEST_P(ProactiveNudgeTrackerTest, TestWait) { @@ -128,7 +154,7 @@ // Should not nudge if nudge is requested too soon. EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); if (uses_segmentation()) { EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); auto result = segmentation_platform::ClassificationResult( @@ -159,7 +185,7 @@ // Should not nudge if nudge is requested too soon. EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); EXPECT_TRUE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); } @@ -172,7 +198,7 @@ EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); nudge_tracker().FocusChangedInPage(); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); } @@ -189,7 +215,7 @@ EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field2)); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); } @@ -200,7 +226,7 @@ .Times(0); nudge_tracker().FocusChangedInPage(); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); } TEST_P(ProactiveNudgeTrackerTest, TestNoNudgeDelay) { @@ -226,7 +252,7 @@ .Times(0); EXPECT_TRUE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); // Wait just in case the timer could be pending. - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); } } @@ -243,7 +269,7 @@ .Times(uses_segmentation() ? 0 : 1); EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); - task_environment().FastForwardBy(base::Seconds(4)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); if (uses_segmentation()) { EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); @@ -258,7 +284,194 @@ nudge_tracker().ProactiveNudgeRequestedForFormField(field)); } -INSTANTIATE_TEST_SUITE_P(ProactiveNudgeTrackerTest, +INSTANTIATE_TEST_SUITE_P(, ProactiveNudgeTrackerTest, - ::testing::Bool()); + ::testing::Bool(), + [](const auto& info) { + return info.param ? "SegmentationON" + : "SegmentationOFF"; + }); + +class ProactiveNudgeTrackerDerivedEngagementTest + : public ProactiveNudgeTrackerTestBase { + public: + void SetUp() override { + ProactiveNudgeTrackerTestBase::SetUpNudgeTrackerTest(true); + } + + // Set up a scenario where the nudge is shown for a field. + TestFuture<segmentation_platform::TrainingLabels>& TriggerNudgeForField( + int request_number, + const autofill::FormFieldData& field) { + EXPECT_CALL(delegate(), + ShowProactiveNudge(field.renderer_form_id(), field.global_id())) + .Times(1); + + EXPECT_FALSE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); + task_environment().FastForwardBy(GetComposeConfig().proactive_nudge_delay); + EXPECT_TRUE(nudge_tracker().ProactiveNudgeRequestedForFormField(field)); + + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + training_labels_futures_.emplace_back(); + EXPECT_CALL(segmentation_service(), + CollectTrainingData( + segmentation_platform::proto::SegmentId:: + OPTIMIZATION_TARGET_SEGMENTATION_COMPOSE_PROMOTION, + TrainingRequestId(request_number), _, _)) + .Times(1) + .WillOnce(testing::Invoke([&](auto, auto, auto labels, auto) { + training_labels.SetValue(labels); + })); + return training_labels; + } + + // Destroy the nudge tracker. This triggers CollectTrainingData() if + // necessary. + void Reset() { SetUpNudgeTrackerTest(true); } + + private: + // Just holds memory for futures created in TriggerNudgeForField(), not for + // direct use. + std::deque<TestFuture<segmentation_platform::TrainingLabels>> + training_labels_futures_; +}; + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, NoEngagement) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + Reset(); + + EXPECT_EQ(training_labels.Get().output_metric, + std::make_pair("Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kIgnored))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, MinimalUse) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + compose::ComposeSessionEvents events; + nudge_tracker().ComposeSessionCompleted( + kFieldRendererId, ComposeSessionCloseReason::kCloseButtonPressed, events); + Reset(); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kOpenedComposeMinimalUse))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, SuggestionGenerated) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + compose::ComposeSessionEvents events; + events.compose_count = 1; + nudge_tracker().ComposeSessionCompleted( + kFieldRendererId, ComposeSessionCloseReason::kCloseButtonPressed, events); + // This test should work with or without deleting the tracker. + Reset(); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kGeneratedComposeSuggestion))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, AcceptedSuggestion) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + compose::ComposeSessionEvents events; + events.compose_count = 1; + events.inserted_results = true; + nudge_tracker().ComposeSessionCompleted( + kFieldRendererId, ComposeSessionCloseReason::kAcceptedSuggestion, events); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kAcceptedComposeSuggestion))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, + IgnoresSessionForDifferentField) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + compose::ComposeSessionEvents events; + // This one is ignored because it has the wrong field id. + nudge_tracker().ComposeSessionCompleted( + autofill::FieldRendererId(999), + ComposeSessionCloseReason::kEndedImplicitly, events); + + events.compose_count = 1; + events.inserted_results = true; + nudge_tracker().ComposeSessionCompleted( + kFieldRendererId, ComposeSessionCloseReason::kAcceptedSuggestion, events); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kAcceptedComposeSuggestion))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, TwoSessions) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels1 = + TriggerNudgeForField(0, CreateTestFormFieldData()); + TestFuture<segmentation_platform::TrainingLabels>& training_labels2 = + TriggerNudgeForField(1, CreateTestFormFieldData(kFieldRendererId2)); + compose::ComposeSessionEvents events; + events.compose_count = 1; + events.inserted_results = true; + nudge_tracker().ComposeSessionCompleted( + kFieldRendererId, ComposeSessionCloseReason::kAcceptedSuggestion, events); + Reset(); + + EXPECT_EQ( + training_labels1.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kAcceptedComposeSuggestion))); + EXPECT_EQ(training_labels2.Get().output_metric, + std::make_pair("Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kIgnored))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, NudgeDisabledSingleSite) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + nudge_tracker().OnUserDisabledNudge(/*single_site_only=*/true); + Reset(); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kNudgeDisabledOnSingleSite))); +} + +TEST_F(ProactiveNudgeTrackerDerivedEngagementTest, NudgeDisabledAllSites) { + TestFuture<segmentation_platform::TrainingLabels>& training_labels = + TriggerNudgeForField(0, CreateTestFormFieldData()); + nudge_tracker().OnUserDisabledNudge(/*single_site_only=*/false); + Reset(); + + EXPECT_EQ( + training_labels.Get().output_metric, + std::make_pair( + "Compose.ProactiveNudge.DerivedEngagement", + static_cast<base::HistogramBase::Sample>( + ProactiveNudgeDerivedEngagement::kNudgeDisabledOnAllSites))); +} + +} // namespace } // namespace compose
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index e8a77df..3bc8e61 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -604,7 +604,9 @@ bindings_->loaders_.erase(bindings_->loaders_.find(this)); } - void OnRetry(base::OnceClosure start_retry) override { NOTREACHED(); } + void OnRetry(base::OnceClosure start_retry) override { + NOTREACHED_IN_MIGRATION(); + } const int stream_id_; const raw_ptr<DevToolsUIBindings> bindings_;
diff --git a/chrome/browser/download/download_dir_policy_handler.cc b/chrome/browser/download/download_dir_policy_handler.cc index 0c85b9a7..f6f5482 100644 --- a/chrome/browser/download/download_dir_policy_handler.cc +++ b/chrome/browser/download/download_dir_policy_handler.cc
@@ -13,7 +13,7 @@ #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" -#include "chrome/browser/ash/policy/local_user_files/policy_utils.h" +#include "chrome/browser/ash/policy/skyvault/policy_utils.h" #include "chrome/browser/download/download_dir_util.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/policy/policy_path_parser.h"
diff --git a/chrome/browser/download/download_ui_model.cc b/chrome/browser/download/download_ui_model.cc index 4c82962a..020d735 100644 --- a/chrome/browser/download/download_ui_model.cc +++ b/chrome/browser/download/download_ui_model.cc
@@ -354,8 +354,8 @@ return l10n_util::GetStringFUTF16(IDS_PROMPT_DEEP_SCANNING, filename, offset); case download::DOWNLOAD_DANGER_TYPE_PROMPT_FOR_LOCAL_PASSWORD_SCANNING: - // TODO(crbug.com/40074456): Implement UX for this danger type. - return u""; + return l10n_util::GetStringFUTF16( + IDS_DOWNLOAD_LOCAL_DECRYPTION_PROMPT_ALERT, filename, offset); case download::DOWNLOAD_DANGER_TYPE_BLOCKED_SCAN_FAILED: return l10n_util::GetStringUTF16(IDS_PROMPT_DOWNLOAD_BLOCKED_SCAN_FAILED); case download::DOWNLOAD_DANGER_TYPE_DEEP_SCANNED_SAFE:
diff --git a/chrome/browser/enterprise/connectors/analysis/file_transfer_analysis_delegate.cc b/chrome/browser/enterprise/connectors/analysis/file_transfer_analysis_delegate.cc index 3a621ae..ac698ef35 100644 --- a/chrome/browser/enterprise/connectors/analysis/file_transfer_analysis_delegate.cc +++ b/chrome/browser/enterprise/connectors/analysis/file_transfer_analysis_delegate.cc
@@ -66,7 +66,7 @@ ~GetFileURLsDelegate() override = default; // RecursiveOperationDelegate: - void Run() override { NOTREACHED(); } + void Run() override { NOTREACHED_IN_MIGRATION(); } void RunRecursively() override { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); StartRecursiveOperation(root_,
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 1153d978..bc4f0733a 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -960,6 +960,8 @@ "//device/fido", "//extensions:extensions_resources", "//extensions/browser", + "//extensions/browser/api/storage:settings_namespace", + "//extensions/browser/api/storage:settings_observer", "//extensions/browser/updater", "//extensions/browser/updater:keepalive", "//extensions/buildflags",
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc index 4a96ced..a77a8810 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc
@@ -71,7 +71,7 @@ // The type of the test. Either based on Prefs or Cryptohome enum class TestType { kPrefs, kCryptohome }; -const std::string_view TestTypeStr(TestType type) { +const std::string TestTypeStr(TestType type) { switch (type) { case TestType::kPrefs: return "PrefBased"; @@ -135,13 +135,11 @@ class QuickUnlockPrivateUnitTest : public ExtensionApiUnittest, - public ::testing::WithParamInterface<std::tuple<TestType, bool>> { + public ::testing::WithParamInterface<TestType> { public: static std::string ParamInfoToString( testing::TestParamInfo<QuickUnlockPrivateUnitTest::ParamType> info) { - return base::StrCat( - {TestTypeStr(std::get<0>(info.param)), - std::get<1>(info.param) ? "AutosubmitEnabled" : "AutosubmitDisabled"}); + return TestTypeStr(info.param); } QuickUnlockPrivateUnitTest() = default; @@ -156,25 +154,13 @@ void SetUp() override { const auto param = GetParam(); - std::vector<base::test::FeatureRef> enabled_features; - std::vector<base::test::FeatureRef> disabled_features; - - // Enable/disable PIN auto submit - if (std::get<1>(param)) { - enabled_features.push_back(ash::features::kQuickUnlockPinAutosubmit); - } else { - disabled_features.push_back(ash::features::kQuickUnlockPinAutosubmit); - } - - feature_list_.InitWithFeatures(enabled_features, disabled_features); - ash::CryptohomeMiscClient::InitializeFake(); ash::UserDataAuthClient::InitializeFake(); auto* fake_userdataauth_client_testapi = ash::FakeUserDataAuthClient::TestApi::Get(); fake_userdataauth_client_testapi->set_enable_auth_check(true); - if (std::get<0>(param) == TestType::kCryptohome) { + if (param == TestType::kCryptohome) { fake_userdataauth_client_testapi->set_supports_low_entropy_credentials( true); } @@ -245,7 +231,7 @@ user_manager::FakeUserManager::GetFakeUsernameHash(account_id)); auth_token_user_context_.SetSessionLifetime( base::Time::Now() + ash::quick_unlock::AuthToken::kTokenExpiration); - if (std::get<0>(GetParam()) == TestType::kCryptohome) { + if (GetParam() == TestType::kCryptohome) { auto* fake_userdataauth_client_testapi = ash::FakeUserDataAuthClient::TestApi::Get(); @@ -609,15 +595,12 @@ return set_pin_future.Get(); } - bool IsAutosubmitFeatureEnabled() { return std::get<1>(GetParam()); } - void DisablePinByPolicy() { test_api_.reset(); test_api_ = std::make_unique<ash::quick_unlock::TestApi>( /*override_quick_unlock=*/true); } - base::test::ScopedFeatureList feature_list_; raw_ptr<sync_preferences::TestingPrefServiceSyncable, DanglingUntriaged> test_pref_service_; @@ -899,11 +882,10 @@ // Enabling a PIN will by default enable auto submit, unless it is // recommended/forced by policy to be disabled. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitLongestPossiblePin) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); SetPin("123456789012"); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 12 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 12); } // When recommended to be disabled, PIN auto submit will not be enabled when @@ -947,32 +929,30 @@ // When auto submit is enabled, it remains enabled when the PIN is changed // and the exposed length is updated. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitOnSetAndUpdate) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); SetPin("123456"); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 6 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 6); SetPin("12345678"); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 8 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 8); } // When auto submit is disabled, it remains disabled when the PIN is changed // and the exposed length remains zero. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitBehaviorWhenDisabled) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); SetPin("123456"); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 6 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 6); // Disable auto submit - EXPECT_EQ(SetPinAutosubmitEnabled("", false /*enabled*/), feature_enabled); + EXPECT_TRUE(SetPinAutosubmitEnabled("", false /*enabled*/)); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(HasUserValueForPinAutosubmitPref(), feature_enabled); + EXPECT_TRUE(HasUserValueForPinAutosubmitPref()); EXPECT_FALSE(GetAutosubmitPrefVal()); EXPECT_EQ(GetExposedPinLength(), 0); @@ -980,18 +960,16 @@ SetPin("12345678"); EXPECT_FALSE(GetAutosubmitPrefVal()); EXPECT_EQ(GetExposedPinLength(), 0); - EXPECT_EQ(HasUserValueForPinAutosubmitPref(), feature_enabled); + EXPECT_TRUE(HasUserValueForPinAutosubmitPref()); } // Disabling PIN removes the user set value for auto submit and clears // the exposed length. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitOnPinDisabled) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - SetPin("123456"); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 6 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 6); // Disable PIN ClearPin(); @@ -1003,8 +981,6 @@ // If the user has no control over the preference, the pin length is collected // upon a successful authentication attempt. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitCollectLengthOnAuthSuccess) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - // Start with MANDATORY FALSE to prevent auto enabling when setting a PIN. test_pref_service_->SetManagedPref(::prefs::kPinUnlockAutosubmitEnabled, std::make_unique<base::Value>(false)); @@ -1025,18 +1001,16 @@ // Authenticate with the correct pin. Length is exposed. EXPECT_TRUE(TryAuthenticate("123456")); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 6 : 0); + EXPECT_EQ(GetExposedPinLength(), 6); } // If the user had PIN auto submit enabled and it was forced disabled via // policy, the exposed length will be removed when the user pods are updated. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitClearLengthOnUiUpdate) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - SetPin("123456"); EXPECT_TRUE(IsPinSetInBackend()); - EXPECT_EQ(GetAutosubmitPrefVal(), feature_enabled); - EXPECT_EQ(GetExposedPinLength(), feature_enabled ? 6 : 0); + EXPECT_TRUE(GetAutosubmitPrefVal()); + EXPECT_EQ(GetExposedPinLength(), 6); // Switch to MANDATORY FALSE. test_pref_service_->SetManagedPref(::prefs::kPinUnlockAutosubmitEnabled, @@ -1051,21 +1025,11 @@ EXPECT_EQ(GetExposedPinLength(), 0); } -// Checks that the feature flag correctly prevents all actions. -TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitFeatureGuard) { - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - EXPECT_EQ(ash::features::IsPinAutosubmitFeatureEnabled(), feature_enabled); -} - // Tests that the backfill operation sets a user value for the auto submit pref // for users who have set a PIN in a version of Chrome OS that did not support // auto submit. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitBackfillDefaultPinLength) { base::HistogramTester histogram_tester; - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - if (!feature_enabled) - return; - SetPinForBackfillTests("123456"); // A successful authentication attempt will backfill the user value. @@ -1083,9 +1047,6 @@ // No backfill operation if the PIN is longer than 6 digits. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitBackfillNonDefaultPinLength) { base::HistogramTester histogram_tester; - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - if (!feature_enabled) - return; SetPinForBackfillTests("1234567"); @@ -1105,9 +1066,6 @@ // to false for enterprise users even with a default length of 6. TEST_P(QuickUnlockPrivateUnitTest, PinAutosubmitBackfillEnterprise) { base::HistogramTester histogram_tester; - const bool feature_enabled = IsAutosubmitFeatureEnabled(); - if (!feature_enabled) - return; // Enterprise users have auto submit disabled by default. test_pref_service_->SetManagedPref(::prefs::kPinUnlockAutosubmitEnabled, @@ -1127,11 +1085,10 @@ ash::quick_unlock::PinBackend::BackfillEvent::kDisabledDueToPolicy, 1); } -INSTANTIATE_TEST_SUITE_P( - StorageProviders, - QuickUnlockPrivateUnitTest, - testing::Combine(testing::Values(TestType::kPrefs, TestType::kCryptohome), - testing::Bool()), /*autosubmit*/ - QuickUnlockPrivateUnitTest::ParamInfoToString); +INSTANTIATE_TEST_SUITE_P(StorageProviders, + QuickUnlockPrivateUnitTest, + testing::Values(TestType::kPrefs, + TestType::kCryptohome), + QuickUnlockPrivateUnitTest::ParamInfoToString); } // namespace extensions
diff --git a/chrome/browser/extensions/extension_error_ui_default.cc b/chrome/browser/extensions/extension_error_ui_default.cc index d38bc7b..af95470e 100644 --- a/chrome/browser/extensions/extension_error_ui_default.cc +++ b/chrome/browser/extensions/extension_error_ui_default.cc
@@ -158,7 +158,7 @@ return {}; } - void ExecuteMenuItem(Browser* browser) override { NOTREACHED(); } + void ExecuteMenuItem(Browser* browser) override { NOTREACHED_IN_MIGRATION(); } std::u16string GetBubbleViewTitle() override { return GenerateTitle(delegate_->GetBlocklistedExtensions(),
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc index 08cfe47..67aa879 100644 --- a/chrome/browser/extensions/extension_sync_service.cc +++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -377,7 +377,8 @@ case -1: state = INSTALLED_OUTDATED; break; case 0: state = INSTALLED_MATCHING; break; case 1: state = INSTALLED_NEWER; break; - default: NOTREACHED(); + default: + NOTREACHED_IN_MIGRATION(); } }
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl.h b/chrome/browser/fast_checkout/fast_checkout_client_impl.h index a2d99a6..74a13d7 100644 --- a/chrome/browser/fast_checkout/fast_checkout_client_impl.h +++ b/chrome/browser/fast_checkout/fast_checkout_client_impl.h
@@ -116,26 +116,26 @@ CreateFastCheckoutController(); private: - friend class FastCheckoutClientImplTest; + friend class DISABLED_FastCheckoutClientImplTest; FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, DestroyingAutofillDriver_ResetsAutofillManagerPointer); FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnOptionsSelected_LocalCard_SavesFormsAndAutofillDataSelections); FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnOptionsSelected_ServerCard_SavesFormsAndAutofillDataSelections); - FRIEND_TEST_ALL_PREFIXES(FastCheckoutClientImplTest, + FRIEND_TEST_ALL_PREFIXES(DISABLED_FastCheckoutClientImplTest, OnAfterLoadedServerPredictions_FillsForms); FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnAfterDidFillAutofillFormData_SetsFillingFormsToFilledAndStops); FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnFullCardRequestSucceeded_InvokesCreditCardFormFill); FRIEND_TEST_ALL_PREFIXES( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, TryToFillForms_LocalCreditCard_ImmediatelyFillsCreditCardForm); // From autofill::PersonalDataManagerObserver.
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc index f02d68a0..7c9c285e 100644 --- a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc +++ b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc
@@ -250,9 +250,10 @@ MOCK_METHOD(void, Announce, (const std::u16string&), (override)); }; -class FastCheckoutClientImplTest : public ChromeRenderViewHostTestHarness { +class DISABLED_FastCheckoutClientImplTest + : public ChromeRenderViewHostTestHarness { public: - FastCheckoutClientImplTest() + DISABLED_FastCheckoutClientImplTest() : ChromeRenderViewHostTestHarness( base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} @@ -492,7 +493,8 @@ return FormFieldData::DeepEqual(arg, form_data); } -TEST_F(FastCheckoutClientImplTest, Start_InvalidAutofillManager_NoRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + Start_InvalidAutofillManager_NoRun) { // `FastCheckoutClient` is not running initially. EXPECT_FALSE(fast_checkout_client()->IsRunning()); @@ -507,7 +509,8 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, Start_ShouldRunReturnsInvalidData_NoRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + Start_ShouldRunReturnsInvalidData_NoRun) { ON_CALL(*validator(), ShouldRun) .WillByDefault( Return(FastCheckoutTriggerOutcome::kFailureNoValidAutofillProfile)); @@ -522,7 +525,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, Start_ShouldRunReturnsUnsupportedFile_NoRun) { ON_CALL(*validator(), ShouldRun) .WillByDefault(Return(FastCheckoutTriggerOutcome::kUnsupportedFieldType)); @@ -541,7 +544,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, Start_ShouldRunReturnsSuccess_Run) { +TEST_F(DISABLED_FastCheckoutClientImplTest, Start_ShouldRunReturnsSuccess_Run) { // `FastCheckoutClient` is not running initially. EXPECT_FALSE(fast_checkout_client()->IsRunning()); @@ -568,7 +571,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnPersonalDataChanged_StopIfInvalidPersonalData) { ON_CALL(*validator(), HasValidPersonalData) .WillByDefault( @@ -602,7 +605,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnPersonalDataChanged_UpdatesTheUIWithNewData) { ON_CALL(*validator(), HasValidPersonalData) .WillByDefault(Return(FastCheckoutTriggerOutcome::kSuccess)); @@ -641,7 +644,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, Stop_WhenIsRunning_CancelsTheRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, Stop_WhenIsRunning_CancelsTheRun) { // `FastCheckoutClient` is not running initially. EXPECT_FALSE(fast_checkout_client()->IsRunning()); EXPECT_FALSE(fast_checkout_client()->IsShowing()); @@ -667,7 +670,8 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, OnDismiss_WhenIsRunning_CancelsTheRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + OnDismiss_WhenIsRunning_CancelsTheRun) { // `FastCheckoutClient` is not running initially. EXPECT_FALSE(fast_checkout_client()->IsRunning()); @@ -687,7 +691,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, DestroyingAutofillDriver_ResetsAutofillManagerPointer) { // Set up Autofill instances so that `FastCheckoutClient::Stop(..)` will be // called when `autofill_driver` is destroyed below. `Stop(..)` is supposed to @@ -727,7 +731,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnOptionsSelected_ServerCard_SavesFormsAndAutofillDataSelections) { std::unique_ptr<autofill::FormStructure> address_form = SetUpAddressForm(); std::unique_ptr<autofill::FormStructure> credit_card_form = @@ -750,7 +754,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnOptionsSelected_LocalCard_SavesFormsAndAutofillDataSelections) { autofill::FormStructure* credit_card_form = AddFormToAutofillManagerCache(SetUpCreditCardForm()); @@ -776,7 +780,8 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, OnAfterLoadedServerPredictions_FillsForms) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + OnAfterLoadedServerPredictions_FillsForms) { std::unique_ptr<autofill::FormStructure> address_form = SetUpAddressForm(); std::unique_ptr<autofill::FormStructure> credit_card_form = SetUpCreditCardForm(); @@ -825,7 +830,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnAfterDidFillAutofillFormData_SetsFillingFormsToFilledAndStops) { autofill::FormStructure* address_form = AddFormToAutofillManagerCache(SetUpAddressForm()); @@ -906,7 +911,7 @@ Pair(Autofill_FastCheckoutFormStatus::kFormTypesName, 5)))); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnAutofillManagerReset_IsShowing_ResetsState) { OnBeforeAskForValuesToFill(); EXPECT_TRUE(fast_checkout_client()->TryToStart( @@ -923,7 +928,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnAutofillManagerReset_IsNotShowing_ResetsState) { std::unique_ptr<autofill::FormStructure> address_form = SetUpAddressForm(); @@ -936,7 +941,8 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, OnAutofillManagerDestroyed_ResetsState) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + OnAutofillManagerDestroyed_ResetsState) { OnBeforeAskForValuesToFill(); EXPECT_TRUE(fast_checkout_client()->TryToStart( GURL(kUrl), autofill::FormData(), autofill::FormFieldData(), @@ -950,7 +956,8 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, TimeoutTimer_ThirtyMinutesPassed_StopsRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, + TimeoutTimer_ThirtyMinutesPassed_StopsRun) { std::unique_ptr<autofill::FormStructure> address_form = SetUpAddressForm(); std::unique_ptr<autofill::FormStructure> credit_card_form = SetUpCreditCardForm(); @@ -966,7 +973,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, OnNavigation_OtherUrl_StopsRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, OnNavigation_OtherUrl_StopsRun) { OnBeforeAskForValuesToFill(); EXPECT_TRUE(fast_checkout_client()->TryToStart( GURL(kUrl), autofill::FormData(), autofill::FormFieldData(), @@ -980,7 +987,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnNavigation_SameUrlButNoCartOrCheckoutPage_StopsRun) { OnBeforeAskForValuesToFill(); EXPECT_TRUE(fast_checkout_client()->TryToStart( @@ -995,7 +1002,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnNavigation_SameUrlAndCartOrCheckoutPage_DoesNotStopRun) { OnBeforeAskForValuesToFill(); EXPECT_TRUE(fast_checkout_client()->TryToStart( @@ -1009,7 +1016,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, OnFullCardRequestSucceeded_InvokesCreditCardFormFill) { autofill::FormStructure* address_form = AddFormToAutofillManagerCache(SetUpAddressForm()); @@ -1043,7 +1050,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, OnFullCardRequestFailed_StopsRun) { +TEST_F(DISABLED_FastCheckoutClientImplTest, OnFullCardRequestFailed_StopsRun) { autofill::FormStructure* credit_card_form = AddFormToAutofillManagerCache(SetUpCreditCardForm()); auto card_type = autofill::CreditCard::RecordType::kFullServerCard; @@ -1059,7 +1066,7 @@ } TEST_F( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnAfterDidFillAutofillFormData_AddressForm_MakesAddressFormA11yAnnouncement) { autofill::FormStructure* address_form = AddFormToAutofillManagerCache(SetUpAddressForm()); @@ -1074,7 +1081,7 @@ } TEST_F( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnAfterDidFillAutofillFormData_EmailForm_MakesEmailFormA11yAnnouncement) { autofill::FormStructure* address_form = AddFormToAutofillManagerCache(SetUpAddressForm()); @@ -1090,7 +1097,7 @@ } TEST_F( - FastCheckoutClientImplTest, + DISABLED_FastCheckoutClientImplTest, OnAfterDidFillAutofillFormData_CreditCardForm_MakesCreditCardFormA11yAnnouncement) { autofill::FormStructure* credit_card_form = AddFormToAutofillManagerCache(SetUpCreditCardForm()); @@ -1111,7 +1118,7 @@ EXPECT_FALSE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, GetSelectedAutofillProfile_ProfileDeletedSinceSelection_StopsRun) { std::unique_ptr<autofill::FormStructure> address_form = SetUpAddressForm(); @@ -1130,7 +1137,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, GetSelectedCreditCard_CardDeletedSinceSelection_StopsRun) { std::unique_ptr<autofill::FormStructure> credit_card_form = SetUpCreditCardForm(); @@ -1153,7 +1160,7 @@ EXPECT_TRUE(fast_checkout_client()->IsNotShownYet()); } -TEST_F(FastCheckoutClientImplTest, +TEST_F(DISABLED_FastCheckoutClientImplTest, TryToFillForms_LocalCreditCard_ImmediatelyFillsCreditCardForm) { autofill::FormStructure* credit_card_form = AddFormToAutofillManagerCache(SetUpCreditCardForm());
diff --git a/chrome/browser/feedback/show_feedback_page_lacros.cc b/chrome/browser/feedback/show_feedback_page_lacros.cc index 2a27994..fc06062b 100644 --- a/chrome/browser/feedback/show_feedback_page_lacros.cc +++ b/chrome/browser/feedback/show_feedback_page_lacros.cc
@@ -43,6 +43,8 @@ return crosapi::mojom::LacrosFeedbackSource::kFeedbackSourceQuickOffice; case feedback::kFeedbackSourceAI: return crosapi::mojom::LacrosFeedbackSource::kFeedbackSourceAI; + case feedback::kFeedbackSourceLensOverlay: + return crosapi::mojom::LacrosFeedbackSource::kFeedbackSourceLensOverlay; default: LOG(ERROR) << "ShowFeedbackPage is called by unknown Lacros source: " << static_cast<int>(source);
diff --git a/chrome/browser/feedback/show_feedback_page_lacros_browsertest.cc b/chrome/browser/feedback/show_feedback_page_lacros_browsertest.cc index 6ba2859..16ccf3a8 100644 --- a/chrome/browser/feedback/show_feedback_page_lacros_browsertest.cc +++ b/chrome/browser/feedback/show_feedback_page_lacros_browsertest.cc
@@ -147,3 +147,11 @@ /*ai_metadata=*/base::Value::Dict()); histogram_tester.ExpectTotalCount("Feedback.RequestSource", 1); } + +IN_PROC_BROWSER_TEST_F(ShowFeedbackPageBrowserTest, + ShowFeedbackPageFromLensOverlay) { + base::HistogramTester histogram_tester; + histogram_tester.ExpectTotalCount("Feedback.RequestSource", 0); + ShowFeedbackPageWithFeedbackSource(feedback::kFeedbackSourceLensOverlay); + histogram_tester.ExpectTotalCount("Feedback.RequestSource", 1); +}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 01b3bd3..e148bc7 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -6182,6 +6182,11 @@ "expiry_milestone": 135 }, { + "name": "omnibox-asynchronous-view-inflation", + "owners": ["ender@google.com", "pnoland@google.com", "gangwu@google.com"], + "expiry_milestone": 135 + }, + { "name": "omnibox-calc-provider", "owners": ["manukh@chromium.org", "chrome-omnibox-team@google.com"], "expiry_milestone": 125
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 856552c..09ba22b1 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2363,6 +2363,10 @@ const char kOmniboxAnswerActionsDescription[] = "Answer Actions attaches related Action Chips to Answer suggestions."; +const char kOmniboxAsyncViewInflationName[] = "Async Omnibox view inflation"; +const char kOmniboxAsyncViewInflationDescription[] = + "Inflate Omnibox and Suggestions views off the UI thread."; + const char kOmniboxCalcProviderName[] = "Omnibox calc provider"; const char kOmniboxCalcProviderDescription[] = "When enabled, suggests recent calculator results in the omnibox.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index ef931b2..90eae95d 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1374,6 +1374,9 @@ extern const char kOmniboxAnswerActionsName[]; extern const char kOmniboxAnswerActionsDescription[]; +extern const char kOmniboxAsyncViewInflationName[]; +extern const char kOmniboxAsyncViewInflationDescription[]; + extern const char kOmniboxCalcProviderName[]; extern const char kOmniboxCalcProviderDescription[];
diff --git a/chrome/browser/lens/core/mojom/lens.mojom b/chrome/browser/lens/core/mojom/lens.mojom index 204c40f7..b05e3adb2 100644 --- a/chrome/browser/lens/core/mojom/lens.mojom +++ b/chrome/browser/lens/core/mojom/lens.mojom
@@ -10,6 +10,7 @@ import "mojo/public/mojom/base/big_string.mojom"; import "ui/gfx/geometry/mojom/geometry.mojom"; import "url/mojom/url.mojom"; +import "ui/base/mojom/window_open_disposition.mojom"; // Factory method for creating a new WebUI page handler. interface LensPageHandlerFactory { @@ -43,6 +44,10 @@ // dialog. FeedbackRequestedByOverlay(); + // When this method is called, the C++ coordinator will open the link to the + // Help Center article in a new tab. + InfoRequestedByOverlay(ui.mojom.ClickModifiers click_modifiers); + // When this method is called, the C++ coordinator sends a Lens request with // the given bounding region to the Lens servers and display results in the // Chrome side panel. The region should be normalized between 0 and 1.
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list_unittest.cc b/chrome/browser/media/webrtc/native_desktop_media_list_unittest.cc index b9be9b7..c52f9e0f 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list_unittest.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list_unittest.cc
@@ -706,7 +706,8 @@ &run_loop))); // Called upon webrtc::DesktopCapturer::CaptureFrame() call. ON_CALL(observer_, OnSourceThumbnailChanged(_)) - .WillByDefault(testing::InvokeWithoutArgs([]() { NOTREACHED(); })); + .WillByDefault( + testing::InvokeWithoutArgs([]() { NOTREACHED_IN_MIGRATION(); })); model_->StartUpdating(&observer_);
diff --git a/chrome/browser/media/webrtc/webrtc_event_log_manager_common_unittest.cc b/chrome/browser/media/webrtc/webrtc_event_log_manager_common_unittest.cc index 4b3b570..823c5f4 100644 --- a/chrome/browser/media/webrtc/webrtc_event_log_manager_common_unittest.cc +++ b/chrome/browser/media/webrtc/webrtc_event_log_manager_common_unittest.cc
@@ -329,7 +329,9 @@ EXPECT_EQ(uncompressed, expected_contents); break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } }
diff --git a/chrome/browser/metrics/structured/ash_structured_metrics_recorder.cc b/chrome/browser/metrics/structured/ash_structured_metrics_recorder.cc index e5e0243..90b60f6 100644 --- a/chrome/browser/metrics/structured/ash_structured_metrics_recorder.cc +++ b/chrome/browser/metrics/structured/ash_structured_metrics_recorder.cc
@@ -78,9 +78,6 @@ // Base class handles most of the work that is needed. StructuredMetricsRecorder::ProvideEventMetrics(uma_proto); - // Add the system profile. - ProvideSystemProfile(uma_proto.mutable_system_profile()); - // Handle External Metrics statistics. LogExternalMetricsScanInUpload(external_metrics_scans_); external_metrics_scans_ = 0; @@ -117,6 +114,13 @@ } } +void AshStructuredMetricsRecorder::ProvideLogMetadata( + ChromeUserMetricsExtension& uma_proto) { + StructuredMetricsRecorder::ProvideLogMetadata(uma_proto); + // Add the system profile. + ProvideSystemProfile(uma_proto.mutable_system_profile()); +} + void AshStructuredMetricsRecorder::OnSystemProfileInitialized() { system_profile_initialized_ = true; }
diff --git a/chrome/browser/metrics/structured/ash_structured_metrics_recorder.h b/chrome/browser/metrics/structured/ash_structured_metrics_recorder.h index 9a21159a..9c10c4cc 100644 --- a/chrome/browser/metrics/structured/ash_structured_metrics_recorder.h +++ b/chrome/browser/metrics/structured/ash_structured_metrics_recorder.h
@@ -54,6 +54,7 @@ const Event& event, const ProjectValidator& project_validator, const KeyData& key_data) override; + void ProvideLogMetadata(ChromeUserMetricsExtension& uma_proto) override; // Recorder::RecorderImpl: void OnSystemProfileInitialized() override;
diff --git a/chrome/browser/metrics/structured/ash_structured_metrics_recorder_unittest.cc b/chrome/browser/metrics/structured/ash_structured_metrics_recorder_unittest.cc index bbf76f2..7317af2 100644 --- a/chrome/browser/metrics/structured/ash_structured_metrics_recorder_unittest.cc +++ b/chrome/browser/metrics/structured/ash_structured_metrics_recorder_unittest.cc
@@ -231,6 +231,7 @@ ChromeUserMetricsExtension GetUmaProto() { ChromeUserMetricsExtension uma_proto; recorder_->ProvideEventMetrics(uma_proto); + recorder_->ProvideLogMetadata(uma_proto); Wait(); return uma_proto; }
diff --git a/chrome/browser/net/external_protocol_browsertest.cc b/chrome/browser/net/external_protocol_browsertest.cc index d5f314c6..3156ea2 100644 --- a/chrome/browser/net/external_protocol_browsertest.cc +++ b/chrome/browser/net/external_protocol_browsertest.cc
@@ -82,7 +82,7 @@ return ExternalProtocolHandler::BlockState::DONT_BLOCK; } - void BlockRequest() override { NOTREACHED(); } + void BlockRequest() override { NOTREACHED_IN_MIGRATION(); } void RunExternalProtocolDialog( const GURL& url,
diff --git a/chrome/browser/net/websocket_browsertest.cc b/chrome/browser/net/websocket_browsertest.cc index 699f156..25e2a04 100644 --- a/chrome/browser/net/websocket_browsertest.cc +++ b/chrome/browser/net/websocket_browsertest.cc
@@ -518,7 +518,7 @@ NOTREACHED_IN_MIGRATION(); } - void OnClosingHandshake() override { NOTREACHED(); } + void OnClosingHandshake() override { NOTREACHED_IN_MIGRATION(); } private: void OnDisconnect(uint32_t reason, const std::string& message) {
diff --git a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom index 6ebd11b..93c63f8 100644 --- a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom +++ b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom
@@ -4,8 +4,16 @@ module ntp.calendar.mojom; +// An event from the user's Google Calendar. +struct CalendarEvent { + // Title of event. + string title; +}; + // Browser-side handler for requests from NTP Module UI. interface GoogleCalendarPageHandler { + // Returns a list of the events on the user's Google Calendar for today. + GetEvents() => (array<CalendarEvent> events); // Dismisses module for fixed amount of time. DismissModule(); // Restores the module immediately.
diff --git a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.cc b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.cc index 1c51664..81c598a 100644 --- a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.cc +++ b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.cc
@@ -4,8 +4,11 @@ #include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h" +#include <string> #include <utility> +#include <vector> +#include "base/strings/string_number_conversions.h" #include "chrome/browser/profiles/profile.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" @@ -16,6 +19,21 @@ const char kGoogleCalendarLastDismissedTimePrefName[] = "NewTabPage.GoogleCalendar.LastDimissedTime"; +ntp::calendar::mojom::CalendarEventPtr GetFakeEvent(int index) { + ntp::calendar::mojom::CalendarEventPtr event = + ntp::calendar::mojom::CalendarEvent::New(); + event->title = "Calendar Event " + base::NumberToString(index); + return event; +} + +std::vector<ntp::calendar::mojom::CalendarEventPtr> GetFakeEvents() { + std::vector<ntp::calendar::mojom::CalendarEventPtr> events; + for (int i = 0; i < 3; ++i) { + events.push_back(GetFakeEvent(i)); + } + return events; +} + } // namespace // static @@ -37,6 +55,18 @@ GoogleCalendarPageHandler::~GoogleCalendarPageHandler() = default; +void GoogleCalendarPageHandler::GetEvents(GetEventsCallback callback) { + const std::string fake_data_param = base::GetFieldTrialParamValueByFeature( + ntp_features::kNtpCalendarModule, + ntp_features::kNtpCalendarModuleDataParam); + if (!fake_data_param.empty()) { + std::move(callback).Run(GetFakeEvents()); + } else { + std::move(callback).Run( + std::vector<ntp::calendar::mojom::CalendarEventPtr>()); + } +} + void GoogleCalendarPageHandler::DismissModule() { pref_service_->SetTime(kGoogleCalendarLastDismissedTimePrefName, base::Time::Now());
diff --git a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h index 9b8cab1..2921598 100644 --- a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h +++ b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_NEW_TAB_PAGE_MODULES_V2_CALENDAR_GOOGLE_CALENDAR_PAGE_HANDLER_H_ #include "base/memory/raw_ptr.h" +#include "base/strings/string_number_conversions.h" #include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -26,6 +27,7 @@ static void RegisterProfilePrefs(PrefRegistrySimple* registry); // ntp::calendar::mojom::GoogleCalendarPageHandler: + void GetEvents(GetEventsCallback callback) override; void DismissModule() override; void RestoreModule() override;
diff --git a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler_unittest.cc b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler_unittest.cc index 8135a879..a6c4965 100644 --- a/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler_unittest.cc +++ b/chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler_unittest.cc
@@ -4,6 +4,10 @@ #include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h" +#include <string> +#include <vector> + +#include "base/test/mock_callback.h" #include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" #include "components/search/ntp_features.h" @@ -20,9 +24,7 @@ class GoogleCalendarPageHandlerTest : public testing::Test { public: GoogleCalendarPageHandlerTest() { - feature_list_.InitWithFeatures( - /*enabled_features=*/{ntp_features::kNtpCalendarModule}, - /*disabled_features=*/{}); + feature_list_.InitAndEnableFeature(ntp_features::kNtpCalendarModule); profile_ = std::make_unique<TestingProfile>(); pref_service_ = profile_->GetPrefs(); } @@ -42,6 +44,7 @@ content::BrowserTaskEnvironment& task_environment() { return task_environment_; } + base::test::ScopedFeatureList& feature_list() { return feature_list_; } private: // NOTE: The initialization order of these members matters. @@ -65,3 +68,26 @@ EXPECT_EQ(pref_service().GetTime(kGoogleCalendarLastDismissedTimePrefName), base::Time()); } + +TEST_F(GoogleCalendarPageHandlerTest, GetFakeEvents) { + base::FieldTrialParams params; + params[ntp_features::kNtpCalendarModuleDataParam] = "fake"; + feature_list().Reset(); + feature_list().InitAndEnableFeatureWithParameters( + ntp_features::kNtpCalendarModule, params); + + std::vector<ntp::calendar::mojom::CalendarEventPtr> response; + base::MockCallback<GoogleCalendarPageHandler::GetEventsCallback> callback; + EXPECT_CALL(callback, Run(testing::_)) + .Times(1) + .WillOnce(testing::Invoke( + [&](std::vector<ntp::calendar::mojom::CalendarEventPtr> events) { + response = std::move(events); + })); + + handler().GetEvents(callback.Get()); + EXPECT_EQ(response.size(), 3u); + for (int i = 0; i < 3; ++i) { + EXPECT_EQ(response[i]->title, "Calendar Event " + base::NumberToString(i)); + } +}
diff --git a/chrome/browser/notifications/notification_common.cc b/chrome/browser/notifications/notification_common.cc index 6cd8d5b58..60157c3 100644 --- a/chrome/browser/notifications/notification_common.cc +++ b/chrome/browser/notifications/notification_common.cc
@@ -49,13 +49,13 @@ // static void NotificationCommon::OpenNotificationSettings(Profile* profile, const GURL& origin) { -// TODO(peter): Use the |origin| to direct the user to a more appropriate -// settings page to toggle permission. + // TODO(peter): Use the |origin| to direct the user to a more appropriate + // settings page to toggle permission. #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH) -// Android settings are handled through Java. Chrome OS settings are handled -// through the tray's setting panel. -NOTREACHED(); + // Android settings are handled through Java. Chrome OS settings are handled + // through the tray's setting panel. + NOTREACHED_IN_MIGRATION(); #else chrome::ScopedTabbedBrowserDisplayer browser_displayer(profile); chrome::ShowContentSettingsExceptions(browser_displayer.browser(),
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc index 37fb69de..412e1fb 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.cc +++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -70,6 +70,10 @@ #include "extensions/common/constants.h" #endif +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "base/metrics/histogram_functions.h" +#endif // IS_CHROMEOS_ASH + using content::BrowserContext; using content::BrowserThread; using content::NotificationDatabaseData; @@ -77,6 +81,22 @@ namespace { +#if BUILDFLAG(IS_CHROMEOS_ASH) + +constexpr char kNotificationResourceActionIconMemorySizeHistogram[] = + "Ash.NotificationResource.ActionIconSizeInKB"; + +constexpr char kNotificationResourceBadgeMemorySizeHistogram[] = + "Ash.NotificationResource.BadgeMemorySizeInKB"; + +constexpr char kNotificationReourceIconMemorySizeHistogram[] = + "Ash.NotificationResource.IconMemorySizeInKB"; + +constexpr char kNotificationResourceImageMemorySizeHistogram[] = + "Ash.NotificationResource.ImageMemorySizeInKB"; + +#endif // IS_CHROMEOS_ASH + // Whether a web notification should be displayed when chrome is in full // screen mode. static bool ShouldDisplayWebNotificationOnFullScreen(Profile* profile, @@ -473,14 +493,19 @@ std::optional<WebAppIconAndTitle> web_app_icon_and_title; #if BUILDFLAG(IS_CHROMEOS) web_app_icon_and_title = FindWebAppIconAndTitle(web_app_hint_url); - if (web_app_icon_and_title && notification_resources.badge.isNull()) { #if BUILDFLAG(IS_CHROMEOS_ASH) + if (web_app_icon_and_title && notification_resources.badge.isNull()) { // ChromeOS: Enables web app theme color only if monochrome web app icon // has been specified. `badge` Notifications API icons must be masked with // the accent color. optional_fields.ignore_accent_color_for_small_image = true; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) } + + base::UmaHistogramMemoryKB( + kNotificationReourceIconMemorySizeHistogram, + notification_resources.notification_icon.computeByteSize() / 1024); + +#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS) message_center::NotifierId notifier_id( @@ -509,10 +534,14 @@ message_center::FullscreenVisibility::OVER_USER); } - if (!notification_resources.image.drawsNothing()) { + if (const SkBitmap& image = notification_resources.image; + !image.drawsNothing()) { notification.set_type(message_center::NOTIFICATION_TYPE_IMAGE); - notification.SetImage( - gfx::Image::CreateFrom1xBitmap(notification_resources.image)); + notification.SetImage(gfx::Image::CreateFrom1xBitmap(image)); +#if BUILDFLAG(IS_CHROMEOS_ASH) + base::UmaHistogramMemoryKB(kNotificationResourceImageMemorySizeHistogram, + image.computeByteSize() / 1024); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } if (web_app_icon_and_title && !web_app_icon_and_title->icon.isNull()) @@ -520,9 +549,12 @@ // TODO(peter): Handle different screen densities instead of always using the // 1x bitmap - crbug.com/585815. - if (!notification_resources.badge.isNull()) { - notification.SetSmallImage( - gfx::Image::CreateFrom1xBitmap(notification_resources.badge)); + if (const SkBitmap& badge = notification_resources.badge; !badge.isNull()) { + notification.SetSmallImage(gfx::Image::CreateFrom1xBitmap(badge)); +#if BUILDFLAG(IS_CHROMEOS_ASH) + base::UmaHistogramMemoryKB(kNotificationResourceBadgeMemorySizeHistogram, + badge.computeByteSize() / 1024); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } // Developer supplied action buttons. @@ -532,8 +564,13 @@ message_center::ButtonInfo button(action->title); // TODO(peter): Handle different screen densities instead of always using // the 1x bitmap - crbug.com/585815. - button.icon = - gfx::Image::CreateFrom1xBitmap(notification_resources.action_icons[i]); + const SkBitmap& action_icon = notification_resources.action_icons[i]; + button.icon = gfx::Image::CreateFrom1xBitmap(action_icon); +#if BUILDFLAG(IS_CHROMEOS_ASH) + base::UmaHistogramMemoryKB( + kNotificationResourceActionIconMemorySizeHistogram, + action_icon.computeByteSize() / 1024); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) if (action->type == blink::mojom::NotificationActionType::TEXT) { button.placeholder = action->placeholder.value_or( l10n_util::GetStringUTF16(IDS_NOTIFICATION_REPLY_PLACEHOLDER));
diff --git a/chrome/browser/page_image_service/android/java/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridge.java b/chrome/browser/page_image_service/android/java/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridge.java index 21fa4f92..705ea4e 100644 --- a/chrome/browser/page_image_service/android/java/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridge.java +++ b/chrome/browser/page_image_service/android/java/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridge.java
@@ -60,7 +60,6 @@ /** Cleanup any cached bitmap or URLs in memory. */ public void clear() { - mSalientImageUrlCache.clear(); mImageFetcher.clear(); } @@ -126,6 +125,10 @@ && mSalientImageUrlCache.containsValue(imageUrl); } + boolean isUrlCacheEmptyForTesting() { + return mSalientImageUrlCache.isEmpty(); + } + @NativeMethods public interface Natives { long init(@JniType("Profile*") Profile profile);
diff --git a/chrome/browser/page_image_service/android/junit/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridgeUnitTest.java b/chrome/browser/page_image_service/android/junit/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridgeUnitTest.java index ad67fe6..8cba50d 100644 --- a/chrome/browser/page_image_service/android/junit/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridgeUnitTest.java +++ b/chrome/browser/page_image_service/android/junit/src/org/chromium/chrome/browser/page_image_service/ImageServiceBridgeUnitTest.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.page_image_service; +import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertTrue; import static org.mockito.ArgumentMatchers.anyLong; @@ -106,7 +107,22 @@ @Test @SmallTest public void testClear() { + mImageServiceBridge.fetchImageUrlFor(/* isAccountData= */ true, PAGE_URL, mUrlCallback); + + verify(mImageServiceBridgeJni) + .fetchImageUrlFor( + anyLong(), + eq(true), + eq(CLIENT_ID), + eq(PAGE_URL), + mUrlCallbackCaptor.capture()); + mUrlCallbackCaptor.getValue().onResult(SALIENT_IMAGE_URL); + assertFalse(mImageServiceBridge.isUrlCacheEmptyForTesting()); + + // Verifies that cleaning up the bridge deletes the cache of the image fetcher, but doesn't + // delete the cache of salient image URLs. mImageServiceBridge.clear(); verify(mImageFetcher).clear(); + assertFalse(mImageServiceBridge.isUrlCacheEmptyForTesting()); } }
diff --git a/chrome/browser/performance_manager/metrics/metrics_provider_desktop_unittest.cc b/chrome/browser/performance_manager/metrics/metrics_provider_desktop_unittest.cc index ce96e685..ce89748a 100644 --- a/chrome/browser/performance_manager/metrics/metrics_provider_desktop_unittest.cc +++ b/chrome/browser/performance_manager/metrics/metrics_provider_desktop_unittest.cc
@@ -6,13 +6,13 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" -#include "base/test/task_environment.h" #include "chrome/browser/performance_manager/public/user_tuning/user_performance_tuning_manager.h" #include "chrome/browser/performance_manager/test_support/fake_frame_throttling_delegate.h" #include "chrome/browser/performance_manager/test_support/test_user_performance_tuning_manager_environment.h" #include "components/performance_manager/public/features.h" #include "components/performance_manager/public/user_tuning/prefs.h" #include "components/prefs/testing_pref_service.h" +#include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" class PerformanceManagerMetricsProviderDesktopTest : public testing::Test { @@ -89,7 +89,7 @@ } } - base::test::TaskEnvironment task_environment_{ + content::BrowserTaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; TestingPrefServiceSimple local_state_;
diff --git a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_browsertest.cc b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_browsertest.cc index 6ac8eee..ac15748f 100644 --- a/chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_browsertest.cc +++ b/chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_browsertest.cc
@@ -127,14 +127,13 @@ // Tests SiteDataCacheFacade in different threading configurations. class SiteDataCacheFacadeBrowserTest : public InProcessBrowserTest, - public ::testing::WithParamInterface<PMThreadingConfiguration> { + public ::testing::WithParamInterface<bool> { using Super = InProcessBrowserTest; protected: SiteDataCacheFacadeBrowserTest() { - scoped_feature_list_.InitWithFeatureStates( - {{features::kRunOnMainThread, GetParam().run_on_main_thread}, - {features::kRunOnMainThreadSync, GetParam().run_on_main_thread_sync}}); + scoped_feature_list_.InitWithFeatureState(features::kRunOnMainThreadSync, + GetParam()); } void SetUpOnMainThread() override { @@ -249,18 +248,7 @@ std::optional<ClearSiteDataOnProfileDestroyed> clear_site_data_; }; -INSTANTIATE_TEST_SUITE_P( - , - SiteDataCacheFacadeBrowserTest, - ::testing::Values( - PMThreadingConfiguration{.run_on_main_thread = false, - .run_on_main_thread_sync = false}, - - PMThreadingConfiguration{.run_on_main_thread = true, - .run_on_main_thread_sync = false}, - - PMThreadingConfiguration{.run_on_main_thread = false, - .run_on_main_thread_sync = true})); +INSTANTIATE_TEST_SUITE_P(, SiteDataCacheFacadeBrowserTest, ::testing::Bool()); // TODO(crbug.com/330771327): This test is consistently failing across multiple // builders. Pre-test: Sets up state before the main test by writing some
diff --git a/chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_test_utils.cc b/chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_test_utils.cc index 3616123a..6a51c7d 100644 --- a/chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_test_utils.cc +++ b/chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_test_utils.cc
@@ -88,7 +88,7 @@ NOTREACHED_IN_MIGRATION(); } - void FinishedProcessingCheck() override { NOTREACHED(); } + void FinishedProcessingCheck() override { NOTREACHED_IN_MIGRATION(); } }; } // namespace
diff --git a/chrome/browser/printing/print_view_manager_unittest.cc b/chrome/browser/printing/print_view_manager_unittest.cc index f184e718..212083a 100644 --- a/chrome/browser/printing/print_view_manager_unittest.cc +++ b/chrome/browser/printing/print_view_manager_unittest.cc
@@ -345,7 +345,9 @@ SetupScriptedPrintPreviewCallback callback) override { NOTREACHED_IN_MIGRATION(); } - void ShowScriptedPrintPreview(bool is_modifiable) override { NOTREACHED(); } + void ShowScriptedPrintPreview(bool is_modifiable) override { + NOTREACHED_IN_MIGRATION(); + } void RequestPrintPreview( mojom::RequestPrintPreviewParamsPtr params) override { NOTREACHED_IN_MIGRATION();
diff --git a/chrome/browser/private_network_access/private_network_device_browser_test_utils.cc b/chrome/browser/private_network_access/private_network_device_browser_test_utils.cc index fda954a..440ae32 100644 --- a/chrome/browser/private_network_access/private_network_device_browser_test_utils.cc +++ b/chrome/browser/private_network_access/private_network_device_browser_test_utils.cc
@@ -31,11 +31,15 @@ delete this; } - void OnOptionAdded(size_t index) override { NOTREACHED(); } - void OnOptionRemoved(size_t index) override { NOTREACHED(); } - void OnOptionUpdated(size_t index) override { NOTREACHED(); } - void OnAdapterEnabledChanged(bool enabled) override { NOTREACHED(); } - void OnRefreshStateChanged(bool refreshing) override { NOTREACHED(); } + void OnOptionAdded(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnOptionRemoved(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnOptionUpdated(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnAdapterEnabledChanged(bool enabled) override { + NOTREACHED_IN_MIGRATION(); + } + void OnRefreshStateChanged(bool refreshing) override { + NOTREACHED_IN_MIGRATION(); + } private: std::unique_ptr<permissions::ChooserController> controller_;
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index 1f56c62..a3ff0cec 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -404,6 +404,7 @@ #include "chrome/browser/lacros/remote_apps/remote_apps_proxy_lacros_factory.h" #include "chrome/browser/speech/tts_client_factory_lacros.h" #include "chrome/browser/ui/startup/first_run_service.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h" #endif #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) @@ -1248,6 +1249,7 @@ #endif #if BUILDFLAG(IS_CHROMEOS_LACROS) TtsClientFactoryLacros::GetInstance(); + printing::ExtensionPrinterServiceProviderFactoryLacros::GetInstance(); #endif #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID) TurnSyncOnHelper::EnsureFactoryBuilt();
diff --git a/chrome/browser/promos/promos_utils.cc b/chrome/browser/promos/promos_utils.cc index 067692d..ab7697a 100644 --- a/chrome/browser/promos/promos_utils.cc +++ b/chrome/browser/promos/promos_utils.cc
@@ -92,13 +92,13 @@ } } -// RecordIOSPasswordPromoShownHistogram records which impression (count) was +// RecordIOSPromoShownHistogram records which impression (count) was // shown to the user depending on the given promo type. void RecordIOSPromoShownHistogram(IOSPromoType promo_type, int impression_count) { switch (promo_type) { case IOSPromoType::kPassword: - RecordIOSPasswordPromoShownHistogram(impression_count); + RecordIOSDesktopPasswordPromoShownHistogram(impression_count); break; // TODO(crbug.com/331408937): Add IOS Address Promo for Desktop. default:
diff --git a/chrome/browser/resources/ash/settings/BUILD.gn b/chrome/browser/resources/ash/settings/BUILD.gn index 75482b8..62e03ba 100644 --- a/chrome/browser/resources/ash/settings/BUILD.gn +++ b/chrome/browser/resources/ash/settings/BUILD.gn
@@ -227,7 +227,10 @@ "os_apps_page/app_notifications_page/app_notification_row.ts", "os_apps_page/app_notifications_page/app_notifications_manager_subpage.ts", "os_apps_page/app_notifications_page/app_notifications_subpage.ts", + "os_apps_page/app_parental_controls/app_setup_pin_dialog.ts", + "os_apps_page/app_parental_controls/app_setup_pin_keyboard.ts", "os_apps_page/app_parental_controls/app_parental_controls_subpage.ts", + "os_apps_page/app_parental_controls/app_verify_pin_dialog.ts", "os_apps_page/app_parental_controls/block_app_item.ts", "os_apps_page/manage_isolated_web_apps_page/manage_isolated_web_apps_subpage.ts", "os_apps_page/os_apps_page.ts",
diff --git a/chrome/browser/resources/ash/settings/controls/v2/settings_toggle_v2.ts b/chrome/browser/resources/ash/settings/controls/v2/settings_toggle_v2.ts index 4f0ce39..f45a71ae 100644 --- a/chrome/browser/resources/ash/settings/controls/v2/settings_toggle_v2.ts +++ b/chrome/browser/resources/ash/settings/controls/v2/settings_toggle_v2.ts
@@ -45,6 +45,12 @@ value: false, }, + /** Whether the control should represent the inverted pref value. */ + inverted: { + type: Boolean, + value: false, + }, + /** * If true, changing the control’s value will not update the pref * automatically. This allows the container to confirm the change first @@ -60,11 +66,12 @@ static get observers() { return [ - 'prefChanged_(pref.*)', + 'setToPrefValue_(pref.*)', ]; } checked: boolean; + inverted: boolean; noSetPref: boolean; override validPrefTypes: chrome.settingsPrivate.PrefType[] = [ chrome.settingsPrivate.PrefType.BOOLEAN, @@ -83,8 +90,9 @@ /** * Handle downward data binding from pref to update the toggle accordingly. */ - private prefChanged_(): void { - this.checked = this.pref!.value; + private setToPrefValue_(): void { + const currentPrefValue = this.pref!.value; + this.checked = this.inverted ? !currentPrefValue : currentPrefValue; } /** @@ -115,7 +123,8 @@ commitPrefChange(): void { // updatePrefValueFromUserAction() will ensure that the pref is defined // before committing the change. - this.updatePrefValueFromUserAction(this.checked); + this.updatePrefValueFromUserAction( + this.inverted ? !this.checked : this.checked); } /** @@ -124,7 +133,7 @@ resetToPrefValue(): void { assert(this.pref, 'resetToPrefValue() requires pref to be defined.'); - this.checked = this.pref.value; + this.setToPrefValue_(); } }
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.html b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.html new file mode 100644 index 0000000..70608aa --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.html
@@ -0,0 +1,35 @@ +<style include="settings-shared"> + #setupPinKeyboardDiv { + justify-content: center; + } + + #setupPinKeyboard { + --cr-input-placeholder-letter-spacing: normal; + } + + #pinSetupDialogSubtitle { + /* Set so the confirm dialog height matches the initial dialog height. */ + min-height: 48px; + padding-bottom: 16px; + } +</style> +<cr-dialog id="dialog" on-close="close" + close-text="$i18n{close}"> + <div slot="title">[[getTitle_(isConfirmStep_)]]</div> + <div slot="body"> + <div id="pinSetupDialogSubtitle">[[getSubtitle_(isConfirmStep_)]]</div> + <div id="setupPinKeyboardDiv" class="settings-box continuation"> + <app-setup-pin-keyboard id="setupPinKeyboard" + is-confirm-step="{{isConfirmStep_}}"> + </app-setup-pin-keyboard> + </div> + </div> + <div slot="button-container"> + <cr-button class="cancel-button" on-click="onCancelClick_"> + $i18n{cancel} + </cr-button> + <cr-button class="action-button" on-click="onPinSubmit_"> + <span>[[getContinueMessage_(isConfirmStep_)]]</span> + </cr-button> + </div> +</cr-dialog> \ No newline at end of file
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.ts b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.ts new file mode 100644 index 0000000..5996ad7 --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_dialog.ts
@@ -0,0 +1,110 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'app-setup-pin-dialog' is the dialog for setting up a PIN + * to access App Parental Controls. + */ + +import 'chrome://resources/ash/common/cr_elements/cr_button/cr_button.js'; +import 'chrome://resources/ash/common/cr_elements/cr_dialog/cr_dialog.js'; +import '../../settings_shared.css.js'; + +import {CrDialogElement} from 'chrome://resources/ash/common/cr_elements/cr_dialog/cr_dialog.js'; +import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './app_setup_pin_dialog.html.js'; +import {AppSetupPinKeyboardElement} from './app_setup_pin_keyboard.js'; + +const AppSetupPinDialogElementBase = I18nMixin(PolymerElement); + +interface AppSetupPinDialogElement { + $: { + dialog: CrDialogElement, + setupPinKeyboard: AppSetupPinKeyboardElement, + }; +} + +class AppSetupPinDialogElement extends AppSetupPinDialogElementBase { + static get is() { + return 'app-setup-pin-dialog' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + /** + * Whether the user is at the PIN confirmation step. + */ + isConfirmStep_: {type: Boolean, value: false}, + }; + } + + private isConfirmStep_: boolean; + + override connectedCallback(): void { + super.connectedCallback(); + + this.$.dialog.showModal(); + this.$.setupPinKeyboard.focus(); + } + + close(): void { + if (this.$.dialog.open) { + this.$.dialog.close(); + } + + this.$.setupPinKeyboard.resetState(); + } + + private onCancelClick_(e: Event): void { + // Stop propagation to keep the subpage from opening. + e.stopPropagation(); + this.$.setupPinKeyboard.resetState(); + this.close(); + } + + private onPinSubmit_(e: Event): void { + // TODO(b/332936223): This method currently naively switches from the + // initial screen to the submit screen. It will be updated when the + // actual PIN setup flow is implemented. + + // Stop propagation to keep the subpage from opening. + e.stopPropagation(); + if (!this.isConfirmStep_) { + this.$.setupPinKeyboard.doSubmit(); + this.isConfirmStep_ = true; + } else { + this.close(); + } + } + + private getTitle_(isConfirmStep: boolean): string { + return this.i18n( + isConfirmStep ? 'appParentalControlsConfirmPinTitle' : + 'appParentalControlsChoosePinTitle'); + } + + private getSubtitle_(isConfirmStep: boolean): string { + return isConfirmStep ? '' : + this.i18n('appParentalControlsChoosePinSubtitle'); + } + + private getContinueMessage_(isConfirmStep: boolean): string { + return this.i18n(isConfirmStep ? 'confirm' : 'continue'); + } +} + +declare global { + interface HTMLElementTagNameMap { + [AppSetupPinDialogElement.is]: AppSetupPinDialogElement; + } +} + +customElements.define(AppSetupPinDialogElement.is, AppSetupPinDialogElement);
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.html b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.html new file mode 100644 index 0000000..704c044d --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.html
@@ -0,0 +1,22 @@ +<style include="settings-shared"> + #problemDiv { + align-items: center; + display: flex; + flex-direction: row; + font-size: 10px; + height: 32px; + min-height: 0; + padding-bottom: 8px; + } + + /* Hide this using 'visibility: hidden' instead of 'hidden' so that the + dialog does not resize when there are no problems to display. */ + #problemDiv[invisible] { + visibility: hidden; + } +</style> +<pin-keyboard id="pinKeyboard" value="{{pinKeyboardValue_}}"> + <div id="problemDiv"> + <!--TODO(b/332936223): Add problem message here.--> + </div> +</pin-keyboard> \ No newline at end of file
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.ts b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.ts new file mode 100644 index 0000000..493fd33d --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_setup_pin_keyboard.ts
@@ -0,0 +1,109 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'app-setup-pin-keyboard' is the keyboard/input field for + * entering a PIN to access App Parental Controls. Used by the PIN setup + * dialog. + */ + +import 'chrome://resources/ash/common/quick_unlock/pin_keyboard.js'; +import 'chrome://resources/ash/common/cr_elements/cr_shared_vars.css.js'; +import '../../settings_shared.css.js'; + +import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; +import {PinKeyboardElement} from 'chrome://resources/ash/common/quick_unlock/pin_keyboard.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './app_setup_pin_keyboard.html.js'; + +const AppSetupPinKeyboardElementBase = I18nMixin(PolymerElement); + +export interface AppSetupPinKeyboardElement { + $: { + pinKeyboard: PinKeyboardElement, + }; +} + +export class AppSetupPinKeyboardElement extends AppSetupPinKeyboardElementBase { + static get is() { + return 'app-setup-pin-keyboard' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + /** + * Whether the user is at the PIN confirmation step. + */ + isConfirmStep: { + notify: true, + type: Boolean, + value: false, + }, + + /** + * The current PIN keyboard value. + */ + pinKeyboardValue_: { + type: String, + value: '', + }, + + /** + * Stores the initial PIN value so it can be confirmed. + */ + initialPin_: { + type: String, + value: '', + }, + }; + } + + isConfirmStep: boolean; + private pinKeyboardValue_: string; + private initialPin_: string; + + override focus(): void { + this.$.pinKeyboard.focusInput(); + } + + override connectedCallback(): void { + this.resetState(); + } + + resetState(): void { + this.initialPin_ = ''; + this.pinKeyboardValue_ = ''; + this.isConfirmStep = false; + } + + /** + * Intended to be called by the containing dialog when the user attempts + * to submit the PIN. + */ + doSubmit(): void { + // TODO(b/332936223): Implement actual PIN submission logic. + if (!this.isConfirmStep) { + this.initialPin_ = this.pinKeyboardValue_; + this.pinKeyboardValue_ = ''; + this.$.pinKeyboard.focusInput(); + this.isConfirmStep = true; + return; + } + } +} + +declare global { + interface HTMLElementTagNameMap { + [AppSetupPinKeyboardElement.is]: AppSetupPinKeyboardElement; + } +} + +customElements.define( + AppSetupPinKeyboardElement.is, AppSetupPinKeyboardElement);
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.html b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.html new file mode 100644 index 0000000..b1cb8bb --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.html
@@ -0,0 +1,64 @@ +<style include="settings-shared"> + #errorDiv { + align-items: center; + color: var(--cros-text-color-alert); + display: flex; + flex-direction: row; + /* Enough height for two rows. */ + min-height: 48px; + } + + /* Hide this using visibility: hidden instead of hidden so that the + dialog does not resize when there are no problems to display. */ + #errorDiv[invisible] { + visibility: hidden; + } + + #forgotPinLink { + margin-inline-start: 12px; + margin-top: 6px; + } + + cr-dialog [slot=button-container] { + display: flex; + justify-content: space-between; + padding-bottom: var(--cr-dialog-button-container-padding-bottom, 16px); + padding-inline-end: + var(--cr-dialog-button-container-padding-horizontal, 16px); + padding-inline-start: + var(--cr-dialog-button-container-padding-horizontal, 16px); + padding-top: var(--cr-dialog-button-container-padding-top, 16px); + } + + #pinKeyboardDiv { + justify-content: center; + } + + #pinKeyboard { + --cr-input-placeholder-letter-spacing: normal; + } + + #verifyPinDialogSubtitle { + padding-bottom: 16px; + } +</style> +<cr-dialog id="dialog" on-close="close" close-text="$i18n{close}"> + <div slot="title">$i18n{appParentalControlsAccessDialogTitle}</div> + <div slot="body"> + <div id="pinKeyboardDiv" class="settings-box continuation"> + <pin-keyboard id="pinKeyboard" + on-submit="onPinSubmit_" value="{{pinValue_}}" + enable-placeholder> + <!-- TODO(b/332936223): Add PIN error message here. --> + <div id="errorDiv" invisible$="[[!error_]]"></div> + </pin-keyboard> + </div> + </div> + <div slot="button-container"> + <!--TODO(b/339219535): Link to help center article here. --> + <a id="forgotPinLink">$i18n{appParentalControlsForgotPinLinkName}</a> + <cr-button class="cancel-button" on-click="onCancelClick_"> + $i18n{cancel} + </cr-button> + </div> +</cr-dialog> \ No newline at end of file
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.ts b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.ts new file mode 100644 index 0000000..e70ccdc --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_parental_controls/app_verify_pin_dialog.ts
@@ -0,0 +1,92 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'app-verify-pin-dialog' is the dialog for verifying that the PIN + * a user enters to access App Parental Controls matches the existing PIN. + */ + +import 'chrome://resources/ash/common/quick_unlock/pin_keyboard.js'; +import 'chrome://resources/ash/common/cr_elements/cr_button/cr_button.js'; +import 'chrome://resources/ash/common/cr_elements/cr_dialog/cr_dialog.js'; +import '../../settings_shared.css.js'; +import './app_setup_pin_keyboard.js'; + +import {CrDialogElement} from 'chrome://resources/ash/common/cr_elements/cr_dialog/cr_dialog.js'; +import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; +import {PinKeyboardElement} from 'chrome://resources/ash/common/quick_unlock/pin_keyboard.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './app_verify_pin_dialog.html.js'; + +const AppVerifyPinDialogElementBase = I18nMixin(PolymerElement); + +interface AppVerifyPinDialogElement { + $: { + dialog: CrDialogElement, + pinKeyboard: PinKeyboardElement, + }; +} + +class AppVerifyPinDialogElement extends AppVerifyPinDialogElementBase { + static get is() { + return 'app-verify-pin-dialog' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + /** + * The current PIN keyboard value. + */ + pinValue_: { + type: String, + }, + }; + } + + private pinValue_: string; + + override connectedCallback(): void { + super.connectedCallback(); + + this.resetState(); + this.$.dialog.showModal(); + this.$.pinKeyboard.focusInput(); + } + + close(): void { + if (this.$.dialog.open) { + this.$.dialog.close(); + } + this.resetState(); + } + + resetState(): void { + this.pinValue_ = ''; + } + + private onCancelClick_(e: Event): void { + // Stop propagation to keep the subpage from opening. + e.stopPropagation(); + this.close(); + } + + private onPinSubmit_(): void { + // TODO(b/332936481): Implement pin submission logic. + return; + } +} + +declare global { + interface HTMLElementTagNameMap { + [AppVerifyPinDialogElement.is]: AppVerifyPinDialogElement; + } +} + +customElements.define(AppVerifyPinDialogElement.is, AppVerifyPinDialogElement);
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.html b/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.html index 8b0c409..a2d8080ea 100644 --- a/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.html +++ b/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.html
@@ -34,7 +34,8 @@ <template is="dom-if" if="[[isAppParentalControlsFeatureAvailable_]]"> <div id="appParentalControls" class="settings-box" - actionable$="[[prefs.on_device_app_controls.setup_completed.value]]" + actionable$= + "[[prefs.on_device_app_controls.setup_completed.value]]" on-click="onClickParentalControls_"> <iron-icon id="parentalControlsRowIcon" icon="[[rowIcons_.manageApps]]"> @@ -66,6 +67,24 @@ on-change="disableParentalControls_"> </cr-toggle> </template> + <template is="dom-if" if="[[showParentalControlsSetupPinDialog_]]" + restamp> + <app-setup-pin-dialog id="setupPin" + on-close="onSetupPinDialogClose_"> + </app-setup-pin-dialog> + </template> + <template is="dom-if" if="[[showParentalControlsVerifyPinDialog_]]" + restamp> + <app-verify-pin-dialog id="verifyPin" + on-close="onVerifyPinDialogClose_"> + </app-verify-pin-dialog> + </template> + <template is="dom-if" if="[[showParentalControlsDisablePinDialog_]]" + restamp> + <app-verify-pin-dialog id="disableDialog" + on-close="onDisablePinDialogClose_"> + </app-verify-pin-dialog> + </template> </div> </template> <template is="dom-if" if="[[showAndroidApps_]]">
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.ts b/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.ts index 25aeeaf..037b67f 100644 --- a/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.ts +++ b/chrome/browser/resources/ash/settings/os_apps_page/os_apps_page.ts
@@ -25,6 +25,8 @@ import './app_management_page/app_management_page.js'; import './app_management_page/app_detail_view.js'; import './app_management_page/uninstall_button.js'; +import './app_parental_controls/app_setup_pin_dialog.js'; +import './app_parental_controls/app_verify_pin_dialog.js'; import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js'; import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; @@ -135,6 +137,30 @@ }, }, + /** + * Whether the Disable Parental Controls dialog should be shown. + */ + showParentalControlsDisablePinDialog_: { + type: Boolean, + value: false, + }, + + /** + * Whether the Parental Controls PIN setup dialog should be shown. + */ + showParentalControlsSetupPinDialog_: { + type: Boolean, + value: false, + }, + + /** + * Whether the Parental Controls PIN verification dialog should be shown. + */ + showParentalControlsVerifyPinDialog_: { + type: Boolean, + value: false, + }, + isPluginVmAvailable_: { type: Boolean, value: () => { @@ -251,6 +277,9 @@ private readonly showAndroidApps_: boolean; private showAppNotificationsRow_: boolean; private showManageIsolatedWebAppsRow_: boolean; + private showParentalControlsDisablePinDialog_: boolean; + private showParentalControlsSetupPinDialog_: boolean; + private showParentalControlsVerifyPinDialog_: boolean; private readonly shouldShowStartup_: boolean; constructor() { @@ -328,23 +357,47 @@ } private onClickParentalControls_(): void { - const isParentalControlsSetup = + const isParentalControlsSetupCompleted = this.getPref('on_device_app_controls.setup_completed').value; - if (isParentalControlsSetup) { - Router.getInstance().navigateTo(routes.APP_PARENTAL_CONTROLS); + if (isParentalControlsSetupCompleted) { + this.showParentalControlsVerifyPinDialog_ = true; } } private setUpParentalControls_(e: Event): void { - this.setPrefValue('on_device_app_controls.setup_completed', true); + this.showParentalControlsSetupPinDialog_ = true; // Stop propagation to keep the subpage from opening. e.stopPropagation(); } - private disableParentalControls_(): void { + private disableParentalControls_(e: Event): void { + this.showParentalControlsDisablePinDialog_ = true; + // Stop propagation to keep the subpage from opening. + e.stopPropagation(); + } + + private onVerifyPinDialogClose_(): void { + this.showParentalControlsVerifyPinDialog_ = false; + // TODO(b/332936481): Only navigate to the subpage on successful PIN + // verification. + Router.getInstance().navigateTo(routes.APP_PARENTAL_CONTROLS); + } + + private onDisablePinDialogClose_(): void { + this.showParentalControlsDisablePinDialog_ = false; + // TODO(b/334102223): Only set setup pref to false on successful PIN + // verification. this.setPrefValue('on_device_app_controls.setup_completed', false); } + private onSetupPinDialogClose_(): void { + this.showParentalControlsSetupPinDialog_ = false; + // TODO(b/332936223): Only set setup pref to true and navigate to the + // subpage on PIN submission success. + this.setPrefValue('on_device_app_controls.setup_completed', true); + Router.getInstance().navigateTo(routes.APP_PARENTAL_CONTROLS); + } + private onClickManageIsolatedWebApps_(): void { Router.getInstance().navigateTo(routes.MANAGE_ISOLATED_WEB_APPS); }
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts index 58bdff2..c6e10fa 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts
@@ -15,10 +15,7 @@ private onInitCallbackForTest_: (() => void)|undefined; private initialized_ = false; declare private cameraStreamReadyPromise_: Promise<void>; - declare private cameraStreamClosedPromise_: Promise<void>; private cameraStreamReadyResolver_?: () => void; - private cameraStreamClosedResolver_?: () => void; - private cameraStreamWindowId_ = -1; constructor() { this.mouseController_ = new MouseController(); @@ -26,9 +23,6 @@ this.cameraStreamReadyPromise_ = new Promise(resolve => { this.cameraStreamReadyResolver_ = resolve; }); - this.cameraStreamClosedPromise_ = new Promise(resolve => { - this.cameraStreamClosedResolver_ = resolve; - }); this.init_(); } @@ -57,12 +51,7 @@ 'accessibility_common/facegaze/camera_stream.html'), type: chrome.windows.CreateType.PANEL, }; - chrome.windows.create(params, (win) => { - if (!win || win.id === undefined) { - return; - } - - this.cameraStreamWindowId_ = win.id; + chrome.windows.create(params, () => { chrome.runtime.onMessage.addListener(message => { if (message.type === 'faceLandmarkerResult') { this.processFaceLandmarkerResult_(message.result); @@ -108,11 +97,6 @@ /** Destructor to remove any listeners. */ onFaceGazeDisabled(): void { this.mouseController_.stopEventListeners(); - if (this.cameraStreamWindowId_ !== -1) { - chrome.windows.remove(this.cameraStreamWindowId_, () => { - this.cameraStreamClosedResolver_!(); - }); - } } /** Allows tests to wait for FaceGaze to be fully initialized. */
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js index cc23194..726f58b 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test.js
@@ -793,15 +793,3 @@ keyEvents[9].type); assertEquals(KeyCode.LEFT, keyEvents[9].keyCode); }); - -AX_TEST_F('FaceGazeTest', 'ClosesCameraStream', async function() { - await this.getFaceGaze().cameraStreamReadyPromise_; - let win = chrome.extension.getViews().find( - view => view.location.href.includes('camera_stream.html')); - assertTrue(!!win); - this.getFaceGaze().onFaceGazeDisabled(); - await this.getFaceGaze().cameraStreamClosedPromise_; - win = chrome.extension.getViews().find( - view => view.location.href.includes('camera_stream.html')); - assertFalse(!!win); -});
diff --git a/chrome/browser/resources/chromeos/login/components/oobe_personalized_apps_list.ts b/chrome/browser/resources/chromeos/login/components/oobe_personalized_apps_list.ts index 8fb24e4..d734bb3 100644 --- a/chrome/browser/resources/chromeos/login/components/oobe_personalized_apps_list.ts +++ b/chrome/browser/resources/chromeos/login/components/oobe_personalized_apps_list.ts
@@ -103,10 +103,12 @@ itemRenderedChanged(): void { if (this.appsList.length !== 0 && - this.itemRendered === this.appsList.length && + // TODO: Found a better condition as with that one we never render full + // list of apps. + // this.itemRendered === this.appsList.length && this.loadedIconsCount === this.appsList.length) { - this.dispatchEvent(new CustomEvent( - 'apps-icons-loaded', {bubbles: true, composed: true})); + this.dispatchEvent( + new CustomEvent('icons-loaded', {bubbles: true, composed: true})); } }
diff --git a/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.html b/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.html index feb7cd0..3695dc0 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.html +++ b/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.html
@@ -25,7 +25,7 @@ <oobe-personalized-apps-list id="categoriesAppsList" class="focus-on-show" selected-apps-count="{{numberOfSelectedApps}}" - on-apps-icons-loaded="onFullyLoaded"> + on-icons-loaded="onFullyLoaded"> </oobe-personalized-apps-list> </div> <div slot="back-navigation">
diff --git a/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.ts b/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.ts index 1770a76e..0a66edb 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.ts +++ b/chrome/browser/resources/chromeos/login/screens/common/personalized_recommend_apps.ts
@@ -36,10 +36,6 @@ BACK = 'back', } -interface RecommendAppsScreenData { - data: CategoriesAppsMap; -} - export const PersonalizedRecommedAppsElementBase = mixinBehaviors( [LoginScreenBehavior, OobeDialogHostBehavior, MultiStepBehavior], @@ -102,11 +98,11 @@ return OobeUiState.ONBOARDING; } - setCategoriesAppsMapData(categoriesData: RecommendAppsScreenData): void { - assert('data' in categoriesData); + setCategoriesAppsMapData(categoriesData: CategoriesAppsMap): void { + assert(categoriesData !== null); this.shadowRoot! .querySelector<OobePersonalizedAppsList>('#categoriesAppsList')!.init( - categoriesData['data']); + categoriesData); } /**
diff --git a/chrome/browser/resources/chromeos/password_change/urgent_password_expiry_notification_app.js b/chrome/browser/resources/chromeos/password_change/urgent_password_expiry_notification_app.js index a940600..4ac95e6 100644 --- a/chrome/browser/resources/chromeos/password_change/urgent_password_expiry_notification_app.js +++ b/chrome/browser/resources/chromeos/password_change/urgent_password_expiry_notification_app.js
@@ -19,7 +19,7 @@ import {I18nBehavior} from 'chrome://resources/ash/common/i18n_behavior.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; import {WebUIListenerBehavior} from 'chrome://resources/ash/common/web_ui_listener_behavior.js'; -import {Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getTemplate} from './urgent_password_expiry_notification_app.html.js'; @@ -27,32 +27,54 @@ const ONE_MINUTE_IN_MS = ONE_SECOND_IN_MS * 60; const ONE_HOUR_IN_MS = ONE_MINUTE_IN_MS * 60; -Polymer({ - is: 'urgent-password-expiry-notification', +/** + * @constructor + * @extends {PolymerElement} + * @implements {I18nBehaviorInterface} + */ +const UrgentPasswordExpiryNotificationElementBase = + mixinBehaviors([I18nBehavior, WebUIListenerBehavior], PolymerElement); - _template: getTemplate(), +/** @polymer */ +class UrgentPasswordExpiryNotificationElement extends + UrgentPasswordExpiryNotificationElementBase { + static get is() { + return 'urgent-password-expiry-notification'; + } - behaviors: [I18nBehavior, WebUIListenerBehavior], + static get template() { + return getTemplate(); + } - properties: { - /** @private {string} */ - title_: { - type: String, - value: '', - }, - }, + static get properties() { + return { + /** @private {string} */ + title_: { + type: String, + value: '', + }, - /** @type {?Date} */ - expirationTime_: null, + }; + } - /** @type {?number} */ - countDownIntervalId_: null, + constructor() { + super(); - /** @type {?number} */ - countDownIntervalMs_: null, + /** @type {?Date} */ + this.expirationTime_ = null; + + /** @type {?number} */ + this.countDownIntervalId_ = null; + + /** @type {?number} */ + this.countDownIntervalMs_ = null; + } + /** @override */ - attached() { + connectedCallback() { + super.connectedCallback(); + this.$.dialog.showModal(); if (loadTimeData.valueExists('initialTitle')) { this.title_ = loadTimeData.getString('initialTitle'); @@ -68,7 +90,7 @@ this.ensureCountDownCalledOftenEnough_(); } } - }, + } /** @private */ ensureCountDownCalledOftenEnough_() { @@ -83,7 +105,7 @@ // Expires some time in the future - update UI every hour. this.ensureCountDownCalledWithInterval_(ONE_HOUR_IN_MS); } - }, + } /** @private */ ensureCountDownCalledWithInterval_(intervalMs) { @@ -94,7 +116,7 @@ this.countDownIntervalId_ = setInterval(this.countDown_.bind(this), intervalMs); this.countDownIntervalMs_ = intervalMs; - }, + } /** @private */ stopCountDownCalls_() { @@ -104,7 +126,7 @@ clearInterval(this.countDownIntervalId_); this.countDownIntervalId_ = null; this.countDownIntervalMs_ = null; - }, + } /** @private */ countDown_() { @@ -113,11 +135,14 @@ cr.sendWithPromise('getTitleText', msUntilExpiry).then((title) => { this.title_ = title; }); - }, + } /** @private */ onButtonTap_() { chrome.send('continue'); - }, + } +} -}); +customElements.define( + UrgentPasswordExpiryNotificationElement.is, + UrgentPasswordExpiryNotificationElement);
diff --git a/chrome/browser/resources/lens/overlay/BUILD.gn b/chrome/browser/resources/lens/overlay/BUILD.gn index 1ddde6a..7f12c2ba 100644 --- a/chrome/browser/resources/lens/overlay/BUILD.gn +++ b/chrome/browser/resources/lens/overlay/BUILD.gn
@@ -28,6 +28,7 @@ static_files = [ "feedback.svg", "icon_clear.svg", + "info.svg", "lens_overlay.html", "side_panel/side_panel.html", ]
diff --git a/chrome/browser/resources/lens/overlay/info.svg b/chrome/browser/resources/lens/overlay/info.svg new file mode 100644 index 0000000..cb7515c --- /dev/null +++ b/chrome/browser/resources/lens/overlay/info.svg
@@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 -960 960 960"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
diff --git a/chrome/browser/resources/lens/overlay/lens_overlay_app.html b/chrome/browser/resources/lens/overlay/lens_overlay_app.html index c9e7091d..f49a169 100644 --- a/chrome/browser/resources/lens/overlay/lens_overlay_app.html +++ b/chrome/browser/resources/lens/overlay/lens_overlay_app.html
@@ -23,8 +23,7 @@ position: absolute; } - #closeButton, - #feedbackButton { + .action-button { --cr-icon-button-icon-size: 20px; --cr-icon-button-size: 36px; --cr-icon-button-fill-color: white; @@ -43,6 +42,10 @@ --cr-icon-image: url("feedback.svg"); } + #infoButton { + --cr-icon-image: url("info.svg"); + } + .app-container :not(lens-selection-overlay) { transition: opacity 150ms linear; } @@ -51,7 +54,6 @@ opacity: 0; } - initial-toast { pointer-events: none; } @@ -69,8 +71,12 @@ <cr-icon-button id="feedbackButton" class="action-button" on-click="onFeedbackButtonClick" aria-label="$i18n{sendFeedback}" title="$i18n{sendFeedback}"></cr-icon-button> + <cr-icon-button id="infoButton" class="action-button" + on-click="onInfoButtonClick" aria-label="$i18n{info}" + title="$i18n{info}"> + </cr-icon-button> <cr-icon-button id="closeButton" class="action-button" on-click="onCloseButtonClick" aria-label="$i18n{close}" title="$i18n{close}"></cr-icon-button> </div> -</div> \ No newline at end of file +</div>
diff --git a/chrome/browser/resources/lens/overlay/lens_overlay_app.ts b/chrome/browser/resources/lens/overlay/lens_overlay_app.ts index ff162f0..a836655 100644 --- a/chrome/browser/resources/lens/overlay/lens_overlay_app.ts +++ b/chrome/browser/resources/lens/overlay/lens_overlay_app.ts
@@ -30,6 +30,7 @@ backgroundScrim: HTMLElement, closeButton: CrIconButtonElement, feedbackButton: CrIconButtonElement, + infoButton: CrIconButtonElement, initialToast: InitialToastElement, }; } @@ -107,6 +108,16 @@ this.browserProxy.handler.feedbackRequestedByOverlay(); } + private onInfoButtonClick(event: MouseEvent|KeyboardEvent) { + this.browserProxy.handler.infoRequestedByOverlay({ + middleButton: (event as MouseEvent).button === 1, + altKey: event.altKey, + ctrlKey: event.ctrlKey, + metaKey: event.metaKey, + shiftKey: event.shiftKey, + }); + } + private onNotifyResultsPanelOpened() { this.closeButtonHidden = true; }
diff --git a/chrome/browser/resources/lens/overlay/object_layer.ts b/chrome/browser/resources/lens/overlay/object_layer.ts index 07ccc211..e4d3f153 100644 --- a/chrome/browser/resources/lens/overlay/object_layer.ts +++ b/chrome/browser/resources/lens/overlay/object_layer.ts
@@ -287,15 +287,33 @@ context.clip(); context.drawImage( this.$.highlightImg, 0, 0, this.canvasWidth, this.canvasHeight); - - // Draw a solid mask fill over the path of the image. context.restore(); + + // Stroke the path on top of the image. context.lineCap = 'round'; context.lineJoin = 'round'; context.lineWidth = 2; - context.filter = 'none'; - context.fillStyle = 'rgba(255, 255, 255, 0.2)'; - context.fill(); + context.filter = 'blur(4px)'; + // Fit a square around the bounding box to use for gradient coordinates. + const objectBoundingBox = object.geometry.boundingBox; + const longestEdge = + Math.max(objectBoundingBox.box.width, objectBoundingBox.box.height); + const left = (objectBoundingBox.box.x - longestEdge / 2) * this.canvasWidth; + const top = (objectBoundingBox.box.y - longestEdge / 2) * this.canvasHeight; + const right = + (objectBoundingBox.box.x + longestEdge / 2) * this.canvasWidth; + const bottom = + (objectBoundingBox.box.y + longestEdge / 2) * this.canvasHeight; + const gradient = context.createLinearGradient( + left, + top, + right, + bottom, + ); + gradient.addColorStop(0, '#ffffff'); + gradient.addColorStop(1, '#ffffff'); + context.strokeStyle = gradient; + context.stroke(); } private clearCanvas(context: CanvasRenderingContext2D) {
diff --git a/chrome/browser/resources/lens/overlay/selection_overlay.ts b/chrome/browser/resources/lens/overlay/selection_overlay.ts index 0906d9ab..66d0c22 100644 --- a/chrome/browser/resources/lens/overlay/selection_overlay.ts +++ b/chrome/browser/resources/lens/overlay/selection_overlay.ts
@@ -290,7 +290,7 @@ document.body.style.cursor = 'crosshair'; this.cursorOffsetX = 3; this.cursorOffsetY = 6; - this.cursorImgUri = 'search.svg'; + this.cursorImgUri = 'lens.svg'; } // Called on object hover. @@ -298,7 +298,7 @@ // No dragging for objects, so no need to set body cursor style. this.cursorOffsetX = 4; this.cursorOffsetY = 8; - this.cursorImgUri = 'search.svg'; + this.cursorImgUri = 'lens.svg'; } private resetCursor() {
diff --git a/chrome/browser/resources/lens/overlay/text_layer.ts b/chrome/browser/resources/lens/overlay/text_layer.ts index a197b09..576c0be1 100644 --- a/chrome/browser/resources/lens/overlay/text_layer.ts +++ b/chrome/browser/resources/lens/overlay/text_layer.ts
@@ -48,7 +48,9 @@ // Return the text separator if there is one, else returns a space. function getTextSeparator(word: Word): string { - return word.textSeparator ? word.textSeparator : ' '; + return (word.textSeparator !== null && word.textSeparator !== undefined) ? + word.textSeparator : + ' '; } export interface TextLayerElement {
diff --git a/chrome/browser/resources/new_tab_page/lazy_load.ts b/chrome/browser/resources/new_tab_page/lazy_load.ts index 4847a1b..d9c11f8 100644 --- a/chrome/browser/resources/new_tab_page/lazy_load.ts +++ b/chrome/browser/resources/new_tab_page/lazy_load.ts
@@ -46,6 +46,7 @@ export {DisableModuleEvent, DismissModuleEvent, ModulesElement} from './modules/modules.js'; export {photosDescriptor, PhotosModuleElement} from './modules/photos/module.js'; export {PhotosProxy} from './modules/photos/photos_module_proxy.js'; +export {CalendarElement} from './modules/v2/calendar/calendar.js'; export {googleCalendarDescriptor, GoogleCalendarModuleElement} from './modules/v2/calendar/google_calendar_module.js'; export {GoogleCalendarProxyImpl} from './modules/v2/calendar/google_calendar_proxy.js'; export {outlookCalendarDescriptor, OutlookCalendarModuleElement} from './modules/v2/calendar/outlook_calendar_module.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.gni b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.gni index 13fde9b..beada92 100644 --- a/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.gni +++ b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.gni
@@ -4,6 +4,7 @@ # List of files that should be passed to html_to_wrapper(). calendar_v2_web_component_files = [ + "modules/v2/calendar/calendar.ts", "modules/v2/calendar/google_calendar_module.ts", "modules/v2/calendar/outlook_calendar_module.ts", ]
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.html b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.html new file mode 100644 index 0000000..9a690594 --- /dev/null +++ b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.html
@@ -0,0 +1,3 @@ +<template is="dom-repeat" items="[[events]]"> + <p>[[item.title]]</p> +</template> \ No newline at end of file
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.ts b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.ts new file mode 100644 index 0000000..e7c3881 --- /dev/null +++ b/chrome/browser/resources/new_tab_page/modules/v2/calendar/calendar.ts
@@ -0,0 +1,32 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import type {CalendarEvent} from '../../../google_calendar.mojom-webui.js'; + +import {getTemplate} from './calendar.html.js'; + +/** + * The calendar element for displaying the user's list of events. . + */ +export class CalendarElement extends PolymerElement { + static get is() { + return 'ntp-calendar'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + events: Object, + }; + } + + events: CalendarEvent[]; +} + +customElements.define(CalendarElement.is, CalendarElement);
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.html b/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.html index 588e6f6..fdeafea 100644 --- a/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.html +++ b/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.html
@@ -1,9 +1,10 @@ <ntp-module-header-v2 - id="moduleHeaderElementV2" - header-text="[[i18n('modulesTodayCalendarHeader')]]" - menu-item-groups="[[getMenuItemGroups_()]]" - more-actions-text="[[i18n('modulesTodayCalendarMoreActions')]]" - on-disable-button-click="onDisableButtonClick_" - on-dismiss-button-click="onDismissButtonClick_" - on-menu-button-click="onMenuButtonClick_"> -</ntp-module-header-v2> \ No newline at end of file + id="moduleHeaderElementV2" + header-text="[[i18n('modulesTodayCalendarHeader')]]" + menu-item-groups="[[getMenuItemGroups_()]]" + more-actions-text="[[i18n('modulesTodayCalendarMoreActions')]]" + on-disable-button-click="onDisableButtonClick_" + on-dismiss-button-click="onDismissButtonClick_" + on-menu-button-click="onMenuButtonClick_"> +</ntp-module-header-v2> +<ntp-calendar id="calendar" events="[[events_]]"></ntp-calendar>
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.ts b/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.ts index b7654ad..8e593d3 100644 --- a/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.ts +++ b/chrome/browser/resources/new_tab_page/modules/v2/calendar/google_calendar_module.ts
@@ -2,20 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import './calendar.js'; import '../../module_header.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {GoogleCalendarPageHandlerRemote} from '../../../google_calendar.mojom-webui.js'; +import type {CalendarEvent, GoogleCalendarPageHandlerRemote} from '../../../google_calendar.mojom-webui.js'; import {I18nMixin} from '../../../i18n_setup.js'; import {ModuleDescriptor} from '../../module_descriptor.js'; import type {MenuItem, ModuleHeaderElementV2} from '../module_header.js'; +import type {CalendarElement} from './calendar.js'; import {getTemplate} from './google_calendar_module.html.js'; import {GoogleCalendarProxyImpl} from './google_calendar_proxy.js'; export interface GoogleCalendarModuleElement { $: { + calendar: CalendarElement, moduleHeaderElementV2: ModuleHeaderElementV2, }; } @@ -35,15 +38,21 @@ } static get properties() { - return {}; + return { + events_: Object, + }; } +private events_: + CalendarEvent[]; + private handler_: GoogleCalendarPageHandlerRemote; - constructor() { + constructor(events: CalendarEvent[]) { super(); this.handler_ = GoogleCalendarProxyImpl.getInstance().handler; + this.events_ = events; } private getMenuItemGroups_(): MenuItem[][] { @@ -102,8 +111,9 @@ async function createGoogleCalendarElement(): Promise<GoogleCalendarModuleElement|null> { - return new Promise<GoogleCalendarModuleElement>( - (resolve) => resolve(new GoogleCalendarModuleElement())); + const {events} = + await GoogleCalendarProxyImpl.getInstance().handler.getEvents(); + return events.length > 0 ? new GoogleCalendarModuleElement(events) : null; } export const googleCalendarDescriptor: ModuleDescriptor = new ModuleDescriptor(
diff --git a/chrome/browser/resources/tab_search/tab_organization_group.html b/chrome/browser/resources/tab_search/tab_organization_group.html index 0c68415..f97b523 100644 --- a/chrome/browser/resources/tab_search/tab_organization_group.html +++ b/chrome/browser/resources/tab_search/tab_organization_group.html
@@ -2,7 +2,8 @@ cr-icon-button { --cr-icon-button-fill-color: var(--mwb-icon-button-fill-color); --cr-icon-button-icon-size: 16px; - --cr-icon-button-size: 20px; + --cr-icon-button-size: 24px; + margin: 0 } cr-input { @@ -28,6 +29,7 @@ } tab-search-item { + --tab-search-item-icon-margin: 8px; --tab-search-favicon-background: var(--color-tab-search-background); } @@ -60,6 +62,11 @@ justify-content: space-between; } + :host(:not([show-reject])) .icon-edit, + .icon-clear { + margin-inline-end: var(--cr-icon-ripple-margin); + } + #multiOrganizationInput { width: 100%; }
diff --git a/chrome/browser/resources/tab_search/tab_organization_group.ts b/chrome/browser/resources/tab_search/tab_organization_group.ts index 2445024..cd5ea2ef 100644 --- a/chrome/browser/resources/tab_search/tab_organization_group.ts +++ b/chrome/browser/resources/tab_search/tab_organization_group.ts
@@ -67,6 +67,7 @@ showReject: { type: Boolean, value: false, + reflectToAttribute: true, }, lastFocusedIndex_: {
diff --git a/chrome/browser/resources/tab_search/tab_organization_results.html b/chrome/browser/resources/tab_search/tab_organization_results.html index aed2c3b..1e5f369 100644 --- a/chrome/browser/resources/tab_search/tab_organization_results.html +++ b/chrome/browser/resources/tab_search/tab_organization_results.html
@@ -23,10 +23,29 @@ } #scrollable { + --external-margin: 20px; + --scrollbar-width: 4px; + --scroll-border: solid 1px var(--color-tab-search-divider); + --non-scroll-border: solid 1px transparent; + border-bottom: var(--non-scroll-border); + border-top: var(--non-scroll-border); display: flex; flex-direction: column; gap: 12px; + /* Render the scroll bar and scroll borders at the edge of the dialog */ + margin: 0 calc(-1 * var(--external-margin)); overflow-y: auto; + padding: 0 calc(var(--external-margin) - var(--scrollbar-width)) + 0 var(--external-margin); + scrollbar-gutter: stable; + } + + #scrollable.can-scroll.is-scrolled { + border-top: var(--scroll-border); + } + + #scrollable.can-scroll:not(.scrolled-to-bottom) { + border-bottom: var(--scroll-border); } .tab-organization-body,
diff --git a/chrome/browser/resources/tab_search/tab_organization_results.ts b/chrome/browser/resources/tab_search/tab_organization_results.ts index 2f96eda..88b3f9f 100644 --- a/chrome/browser/resources/tab_search/tab_organization_results.ts +++ b/chrome/browser/resources/tab_search/tab_organization_results.ts
@@ -15,7 +15,7 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {mojoString16ToString} from 'chrome://resources/js/mojo_type_util.js'; import type {IronSelectorElement} from 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; -import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {afterNextRender, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import type {TabOrganizationGroupElement} from './tab_organization_group.js'; import {getTemplate} from './tab_organization_results.html.js'; @@ -75,6 +75,12 @@ return getTemplate(); } + override ready() { + super.ready(); + + this.$.scrollable.addEventListener('scroll', this.updateScroll_.bind(this)); + } + focusInput() { const group = this.shadowRoot!.querySelector('tab-organization-group'); if (!group) { @@ -83,6 +89,17 @@ group.focusInput(); } + private updateScroll_() { + const scrollable = this.$.scrollable; + scrollable.classList.toggle( + 'can-scroll', scrollable.clientHeight < scrollable.scrollHeight); + scrollable.classList.toggle('is-scrolled', scrollable.scrollTop > 0); + scrollable.classList.toggle( + 'scrolled-to-bottom', + scrollable.scrollTop + scrollable.clientHeight >= + scrollable.scrollHeight); + } + private getTitle_(): string { if (this.multiTabOrganization) { if (this.hasMultipleOrganizations_()) { @@ -118,10 +135,12 @@ MINIMUM_SCROLLABLE_MAX_HEIGHT, (this.availableHeight - NON_SCROLLABLE_VERTICAL_SPACING)); this.$.scrollable.style.maxHeight = maxHeight + 'px'; + afterNextRender(this, () => this.updateScroll_()); } private onSessionChange_() { this.feedbackSelectedOption_ = CrFeedbackOption.UNSPECIFIED; + afterNextRender(this, () => this.updateScroll_()); } private onCreateAllGroupsClick_(event: CustomEvent) {
diff --git a/chrome/browser/resources/tab_search/tab_search_item.html b/chrome/browser/resources/tab_search/tab_search_item.html index 920d7ac3..65807a2 100644 --- a/chrome/browser/resources/tab_search/tab_search_item.html +++ b/chrome/browser/resources/tab_search/tab_search_item.html
@@ -151,7 +151,7 @@ height: 40px; justify-content: center; overflow: hidden; - margin-inline-end: 16px; + margin-inline-end: var(--tab-search-item-icon-margin, 16px); width: 40px; }
diff --git a/chrome/browser/resources/webui_gallery/BUILD.gn b/chrome/browser/resources/webui_gallery/BUILD.gn index 2f383a0a..3be5dc0 100644 --- a/chrome/browser/resources/webui_gallery/BUILD.gn +++ b/chrome/browser/resources/webui_gallery/BUILD.gn
@@ -16,6 +16,8 @@ ] css_files = [ + "demos/buttons/buttons_demo.css", + "demos/card/card_demo.css", "demos/cr_action_menu/cr_action_menu_demo.css", "demos/demo.css", "demos/demo_lit.css",
diff --git a/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.css b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.css new file mode 100644 index 0000000..d67479e --- /dev/null +++ b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.css
@@ -0,0 +1,16 @@ +/* Copyright 2024 The Chromium Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #import=../demo_lit.css.js + * #scheme=relative + * #include=demo-lit + * #css_wrapper_metadata_end */ + +cr-expand-button { + min-width: 100px; + padding: 0 12px; + width: 45%; +}
diff --git a/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.html b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.html index dd498bb5..90f586d8b 100644 --- a/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.html +++ b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.html
@@ -1,10 +1,4 @@ -<style include="demo"> - cr-expand-button { - min-width: 100px; - padding: 0 12px; - width: 45%; - } -</style> + <h1>cr-button</h1> <div class="demos"> @@ -59,12 +53,13 @@ <h1>cr-expand-button</h1> <div class="demos"> - <cr-expand-button expanded="{{expanded_}}" + <cr-expand-button ?expanded="${this.expanded_}" + @expanded-changed="${this.onExpandedChanged_}" expand-title="Expand" collapse-title="Collapse"> - <div hidden$="[[expanded_]]">Expand row</div> - <div hidden$="[[!expanded_]]">Collapse row</div> + <div ?hidden="${this.expanded_}">Expand row</div> + <div ?hidden="${!this.expanded_}">Collapse row</div> </cr-expand-button> - <cr-collapse opened="[[expanded_]]">Some content goes here.</cr-collapse> + <cr-collapse ?opened="${this.expanded_}">Some content goes here.</cr-collapse> <cr-expand-button expand-icon="cr:arrow-drop-down" collapse-icon="cr:arrow-drop-up">
diff --git a/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.ts b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.ts index cf27d51..062d64c 100644 --- a/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.ts +++ b/chrome/browser/resources/webui_gallery/demos/buttons/buttons_demo.ts
@@ -8,28 +8,36 @@ import '//resources/cr_elements/cr_icon/cr_icon.js'; import '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import '//resources/cr_elements/icons_lit.html.js'; -import '../demo.css.js'; -import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {CrLitElement} from '//resources/lit/v3_0/lit.rollup.js'; -import {getTemplate} from './buttons_demo.html.js'; +import {getCss} from './buttons_demo.css.js'; +import {getHtml} from './buttons_demo.html.js'; -class ButtonsDemoElement extends PolymerElement { +export class ButtonsDemoElement extends CrLitElement { static get is() { return 'buttons-demo'; } - static get template() { - return getTemplate(); + static override get styles() { + return getCss(); } - static get properties() { + override render() { + return getHtml.bind(this)(); + } + + static override get properties() { return { - expanded_: Boolean, + expanded_: {type: Boolean}, }; } - private exapanded_: boolean; + protected expanded_: boolean = false; + + protected onExpandedChanged_(e: CustomEvent<{value: boolean}>) { + this.expanded_ = e.detail.value; + } } export const tagName = ButtonsDemoElement.is;
diff --git a/chrome/browser/resources/webui_gallery/demos/card/card_demo.css b/chrome/browser/resources/webui_gallery/demos/card/card_demo.css new file mode 100644 index 0000000..4e63a369 --- /dev/null +++ b/chrome/browser/resources/webui_gallery/demos/card/card_demo.css
@@ -0,0 +1,30 @@ +/* Copyright 2024 The Chromium Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #import=//resources/cr_elements/cr_page_host_style_lit.css.js + * #import=//resources/cr_elements/cr_shared_style_lit.css.js + * #import=//resources/cr_elements/cr_shared_vars.css.js + * #scheme=relative + * #include=cr-page-host-style-lit cr-shared-style-lit + * #css_wrapper_metadata_end */ + +.card { + background-color: var(--cr-card-background-color); + border-radius: var(--cr-card-border-radius); + box-shadow: var(--cr-card-shadow); + margin: 0 auto; + margin-block-end: 36px; + max-width: var(--card-max-width); +} + +.flex { + flex: 1; +} + +#expandedContent { + padding-inline-end: var(--cr-section-padding); + padding-inline-start: var(--cr-section-indent-padding); +}
diff --git a/chrome/browser/resources/webui_gallery/demos/card/card_demo.html b/chrome/browser/resources/webui_gallery/demos/card/card_demo.html index 3d595d8..703510b 100644 --- a/chrome/browser/resources/webui_gallery/demos/card/card_demo.html +++ b/chrome/browser/resources/webui_gallery/demos/card/card_demo.html
@@ -1,22 +1,3 @@ -<style include="cr-page-host-style cr-shared-style"> - .card { - background-color: var(--cr-card-background-color); - border-radius: var(--cr-card-border-radius); - box-shadow: var(--cr-card-shadow); - margin: 0 auto; - margin-block-end: 36px; - max-width: var(--card-max-width); - } - - .flex { - flex: 1; - } - - #expandedContent { - padding-inline-end: var(--cr-section-padding); - padding-inline-start: var(--cr-section-indent-padding); - } -</style> <div class="cr-centered-card-container"> <h2>Cards and rows with content</h2> <div class="card"> @@ -55,7 +36,7 @@ </cr-link-row> <cr-link-row class="hr" external label="A row that links to an external website" - on-click="onExternalLinkClick_"></cr-link-row> + @click="${this.onExternalLinkClick_}"></cr-link-row> <cr-link-row no-hover class="hr" label="Link row with no hover effect"> </cr-link-row> <cr-link-row start-icon="cr:check" label="Row with an icon"></cr-link-row> @@ -68,10 +49,11 @@ <h2>Other examples</h2> <div class="card"> - <cr-expand-button class="cr-row first" expanded="{{expanded_}}"> + <cr-expand-button class="cr-row first" ?expanded="${this.expanded_}" + @expanded-changed="${this.onExpandedChanged_}"> A row that expands... </cr-expand-button> - <cr-collapse id="expandedContent" opened="[[expanded_]]"> + <cr-collapse id="expandedContent" ?opened="${this.expanded_}"> <div class="cr-padded-text">...into more rows!</div> <div class="cr-padded-text hr">...into more rows!</div> <div class="cr-padded-text hr">...into more rows!</div>
diff --git a/chrome/browser/resources/webui_gallery/demos/card/card_demo.ts b/chrome/browser/resources/webui_gallery/demos/card/card_demo.ts index 0bd0268..7898696c 100644 --- a/chrome/browser/resources/webui_gallery/demos/card/card_demo.ts +++ b/chrome/browser/resources/webui_gallery/demos/card/card_demo.ts
@@ -8,35 +8,41 @@ import '//resources/cr_elements/cr_expand_button/cr_expand_button.js'; import '//resources/cr_elements/cr_icon/cr_icon.js'; import '//resources/cr_elements/cr_link_row/cr_link_row.js'; -import '//resources/cr_elements/cr_page_host_style.css.js'; -import '//resources/cr_elements/cr_shared_style.css.js'; -import '//resources/cr_elements/cr_shared_vars.css.js'; import '//resources/cr_elements/icons_lit.html.js'; -import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {CrLitElement} from '//resources/lit/v3_0/lit.rollup.js'; -import {getTemplate} from './card_demo.html.js'; +import {getCss} from './card_demo.css.js'; +import {getHtml} from './card_demo.html.js'; -class CardDemoElement extends PolymerElement { +export class CardDemoElement extends CrLitElement { static get is() { return 'card-demo'; } - static get template() { - return getTemplate(); + static override get styles() { + return getCss(); } - static get properties() { + override render() { + return getHtml.bind(this)(); + } + + static override get properties() { return { - expanded_: Boolean, + expanded_: {type: Boolean}, }; } - private expanded_: boolean = false; + protected expanded_: boolean = false; - private onExternalLinkClick_() { + protected onExternalLinkClick_() { window.open('https://chromium.org'); } + + protected onExpandedChanged_(e: CustomEvent<{value: boolean}>) { + this.expanded_ = e.detail.value; + } } export const tagName = CardDemoElement.is;
diff --git a/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.html b/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.html index 1b208e7..0865126 100644 --- a/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.html +++ b/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.html
@@ -1,8 +1,8 @@ -<style include="demo"></style> <h1>cr-checkbox</h1> <div class="demos"> - <cr-checkbox checked="{{myValue_}}">Checkbox</cr-checkbox> - <div>Above checkbox is checked? [[myValue_]]</div> + <cr-checkbox ?checked="${this.myValue_}" + @checked-changed="${this.onCheckedChanged_}">Checkbox</cr-checkbox> + <div>Above checkbox is checked? ${this.myValue_}</div> <cr-checkbox checked>Checkbox</cr-checkbox> <cr-checkbox checked class="label-first">
diff --git a/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.ts b/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.ts index a47b84d0..8b151ea4 100644 --- a/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.ts +++ b/chrome/browser/resources/webui_gallery/demos/cr_checkbox/cr_checkbox_demo.ts
@@ -3,28 +3,37 @@ // found in the LICENSE file. import '//resources/cr_elements/cr_checkbox/cr_checkbox.js'; -import '../demo.css.js'; -import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {CrLitElement} from '//resources/lit/v3_0/lit.rollup.js'; -import {getTemplate} from './cr_checkbox_demo.html.js'; +import {getCss} from '../demo_lit.css.js'; -class CrCheckboxDemoElement extends PolymerElement { +import {getHtml} from './cr_checkbox_demo.html.js'; + +export class CrCheckboxDemoElement extends CrLitElement { static get is() { return 'cr-checkbox-demo'; } - static get template() { - return getTemplate(); + static override get styles() { + return getCss(); } - static get properties() { + override render() { + return getHtml.bind(this)(); + } + + static override get properties() { return { - myValue_: Boolean, + myValue_: {type: Boolean}, }; } - private myValue_: boolean; + protected myValue_: boolean; + + protected onCheckedChanged_(e: CustomEvent<{value: boolean}>) { + this.myValue_ = e.detail.value; + } } export const tagName = CrCheckboxDemoElement.is;
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc index 46e096bd..c2dbf269 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -156,7 +156,7 @@ MOCK_CONST_METHOD1(IsPrivateIPAddress, bool(const net::IPAddress&)); MOCK_CONST_METHOD1(IsLocalResource, bool(const net::IPAddress&)); MOCK_METHOD2(GetValidCachedResult, bool(const GURL&, bool*)); - MOCK_METHOD0(OverPhishingReportLimit, bool()); + MOCK_METHOD0(AtPhishingReportLimit, bool()); MOCK_METHOD0(GetModelSharedMemoryRegion, base::ReadOnlySharedMemoryRegion()); MOCK_METHOD0(GetModelType, CSDModelType()); MOCK_METHOD0(IsModelAvailable, bool()); @@ -400,7 +400,7 @@ DoAll(SetArgPointee<1>(true), Return(*get_valid_cached_result))); } if (over_phishing_report_limit) { - EXPECT_CALL(*csd_service_, OverPhishingReportLimit()) + EXPECT_CALL(*csd_service_, AtPhishingReportLimit()) .WillOnce(Return(*over_phishing_report_limit)); } if (is_local) { @@ -1554,7 +1554,7 @@ GURL url("http://host.com/"); ExpectPreClassificationChecks(url, &kFalse, nullptr, nullptr, nullptr, &kFalse); - EXPECT_CALL(*csd_service_, OverPhishingReportLimit()).Times(0); + EXPECT_CALL(*csd_service_, AtPhishingReportLimit()).Times(0); NavigateAndKeepLoading(web_contents(), url); WaitAndCheckPreClassificationChecks(); fake_phishing_detector_.CheckMessage(&url);
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index 8b02f6de..02056af 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -224,9 +224,7 @@ response_data, net_error); } - bool OverPhishingReportLimit() { - return csd_service_->OverPhishingReportLimit(); - } + bool AtPhishingReportLimit() { return csd_service_->AtPhishingReportLimit(); } std::deque<base::Time>& GetPhishingReportTimes() { return csd_service_->phishing_report_times_; @@ -377,7 +375,7 @@ // Check that we have recorded all 5 requests within the correct time range. std::deque<base::Time>& report_times = GetPhishingReportTimes(); EXPECT_EQ(5U, report_times.size()); - EXPECT_TRUE(OverPhishingReportLimit()); + EXPECT_TRUE(AtPhishingReportLimit()); while (!report_times.empty()) { base::Time time = report_times.back(); report_times.pop_back(); @@ -466,7 +464,52 @@ csd_service_->AddPhishingReport(now); EXPECT_EQ(2, csd_service_->GetPhishingNumReports()); - EXPECT_FALSE(OverPhishingReportLimit()); + EXPECT_FALSE(AtPhishingReportLimit()); + + csd_service_->AddPhishingReport(now); + EXPECT_EQ(3, csd_service_->GetPhishingNumReports()); + EXPECT_TRUE(AtPhishingReportLimit()); +} + +TEST_P(ClientSideDetectionServiceTest, GetNumReportAtLimitWhenProfileIsNull) { + csd_service_ = std::make_unique<ClientSideDetectionService>( + nullptr, model_observer_tracker_.get(), background_task_runner_); + EXPECT_TRUE(AtPhishingReportLimit()); +} + +TEST_P(ClientSideDetectionServiceTest, + GetNumReportTestWhenPrefsPreloadedAndOverLimit) { + // The current report limit is 3 as per + // ClientSideDetectionService::kMaxReportsPerInterval. + base::Value::List time_list; + time_list.Append(base::Value(base::Time::Now().InSecondsFSinceUnixEpoch())); + time_list.Append(base::Value(base::Time::Now().InSecondsFSinceUnixEpoch())); + time_list.Append(base::Value(base::Time::Now().InSecondsFSinceUnixEpoch())); + + profile_->GetPrefs()->SetList(prefs::kSafeBrowsingCsdPingTimestamps, + std::move(time_list)); + + csd_service_ = std::make_unique<ClientSideDetectionService>( + std::make_unique<ChromeClientSideDetectionServiceDelegate>(profile_), + model_observer_tracker_.get(), background_task_runner_); + EXPECT_TRUE(AtPhishingReportLimit()); +} + +TEST_P(ClientSideDetectionServiceTest, + GetNumReportTestWhenPrefsPreloadedNotOverLimit) { + // The current report limit is 3 as per + // ClientSideDetectionService::kMaxReportsPerInterval. + base::Value::List time_list; + time_list.Append(base::Value(base::Time::Now().InSecondsFSinceUnixEpoch())); + time_list.Append(base::Value(base::Time::Now().InSecondsFSinceUnixEpoch())); + + profile_->GetPrefs()->SetList(prefs::kSafeBrowsingCsdPingTimestamps, + std::move(time_list)); + + csd_service_ = std::make_unique<ClientSideDetectionService>( + std::make_unique<ChromeClientSideDetectionServiceDelegate>(profile_), + model_observer_tracker_.get(), background_task_runner_); + EXPECT_FALSE(AtPhishingReportLimit()); } TEST_P(ClientSideDetectionServiceTest, GetNumReportTestESB) { @@ -485,16 +528,32 @@ csd_service_->AddPhishingReport(now - twenty_five_hours); csd_service_->AddPhishingReport(now); csd_service_->AddPhishingReport(now); - csd_service_->AddPhishingReport(now); + + EXPECT_EQ(2, csd_service_->GetPhishingNumReports()); + // We have not quite hit the limit for both ESB and SSB users. + EXPECT_FALSE(AtPhishingReportLimit()); + + // Adding one more will hit the limit just for SSB users. csd_service_->AddPhishingReport(now); - EXPECT_EQ(4, csd_service_->GetPhishingNumReports()); - + EXPECT_EQ(3, csd_service_->GetPhishingNumReports()); if (base::FeatureList::IsEnabled(kSafeBrowsingDailyPhishingReportsLimit)) { - EXPECT_FALSE(OverPhishingReportLimit()); + EXPECT_FALSE(AtPhishingReportLimit()); } else { - EXPECT_TRUE(OverPhishingReportLimit()); + EXPECT_TRUE(AtPhishingReportLimit()); } + + // Adding 7 more to 10 reports total will hit the limit for ESB users as the + // limit is predefined in this class. + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + csd_service_->AddPhishingReport(now); + + EXPECT_TRUE(AtPhishingReportLimit()); } TEST_P(ClientSideDetectionServiceTest, CacheTest) {
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc index 54227906..36a814d2 100644 --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
@@ -242,8 +242,6 @@ LastDownloadFinder::~LastDownloadFinder() { g_browser_process->profile_manager()->RemoveObserver(this); - for (const auto& state : profile_states_) - state.first->RemoveObserver(this); } // static @@ -254,8 +252,9 @@ base::WrapUnique(new LastDownloadFinder( std::move(download_details_getter), std::move(callback)))); // Return NULL if there is no work to do. - if (finder->profile_states_.empty()) + if (finder->pending_profiles_.empty()) { return nullptr; + } return finder; } @@ -276,35 +275,50 @@ g_browser_process->profile_manager()->AddObserver(this); } +LastDownloadFinder::PendingProfileData::PendingProfileData( + LastDownloadFinder* finder, + Profile* profile, + State state) + : state(state), observation(finder) { + observation.Observe(profile); +} + +LastDownloadFinder::PendingProfileData::~PendingProfileData() = default; + +// static +LastDownloadFinder::ProfileKey LastDownloadFinder::KeyForProfile( + Profile* profile) { + return ProfileKey(reinterpret_cast<std::uintptr_t>(profile)); +} + void LastDownloadFinder::SearchInProfile(Profile* profile) { // Do not look in OTR profiles or in profiles that do not participate in // safe browsing extended reporting. if (!IncidentReportingService::IsEnabledForProfile(profile)) return; - // Exit early if already processing this profile. This could happen if, for - // example, OnProfileAdded is called after construction while waiting for - // OnHistoryServiceLoaded. - if (profile_states_.count(profile)) + // Try to initiate a metadata search. + ProfileKey profile_key = KeyForProfile(profile); + auto [iter, inserted] = pending_profiles_.try_emplace( + profile_key, this, profile, PendingProfileData::WAITING_FOR_METADATA); + + // If the profile was already being processed, do nothing. + if (!inserted) { return; - - profile->AddObserver(this); - - // Initiate a metadata search. As with IncidentReportingService, it's assumed - // that all passed profiles will outlive |this|. - profile_states_[profile] = WAITING_FOR_METADATA; + } download_details_getter_.Run( profile, base::BindOnce(&LastDownloadFinder::OnMetadataQuery, - weak_ptr_factory_.GetWeakPtr(), profile)); + weak_ptr_factory_.GetWeakPtr(), profile_key)); } void LastDownloadFinder::OnMetadataQuery( - Profile* profile, + ProfileKey profile_key, std::unique_ptr<ClientIncidentReport_DownloadDetails> details) { - auto iter = profile_states_.find(profile); + auto iter = pending_profiles_.find(profile_key); // Early-exit if the search for this profile was abandoned. - if (iter == profile_states_.end()) + if (iter == pending_profiles_.end()) { return; + } if (details) { if (IsMostInterestingBinary(*details, details_.get(), @@ -312,14 +326,14 @@ details_ = std::move(details); most_recent_binary_row_.end_time = base::Time(); } - iter->second = WAITING_FOR_NON_BINARY_HISTORY; + iter->second.state = PendingProfileData::WAITING_FOR_NON_BINARY_HISTORY; } else { - iter->second = WAITING_FOR_HISTORY; + iter->second.state = PendingProfileData::WAITING_FOR_HISTORY; } // Initiate a history search history::HistoryService* history_service = - HistoryServiceFactory::GetForProfile(profile, + HistoryServiceFactory::GetForProfile(iter->second.profile(), ServiceAccessType::IMPLICIT_ACCESS); // No history service is returned for profiles that do not save history. if (!history_service) { @@ -329,7 +343,7 @@ if (history_service->BackendLoaded()) { history_service->QueryDownloads( base::BindOnce(&LastDownloadFinder::OnDownloadQuery, - weak_ptr_factory_.GetWeakPtr(), profile)); + weak_ptr_factory_.GetWeakPtr(), profile_key)); } else { // else wait until history is loaded. history_service_observations_.AddObservation(history_service); @@ -337,15 +351,16 @@ } void LastDownloadFinder::OnDownloadQuery( - Profile* profile, + ProfileKey profile_key, std::vector<history::DownloadRow> downloads) { // Early-exit if the history search for this profile was abandoned. - auto iter = profile_states_.find(profile); - if (iter == profile_states_.end()) + auto iter = pending_profiles_.find(profile_key); + if (iter == pending_profiles_.end()) { return; + } // Don't overwrite the download from metadata if it came from this profile. - if (iter->second == WAITING_FOR_HISTORY) { + if (iter->second.state == PendingProfileData::WAITING_FOR_HISTORY) { // Find the most recent from this profile and use it if it's better than // anything else found so far. const history::DownloadRow* profile_best_binary = @@ -370,19 +385,19 @@ } void LastDownloadFinder::RemoveProfileAndReportIfDone( - std::map<Profile*, ProfileWaitState>::iterator iter) { - DCHECK(iter != profile_states_.end()); - iter->first->RemoveObserver(this); - profile_states_.erase(iter); + PendingProfilesMap::iterator iter) { + CHECK(iter != pending_profiles_.end()); + pending_profiles_.erase(iter); // Finish processing if all results are in. - if (profile_states_.empty()) + if (pending_profiles_.empty()) { ReportResults(); + } // Do not touch this LastDownloadFinder after reporting results. } void LastDownloadFinder::ReportResults() { - DCHECK(profile_states_.empty()); + CHECK(pending_profiles_.empty()); std::unique_ptr<ClientIncidentReport_DownloadDetails> binary_details; std::unique_ptr<ClientIncidentReport_NonBinaryDownloadDetails> @@ -414,25 +429,27 @@ } void LastDownloadFinder::OnProfileWillBeDestroyed(Profile* profile) { - // |profile| may not be present in the set of profiles. - auto iter = profile_states_.find(profile); - DCHECK(iter != profile_states_.end()); + // If a Profile is about to be destroyed while we are observing it, the + // `profile` must be present in the map of pending queries. + auto iter = pending_profiles_.find(KeyForProfile(profile)); + CHECK(iter != pending_profiles_.end()); RemoveProfileAndReportIfDone(iter); } void LastDownloadFinder::OnHistoryServiceLoaded( history::HistoryService* history_service) { - for (const auto& pair : profile_states_) { + for (auto& [profile_key, profile_data] : pending_profiles_) { history::HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists( - pair.first, ServiceAccessType::EXPLICIT_ACCESS); + profile_data.profile(), ServiceAccessType::EXPLICIT_ACCESS); if (hs == history_service) { // Start the query in the history service if the finder was waiting for // the service to load. - if (pair.second == WAITING_FOR_HISTORY || - pair.second == WAITING_FOR_NON_BINARY_HISTORY) { + if (profile_data.state == PendingProfileData::WAITING_FOR_HISTORY || + profile_data.state == + PendingProfileData::WAITING_FOR_NON_BINARY_HISTORY) { history_service->QueryDownloads( base::BindOnce(&LastDownloadFinder::OnDownloadQuery, - weak_ptr_factory_.GetWeakPtr(), pair.first)); + weak_ptr_factory_.GetWeakPtr(), profile_key)); } return; }
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h index fe26f176..71e3e46 100644 --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ +#include <stdint.h> + #include <map> #include <memory> #include <vector> @@ -12,6 +14,8 @@ #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" #include "base/scoped_multi_source_observation.h" +#include "base/scoped_observation.h" +#include "base/types/strong_alias.h" #include "chrome/browser/profiles/profile_manager_observer.h" #include "chrome/browser/profiles/profile_observer.h" #include "chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.h" @@ -65,15 +69,43 @@ LastDownloadFinder(); private: - enum ProfileWaitState { - WAITING_FOR_METADATA, - WAITING_FOR_HISTORY, - WAITING_FOR_NON_BINARY_HISTORY, + // Holds state for a Profile for which a query is currently pending. The State + // describes what we are waiting for. The observation is a mechanism to ensure + // that we do not attempt to process the results of a search for a Profile + // that is no longer valid. This guarantees that a PendingProfileData exists + // iff the Profile is alive and we are waiting on a query for it. + struct PendingProfileData { + enum State { + WAITING_FOR_METADATA, + WAITING_FOR_HISTORY, + WAITING_FOR_NON_BINARY_HISTORY, + }; + + // Makes the `finder` start observing `profile`. + PendingProfileData(LastDownloadFinder* finder, + Profile* profile, + State state); + + ~PendingProfileData(); + + Profile* profile() { return observation.GetSource(); } + + State state; + base::ScopedObservation<Profile, LastDownloadFinder> observation; }; + // We identify Profiles by their addresses, in the form of a uintptr_t value, + // which is derived from a Profile* but is not to be dereferenced. + using ProfileKey = base::StrongAlias<class ProfileKeyTag, uintptr_t>; + + using PendingProfilesMap = std::map<ProfileKey, PendingProfileData>; + LastDownloadFinder(DownloadDetailsGetter download_details_getter, LastDownloadCallback callback); + // Returns the address of the Profile in a safe form to be used as a map key. + static inline ProfileKey KeyForProfile(Profile* profile); + // Adds |profile| to the set of profiles to be searched if it is an // on-the-record profile with history that participates in safe browsing // extended reporting. A search for metadata is initiated immediately. @@ -84,19 +116,19 @@ // begins a search in history. Reports results if there are no more pending // queries. void OnMetadataQuery( - Profile* profile, + ProfileKey profile_key, std::unique_ptr<ClientIncidentReport_DownloadDetails> details); // HistoryService::DownloadQueryCallback. Retrieves the most recent completed // executable download from |downloads| and reports results if there are no // more pending queries. - void OnDownloadQuery(Profile* profile, + void OnDownloadQuery(ProfileKey profile_key, std::vector<history::DownloadRow> downloads); - // Removes the profile pointed to by |it| from profile_states_ and reports - // results if there are no more pending queries. - void RemoveProfileAndReportIfDone( - std::map<Profile*, ProfileWaitState>::iterator iter); + // Severs ties with the Profile whose state is pointed at by `iter` within + // `pending_profiles_`, either after a query finishes or to abandon an ongoing + // query. Also reports results if there are no more pending queries. + void RemoveProfileAndReportIfDone(PendingProfilesMap::iterator iter); // Invokes the caller-supplied callback with the download found. void ReportResults(); @@ -120,9 +152,10 @@ // found. LastDownloadCallback callback_; - // A mapping of profiles for which a download query is pending to their - // respective states. - std::map<Profile*, ProfileWaitState> profile_states_; + // A mapping of profiles for which a query is pending to their respective + // states. Items are removed from here when a query finishes, or when we + // abandon a query. + PendingProfilesMap pending_profiles_; // The most interesting download details retrieved from download metadata. std::unique_ptr<ClientIncidentReport_DownloadDetails> details_;
diff --git a/chrome/browser/sessions/session_restore_delegate.h b/chrome/browser/sessions/session_restore_delegate.h index 247a7de..bdb2ed54 100644 --- a/chrome/browser/sessions/session_restore_delegate.h +++ b/chrome/browser/sessions/session_restore_delegate.h
@@ -46,12 +46,6 @@ return group_; } - // Starts or stops tracking the lifetime of the WebContents. Starting - // results in CHECKing if the WebContents is destroyed. Used for - // https://crbug.com/1482502 . - void StartTrackingWebContentsLifetime(); - void StopTrackingWebContentsLifetime(); - private: // During restore it's possible for some WebContents to be deleted, which // is why this is a WeakPtr. Before SessionRestore calls to RestoreTabs()
diff --git a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc index fefa648..1ff8f2d 100644 --- a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc
@@ -20,6 +20,7 @@ #include "build/buildflag.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/sync/account_bookmark_sync_service_factory.h" #include "chrome/browser/sync/device_info_sync_service_factory.h" #include "chrome/browser/sync/local_or_syncable_bookmark_sync_service_factory.h" #include "chrome/browser/sync/sync_invalidations_service_factory.h" @@ -2620,6 +2621,78 @@ EXPECT_THAT(model->account_bookmark_bar_node()->children(), ElementsAre(IsFolderWithTitle(kInitiallyAccountTitle))); } + +IN_PROC_BROWSER_TEST_F(SingleClientBookmarksWithAccountStorageSyncTest, + PRE_ShouldPersistIfInitialUpdatesCrossMaxCountLimit) { + // Create two bookmarks on the server under BookmarkBar with a truncated + // title. + fake_server::EntityBuilderFactory entity_builder_factory; + const std::string kTitle1 = "title1"; + const std::string kUrl1 = "http://www.url1.com"; + fake_server_->InjectEntity( + entity_builder_factory.NewBookmarkEntityBuilder(kTitle1).BuildBookmark( + GURL(kUrl1))); + + const std::string kTitle2 = "title2"; + const std::string kUrl2 = "http://www.url2.com"; + fake_server_->InjectEntity( + entity_builder_factory.NewBookmarkEntityBuilder(kTitle2).BuildBookmark( + GURL(kUrl2))); + + ASSERT_TRUE(SetupClients()); + // Set a limit of 4 bookmarks. This should result in an error when we get an + // update of size 5. + AccountBookmarkSyncServiceFactory::GetForProfile( + GetProfile(kSingleProfileIndex)) + ->SetBookmarksLimitForTesting(4); + // Setup a primary account, but don't actually enable Sync-the-feature (so + // that Sync will start in transport mode). + ASSERT_TRUE(GetClient(kSingleProfileIndex)->SignInPrimaryAccount()); + // Note: Depending on the state of feature flags (specifically + // kReplaceSyncPromosWithSignInPromos), Bookmarks may or may not be considered + // selected by default. + GetSyncService(kSingleProfileIndex) + ->GetUserSettings() + ->SetSelectedType(syncer::UserSelectableType::kBookmarks, true); + + // Update of size 5 exceeds the limit. + EXPECT_TRUE( + BookmarksDataTypeErrorChecker(GetClient(kSingleProfileIndex)->service()) + .Wait()); + + BookmarkModel* model = GetBookmarkModel(kSingleProfileIndex); + EXPECT_THAT(model->account_bookmark_bar_node(), IsNull()); + EXPECT_THAT(model->account_other_node(), IsNull()); + EXPECT_THAT(model->account_mobile_node(), IsNull()); + + // Bookmarks should be in an error state. Thus excluding it from the + // CheckForDataTypeFailures() check. + ExcludeDataTypesFromCheckForDataTypeFailures({syncer::BOOKMARKS}); +} + +IN_PROC_BROWSER_TEST_F(SingleClientBookmarksWithAccountStorageSyncTest, + ShouldPersistIfInitialUpdatesCrossMaxCountLimit) { + ASSERT_TRUE(SetupClients()); + ASSERT_TRUE(GetClient(kSingleProfileIndex)->AwaitEngineInitialization()); + + // The fact that too many bookmarks were downloaded should have been persisted + // and hence remembered now. Note that this test doesn't override + // SetBookmarksLimitForTesting(), so the error must have been detected in + // the PRE_ test. + EXPECT_TRUE( + BookmarksDataTypeErrorChecker(GetClient(kSingleProfileIndex)->service()) + .Wait()); + + // Account permanent nodes should remain absent. + BookmarkModel* model = GetBookmarkModel(kSingleProfileIndex); + EXPECT_THAT(model->account_bookmark_bar_node(), IsNull()); + EXPECT_THAT(model->account_other_node(), IsNull()); + EXPECT_THAT(model->account_mobile_node(), IsNull()); + + // Bookmarks should be in an error state. Thus excluding it from the + // CheckForDataTypeFailures() check. + ExcludeDataTypesFromCheckForDataTypeFailures({syncer::BOOKMARKS}); +} #endif // !BUILDFLAG(IS_ANDROID) // Android doesn't currently support PRE_ tests, see crbug.com/40200835 or
diff --git a/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc index d33fdb3..40a107fc 100644 --- a/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_web_apps_sync_test.cc
@@ -52,7 +52,7 @@ void Wait() { run_loop_.Run(); } - void OnAppRegistrarDestroyed() override { NOTREACHED(); } + void OnAppRegistrarDestroyed() override { NOTREACHED_IN_MIGRATION(); } private: base::RunLoop run_loop_;
diff --git a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupColorUtils.java b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupColorUtils.java index e846e19..4b3a1ad 100644 --- a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupColorUtils.java +++ b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupColorUtils.java
@@ -43,15 +43,15 @@ * * @param tabRootId The tab root ID whose related tab group color will be deleted. */ - public static void deleteTabGroupColor(int tabRootId) { + static void deleteTabGroupColor(int tabRootId) { assert tabRootId != Tab.INVALID_TAB_ID; getSharedPreferences().edit().remove(String.valueOf(tabRootId)).apply(); } /** * This method fetches tab group colors for the related tab group root ID. While currently - * public, the intent is to make this package protected and force all access to go through the - * {@Link TabGroupModelFilter}. + * public, the intent is to make thisUndo package protected and force all access to go through + * the {@Link TabGroupModelFilter}. * * @param tabRootId The tab root ID whose related tab group color will be fetched. * @return The stored color of the target tab group, default value is -1 (INVALID_COLOR_ID).
diff --git a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java index d89834f..79d6387a 100644 --- a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java +++ b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java
@@ -644,6 +644,8 @@ assert currentIndex != TabModel.INVALID_TAB_INDEX; boolean isChangingRootIds = tab.getRootId() != originalRootId; + boolean isChangingStableIds = !Objects.equals(tab.getTabGroupId(), originalTabGroupId); + boolean isChangingGroups = isChangingRootIds || isChangingStableIds; boolean isChangingIndex = currentIndex != originalIndex; // We need to explicitly trigger `didMoveTabOutOfGroup` if the tab is changing groups so @@ -652,13 +654,13 @@ // groups because it lacks enough context, hence the `mIsUndoing` variable is used as a // bodge to communicate this. Then we signal `didMergeTabToGroup` separately afterwards // so long as the tab is actually becoming part of a tab group. - mIsUndoing = isChangingRootIds; + mIsUndoing = isChangingGroups; setBothGroupIds(tab, originalRootId, originalTabGroupId); if (isChangingIndex) { if (currentIndex < originalIndex) originalIndex++; getTabModel().moveTab(tab.getId(), originalIndex); - } else if (isChangingRootIds) { + } else if (isChangingGroups) { didMoveTab(tab, originalIndex, currentIndex); } // Else we can ignore tabs that remain at the same index if they are not changing root IDs. @@ -668,7 +670,7 @@ // If undoing results in restoring a tab into a different group then notify observers it was // added. // TODO(b/b/339480464): Emit a matching willMergeTabToGroup somewhere upstream. - if (isChangingRootIds && isTabInTabGroup(tab)) { + if (isChangingGroups && isTabInTabGroup(tab)) { TabGroup group = mRootIdToGroupMap.get(originalRootId); // Last shown tab IDs are not preserved across an undo. for (TabGroupModelFilterObserver observer : mGroupFilterObserver) { @@ -1468,6 +1470,14 @@ } } + /** Deletes the color that was recorded for the group. */ + public void deleteTabGroupColor(int rootId) { + TabGroupColorUtils.deleteTabGroupColor(rootId); + for (TabGroupModelFilterObserver observer : mGroupFilterObserver) { + observer.didChangeTabGroupColor(rootId, TabGroupColorId.GREY); + } + } + /** Sets whether the tab group is expanded or collapsed. */ public void setTabGroupCollapsed(int rootId, boolean isCollapsed) { TabGroupCollapsedUtils.storeTabGroupCollapsed(rootId, isCollapsed);
diff --git a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupTitleUtils.java b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupTitleUtils.java index 38e34dd2..9a6802c 100644 --- a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupTitleUtils.java +++ b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupTitleUtils.java
@@ -40,8 +40,7 @@ * * @param tabRootId The tab root ID whose related tab group title will be deleted. */ - // Package Private. - public static void deleteTabGroupTitle(int tabRootId) { + static void deleteTabGroupTitle(int tabRootId) { assert tabRootId != Tab.INVALID_TAB_ID; getSharedPreferences().edit().remove(String.valueOf(tabRootId)).apply(); }
diff --git a/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java b/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java index cf4a097..a757a1a 100644 --- a/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java +++ b/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java
@@ -1724,6 +1724,53 @@ } @Test + public void undoGroupedTabGroup_ToTab() { + List<Tab> expectedTabModel = + new ArrayList<>(Arrays.asList(mTab1, mTab2, mTab3, mTab4, mTab5, mTab6)); + + // Simulate we just grouped the group (mTab2, mTab3) with mTab1. + mTab1.setRootId(TAB1_ROOT_ID); + mTab2.setRootId(TAB1_ROOT_ID); + mTab3.setRootId(TAB1_ROOT_ID); + mTab1.setTabGroupId(TAB2_TAB_GROUP_ID); + mTab2.setTabGroupId(TAB2_TAB_GROUP_ID); + mTab3.setTabGroupId(TAB2_TAB_GROUP_ID); + mTabGroupModelFilter.resetFilterState(); + assertThat(mTab1.getRootId(), equalTo(TAB1_ROOT_ID)); + assertThat(mTab2.getRootId(), equalTo(TAB1_ROOT_ID)); + assertThat(mTab3.getRootId(), equalTo(TAB1_ROOT_ID)); + assertThat(mTab1.getTabGroupId(), equalTo(TAB2_TAB_GROUP_ID)); + assertThat(mTab2.getTabGroupId(), equalTo(TAB2_TAB_GROUP_ID)); + assertThat(mTab3.getTabGroupId(), equalTo(TAB2_TAB_GROUP_ID)); + assertThat(mTabGroupModelFilter.indexOf(mTab1), equalTo(0)); + assertThat(mTabGroupModelFilter.indexOf(mTab2), equalTo(0)); + assertThat(mTabGroupModelFilter.indexOf(mTab3), equalTo(0)); + assertArrayEquals(mTabs.toArray(), expectedTabModel.toArray()); + + // Undo the grouped action in reverse order so indexes are correct. + mTabGroupModelFilter.undoGroupedTab(mTab3, POSITION2, TAB2_ROOT_ID, TAB2_TAB_GROUP_ID); + verify(mTabGroupModelFilterObserver).didMoveTabOutOfGroup(mTab3, POSITION1); + verify(mTabGroupModelFilterObserver).didMergeTabToGroup(mTab3, mTab3.getId()); + mTabGroupModelFilter.undoGroupedTab(mTab2, POSITION2, TAB2_ROOT_ID, TAB2_TAB_GROUP_ID); + verify(mTabGroupModelFilterObserver).didMoveTabOutOfGroup(mTab2, POSITION1); + verify(mTabGroupModelFilterObserver).didMergeTabToGroup(mTab2, mTab3.getId()); + mTabGroupModelFilter.undoGroupedTab(mTab1, POSITION1, TAB1_ROOT_ID, null); + verify(mTabGroupModelFilterObserver).didMoveTabOutOfGroup(mTab1, POSITION1); + verify(mTabGroupModelFilterObserver, never()).didMergeTabToGroup(eq(mTab1), anyInt()); + + assertArrayEquals(mTabs.toArray(), expectedTabModel.toArray()); + assertThat(mTab1.getRootId(), equalTo(TAB1_ROOT_ID)); + assertThat(mTab2.getRootId(), equalTo(TAB2_ROOT_ID)); + assertThat(mTab3.getRootId(), equalTo(TAB2_ROOT_ID)); + assertNull(mTab1.getTabGroupId()); + assertThat(mTab2.getTabGroupId(), equalTo(TAB2_TAB_GROUP_ID)); + assertThat(mTab3.getTabGroupId(), equalTo(TAB2_TAB_GROUP_ID)); + assertThat(mTabGroupModelFilter.indexOf(mTab1), equalTo(0)); + assertThat(mTabGroupModelFilter.indexOf(mTab2), equalTo(1)); + assertThat(mTabGroupModelFilter.indexOf(mTab3), equalTo(1)); + } + + @Test public void undoGroupedTab_MultipleGroupUndoWithMovement() { List<Tab> expectedTabModel = new ArrayList<>(Arrays.asList(mTab1, mTab2, mTab3, mTab6, mTab5, mTab4));
diff --git a/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodControllerRobolectricTest.java b/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodControllerRobolectricTest.java index 30a6920..d9e2c98 100644 --- a/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodControllerRobolectricTest.java +++ b/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodControllerRobolectricTest.java
@@ -20,7 +20,10 @@ import static org.chromium.chrome.browser.autofill.AutofillTestHelper.createVirtualCreditCard; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_CREDIT_CARD_INDEX_SELECTED; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_CREDIT_CARD_OUTCOME_HISTOGRAM; +import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_IBAN_INDEX_SELECTED; +import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_NUMBER_OF_CARDS_SHOWN; +import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TOUCH_TO_FILL_NUMBER_OF_IBANS_SHOWN; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.CreditCardProperties.CARD_NAME; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.CreditCardProperties.CARD_NUMBER; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.CreditCardProperties.NETWORK_NAME; @@ -30,6 +33,7 @@ import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.FooterProperties.SHOW_PAYMENT_METHOD_SETTINGS_CALLBACK; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.IbanProperties.IBAN_NICKNAME; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.IbanProperties.IBAN_VALUE; +import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.IbanProperties.ON_IBAN_CLICK_ACTION; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.ItemType.CREDIT_CARD; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.ItemType.FILL_BUTTON; import static org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodProperties.ItemType.FOOTER; @@ -65,6 +69,7 @@ import org.chromium.chrome.browser.autofill.PersonalDataManager.Iban; import org.chromium.chrome.browser.touch_to_fill.common.BottomSheetFocusHelper; import org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TouchToFillCreditCardOutcome; +import org.chromium.chrome.browser.touch_to_fill.payments.TouchToFillPaymentMethodMediator.TouchToFillIbanOutcome; import org.chromium.components.autofill.AutofillFeatures; import org.chromium.components.browser_ui.bottomsheet.BottomSheetContent; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; @@ -469,6 +474,10 @@ public void testShowIbansWithOneEntry() throws TimeoutException { mCoordinator.showSheet(List.of(LOCAL_IBAN)); + assertEquals( + 1, + RecordHistogram.getHistogramValueCountForTesting( + TOUCH_TO_FILL_NUMBER_OF_IBANS_SHOWN, 1)); ModelList itemList = mTouchToFillPaymentMethodModel.get(SHEET_ITEMS); assertThat(getModelsOfType(itemList, IBAN).size(), is(1)); @@ -484,6 +493,10 @@ public void testShowIbansWithTwoEntries() throws TimeoutException { mCoordinator.showSheet(List.of(LOCAL_IBAN, LOCAL_IBAN_NO_NICKNAME)); + assertEquals( + 1, + RecordHistogram.getHistogramValueCountForTesting( + TOUCH_TO_FILL_NUMBER_OF_IBANS_SHOWN, 2)); ModelList itemList = mTouchToFillPaymentMethodModel.get(SHEET_ITEMS); assertThat(getModelsOfType(itemList, IBAN).size(), is(2)); @@ -510,6 +523,33 @@ .get(SHOW_PAYMENT_METHOD_SETTINGS_CALLBACK) .run(); verify(mDelegateMock).showPaymentMethodSettings(); + assertEquals( + 1, + RecordHistogram.getHistogramValueCountForTesting( + TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM, + TouchToFillIbanOutcome.MANAGE_PAYMENTS)); + } + + @Test + public void testCallsDelegateForIbanOnSelectingItem() { + mCoordinator.showSheet(List.of(LOCAL_IBAN)); + assertThat(mTouchToFillPaymentMethodModel.get(VISIBLE), is(true)); + + Optional<PropertyModel> ibanModel = + getIbanModelByAutofillName( + mTouchToFillPaymentMethodModel.get(SHEET_ITEMS), LOCAL_IBAN); + assertNotNull(ibanModel.get()); + mClock.advanceCurrentTimeMillis(InputProtector.POTENTIALLY_UNINTENDED_INPUT_THRESHOLD); + ibanModel.get().get(ON_IBAN_CLICK_ACTION).run(); + verify(mDelegateMock).localIbanSuggestionSelected(LOCAL_IBAN.getGuid()); + assertEquals( + 1, + RecordHistogram.getHistogramValueCountForTesting( + TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM, TouchToFillIbanOutcome.IBAN)); + assertEquals( + 1, + RecordHistogram.getHistogramValueCountForTesting( + TOUCH_TO_FILL_IBAN_INDEX_SELECTED, 0)); } @Test
diff --git a/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodMediator.java b/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodMediator.java index f540324c..aba40aa 100644 --- a/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodMediator.java +++ b/chrome/browser/touch_to_fill/autofill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/payments/TouchToFillPaymentMethodMediator.java
@@ -53,7 +53,7 @@ */ class TouchToFillPaymentMethodMediator { /** - * The final outcome that closes the Touch To Fill sheet. + * The final outcome that closes the credit card Touch To Fill sheet. * * <p>Entries should not be renumbered and numeric values should never be reused. Needs to stay * in sync with TouchToFill.CreditCard.Outcome in enums.xml. @@ -75,6 +75,25 @@ int MAX_VALUE = DISMISS; } + /** + * The final outcome that closes the IBAN Touch To Fill sheet. + * + * <p>Entries should not be renumbered and numeric values should never be reused. Needs to stay + * in sync with TouchToFill.Iban.Outcome in enums.xml. + */ + @IntDef({ + TouchToFillIbanOutcome.IBAN, + TouchToFillIbanOutcome.MANAGE_PAYMENTS, + TouchToFillIbanOutcome.DISMISS + }) + @Retention(RetentionPolicy.SOURCE) + @interface TouchToFillIbanOutcome { + int IBAN = 0; + int MANAGE_PAYMENTS = 1; + int DISMISS = 2; + int MAX_VALUE = DISMISS; + } + @VisibleForTesting static final String TOUCH_TO_FILL_CREDIT_CARD_OUTCOME_HISTOGRAM = "Autofill.TouchToFill.CreditCard.Outcome2"; @@ -87,6 +106,17 @@ static final String TOUCH_TO_FILL_NUMBER_OF_CARDS_SHOWN = "Autofill.TouchToFill.CreditCard.NumberOfCardsShown"; + @VisibleForTesting + static final String TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM = "Autofill.TouchToFill.Iban.Outcome"; + + @VisibleForTesting + static final String TOUCH_TO_FILL_IBAN_INDEX_SELECTED = + "Autofill.TouchToFill.Iban.SelectedIndex"; + + @VisibleForTesting + static final String TOUCH_TO_FILL_NUMBER_OF_IBANS_SHOWN = + "Autofill.TouchToFill.Iban.NumberOfIbansShown"; + // TODO(crbug.com/40246126): Remove the Context from the Mediator. private Context mContext; private TouchToFillPaymentMethodComponent.Delegate mDelegate; @@ -118,6 +148,7 @@ assert cards != null; mCards = cards; + mIbans = null; ModelList sheetItems = mModel.get(SHEET_ITEMS); sheetItems.clear(); @@ -152,6 +183,7 @@ assert ibans != null; mIbans = ibans; + mCards = null; ModelList sheetItems = mModel.get(SHEET_ITEMS); sheetItems.clear(); @@ -173,7 +205,8 @@ mBottomSheetFocusHelper.registerForOneTimeUse(); mModel.set(VISIBLE, true); - // TODO(b/332193789): Add IBAN-related metrics. + + RecordHistogram.recordCount100Histogram(TOUCH_TO_FILL_NUMBER_OF_IBANS_SHOWN, mIbans.size()); } void hideSheet() { @@ -190,27 +223,41 @@ || reason == StateChangeReason.TAP_SCRIM; mDelegate.onDismissed(dismissedByUser); if (dismissedByUser) { - RecordHistogram.recordEnumeratedHistogram( - TOUCH_TO_FILL_CREDIT_CARD_OUTCOME_HISTOGRAM, - TouchToFillCreditCardOutcome.DISMISS, - TouchToFillCreditCardOutcome.MAX_VALUE + 1); + if (mCards != null) { + RecordHistogram.recordEnumeratedHistogram( + TOUCH_TO_FILL_CREDIT_CARD_OUTCOME_HISTOGRAM, + TouchToFillCreditCardOutcome.DISMISS, + TouchToFillCreditCardOutcome.MAX_VALUE + 1); + } else { + assert mIbans != null; + RecordHistogram.recordEnumeratedHistogram( + TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM, + TouchToFillIbanOutcome.DISMISS, + TouchToFillIbanOutcome.MAX_VALUE + 1); + } } } public void scanCreditCard() { mDelegate.scanCreditCard(); - recordTouchToFillOutcomeHistogram(TouchToFillCreditCardOutcome.SCAN_NEW_CARD); + recordTouchToFillCreditCardOutcomeHistogram(TouchToFillCreditCardOutcome.SCAN_NEW_CARD); } public void showPaymentMethodSettings() { mDelegate.showPaymentMethodSettings(); - recordTouchToFillOutcomeHistogram(TouchToFillCreditCardOutcome.MANAGE_PAYMENTS); + if (mCards != null) { + recordTouchToFillCreditCardOutcomeHistogram( + TouchToFillCreditCardOutcome.MANAGE_PAYMENTS); + } else { + assert mIbans != null; + recordTouchToFillIbanOutcomeHistogram(TouchToFillIbanOutcome.MANAGE_PAYMENTS); + } } public void onSelectedCreditCard(CreditCard card) { if (!mInputProtector.shouldInputBeProcessed()) return; mDelegate.creditCardSuggestionSelected(card.getGUID(), card.getIsVirtual()); - recordTouchToFillOutcomeHistogram( + recordTouchToFillCreditCardOutcomeHistogram( card.getIsVirtual() ? TouchToFillCreditCardOutcome.VIRTUAL_CARD : TouchToFillCreditCardOutcome.CREDIT_CARD); @@ -225,6 +272,9 @@ } else { mDelegate.serverIbanSuggestionSelected(iban.getInstrumentId()); } + recordTouchToFillIbanOutcomeHistogram(TouchToFillIbanOutcome.IBAN); + RecordHistogram.recordCount100Histogram( + TOUCH_TO_FILL_IBAN_INDEX_SELECTED, mIbans.indexOf(iban)); } private PropertyModel createCardModel( @@ -339,7 +389,7 @@ return true; } - private static void recordTouchToFillOutcomeHistogram( + private static void recordTouchToFillCreditCardOutcomeHistogram( @TouchToFillCreditCardOutcome int outcome) { RecordHistogram.recordEnumeratedHistogram( TOUCH_TO_FILL_CREDIT_CARD_OUTCOME_HISTOGRAM, @@ -347,6 +397,13 @@ TouchToFillCreditCardOutcome.MAX_VALUE + 1); } + private static void recordTouchToFillIbanOutcomeHistogram(@TouchToFillIbanOutcome int outcome) { + RecordHistogram.recordEnumeratedHistogram( + TOUCH_TO_FILL_IBAN_OUTCOME_HISTOGRAM, + outcome, + TouchToFillIbanOutcome.MAX_VALUE + 1); + } + void setInputProtectorForTesting(InputProtector inputProtector) { mInputProtector = inputProtector; }
diff --git a/chrome/browser/tpcd/metadata/devtools_observer.cc b/chrome/browser/tpcd/metadata/devtools_observer.cc index 550b3f1..788c81f4 100644 --- a/chrome/browser/tpcd/metadata/devtools_observer.cc +++ b/chrome/browser/tpcd/metadata/devtools_observer.cc
@@ -66,12 +66,13 @@ content_settings::SettingInfo out_info; bool allowed = tpcd_metadata_manager_->IsAllowed( third_party_url, first_party_url, &out_info); - CHECK(allowed); - metadata_issue_details->opt_out_percentage = - out_info.metadata.tpcd_metadata_elected_dtrp(); - metadata_issue_details->is_opt_out_top_level = - (out_info.metadata.tpcd_metadata_rule_source() == - TpcdMetadataRuleSource::SOURCE_1P_DT); + if (allowed) { + metadata_issue_details->opt_out_percentage = + out_info.metadata.tpcd_metadata_elected_dtrp(); + metadata_issue_details->is_opt_out_top_level = + (out_info.metadata.tpcd_metadata_rule_source() == + TpcdMetadataRuleSource::SOURCE_1P_DT); + } } details->cookie_deprecation_metadata_issue_details =
diff --git a/chrome/browser/tpcd/metadata/devtools_observer_browsertest.cc b/chrome/browser/tpcd/metadata/devtools_observer_browsertest.cc index fa3db2cf..0afd8543 100644 --- a/chrome/browser/tpcd/metadata/devtools_observer_browsertest.cc +++ b/chrome/browser/tpcd/metadata/devtools_observer_browsertest.cc
@@ -126,15 +126,17 @@ uint32_t opt_out_percentage, bool is_opt_out_top_level) { auto is_metadata_issue = [](const base::Value::Dict& params) { - return *(params.FindStringByDottedPath("issue.code")) == - "CookieDeprecationMetadataIssue"; + const std::string* issue_code = + params.FindStringByDottedPath("issue.code"); + return issue_code && *issue_code == "CookieDeprecationMetadataIssue"; }; // Wait for notification of a Metadata Issue. base::Value::Dict params = WaitForMatchingNotification( "Audits.issueAdded", base::BindRepeating(is_metadata_issue)); - ASSERT_EQ(*params.FindStringByDottedPath("issue.code"), - "CookieDeprecationMetadataIssue"); + const std::string* issue_code = params.FindStringByDottedPath("issue.code"); + ASSERT_TRUE(issue_code); + ASSERT_EQ(*issue_code, "CookieDeprecationMetadataIssue"); base::Value::Dict* metadata_issue_details = params.FindDictByDottedPath( "issue.details.cookieDeprecationMetadataIssueDetails");
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 3cc3f73..e8093d3 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3138,10 +3138,6 @@ "webui/ash/cloud_upload/cloud_upload_util.h", "webui/ash/cloud_upload/drive_upload_handler.cc", "webui/ash/cloud_upload/drive_upload_handler.h", - "webui/ash/cloud_upload/drive_upload_observer.cc", - "webui/ash/cloud_upload/drive_upload_observer.h", - "webui/ash/cloud_upload/odfs_skyvault_uploader.cc", - "webui/ash/cloud_upload/odfs_skyvault_uploader.h", "webui/ash/cloud_upload/one_drive_upload_handler.cc", "webui/ash/cloud_upload/one_drive_upload_handler.h", "webui/ash/connectivity_diagnostics_dialog.cc", @@ -5036,6 +5032,8 @@ "commerce/price_tracking_page_action_controller.h", "commerce/product_specifications_entry_point_controller.cc", "commerce/product_specifications_entry_point_controller.h", + "commerce/product_specifications_page_action_controller.cc", + "commerce/product_specifications_page_action_controller.h", "dialogs/outdated_upgrade_bubble.cc", "dialogs/outdated_upgrade_bubble.h", "plus_addresses/plus_address_creation_controller_desktop.h", @@ -5546,6 +5544,8 @@ "views/fullscreen_control/fullscreen_control_host.h", "views/global_error_bubble_view.cc", "views/global_error_bubble_view.h", + "views/global_media_controls/cast_device_footer_view.cc", + "views/global_media_controls/cast_device_footer_view.h", "views/global_media_controls/cast_device_selector_view.cc", "views/global_media_controls/cast_device_selector_view.h", "views/global_media_controls/media_dialog_view.cc", @@ -7046,6 +7046,35 @@ "webui/print_preview/local_printer_handler_default.h", ] } + + if (is_chromeos_ash) { + sources += [ + "webui/print_preview/extension_printer_handler_adapter_ash.cc", + "webui/print_preview/extension_printer_handler_adapter_ash.h", + ] + deps += [ + "//chromeos/crosapi/cpp", + "//chromeos/crosapi/mojom", + "//chromeos/printing", + ] + } + + if (is_chromeos_lacros) { + sources += [ + "webui/print_preview/extension_printer_service_provider_factory_lacros.cc", + "webui/print_preview/extension_printer_service_provider_factory_lacros.h", + "webui/print_preview/extension_printer_service_provider_lacros.cc", + "webui/print_preview/extension_printer_service_provider_lacros.h", + "webui/print_preview/extension_printer_service_setup_lacros.cc", + "webui/print_preview/extension_printer_service_setup_lacros.h", + ] + deps += [ + "//chromeos/crosapi/cpp", + "//chromeos/crosapi/mojom", + "//chromeos/lacros", + "//chromeos/printing", + ] + } } if (safe_browsing_mode > 0) {
diff --git a/chrome/browser/ui/android/autofill/autofill_save_iban_bottom_sheet_bridge_unittest.cc b/chrome/browser/ui/android/autofill/autofill_save_iban_bottom_sheet_bridge_unittest.cc deleted file mode 100644 index 6702117..0000000 --- a/chrome/browser/ui/android/autofill/autofill_save_iban_bottom_sheet_bridge_unittest.cc +++ /dev/null
@@ -1,96 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/android/autofill/autofill_save_iban_bottom_sheet_bridge.h" -#include <memory> -#include <string> - -#include "base/android/jni_string.h" -#include "base/functional/callback_helpers.h" -#include "base/test/metrics/histogram_tester.h" -#include "base/test/mock_callback.h" -#include "chrome/browser/ui/android/autofill/autofill_save_iban_delegate.h" -#include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "components/autofill/core/browser/autofill_test_utils.h" -#include "content/public/browser/web_contents.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace autofill { -namespace { - -using SaveIbanOfferUserDecision = - payments::PaymentsAutofillClient::SaveIbanOfferUserDecision; - -std::u16string_view kIbanLabel = u"CH56 0483 5012 3456 7800 9"; -std::u16string kUserProvidedNickname = u"My Doctor's IBAN"; - -class AutofillSaveIbanBottomSheetBridgeTest - : public ChromeRenderViewHostTestHarness { - public: - void LocalCallback(SaveIbanOfferUserDecision decision, - std::u16string_view nickname) { - base::DoNothing(); - } - - payments::PaymentsAutofillClient::SaveIbanPromptCallback MakeLocalCallback() { - return base::BindOnce(&AutofillSaveIbanBottomSheetBridgeTest::LocalCallback, - base::Unretained(this)); - } -}; - -class MockDelegate : public AutofillSaveIbanDelegate { - public: - explicit MockDelegate(payments::PaymentsAutofillClient::SaveIbanPromptCallback - save_iban_callback, - content::WebContents* web_contents) - : AutofillSaveIbanDelegate(std::move(save_iban_callback), web_contents) {} - MOCK_METHOD(void, OnUiAccepted, (base::OnceClosure, std::u16string_view)); - MOCK_METHOD(void, OnUiCanceled, ()); - MOCK_METHOD(void, OnUiIgnored, ()); -}; - -// Check OnUiAccepted() is called in delegate. -TEST_F(AutofillSaveIbanBottomSheetBridgeTest, BridgeCallsOnUiAccepted) { - std::unique_ptr<MockDelegate> delegate = - std::make_unique<MockDelegate>(MakeLocalCallback(), web_contents()); - MockDelegate& delegate_reference = *delegate; - AutofillSaveIbanBottomSheetBridge bridge; - bridge.RequestShowContent(kIbanLabel, std::move(delegate)); - - base::MockOnceClosure mock_accept_callback; - EXPECT_CALL(delegate_reference, OnUiAccepted); - - JNIEnv* env = base::android::AttachCurrentThread(); - bridge.OnUiAccepted(env, kUserProvidedNickname); -} - -// Check OnUiCanceled() is called in delegate. -TEST_F(AutofillSaveIbanBottomSheetBridgeTest, BridgeCallsOnUiCanceled) { - std::unique_ptr<MockDelegate> delegate = - std::make_unique<MockDelegate>(MakeLocalCallback(), web_contents()); - MockDelegate& delegate_reference = *delegate; - AutofillSaveIbanBottomSheetBridge bridge; - bridge.RequestShowContent(kIbanLabel, std::move(delegate)); - - EXPECT_CALL(delegate_reference, OnUiCanceled()); - - bridge.OnUiCanceled(/*env=*/nullptr); -} - -// Check OnUiIgnored() is called in delegate. -TEST_F(AutofillSaveIbanBottomSheetBridgeTest, BridgeCallsOnUiIgnored) { - std::unique_ptr<MockDelegate> delegate = - std::make_unique<MockDelegate>(MakeLocalCallback(), web_contents()); - MockDelegate& delegate_reference = *delegate; - AutofillSaveIbanBottomSheetBridge bridge; - bridge.RequestShowContent(kIbanLabel, std::move(delegate)); - - EXPECT_CALL(delegate_reference, OnUiIgnored()); - - bridge.OnUiIgnored(/*env=*/nullptr); -} - -} // namespace -} // namespace autofill
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java index b586264a..09b874f 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java
@@ -237,7 +237,6 @@ // automatically added to the hierarchy, which changes the precondition assumed // by the old logic. The lines below ensure the initial condition is what the // logic expects it to be. - dropdown.setVisibility(View.VISIBLE); UiUtils.removeViewFromParent(dropdown); }
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionListViewBinder.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionListViewBinder.java index b8d6ec4e..0bffd36 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionListViewBinder.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionListViewBinder.java
@@ -10,7 +10,6 @@ import androidx.annotation.Nullable; import org.chromium.chrome.browser.omnibox.R; -import org.chromium.components.omnibox.OmniboxFeatures; import org.chromium.ui.UiUtils; import org.chromium.ui.modelutil.ListObservable; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; @@ -49,24 +48,16 @@ // Ensure the tracked keyboard state is consistent with actual keyboard state. // The keyboard is about to be called up. view.dropdown.resetKeyboardShownState(); - if (OmniboxFeatures.sAsyncViewInflation.isEnabled()) { - view.dropdown.setVisibility(View.VISIBLE); - view.container.setVisibility(View.VISIBLE); - } else if (dropdownView.getParent() == null) { + if (dropdownView.getParent() == null) { view.container.addView(dropdownView); // When showing the suggestions list for the first time, make sure to apply // appropriate visibility to freshly inflated container. // This is later handled by subsequent calls to updateContainerVisibility() // performed whenever the suggestion model list changes. - updateContainerVisibility(model, view.container); + updateContainerVisibility(model, view); } } else { - if (OmniboxFeatures.sAsyncViewInflation.isEnabled()) { - view.container.setVisibility(View.GONE); - view.dropdown.setVisibility(View.GONE); - } else { - UiUtils.removeViewFromParent(dropdownView); - } + UiUtils.removeViewFromParent(dropdownView); } } else if (SuggestionListProperties.EMBEDDER.equals(propertyKey)) { view.dropdown.setEmbedder(model.get(SuggestionListProperties.EMBEDDER)); @@ -101,13 +92,13 @@ @Override public void onItemRangeInserted( ListObservable source, int index, int count) { - updateContainerVisibility(model, view.container); + updateContainerVisibility(model, view); } @Override public void onItemRangeRemoved( ListObservable source, int index, int count) { - updateContainerVisibility(model, view.container); + updateContainerVisibility(model, view); } }); } else if (SuggestionListProperties.COLOR_SCHEME.equals(propertyKey)) { @@ -124,8 +115,11 @@ } } - private static void updateContainerVisibility(PropertyModel model, ViewGroup container) { + private static void updateContainerVisibility( + PropertyModel model, SuggestionListViewHolder holder) { ModelList listItems = model.get(SuggestionListProperties.SUGGESTION_MODELS); - container.setVisibility(listItems.size() == 0 ? View.GONE : View.VISIBLE); + int visibility = listItems.size() == 0 ? View.GONE : View.VISIBLE; + holder.container.setVisibility(visibility); + holder.dropdown.setVisibility(visibility); } }
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsListAnimationDriver.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsListAnimationDriver.java index 2a580f3f..0f45a2c 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsListAnimationDriver.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsListAnimationDriver.java
@@ -56,9 +56,6 @@ } void onOmniboxSessionStateChange(boolean active) { - // Ensure that we always start from the same, known initial state, even when we're starting - // for the first time. - mListPropertyModel.set(SuggestionListProperties.ALPHA, 0.0f); if (active) { InsetObserver insetObserver = InsetObserverSupplier.getValueOrNullFrom(mWindowAndroid); insetObserver.addWindowInsetsAnimationListener(this);
diff --git a/chrome/browser/ui/android/webid/internal/BUILD.gn b/chrome/browser/ui/android/webid/internal/BUILD.gn index 357d4d3..c16c920 100644 --- a/chrome/browser/ui/android/webid/internal/BUILD.gn +++ b/chrome/browser/ui/android/webid/internal/BUILD.gn
@@ -133,6 +133,7 @@ "//chrome/browser/tab:java", "//chrome/browser/tabmodel:java", "//chrome/browser/ui/android/webid:public_java", + "//chrome/browser/webid:java", "//chrome/test/android:chrome_java_integration_test_support", "//components/browser_ui/bottomsheet/android:java", "//components/browser_ui/bottomsheet/android/test:java",
diff --git a/chrome/browser/ui/android/webid/internal/java/src/org/chromium/chrome/browser/ui/android/webid/DigitalIdentitySafetyInterstitialIntegrationTest.java b/chrome/browser/ui/android/webid/internal/java/src/org/chromium/chrome/browser/ui/android/webid/DigitalIdentitySafetyInterstitialIntegrationTest.java index 6e33a38..799a608c 100644 --- a/chrome/browser/ui/android/webid/internal/java/src/org/chromium/chrome/browser/ui/android/webid/DigitalIdentitySafetyInterstitialIntegrationTest.java +++ b/chrome/browser/ui/android/webid/internal/java/src/org/chromium/chrome/browser/ui/android/webid/DigitalIdentitySafetyInterstitialIntegrationTest.java
@@ -32,11 +32,11 @@ import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.webid.DigitalIdentityProvider; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.content_public.browser.ContentFeatureList; import org.chromium.content_public.browser.test.util.DOMUtils; -import org.chromium.content_public.browser.test.util.DigitalCredentialProviderUtils; import org.chromium.content_public.browser.test.util.DigitalCredentialProviderUtils.MockIdentityCredentialsDelegate; import org.chromium.content_public.browser.test.util.JavaScriptUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -143,8 +143,7 @@ public void setUp() { mActivityTestRule.getEmbeddedTestServerRule().setServerUsesHttps(true); mTestServer = mActivityTestRule.getTestServer(); - DigitalCredentialProviderUtils.setDelegateForTesting( - new ReturnTokenIdentityCredentialsDelegate()); + DigitalIdentityProvider.setDelegateForTesting(new ReturnTokenIdentityCredentialsDelegate()); mActivityTestRule.startMainActivityWithURL(mTestServer.getURL(TEST_PAGE)); @@ -303,7 +302,7 @@ public void testNoDialogIfNavigationDuringAndroidOsCall() throws TimeoutException { DelayedReturnIdentityCredentialsDelegate delegate = new DelayedReturnIdentityCredentialsDelegate(); - DigitalCredentialProviderUtils.setDelegateForTesting(delegate); + DigitalIdentityProvider.setDelegateForTesting(delegate); setFieldTrialParam( DigitalIdentitySafetyInterstitialBridge .DIGITAL_IDENTITY_HIGH_RISK_DIALOG_PARAM_VALUE);
diff --git a/chrome/browser/ui/ash/ambient/managed_screensaver_browsertest.cc b/chrome/browser/ui/ash/ambient/managed_screensaver_browsertest.cc index c93ab96..1033fec1d 100644 --- a/chrome/browser/ui/ash/ambient/managed_screensaver_browsertest.cc +++ b/chrome/browser/ui/ash/ambient/managed_screensaver_browsertest.cc
@@ -479,7 +479,7 @@ test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/3, /*timeout=*/3 * kTestPerTransitionTimeout, /*on_complete=*/test_future_->GetCallback(), - /*on_timeout=*/base::BindOnce([]() { NOTREACHED(); })); + /*on_timeout=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); ASSERT_TRUE(test_future_->Wait()); ASSERT_NE(nullptr, GetContainerView()); @@ -490,7 +490,7 @@ test_future_ = std::make_unique<base::test::TestFuture<void>>(); test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/1, /*timeout=*/kTestPerTransitionTimeout, - /*on_complete=*/base::BindOnce([]() { NOTREACHED(); }), + /*on_complete=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }), /*on_timeout=*/test_future_->GetCallback()); ASSERT_TRUE(test_future_->Wait()); { @@ -510,7 +510,7 @@ test_future_ = std::make_unique<base::test::TestFuture<void>>(); test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/1, /*timeout=*/kTestPerTransitionTimeout, - /*on_complete=*/base::BindOnce([]() { NOTREACHED(); }), + /*on_complete=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }), /*on_timeout=*/test_future_->GetCallback()); ASSERT_TRUE(test_future_->Wait()); @@ -529,7 +529,7 @@ // The large image will not even be downloaded and will fail to download. test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/1, /*timeout=*/kTestPerTransitionTimeout, - /*on_complete=*/base::BindOnce([]() { NOTREACHED(); }), + /*on_complete=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }), /*on_timeout=*/test_future_->GetCallback()); ASSERT_TRUE(test_future_->Wait()); ASSERT_EQ(nullptr, GetContainerView()); @@ -548,7 +548,7 @@ // show images as the second image will fail to decode. test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/1, /*timeout=*/kTestPerTransitionTimeout, - /*on_complete=*/base::BindOnce([]() { NOTREACHED(); }), + /*on_complete=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }), /*on_timeout=*/test_future_->GetCallback()); ASSERT_TRUE(test_future_->Wait()); ASSERT_EQ(nullptr, GetContainerView()); @@ -567,7 +567,7 @@ test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/3, /*timeout=*/3 * kTestPerTransitionTimeout, /*on_complete=*/test_future_->GetCallback(), - /*on_timeout=*/base::BindOnce([]() { NOTREACHED(); })); + /*on_timeout=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); ASSERT_TRUE(test_future_->Wait()); { base::ScopedAllowBlockingForTesting allow_blocking; @@ -579,7 +579,7 @@ test_future_ = std::make_unique<base::test::TestFuture<void>>(); test_api.WaitForPhotoTransitionAnimationCompleted( /*num_completions=*/1, /*timeout=*/kTestPerTransitionTimeout, - /*on_complete=*/base::BindOnce([]() { NOTREACHED(); }), + /*on_complete=*/base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }), /*on_timeout=*/test_future_->GetCallback()); ASSERT_TRUE(test_future_->Wait()); {
diff --git a/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.cc b/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.cc index 3d43fd1..80aa66ff 100644 --- a/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.cc +++ b/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.cc
@@ -22,7 +22,7 @@ #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/ash/policy/dlp/dlp_content_manager_ash.h" -#include "chrome/browser/ash/policy/local_user_files/file_location_utils.h" +#include "chrome/browser/ash/policy/skyvault/file_location_utils.h" #include "chrome/browser/ash/video_conference/video_conference_manager_ash.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_prefs.h"
diff --git a/chrome/browser/ui/autofill/autofill_context_menu_manager.cc b/chrome/browser/ui/autofill/autofill_context_menu_manager.cc index af29e3bd..9f32a14 100644 --- a/chrome/browser/ui/autofill/autofill_context_menu_manager.cc +++ b/chrome/browser/ui/autofill/autofill_context_menu_manager.cc
@@ -588,7 +588,7 @@ case FillingProduct::kIban: case FillingProduct::kAutocomplete: case FillingProduct::kCompose: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } }
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 66b78ef..1e312b74 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -1544,6 +1544,7 @@ TabOrganizationServiceFactory::GetForProfile(browser->profile()); UMA_HISTOGRAM_BOOLEAN("Tab.Organization.AllEntrypoints.Clicked", true); UMA_HISTOGRAM_BOOLEAN("Tab.Organization.ThreeDotMenu.Clicked", true); + browser->window()->NotifyPromoFeatureUsed(features::kTabOrganization); service->RestartSessionAndShowUI(browser, TabOrganizationEntryPoint::kThreeDotMenu);
diff --git a/chrome/browser/ui/browser_navigator_iwa_browsertest.cc b/chrome/browser/ui/browser_navigator_iwa_browsertest.cc index 44ec06a..affc98c 100644 --- a/chrome/browser/ui/browser_navigator_iwa_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_iwa_browsertest.cc
@@ -88,7 +88,7 @@ content::WebContents* web_contents) override { NOTREACHED_IN_MIGRATION(); } - void FinishedProcessingCheck() override { NOTREACHED(); } + void FinishedProcessingCheck() override { NOTREACHED_IN_MIGRATION(); } base::test::TestFuture<void> future; };
diff --git a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.cc b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.cc index 112022cb..8184e86 100644 --- a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.cc +++ b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.cc
@@ -6,6 +6,7 @@ #include "base/no_destructor.h" #include "chrome/browser/ui/chromeos/magic_boost/magic_boost_disclaimer_view.h" +#include "chrome/browser/ui/chromeos/magic_boost/magic_boost_opt_in_card.h" #include "ui/views/widget/unique_widget_ptr.h" namespace chromeos { @@ -29,6 +30,17 @@ MagicBoostController::~MagicBoostController() = default; +void MagicBoostController::ShowOptInUi(const gfx::Rect& anchor_view_bounds) { + CHECK(!opt_in_widget_); + CHECK(!disclaimer_widget_); + opt_in_widget_ = MagicBoostOptInCard::CreateWidget(anchor_view_bounds); + opt_in_widget_->Show(); +} + +void MagicBoostController::CloseOptInUi() { + opt_in_widget_.reset(); +} + void MagicBoostController::ShowDisclaimerUi() { if (disclaimer_widget_) { return;
diff --git a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.h b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.h index eb173fd..ed0da34 100644 --- a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.h +++ b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller.h
@@ -8,6 +8,10 @@ #include "base/no_destructor.h" #include "ui/views/widget/unique_widget_ptr.h" +namespace gfx { +class Rect; +} // namespace gfx + namespace views { class Widget; } // namespace views @@ -23,16 +27,15 @@ static MagicBoostController* Get(); - // Shows Magic Boost opt-in widget. - virtual void ShowOptInUi() {} - - // Closes Magic Boost opt-in widget. - virtual void CloseOptInUi() {} + // Shows/closes Magic Boost opt-in widget. + virtual void ShowOptInUi(const gfx::Rect& anchor_view_bounds); + virtual void CloseOptInUi(); // Shows Magic Boost disclaimer widget. void ShowDisclaimerUi(); // For testing. + views::Widget* opt_in_widget_for_test() { return opt_in_widget_.get(); } views::Widget* disclaimer_widget_for_test() { return disclaimer_widget_.get(); } @@ -60,6 +63,7 @@ ~MagicBoostController(); private: + views::UniqueWidgetPtr opt_in_widget_; views::UniqueWidgetPtr disclaimer_widget_; };
diff --git a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller_unittest.cc b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller_unittest.cc index 163c0a6..494c352a 100644 --- a/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller_unittest.cc +++ b/chrome/browser/ui/chromeos/magic_boost/magic_boost_controller_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "chrome/browser/ui/chromeos/magic_boost/magic_boost_disclaimer_view.h" +#include "chrome/browser/ui/chromeos/magic_boost/magic_boost_opt_in_card.h" #include "chrome/test/views/chrome_views_test_base.h" #include "ui/lottie/resource.h" #include "ui/views/view_utils.h" @@ -35,4 +36,23 @@ controller->disclaimer_widget_for_test()->GetContentsView())); } +TEST_F(MagicBoostControllerTest, OptInUi) { + auto* controller = MagicBoostController::Get(); + + // Initially the opt-in widget is not visible. + EXPECT_FALSE(controller->opt_in_widget_for_test()); + + // Show the opt-in widget and test that the proper views are set. + controller->ShowOptInUi(/*anchor_bounds=*/gfx::Rect()); + auto* opt_in_widget = controller->opt_in_widget_for_test(); + ASSERT_TRUE(opt_in_widget); + EXPECT_TRUE(opt_in_widget->IsVisible()); + EXPECT_TRUE(views::IsViewClass<MagicBoostOptInCard>( + opt_in_widget->GetContentsView())); + + // Test that the opt-in widget is closed on `CloseOptInUI`. + controller->CloseOptInUi(); + EXPECT_FALSE(controller->opt_in_widget_for_test()); +} + } // namespace chromeos
diff --git a/chrome/browser/ui/chromeos/magic_boost/test/mock_magic_boost_controller.h b/chrome/browser/ui/chromeos/magic_boost/test/mock_magic_boost_controller.h index 2ed47df..c006b82 100644 --- a/chrome/browser/ui/chromeos/magic_boost/test/mock_magic_boost_controller.h +++ b/chrome/browser/ui/chromeos/magic_boost/test/mock_magic_boost_controller.h
@@ -19,7 +19,7 @@ ~MockMagicBoostController(); // chromeos::MahiManager: - MOCK_METHOD(void, ShowOptInUi, (), (override)); + MOCK_METHOD(void, ShowOptInUi, (const gfx::Rect&), (override)); MOCK_METHOD(void, CloseOptInUi, (), (override)); MOCK_METHOD(bool, ShouldQuickAnswersAndMahiShowOptIn, (), (override)); };
diff --git a/chrome/browser/ui/commerce/commerce_ui_tab_helper.cc b/chrome/browser/ui/commerce/commerce_ui_tab_helper.cc index ce09b42..e88a68b 100644 --- a/chrome/browser/ui/commerce/commerce_ui_tab_helper.cc +++ b/chrome/browser/ui/commerce/commerce_ui_tab_helper.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/commerce/commerce_page_action_controller.h" #include "chrome/browser/ui/commerce/price_tracking_page_action_controller.h" +#include "chrome/browser/ui/commerce/product_specifications_page_action_controller.h" #include "chrome/browser/ui/side_panel/side_panel_ui.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/commerce/price_insights_icon_view.h" @@ -32,6 +33,7 @@ #include "components/commerce/core/commerce_constants.h" #include "components/commerce/core/commerce_feature_list.h" #include "components/commerce/core/commerce_utils.h" +#include "components/commerce/core/feature_utils.h" #include "components/commerce/core/metrics/metrics_utils.h" #include "components/commerce/core/price_tracking_utils.h" #include "components/image_fetcher/core/image_fetcher.h" @@ -60,6 +62,20 @@ namespace commerce { +namespace { + +void UpdatePageActionIconView(content::WebContents* web_contents, + PageActionIconType type) { + CHECK(web_contents); + Browser* browser = chrome::FindBrowserWithTab(web_contents); + if (!browser || !browser->window()) { + return; + } + browser->window()->UpdatePageActionIcon(type); +} + +} // namespace + CommerceUiTabHelper::CommerceUiTabHelper( content::WebContents* content, ShoppingService* shopping_service, @@ -100,6 +116,21 @@ std::make_unique<PriceTrackingPageActionController>( std::move(update_callback), shopping_service_, image_fetcher_, tracker); + + base::RepeatingCallback<void()> product_specifications_update_callback = + base::BindRepeating( + [](base::WeakPtr<CommerceUiTabHelper> helper) { + if (!helper) { + return; + } + + helper->MaybeComputePageActionToExpand(); + helper->UpdateProductSpecificationsIconView(); + }, + weak_ptr_factory_.GetWeakPtr()); + product_specifications_controller_ = + std::make_unique<ProductSpecificationsPageActionController>( + std::move(product_specifications_update_callback), shopping_service_); } CommerceUiTabHelper::~CommerceUiTabHelper() = default; @@ -162,6 +193,9 @@ price_tracking_controller_->ResetForNewNavigation( web_contents()->GetLastCommittedURL()); + product_specifications_controller_->ResetForNewNavigation( + web_contents()->GetLastCommittedURL()); + if (shopping_service_->IsPriceInsightsEligible()) { // Price insights needs product info to get the product cluster title. shopping_service_->GetProductInfoForUrl( @@ -207,15 +241,7 @@ } void CommerceUiTabHelper::UpdatePriceInsightsIconView() { - DCHECK(web_contents()); - - Browser* browser = chrome::FindBrowserWithTab(web_contents()); - - if (!browser || !browser->window()) { - return; - } - - browser->window()->UpdatePageActionIcon(PageActionIconType::kPriceInsights); + UpdatePageActionIconView(web_contents(), PageActionIconType::kPriceInsights); } void CommerceUiTabHelper::SetImageFetcherForTesting( @@ -233,6 +259,11 @@ price_insights_info_.has_value(); } +bool CommerceUiTabHelper::ShouldShowProductSpecificationsIconView() { + return product_specifications_controller_->ShouldShowForNavigation().value_or( + false); +} + void CommerceUiTabHelper::HandleProductInfoResponse( const GURL& url, const std::optional<const ProductInfo>& info) { @@ -314,6 +345,11 @@ return; } + if (!product_specifications_controller_->ShouldShowForNavigation() + .has_value()) { + return; + } + if (is_page_action_expansion_computed_for_page_) { return; } @@ -411,15 +447,12 @@ } void CommerceUiTabHelper::UpdatePriceTrackingIconView() { - DCHECK(web_contents()); + UpdatePageActionIconView(web_contents(), PageActionIconType::kPriceTracking); +} - Browser* browser = chrome::FindBrowserWithTab(web_contents()); - - if (!browser || !browser->window()) { - return; - } - - browser->window()->UpdatePageActionIcon(PageActionIconType::kPriceTracking); +void CommerceUiTabHelper::UpdateProductSpecificationsIconView() { + UpdatePageActionIconView(web_contents(), + PageActionIconType::kProductSpecifications); } void CommerceUiTabHelper::MakeShoppingInsightsSidePanelAvailable() { @@ -534,6 +567,11 @@ return; } + if (ShouldShowProductSpecificationsIconView()) { + page_action_to_expand_ = PageActionIconType::kProductSpecifications; + return; + } + // Prioritize the price insights icon. if (ShouldShowPriceInsightsIconView()) { PriceInsightsIconView::PriceInsightsIconLabelType label_type =
diff --git a/chrome/browser/ui/commerce/commerce_ui_tab_helper.h b/chrome/browser/ui/commerce/commerce_ui_tab_helper.h index 6d69dd3..6106876 100644 --- a/chrome/browser/ui/commerce/commerce_ui_tab_helper.h +++ b/chrome/browser/ui/commerce/commerce_ui_tab_helper.h
@@ -39,6 +39,8 @@ namespace commerce { +class ProductSpecificationsPageActionController; + // This tab helper is used to update and maintain the state of UI for commerce // features. class CommerceUiTabHelper @@ -59,6 +61,8 @@ virtual bool ShouldShowPriceTrackingIconView(); // Return whether the PriceInsightsIconView is visible. virtual bool ShouldShowPriceInsightsIconView(); + // Return whether the ProductSpecificationsIconView is visible. + virtual bool ShouldShowProductSpecificationsIconView(); // Return the page action label. If no label should be shown, return // PriceInsightsIconLabelType::kNone. @@ -134,6 +138,8 @@ void UpdatePriceInsightsIconView(); + void UpdateProductSpecificationsIconView(); + void TriggerUpdateForIconView(); bool ShouldIgnoreSameUrlNavigation(); @@ -171,6 +177,8 @@ raw_ptr<image_fetcher::ImageFetcher> image_fetcher_; std::unique_ptr<PriceTrackingPageActionController> price_tracking_controller_; + std::unique_ptr<ProductSpecificationsPageActionController> + product_specifications_controller_; // The product info available for the current page if available. std::optional<ProductInfo> product_info_for_page_;
diff --git a/chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h b/chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h index 836d0d5..7d858ab0 100644 --- a/chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h +++ b/chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h
@@ -29,6 +29,7 @@ MOCK_METHOD(const gfx::Image&, GetProductImage, ()); MOCK_METHOD(bool, ShouldShowPriceTrackingIconView, ()); MOCK_METHOD(bool, ShouldShowPriceInsightsIconView, ()); + MOCK_METHOD(bool, ShouldShowProductSpecificationsIconView, ()); MOCK_METHOD(bool, IsPriceTracking, ()); MOCK_METHOD(void, SetPriceTrackingState,
diff --git a/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc b/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc new file mode 100644 index 0000000..9ba99a2 --- /dev/null +++ b/chrome/browser/ui/commerce/product_specifications_page_action_controller.cc
@@ -0,0 +1,82 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/commerce/product_specifications_page_action_controller.h" + +#include "components/commerce/core/feature_utils.h" +#include "components/commerce/core/shopping_service.h" + +namespace commerce { + +ProductSpecificationsPageActionController:: + ProductSpecificationsPageActionController( + base::RepeatingCallback<void()> notify_callback, + ShoppingService* shopping_service) + : CommercePageActionController(std::move(notify_callback)), + shopping_service_(shopping_service) {} + +ProductSpecificationsPageActionController:: + ~ProductSpecificationsPageActionController() = default; + +std::optional<bool> +ProductSpecificationsPageActionController::ShouldShowForNavigation() { + // If the user isn't eligible for the feature, don't block. + if (!shopping_service_ || !shopping_service_->GetAccountChecker() || + !commerce::IsProductSpecificationsEnabled( + shopping_service_->GetAccountChecker())) { + return false; + } + // If the page is not yet determined to be a product page, we're "undecided". + if (!got_product_response_for_page_) { + return std::nullopt; + } + // If we got a response from the shopping service but the response was empty, + // we don't need to know about the product group info. + if (got_product_response_for_page_ && !product_info_for_page_.has_value()) { + return false; + } + return product_group_for_page_.has_value(); +} + +bool ProductSpecificationsPageActionController::WantsExpandedUi() { + return product_group_for_page_.has_value(); +} + +void ProductSpecificationsPageActionController::ResetForNewNavigation( + const GURL& url) { + if (!shopping_service_ || !shopping_service_->GetAccountChecker() || + !commerce::IsProductSpecificationsEnabled( + shopping_service_->GetAccountChecker())) { + return; + } + // Cancel any pending callbacks. + weak_ptr_factory_.InvalidateWeakPtrs(); + + current_url_ = url; + got_product_response_for_page_ = false; + product_group_for_page_ = std::nullopt; + product_info_for_page_ = std::nullopt; + // Initiate an update for the icon on navigation since we may not have product + // info. + NotifyHost(); + + shopping_service_->GetProductInfoForUrl( + url, + base::BindOnce( + &ProductSpecificationsPageActionController::HandleProductInfoResponse, + weak_ptr_factory_.GetWeakPtr())); +} + +void ProductSpecificationsPageActionController::HandleProductInfoResponse( + const GURL& url, + const std::optional<const ProductInfo>& info) { + if (url == current_url_ && info.has_value()) { + product_info_for_page_ = info; + product_group_for_page_ = + shopping_service_->GetProductGroupForCandidateProduct(url); + } + got_product_response_for_page_ = true; + NotifyHost(); +} +} // namespace commerce
diff --git a/chrome/browser/ui/commerce/product_specifications_page_action_controller.h b/chrome/browser/ui/commerce/product_specifications_page_action_controller.h new file mode 100644 index 0000000..6ad62cc --- /dev/null +++ b/chrome/browser/ui/commerce/product_specifications_page_action_controller.h
@@ -0,0 +1,65 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_COMMERCE_PRODUCT_SPECIFICATIONS_PAGE_ACTION_CONTROLLER_H_ +#define CHROME_BROWSER_UI_COMMERCE_PRODUCT_SPECIFICATIONS_PAGE_ACTION_CONTROLLER_H_ + +#include <optional> + +#include "base/functional/callback.h" +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ui/commerce/commerce_page_action_controller.h" +#include "components/commerce/core/commerce_types.h" +#include "components/commerce/core/compare/product_group.h" + +namespace commerce { + +class ShoppingService; + +class ProductSpecificationsPageActionController + : public CommercePageActionController { + public: + ProductSpecificationsPageActionController( + base::RepeatingCallback<void()> notify_callback, + ShoppingService* shopping_service); + ProductSpecificationsPageActionController( + const ProductSpecificationsPageActionController&) = delete; + ProductSpecificationsPageActionController& operator=( + const ProductSpecificationsPageActionController&) = delete; + ~ProductSpecificationsPageActionController() override; + + // CommercePageActionController impl: + std::optional<bool> ShouldShowForNavigation() override; + bool WantsExpandedUi() override; + void ResetForNewNavigation(const GURL& url) override; + + private: + void HandleProductInfoResponse(const GURL& url, + const std::optional<const ProductInfo>& info); + + // The URL for the most recent navigation. + GURL current_url_; + + // Whether we have got the response for checking if the current page is a + // product page. + bool got_product_response_for_page_{false}; + + // The product info available for the current page if available. + std::optional<ProductInfo> product_info_for_page_; + + // The product group that current page can be added to if available. + std::optional<ProductGroup> product_group_for_page_; + + // The shopping service is tied to the lifetime of the browser context + // which will always outlive this tab helper. + raw_ptr<ShoppingService> shopping_service_; + + base::WeakPtrFactory<ProductSpecificationsPageActionController> + weak_ptr_factory_{this}; +}; + +} // namespace commerce + +#endif // CHROME_BROWSER_UI_COMMERCE_PRODUCT_SPECIFICATIONS_PAGE_ACTION_CONTROLLER_H_
diff --git a/chrome/browser/ui/commerce/product_specifications_page_action_controller_unittest.cc b/chrome/browser/ui/commerce/product_specifications_page_action_controller_unittest.cc new file mode 100644 index 0000000..142dc9f3 --- /dev/null +++ b/chrome/browser/ui/commerce/product_specifications_page_action_controller_unittest.cc
@@ -0,0 +1,164 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/commerce/product_specifications_page_action_controller.h" + +#include <memory> +#include <optional> + +#include "base/run_loop.h" +#include "base/test/mock_callback.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" +#include "base/uuid.h" +#include "chrome/test/base/testing_profile.h" +#include "components/commerce/core/commerce_feature_list.h" +#include "components/commerce/core/mock_account_checker.h" +#include "components/commerce/core/mock_shopping_service.h" +#include "components/commerce/core/shopping_service.h" +#include "components/commerce/core/test_utils.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace commerce { + +namespace { +const char kTestUrl[] = "https://www.example.com"; +const int64_t kClusterId = 12345L; + +// Build a basic ProductInfo object. +std::optional<ProductInfo> CreateProductInfo(uint64_t cluster_id) { + std::optional<ProductInfo> info; + info.emplace(); + info->product_cluster_id = cluster_id; + return info; +} + +std::optional<ProductGroup> CreateProductGroup() { + return ProductGroup(base::Uuid::GenerateRandomV4(), "test", {GURL()}, + base::Time()); +} +} // namespace + +class ProductSpecificationsPageActionControllerUnittest : public testing::Test { + public: + ProductSpecificationsPageActionControllerUnittest() = default; + + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature(commerce::kProductSpecifications); + shopping_service_ = std::make_unique<MockShoppingService>(); + base::RepeatingCallback<void()> callback = notify_host_callback_.Get(); + account_checker_ = std::make_unique<MockAccountChecker>(); + shopping_service_->SetAccountChecker(account_checker_.get()); + controller_ = std::make_unique<ProductSpecificationsPageActionController>( + std::move(callback), shopping_service_.get()); + } + + ProductSpecificationsPageActionControllerUnittest( + const ProductSpecificationsPageActionControllerUnittest&) = delete; + ProductSpecificationsPageActionControllerUnittest operator=( + const ProductSpecificationsPageActionControllerUnittest&) = delete; + ~ProductSpecificationsPageActionControllerUnittest() override = default; + + protected: + base::test::ScopedFeatureList scoped_feature_list_; + std::unique_ptr<MockAccountChecker> account_checker_; + base::MockRepeatingCallback<void()> notify_host_callback_; + std::unique_ptr<MockShoppingService> shopping_service_; + std::unique_ptr<ProductSpecificationsPageActionController> controller_; + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; +}; + +TEST_F(ProductSpecificationsPageActionControllerUnittest, IconShow) { + EXPECT_CALL(*shopping_service_, GetProductGroupForCandidateProduct).Times(1); + EXPECT_CALL(*shopping_service_, GetProductInfoForUrl).Times(1); + EXPECT_CALL(notify_host_callback_, Run()).Times(testing::AtLeast(1)); + + // Before a navigation, the controller should be in an "undecided" state. + ASSERT_FALSE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); + + shopping_service_->SetResponseForGetProductGroupForCandidateProduct( + CreateProductGroup()); + shopping_service_->SetResponseForGetProductInfoForUrl( + CreateProductInfo(kClusterId)); + + controller_->ResetForNewNavigation(GURL(kTestUrl)); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_TRUE(controller_->ShouldShowForNavigation().value()); + ASSERT_TRUE(controller_->WantsExpandedUi()); +} + +TEST_F(ProductSpecificationsPageActionControllerUnittest, + IconNotwShow_NoProductGroup) { + EXPECT_CALL(*shopping_service_, GetProductGroupForCandidateProduct).Times(1); + EXPECT_CALL(*shopping_service_, GetProductInfoForUrl).Times(1); + EXPECT_CALL(notify_host_callback_, Run()).Times(testing::AtLeast(1)); + + // Before a navigation, the controller should be in an "undecided" state. + ASSERT_FALSE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); + + // Mock no product group for current URL. + shopping_service_->SetResponseForGetProductGroupForCandidateProduct( + std::nullopt); + shopping_service_->SetResponseForGetProductInfoForUrl( + CreateProductInfo(kClusterId)); + + controller_->ResetForNewNavigation(GURL(kTestUrl)); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->ShouldShowForNavigation().value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); +} + +TEST_F(ProductSpecificationsPageActionControllerUnittest, + IconNotwShow_NoProductInfo) { + EXPECT_CALL(*shopping_service_, GetProductGroupForCandidateProduct).Times(0); + EXPECT_CALL(*shopping_service_, GetProductInfoForUrl).Times(1); + EXPECT_CALL(notify_host_callback_, Run()).Times(testing::AtLeast(1)); + + // Before a navigation, the controller should be in an "undecided" state. + ASSERT_FALSE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); + + // Mock no product info for current URL. + shopping_service_->SetResponseForGetProductInfoForUrl(std::nullopt); + + controller_->ResetForNewNavigation(GURL(kTestUrl)); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->ShouldShowForNavigation().value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); +} + +TEST_F(ProductSpecificationsPageActionControllerUnittest, + IconNotwShow_FeatureIneligible) { + // Mock Ineligible for the feature. + account_checker_->SetSignedIn(false); + + EXPECT_CALL(*shopping_service_, GetProductGroupForCandidateProduct).Times(0); + EXPECT_CALL(*shopping_service_, GetProductInfoForUrl).Times(0); + EXPECT_CALL(notify_host_callback_, Run()).Times(testing::AtLeast(0)); + + // Before a navigation, the controller already rejects. + ASSERT_TRUE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->ShouldShowForNavigation().value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); + + controller_->ResetForNewNavigation(GURL(kTestUrl)); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(controller_->ShouldShowForNavigation().has_value()); + ASSERT_FALSE(controller_->ShouldShowForNavigation().value()); + ASSERT_FALSE(controller_->WantsExpandedUi()); +} + +} // namespace commerce
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.cc b/chrome/browser/ui/lens/lens_overlay_controller.cc index 5e81d9e..de97581 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_controller.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/lens/core/mojom/overlay_object.mojom.h" #include "chrome/browser/lens/core/mojom/text.mojom.h" #include "chrome/browser/search/search.h" +#include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/chrome_pages.h" @@ -45,9 +46,11 @@ #include "third_party/lens_server_proto/lens_overlay_selection_type.pb.h" #include "third_party/lens_server_proto/lens_overlay_service_deps.pb.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/window_open_disposition_utils.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/rounded_corners_f.h" +#include "ui/native_theme/native_theme.h" #include "ui/views/controls/webview/web_contents_set_background_color.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/flex_layout_types.h" @@ -155,6 +158,18 @@ return top_level_widget->GetNativeView(); } +// TODO(b/341360519): Move this to a separate file. +bool SidePanelShouldUseDarkMode(ThemeService* theme_service) { + if (!lens::features::UseBrowserDarkModeSettingForLensOverlay()) { + return false; + } + ThemeService::BrowserColorScheme color_scheme = + theme_service->GetBrowserColorScheme(); + return color_scheme == ThemeService::BrowserColorScheme::kSystem + ? ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors() + : color_scheme == ThemeService::BrowserColorScheme::kDark; +} + } // namespace LensOverlayController::LensOverlayController( @@ -162,12 +177,14 @@ variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, PrefService* pref_service, - syncer::SyncService* sync_service) + syncer::SyncService* sync_service, + ThemeService* theme_service) : tab_(tab), variations_client_(variations_client), identity_manager_(identity_manager), pref_service_(pref_service), - sync_service_(sync_service) { + sync_service_(sync_service), + theme_service_(theme_service) { LensOverlayControllerTabLookup::CreateForWebContents(tab_->GetContents(), this); @@ -313,7 +330,8 @@ weak_factory_.GetWeakPtr()), base::BindRepeating(&LensOverlayController::HandleThumbnailCreated, weak_factory_.GetWeakPtr()), - variations_client_, identity_manager_, invocation_source); + variations_client_, identity_manager_, invocation_source, + SidePanelShouldUseDarkMode(theme_service_)); side_panel_coordinator_ = SidePanelUtil::GetSidePanelCoordinatorForBrowser(tab_browser); @@ -648,12 +666,13 @@ lens::LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source) { + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) { return std::make_unique<lens::LensOverlayQueryController>( std::move(full_image_callback), std::move(url_callback), std::move(interaction_data_callback), std::move(thumbnail_created_callback), variations_client, - identity_manager, invocation_source); + identity_manager, invocation_source, use_dark_mode); } LensOverlayController::OverlayInitializationData::OverlayInitializationData( @@ -1281,6 +1300,19 @@ /*extra_diagnostics=*/std::string()); } +void LensOverlayController::InfoRequestedByOverlay( + ui::mojom::ClickModifiersPtr click_modifiers) { + // The tab is expected to be in the foreground. + CHECK(tab_->IsInForeground()); + tab_->GetBrowserWindowInterface()->OpenURL( + GURL(lens::features::GetLensOverlayHelpCenterURL()), + ui::DispositionFromClick( + click_modifiers->middle_button, click_modifiers->alt_key, + click_modifiers->ctrl_key, click_modifiers->meta_key, + click_modifiers->shift_key, + WindowOpenDisposition::NEW_BACKGROUND_TAB)); +} + void LensOverlayController::IssueLensRequest( lens::mojom::CenterRotatedBoxPtr region) { CHECK(initialization_data_);
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.h b/chrome/browser/ui/lens/lens_overlay_controller.h index 19232878..0ef8a3e 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.h +++ b/chrome/browser/ui/lens/lens_overlay_controller.h
@@ -11,6 +11,7 @@ #include "chrome/browser/lens/core/mojom/lens.mojom.h" #include "chrome/browser/lens/core/mojom/overlay_object.mojom.h" #include "chrome/browser/lens/core/mojom/text.mojom.h" +#include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" #include "chrome/browser/ui/exclusive_access/fullscreen_observer.h" @@ -33,6 +34,7 @@ #include "mojo/public/cpp/bindings/remote.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/interaction/element_identifier.h" +#include "ui/base/mojom/window_open_disposition.mojom.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/widget/unique_widget_ptr.h" @@ -81,7 +83,8 @@ variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, PrefService* pref_service, - syncer::SyncService* sync_service); + syncer::SyncService* sync_service, + ThemeService* theme_service); ~LensOverlayController() override; DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kOverlayId); @@ -354,7 +357,8 @@ lens::LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source); + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode); private: // Data class for constructing overlay and storing overlay state for @@ -532,6 +536,8 @@ void CloseRequestedByOverlayBackgroundClick() override; void CloseRequestedByOverlayEscapeKeyPress() override; void FeedbackRequestedByOverlay() override; + void InfoRequestedByOverlay( + ui::mojom::ClickModifiersPtr click_modifiers) override; // TODO: rename this to IssueRegionSearchRequest. void IssueLensRequest(lens::mojom::CenterRotatedBoxPtr region) override; void IssueObjectSelectionRequest(const std::string& object_id); @@ -702,6 +708,9 @@ // The sync service associated with the current profile. raw_ptr<syncer::SyncService> sync_service_; + // The theme service associated with the current profile. + raw_ptr<ThemeService> theme_service_; + // Prevents other features from showing tab-modal UI. std::unique_ptr<tabs::ScopedTabModalUI> scoped_tab_modal_ui_;
diff --git a/chrome/browser/ui/lens/lens_overlay_controller_browsertest.cc b/chrome/browser/ui/lens/lens_overlay_controller_browsertest.cc index 05a78045..6a736808 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller_browsertest.cc +++ b/chrome/browser/ui/lens/lens_overlay_controller_browsertest.cc
@@ -19,6 +19,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/sync/sync_service_factory.h" +#include "chrome/browser/themes/theme_service.h" +#include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" @@ -242,14 +244,16 @@ lens::LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - LensOverlayInvocationSource invocation_source) + LensOverlayInvocationSource invocation_source, + bool use_dark_mode) : LensOverlayQueryController(full_image_callback, url_callback, interaction_data_callback, thumbnail_created_callback, variations_client, identity_manager, - invocation_source) {} + invocation_source, + use_dark_mode) {} void StartQueryFlow(const SkBitmap& screenshot, std::optional<GURL> page_url, @@ -278,12 +282,14 @@ variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, PrefService* pref_service, - syncer::SyncService* sync_service) + syncer::SyncService* sync_service, + ThemeService* theme_service) : LensOverlayController(tab, variations_client, identity_manager, pref_service, - sync_service) {} + sync_service, + theme_service) {} std::unique_ptr<lens::LensOverlayQueryController> CreateLensQueryController( lens::LensOverlayFullImageResponseCallback full_image_callback, @@ -292,11 +298,12 @@ lens::LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source) override { + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) override { return std::make_unique<LensOverlayQueryControllerFake>( full_image_callback, url_callback, interaction_data_callback, thumbnail_created_callback, variations_client, identity_manager, - invocation_source); + invocation_source, use_dark_mode); } void BindOverlay(mojo::PendingReceiver<lens::mojom::LensPageHandler> receiver, @@ -339,10 +346,14 @@ std::unique_ptr<LensOverlayController> CreateLensController( tabs::TabInterface* tab, Profile* profile) override { + auto* theme_service = ThemeServiceFactory::GetForProfile(profile); + // Set browser color scheme to light mode for consistency. + theme_service->SetBrowserColorScheme( + ThemeService::BrowserColorScheme::kLight); return std::make_unique<LensOverlayControllerFake>( tab, profile->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile), profile->GetPrefs(), - SyncServiceFactory::GetForProfile(profile)); + SyncServiceFactory::GetForProfile(profile), theme_service); } }; @@ -1629,7 +1640,7 @@ // Loading a url in the side panel should show the results page. const GURL first_search_url( "https://www.google.com/" - "search?source=chrome.cr.menu&q=oranges&lns_mode=text&gsc=1&" + "search?cs=0&source=chrome.cr.menu&q=oranges&lns_mode=text&gsc=1&" "hl=en-US"); controller->LoadURLInResultsFrame(first_search_url); EXPECT_TRUE(content::WaitForLoadStop( @@ -1651,7 +1662,7 @@ // Loading a second url in the side panel should show the results page. const GURL second_search_url( "https://www.google.com/" - "search?source=chrome.cr.menu&q=kiwi&lns_mode=text&gsc=1&hl=" + "search?cs=0&source=chrome.cr.menu&q=kiwi&lns_mode=text&gsc=1&hl=" "en-US"); // We can't use content::WaitForLoadStop here since the last navigation is // successful. @@ -1719,7 +1730,7 @@ // Loading a url in the side panel should show the results page. const GURL first_search_url( "https://www.google.com/" - "search?source=chrome.cr.menu&q=oranges&lns_mode=text&gsc=1&" + "search?cs=0&source=chrome.cr.menu&q=oranges&lns_mode=text&gsc=1&" "hl=en-US"); controller->IssueTextSelectionRequestForTesting("oranges", 20, 200); EXPECT_TRUE(content::WaitForLoadStop( @@ -1743,7 +1754,7 @@ // Loading a second url in the side panel should show the results page. const GURL second_search_url( "https://www.google.com/" - "search?source=chrome.cr.menu&q=kiwi&lns_mode=text&gsc=1&hl=" + "search?cs=0&source=chrome.cr.menu&q=kiwi&lns_mode=text&gsc=1&hl=" "en-US"); // We can't use content::WaitForLoadStop here since the last navigation is // successful.
diff --git a/chrome/browser/ui/lens/lens_overlay_proto_converter.cc b/chrome/browser/ui/lens/lens_overlay_proto_converter.cc index cadab72..19b5a4a 100644 --- a/chrome/browser/ui/lens/lens_overlay_proto_converter.cc +++ b/chrome/browser/ui/lens/lens_overlay_proto_converter.cc
@@ -98,7 +98,9 @@ lens::WritingDirection writing_direction) { lens::mojom::WordPtr word = lens::mojom::Word::New(); word->plain_text = proto_word.plain_text(); - word->text_separator = proto_word.text_separator(); + if (proto_word.has_text_separator()) { + word->text_separator = proto_word.text_separator(); + } if (proto_word.has_geometry()) { word->geometry = CreateGeometryMojomFromProto(proto_word.geometry()); }
diff --git a/chrome/browser/ui/lens/lens_overlay_query_controller.cc b/chrome/browser/ui/lens/lens_overlay_query_controller.cc index 8091fe8c..cb55131e 100644 --- a/chrome/browser/ui/lens/lens_overlay_query_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_query_controller.cc
@@ -152,7 +152,8 @@ LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source) + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) : full_image_callback_(std::move(full_image_callback)), interaction_data_callback_(std::move(interaction_data_callback)), thumbnail_created_callback_(std::move(thumbnail_created_callback)), @@ -161,7 +162,8 @@ url_callback_(std::move(url_callback)), variations_client_(variations_client), identity_manager_(identity_manager), - invocation_source_(invocation_source) {} + invocation_source_(invocation_source), + use_dark_mode_(use_dark_mode) {} LensOverlayQueryController::~LensOverlayQueryController() = default; @@ -385,7 +387,7 @@ lens_overlay_url_response.set_url( lens::BuildTextOnlySearchURL(query_text, page_url_, page_title_, additional_search_query_params, - invocation_source_) + invocation_source_, use_dark_mode_) .spec()); base::SequencedTaskRunner::GetCurrentDefault()->PostTask( FROM_HERE, base::BindOnce(url_callback_, lens_overlay_url_response)); @@ -548,7 +550,7 @@ lens_overlay_url_response.set_url( lens::BuildLensSearchURL( query_text, request_id_generator_->GetNextRequestId(), cluster_info, - additional_search_query_params, invocation_source_) + additional_search_query_params, invocation_source_, use_dark_mode_) .spec()); base::SequencedTaskRunner::GetCurrentDefault()->PostTask( FROM_HERE, base::BindOnce(url_callback_, lens_overlay_url_response));
diff --git a/chrome/browser/ui/lens/lens_overlay_query_controller.h b/chrome/browser/ui/lens/lens_overlay_query_controller.h index f708317..2ad5b2b 100644 --- a/chrome/browser/ui/lens/lens_overlay_query_controller.h +++ b/chrome/browser/ui/lens/lens_overlay_query_controller.h
@@ -56,7 +56,8 @@ LensOverlayThumbnailCreatedCallback thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source); + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode); virtual ~LensOverlayQueryController(); // Starts a query flow by sending a request to Lens using the screenshot, @@ -275,6 +276,11 @@ // The invocation source that triggered the query flow. lens::LensOverlayInvocationSource invocation_source_; + // Whether or not to use dark mode in search urls. This is only calculated + // once per session because the search box theme is also only set once + // per session. + bool use_dark_mode_; + base::WeakPtrFactory<LensOverlayQueryController> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc b/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc index 6cb0ff9..4ba6ccb 100644 --- a/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc +++ b/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc
@@ -103,14 +103,16 @@ thumbnail_created_callback, variations::VariationsClient* variations_client, signin::IdentityManager* identity_manager, - lens::LensOverlayInvocationSource invocation_source) + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) : LensOverlayQueryController(full_image_callback, url_callback, interaction_data_callback, thumbnail_created_callback, variations_client, identity_manager, - invocation_source) {} + invocation_source, + use_dark_mode) {} ~LensOverlayQueryControllerMock() override = default; lens::LensOverlayObjectsResponse fake_objects_response_; @@ -209,7 +211,8 @@ base::NullCallback(), base::NullCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); SkBitmap bitmap = CreateNonEmptyBitmap(100, 100); query_controller.StartQueryFlow( bitmap, std::make_optional<GURL>(kTestPageUrl), @@ -265,7 +268,8 @@ thumbnail_created_future.GetRepeatingCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); query_controller.fake_objects_response_.mutable_cluster_info() ->set_server_session_id(kTestServerSessionId); query_controller.fake_interaction_response_.set_encoded_response( @@ -365,7 +369,8 @@ thumbnail_created_future.GetRepeatingCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); query_controller.fake_objects_response_.mutable_cluster_info() ->set_server_session_id(kTestServerSessionId); query_controller.fake_interaction_response_.set_encoded_response( @@ -469,7 +474,8 @@ thumbnail_created_future.GetRepeatingCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); query_controller.fake_objects_response_.mutable_cluster_info() ->set_server_session_id(kTestServerSessionId); query_controller.fake_interaction_response_.set_encoded_response( @@ -554,7 +560,8 @@ thumbnail_created_future.GetRepeatingCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); SkBitmap bitmap = CreateNonEmptyBitmap(100, 100); std::map<std::string, std::string> additional_search_query_params; query_controller.StartQueryFlow( @@ -601,7 +608,8 @@ thumbnail_created_future.GetRepeatingCallback(), profile()->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile()), - lens::LensOverlayInvocationSource::kAppMenu); + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false); query_controller.fake_objects_response_.mutable_cluster_info() ->set_server_session_id(kTestServerSessionId); query_controller.fake_interaction_response_.set_encoded_response(
diff --git a/chrome/browser/ui/lens/lens_overlay_url_builder.cc b/chrome/browser/ui/lens/lens_overlay_url_builder.cc index 4fabe79..c493e76 100644 --- a/chrome/browser/ui/lens/lens_overlay_url_builder.cc +++ b/chrome/browser/ui/lens/lens_overlay_url_builder.cc
@@ -71,6 +71,11 @@ constexpr char kViewportWidthQueryParamKey[] = "biw"; constexpr char kViewportHeightQueryParamKey[] = "bih"; +// Query parameter for dark mode. +inline constexpr char kDarkModeParameterKey[] = "cs"; +inline constexpr char kDarkModeParameterLightValue[] = "0"; +inline constexpr char kDarkModeParameterDarkValue[] = "1"; + // Appends the url params from the map to the url. GURL AppendUrlParamsFromMap( const GURL& url_to_modify, @@ -164,14 +169,24 @@ url_to_modify, kInvocationSourceParameterKey, param_value); } +GURL AppendDarkModeParamToURL(const GURL& url_to_modify, bool use_dark_mode) { + return net::AppendOrReplaceQueryParameter( + url_to_modify, kDarkModeParameterKey, + use_dark_mode ? kDarkModeParameterDarkValue + : kDarkModeParameterLightValue); +} + GURL BuildTextOnlySearchURL( const std::string& text_query, std::optional<GURL> page_url, std::optional<std::string> page_title, std::map<std::string, std::string> additional_search_query_params, - lens::LensOverlayInvocationSource invocation_source) { + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) { GURL url_with_query_params = GURL(lens::features::GetLensOverlayResultsSearchURL()); + url_with_query_params = + AppendDarkModeParamToURL(url_with_query_params, use_dark_mode); url_with_query_params = AppendInvocationSourceParamToURL( url_with_query_params, invocation_source); url_with_query_params = AppendUrlParamsFromMap( @@ -193,9 +208,12 @@ std::unique_ptr<lens::LensOverlayRequestId> request_id, lens::LensOverlayClusterInfo cluster_info, std::map<std::string, std::string> additional_search_query_params, - lens::LensOverlayInvocationSource invocation_source) { + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode) { GURL url_with_query_params = GURL(lens::features::GetLensOverlayResultsSearchURL()); + url_with_query_params = + AppendDarkModeParamToURL(url_with_query_params, use_dark_mode); url_with_query_params = AppendInvocationSourceParamToURL( url_with_query_params, invocation_source); url_with_query_params = AppendUrlParamsFromMap(
diff --git a/chrome/browser/ui/lens/lens_overlay_url_builder.h b/chrome/browser/ui/lens/lens_overlay_url_builder.h index 05854b1..955135a 100644 --- a/chrome/browser/ui/lens/lens_overlay_url_builder.h +++ b/chrome/browser/ui/lens/lens_overlay_url_builder.h
@@ -24,6 +24,8 @@ std::optional<GURL> page_url, std::optional<std::string> page_title); +GURL AppendDarkModeParamToURL(const GURL& url_to_modify, bool use_dark_mode); + GURL AppendInvocationSourceParamToURL( const GURL& url_to_modify, lens::LensOverlayInvocationSource invocation_source); @@ -33,14 +35,16 @@ std::optional<GURL> page_url, std::optional<std::string> page_title, std::map<std::string, std::string> additional_search_query_params, - lens::LensOverlayInvocationSource invocation_source); + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode); GURL BuildLensSearchURL( std::optional<std::string> text_query, std::unique_ptr<lens::LensOverlayRequestId> request_id, lens::LensOverlayClusterInfo cluster_info, std::map<std::string, std::string> additional_search_query_params, - lens::LensOverlayInvocationSource invocation_source); + lens::LensOverlayInvocationSource invocation_source, + bool use_dark_mode); // Returns the value of the text query parameter value from the provided search // URL if any. Empty string otherwise.
diff --git a/chrome/browser/ui/lens/lens_overlay_url_builder_unittest.cc b/chrome/browser/ui/lens/lens_overlay_url_builder_unittest.cc index 90d5c67..6d92d81 100644 --- a/chrome/browser/ui/lens/lens_overlay_url_builder_unittest.cc +++ b/chrome/browser/ui/lens/lens_overlay_url_builder_unittest.cc
@@ -70,14 +70,15 @@ std::string text_query = "Apples"; std::map<std::string, std::string> additional_params; std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", kResultsSearchBaseUrl, text_query.c_str(), kLanguage); EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, /*page_url=*/std::nullopt, /*page_title=*/std::nullopt, additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -98,13 +99,14 @@ std::make_optional<std::string>(kPageTitle)); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", kResultsSearchBaseUrl, text_query.c_str(), kLanguage); EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, std::make_optional<GURL>(kPageUrl), std::make_optional<std::string>(kPageTitle), additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -116,7 +118,7 @@ std::make_optional<std::string>(kPageTitle)); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" "mactx=%s", kResultsSearchBaseUrl, text_query.c_str(), kLanguage, expected_search_context.c_str()); @@ -124,7 +126,8 @@ EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, std::make_optional<GURL>(kPageUrl), std::make_optional<std::string>(kPageTitle), additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -135,7 +138,7 @@ std::make_optional<GURL>(kPageUrl), /*page_title=*/std::nullopt); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" "mactx=%s", kResultsSearchBaseUrl, text_query.c_str(), kLanguage, expected_search_context.c_str()); @@ -143,7 +146,8 @@ EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, std::make_optional<GURL>(kPageUrl), /*page_title=*/std::nullopt, additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -154,7 +158,7 @@ /*page_url=*/std::nullopt, std::make_optional<std::string>(kPageTitle)); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s&masfc=c&" "mactx=%s", kResultsSearchBaseUrl, text_query.c_str(), kLanguage, expected_search_context.c_str()); @@ -163,7 +167,8 @@ text_query, /*page_url=*/std::nullopt, std::make_optional<std::string>(kPageTitle), additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -171,14 +176,15 @@ std::string text_query = ""; std::map<std::string, std::string> additional_params; std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=&lns_mode=text&gsc=1&hl=%s", + "%s?cs=0&source=chrome.cr.menu&q=&lns_mode=text&gsc=1&hl=%s", kResultsSearchBaseUrl, kLanguage); EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, /*page_url=*/std::nullopt, /*page_title=*/std::nullopt, additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -188,14 +194,15 @@ std::string escaped_text_query = base::EscapeQueryParamValue(text_query, /*use_plus=*/true); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", kResultsSearchBaseUrl, escaped_text_query.c_str(), kLanguage); EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, /*page_url=*/std::nullopt, /*page_title=*/std::nullopt, additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -205,14 +212,15 @@ std::string escaped_text_query = base::EscapeQueryParamValue(text_query, /*use_plus=*/true); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", + "%s?cs=0&source=chrome.cr.menu&q=%s&lns_mode=text&gsc=1&hl=%s", kResultsSearchBaseUrl, escaped_text_query.c_str(), kLanguage); EXPECT_EQ(lens::BuildTextOnlySearchURL( text_query, /*page_url=*/std::nullopt, /*page_title=*/std::nullopt, additional_params, - lens::LensOverlayInvocationSource::kAppMenu), + lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -233,14 +241,15 @@ request_id->set_image_sequence_id(image_sequence_id); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&gsc=1&hl=%s&q=%s&lns_mode=mu&" + "%s?cs=0&source=chrome.cr.menu&gsc=1&hl=%s&q=%s&lns_mode=mu&" "gsessionid=&udm=24&vsrid=%s", kResultsSearchBaseUrl, kLanguage, escaped_text_query.c_str(), EncodeRequestId(request_id.get()).c_str()); EXPECT_EQ(lens::BuildLensSearchURL( text_query, std::move(request_id), cluster_info, - additional_params, lens::LensOverlayInvocationSource::kAppMenu), + additional_params, lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -263,14 +272,15 @@ request_id->set_image_sequence_id(image_sequence_id); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&gsc=1&hl=%s&q=%s&lns_mode=mu&" + "%s?cs=0&source=chrome.cr.menu&gsc=1&hl=%s&q=%s&lns_mode=mu&" "gsessionid=%s&udm=24&vsrid=%s", kResultsSearchBaseUrl, kLanguage, escaped_text_query.c_str(), search_session_id.c_str(), EncodeRequestId(request_id.get()).c_str()); EXPECT_EQ(lens::BuildLensSearchURL( text_query, std::move(request_id), cluster_info, - additional_params, lens::LensOverlayInvocationSource::kAppMenu), + additional_params, lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -297,7 +307,7 @@ &encoded_request_id); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu&gsc=1&hl=%s&q=&lns_mode=un&" + "%s?cs=0&source=chrome.cr.menu&gsc=1&hl=%s&q=&lns_mode=un&" "gsessionid=%s&udm=26&vsrid=%s", kResultsSearchBaseUrl, kLanguage, search_session_id.c_str(), encoded_request_id.c_str()); @@ -305,7 +315,8 @@ EXPECT_EQ( lens::BuildLensSearchURL( /*text_query=*/std::nullopt, std::move(request_id), cluster_info, - additional_params, lens::LensOverlayInvocationSource::kAppMenu), + additional_params, lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -332,7 +343,7 @@ &encoded_request_id); std::string expected_url = base::StringPrintf( - "%s?source=chrome.cr.menu¶m=value&gsc=1&hl=%s&q=&lns_" + "%s?cs=0&source=chrome.cr.menu¶m=value&gsc=1&hl=%s&q=&lns_" "mode=un&gsessionid=%s&udm=26&" "vsrid=%s", kResultsSearchBaseUrl, kLanguage, search_session_id.c_str(), @@ -341,7 +352,8 @@ EXPECT_EQ( lens::BuildLensSearchURL( /*text_query=*/std::nullopt, std::move(request_id), cluster_info, - additional_params, lens::LensOverlayInvocationSource::kAppMenu), + additional_params, lens::LensOverlayInvocationSource::kAppMenu, + /*use_dark_mode=*/false), expected_url); } @@ -411,6 +423,21 @@ expected_omnibox_url); } +TEST_F(LensOverlayUrlBuilderTest, + AppendDarkModeParamToURLToUrlAppendsDarkMode) { + const GURL base_url(kResultsSearchBaseUrl); + + std::string expected_light_mode_url = + base::StringPrintf("%s?cs=0", kResultsSearchBaseUrl); + EXPECT_EQ(lens::AppendDarkModeParamToURL(base_url, /*use_dark_mode=*/false), + expected_light_mode_url); + + std::string expected_dark_mode_url = + base::StringPrintf("%s?cs=1", kResultsSearchBaseUrl); + EXPECT_EQ(lens::AppendDarkModeParamToURL(base_url, /*use_dark_mode=*/true), + expected_dark_mode_url); +} + TEST_F(LensOverlayUrlBuilderTest, HasCommonSearchQueryParametersNoQueryParams) { const GURL url(kResultsSearchBaseUrl); EXPECT_FALSE(lens::HasCommonSearchQueryParameters(url));
diff --git a/chrome/browser/ui/lens/lens_untrusted_ui.cc b/chrome/browser/ui/lens/lens_untrusted_ui.cc index be6cbd3..f0f118a1 100644 --- a/chrome/browser/ui/lens/lens_untrusted_ui.cc +++ b/chrome/browser/ui/lens/lens_untrusted_ui.cc
@@ -34,14 +34,15 @@ chrome::kChromeUILensUntrustedURL); html_source->AddLocalizedString("backButton", IDS_ACCNAME_BACK); html_source->AddLocalizedString("close", IDS_CLOSE); - html_source->AddLocalizedString("sendFeedback", IDS_LENS_SEND_FEEDBACK_LABEL); html_source->AddLocalizedString("copy", IDS_LENS_OVERLAY_COPY); html_source->AddLocalizedString("copyToastMessage", IDS_LENS_OVERLAY_COPY_TOAST_MESSAGE); html_source->AddLocalizedString("dismiss", IDS_LENS_OVERLAY_TOAST_DISMISS_MESSAGE); + html_source->AddLocalizedString("info", IDS_LENS_OVERLAY_INFO_BUTTON_LABEL); html_source->AddLocalizedString("initialToastMessage", IDS_LENS_OVERLAY_INITIAL_TOAST_MESSAGE); + html_source->AddLocalizedString("sendFeedback", IDS_LENS_SEND_FEEDBACK_LABEL); html_source->AddLocalizedString("translate", IDS_LENS_OVERLAY_TRANSLATE); // Add finch flags
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java index 1572166..ecc85e3 100644 --- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java +++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java
@@ -24,6 +24,7 @@ import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeSupplier; import org.chromium.components.browser_ui.widget.InsetObserver; import org.chromium.ui.accessibility.AccessibilityState; +import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.WindowAndroid; /** @@ -287,7 +288,8 @@ currentSnackbar, mSnackbarParentView, mWindowAndroid, - mEdgeToEdgeSupplier); + mEdgeToEdgeSupplier, + isTablet()); mView.show(); // If there is a temporary parent set, reparent accordingly. We override here @@ -320,6 +322,10 @@ mIsShowingSupplier.set(isShowing()); } + private boolean isTablet() { + return DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity); + } + // ============================================================================================ // SnackbarStateProvider // ============================================================================================ @@ -334,6 +340,11 @@ mObservers.removeObserver(observer); } + @Override + public boolean isFullWidth() { + return !isTablet(); + } + // ============================================================================================ // Testing // ============================================================================================
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarStateProvider.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarStateProvider.java index a318550..3ea7cf1 100644 --- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarStateProvider.java +++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarStateProvider.java
@@ -31,4 +31,7 @@ * @param observer The observer to remove. */ void removeObserver(Observer observer); + + /** Return whether the snackbars extend across the full width of their container. */ + boolean isFullWidth(); }
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java index 3862de0..e24b651 100644 --- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java +++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java
@@ -35,7 +35,6 @@ import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.InsetObserver; import org.chromium.components.browser_ui.widget.text.TemplatePreservingTextView; -import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.interpolators.Interpolators; @@ -101,8 +100,9 @@ OnClickListener listener, Snackbar snackbar, ViewGroup parentView, - @Nullable WindowAndroid windowAndroid) { - this(activity, listener, snackbar, parentView, windowAndroid, null); + @Nullable WindowAndroid windowAndroid, + boolean isTablet) { + this(activity, listener, snackbar, parentView, windowAndroid, null, isTablet); } /** @@ -124,8 +124,9 @@ Snackbar snackbar, ViewGroup parentView, @Nullable WindowAndroid windowAndroid, - @Nullable EdgeToEdgeSupplier edgeToEdgeSupplier) { - mIsTablet = DeviceFormFactor.isNonMultiDisplayContextOnTablet(activity); + @Nullable EdgeToEdgeSupplier edgeToEdgeSupplier, + boolean isTablet) { + mIsTablet = isTablet; mOriginalParent = parentView; mWindowAndroid = windowAndroid;
diff --git a/chrome/browser/ui/startup/silent_sync_enabler.cc b/chrome/browser/ui/startup/silent_sync_enabler.cc index 1474454e..545838c 100644 --- a/chrome/browser/ui/startup/silent_sync_enabler.cc +++ b/chrome/browser/ui/startup/silent_sync_enabler.cc
@@ -54,7 +54,9 @@ NOTREACHED_IN_MIGRATION(); } - void ShowLoginError(const SigninUIError& error) override { NOTREACHED(); } + void ShowLoginError(const SigninUIError& error) override { + NOTREACHED_IN_MIGRATION(); + } void ShowMergeSyncDataConfirmation(const std::string&, const std::string&, @@ -62,9 +64,9 @@ NOTREACHED_IN_MIGRATION(); } - void ShowSyncSettings() override { NOTREACHED(); } + void ShowSyncSettings() override { NOTREACHED_IN_MIGRATION(); } - void SwitchToProfile(Profile*) override { NOTREACHED(); } + void SwitchToProfile(Profile*) override { NOTREACHED_IN_MIGRATION(); } }; } // namespace
diff --git a/chrome/browser/ui/tabs/tab_features.cc b/chrome/browser/ui/tabs/tab_features.cc index f73c7df..1db833f 100644 --- a/chrome/browser/ui/tabs/tab_features.cc +++ b/chrome/browser/ui/tabs/tab_features.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/sync/sync_service_factory.h" +#include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/lens/lens_overlay_controller.h" #include "chrome/browser/ui/tabs/tab_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -63,7 +64,8 @@ return std::make_unique<LensOverlayController>( tab, profile->GetVariationsClient(), IdentityManagerFactory::GetForProfile(profile), profile->GetPrefs(), - SyncServiceFactory::GetForProfile(profile)); + SyncServiceFactory::GetForProfile(profile), + ThemeServiceFactory::GetForProfile(profile)); } } // namespace tabs
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc index bec4996..a5c7537c 100644 --- a/chrome/browser/ui/tabs/tab_menu_model.cc +++ b/chrome/browser/ui/tabs/tab_menu_model.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/user_notes/user_notes_controller.h" #include "chrome/browser/ui/web_applications/web_app_tabbed_utils.h" +#include "chrome/browser/user_education/user_education_service.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" @@ -157,7 +158,9 @@ if (tab_organization_service) { AddItemWithStringId(TabStripModel::CommandOrganizeTabs, IDS_TAB_CXMENU_ORGANIZE_TABS); - SetIsNewFeatureAt(GetItemCount() - 1, true); + SetIsNewFeatureAt(GetItemCount() - 1, + UserEducationService::MaybeShowNewBadge( + tab_strip->profile(), features::kTabOrganization)); } }
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index 255165f..e2167da 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -1802,6 +1802,7 @@ CHECK(service); UMA_HISTOGRAM_BOOLEAN("Tab.Organization.AllEntrypoints.Clicked", true); UMA_HISTOGRAM_BOOLEAN("Tab.Organization.TabContextMenu.Clicked", true); + browser->window()->NotifyPromoFeatureUsed(features::kTabOrganization); service->RestartSessionAndShowUI( browser, TabOrganizationEntryPoint::kTabContextMenu,
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index dca26d57..15965710 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -1796,7 +1796,9 @@ if (tab_organization_service) { AddItemWithStringIdAndVectorIcon( this, IDC_ORGANIZE_TABS, IDS_TAB_ORGANIZE_MENU, kAutoTabGroupsIcon); - SetIsNewFeatureAt(GetIndexOfCommandId(IDC_ORGANIZE_TABS).value(), true); + SetIsNewFeatureAt(GetIndexOfCommandId(IDC_ORGANIZE_TABS).value(), + browser()->window()->MaybeShowNewBadgeFor( + features::kTabOrganization)); } }
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc index 0928faf..de76825 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc
@@ -946,7 +946,8 @@ .SetHorizontalScrollBarMode( views::ScrollView::ScrollBarMode::kDisabled) .SetDrawOverflowIndicator(false) - .ClipHeightTo(0, body_container->GetPreferredSize().height()) + .ClipHeightTo( + 0, body_container->GetHeightForWidth(kAutofillPopupMaxWidth)) .Build(); body_container_ = scroll_view->SetContents(std::move(body_container)); scroll_view_ = suggestions_container_->AddChildView(std::move(scroll_view)); @@ -1009,7 +1010,8 @@ // Adjust the scrollable area height. Make sure this adjustment always goes // after changes that can affect `body_container_`'s size. if (scroll_view_ && body_container_ && IsFooterScrollable()) { - scroll_view_->ClipHeightTo(0, body_container_->GetPreferredSize().height()); + scroll_view_->ClipHeightTo( + 0, body_container_->GetHeightForWidth(kAutofillPopupMaxWidth)); } } @@ -1033,6 +1035,22 @@ return width; } +gfx::Size PopupViewViews::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + gfx::Size size = views::View::CalculatePreferredSize(available_size); + // Applies certain rounding rules to the given width, such as matching the + // element width when possible. + const int width = AdjustWidth(size.width()); + if (size.width() > kAutofillPopupMaxWidth) { + // TODO(crbug.com/40232718): When we set the vertical axis to stretch, + // BoxLayout will occupy the entire vertical axis size. Two calculations are + // needed to correct this. + return views::View::CalculatePreferredSize(views::SizeBounds(width, {})); + } + + return size; +} + bool PopupViewViews::DoUpdateBoundsAndRedrawPopup() { gfx::Size preferred_size = CalculatePreferredSize({}); gfx::Rect popup_bounds;
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views.h b/chrome/browser/ui/views/autofill/popup/popup_view_views.h index 04ae88d..ca6f737 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_view_views.h +++ b/chrome/browser/ui/views/autofill/popup/popup_view_views.h
@@ -124,6 +124,8 @@ base::WeakPtr<AutofillPopupView> GetWeakPtr() override; // PopupBaseView: + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; // PopupSearchBarView::Delegate:
diff --git a/chrome/browser/ui/views/autofill/popup/popup_warning_view.cc b/chrome/browser/ui/views/autofill/popup/popup_warning_view.cc index 50b1bdf..2de8b62 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_warning_view.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_warning_view.cc
@@ -15,12 +15,15 @@ #include "ui/color/color_id.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" +#include "ui/views/layout/fill_layout.h" namespace autofill { PopupWarningView::PopupWarningView(const Suggestion& suggestion) : text_value_(suggestion.main_text.value) { - SetUseDefaultFillLayout(true); + // TODO(crbug.com/327247047): SetUseDefaultFillLayout(true) ignore insets by + // default. But we need insets for broder. + SetLayoutManager(std::make_unique<views::FillLayout>()); SetBorder(views::CreateEmptyBorder( gfx::Insets::VH(PopupBaseView::GetCornerRadius(), PopupBaseView::ArrowHorizontalMargin())));
diff --git a/chrome/browser/ui/views/commerce/product_specifications_icon_view.cc b/chrome/browser/ui/views/commerce/product_specifications_icon_view.cc index e00e800..85ded6a 100644 --- a/chrome/browser/ui/views/commerce/product_specifications_icon_view.cc +++ b/chrome/browser/ui/views/commerce/product_specifications_icon_view.cc
@@ -43,8 +43,13 @@ "ProductSpecifications"), browser_(browser), icon_(&omnibox::kProductSpecificationsAddIcon) { + SetUpForInOutAnimation(); SetProperty(views::kElementIdentifierKey, kProductSpecificationsChipElementId); + SetAccessibilityProperties( + /*role*/ std::nullopt, + l10n_util::GetStringUTF16( + IDS_PRODUCT_SPECIFICATIONS_PAGE_ACTION_ADD_DEFAULT)); } ProductSpecificationsIconView::~ProductSpecificationsIconView() = default; @@ -70,14 +75,47 @@ void ProductSpecificationsIconView::UpdateImpl() { bool should_show = ShouldShow(); - SetLabel(l10n_util::GetStringUTF16( - IDS_PRODUCT_SPECIFICATIONS_PAGE_ACTION_ADD_DEFAULT)); + if (should_show) { + // TODO(b/325660810): Add logics to flip button visual state. + SetVisualState(false); + SetLabel(l10n_util::GetStringUTF16( + IDS_PRODUCT_SPECIFICATIONS_PAGE_ACTION_ADD_DEFAULT)); + MaybeShowPageActionLabel(); + } else { + HidePageActionLabel(); + } SetVisible(should_show); } +void ProductSpecificationsIconView::AnimationProgressed( + const gfx::Animation* animation) { + PageActionIconView::AnimationProgressed(animation); + // Pause the animation when the label is fully revealed to keep the icon in + // the expanded state. + // TODO(crbug.com/40832707): This approach of inspecting the animation + // progress to extend the animation duration is quite hacky. This should be + // removed and the IconLabelBubbleView API expanded to support a finer level + // of control. + constexpr double kAnimationValueWhenLabelFullyShown = 0.5; + if (should_extend_label_shown_duration_ && + GetAnimationValue() >= kAnimationValueWhenLabelFullyShown) { + should_extend_label_shown_duration_ = false; + PauseAnimation(); + } +} + bool ProductSpecificationsIconView::ShouldShow() { - // TODO(b/325660810): Add implementation to decide if icon should show. - return false; + if (delegate()->ShouldHidePageActionIcons()) { + return false; + } + auto* web_contents = GetWebContents(); + if (!web_contents) { + return false; + } + auto* tab_helper = + commerce::CommerceUiTabHelper::FromWebContents(web_contents); + + return tab_helper && tab_helper->ShouldShowProductSpecificationsIconView(); } void ProductSpecificationsIconView::SetVisualState(bool is_added) { @@ -88,5 +126,24 @@ UpdateIconImage(); } +void ProductSpecificationsIconView::MaybeShowPageActionLabel() { + if (!base::FeatureList::IsEnabled(commerce::kCommerceAllowChipExpansion)) { + return; + } + auto* tab_helper = + commerce::CommerceUiTabHelper::FromWebContents(GetWebContents()); + if (!tab_helper || !tab_helper->ShouldExpandPageActionIcon( + PageActionIconType::kProductSpecifications)) { + return; + } + should_extend_label_shown_duration_ = true; + AnimateIn(std::nullopt); +} + +void ProductSpecificationsIconView::HidePageActionLabel() { + UnpauseAnimation(); + ResetSlideAnimation(false); +} + BEGIN_METADATA(ProductSpecificationsIconView) END_METADATA
diff --git a/chrome/browser/ui/views/commerce/product_specifications_icon_view.h b/chrome/browser/ui/views/commerce/product_specifications_icon_view.h index c2cb47c3..7cbd18cd 100644 --- a/chrome/browser/ui/views/commerce/product_specifications_icon_view.h +++ b/chrome/browser/ui/views/commerce/product_specifications_icon_view.h
@@ -35,12 +35,21 @@ void UpdateImpl() override; private: + // IconLabelBubbleView: + void AnimationProgressed(const gfx::Animation* animation) override; + bool ShouldShow(); void SetVisualState(bool is_added); + void MaybeShowPageActionLabel(); + void HidePageActionLabel(); const raw_ptr<Browser> browser_; raw_ptr<const gfx::VectorIcon> icon_; + + // Boolean that tracks whether we should extend the duration for which the + // label is shown when it animates in. + bool should_extend_label_shown_duration_ = false; }; #endif // CHROME_BROWSER_UI_VIEWS_COMMERCE_PRODUCT_SPECIFICATIONS_ICON_VIEW_H_
diff --git a/chrome/browser/ui/views/commerce/product_specifications_icon_view_integration_test.cc b/chrome/browser/ui/views/commerce/product_specifications_icon_view_integration_test.cc new file mode 100644 index 0000000..940d8dfa --- /dev/null +++ b/chrome/browser/ui/views/commerce/product_specifications_icon_view_integration_test.cc
@@ -0,0 +1,120 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <memory> + +#include "base/functional/bind.h" +#include "chrome/browser/commerce/shopping_service_factory.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_element_identifiers.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h" +#include "chrome/browser/ui/views/commerce/product_specifications_icon_view.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/frame/test_with_browser_view.h" +#include "chrome/browser/ui/views/toolbar/toolbar_view.h" +#include "components/commerce/core/commerce_feature_list.h" +#include "components/commerce/core/mock_account_checker.h" +#include "components/commerce/core/mock_shopping_service.h" +#include "components/commerce/core/test_utils.h" +#include "content/public/browser/browser_context.h" +#include "ui/base/interaction/element_identifier.h" +#include "ui/base/interaction/element_tracker.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/ui_base_features.h" +#include "ui/views/interaction/element_tracker_views.h" + +namespace { +const char kUrlA[] = "chrome://flags"; +const char kUrlB[] = "about:blank"; + +} // namespace + +class ProductSpecificationsIconViewIntegrationTest + : public TestWithBrowserView { + public: + ProductSpecificationsIconViewIntegrationTest() = default; + + ProductSpecificationsIconViewIntegrationTest( + const ProductSpecificationsIconViewIntegrationTest&) = delete; + ProductSpecificationsIconViewIntegrationTest& operator=( + const ProductSpecificationsIconViewIntegrationTest&) = delete; + + ~ProductSpecificationsIconViewIntegrationTest() override = default; + + void SetUp() override { + test_features_.InitAndEnableFeature(commerce::kProductSpecifications); + TestWithBrowserView::SetUp(); + + account_checker_ = std::make_unique<commerce::MockAccountChecker>(); + shopping_service_ = static_cast<commerce::MockShoppingService*>( + commerce::ShoppingServiceFactory::GetForBrowserContext( + browser()->profile())); + shopping_service_->SetAccountChecker(account_checker_.get()); + AddTab(browser(), GURL(kUrlA)); + mock_tab_helper_ = AttachTabHelperToWebContents( + browser()->tab_strip_model()->GetActiveWebContents()); + } + + TestingProfile::TestingFactories GetTestingFactories() override { + TestingProfile::TestingFactories factories = + TestWithBrowserView::GetTestingFactories(); + factories.emplace_back( + commerce::ShoppingServiceFactory::GetInstance(), + base::BindRepeating(&ProductSpecificationsIconViewIntegrationTest:: + BuildMockShoppingService)); + return factories; + } + + static std::unique_ptr<KeyedService> BuildMockShoppingService( + content::BrowserContext* context) { + std::unique_ptr<commerce::MockShoppingService> service = + std::make_unique<commerce ::MockShoppingService>(); + return service; + } + + ProductSpecificationsIconView* GetChip() { + auto* location_bar_view = browser_view()->toolbar()->location_bar(); + const ui::ElementContext context = + views::ElementTrackerViews::GetContextForView(location_bar_view); + views::View* matched_view = + views::ElementTrackerViews::GetInstance()->GetFirstMatchingView( + kProductSpecificationsChipElementId, context); + return matched_view + ? views::AsViewClass<ProductSpecificationsIconView>(matched_view) + : nullptr; + } + + MockCommerceUiTabHelper* GetTabHelper() { return mock_tab_helper_.get(); } + + protected: + raw_ptr<MockCommerceUiTabHelper, DanglingUntriaged> mock_tab_helper_; + + private: + MockCommerceUiTabHelper* AttachTabHelperToWebContents( + content::WebContents* web_contents) { + MockCommerceUiTabHelper::CreateForWebContents(web_contents); + return static_cast<MockCommerceUiTabHelper*>( + MockCommerceUiTabHelper::FromWebContents(web_contents)); + } + + base::test::ScopedFeatureList test_features_; + raw_ptr<commerce::MockShoppingService, AcrossTasksDanglingUntriaged> + shopping_service_; + std::unique_ptr<commerce::MockAccountChecker> account_checker_; +}; + +TEST_F(ProductSpecificationsIconViewIntegrationTest, TestIconVisibility) { + ON_CALL(*GetTabHelper(), ShouldShowProductSpecificationsIconView) + .WillByDefault(testing::Return(true)); + + NavigateAndCommitActiveTab(GURL(kUrlA)); + auto* icon_view = GetChip(); + EXPECT_TRUE(icon_view->GetVisible()); + + ON_CALL(*GetTabHelper(), ShouldShowProductSpecificationsIconView) + .WillByDefault(testing::Return(false)); + NavigateAndCommitActiveTab(GURL(kUrlB)); + EXPECT_FALSE(icon_view->GetVisible()); +}
diff --git a/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.cc b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.cc new file mode 100644 index 0000000..f72e191 --- /dev/null +++ b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.cc
@@ -0,0 +1,103 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h" + +#include "chrome/browser/ui/views/global_media_controls/media_item_ui_helper.h" +#include "components/strings/grit/components_strings.h" +#include "components/vector_icons/vector_icons.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/views/background.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/layout/box_layout.h" + +namespace { + +constexpr gfx::Size kPreferredSize{370, 0}; + +constexpr int kBackgroundBorderThickness = 1; +constexpr int kBackgroundCornerRadius = 8; +constexpr int kStopCastingButtonCornerRadius = 10; +constexpr int kBackgroundSeparator = 8; +constexpr int kStopCastingButtonSeparator = 6; +constexpr int kDeviceIconSize = 20; +constexpr int kStopCastingButtonIconSize = 12; + +constexpr gfx::Insets kBackgroundInsets = gfx::Insets::VH(14, 16); + +} // namespace + +CastDeviceFooterView::CastDeviceFooterView( + base::RepeatingClosure stop_casting_callback, + media_message_center::MediaColorTheme media_color_theme) + : stop_casting_callback_(std::move(stop_casting_callback)) { + SetPreferredSize(kPreferredSize); + SetBorder(views::CreateThemedRoundedRectBorder( + kBackgroundBorderThickness, kBackgroundCornerRadius, + media_color_theme.device_selector_border_color_id)); + SetBackground(views::CreateThemedRoundedRectBackground( + media_color_theme.device_selector_background_color_id, + kBackgroundCornerRadius)); + auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kHorizontal, kBackgroundInsets, + kBackgroundSeparator)); + + // Add the device icon. + device_icon_ = AddChildView( + std::make_unique<views::ImageView>(ui::ImageModel::FromVectorIcon( + vector_icons::kMediaRouterIdleIcon, + media_color_theme.device_selector_foreground_color_id, + kDeviceIconSize))); + + // Add the device name. + // TODO(yrw): Add in the correct device name. + device_name_ = AddChildView(std::make_unique<views::Label>(u"Test Device")); + device_name_->SetTextStyle(views::style::STYLE_BODY_2); + device_name_->SetEnabledColorId( + media_color_theme.device_selector_foreground_color_id); + device_name_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + layout->SetFlexForView(device_name_, 1); + + // Add the stop casting button. + stop_casting_button_ = AddChildView(std::make_unique<views::LabelButton>( + base::BindRepeating(&CastDeviceFooterView::StopCasting, + base::Unretained(this)), + l10n_util::GetStringUTF16( + IDS_MEDIA_MESSAGE_CENTER_MEDIA_NOTIFICATION_ACTION_STOP_CASTING))); + stop_casting_button_->SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + vector_icons::kStopCircleIcon, + media_color_theme.error_foreground_color_id, + kStopCastingButtonIconSize)); + stop_casting_button_->SetLabelStyle(views::style::STYLE_BODY_5); + stop_casting_button_->SetEnabledTextColorIds( + media_color_theme.error_foreground_color_id); + stop_casting_button_->SetImageLabelSpacing(kStopCastingButtonSeparator); + stop_casting_button_->SetBackground(views::CreateThemedRoundedRectBackground( + media_color_theme.error_container_color_id, + kStopCastingButtonCornerRadius)); + + // Set the focus behavior for stop casting button. + stop_casting_button_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); + stop_casting_button_->SetFocusRingCornerRadius( + kStopCastingButtonCornerRadius); + views::FocusRing::Get(stop_casting_button_) + ->SetColorId(media_color_theme.focus_ring_color_id); +} + +CastDeviceFooterView::~CastDeviceFooterView() = default; + +views::LabelButton* CastDeviceFooterView::GetStopCastingButtonForTesting() { + return stop_casting_button_; +} + +void CastDeviceFooterView::StopCasting() { + stop_casting_button_->SetEnabled(false); + stop_casting_callback_.Run(); +} + +BEGIN_METADATA(CastDeviceFooterView) +END_METADATA
diff --git a/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h new file mode 100644 index 0000000..429b3b6 --- /dev/null +++ b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h
@@ -0,0 +1,47 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_GLOBAL_MEDIA_CONTROLS_CAST_DEVICE_FOOTER_VIEW_H_ +#define CHROME_BROWSER_UI_VIEWS_GLOBAL_MEDIA_CONTROLS_CAST_DEVICE_FOOTER_VIEW_H_ + +#include "components/global_media_controls/public/views/media_item_ui_footer.h" +#include "components/media_message_center/notification_theme.h" +#include "ui/base/metadata/metadata_header_macros.h" + +namespace views { +class ImageView; +class Label; +class LabelButton; +} // namespace views + +// A footer view attached to MediaItemUIUpdatedView containing the casting +// device and a stop casting button for a cast media item. This is used within +// MediaDialogView on non-CrOS desktop platforms when the +// media::kGlobalMediaControlsUpdatedUI flag is enabled. +class CastDeviceFooterView : public global_media_controls::MediaItemUIFooter { + METADATA_HEADER(CastDeviceFooterView, + global_media_controls::MediaItemUIFooter) + + public: + explicit CastDeviceFooterView( + base::RepeatingClosure stop_casting_callback, + media_message_center::MediaColorTheme media_color_theme); + ~CastDeviceFooterView() override; + + // global_media_controls::MediaItemUIFooter: + void OnColorsChanged(SkColor foreground, SkColor background) override {} + + views::LabelButton* GetStopCastingButtonForTesting(); + + private: + void StopCasting(); + + raw_ptr<views::ImageView> device_icon_; + raw_ptr<views::Label> device_name_; + raw_ptr<views::LabelButton> stop_casting_button_; + + base::RepeatingClosure stop_casting_callback_; +}; + +#endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_MEDIA_CONTROLS_CAST_DEVICE_FOOTER_VIEW_H_
diff --git a/chrome/browser/ui/views/global_media_controls/cast_device_footer_view_unittest.cc b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view_unittest.cc new file mode 100644 index 0000000..9bc74ec7 --- /dev/null +++ b/chrome/browser/ui/views/global_media_controls/cast_device_footer_view_unittest.cc
@@ -0,0 +1,7 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h" + +// TODO(yrw): Implement when CastDeviceFooterView is done.
diff --git a/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc b/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc index eed2c76..e1b219a2 100644 --- a/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc
@@ -218,20 +218,29 @@ } } -// TODO(yrw): Implement changes for `updated_items_`. void MediaDialogView::RefreshMediaItem( const std::string& id, base::WeakPtr<media_message_center::MediaNotificationItem> item) { - if (!observed_items_[id]) { + if (observed_items_.find(id) == observed_items_.end() && + updated_items_.find(id) == updated_items_.end()) { return; } bool show_devices = entry_point_ == GlobalMediaControlsEntryPoint::kPresentation; - observed_items_[id]->UpdateFooterView( - BuildFooter(id, item, profile_, media_color_theme_)); - observed_items_[id]->UpdateDeviceSelector( - BuildDeviceSelector(id, item, service_, service_, profile_, entry_point_, - show_devices, media_color_theme_)); + + if (media_color_theme_.has_value()) { + updated_items_[id]->UpdateFooterView( + BuildFooter(id, item, profile_, media_color_theme_)); + updated_items_[id]->UpdateDeviceSelectorView( + BuildDeviceSelector(id, item, service_, service_, profile_, + entry_point_, show_devices, media_color_theme_)); + } else { + observed_items_[id]->UpdateFooterView( + BuildFooter(id, item, profile_, media_color_theme_)); + observed_items_[id]->UpdateDeviceSelector( + BuildDeviceSelector(id, item, service_, service_, profile_, + entry_point_, show_devices, media_color_theme_)); + } UpdateBubbleSize(); } @@ -712,7 +721,8 @@ return std::make_unique<global_media_controls::MediaItemUIUpdatedView>( id, item, media_color_theme_.value(), BuildDeviceSelector(id, item, service_, service_, profile_, entry_point_, - show_devices, media_color_theme_)); + show_devices, media_color_theme_), + BuildFooter(id, item, profile_, media_color_theme_)); } BEGIN_METADATA(MediaDialogView)
diff --git a/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc b/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc index 941ea46d..64bc5df2 100644 --- a/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc +++ b/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/global_media_controls/cast_media_notification_item.h" #include "chrome/browser/ui/global_media_controls/media_item_ui_metrics.h" +#include "chrome/browser/ui/views/global_media_controls/cast_device_footer_view.h" #include "chrome/browser/ui/views/global_media_controls/cast_device_selector_view.h" #include "chrome/browser/ui/views/global_media_controls/media_dialog_view.h" #include "chrome/browser/ui/views/global_media_controls/media_item_ui_cast_footer_view.h" @@ -255,14 +256,9 @@ if (item->GetSourceType() == media_message_center::SourceType::kCast && media_router::GlobalMediaControlsCastStartStopEnabled(profile)) { #if BUILDFLAG(IS_CHROMEOS) - bool use_updated_ui = - base::FeatureList::IsEnabled(media::kGlobalMediaControlsCrOSUpdatedUI); -#else - bool use_updated_ui = - base::FeatureList::IsEnabled(media::kGlobalMediaControlsUpdatedUI); -#endif - - if (use_updated_ui && media_color_theme.has_value()) { + if (base::FeatureList::IsEnabled( + media::kGlobalMediaControlsCrOSUpdatedUI) && + media_color_theme.has_value()) { return std::make_unique<MediaItemUICastFooterView>( base::BindRepeating( &CastMediaNotificationItem::StopCasting, @@ -270,6 +266,16 @@ ->GetWeakPtr()), media_color_theme.value()); } +#else + if (media_color_theme.has_value()) { + return std::make_unique<CastDeviceFooterView>( + base::BindRepeating( + &CastMediaNotificationItem::StopCasting, + static_cast<CastMediaNotificationItem*>(item.get()) + ->GetWeakPtr()), + media_color_theme.value()); + } +#endif return std::make_unique<MediaItemUILegacyCastFooterView>( base::BindRepeating( @@ -283,6 +289,13 @@ return nullptr; } +#if !BUILDFLAG(IS_CHROMEOS) + if (media_color_theme.has_value()) { + return std::make_unique<CastDeviceFooterView>(std::move(stop_casting_cb), + media_color_theme.value()); + } +#endif + return std::make_unique<MediaItemUILegacyCastFooterView>( std::move(stop_casting_cb)); } @@ -306,6 +319,7 @@ theme.background_color_id = ui::kColorSysSurface2; theme.device_selector_border_color_id = ui::kColorSysDivider; + theme.device_selector_foreground_color_id = ui::kColorSysPrimary; theme.device_selector_background_color_id = ui::kColorSysSurface5; theme.error_foreground_color_id = ui::kColorSysError; theme.error_container_color_id = ui::kColorSysErrorContainer;
diff --git a/chrome/browser/ui/views/mahi/mahi_menu_controller.cc b/chrome/browser/ui/views/mahi/mahi_menu_controller.cc index 2173d97..0d7fe0e 100644 --- a/chrome/browser/ui/views/mahi/mahi_menu_controller.cc +++ b/chrome/browser/ui/views/mahi/mahi_menu_controller.cc
@@ -66,7 +66,7 @@ if (features::IsMagicBoostEnabled() && MagicBoostController::Get()->ShouldQuickAnswersAndMahiShowOptIn()) { - MagicBoostController::Get()->ShowOptInUi(); + MagicBoostController::Get()->ShowOptInUi(anchor_bounds); return; }
diff --git a/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc b/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc index 87c2cec1..10af471 100644 --- a/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc +++ b/chrome/browser/ui/views/permissions/chip/permission_chip_unittest.cc
@@ -79,7 +79,7 @@ void Deny() override { requests_.clear(); } void Dismiss() override { requests_.clear(); } void Ignore() override { requests_.clear(); } - void FinalizeCurrentRequests() override { NOTREACHED(); } + void FinalizeCurrentRequests() override { NOTREACHED_IN_MIGRATION(); } void OpenHelpCenterLink(const ui::Event& event) override {} void PreIgnoreQuietPrompt() override { requests_.clear(); } void SetManageClicked() override { requests_.clear(); }
diff --git a/chrome/browser/ui/views/side_panel/lens/lens_side_panel_coordinator_unittest.cc b/chrome/browser/ui/views/side_panel/lens/lens_side_panel_coordinator_unittest.cc index 3796f83..1da97579 100644 --- a/chrome/browser/ui/views/side_panel/lens/lens_side_panel_coordinator_unittest.cc +++ b/chrome/browser/ui/views/side_panel/lens/lens_side_panel_coordinator_unittest.cc
@@ -67,8 +67,8 @@ SidePanelCoordinator::GetGlobalSidePanelRegistry(browser); SidePanelUtil::PopulateGlobalEntries(browser, global_registry); - // Reading list, bookmarks, reading mode. - EXPECT_EQ(global_registry->entries().size(), 3u); + // Reading list, bookmarks. + EXPECT_EQ(global_registry->entries().size(), 2u); // Create the lens coordinator in Browser. lens_side_panel_coordinator_ =
diff --git a/chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator_unittest.cc b/chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator_unittest.cc index 5cf2cef..d7cd0d9 100644 --- a/chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator_unittest.cc +++ b/chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator_unittest.cc
@@ -48,13 +48,38 @@ side_panel_coordinator_ = SidePanelUtil::GetSidePanelCoordinatorForBrowser(browser()); - side_panel_registry_ = - SidePanelCoordinator::GetGlobalSidePanelRegistry(browser()); read_anything_coordinator_ = ReadAnythingCoordinator::GetOrCreateForBrowser(browser()); - AddTab(browser_view()->browser(), GURL("http://foo1.com")); + // Ensure a kReadAnything entry is added to the contextual registry for the + // first tab. + AddTabToBrowser(GURL("http://foo1.com")); + auto* tab_one_registry = + SidePanelRegistry::Get(browser_view()->GetActiveWebContents()); + contextual_registries_.push_back(tab_one_registry); + + // Ensure a kReadAnything entry is added to the contextual registry for the + // second tab. + AddTabToBrowser(GURL("http://foo2.com")); + auto* tab_two_registry = + SidePanelRegistry::Get(browser_view()->GetActiveWebContents()); + contextual_registries_.push_back(tab_two_registry); + + // Verify the first tab has one entry, kReadAnything. browser_view()->browser()->tab_strip_model()->ActivateTabAt(0); + SidePanelRegistry* contextual_registry = + SidePanelRegistry::Get(browser_view()->GetActiveWebContents()); + ASSERT_EQ(contextual_registry->entries().size(), 1u); + EXPECT_EQ(contextual_registry->entries()[0]->key().id(), + SidePanelEntry::Id::kReadAnything); + + // Verify the second tab has one entry, kReadAnything. + browser_view()->browser()->tab_strip_model()->ActivateTabAt(1); + contextual_registry = + SidePanelRegistry::Get(browser_view()->GetActiveWebContents()); + ASSERT_EQ(contextual_registry->entries().size(), 1u); + EXPECT_EQ(contextual_registry->entries()[0]->key().id(), + SidePanelEntry::Id::kReadAnything); } // Wrapper methods around the ReadAnythingCoordinator. These do nothing more @@ -100,7 +125,8 @@ protected: raw_ptr<SidePanelCoordinator, DanglingUntriaged> side_panel_coordinator_ = nullptr; - raw_ptr<SidePanelRegistry, DanglingUntriaged> side_panel_registry_ = nullptr; + std::vector<raw_ptr<SidePanelRegistry, DanglingUntriaged>> + contextual_registries_; raw_ptr<ReadAnythingCoordinator, DanglingUntriaged> read_anything_coordinator_ = nullptr; @@ -142,7 +168,8 @@ TEST_F(ReadAnythingCoordinatorTest, ActivateCalled_ShowAndHideReadAnythingEntry) { AddObserver(&coordinator_observer_); - SidePanelEntry* entry = side_panel_registry_->GetEntryForKey( + ASSERT_EQ(contextual_registries_.size(), 2u); + SidePanelEntry* entry = contextual_registries_[0]->GetEntryForKey( SidePanelEntry::Key(SidePanelEntry::Id::kReadAnything)); EXPECT_CALL(coordinator_observer_, Activate(true)).Times(1); @@ -153,9 +180,12 @@ } #if !BUILDFLAG(IS_CHROMEOS_LACROS) -TEST_F(ReadAnythingCoordinatorTest, - SidePanelShowAndHide_NonLacros_CallEmbeddedA11yExtensionLoader) { - SidePanelEntry* entry = side_panel_registry_->GetEntryForKey( +// TODO(b/324143642): enable this test when reading mode local side panels work +// with Docs. +TEST_F( + ReadAnythingCoordinatorTest, + DISABLED_SidePanelShowAndHide_NonLacros_CallEmbeddedA11yExtensionLoader) { + SidePanelEntry* entry = contextual_registries_[0]->GetEntryForKey( SidePanelEntry::Key(SidePanelEntry::Id::kReadAnything)); EXPECT_FALSE(EmbeddedA11yExtensionLoader::GetInstance()->IsExtensionInstalled( extension_misc::kReadingModeGDocsHelperExtensionId)); @@ -172,10 +202,12 @@ #endif // !BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_LACROS) +// TODO(b/324143642): enable this test when reading mode local side panels work +// with Docs. TEST_F( ReadAnythingCoordinatorTest, - SidePanelShowAndHide_Lacros_EmbeddedA11yManagerLacrosUpdateReadingModeState) { - SidePanelEntry* entry = side_panel_registry_->GetEntryForKey( + DISABLED_SidePanelShowAndHide_Lacros_EmbeddedA11yManagerLacrosUpdateReadingModeState) { + SidePanelEntry* entry = contextual_registries_[0]->GetEntryForKey( SidePanelEntry::Key(SidePanelEntry::Id::kReadAnything)); EXPECT_FALSE( EmbeddedA11yManagerLacros::GetInstance()->IsReadingModeEnabled());
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc b/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc index 58265d9..7a112cc 100644 --- a/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc +++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator_unittest.cc
@@ -205,6 +205,8 @@ SidePanelRegistry::Get(browser_view()->GetActiveWebContents()); registry->Deregister( SidePanelEntry::Key(SidePanelEntry::Id::kSearchCompanion)); + registry->Deregister( + SidePanelEntry::Key(SidePanelEntry::Id::kReadAnything)); } protected:
diff --git a/chrome/browser/ui/views/user_education/browser_user_education_service.cc b/chrome/browser/ui/views/user_education/browser_user_education_service.cc index d8c343819..e2e3430 100644 --- a/chrome/browser/ui/views/user_education/browser_user_education_service.cc +++ b/chrome/browser/ui/views/user_education/browser_user_education_service.cc
@@ -1364,6 +1364,12 @@ lens::features::kLensOverlay, user_education::Metadata(126, "jdonnelly@google.com, dfried@google.com", "Shown in app and web context menus."))); + + registry.RegisterFeature(user_education::NewBadgeSpecification( + features::kTabOrganization, + user_education::Metadata( + 126, "emshack@chromium.org", + "Shown in app menu when TabOrganizationAppMenuItem is enabled."))); } std::unique_ptr<BrowserFeaturePromoController> CreateUserEducationResources(
diff --git a/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.cc b/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.cc index 8f1630d..41c0327 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.cc
@@ -7,7 +7,6 @@ #include "ash/constants/ash_features.h" #include "base/values.h" #include "chrome/browser/ash/login/oobe_screen.h" -#include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h b/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h index 2a4f0ab..4adb2d28 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h
@@ -12,6 +12,7 @@ namespace ash { +// TODO(b/315829727): remove now unused handler + all dependent resources. // Interface for dependency injection between GaiaPasswordChangedScreen and its // WebUI representation. class GaiaPasswordChangedView {
diff --git a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc index d9ac75a2..17c9955 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc
@@ -408,6 +408,16 @@ void AddAppParentalControlsStrings(content::WebUIDataSource* html_source) { static constexpr webui::LocalizedString kLocalizedStrings[] = { + {"appParentalControlsAccessDialogTitle", + IDS_SETTINGS_APP_PARENTAL_CONTROLS_ACCESS_DIALOG_TITLE}, + {"appParentalControlsChoosePinSubtitle", + IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_SUBTITLE}, + {"appParentalControlsChoosePinTitle", + IDS_SETTINGS_APP_PARENTAL_CONTROLS_CHOOSE_PIN_TITLE}, + {"appParentalControlsConfirmPinTitle", + IDS_SETTINGS_APP_PARENTAL_CONTROLS_CONFIRM_PIN_TITLE}, + {"appParentalControlsForgotPinLinkName", + IDS_SETTINGS_APP_PARENTAL_CONTROLS_FORGOT_PIN_LINK_NAME}, {"appParentalControlsTitle", IDS_OS_SETTINGS_APP_PARENTAL_CONTROLS_LABEL}, {"appParentalControlsSubtitle", IDS_OS_SETTINGS_APP_PARENTAL_CONTROLS_SUBLABEL},
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.cc b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.cc index 8cbcccc..e9dd44e 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.cc
@@ -15,6 +15,8 @@ #include "base/functional/bind.h" #include "base/metrics/histogram_functions.h" #include "base/strings/strcat.h" +#include "base/time/time.h" +#include "base/timer/timer.h" #include "chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.mojom.h" #include "chromeos/dbus/power_manager/backlight.pb.h" #include "ui/display/manager/display_manager.h" @@ -36,6 +38,11 @@ // fired or not. constexpr int kUserOverrideDisplaySettingsTimeThresholdInMinute = 60; +// The interval of the timer that records the brightness slider adjusted event. +// Multiple changes to the brightness percentage will not be recorded until +// after this interval elapses. +constexpr base::TimeDelta kMetricsDelayTimerInterval = base::Seconds(2); + // Get UMA histogram name that records the time elapsed between users changing // the display settings and the display is connected. const std::string GetUserOverrideDefaultSettingsHistogramName( @@ -58,7 +65,12 @@ } // namespace -DisplaySettingsProvider::DisplaySettingsProvider() { +DisplaySettingsProvider::DisplaySettingsProvider() + : brightness_slider_metric_delay_timer_( + FROM_HERE, + kMetricsDelayTimerInterval, + this, + &DisplaySettingsProvider::RecordBrightnessSliderAdjusted) { if (Shell::HasInstance()) { shell_observation_.Observe(ash::Shell::Get()); } @@ -360,10 +372,16 @@ percent, /*gradual=*/true, /*source=*/ BrightnessControlDelegate::BrightnessChangeSource::kSettingsApp); + last_set_brightness_percent_ = percent; + // Start or reset timer for recording to metrics. + brightness_slider_metric_delay_timer_.Reset(); +} + +void DisplaySettingsProvider::RecordBrightnessSliderAdjusted() { // Record the brightness change event. std::string histogram_name(base::StrCat( {kDisplaySettingsHistogramName, ".Internal.BrightnessSliderAdjusted"})); - base::UmaHistogramPercentage(histogram_name, percent); + base::UmaHistogramPercentage(histogram_name, last_set_brightness_percent_); } void DisplaySettingsProvider::SetInternalDisplayAmbientLightSensorEnabled(
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.h b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.h index ab399c9..f6adead 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.h +++ b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.h
@@ -13,6 +13,7 @@ #include "ash/system/brightness_control_delegate.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" +#include "base/timer/timer.h" #include "base/types/id_type.h" #include "chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.mojom.h" #include "chromeos/dbus/power/power_manager_client.h" @@ -141,6 +142,8 @@ void OnGetHasAmbientLightSensor(HasAmbientLightSensorCallback callback, std::optional<bool> has_ambient_light_sensor); + void RecordBrightnessSliderAdjusted(); + base::ScopedObservation<ash::Shell, ash::ShellObserver> shell_observation_{ this}; @@ -165,6 +168,13 @@ // the display is connected. std::map<DisplayId, base::TimeTicks> displays_connection_timestamp_map_; + // The last display brightness percentage set by the user. Used for metrics. + double last_set_brightness_percent_; + + // Times used to prevent the brightness slider metrics from recording each + // time the user moves the slider while setting the desired brightness. + base::DelayTimer brightness_slider_metric_delay_timer_; + mojo::Receiver<mojom::DisplaySettingsProvider> receiver_{this}; base::WeakPtrFactory<DisplaySettingsProvider> weak_ptr_factory_{this};
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider_unittest.cc b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider_unittest.cc index d75eeb2..882ec80 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider_unittest.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider_unittest.cc
@@ -15,6 +15,7 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" +#include "base/time/time.h" #include "chrome/test/base/chrome_ash_test_base.h" #include "chromeos/dbus/power_manager/backlight.pb.h" #include "content/public/test/browser_task_environment.h" @@ -25,6 +26,8 @@ namespace { +constexpr base::TimeDelta kMetricsDelayTimerInterval = base::Seconds(2); + // A mock observer that records current tablet mode status and counts when // OnTabletModeChanged function is called. class FakeTabletModeObserver : public mojom::TabletModeObserver { @@ -653,26 +656,45 @@ "ChromeOS.Settings.Display.Internal.BrightnessSliderAdjusted", /*expected_count=*/0); - double brightness_percent = 33.3; - provider_->SetInternalDisplayScreenBrightness(brightness_percent); + double first_brightness_percent = 33.3; + double second_brightness_percent = 44.4; + double third_brightness_percent = 55.5; + // Move the brightness slider rapidly in succession. + provider_->SetInternalDisplayScreenBrightness(first_brightness_percent); + FastForwardBy(kMetricsDelayTimerInterval / 4); + provider_->SetInternalDisplayScreenBrightness(second_brightness_percent); + FastForwardBy(kMetricsDelayTimerInterval / 4); + provider_->SetInternalDisplayScreenBrightness(third_brightness_percent); - // The BrightnessControlDelegate should have been called with the new + // The BrightnessControlDelegate should have been called with the most recent // brightness percent. - EXPECT_EQ(brightness_percent, + EXPECT_EQ(third_brightness_percent, brightness_control_delegate_->brightness_percent()); // The BrightnessChangeSource should indicate that this change came from the // Settings app. EXPECT_EQ(BrightnessControlDelegate::BrightnessChangeSource::kSettingsApp, brightness_control_delegate_->last_brightness_change_source()); - // Histogram should have been recorded for this change. + // Wait for the metrics delay timer to resolve. + FastForwardBy(kMetricsDelayTimerInterval); + + // Histogram should have been recorded for this change, but only for the most + // recent brightness percent. histogram_tester_.ExpectTotalCount( "ChromeOS.Settings.Display.Internal.BrightnessSliderAdjusted", /*expected_count=*/1); - histogram_tester_.ExpectUniqueSample( + histogram_tester_.ExpectBucketCount( "ChromeOS.Settings.Display.Internal.BrightnessSliderAdjusted", - /*sample=*/brightness_percent, - /*expected_bucket_count=*/1); + /*sample=*/first_brightness_percent, + /*expected_count=*/0); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.Display.Internal.BrightnessSliderAdjusted", + /*sample=*/second_brightness_percent, + /*expected_count=*/0); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.Display.Internal.BrightnessSliderAdjusted", + /*sample=*/third_brightness_percent, + /*expected_count=*/1); } // Test the behavior when setting the internal display screen brightness (when
diff --git a/chrome/browser/ui/webui/ash/settings/pages/people/people_section.cc b/chrome/browser/ui/webui/ash/settings/pages/people/people_section.cc index b747354..2dbba02 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/people/people_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/people/people_section.cc
@@ -313,8 +313,6 @@ html_source->AddLocalizedStrings(kLocalizedStrings); html_source->AddBoolean("quickUnlockEnabled", quick_unlock::IsPinEnabled()); - html_source->AddBoolean("quickUnlockPinAutosubmitFeatureEnabled", - features::IsPinAutosubmitFeatureEnabled()); html_source->AddBoolean("quickUnlockDisabledByPolicy", quick_unlock::IsPinDisabledByPolicy( pref_service, quick_unlock::Purpose::kAny));
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.cc b/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.cc new file mode 100644 index 0000000..48c6898 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.cc
@@ -0,0 +1,60 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.h" + +#include <utility> + +#include "chrome/browser/ash/crosapi/crosapi_ash.h" +#include "chrome/browser/ash/crosapi/crosapi_manager.h" +#include "chrome/browser/ash/crosapi/extension_printer_service_ash.h" + +namespace printing { + +ExtensionPrinterHandlerAdapterAsh::ExtensionPrinterHandlerAdapterAsh() = + default; + +ExtensionPrinterHandlerAdapterAsh::~ExtensionPrinterHandlerAdapterAsh() = + default; + +void ExtensionPrinterHandlerAdapterAsh::Reset() { + // TODO(http://b/40273973): call GetExtensionPrinterService()->Reset() after + // that is being implemented. +} + +void ExtensionPrinterHandlerAdapterAsh::StartGetPrinters( + AddedPrintersCallback added_printers_callback, + GetPrintersDoneCallback done_callback) { + GetExtensionPrinterService()->StartGetPrinters( + std::move(added_printers_callback), std::move(done_callback)); +} + +void ExtensionPrinterHandlerAdapterAsh::StartGetCapability( + const std::string& destination_id, + GetCapabilityCallback callback) { + // TODO(http://b/40273973): Add Implementation. +} + +void ExtensionPrinterHandlerAdapterAsh::StartPrint( + const std::u16string& job_title, + base::Value::Dict settings, + scoped_refptr<base::RefCountedMemory> print_data, + PrintCallback callback) { + // TODO(http://b/40273973): Add Implementation. +} + +void ExtensionPrinterHandlerAdapterAsh::StartGrantPrinterAccess( + const std::string& printer_id, + GetPrinterInfoCallback callback) { + // TODO(http://b/40273973): Add Implementation. +} + +crosapi::ExtensionPrinterServiceAsh* +ExtensionPrinterHandlerAdapterAsh::GetExtensionPrinterService() { + return crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->extension_printer_service_ash(); +} + +} // namespace printing
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.h b/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.h new file mode 100644 index 0000000..6b66793 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.h
@@ -0,0 +1,52 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_ADAPTER_ASH_H_ +#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_ADAPTER_ASH_H_ + +#include "chrome/browser/ui/webui/print_preview/printer_handler.h" + +namespace crosapi { +class ExtensionPrinterServiceAsh; +} + +namespace printing { + +// Ash-chrome implementation of the PrinterHandler interface specifically for +// lacros extensions. +// +// - Delegates print requests to ExtensionPrinterServiceAsh for forwarding to +// lacros and receiving responses via crosapi. +// +// - Actively replaces the default ExtensionPrinterHandler when lacros is in +// use, as the default handler is not compatible with lacros extensions. +class ExtensionPrinterHandlerAdapterAsh : public PrinterHandler { + public: + ExtensionPrinterHandlerAdapterAsh(); + ExtensionPrinterHandlerAdapterAsh(const ExtensionPrinterHandlerAdapterAsh&) = + delete; + ExtensionPrinterHandlerAdapterAsh& operator=( + const ExtensionPrinterHandlerAdapterAsh&) = delete; + ~ExtensionPrinterHandlerAdapterAsh() override; + + // PrinterHandler implementation: + void Reset() override; + void StartGetPrinters(AddedPrintersCallback added_printers_callback, + GetPrintersDoneCallback done_callback) override; + void StartGetCapability(const std::string& destination_id, + GetCapabilityCallback callback) override; + void StartPrint(const std::u16string& job_title, + base::Value::Dict settings, + scoped_refptr<base::RefCountedMemory> print_data, + PrintCallback callback) override; + void StartGrantPrinterAccess(const std::string& printer_id, + GetPrinterInfoCallback callback) override; + + private: + crosapi::ExtensionPrinterServiceAsh* GetExtensionPrinterService(); +}; + +} // namespace printing + +#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_HANDLER_ADAPTER_ASH_H_
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.cc b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.cc new file mode 100644 index 0000000..4d02ed58 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.cc
@@ -0,0 +1,47 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h" + +#include "base/no_destructor.h" +#include "chrome/browser/profiles/incognito_helpers.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" + +namespace printing { + +ExtensionPrinterServiceProviderLacros* +ExtensionPrinterServiceProviderFactoryLacros::GetForBrowserContext( + content::BrowserContext* context) { + return static_cast<ExtensionPrinterServiceProviderLacros*>( + GetInstance()->GetServiceForBrowserContext(context, true)); +} + +ExtensionPrinterServiceProviderFactoryLacros* +ExtensionPrinterServiceProviderFactoryLacros::GetInstance() { + static base::NoDestructor<ExtensionPrinterServiceProviderFactoryLacros> + instance; + return instance.get(); +} + +ExtensionPrinterServiceProviderFactoryLacros:: + ExtensionPrinterServiceProviderFactoryLacros() + : ProfileKeyedServiceFactory( + "ExtensionPrinterServiceProviderLacros", + ProfileSelections::Builder() + .WithRegular(ProfileSelection::kRedirectedToOriginal) + .WithGuest(ProfileSelection::kRedirectedToOriginal) + .Build()) {} + +ExtensionPrinterServiceProviderFactoryLacros:: + ~ExtensionPrinterServiceProviderFactoryLacros() = default; + +std::unique_ptr<KeyedService> ExtensionPrinterServiceProviderFactoryLacros:: + BuildServiceInstanceForBrowserContext( + content::BrowserContext* context) const { + return std::make_unique<ExtensionPrinterServiceProviderLacros>(context); +} + +} // namespace printing
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h new file mode 100644 index 0000000..cf32cf9 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h
@@ -0,0 +1,42 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_FACTORY_LACROS_H_ +#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_FACTORY_LACROS_H_ + +#include "base/no_destructor.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" + +namespace printing { + +class ExtensionPrinterServiceProviderLacros; + +// Service factory to create ExtensionPrinterServiceProviderLacros per +// BrowserContext. Note that OTR browser context uses its original profile's +// browser context, and won't create a separate +// ExtensionPrinterServiceProviderLacros. +class ExtensionPrinterServiceProviderFactoryLacros + : public ProfileKeyedServiceFactory { + public: + // Returns the ExtensionPrinterServiceProviderLacros for |browser_context|, + // creating it if it is not yet created. + static ExtensionPrinterServiceProviderLacros* GetForBrowserContext( + content::BrowserContext* context); + + // Returns the ExtensionPrinterServiceProviderFactoryLacros instance. + static ExtensionPrinterServiceProviderFactoryLacros* GetInstance(); + + private: + friend class base::NoDestructor<ExtensionPrinterServiceProviderFactoryLacros>; + ExtensionPrinterServiceProviderFactoryLacros(); + ~ExtensionPrinterServiceProviderFactoryLacros() override; + + // ProfileKeyedServiceFactory overrides: + std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext( + content::BrowserContext* context) const override; +}; + +} // namespace printing + +#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_FACTORY_LACROS_H_
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.cc b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.cc new file mode 100644 index 0000000..efd2fca7 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.cc
@@ -0,0 +1,91 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h" + +#include <memory> + +#include "base/functional/bind.h" +#include "base/json/json_writer.h" +#include "base/unguessable_token.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_factory_lacros.h" +#include "chrome/browser/ui/webui/print_preview/printer_handler.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" +#include "chromeos/lacros/lacros_service.h" + +namespace printing { + +ExtensionPrinterServiceProviderLacros::ExtensionPrinterServiceProviderLacros( + content::BrowserContext* browser_context) + : browser_context_(browser_context) { + Profile* profile = Profile::FromBrowserContext(browser_context); + // Printing extensions from primary profile only is supported for now. + if (profile != ProfileManager::GetPrimaryUserProfile()) { + VLOG(1) << "ExtensionPrinterServiceProviderLacros():" + "not the main profile"; + return; + } + + auto* service = chromeos::LacrosService::Get(); + if (!service->IsAvailable<crosapi::mojom::ExtensionPrinterService>()) { + VLOG(1) << "ExtensionPrinterServiceProviderLacros():" + << " crosapi::mojom::ExtensionPrinterService is not available"; + return; + } + service->GetRemote<crosapi::mojom::ExtensionPrinterService>() + ->RegisterServiceProvider( + receiver_.BindNewPipeAndPassRemoteWithVersion()); + extension_printer_handler_ = + PrinterHandler::CreateForExtensionPrinters(profile); +} + +ExtensionPrinterServiceProviderLacros:: + ~ExtensionPrinterServiceProviderLacros() = default; + +ExtensionPrinterServiceProviderLacros* +ExtensionPrinterServiceProviderLacros::GetForBrowserContext( + content::BrowserContext* context) { + return ExtensionPrinterServiceProviderFactoryLacros::GetForBrowserContext( + context); +} + +void ExtensionPrinterServiceProviderLacros::DispatchGetPrintersRequest( + const ::base::UnguessableToken& request_id) { + VLOG(1) + << "ExtensionPrinterServiceProviderLacros::DispatchGetPrintersRequest():" + << " request_id=" << request_id; + extension_printer_handler_->StartGetPrinters( + base::BindRepeating( + &ExtensionPrinterServiceProviderLacros::OnAddedPrinters, + weak_ptr_factory_.GetWeakPtr(), request_id), + base::BindOnce(&ExtensionPrinterServiceProviderLacros::OnGetPrintersDone, + weak_ptr_factory_.GetWeakPtr(), request_id)); +} + +void ExtensionPrinterServiceProviderLacros::OnAddedPrinters( + const base::UnguessableToken request_id, + base::Value::List printers) { + VLOG(1) << "ExtensionPrinterServiceProviderLacros::OnAddedPrinters():" + << " request_id=" << request_id + << ", # of printers=" << printers.size(); + + chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::ExtensionPrinterService>() + ->PrintersAdded(request_id, std::move(printers), /* is_done=*/false); +} + +void ExtensionPrinterServiceProviderLacros::OnGetPrintersDone( + base::UnguessableToken request_id) { + VLOG(1) << "ExtensionPrinterServiceProviderLacros::OnGetPrintersDone():" + << " request_id=" << request_id; + + base::Value::List printers; // return an empty list of printers. + chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::ExtensionPrinterService>() + ->PrintersAdded(request_id, std::move(printers), /* is_done=*/true); +} + +} // namespace printing
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h new file mode 100644 index 0000000..5ab75712 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h
@@ -0,0 +1,71 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_LACROS_H_ +#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_LACROS_H_ + +#include <memory> + +#include "base/memory/weak_ptr.h" +#include "base/unguessable_token.h" +#include "chrome/browser/ui/webui/print_preview/printer_handler.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" +#include "extensions/browser/browser_context_keyed_api_factory.h" +#include "mojo/public/cpp/bindings/receiver.h" + +namespace content { +class BrowserContext; +} + +namespace printing { + +// Implements crosapi::mojom::ExtensionPrinterServiceProvider to enable +// ash-chrome to request printing operations (e.g., querying printers, +// submitting jobs) from Lacros extensions. One instance per BrowserContext. +class ExtensionPrinterServiceProviderLacros + : public extensions::BrowserContextKeyedAPI, + public crosapi::mojom::ExtensionPrinterServiceProvider { + public: + explicit ExtensionPrinterServiceProviderLacros( + content::BrowserContext* context); + ExtensionPrinterServiceProviderLacros( + const ExtensionPrinterServiceProviderLacros&) = delete; + ExtensionPrinterServiceProviderLacros& operator=( + const ExtensionPrinterServiceProviderLacros&) = delete; + ~ExtensionPrinterServiceProviderLacros() override; + + content::BrowserContext* browser_context() { return browser_context_; } + + static ExtensionPrinterServiceProviderLacros* GetForBrowserContext( + content::BrowserContext* context); + + // crosapi::mojom::ExtensionPrinterServiceProvider: + void DispatchGetPrintersRequest( + const ::base::UnguessableToken& request_id) override; + + void SetPrinterHandlerForTesting(std::unique_ptr<PrinterHandler> handler) { + extension_printer_handler_ = std::move(handler); + } + + private: + void OnAddedPrinters(const base::UnguessableToken request_id, + base::Value::List printers); + void OnGetPrintersDone(base::UnguessableToken request_id); + + friend class extensions::BrowserContextKeyedAPIFactory< + ExtensionPrinterServiceProviderLacros>; + + raw_ptr<content::BrowserContext> browser_context_; // not owned. + mojo::Receiver<crosapi::mojom::ExtensionPrinterServiceProvider> receiver_{ + this}; + // Handles requests for extension printers. + std::unique_ptr<PrinterHandler> extension_printer_handler_; + + base::WeakPtrFactory<ExtensionPrinterServiceProviderLacros> weak_ptr_factory_{ + this}; +}; + +} // namespace printing + +#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_PROVIDER_LACROS_H_
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros_browsertest.cc b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros_browsertest.cc new file mode 100644 index 0000000..8940f4e --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros_browsertest.cc
@@ -0,0 +1,193 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h" + +#include <memory> + +#include "base/test/task_environment.h" +#include "base/test/values_test_util.h" +#include "base/unguessable_token.h" +#include "base/values.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_handler.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" +#include "chromeos/lacros/lacros_service.h" +#include "content/public/test/browser_test.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace printing { + +namespace { + +base::Value::List CreateTestPrinters() { + return base::test::ParseJsonList(R"( + [ { + "description": "A virtual printer for testing", + "extensionId": "jbljdigmdjodgkcllikhggoepmmffbam", + "extensionName": "Test Printer Provider", + "id": "jbljdigmdjodgkcllikhggoepmmffbam:test-printer-01", + "name": "Test Printer 01" + }, { + "description": "A virtual printer for testing", + "extensionId": "jbljdigmdjodgkcllikhggoepmmffbam", + "extensionName": "Test Printer Provider", + "id": "jbljdigmdjodgkcllikhggoepmmffbam:test-printer-02", + "name": "Test Printer 02" + } ] + )"); +} + +using ::testing::_; +using ::testing::Mock; +using ::testing::SizeIs; + +class MockExtensionPrinterServiceAsh + : public crosapi::mojom::ExtensionPrinterService { + public: + MockExtensionPrinterServiceAsh() { + ON_CALL(*this, RegisterServiceProvider) + .WillByDefault(testing::Invoke( + [&](mojo::PendingRemote< + crosapi::mojom::ExtensionPrinterServiceProvider> provider) { + remote_.Bind(std::move(provider)); + })); + } + + // mojom::ExtensionPrinterService: + MOCK_METHOD( + void, + RegisterServiceProvider, + (mojo::PendingRemote<crosapi::mojom::ExtensionPrinterServiceProvider>), + (override)); + + MOCK_METHOD(void, + PrintersAdded, + (const base::UnguessableToken& request_id, + base::Value::List printers, + bool is_done), + (override)); + + mojo::Receiver<crosapi::mojom::ExtensionPrinterService> receiver_{this}; + mojo::Remote<crosapi::mojom::ExtensionPrinterServiceProvider> remote_; +}; + +class FakeExtensionPrinterHandler : public PrinterHandler { + public: + FakeExtensionPrinterHandler() { SetPrinters(CreateTestPrinters()); } + FakeExtensionPrinterHandler(const FakeExtensionPrinterHandler&) = delete; + FakeExtensionPrinterHandler& operator=(const FakeExtensionPrinterHandler&) = + delete; + ~FakeExtensionPrinterHandler() override = default; + + void Reset() override {} + + void StartGetPrinters(AddedPrintersCallback added_printers_callback, + GetPrintersDoneCallback done_callback) override { + if (!printers_.empty()) { + added_printers_callback.Run(printers_.Clone()); + } + std::move(done_callback).Run(); + } + + void StartGetCapability(const std::string& destination_id, + GetCapabilityCallback callback) override {} + + void StartGrantPrinterAccess(const std::string& printer_id, + GetPrinterInfoCallback callback) override {} + + void StartPrint(const std::u16string& job_title, + base::Value::Dict settings, + scoped_refptr<base::RefCountedMemory> print_data, + PrintCallback callback) override {} + + void SetPrinters(base::Value::List printers) { + printers_ = std::move(printers); + } + + private: + base::Value::List printers_; +}; + +class ExtensionPrinterServiceProviderLacrosBrowserTest + : public InProcessBrowserTest { + public: + ExtensionPrinterServiceProviderLacrosBrowserTest() + : request_id_(base::UnguessableToken::Create()) {} + + // InProcessBrowserTest: + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + + // Inject the mock interface. + chromeos::LacrosService::Get()->InjectRemoteForTesting( + mock_extension_printer_service_.receiver_.BindNewPipeAndPassRemote()); + } + + bool IsExtensionPrinterServiceAvailable() { + auto* lacros_service = chromeos::LacrosService::Get(); + return ( + lacros_service && + lacros_service->IsAvailable<crosapi::mojom::ExtensionPrinterService>()); + } + + protected: + const base::UnguessableToken request_id_; + MockExtensionPrinterServiceAsh mock_extension_printer_service_; +}; + +} // namespace + +// Verifies that `ExtensionPrinterServiceProviderLacros` calls the +// ExtensionPrinterService interface to register itself as a service provider. +IN_PROC_BROWSER_TEST_F(ExtensionPrinterServiceProviderLacrosBrowserTest, + RegisterServiceProvider) { + if (!IsExtensionPrinterServiceAvailable()) { + GTEST_SKIP_("extension printer service is not available"); + } + + EXPECT_CALL(mock_extension_printer_service_, RegisterServiceProvider) + .Times(1); + + ExtensionPrinterServiceProviderLacros provider{browser()->profile()}; + + chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::ExtensionPrinterService>() + .FlushForTesting(); +} + +// Verifies that `ExtensionPrinterServiceProviderLacros` calls the +// ExtensionPrinterService's PrintersAdded interface to report printers found +// and to signal done. +IN_PROC_BROWSER_TEST_F(ExtensionPrinterServiceProviderLacrosBrowserTest, + DispatchGetPrintersRequest) { + if (!IsExtensionPrinterServiceAvailable()) { + GTEST_SKIP_("extension printer service is not available"); + } + + EXPECT_CALL(mock_extension_printer_service_, RegisterServiceProvider) + .Times(1); + // The last call is for signaling done. + EXPECT_CALL(mock_extension_printer_service_, + PrintersAdded(request_id_, SizeIs(0), true)); + // The first call is for reporting none empty printer set. + EXPECT_CALL(mock_extension_printer_service_, + PrintersAdded(request_id_, SizeIs(2), false)); + + ExtensionPrinterServiceProviderLacros provider{browser()->profile()}; + provider.SetPrinterHandlerForTesting( + std::make_unique<FakeExtensionPrinterHandler>()); + provider.DispatchGetPrintersRequest(request_id_); + + chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::ExtensionPrinterService>() + .FlushForTesting(); +} + +} // namespace printing
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.cc b/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.cc new file mode 100644 index 0000000..0d4b628 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.cc
@@ -0,0 +1,40 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.h" + +#include "chrome/browser/browser_process.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/profiles/profile_manager_observer.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_service_provider_lacros.h" + +namespace printing { + +ExtensionPrinterServiceSetupLacros* +ExtensionPrinterServiceSetupLacros::GetInstance() { + static base::NoDestructor<ExtensionPrinterServiceSetupLacros> + extension_printer_service_setup_lacros; + return extension_printer_service_setup_lacros.get(); +} + +ExtensionPrinterServiceSetupLacros::ExtensionPrinterServiceSetupLacros() { + profile_manager_observation_.Observe(g_browser_process->profile_manager()); +} + +ExtensionPrinterServiceSetupLacros::~ExtensionPrinterServiceSetupLacros() = + default; + +void ExtensionPrinterServiceSetupLacros::OnProfileAdded(Profile* profile) { + // Create ExtensionPrinterServiceProviderLacros for |profile| if it is a main + // profile. + if (profile == ProfileManager::GetPrimaryUserProfile()) { + ExtensionPrinterServiceProviderLacros::GetForBrowserContext(profile); + } +} + +void ExtensionPrinterServiceSetupLacros::OnProfileManagerDestroying() { + profile_manager_observation_.Reset(); +} + +} // namespace printing
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.h b/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.h new file mode 100644 index 0000000..71b7277 --- /dev/null +++ b/chrome/browser/ui/webui/print_preview/extension_printer_service_setup_lacros.h
@@ -0,0 +1,40 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_SETUP_LACROS_H_ +#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_SETUP_LACROS_H_ + +#include "base/no_destructor.h" +#include "base/scoped_observation.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/profiles/profile_manager_observer.h" + +namespace printing { + +// Creates ExtensionPrinterServiceProviderLacros when user profile is loaded. +class ExtensionPrinterServiceSetupLacros : public ProfileManagerObserver { + public: + static ExtensionPrinterServiceSetupLacros* GetInstance(); + + ExtensionPrinterServiceSetupLacros( + const ExtensionPrinterServiceSetupLacros&) = delete; + ExtensionPrinterServiceSetupLacros& operator=( + const ExtensionPrinterServiceSetupLacros&) = delete; + + private: + friend class base::NoDestructor<ExtensionPrinterServiceSetupLacros>; + ExtensionPrinterServiceSetupLacros(); + ~ExtensionPrinterServiceSetupLacros() override; + + // ProfileManagerObserver + void OnProfileAdded(Profile* profile) override; + void OnProfileManagerDestroying() override; + + base::ScopedObservation<ProfileManager, ProfileManagerObserver> + profile_manager_observation_{this}; +}; + +} // namespace printing + +#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_EXTENSION_PRINTER_SERVICE_SETUP_LACROS_H_
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc index 9fe0f77..7287bb21 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -11,10 +11,12 @@ #include <utility> #include <vector> +#include "ash/constants/ash_features.h" #include "base/check.h" #include "base/command_line.h" #include "base/containers/contains.h" #include "base/dcheck_is_on.h" +#include "base/feature_list.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/i18n/number_formatting.h" @@ -86,10 +88,12 @@ #endif #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "chrome/browser/ash/crosapi/browser_util.h" #include "chrome/browser/ash/crosapi/crosapi_ash.h" #include "chrome/browser/ash/crosapi/crosapi_manager.h" #include "chrome/browser/ash/crosapi/local_printer_ash.h" #include "chrome/browser/ash/drive/drive_integration_service.h" +#include "chrome/browser/ui/webui/print_preview/extension_printer_handler_adapter_ash.h" #elif BUILDFLAG(IS_CHROMEOS_LACROS) #include "chrome/common/chrome_paths_lacros.h" #include "chromeos/lacros/lacros_service.h" @@ -1162,6 +1166,18 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( mojom::PrinterType printer_type) { if (printer_type == mojom::PrinterType::kExtension) { +#if BUILDFLAG(IS_CHROMEOS_ASH) + // When Lacros is enabled, uses the ExtensionPrinterHandlerAdapterAsh to + // talk to Lacros's extension printers. + if (ash::features::IsLacrosExtensionPrintingEnabled() && + crosapi::browser_util::IsLacrosEnabled()) { + if (!extension_printer_handler_adapter_) { + extension_printer_handler_adapter_ = + std::make_unique<ExtensionPrinterHandlerAdapterAsh>(); + } + return extension_printer_handler_adapter_.get(); + } +#endif if (!extension_printer_handler_) { extension_printer_handler_ = PrinterHandler::CreateForExtensionPrinters( Profile::FromWebUI(web_ui()));
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chrome/browser/ui/webui/print_preview/print_preview_handler.h index 14cf816..dd5e4527 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -48,6 +48,9 @@ namespace printing { +#if BUILDFLAG(IS_CHROMEOS_ASH) +class ExtensionPrinterHandlerAdapterAsh; +#endif class PdfPrinterHandler; class PrinterHandler; class PrintPreviewUI; @@ -325,6 +328,12 @@ nullptr; #endif +#if BUILDFLAG(IS_CHROMEOS_ASH) + // Used when Lacros is enabled. + std::unique_ptr<ExtensionPrinterHandlerAdapterAsh> + extension_printer_handler_adapter_ = nullptr; +#endif + #if BUILDFLAG(IS_CHROMEOS_LACROS) // Version number of the LocalPrinter mojo service. int local_printer_version_ = 0;
diff --git a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc index 849c4a18..3113f8f0 100644 --- a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc +++ b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc
@@ -246,7 +246,9 @@ if (features::IsReadAnythingLocalSidePanelEnabled()) { auto* active_web_contents = browser_->tab_strip_model()->GetActiveWebContents(); - ObserveWebContentsSidePanelController(active_web_contents); + if (active_web_contents) { + ObserveWebContentsSidePanelController(active_web_contents); + } } else { coordinator_ = ReadAnythingCoordinator::FromBrowser(browser_.get()); if (coordinator_) {
diff --git a/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc b/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc index 448aff81..36325911 100644 --- a/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc +++ b/chrome/browser/ui/webui/signin/turn_sync_on_helper_browsertest.cc
@@ -65,7 +65,9 @@ ~Delegate() override = default; // TurnSyncOnHelper::Delegate: - void ShowLoginError(const SigninUIError& error) override { NOTREACHED(); } + void ShowLoginError(const SigninUIError& error) override { + NOTREACHED_IN_MIGRATION(); + } void ShowMergeSyncDataConfirmation( const std::string& previous_email, const std::string& new_email, @@ -86,8 +88,10 @@ SyncConfirmationCallback callback) override { AdvanceFlowOrCapture(BlockingStep::kSyncDisabled, std::move(callback)); } - void ShowSyncSettings() override { NOTREACHED(); } - void SwitchToProfile(Profile* new_profile) override { NOTREACHED(); } + void ShowSyncSettings() override { NOTREACHED_IN_MIGRATION(); } + void SwitchToProfile(Profile* new_profile) override { + NOTREACHED_IN_MIGRATION(); + } BlockingStep blocking_step() const { return blocking_step_; }
diff --git a/chrome/browser/usb/usb_browser_test_utils.cc b/chrome/browser/usb/usb_browser_test_utils.cc index 89b31bba..c951865c 100644 --- a/chrome/browser/usb/usb_browser_test_utils.cc +++ b/chrome/browser/usb/usb_browser_test_utils.cc
@@ -33,11 +33,15 @@ delete this; } - void OnOptionAdded(size_t index) override { NOTREACHED(); } - void OnOptionRemoved(size_t index) override { NOTREACHED(); } - void OnOptionUpdated(size_t index) override { NOTREACHED(); } - void OnAdapterEnabledChanged(bool enabled) override { NOTREACHED(); } - void OnRefreshStateChanged(bool refreshing) override { NOTREACHED(); } + void OnOptionAdded(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnOptionRemoved(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnOptionUpdated(size_t index) override { NOTREACHED_IN_MIGRATION(); } + void OnAdapterEnabledChanged(bool enabled) override { + NOTREACHED_IN_MIGRATION(); + } + void OnRefreshStateChanged(bool refreshing) override { + NOTREACHED_IN_MIGRATION(); + } private: std::unique_ptr<permissions::ChooserController> controller_;
diff --git a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc index c85c1f63..e077b27 100644 --- a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc +++ b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc
@@ -1168,9 +1168,9 @@ WebAppInstallManagerObserverAdapter install_observer( &GetProvider().install_manager()); install_observer.SetWebAppInstalledDelegate(base::BindLambdaForTesting( - [](const webapps::AppId& app_id) { NOTREACHED(); })); + [](const webapps::AppId& app_id) { NOTREACHED_IN_MIGRATION(); })); install_observer.SetWebAppUninstalledDelegate(base::BindLambdaForTesting( - [](const webapps::AppId& app_id) { NOTREACHED(); })); + [](const webapps::AppId& app_id) { NOTREACHED_IN_MIGRATION(); })); // CSS #RRGGBBAA syntax. OverrideManifest(kManifestTemplate, {kInstallableIconList, "#00FF00F0"});
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc b/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc index 0a74ac22..781588ac7 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc +++ b/chrome/browser/web_applications/policy/web_app_policy_manager_unittest.cc
@@ -245,7 +245,7 @@ return on_policy_changed_call_count; } - void OnAppRegistrarDestroyed() override { NOTREACHED(); } + void OnAppRegistrarDestroyed() override { NOTREACHED_IN_MIGRATION(); } private: int on_policy_changed_call_count = 0;
diff --git a/chrome/browser/webauthn/enclave_manager_unittest.cc b/chrome/browser/webauthn/enclave_manager_unittest.cc index ee259721..d99821e 100644 --- a/chrome/browser/webauthn/enclave_manager_unittest.cc +++ b/chrome/browser/webauthn/enclave_manager_unittest.cc
@@ -347,8 +347,10 @@ *manager_.GetWrappedSecret(/*version=*/kSecretVersion); ui_request->entity = std::move(entity); ui_request->claimed_pin = std::move(claimed_pin); - ui_request->save_passkey_callback = base::BindOnce( - [](sync_pb::WebauthnCredentialSpecifics) { NOTREACHED(); }); + ui_request->save_passkey_callback = + base::BindOnce([](sync_pb::WebauthnCredentialSpecifics) { + NOTREACHED_IN_MIGRATION(); + }); enclave::EnclaveAuthenticator authenticator( std::move(ui_request), /*network_context_factory=*/
diff --git a/chrome/browser/webid/BUILD.gn b/chrome/browser/webid/BUILD.gn new file mode 100644 index 0000000..abe1d24 --- /dev/null +++ b/chrome/browser/webid/BUILD.gn
@@ -0,0 +1,36 @@ +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") +import("//third_party/jni_zero/jni_zero.gni") + +android_library("java") { + sources = [ "android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProvider.java" ] + deps = [ + "//base:base_java", + "//content/public/android:content_java", + "//content/public/android:identity_credentials_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/jni_zero:jni_zero_java", + "//ui/android:ui_no_recycler_view_java", + ] + + srcjar_deps = [ ":jni_headers" ] +} + +generate_jni("jni_headers") { + sources = [ "android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProvider.java" ] +} + +robolectric_library("junit") { + testonly = true + sources = [ "android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProviderUnitTest.java" ] + + deps = [ + ":java", + "//base:base_junit_test_support", + "//content/public/android:content_java", + "//third_party/junit:junit", + ] +}
diff --git a/content/public/android/java/src/org/chromium/content/browser/webid/DigitalIdentityProvider.java b/chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProvider.java similarity index 92% rename from content/public/android/java/src/org/chromium/content/browser/webid/DigitalIdentityProvider.java rename to chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProvider.java index a854282b..e349cfa 100644 --- a/content/public/android/java/src/org/chromium/content/browser/webid/DigitalIdentityProvider.java +++ b/chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProvider.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.content.browser.webid; +package org.chromium.chrome.browser.webid; import android.annotation.SuppressLint; import android.credentials.GetCredentialException; @@ -11,19 +11,20 @@ import androidx.annotation.VisibleForTesting; import org.jni_zero.CalledByNative; -import org.jni_zero.JNINamespace; import org.jni_zero.NativeMethods; import org.chromium.base.ResettersForTesting; +import org.chromium.content_public.browser.webid.IdentityCredentialsDelegate; +import org.chromium.content_public.browser.webid.IdentityCredentialsDelegateFactory; import org.chromium.content_public.browser.webid.DigitalIdentityRequestStatusForMetrics; import org.chromium.ui.base.WindowAndroid; /** Class for issuing request to the Identity Credentials Manager in GMS core. */ -@JNINamespace("content") public class DigitalIdentityProvider { private static final String TAG = "DigitalIdentityProvider"; private long mDigitalIdentityProvider; - private static IdentityCredentialsDelegate sCredentials = new IdentityCredentialsDelegateImpl(); + private static IdentityCredentialsDelegate sCredentials = + IdentityCredentialsDelegateFactory.createDefault(); private DigitalIdentityProvider(long digitalIdentityProvider) { mDigitalIdentityProvider = digitalIdentityProvider;
diff --git a/content/public/android/junit/src/org/chromium/content/browser/webid/DigitalIdentityProviderTest.java b/chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProviderUnitTest.java similarity index 94% rename from content/public/android/junit/src/org/chromium/content/browser/webid/DigitalIdentityProviderTest.java rename to chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProviderUnitTest.java index f6c108d..86531da 100644 --- a/content/public/android/junit/src/org/chromium/content/browser/webid/DigitalIdentityProviderTest.java +++ b/chrome/browser/webid/android/java/src/org/chromium/chrome/browser/webid/DigitalIdentityProviderUnitTest.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.content.browser.webid; +package org.chromium.chrome.browser.webid; import static org.junit.Assert.assertEquals; @@ -18,7 +18,7 @@ /** Tests for {@link DigitalIdentityProvider} */ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE, sdk = 34) -public class DigitalIdentityProviderTest { +public class DigitalIdentityProviderUnitTest { @Test public void testUserDeclined() { assertEquals(
diff --git a/content/browser/webid/digital_credentials/digital_identity_provider_android.cc b/chrome/browser/webid/digital_identity_provider_android.cc similarity index 88% rename from content/browser/webid/digital_credentials/digital_identity_provider_android.cc rename to chrome/browser/webid/digital_identity_provider_android.cc index b81721a..c532bfeb 100644 --- a/content/browser/webid/digital_credentials/digital_identity_provider_android.cc +++ b/chrome/browser/webid/digital_identity_provider_android.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/webid/digital_credentials/digital_identity_provider_android.h" +#include "chrome/browser/webid/digital_identity_provider_android.h" #include <jni.h> #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/values.h" -#include "content/public/android/content_jni_headers/DigitalIdentityProvider_jni.h" +#include "chrome/browser/webid/jni_headers/DigitalIdentityProvider_jni.h" #include "content/public/browser/web_contents.h" #include "ui/android/window_android.h" @@ -18,8 +18,6 @@ using base::android::ConvertUTF8ToJavaString; using base::android::ScopedJavaLocalRef; -namespace content { - DigitalIdentityProviderAndroid::DigitalIdentityProviderAndroid() { JNIEnv* env = AttachCurrentThread(); j_digital_identity_provider_android_.Reset( @@ -33,7 +31,7 @@ env, j_digital_identity_provider_android_); } -void DigitalIdentityProviderAndroid::Request(WebContents* web_contents, +void DigitalIdentityProviderAndroid::Request(content::WebContents* web_contents, const url::Origin& origin, const std::string& request, DigitalIdentityCallback callback) { @@ -66,5 +64,3 @@ status_for_metrics)); } } - -} // namespace content
diff --git a/content/browser/webid/digital_credentials/digital_identity_provider_android.h b/chrome/browser/webid/digital_identity_provider_android.h similarity index 71% rename from content/browser/webid/digital_credentials/digital_identity_provider_android.h rename to chrome/browser/webid/digital_identity_provider_android.h index f907db71..f53b740 100644 --- a/content/browser/webid/digital_credentials/digital_identity_provider_android.h +++ b/chrome/browser/webid/digital_identity_provider_android.h
@@ -2,28 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_ -#define CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_ +#ifndef CHROME_BROWSER_WEBID_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_ +#define CHROME_BROWSER_WEBID_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_ + +#include <jni.h> #include "base/android/scoped_java_ref.h" #include "base/functional/callback.h" #include "base/values.h" -#include "content/common/content_export.h" #include "content/public/browser/digital_identity_provider.h" #include "third_party/blink/public/mojom/webid/digital_identity_request.mojom.h" #include "url/origin.h" -#include <jni.h> - namespace content { - class WebContents; +} // Android specific implementation of `DigitalIdentityProvider`. It -// communicates with native apps via JNI. Once an identity is returned from Android -// apps, it sends it back to the browser where the API is initiated. -class CONTENT_EXPORT DigitalIdentityProviderAndroid - : public DigitalIdentityProvider { +// communicates with native apps via JNI. Once an identity is returned from +// Android apps, it sends it back to the browser where the API is initiated. +class DigitalIdentityProviderAndroid : public content::DigitalIdentityProvider { public: DigitalIdentityProviderAndroid(); ~DigitalIdentityProviderAndroid() override; @@ -38,7 +36,7 @@ void OnReceive(JNIEnv*, jstring vc, jint status_for_metrics); // Triggers a request for a digital credential. - void Request(WebContents* web_contents, + void Request(content::WebContents* web_contents, const url::Origin& origin, const std::string& request, DigitalIdentityCallback callback) override; @@ -49,6 +47,4 @@ DigitalIdentityCallback callback_; }; -} // namespace content - -#endif // CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_ +#endif // CHROME_BROWSER_WEBID_DIGITAL_IDENTITY_PROVIDER_ANDROID_H_
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 96bd2e6..5e41555 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1715946394-fb301044648b2f6c5db685e4406627bff9b232ea-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-android32-main-1716011846-c0b8d9a373727ba6ea4501bcc289732021d0c429-ade34032a0dce767637e8cfa9b398680bbbad9dc.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index 781a334d..4bebcd9f 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1715946394-060114cea28305fc4e56eea8740daf431abc7dfa-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-android64-main-1715987969-dc9255f9d1dc36820dc136135d40cc475225872a-c1d1703c1ff2eac39736d1f6278137967557e40e.profdata
diff --git a/chrome/build/lacros-arm64.pgo.txt b/chrome/build/lacros-arm64.pgo.txt index 8a414b3b..5785d86 100644 --- a/chrome/build/lacros-arm64.pgo.txt +++ b/chrome/build/lacros-arm64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-arm64-generic-main-1715817086-fe37d055e236504531a79fa464c7a269007431e1-800eb0868af83ada613f3c4dccccf5bf8ecc5eee.profdata +chrome-chromeos-arm64-generic-main-1715987969-979eda1a8da50c7830161660baef6ecb39f0be2c-c1d1703c1ff2eac39736d1f6278137967557e40e.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index 985ad66..684389b 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1715946394-0d606a3f9756913ec79be600b2190abd7343d282-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-chromeos-amd64-generic-main-1715987969-3f405b4bbccf2e472886dda654fcc2a75ae1f0ce-c1d1703c1ff2eac39736d1f6278137967557e40e.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 28549f0..e7fccbd 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1715946394-fb10ac9039c642bf632d8b57cec302ece8d53251-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-linux-main-1715987969-33e56b66bebaef3259838466c9465521d06d7767-c1d1703c1ff2eac39736d1f6278137967557e40e.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index d7c9ec2..0319da7 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1715961556-610273388e82243ca5c827b8ce5d2aa3f909124a-b06f44122427a3e4ac53159f23e47ac1c48feb63.profdata +chrome-mac-arm-main-1716011846-276b8bb1bc96a246e1fc54cf29130da25bbb297b-ade34032a0dce767637e8cfa9b398680bbbad9dc.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index cb624f1..21e082f1 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1715946394-2c39e17b1662533c36f883f022b8355e132bfd00-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-win-arm64-main-1716011846-01fab9a50bea6d7e17288d3c23ec2e8660147530-ade34032a0dce767637e8cfa9b398680bbbad9dc.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index dc74d9a..60f02161 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1715946394-5d382e4999a816d2fbbd5748dc4811adf4cbd60f-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-win32-main-1716001090-1c4f547b4b6eec8f93e9fec00ed5a783cf8b403b-a382b48acd977a9856364d006ead61a105d05866.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 2fccf6b..8cb0b38 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1715946394-bd848d651db2db4d174ce21345f982efb68d5bdf-3dce49679a2624c3899189a997dfae24a3eaa55a.profdata +chrome-win64-main-1716001090-cf05b9f4da12df84b61bb1b62b373a90e372c321-a382b48acd977a9856364d006ead61a105d05866.profdata
diff --git a/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc b/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc index 3b8fce4..cd5ee47 100644 --- a/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc +++ b/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc
@@ -4,26 +4,44 @@ #include "chrome/services/sharing/nearby/platform/wifi_direct_medium.h" +#include "base/task/thread_pool.h" + namespace nearby::chrome { WifiDirectMedium::WifiDirectMedium( const mojo::SharedRemote<ash::wifi_direct::mojom::WifiDirectManager>& - manager, + wifi_direct_manager, const mojo::SharedRemote<::sharing::mojom::FirewallHoleFactory>& firewall_hole_factory) - : manager_(std::move(manager)), + : task_runner_( + base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})), + wifi_direct_manager_(std::move(wifi_direct_manager)), firewall_hole_factory_(std::move(firewall_hole_factory)) {} WifiDirectMedium::~WifiDirectMedium() = default; bool WifiDirectMedium::IsInterfaceValid() const { - NOTIMPLEMENTED(); - return false; + bool is_interface_valid = false; + base::WaitableEvent waitable_event; + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&WifiDirectMedium::GetCapabilities, base::Unretained(this), + &is_interface_valid, &waitable_event)); + waitable_event.Wait(); + return is_interface_valid; } bool WifiDirectMedium::StartWifiDirect(WifiDirectCredentials* credentials) { - NOTIMPLEMENTED(); - return false; + // Wrap the async mojo call to make it sync. + base::WaitableEvent waitable_event; + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&WifiDirectMedium::CreateGroup, base::Unretained(this), + credentials, &waitable_event)); + waitable_event.Wait(); + + // An active remote means the group has been created. + return !!connection_; } bool WifiDirectMedium::StopWifiDirect() { @@ -61,4 +79,72 @@ return absl::nullopt; } +void WifiDirectMedium::GetCapabilities( + bool* is_capability_supported, + base::WaitableEvent* waitable_event) const { + CHECK(task_runner_->RunsTasksInCurrentSequence()); + wifi_direct_manager_->GetWifiP2PCapabilities( + base::BindOnce(&WifiDirectMedium::OnCapabilities, base::Unretained(this), + is_capability_supported, waitable_event)); +} + +void WifiDirectMedium::OnCapabilities( + bool* is_capability_supported, + base::WaitableEvent* waitable_event, + ash::wifi_direct::mojom::WifiP2PCapabilitiesPtr capabilities) const { + CHECK(task_runner_->RunsTasksInCurrentSequence()); + // TODO(b/341325756): The current mojo API only has `is_client_ready` and + // `is_owner_ready`, both of which return false. There are two options here: + // 1. Update the mojo API to include `is_p2p_supported` and use that. + // 2. Update the Nearby API to specify owner or client AND fix the current + // mojo responses. + *is_capability_supported = true; + waitable_event->Signal(); +} + +void WifiDirectMedium::CreateGroup(WifiDirectCredentials* credentials, + base::WaitableEvent* waitable_event) { + CHECK(task_runner_->RunsTasksInCurrentSequence()); + + // This is currently validated in the Chrome connectivity layer, but totally + // ignored at the platform level. Both SSID and password need to be valid for + // this call to succeed. + credentials->SetSSID("DIRECT-00"); + credentials->SetPassword("SecretPassword"); + + auto credentials_ptr = ash::wifi_direct::mojom::WifiCredentials::New(); + credentials_ptr->ssid = credentials->GetSSID(); + credentials_ptr->passphrase = credentials->GetPassword(); + wifi_direct_manager_->CreateWifiDirectGroup( + std::move(credentials_ptr), + base::BindOnce(&WifiDirectMedium::OnGroupCreated, base::Unretained(this), + credentials, waitable_event)); +} + +void WifiDirectMedium::OnGroupCreated( + WifiDirectCredentials* credentials, + base::WaitableEvent* waitable_event, + ash::wifi_direct::mojom::WifiDirectOperationResult result, + mojo::PendingRemote<ash::wifi_direct::mojom::WifiDirectConnection> + connection) { + CHECK(task_runner_->RunsTasksInCurrentSequence()); + + if (result == ash::wifi_direct::mojom::WifiDirectOperationResult::kSuccess) { + // Store the connection so that the group can be destroyed when the remote + // is reset. + connection_.Bind(std::move(connection), task_runner_); + connection_.set_disconnect_handler( + base::BindOnce(&WifiDirectMedium::OnDisconnect, base::Unretained(this)), + task_runner_); + } + + // Trigger sync signal. + waitable_event->Signal(); +} + +void WifiDirectMedium::OnDisconnect() { + // Reset the connection, since it has been disconnected at this point. + connection_.reset(); +} + } // namespace nearby::chrome
diff --git a/chrome/services/sharing/nearby/platform/wifi_direct_medium.h b/chrome/services/sharing/nearby/platform/wifi_direct_medium.h index 79a0051..a99641b 100644 --- a/chrome/services/sharing/nearby/platform/wifi_direct_medium.h +++ b/chrome/services/sharing/nearby/platform/wifi_direct_medium.h
@@ -38,9 +38,30 @@ override; private: - mojo::SharedRemote<ash::wifi_direct::mojom::WifiDirectManager> manager_; + void GetCapabilities(bool* is_capability_supported, + base::WaitableEvent* waitable_event) const; + void OnCapabilities( + bool* is_capability_supported, + base::WaitableEvent* waitable_event, + ash::wifi_direct::mojom::WifiP2PCapabilitiesPtr capabilities) const; + + void CreateGroup(WifiDirectCredentials* credentials, + base::WaitableEvent* waitable_event); + void OnGroupCreated( + WifiDirectCredentials* credentials, + base::WaitableEvent* waitable_event, + ash::wifi_direct::mojom::WifiDirectOperationResult result, + mojo::PendingRemote<ash::wifi_direct::mojom::WifiDirectConnection> + connection); + + void OnDisconnect(); + + scoped_refptr<base::SequencedTaskRunner> task_runner_; + mojo::SharedRemote<ash::wifi_direct::mojom::WifiDirectManager> + wifi_direct_manager_; mojo::SharedRemote<::sharing::mojom::FirewallHoleFactory> firewall_hole_factory_; + mojo::SharedRemote<ash::wifi_direct::mojom::WifiDirectConnection> connection_; }; } // namespace nearby::chrome
diff --git a/chrome/services/sharing/nearby/platform/wifi_direct_medium_unittest.cc b/chrome/services/sharing/nearby/platform/wifi_direct_medium_unittest.cc index dfb4276..d4d7fb4 100644 --- a/chrome/services/sharing/nearby/platform/wifi_direct_medium_unittest.cc +++ b/chrome/services/sharing/nearby/platform/wifi_direct_medium_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/services/sharing/nearby/platform/wifi_direct_medium.h" +#include "base/task/thread_pool.h" #include "base/test/task_environment.h" #include "chromeos/ash/services/nearby/public/cpp/fake_firewall_hole_factory.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" @@ -12,25 +13,68 @@ namespace { +class FakeWifiDirectConnection + : public ash::wifi_direct::mojom::WifiDirectConnection { + void GetProperties(GetPropertiesCallback callback) override { + NOTIMPLEMENTED(); + } + + void AssociateSocket(::mojo::PlatformHandle socket, + AssociateSocketCallback callback) override { + NOTIMPLEMENTED(); + } +}; + class FakeWifiDirectManager : public ash::wifi_direct::mojom::WifiDirectManager { public: + FakeWifiDirectManager() {} + + ~FakeWifiDirectManager() override {} + void CreateWifiDirectGroup( ash::wifi_direct::mojom::WifiCredentialsPtr credentials, CreateWifiDirectGroupCallback callback) override { - // Noop + if (!connection_) { + std::move(callback).Run( + ash::wifi_direct::mojom::WifiDirectOperationResult::kNotSupported, + mojo::NullRemote()); + } else { + mojo::PendingRemote<ash::wifi_direct::mojom::WifiDirectConnection> + connection_remote; + mojo::MakeSelfOwnedReceiver( + std::move(connection_), + connection_remote.InitWithNewPipeAndPassReceiver()); + std::move(callback).Run( + ash::wifi_direct::mojom::WifiDirectOperationResult::kSuccess, + std::move(connection_remote)); + } } + void ConnectToWifiDirectGroup( ash::wifi_direct::mojom::WifiCredentialsPtr credentials, std::optional<uint32_t> frequency, ConnectToWifiDirectGroupCallback callback) override { - // Noop + std::move(callback).Run( + ash::wifi_direct::mojom::WifiDirectOperationResult::kNotSupported, + mojo::NullRemote()); } void GetWifiP2PCapabilities( GetWifiP2PCapabilitiesCallback callback) override { - // Noop + // TODO(b/341325756): This is currently ignored, so no need to build a real + // response. + auto response = ash::wifi_direct::mojom::WifiP2PCapabilities::New(); + std::move(callback).Run(std::move(response)); } + + void SetWifiDirectConnection( + std::unique_ptr<FakeWifiDirectConnection> connection) { + connection_ = std::move(connection); + } + + private: + std::unique_ptr<FakeWifiDirectConnection> connection_; }; } // namespace @@ -62,10 +106,17 @@ } WifiDirectMedium* medium() { return medium_.get(); } + FakeWifiDirectManager* manager() { return wifi_direct_manager_; } + + void RunOnTaskRunner(base::OnceClosure task) { + base::RunLoop run_loop; + base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}) + ->PostTaskAndReply(FROM_HERE, std::move(task), run_loop.QuitClosure()); + run_loop.Run(); + } private: base::test::TaskEnvironment task_environment_; - raw_ptr<FakeWifiDirectManager> wifi_direct_manager_; mojo::SharedRemote<ash::wifi_direct::mojom::WifiDirectManager> wifi_direct_manager_remote_; @@ -75,8 +126,38 @@ std::unique_ptr<WifiDirectMedium> medium_; }; -TEST_F(WifiDirectMediumTest, ItBuilds) { - EXPECT_TRUE(medium()); +// TODO(b/341325756): This test needs to be replaced once a resolution is found +// for the expected response. +TEST_F(WifiDirectMediumTest, IsInterfaceValid_Temporary) { + RunOnTaskRunner(base::BindOnce( + [](WifiDirectMedium* medium) { + base::ScopedAllowBaseSyncPrimitivesForTesting allow; + EXPECT_TRUE(medium->IsInterfaceValid()); + }, + medium())); +} + +TEST_F(WifiDirectMediumTest, StartWifiDirect_MissingConnection) { + manager()->SetWifiDirectConnection(nullptr); + RunOnTaskRunner(base::BindOnce( + [](WifiDirectMedium* medium) { + base::ScopedAllowBaseSyncPrimitivesForTesting allow; + WifiDirectCredentials credentials; + EXPECT_FALSE(medium->StartWifiDirect(&credentials)); + }, + medium())); +} + +TEST_F(WifiDirectMediumTest, StartWifiDirect_ValidConnection) { + manager()->SetWifiDirectConnection( + std::make_unique<FakeWifiDirectConnection>()); + RunOnTaskRunner(base::BindOnce( + [](WifiDirectMedium* medium) { + base::ScopedAllowBaseSyncPrimitivesForTesting allow; + WifiDirectCredentials credentials; + EXPECT_TRUE(medium->StartWifiDirect(&credentials)); + }, + medium())); } } // namespace nearby::chrome
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 516adbc..b37715c 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -4130,6 +4130,7 @@ # chrome_extensions_browsertests_sources target for more. "//extensions:chrome_extensions_browsertests_sources", "//extensions/browser:test_support", + "//extensions/browser/api/storage:settings_namespace", "//extensions/browser/updater", "//extensions/buildflags", "//extensions/common:mojom", @@ -4801,10 +4802,6 @@ "../browser/ash/policy/handlers/restore_on_startup_browsertest.cc", "../browser/ash/policy/handlers/site_isolation_flag_handling_browsertest.cc", "../browser/ash/policy/handlers/variations_service_policy_browsertest.cc", - "../browser/ash/policy/local_user_files/file_location_utils_browsertest.cc", - "../browser/ash/policy/local_user_files/local_files_cleanup_browsertest.cc", - "../browser/ash/policy/local_user_files/observer_browsertest.cc", - "../browser/ash/policy/local_user_files/policy_utils_browsertest.cc", "../browser/ash/policy/login/blocking_login_browsertest.cc", "../browser/ash/policy/login/device_login_screen_policy_browsertest.cc", "../browser/ash/policy/login/force_maximize_on_first_run_browsertest.cc", @@ -4834,6 +4831,12 @@ "../browser/ash/policy/reporting/metrics_reporting/usb/usb_events_browsertest.cc", "../browser/ash/policy/reporting/os_updates/os_updates_reporter_browsertest.cc", "../browser/ash/policy/reporting/user_added_removed/user_added_removed_reporter_browsertest.cc", + "../browser/ash/policy/skyvault/drive_upload_observer_browsertest.cc", + "../browser/ash/policy/skyvault/file_location_utils_browsertest.cc", + "../browser/ash/policy/skyvault/local_files_cleanup_browsertest.cc", + "../browser/ash/policy/skyvault/observer_browsertest.cc", + "../browser/ash/policy/skyvault/odfs_skyvault_uploader_browsertest.cc", + "../browser/ash/policy/skyvault/policy_utils_browsertest.cc", "../browser/ash/policy/status_collector/child_status_collector_browsertest.cc", "../browser/ash/policy/status_collector/device_status_collector_browsertest.cc", "../browser/ash/preferences_browsertest.cc", @@ -4996,8 +4999,6 @@ "../browser/ui/webui/ash/cloud_upload/cloud_upload_dialog_browsertest.cc", "../browser/ui/webui/ash/cloud_upload/cloud_upload_dialog_browsertest.h", "../browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc", - "../browser/ui/webui/ash/cloud_upload/drive_upload_observer_browsertest.cc", - "../browser/ui/webui/ash/cloud_upload/odfs_skyvault_uploader_browsertest.cc", "../browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc", "../browser/ui/webui/ash/cros_components_browsertest.cc", "../browser/ui/webui/ash/crostini_upgrader/crostini_upgrader_dialog_browsertest.cc", @@ -5489,6 +5490,16 @@ sources += [ "../browser/printing/system_access_process_print_browsertest.cc" ] } + + if (is_chromeos_ash) { + sources += [ + "../browser/ash/crosapi/extension_printer_service_ash_browsertest.cc", + ] + } + + if (is_chromeos_lacros) { + sources += [ "../browser/ui/webui/print_preview/extension_printer_service_provider_lacros_browsertest.cc" ] + } } if (enable_paint_preview) { sources += [ @@ -7614,7 +7625,6 @@ "../browser/translate/translate_manager_render_view_host_android_unittest.cc", "../browser/ui/android/autofill/autofill_cvc_save_message_delegate_unittest.cc", "../browser/ui/android/autofill/autofill_save_card_delegate_android_unittest.cc", - "../browser/ui/android/autofill/autofill_save_iban_bottom_sheet_bridge_unittest.cc", "../browser/ui/android/autofill/autofill_save_iban_delegate_unittest.cc", "../browser/ui/android/autofill/autofill_vcn_enroll_bottom_sheet_bridge_unittest.cc", "../browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc", @@ -7960,6 +7970,7 @@ "../browser/ui/color/new_tab_page_color_mixer_unittest.cc", "../browser/ui/commerce/commerce_ui_tab_helper_unittest.cc", "../browser/ui/commerce/price_tracking_page_action_controller_unittest.cc", + "../browser/ui/commerce/product_specifications_page_action_controller_unittest.cc", "../browser/ui/content_settings/content_setting_bubble_model_unittest.cc", "../browser/ui/content_settings/content_setting_image_model_unittest.cc", "../browser/ui/exclusive_access/exclusive_access_bubble_unittest.cc", @@ -8428,6 +8439,7 @@ "//chrome/common/accessibility:mojo_bindings", "//components/app_constants", "//components/color", + "//components/commerce/core:account_checker_test_support", "//components/commerce/core:cart_db_content_proto", "//components/commerce/core:commerce_constants", "//components/commerce/core:coupon_db_content_proto", @@ -9453,6 +9465,7 @@ "//components/value_store:test_support", "//extensions:extensions_resources", "//extensions/browser:test_support", + "//extensions/browser/api/storage:settings_observer", "//extensions/browser/updater", "//extensions/buildflags", "//extensions/common", @@ -10190,6 +10203,7 @@ "../browser/ui/views/commerce/price_tracking_icon_view_integration_test.cc", "../browser/ui/views/commerce/price_tracking_view_unittest.cc", "../browser/ui/views/commerce/product_specifications_button_unittest.cc", + "../browser/ui/views/commerce/product_specifications_icon_view_integration_test.cc", "../browser/ui/views/confirm_bubble_views_unittest.cc", "../browser/ui/views/content_setting_bubble_contents_unittest.cc", "../browser/ui/views/content_setting_site_row_view_unittest.cc", @@ -10215,6 +10229,7 @@ "../browser/ui/views/frame/browser_view_unittest.cc", "../browser/ui/views/frame/tab_strip_region_view_unittest.cc", "../browser/ui/views/frame/web_contents_close_handler_unittest.cc", + "../browser/ui/views/global_media_controls/cast_device_footer_view_unittest.cc", "../browser/ui/views/global_media_controls/cast_device_selector_view_unittest.cc", "../browser/ui/views/global_media_controls/media_item_ui_device_selector_view_unittest.cc", "../browser/ui/views/global_media_controls/media_item_ui_footer_view_unittest.cc",
diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn index aafdcbf..73cf72fd 100644 --- a/chrome/test/android/BUILD.gn +++ b/chrome/test/android/BUILD.gn
@@ -431,7 +431,6 @@ "javatests/src/org/chromium/chrome/test/util/ActivityTestUtils.java", "javatests/src/org/chromium/chrome/test/util/ByteBufferTestUtils.java", "javatests/src/org/chromium/chrome/test/util/ChromeRenderTestRule.java", - "javatests/src/org/chromium/chrome/test/util/ChromeRestriction.java", "javatests/src/org/chromium/chrome/test/util/SadTabRule.java", "javatests/src/org/chromium/chrome/test/util/ToolbarUnitTestUtils.java", "javatests/src/org/chromium/chrome/test/util/browser/LocationSettingsTestUtil.java",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java index 2cac5ef8..82a67e3 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java
@@ -4,32 +4,16 @@ package org.chromium.chrome.test; -import android.content.Context; -import android.text.TextUtils; - -import androidx.test.core.app.ApplicationProvider; - import org.junit.rules.TestRule; import org.junit.runners.model.InitializationError; -import org.chromium.base.CommandLine; -import org.chromium.base.ContextUtils; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Features; -import org.chromium.base.test.util.RestrictionSkipCheck; -import org.chromium.base.test.util.SkipCheck; -import org.chromium.base.version_info.VersionInfo; -import org.chromium.chrome.test.util.ChromeRestriction; import org.chromium.components.policy.test.annotations.Policies; import org.chromium.content_public.browser.test.ContentJUnit4ClassRunner; -import org.chromium.content_public.browser.test.util.TestThreadUtils; -import org.chromium.gms.ChromiumPlayServicesAvailability; import org.chromium.ui.test.util.DisableAnimationsTestRule; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; -import java.util.concurrent.ExecutionException; /** A custom runner for //chrome JUnit4 tests. */ public class ChromeJUnit4ClassRunner extends ContentJUnit4ClassRunner { @@ -43,13 +27,6 @@ } @Override - protected List<SkipCheck> getSkipChecks() { - return addToList( - super.getSkipChecks(), - new ChromeRestrictionSkipCheck(ApplicationProvider.getApplicationContext())); - } - - @Override protected List<TestHook> getPreTestHooks() { return addToList(super.getPreTestHooks(), Policies.getRegistrationHook()); } @@ -65,142 +42,4 @@ return addToList(rules, new DisableAnimationsTestRule()); } - - private static class ChromeRestrictionSkipCheck extends RestrictionSkipCheck { - public ChromeRestrictionSkipCheck(Context targetContext) { - super(targetContext); - } - - private Class getDaydreamApiClass() { - Class daydreamApiClass; - try { - daydreamApiClass = Class.forName("com.google.vr.ndk.base.DaydreamApi"); - } catch (ClassNotFoundException e) { - daydreamApiClass = null; - } - return daydreamApiClass; - } - - @SuppressWarnings("unchecked") - private boolean isDaydreamReady() { - // We normally check things like this through VrShellDelegate. However, with the - // introduction of Dynamic Feature Modules (DFMs), we have tests that expect the VR - // DFM to not be loaded. Using the normal approach (VrModuleProvider.getDelegate()) - // causes the DFM to be loaded, which we don't want done before the test starts. So, - // access the Daydream API directly. VR is likely, but not guaranteed, to be compiled - // into the test binary, so use reflection. - Class daydreamApiClass = getDaydreamApiClass(); - if (daydreamApiClass == null) { - return false; - } - try { - Method isDaydreamMethod = - daydreamApiClass.getMethod("isDaydreamReadyPlatform", Context.class); - Boolean isDaydream = - (Boolean) - isDaydreamMethod.invoke(null, ContextUtils.getApplicationContext()); - return isDaydream; - } catch (NoSuchMethodException - | SecurityException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException e) { - return false; - } - } - - @SuppressWarnings("unchecked") - private boolean isDaydreamViewPaired() { - if (!isDaydreamReady()) { - return false; - } - - Class daydreamApiClass = getDaydreamApiClass(); - if (daydreamApiClass == null) { - return false; - } - - try { - Method createMethod = daydreamApiClass.getMethod("create", Context.class); - // We need to ensure that the DaydreamApi instance is created on the main thread. - Object daydreamApiInstance = - TestThreadUtils.runOnUiThreadBlocking( - () -> { - return createMethod.invoke( - null, ContextUtils.getApplicationContext()); - }); - if (daydreamApiInstance == null) { - return false; - } - - Method currentViewerMethod = daydreamApiClass.getMethod("getCurrentViewerType"); - // Getting the current viewer type may result in a disk write in VrCore, so allow - // that to prevent StrictMode errors. - Integer viewerType = (Integer) currentViewerMethod.invoke(daydreamApiInstance); - Method closeMethod = daydreamApiClass.getMethod("close"); - closeMethod.invoke(daydreamApiInstance); - // 1 is the viewer type constant for Daydream headsets. We could use reflection to - // check against com.google.vr.ndk.base.GvrApi.ViewerType.DAYDREAM, but the - // constants have never changed, so check this way to be simpler. - return viewerType == 1; - } catch (NoSuchMethodException - | IllegalAccessException - | InvocationTargetException - | ExecutionException e) { - return false; - } - } - - private boolean isVrDonEnabled() { - // We can't directly check whether the VR DON flow is enabled since we don't have - // permission to read the VrCore settings file. Instead, pass a flag. - return CommandLine.getInstance().hasSwitch("vr-don-enabled"); - } - - @Override - protected boolean restrictionApplies(String restriction) { - if (TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES) - && (!ChromiumPlayServicesAvailability.isGooglePlayServicesAvailable( - getTargetContext()))) { - return true; - } - if (TextUtils.equals(restriction, ChromeRestriction.RESTRICTION_TYPE_OFFICIAL_BUILD) - && (!VersionInfo.isOfficialBuild())) { - return true; - } - if (TextUtils.equals(restriction, ChromeRestriction.RESTRICTION_TYPE_DEVICE_DAYDREAM) - || TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_DEVICE_NON_DAYDREAM)) { - boolean isDaydream = isDaydreamReady(); - if (TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_DEVICE_DAYDREAM) - && !isDaydream) { - return true; - } else if (TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_DEVICE_NON_DAYDREAM) - && isDaydream) { - return true; - } - } - if (TextUtils.equals(restriction, ChromeRestriction.RESTRICTION_TYPE_VIEWER_DAYDREAM) - || TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM)) { - boolean daydreamViewPaired = isDaydreamViewPaired(); - if (TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_VIEWER_DAYDREAM) - && !daydreamViewPaired) { - return true; - } else if (TextUtils.equals( - restriction, ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM) - && daydreamViewPaired) { - return true; - } - } - if (TextUtils.equals(restriction, ChromeRestriction.RESTRICTION_TYPE_VR_DON_ENABLED)) { - return !isVrDonEnabled(); - } - return false; - } - } }
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeRestriction.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeRestriction.java deleted file mode 100644 index 53289f9..0000000 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeRestriction.java +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2015 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.test.util; - -/** - * Restrictions that are usable with the @Restriction enum but in the chrome/ layer. - * e.g. @Restriction({ChromeRestriction.RESTRICTION_TYPE_PHONE}) - */ -public final class ChromeRestriction { - /** Specifies the test is only valid on a device that has up to date play services. */ - public static final String RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES = "Google_Play_Services"; - - /** Specifies the test is only valid on official build. */ - public static final String RESTRICTION_TYPE_OFFICIAL_BUILD = "Official_Build"; - - /** Specifies the test is only valid on a Daydream-ready device */ - public static final String RESTRICTION_TYPE_DEVICE_DAYDREAM = "Daydream_Ready"; - - /** Specifies the test is only valid on a non-Daydream-ready device */ - public static final String RESTRICTION_TYPE_DEVICE_NON_DAYDREAM = "Non_Daydream_Ready"; - - /** Specifies the test is only valid if the current VR viewer is Daydream View */ - public static final String RESTRICTION_TYPE_VIEWER_DAYDREAM = "Daydream_View"; - - /** Specifies the test is only valid if the current VR viewer is not Daydream View */ - public static final String RESTRICTION_TYPE_VIEWER_NON_DAYDREAM = "Non_Daydream_View"; - - /** Specifies the test is only valid if the VR DON flow is enabled */ - public static final String RESTRICTION_TYPE_VR_DON_ENABLED = "VR_DON_Enabled"; -}
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/capabilities_manager_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/capabilities_manager_test.ts index b7ec6b6d..08070e69 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/capabilities_manager_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/capabilities_manager_test.ts
@@ -40,6 +40,7 @@ // Initialize the DestinationManager and wait for it to send all events. async function waitForDestinationManagerLoad(): Promise<void> { const destinationManager = DestinationManager.getInstance(); + destinationManager.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); const activeDestinationChangedEvent = eventToPromise( DESTINATION_MANAGER_ACTIVE_DESTINATION_CHANGED, destinationManager); return activeDestinationChangedEvent;
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/destination_manager_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/destination_manager_test.ts index fb0e0b3..bf6152b 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/destination_manager_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/destination_manager_test.ts
@@ -72,13 +72,21 @@ assertNotEquals(notFoundIndex, pdfIndex, 'PDF destination available'); }); - // Verify getLocalDestinations is called on construction of manager. - test('on create getLocalDestinations is called', () => { - const expectedCallCount = 1; + // Verify getLocalDestinations is called during initializeSession. + test('initializeSession calls getLocalDestinations', () => { + let expectedCallCount = 0; assertEquals( expectedCallCount, destinationProvider.getCallCount(GET_LOCAL_DESTINATIONS_METHOD), - `${GET_LOCAL_DESTINATIONS_METHOD} called in construction of manager`); + `${GET_LOCAL_DESTINATIONS_METHOD} not called`); + + // Initialize destination manager. + instance.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); + ++expectedCallCount; + assertEquals( + expectedCallCount, + destinationProvider.getCallCount(GET_LOCAL_DESTINATIONS_METHOD), + `${GET_LOCAL_DESTINATIONS_METHOD} called`); }); // Verify destination manager state updated called when getLocalDestinations @@ -86,14 +94,18 @@ test( 'starting and resolving getLocalDestinations triggers state update', async () => { + let stateChange = + eventToPromise(DESTINATION_MANAGER_STATE_CHANGED, instance); + instance.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); + await stateChange; assertEquals( DestinationManagerState.FETCHING, instance.getState(), 'Fetch in progress'); - const stateChanged = + stateChange = eventToPromise(DESTINATION_MANAGER_STATE_CHANGED, instance); mockTimer.tick(testDelay); - await stateChanged; + await stateChange; assertEquals( DestinationManagerState.LOADED, instance.getState(), @@ -101,28 +113,23 @@ }); // Verify destination manager sets fallback destination to PDF if no other - // destinations are returned in local printer fetch. + // destinations are returned in local printer fetch and session is + // initialized. test( 'starting and resolving getLocalDestinations triggers state active' + ' destination update', async () => { assertEquals( - DestinationManagerState.FETCHING, instance.getState(), - 'Fetch in progress'); - assertEquals( null, instance.getActiveDestination(), 'Fallback destination is not set before loading local printers'); - const stateChanged = eventToPromise( + // Resolve local printers fetch and initialize session. + const activeDestChange = eventToPromise( DESTINATION_MANAGER_ACTIVE_DESTINATION_CHANGED, instance); - - // Resolve local printers fetch. + instance.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); mockTimer.tick(testDelay); - await stateChanged; + await activeDestChange; - assertEquals( - DestinationManagerState.LOADED, instance.getState(), - 'Fetch complete'); assertDeepEquals( PDF_DESTINATION, instance.getActiveDestination(), `Fallback destination is ${PDF_DESTINATION.displayName}`); @@ -265,6 +272,7 @@ async () => { const destinations = [createTestDestination()]; destinationProvider.setLocalDestinationResult(destinations); + instance.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); const stateChanged = eventToPromise(DESTINATION_MANAGER_STATE_CHANGED, instance); @@ -286,7 +294,7 @@ const testDestination = createTestDestination(); testDestination.printerManuallySelected = true; instance.setDestinationForTesting(testDestination); - + instance.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); let managerDestinations = instance.getDestinations(); let expectedDestinations = [PDF_DESTINATION, testDestination]; assertDeepEquals(expectedDestinations, managerDestinations);
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_controller_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_controller_test.ts index 8e25db9..cd3b1c5 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_controller_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_controller_test.ts
@@ -5,7 +5,7 @@ import 'chrome://os-print/js/destination_select_controller.js'; import {DESTINATION_MANAGER_SESSION_INITIALIZED, DESTINATION_MANAGER_STATE_CHANGED, DestinationManager} from 'chrome://os-print/js/data/destination_manager.js'; -import {DESTINATION_SELECT_SHOW_LOADING_CHANGED, DestinationSelectController} from 'chrome://os-print/js/destination_select_controller.js'; +import {DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, DestinationSelectController} from 'chrome://os-print/js/destination_select_controller.js'; import {FakeDestinationProvider} from 'chrome://os-print/js/fakes/fake_destination_provider.js'; import {createCustomEvent} from 'chrome://os-print/js/utils/event_utils.js'; import {setDestinationProviderForTesting} from 'chrome://os-print/js/utils/mojo_data_providers.js'; @@ -45,15 +45,15 @@ assertTrue(controller instanceof EventTarget, 'Is event target'); }); - // Verify shouldShowLoading returns true by default. - test('shouldShowLoading returns true by default', () => { - assertTrue(controller.shouldShowLoading()); + // Verify shouldShowLoadingUi returns true by default. + test('shouldShowLoadingUi returns true by default', () => { + assertTrue(controller.shouldShowLoadingUi()); }); - // Verify shouldShowLoading returns true if + // Verify shouldShowLoadingUi returns true if // DestinationManager's `hasLoadedAnInitialDestination` call is false. test( - 'shouldShowLoading returns true when destination manager has not ' + + 'shouldShowLoadingUi returns true when destination manager has not ' + 'received initial destinations', () => { const hasDestinationsFn = mockController.createFunctionMock( @@ -63,13 +63,14 @@ destinationManager, 'isSessionInitialized'); initializedFn.returnValue = true; - assertTrue(controller.shouldShowLoading(), 'Is fetching destinations'); + assertTrue( + controller.shouldShowLoadingUi(), 'Is fetching destinations'); }); - // Verify shouldShowLoading returns true if + // Verify shouldShowLoadingUi returns true if // DestinationManager's `isSessionInitialized` call is false. test( - 'shouldShowLoading returns true when destination manager has not ' + + 'shouldShowLoadingUi returns true when destination manager has not ' + 'received initial destinations', () => { const hasDestinationsFn = mockController.createFunctionMock( @@ -79,15 +80,15 @@ destinationManager, 'isSessionInitialized'); initializedFn.returnValue = false; - assertTrue(controller.shouldShowLoading(), 'Is initializing manager'); + assertTrue(controller.shouldShowLoadingUi(), 'Is initializing manager'); }); - // Verify shouldShowLoading returns false if + // Verify shouldShowLoadingUi returns false if // DestinationManager's `hasLoadedAnInitialDestination` and // `isSessionInitialized` call is true. test( - 'shouldShowLoading returns false when destination manager has received ' + - 'initial destinations', + 'shouldShowLoadingUi returns false when destination manager has ' + + 'received initial destinations', () => { const hasDestinationsFn = mockController.createFunctionMock( destinationManager, 'hasLoadedAnInitialDestination'); @@ -96,7 +97,8 @@ destinationManager, 'isSessionInitialized'); initializedFn.returnValue = true; - assertFalse(controller.shouldShowLoading(), 'Has fetched destinations'); + assertFalse( + controller.shouldShowLoadingUi(), 'Has fetched destinations'); }); // Verify controller is listening to DESTINATION_MANAGER_STATE_CHANGED event. @@ -118,15 +120,15 @@ mockController.verifyMocks(); }); - // Verify DESTINATION_SELECT_SHOW_LOADING_CHANGED emits when destination + // Verify DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED emits when destination // manager state changes. test( - `emit ${DESTINATION_SELECT_SHOW_LOADING_CHANGED} ` + + `emit ${DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED} ` + 'on destination manager state changed', async () => { const testEvent = createCustomEvent(DESTINATION_MANAGER_STATE_CHANGED); - const showLoadingChanged = - eventToPromise(DESTINATION_SELECT_SHOW_LOADING_CHANGED, controller); + const showLoadingChanged = eventToPromise( + DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, controller); // Simulate event being fired. destinationManager.dispatchEvent(testEvent); @@ -153,16 +155,16 @@ mockController.verifyMocks(); }); - // Verify DESTINATION_SELECT_SHOW_LOADING_CHANGED emits when destination + // Verify DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED emits when destination // manager initialized. test( - `emit ${DESTINATION_SELECT_SHOW_LOADING_CHANGED} ` + + `emit ${DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED} ` + 'on destination manager initialized', async () => { const testEvent = createCustomEvent(DESTINATION_MANAGER_SESSION_INITIALIZED); - const showLoadingChanged = - eventToPromise(DESTINATION_SELECT_SHOW_LOADING_CHANGED, controller); + const showLoadingChanged = eventToPromise( + DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, controller); // Simulate event being fired. destinationManager.dispatchEvent(testEvent);
diff --git a/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_test.ts b/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_test.ts index 9448f456..773b6e6 100644 --- a/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_test.ts +++ b/chrome/test/data/webui/chromeos/print_preview_cros/destination_select_test.ts
@@ -7,7 +7,7 @@ import {DestinationManager} from 'chrome://os-print/js/data/destination_manager.js'; import {DestinationDropdownElement} from 'chrome://os-print/js/destination_dropdown.js'; import {DestinationSelectElement} from 'chrome://os-print/js/destination_select.js'; -import {DESTINATION_SELECT_SHOW_LOADING_CHANGED, DestinationSelectController} from 'chrome://os-print/js/destination_select_controller.js'; +import {DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, DestinationSelectController} from 'chrome://os-print/js/destination_select_controller.js'; import {FakeDestinationProvider} from 'chrome://os-print/js/fakes/fake_destination_provider.js'; import {FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL} from 'chrome://os-print/js/fakes/fake_print_preview_page_handler.js'; import {setDestinationProviderForTesting} from 'chrome://os-print/js/utils/mojo_data_providers.js'; @@ -41,6 +41,7 @@ DestinationManager.resetInstanceForTesting(); destinationManager = DestinationManager.getInstance(); + destinationManager.initializeSession(FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); element = document.createElement(DestinationSelectElement.is) as DestinationSelectElement; @@ -70,16 +71,16 @@ `${DestinationSelectElement.is} should have controller configured`); }); - // Verify expected elements display while `controller.shouldShowLoading` is + // Verify expected elements display while `controller.shouldShowLoadingUi` is // true. test('displays expected elements when showLoading is true', async () => { const hasInitialDestinationsFn = - mockController.createFunctionMock(controller, 'shouldShowLoading'); + mockController.createFunctionMock(controller, 'shouldShowLoadingUi'); hasInitialDestinationsFn.returnValue = true; // Move time forward to resolve getLocalDestinations in manager. const changeEvent = - eventToPromise(DESTINATION_SELECT_SHOW_LOADING_CHANGED, controller); + eventToPromise(DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, controller); mockTimer.tick(testDelay); await changeEvent; @@ -91,16 +92,16 @@ `${DestinationDropdownElement.is} should not be visible`); }); - // Verify expected elements display while `controller.shouldShowLoading` is + // Verify expected elements display while `controller.shouldShowLoadingUi` is // false. test('displays expected loading UX', async () => { const hasInitialDestinationsFn = - mockController.createFunctionMock(controller, 'shouldShowLoading'); + mockController.createFunctionMock(controller, 'shouldShowLoadingUi'); hasInitialDestinationsFn.returnValue = false; // Move time forward to resolve getLocalDestinations in manager. const changeEvent = - eventToPromise(DESTINATION_SELECT_SHOW_LOADING_CHANGED, controller); + eventToPromise(DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, controller); mockTimer.tick(testDelay); await changeEvent; @@ -113,9 +114,9 @@ }); // Verify loading and dropdown visibility update after - // DESTINATION_SELECT_SHOW_LOADING_CHANGED event. + // DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED event. test( - `${DESTINATION_SELECT_SHOW_LOADING_CHANGED} updates loading and ` + + `${DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED} updates loading and ` + 'dropdown visibility', async () => { assertFalse( @@ -125,12 +126,9 @@ isChildVisible(element, loadingSelector), `${loadingSelector} should be visible`); - // Move time forward to resolve getLocalDestinations in manager and - // ensure manager is initialized. - destinationManager.initializeSession( - FAKE_PRINT_SESSION_CONTEXT_SUCCESSFUL); - const changeEvent = - eventToPromise(DESTINATION_SELECT_SHOW_LOADING_CHANGED, controller); + // Move time forward to resolve getLocalDestinations in manager. + const changeEvent = eventToPromise( + DESTINATION_SELECT_SHOW_LOADING_UI_CHANGED, controller); mockTimer.tick(testDelay); await changeEvent;
diff --git a/chrome/test/data/webui/chromeos/settings/controls/v2/settings_toggle_v2_test.ts b/chrome/test/data/webui/chromeos/settings/controls/v2/settings_toggle_v2_test.ts index c432f1b37..c8e5899 100644 --- a/chrome/test/data/webui/chromeos/settings/controls/v2/settings_toggle_v2_test.ts +++ b/chrome/test/data/webui/chromeos/settings/controls/v2/settings_toggle_v2_test.ts
@@ -23,9 +23,12 @@ document.body.appendChild(toggleElement); } - async function initWithPref(prefValue: boolean = false) { + async function initWithPref( + prefValue: boolean = false, isInverted: boolean = false) { init(); + toggleElement.inverted = isInverted; + /** * Pref value used in tests, should reflect the 'checked' attribute. * Create a new pref for each test() to prevent order (state) @@ -313,6 +316,43 @@ assertFalse(toggleElement.pref!.value); }); }); + + suite('with inverted enabled', () => { + setup(async () => { + await initWithPref(/*prefValue=*/ false, /*isInverted=*/ true); + }); + + test('toggle value is the opposite of the pref', () => { + assertFalse(toggleElement.pref!.value); + assertTrue(toggleElement.checked); + }); + + test( + 'clicking on the toggle changes the pref value to the opposite of the toggle', + async () => { + const prefChangeEventPromise = + eventToPromise('user-action-setting-pref-change', window); + + toggleElement.click(); + await flushTasks(); + assertFalse(toggleElement.checked); + + const event = await prefChangeEventPromise; + assertEquals(fakeTogglePref.key, event.detail.prefKey); + assertEquals(!toggleElement.checked, event.detail.value); + }); + + test( + 'checked value reflects the opposite of pref value when pref changes', + () => { + assertFalse(toggleElement.pref!.value); + assertTrue(toggleElement.checked); + + toggleElement.set('pref.value', true); + assertTrue(toggleElement.pref!.value); + assertFalse(toggleElement.checked); + }); + }); }); suite('without pref object', () => {
diff --git a/chrome/test/data/webui/chromeos/settings/os_apps_page/os_apps_page_test.ts b/chrome/test/data/webui/chromeos/settings/os_apps_page/os_apps_page_test.ts index 309aec8..a430b90 100644 --- a/chrome/test/data/webui/chromeos/settings/os_apps_page/os_apps_page_test.ts +++ b/chrome/test/data/webui/chromeos/settings/os_apps_page/os_apps_page_test.ts
@@ -389,11 +389,13 @@ if (isAppParentalControlsAvailable) { test( - 'Clicking set up sets up parental controls and navigates to subpage', - () => { - const parentalControlsRow = - appsPage.shadowRoot!.querySelector<HTMLElement>( - '#appParentalControls'); + `Clicking set up and dismissing the PIN setup dialog sets up parental + controls and navigates to subpage`, + async () => { + const parentalControlsRow = + appsPage.shadowRoot!.querySelector<HTMLElement>( + '#appParentalControls'); + // Wait for the row to become visible. assertTrue(!!parentalControlsRow); assertTrue(isVisible(parentalControlsRow)); @@ -401,42 +403,155 @@ parentalControlsRow.querySelector<HTMLElement>('cr-button'); assertTrue(!!setUpButton); setUpButton.click(); - flush(); + await flushTasks(); - assertNull(appsPage.shadowRoot!.querySelector( + const setupPinDialog = + parentalControlsRow.querySelector<HTMLElement>('#setupPin'); + assertTrue(!!setupPinDialog); + + // TODO(b/332936223): When setup flow is implemented, simulate a + // successful PIN submission here instead. + const cancelPinSetupButton = + setupPinDialog.shadowRoot! + .querySelector<HTMLElement>('#dialog')! + .querySelector<HTMLElement>('.cancel-button'); + assertTrue(!!cancelPinSetupButton); + cancelPinSetupButton.click(); + await waitAfterNextRender(appsPage); + + assertTrue(!!appsPage.shadowRoot!.querySelector( 'settings-app-parental-controls-subpage')); + }); + + test( + `Clicking the subpage arrow and dismissing the verification dialog + when parental controls are enabled navigates to the subpage`, + async () => { + const parentalControlsRow = + appsPage.shadowRoot!.querySelector<HTMLElement>( + '#appParentalControls'); + // Wait for the row to become visible. + assertTrue(!!parentalControlsRow); + assertTrue(isVisible(parentalControlsRow)); + + const setUpButton = + parentalControlsRow.querySelector<HTMLElement>('cr-button'); + assertTrue(!!setUpButton); + setUpButton.click(); + await flushTasks(); + + const setupPinDialog = + parentalControlsRow.querySelector<HTMLElement>('#setupPin'); + assertTrue(!!setupPinDialog); + + // TODO(b/332936223): When setup flow is implemented, simulate a + // successful PIN submission here instead. + const cancelPinSetupButton = + setupPinDialog.shadowRoot! + .querySelector<HTMLElement>('#dialog')! + .querySelector<HTMLElement>('.cancel-button'); + assertTrue(!!cancelPinSetupButton); + cancelPinSetupButton.click(); + await waitAfterNextRender(appsPage); + + assertTrue(!!appsPage.shadowRoot!.querySelector( + 'settings-app-parental-controls-subpage')); + + // Navigate back to apps page from the subpage. + const popStateEventPromise = eventToPromise('popstate', window); + Router.getInstance().navigateToPreviousRoute(); + await popStateEventPromise; + await waitAfterNextRender(appsPage); + + // Click subpage arrow to navigate to the subpage. const subpageArrow = parentalControlsRow.querySelector<HTMLElement>( '.subpage-arrow'); assertTrue(!!subpageArrow); subpageArrow.click(); - flush(); + await flushTasks(); + + const verifyPinDialog = + parentalControlsRow.querySelector<HTMLElement>('#verifyPin'); + assertTrue(!!verifyPinDialog); + + // TODO(b/332936481): When verification flow is implemented, + // simulate a successful PIN verification here instead. + const cancelVerifyPinButton = + verifyPinDialog.shadowRoot! + .querySelector<HTMLElement>('#dialog')! + .querySelector<HTMLElement>('.cancel-button'); + assertTrue(!!cancelVerifyPinButton); + cancelVerifyPinButton.click(); + await waitAfterNextRender(appsPage); assertTrue(!!appsPage.shadowRoot!.querySelector( 'settings-app-parental-controls-subpage')); - }); + }); - test('Toggling parental controls resets parental controls', () => { - const parentalControlsRow = - appsPage.shadowRoot!.querySelector<HTMLElement>( - '#appParentalControls'); - assertTrue(!!parentalControlsRow); - assertTrue(isVisible(parentalControlsRow)); + test( + `Toggling parental controls and dismissing the PIN verification + dialog resets parental controls`, + async () => { + const parentalControlsRow = + appsPage.shadowRoot!.querySelector<HTMLElement>( + '#appParentalControls'); + // Wait for the row to become visible. + assertTrue(!!parentalControlsRow); + assertTrue(isVisible(parentalControlsRow)); - const setUpButton = - parentalControlsRow.querySelector<HTMLElement>('cr-button'); - assertTrue(!!setUpButton); - setUpButton.click(); - flush(); + const setUpButton = + parentalControlsRow.querySelector<HTMLElement>('cr-button'); + assertTrue(!!setUpButton); + setUpButton.click(); + await flushTasks(); - const toggle = - parentalControlsRow.querySelector<HTMLElement>('cr-toggle'); - assertTrue(!!toggle); - toggle.click(); - flush(); + const setupPinDialog = + parentalControlsRow.querySelector<HTMLElement>('#setupPin'); + assertTrue(!!setupPinDialog); - assertTrue( - !!parentalControlsRow.querySelector<HTMLElement>('cr-button')); - }); + // TODO(b/332936223): When setup flow is implemented, simulate a + // successful PIN submission here instead. + const cancelPinSetupButton = + setupPinDialog.shadowRoot! + .querySelector<HTMLElement>('#dialog')! + .querySelector<HTMLElement>('.cancel-button'); + assertTrue(!!cancelPinSetupButton); + cancelPinSetupButton.click(); + await waitAfterNextRender(appsPage); + + assertTrue(!!appsPage.shadowRoot!.querySelector( + 'settings-app-parental-controls-subpage')); + + // Navigate back to apps page from the subpage. + const popStateEventPromise = eventToPromise('popstate', window); + Router.getInstance().navigateToPreviousRoute(); + await popStateEventPromise; + await waitAfterNextRender(appsPage); + + // Click the toggle to disable parental controls. + const toggle = + parentalControlsRow.querySelector<HTMLElement>('cr-toggle'); + assertTrue(!!toggle); + toggle.click(); + await flushTasks(); + + const disableDialog = + parentalControlsRow.querySelector<HTMLElement>( + '#disableDialog'); + assertTrue(!!disableDialog); + + // TODO(b/334102223): When disable flow is implemented, simulate a + // successful PIN verification here instead. + const cancelDisableButton = + disableDialog.shadowRoot!.querySelector<HTMLElement>('#dialog')! + .querySelector<HTMLElement>('.cancel-button'); + assertTrue(!!cancelDisableButton); + cancelDisableButton.click(); + await flushTasks(); + + assertTrue( + !!parentalControlsRow.querySelector<HTMLElement>('cr-button')); + }); } if (!isAppParentalControlsAvailable) {
diff --git a/chrome/test/data/webui/lens/BUILD.gn b/chrome/test/data/webui/lens/BUILD.gn index 8429a28..8fef2b41 100644 --- a/chrome/test/data/webui/lens/BUILD.gn +++ b/chrome/test/data/webui/lens/BUILD.gn
@@ -7,17 +7,18 @@ build_webui_tests("build") { is_chrome_untrusted = true files = [ + "overlay/object_selection_test.ts", "overlay/overlay_background_scrim_test.ts", "overlay/overlay_close_button_test.ts", "overlay/overlay_escape_key_test.ts", "overlay/overlay_feedback_button_test.ts", - "overlay/post_selection_renderer_test.ts", + "overlay/overlay_info_button_test.ts", "overlay/overlay_screenshot_test.ts", - "overlay/test_overlay_browser_proxy.ts", - "overlay/selection_overlay_test.ts", - "overlay/text_selection_test.ts", - "overlay/object_selection_test.ts", + "overlay/post_selection_renderer_test.ts", "overlay/region_selection_test.ts", + "overlay/selection_overlay_test.ts", + "overlay/test_overlay_browser_proxy.ts", + "overlay/text_selection_test.ts", "side_panel/results_frame_test.ts", "side_panel/searchbox_back_button_test.ts", "side_panel/side_panel_escape_key_test.ts",
diff --git a/chrome/test/data/webui/lens/lens_webui_browsertest.cc b/chrome/test/data/webui/lens/lens_webui_browsertest.cc index 8ae67b0..bf1821c 100644 --- a/chrome/test/data/webui/lens/lens_webui_browsertest.cc +++ b/chrome/test/data/webui/lens/lens_webui_browsertest.cc
@@ -127,6 +127,10 @@ RunOverlayTest("lens/overlay/overlay_feedback_button_test.js", "mocha.run()"); } +IN_PROC_BROWSER_TEST_F(LensOverlayTest, OverlayInfoButton) { + RunOverlayTest("lens/overlay/overlay_info_button_test.js", "mocha.run()"); +} + IN_PROC_BROWSER_TEST_F(LensOverlayTest, OverlayScreenshot) { RunOverlayTest("lens/overlay/overlay_screenshot_test.js", "mocha.run()"); }
diff --git a/chrome/test/data/webui/lens/overlay/overlay_info_button_test.ts b/chrome/test/data/webui/lens/overlay/overlay_info_button_test.ts new file mode 100644 index 0000000..90cbc1c --- /dev/null +++ b/chrome/test/data/webui/lens/overlay/overlay_info_button_test.ts
@@ -0,0 +1,48 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome-untrusted://lens/lens_overlay_app.js'; + +import {BrowserProxyImpl} from 'chrome-untrusted://lens/browser_proxy.js'; +import type {LensOverlayAppElement} from 'chrome-untrusted://lens/lens_overlay_app.js'; +import {assertFalse, assertTrue} from 'chrome-untrusted://webui-test/chai_assert.js'; +import {waitBeforeNextRender} from 'chrome-untrusted://webui-test/polymer_test_util.js'; + +import {TestLensOverlayBrowserProxy} from './test_overlay_browser_proxy.js'; + +suite('OverlayInfoButton', () => { + let testBrowserProxy: TestLensOverlayBrowserProxy; + let lensOverlayElement: LensOverlayAppElement; + + setup(() => { + // Resetting the HTML needs to be the first thing we do in setup to + // guarantee that any singleton instances don't change while any UI is still + // attached to the DOM. + document.body.innerHTML = window.trustedTypes!.emptyHTML; + + testBrowserProxy = new TestLensOverlayBrowserProxy(); + BrowserProxyImpl.setInstance(testBrowserProxy); + + lensOverlayElement = document.createElement('lens-overlay-app'); + document.body.appendChild(lensOverlayElement); + return waitBeforeNextRender(lensOverlayElement); + }); + + test('verify clicking info button calls browser proxy', async () => { + lensOverlayElement.$.infoButton.dispatchEvent(new MouseEvent('click', { + button: 1, + altKey: false, + ctrlKey: true, + metaKey: false, + shiftKey: true, + })); + const clickModifiers = + await testBrowserProxy.handler.whenCalled('infoRequestedByOverlay'); + assertTrue(clickModifiers.middleButton); + assertFalse(clickModifiers.altKey); + assertTrue(clickModifiers.ctrlKey); + assertFalse(clickModifiers.metaKey); + assertTrue(clickModifiers.shiftKey); + }); +});
diff --git a/chrome/test/data/webui/lens/overlay/test_overlay_browser_proxy.ts b/chrome/test/data/webui/lens/overlay/test_overlay_browser_proxy.ts index 535d991b..026c59f 100644 --- a/chrome/test/data/webui/lens/overlay/test_overlay_browser_proxy.ts +++ b/chrome/test/data/webui/lens/overlay/test_overlay_browser_proxy.ts
@@ -6,6 +6,7 @@ import type {CenterRotatedBox} from 'chrome-untrusted://lens/geometry.mojom-webui.js'; import type {LensPageHandlerInterface, LensPageRemote} from 'chrome-untrusted://lens/lens.mojom-webui.js'; import {LensPageCallbackRouter} from 'chrome-untrusted://lens/lens.mojom-webui.js'; +import type {ClickModifiers} from 'chrome-untrusted://resources/mojo/ui/base/mojom/window_open_disposition.mojom-webui.js'; import {TestBrowserProxy} from 'chrome-untrusted://webui-test/test_browser_proxy.js'; /** @@ -22,6 +23,7 @@ 'addBackgroundBlur', 'closeSearchBubble', 'feedbackRequestedByOverlay', + 'infoRequestedByOverlay', 'issueLensRequest', 'issueTextSelectionRequest', 'issueTranslateSelectionRequest', @@ -52,6 +54,10 @@ this.methodCalled('feedbackRequestedByOverlay'); } + infoRequestedByOverlay(clickModifiers: ClickModifiers) { + this.methodCalled('infoRequestedByOverlay', clickModifiers); + } + issueLensRequest(rect: CenterRotatedBox) { this.methodCalled('issueLensRequest', rect); }
diff --git a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar.gni b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar.gni index 0199fb9..a8e6d6f 100644 --- a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar.gni +++ b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar.gni
@@ -3,6 +3,8 @@ # found in the LICENSE file. calendar_v2_test_files = [ + "modules/v2/calendar/calendar_test.ts", "modules/v2/calendar/google_calendar_module_test.ts", "modules/v2/calendar/outlook_calendar_module_test.ts", + "modules/v2/calendar/test_support.ts", ]
diff --git a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar_test.ts b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar_test.ts new file mode 100644 index 0000000..41c1831 --- /dev/null +++ b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/calendar_test.ts
@@ -0,0 +1,32 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {CalendarElement} from 'chrome://new-tab-page/lazy_load.js'; +import {assertEquals} from 'chrome://webui-test/chai_assert.js'; +import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; + +import {createEvents} from './test_support.js'; + +suite('NewTabPageModulesGoogleCalendarModuleTest', () => { + let element: CalendarElement; + + setup(async () => { + document.body.innerHTML = window.trustedTypes!.emptyHTML; + element = new CalendarElement(); + document.body.append(element); + }); + + test('events are listed', async () => { + const numEvents = 2; + element.events = createEvents(numEvents); + await waitAfterNextRender(element); + + // Assert. + const eventElements = element.shadowRoot!.querySelectorAll('p'); + assertEquals(eventElements.length, numEvents); + for (let i = 0; i < numEvents; i++) { + assertEquals(eventElements[i]!.innerHTML, `Test Event ${i}`); + } + }); +});
diff --git a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/google_calendar_module_test.ts b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/google_calendar_module_test.ts index a722cb38..e58ad21 100644 --- a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/google_calendar_module_test.ts +++ b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/google_calendar_module_test.ts
@@ -14,6 +14,8 @@ import {installMock} from '../../../test_support.js'; +import {createEvents} from './test_support.js'; + suite('NewTabPageModulesGoogleCalendarModuleTest', () => { let handler: TestMock<GoogleCalendarPageHandlerRemote>; let module: GoogleCalendarModuleElement; @@ -21,6 +23,15 @@ const title = `Today's Calendar`; const dismissToast = `Today's Calendar hidden`; + async function initializeModule(numEvents: number = 0) { + handler.setResultFor( + 'getEvents', Promise.resolve({events: createEvents(numEvents)})); + module = await googleCalendarDescriptor.initialize(0) as + GoogleCalendarModuleElement; + document.body.append(module); + await waitAfterNextRender(module); + } + setup(async () => { loadTimeData.overrideValues({ modulesTodayCalendarHeader: title, @@ -31,20 +42,28 @@ GoogleCalendarPageHandlerRemote, mock => GoogleCalendarProxyImpl.setInstance( new GoogleCalendarProxyImpl(mock))); - module = await googleCalendarDescriptor.initialize(0) as - GoogleCalendarModuleElement; - assertTrue(!!module); - document.body.append(module); - await waitAfterNextRender(module); }); test('creates module', async () => { + await initializeModule(1); + assertTrue(!!module); + // Assert. assertTrue(isVisible(module.$.moduleHeaderElementV2)); assertEquals(module.$.moduleHeaderElementV2.headerText, title); }); + test('does not creates module if no data', async () => { + await initializeModule(0); + + // Assert. + assertEquals(module, null); + }); + test('dismisses and restores module', async () => { + await initializeModule(1); + assertTrue(!!module); + // Act. const whenFired = eventToPromise('dismiss-module-instance', module); ($$(module, 'ntp-module-header-v2')! @@ -62,4 +81,12 @@ // Assert. assertEquals(1, handler.getCallCount('restoreModule')); }); + + test('Calendar element created and passed event data', async () => { + await initializeModule(2); + assertTrue(!!module); + + assertTrue(isVisible(module.$.calendar)); + assertEquals(module.$.calendar.events.length, 2); + }); });
diff --git a/chrome/test/data/webui/new_tab_page/modules/v2/calendar/test_support.ts b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/test_support.ts new file mode 100644 index 0000000..718bf38 --- /dev/null +++ b/chrome/test/data/webui/new_tab_page/modules/v2/calendar/test_support.ts
@@ -0,0 +1,13 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import type {CalendarEvent} from 'chrome://new-tab-page/google_calendar.mojom-webui.js'; + +export function createEvents(num: number): CalendarEvent[] { + const events: CalendarEvent[] = []; + for (let i = 0; i < num; i++) { + events.push({title: `Test Event ${i}`}); + } + return events; +}
diff --git a/chrome/test/data/webui/new_tab_page/new_tab_page_browsertest.cc b/chrome/test/data/webui/new_tab_page/new_tab_page_browsertest.cc index 329a76f..98bcf741 100644 --- a/chrome/test/data/webui/new_tab_page/new_tab_page_browsertest.cc +++ b/chrome/test/data/webui/new_tab_page/new_tab_page_browsertest.cc
@@ -126,6 +126,10 @@ } #endif // !defined(OFFICIAL_BUILD) +IN_PROC_BROWSER_TEST_F(NewTabPageModulesTest, Calendar) { + RunTest("new_tab_page/modules/v2/calendar/calendar_test.js", "mocha.run()"); +} + IN_PROC_BROWSER_TEST_F(NewTabPageModulesTest, GoogleCalendarModule) { RunTest("new_tab_page/modules/v2/calendar/google_calendar_module_test.js", "mocha.run()");
diff --git a/chrome/test/interaction/interaction_test_util_browser.cc b/chrome/test/interaction/interaction_test_util_browser.cc index 56388e5..7e2792c 100644 --- a/chrome/test/interaction/interaction_test_util_browser.cc +++ b/chrome/test/interaction/interaction_test_util_browser.cc
@@ -50,8 +50,8 @@ ~PixelTestUi() override = default; // TestBrowserUi: - void ShowUi(const std::string& name) override { NOTREACHED(); } - void WaitForUserDismissal() override { NOTREACHED(); } + void ShowUi(const std::string& name) override { NOTREACHED_IN_MIGRATION(); } + void WaitForUserDismissal() override { NOTREACHED_IN_MIGRATION(); } bool VerifyUi() override { return VerifyUiWithResult() != ui::test::ActionResult::kFailed;
diff --git a/chrome/updater/app/app_install_win.cc b/chrome/updater/app/app_install_win.cc index 1fca499..b526b880 100644 --- a/chrome/updater/app/app_install_win.cc +++ b/chrome/updater/app/app_install_win.cc
@@ -271,7 +271,7 @@ time_remaining, pos)); } - void OnPause() override { NOTREACHED(); } + void OnPause() override { NOTREACHED_IN_MIGRATION(); } void OnComplete(const ObserverCompletionInfo& observer_info) override { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/chrome/updater/app/server/win/BUILD.gn b/chrome/updater/app/server/win/BUILD.gn index 3ef859e4..1b9e3e7 100644 --- a/chrome/updater/app/server/win/BUILD.gn +++ b/chrome/updater/app/server/win/BUILD.gn
@@ -190,6 +190,10 @@ "PLACEHOLDER-GUID-BC39E1E1-E8FA-4E72-903F-3BF346E7E165=$IPolicyStatus3UserGUID", "PLACEHOLDER-GUID-7B26CC23-B2B8-441B-AA9C-8B551ABB611B=$IPolicyStatus3SystemGUID", + "PLACEHOLDER-GUID-C07BC046-32E0-4184-BC9F-13C4533C24AC=$IPolicyStatus4GUID", + "PLACEHOLDER-GUID-0F6696F3-7F48-446B-97FA-6B34EC2ADB32=$IPolicyStatus4UserGUID", + "PLACEHOLDER-GUID-423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2=$IPolicyStatus4SystemGUID", + "PLACEHOLDER-GUID-2A7D2AE7-8EEE-45B4-B17F-31DAAC82CCBB=$IPolicyStatusValueGUID", "PLACEHOLDER-GUID-7E0A6B39-7CEB-4944-ABFA-F419D201D6A0=$IPolicyStatusValueUserGUID", "PLACEHOLDER-GUID-CC2CCD05-119C-44E1-852D-6DCC2DFB72EC=$IPolicyStatusValueSystemGUID",
diff --git a/chrome/updater/app/server/win/com_classes_legacy.cc b/chrome/updater/app/server/win/com_classes_legacy.cc index c9daed55..152f739 100644 --- a/chrome/updater/app/server/win/com_classes_legacy.cc +++ b/chrome/updater/app/server/win/com_classes_legacy.cc
@@ -1233,13 +1233,17 @@ } PolicyStatusImpl::PolicyStatusImpl() - : IDispatchImpl<IPolicyStatus3, IPolicyStatus2, IPolicyStatus>( - {IID_MAP_ENTRY_USER(IPolicyStatus3), - IID_MAP_ENTRY_USER(IPolicyStatus2), - IID_MAP_ENTRY_USER(IPolicyStatus)}, - {IID_MAP_ENTRY_SYSTEM(IPolicyStatus3), - IID_MAP_ENTRY_SYSTEM(IPolicyStatus2), - IID_MAP_ENTRY_SYSTEM(IPolicyStatus)}), + : IDispatchImpl<IPolicyStatus4, + IPolicyStatus3, + IPolicyStatus2, + IPolicyStatus>({IID_MAP_ENTRY_USER(IPolicyStatus4), + IID_MAP_ENTRY_USER(IPolicyStatus3), + IID_MAP_ENTRY_USER(IPolicyStatus2), + IID_MAP_ENTRY_USER(IPolicyStatus)}, + {IID_MAP_ENTRY_SYSTEM(IPolicyStatus4), + IID_MAP_ENTRY_SYSTEM(IPolicyStatus3), + IID_MAP_ENTRY_SYSTEM(IPolicyStatus2), + IID_MAP_ENTRY_SYSTEM(IPolicyStatus)}), policy_service_(GetAppServerWinInstance()->config()->GetPolicyService()) { } PolicyStatusImpl::~PolicyStatusImpl() = default; @@ -1668,6 +1672,16 @@ : E_FAIL; } +STDMETHODIMP PolicyStatusImpl::get_cloudPolicyOverridesPlatformPolicy( + IPolicyStatusValue** value) { + CHECK(value); + auto policy_status = PolicyStatusResult<bool>::Get(base::BindRepeating( + &PolicyService::CloudPolicyOverridesPlatformPolicy, policy_service_)); + return policy_status.has_value() + ? PolicyStatusValueImpl::Create(*policy_status, value) + : E_FAIL; +} + PolicyStatusValueImpl::PolicyStatusValueImpl() : IDispatchImpl<IPolicyStatusValue>( {{__uuidof(IPolicyStatusValueUser), __uuidof(IPolicyStatusValue)}},
diff --git a/chrome/updater/app/server/win/com_classes_legacy.h b/chrome/updater/app/server/win/com_classes_legacy.h index 8c44212..5a955dcd 100644 --- a/chrome/updater/app/server/win/com_classes_legacy.h +++ b/chrome/updater/app/server/win/com_classes_legacy.h
@@ -329,8 +329,10 @@ // and device management. // // This class is used by chrome://policy to show the current updater policies. -class PolicyStatusImpl - : public IDispatchImpl<IPolicyStatus3, IPolicyStatus2, IPolicyStatus> { +class PolicyStatusImpl : public IDispatchImpl<IPolicyStatus4, + IPolicyStatus3, + IPolicyStatus2, + IPolicyStatus> { public: PolicyStatusImpl(); PolicyStatusImpl(const PolicyStatusImpl&) = delete; @@ -338,7 +340,7 @@ HRESULT RuntimeClassInitialize(); - // IPolicyStatus/IPolicyStatus2/IPolicyStatus3. See + // IPolicyStatus/IPolicyStatus2/IPolicyStatus3/IPolicyStatus4. See // `updater_legacy_idl.template` for the description of the properties below. IFACEMETHODIMP get_lastCheckPeriodMinutes(DWORD* minutes) override; IFACEMETHODIMP get_updatesSuppressedTimes( @@ -389,6 +391,8 @@ IPolicyStatusValue** value) override; IFACEMETHODIMP get_forceInstallApps(VARIANT_BOOL is_machine, IPolicyStatusValue** value) override; + IFACEMETHODIMP get_cloudPolicyOverridesPlatformPolicy( + IPolicyStatusValue** value) override; private: ~PolicyStatusImpl() override;
diff --git a/chrome/updater/app/server/win/com_classes_legacy_unittest.cc b/chrome/updater/app/server/win/com_classes_legacy_unittest.cc index ef825481..b6f91fa 100644 --- a/chrome/updater/app/server/win/com_classes_legacy_unittest.cc +++ b/chrome/updater/app/server/win/com_classes_legacy_unittest.cc
@@ -330,6 +330,8 @@ L"{34527502-D3DB-4205-A69B-789B27EE0414}"); EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatus3)), L"{05A30352-EB25-45B6-8449-BCA7B0542CE5}"); + EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatus4)), + L"{FD0FDA43-AF97-4F1C-BD68-3355FB4F1C92}"); EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatusValue)), L"{27634814-8E41-4C35-8577-980134A96544}"); EXPECT_EQ(StringFromGuid(__uuidof(IProcessLauncher)), @@ -367,6 +369,8 @@ L"{9D31EA63-2E06-4D41-98C7-CB1F307DB597}"); EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatus3)), L"{5C674FC1-80E3-48D2-987B-79D9D286065B}"); + EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatus4)), + L"{4F08E832-C4AF-4D77-840F-8884083E8324}"); EXPECT_EQ(StringFromGuid(__uuidof(IPolicyStatusValue)), L"{47C8886A-A4B5-4F6C-865A-41A207074DFA}"); EXPECT_EQ(StringFromGuid(__uuidof(IProcessLauncher)),
diff --git a/chrome/updater/app/server/win/updater_legacy_idl.template b/chrome/updater/app/server/win/updater_legacy_idl.template index 1479f8a..a852ea2d 100644 --- a/chrome/updater/app/server/win/updater_legacy_idl.template +++ b/chrome/updater/app/server/win/updater_legacy_idl.template
@@ -579,6 +579,32 @@ }; END_INTERFACE +// IPolicyStatus4 exposes everything IPolicyStatus3 does, and in addition, +// exposes the cloudPolicyOverridesPlatformPolicy policy. +BEGIN_INTERFACE( + { + "uuid": { + "user":"PLACEHOLDER-GUID-0F6696F3-7F48-446B-97FA-6B34EC2ADB32", + "system":"PLACEHOLDER-GUID-423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2" + }, + "tokensToSuffix": ["IPolicyStatus4", "IPolicyStatus3", + "IPolicyStatusValue"], + "addToLibrary": ["", "user", "system"] + } +) +[ + object, + dual, + uuid(PLACEHOLDER-GUID-C07BC046-32E0-4184-BC9F-13C4533C24AC), + helpstring("IPolicyStatus4 Interface"), + pointer_default(unique) +] +interface IPolicyStatus4 : IPolicyStatus3 { + [propget] HRESULT cloudPolicyOverridesPlatformPolicy( + [out, retval] IPolicyStatusValue** value); +}; +END_INTERFACE + BEGIN_INTERFACE( { "uuid": {
diff --git a/chrome/updater/branding.gni b/chrome/updater/branding.gni index e250669..46083019 100644 --- a/chrome/updater/branding.gni +++ b/chrome/updater/branding.gni
@@ -77,6 +77,10 @@ IPolicyStatus3UserGUID = "38E9E61D-A104-46E2-9645-C3E7EFF9FD7C" IPolicyStatus3SystemGUID = "F4334319-8210-469B-8262-DD03623FEB5B" + IPolicyStatus4GUID = "FD0FDA43-AF97-4F1C-BD68-3355FB4F1C92" + IPolicyStatus4UserGUID = "F09EBC4C-74E9-41ED-97A8-6CE37550B172" + IPolicyStatus4SystemGUID = "F966A529-43C6-4710-8FF4-0B456324C8F4" + IPolicyStatusValueGUID = "27634814-8E41-4C35-8577-980134A96544" IPolicyStatusValueUserGUID = "2EFD593A-304B-4544-AC39-A02D9105FB8C" IPolicyStatusValueSystemGUID = "4DC034A8-4BFC-4D43-9250-914163356BB0" @@ -164,6 +168,10 @@ IPolicyStatus3UserGUID = "847BB70C-47D0-46C2-8C97-9000A1F9AD99" IPolicyStatus3SystemGUID = "6F7996CA-5531-4299-BD7F-3C7090520090" + IPolicyStatus4GUID = "4F08E832-C4AF-4D77-840F-8884083E8324" + IPolicyStatus4UserGUID = "3C0435E1-B19F-4B7A-8481-D7EBAEBFAF47" + IPolicyStatus4SystemGUID = "DD9F76CA-FCFB-4F8E-B65E-F7C0703AAFBD" + IPolicyStatusValueGUID = "47C8886A-A4B5-4F6C-865A-41A207074DFA" IPolicyStatusValueUserGUID = "13D172EB-2BFB-4D72-AF10-7D33337B7FC6" IPolicyStatusValueSystemGUID = "CFF9AE0F-C5C5-4D53-8394-7602758A52BA"
diff --git a/chrome/updater/policy/service.cc b/chrome/updater/policy/service.cc index 4f9cb27..1667e8a 100644 --- a/chrome/updater/policy/service.cc +++ b/chrome/updater/policy/service.cc
@@ -341,7 +341,6 @@ return QueryPolicy( &PolicyManagerInterface::GetLastCheckPeriod, base::BindRepeating([](std::optional<base::TimeDelta> period) { - // TODO: C++23: `return period.transform(&base::TimeDelta::InMinutes);` return period ? std::make_optional(period->InMinutes()) : std::nullopt; })); }
diff --git a/chrome/updater/test/integration_tests.cc b/chrome/updater/test/integration_tests.cc index e2ff2f33..f141ff3 100644 --- a/chrome/updater/test/integration_tests.cc +++ b/chrome/updater/test/integration_tests.cc
@@ -2171,8 +2171,6 @@ } #if BUILDFLAG(IS_WIN) && !defined(COMPONENT_BUILD) -// TODO(crbug.com/40209325): standalone installers are supported on Windows -// only. TEST_F(IntegrationTest, OfflineInstall) { ASSERT_NO_FATAL_FAILURE(Install()); ASSERT_NO_FATAL_FAILURE(ExpectInstalled());
diff --git a/chrome/updater/update_usage_stats_task_linux.cc b/chrome/updater/update_usage_stats_task_linux.cc index 19078826..5b700556 100644 --- a/chrome/updater/update_usage_stats_task_linux.cc +++ b/chrome/updater/update_usage_stats_task_linux.cc
@@ -18,7 +18,6 @@ bool AreRawUsageStatsEnabled( UpdaterScope scope, const std::vector<std::string>& include_only_these_app_ids) { - // TODO(b/325316125): Implement. return false; }
diff --git a/chrome/updater/update_usage_stats_task_mac.mm b/chrome/updater/update_usage_stats_task_mac.mm index 785f2434..e591d21a 100644 --- a/chrome/updater/update_usage_stats_task_mac.mm +++ b/chrome/updater/update_usage_stats_task_mac.mm
@@ -82,7 +82,6 @@ bool AreRawUsageStatsEnabled( UpdaterScope scope, const std::vector<std::string>& include_only_these_app_ids) { - // TODO(b/325316125): Implement. return false; }
diff --git a/chrome/updater/util/util.cc b/chrome/updater/util/util.cc index 2ad5d09..1cc3131f 100644 --- a/chrome/updater/util/util.cc +++ b/chrome/updater/util/util.cc
@@ -4,6 +4,7 @@ #include "chrome/updater/util/util.h" +#include <algorithm> #include <optional> #include <string> #include <string_view> @@ -18,7 +19,6 @@ #endif // BUILDFLAG(IS_WIN) #include "base/base_paths.h" -#include "base/check_op.h" #include "base/command_line.h" #include "base/files/file.h" #include "base/files/file_enumerator.h" @@ -391,4 +391,12 @@ return delete_success; } +int GetDownloadProgress(int64_t downloaded_bytes, int64_t total_bytes) { + if (downloaded_bytes == -1 || total_bytes == -1 || total_bytes == 0) { + return -1; + } + return 100 * std::clamp(static_cast<double>(downloaded_bytes) / total_bytes, + 0.0, 1.0); +} + } // namespace updater
diff --git a/chrome/updater/util/util.h b/chrome/updater/util/util.h index 48afe8b..5f859a4e 100644 --- a/chrome/updater/util/util.h +++ b/chrome/updater/util/util.h
@@ -232,6 +232,11 @@ return std::ceil(static_cast<double>(m) / n); } +// Returns a value in the [0, 100] range or -1 if the progress could not +// be computed. +[[nodiscard]] int GetDownloadProgress(int64_t downloaded_bytes, + int64_t total_bytes); + } // namespace updater #endif // CHROME_UPDATER_UTIL_UTIL_H_
diff --git a/chrome/updater/util/util_unittest.cc b/chrome/updater/util/util_unittest.cc index d6ee7d85..1268de7 100644 --- a/chrome/updater/util/util_unittest.cc +++ b/chrome/updater/util/util_unittest.cc
@@ -191,4 +191,15 @@ EXPECT_EQ(os.str(), "test\n"); } +TEST(WinUtil, GetDownloadProgress) { + EXPECT_EQ(GetDownloadProgress(0, 50), 0); + EXPECT_EQ(GetDownloadProgress(12, 50), 24); + EXPECT_EQ(GetDownloadProgress(25, 50), 50); + EXPECT_EQ(GetDownloadProgress(50, 50), 100); + EXPECT_EQ(GetDownloadProgress(50, 50), 100); + EXPECT_EQ(GetDownloadProgress(0, -1), -1); + EXPECT_EQ(GetDownloadProgress(-1, -1), -1); + EXPECT_EQ(GetDownloadProgress(50, 0), -1); +} + } // namespace updater
diff --git a/chrome/updater/util/win_util.cc b/chrome/updater/util/win_util.cc index ecb57b70..49689735 100644 --- a/chrome/updater/util/win_util.cc +++ b/chrome/updater/util/win_util.cc
@@ -16,7 +16,6 @@ #include <wrl/client.h> #include <wtsapi32.h> -#include <algorithm> #include <cstdlib> #include <memory> #include <optional> @@ -375,15 +374,6 @@ return result == ERROR_SUCCESS; } -int GetDownloadProgress(int64_t downloaded_bytes, int64_t total_bytes) { - if (downloaded_bytes == -1 || total_bytes == -1 || total_bytes == 0) { - return -1; - } - CHECK_LE(downloaded_bytes, total_bytes); - return 100 * std::clamp(static_cast<double>(downloaded_bytes) / total_bytes, - 0.0, 1.0); -} - HResultOr<bool> IsTokenAdmin(HANDLE token) { SID_IDENTIFIER_AUTHORITY nt_authority = SECURITY_NT_AUTHORITY; PSID administrators_group = nullptr;
diff --git a/chrome/updater/util/win_util.h b/chrome/updater/util/win_util.h index 8dfaf12..7d3f925 100644 --- a/chrome/updater/util/win_util.h +++ b/chrome/updater/util/win_util.h
@@ -233,10 +233,6 @@ const std::wstring& name, const std::wstring& value); -// Returns a value in the [0, 100] range or -1 if the progress could not -// be computed. -int GetDownloadProgress(int64_t downloaded_bytes, int64_t total_bytes); - // Returns `true` if the token is an elevated administrator. If // `token` is `NULL`, the current thread token is used. HResultOr<bool> IsTokenAdmin(HANDLE token);
diff --git a/chrome/updater/util/win_util_unittest.cc b/chrome/updater/util/win_util_unittest.cc index a9a4de3..b6736cd 100644 --- a/chrome/updater/util/win_util_unittest.cc +++ b/chrome/updater/util/win_util_unittest.cc
@@ -66,17 +66,6 @@ } // namespace -TEST(WinUtil, GetDownloadProgress) { - EXPECT_EQ(GetDownloadProgress(0, 50), 0); - EXPECT_EQ(GetDownloadProgress(12, 50), 24); - EXPECT_EQ(GetDownloadProgress(25, 50), 50); - EXPECT_EQ(GetDownloadProgress(50, 50), 100); - EXPECT_EQ(GetDownloadProgress(50, 50), 100); - EXPECT_EQ(GetDownloadProgress(0, -1), -1); - EXPECT_EQ(GetDownloadProgress(-1, -1), -1); - EXPECT_EQ(GetDownloadProgress(50, 0), -1); -} - TEST(WinUtil, GetServiceDisplayName) { for (const bool is_internal_service : {true, false}) { EXPECT_EQ(base::StrCat({base::ASCIIToWide(PRODUCT_FULLNAME_STRING), L" ",
diff --git a/chrome/updater/win/setup/setup_util.cc b/chrome/updater/win/setup/setup_util.cc index 643a7bd..0349baa 100644 --- a/chrome/updater/win/setup/setup_util.cc +++ b/chrome/updater/win/setup/setup_util.cc
@@ -149,6 +149,7 @@ INTERFACE_PAIR(IPolicyStatusUser), INTERFACE_PAIR(IPolicyStatus2User), INTERFACE_PAIR(IPolicyStatus3User), + INTERFACE_PAIR(IPolicyStatus4User), INTERFACE_PAIR(IPolicyStatusValueUser), }; case UpdaterScope::kSystem: @@ -171,6 +172,7 @@ INTERFACE_PAIR(IPolicyStatusSystem), INTERFACE_PAIR(IPolicyStatus2System), INTERFACE_PAIR(IPolicyStatus3System), + INTERFACE_PAIR(IPolicyStatus4System), INTERFACE_PAIR(IPolicyStatusValueSystem), INTERFACE_PAIR(IProcessLauncher), INTERFACE_PAIR(IProcessLauncherSystem), @@ -573,6 +575,7 @@ {__uuidof(IPolicyStatus), updater_legacy_index}, {__uuidof(IPolicyStatus2), updater_legacy_index}, {__uuidof(IPolicyStatus3), updater_legacy_index}, + {__uuidof(IPolicyStatus4), updater_legacy_index}, {__uuidof(IPolicyStatusValue), updater_legacy_index}, {__uuidof(IProcessLauncher), updater_legacy_index}, {__uuidof(IProcessLauncher2), updater_legacy_index}, @@ -587,6 +590,7 @@ {__uuidof(IPolicyStatusUser), kUpdaterLegacyUserIndex}, {__uuidof(IPolicyStatus2User), kUpdaterLegacyUserIndex}, {__uuidof(IPolicyStatus3User), kUpdaterLegacyUserIndex}, + {__uuidof(IPolicyStatus4User), kUpdaterLegacyUserIndex}, {__uuidof(IPolicyStatusValueUser), kUpdaterLegacyUserIndex}, // Updater legacy system typelib. @@ -599,6 +603,7 @@ {__uuidof(IPolicyStatusSystem), kUpdaterLegacySystemIndex}, {__uuidof(IPolicyStatus2System), kUpdaterLegacySystemIndex}, {__uuidof(IPolicyStatus3System), kUpdaterLegacySystemIndex}, + {__uuidof(IPolicyStatus4System), kUpdaterLegacySystemIndex}, {__uuidof(IPolicyStatusValueSystem), kUpdaterLegacySystemIndex}, {__uuidof(IProcessLauncherSystem), kUpdaterLegacySystemIndex}, {__uuidof(IProcessLauncher2System), kUpdaterLegacySystemIndex},
diff --git a/chrome/utility/services.cc b/chrome/utility/services.cc index f5c1649..8cd599f0 100644 --- a/chrome/utility/services.cc +++ b/chrome/utility/services.cc
@@ -38,10 +38,6 @@ #include "services/screen_ai/screen_ai_service_impl.h" // nogncheck #endif -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -#include "services/passage_embeddings/passage_embeddings_service.h" -#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(LINUX) - #if BUILDFLAG(IS_WIN) #include "chrome/services/system_signals/win/win_system_signals_service.h" #include "chrome/services/util_win/processor_metrics.h" @@ -69,6 +65,7 @@ #include "chrome/common/importer/profile_import.mojom.h" #include "chrome/utility/importer/profile_import_impl.h" #include "components/mirroring/service/mirroring_service.h" +#include "services/passage_embeddings/passage_embeddings_service.h" #include "services/proxy_resolver/proxy_resolver_factory_impl.h" // nogncheck #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #endif // !BUILDFLAG(IS_ANDROID) @@ -218,13 +215,6 @@ #endif // BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -auto RunPassageEmbeddingsService( - mojo::PendingReceiver<passage_embeddings::mojom::PassageEmbeddingsService> - receiver) { - return std::make_unique<passage_embeddings::PassageEmbeddingsService>( - std::move(receiver)); -} - auto RunSystemSignalsService( mojo::PendingReceiver<device_signals::mojom::SystemSignalsService> receiver) { @@ -260,6 +250,13 @@ std::move(receiver), content::UtilityThread::Get()->GetIOTaskRunner()); } +auto RunPassageEmbeddingsService( + mojo::PendingReceiver<passage_embeddings::mojom::PassageEmbeddingsService> + receiver) { + return std::make_unique<passage_embeddings::PassageEmbeddingsService>( + std::move(receiver)); +} + #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE) @@ -466,6 +463,7 @@ #if !BUILDFLAG(IS_ANDROID) services.Add(RunProfileImporter); services.Add(RunMirroringService); + services.Add(RunPassageEmbeddingsService); #endif // !BUILDFLAG(IS_ANDROID) #if BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE) @@ -484,7 +482,6 @@ #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) - services.Add(RunPassageEmbeddingsService); services.Add(RunSystemSignalsService); #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chromecast/media/audio/cast_audio_output_stream.cc b/chromecast/media/audio/cast_audio_output_stream.cc index 17e5efc..bab36b7 100644 --- a/chromecast/media/audio/cast_audio_output_stream.cc +++ b/chromecast/media/audio/cast_audio_output_stream.cc
@@ -116,7 +116,7 @@ int64_t delay_timestamp, int64_t delay) override; // We don't push an EOS buffer. - void OnEosPlayed() override { NOTREACHED(); } + void OnEosPlayed() override { NOTREACHED_IN_MIGRATION(); } const ::media::AudioParameters audio_params_; const std::string device_id_;
diff --git a/chromecast/media/audio/external_audio_pipeline_dummy.cc b/chromecast/media/audio/external_audio_pipeline_dummy.cc index b5337190..af66793 100644 --- a/chromecast/media/audio/external_audio_pipeline_dummy.cc +++ b/chromecast/media/audio/external_audio_pipeline_dummy.cc
@@ -12,9 +12,9 @@ // swap in their implementation it complains about missing symbols. #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) #include <stdlib.h> // abort() -#define NOTREACHED() abort() +#define NOTREACHED_IN_MIGRATION() abort() #else -#define NOTREACHED() static_cast<void>(0) +#define NOTREACHED_IN_MIGRATION() static_cast<void>(0) #endif namespace chromecast {
diff --git a/chromecast/net/small_message_socket_unittest.cc b/chromecast/net/small_message_socket_unittest.cc index c44be80..faa196a 100644 --- a/chromecast/net/small_message_socket_unittest.cc +++ b/chromecast/net/small_message_socket_unittest.cc
@@ -94,7 +94,7 @@ SmallMessageSocket* socket() { return &socket_; } private: - void OnError(int error) override { NOTREACHED(); } + void OnError(int error) override { NOTREACHED_IN_MIGRATION(); } bool OnMessage(char* data, size_t size) override { message_history_.push_back(size);
diff --git a/chromecast/system/reboot/reboot_dummy.cc b/chromecast/system/reboot/reboot_dummy.cc index 52e6d4a..94c743d2 100644 --- a/chromecast/system/reboot/reboot_dummy.cc +++ b/chromecast/system/reboot/reboot_dummy.cc
@@ -6,9 +6,9 @@ #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) #include <stdlib.h> // abort() -#define NOTREACHED() abort() +#define NOTREACHED_IN_MIGRATION() abort() #else -#define NOTREACHED() static_cast<void>(0) +#define NOTREACHED_IN_MIGRATION() static_cast<void>(0) #endif namespace chromecast { @@ -35,7 +35,7 @@ } void RebootShlib::SetFdrForNextReboot() { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } bool RebootShlib::IsOtaForNextRebootSupported() { @@ -43,7 +43,7 @@ } void RebootShlib::SetOtaForNextReboot() { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } bool RebootShlib::IsClearOtaForNextRebootSupported() { @@ -51,7 +51,7 @@ } void RebootShlib::ClearOtaForNextReboot() { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } } // namespace chromecast
diff --git a/chromecast/tracing/tracing_service_main.cc b/chromecast/tracing/tracing_service_main.cc index 5f034aa4..e2fd54a 100644 --- a/chromecast/tracing/tracing_service_main.cc +++ b/chromecast/tracing/tracing_service_main.cc
@@ -108,7 +108,9 @@ } // base::MessagePumpLibevent::FdWatcher: - void OnFileCanReadWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanReadWithoutBlocking(int fd) override { + NOTREACHED_IN_MIGRATION(); + } void OnFileCanWriteWithoutBlocking(int fd) override { DCHECK_EQ(out_fd_.get(), fd); CopyTraceData(); @@ -197,7 +199,9 @@ DCHECK_EQ(connection_fd_.get(), fd); ReceiveClientMessage(); } - void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanWriteWithoutBlocking(int fd) override { + NOTREACHED_IN_MIGRATION(); + } private: enum class State { @@ -361,7 +365,9 @@ DCHECK_EQ(server_socket_.get(), fd); AcceptConnection(); } - void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanWriteWithoutBlocking(int fd) override { + NOTREACHED_IN_MIGRATION(); + } private: void AcceptConnection() {
diff --git a/chromeos/ash/components/audio/audio_selection_notification_handler.cc b/chromeos/ash/components/audio/audio_selection_notification_handler.cc index 92f9291..c73380c7 100644 --- a/chromeos/ash/components/audio/audio_selection_notification_handler.cc +++ b/chromeos/ash/components/audio/audio_selection_notification_handler.cc
@@ -258,8 +258,6 @@ /*by_user=*/false); message_center->AddNotification( std::make_unique<message_center::Notification>(notification)); - - // TODO(zhangwenyu): Add metrics to record notification is displayed. } void AudioSelectionNotificationHandler::HandleSwitchButtonClicked( @@ -318,7 +316,9 @@ return; } - // TODO(zhangwenyu): Add metrics to record notification button clicked. + audio_device_metrics_handler_.RecordNotificationEvents( + AudioDeviceMetricsHandler::AudioSelectionNotificationEvents:: + kNotificationWithMultipleSourcesDevicesClicked); // Open OS Settings audio page. open_settigns_callback.Run();
diff --git a/chromeos/ash/components/audio/audio_selection_notification_handler_unittest.cc b/chromeos/ash/components/audio/audio_selection_notification_handler_unittest.cc index b90e032..4eec03b 100644 --- a/chromeos/ash/components/audio/audio_selection_notification_handler_unittest.cc +++ b/chromeos/ash/components/audio/audio_selection_notification_handler_unittest.cc
@@ -746,6 +746,21 @@ FastForwardBy(AudioSelectionNotificationHandler::kDebounceTime); EXPECT_EQ(1u, GetNotificationCount()); + // No clicking notification event metrics are fired before clicking settings + // button, only the notification showing up metrics are fired. + histogram_tester().ExpectTotalCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, 1); + histogram_tester().ExpectBucketCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, + AudioDeviceMetricsHandler::AudioSelectionNotificationEvents:: + kNotificationWithMultipleSourcesDevicesShowsUp, + 1); + histogram_tester().ExpectBucketCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, + AudioDeviceMetricsHandler::AudioSelectionNotificationEvents:: + kNotificationWithMultipleSourcesDevicesClicked, + 0); + // Clicking notification body does not have any effects. HandleSettingsButtonClicked(std::nullopt); EXPECT_EQ(1u, GetNotificationCount()); @@ -756,6 +771,21 @@ EXPECT_TRUE(settings_audio_page_opened()); EXPECT_EQ(0u, GetNotificationCount()); + + // Clicking notification event metrics are fired after clicking settings + // button. + histogram_tester().ExpectTotalCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, 2); + histogram_tester().ExpectBucketCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, + AudioDeviceMetricsHandler::AudioSelectionNotificationEvents:: + kNotificationWithMultipleSourcesDevicesShowsUp, + 1); + histogram_tester().ExpectBucketCount( + AudioDeviceMetricsHandler::kAudioSelectionNotification, + AudioDeviceMetricsHandler::AudioSelectionNotificationEvents:: + kNotificationWithMultipleSourcesDevicesClicked, + 1); } } // namespace ash
diff --git a/chromeos/ash/components/drivefs/drivefs_host_unittest.cc b/chromeos/ash/components/drivefs/drivefs_host_unittest.cc index 5b6ce793..33f705a5 100644 --- a/chromeos/ash/components/drivefs/drivefs_host_unittest.cc +++ b/chromeos/ash/components/drivefs/drivefs_host_unittest.cc
@@ -606,9 +606,11 @@ TEST_F(DriveFsHostTest, DisplayConfirmDialogImpl_IgnoreUnknownReasonTypes) { ASSERT_NO_FATAL_FAILURE(DoMount()); - host_->set_dialog_handler(base::BindRepeating( - [](const mojom::DialogReason&, - base::OnceCallback<void(mojom::DialogResult)>) { NOTREACHED(); })); + host_->set_dialog_handler( + base::BindRepeating([](const mojom::DialogReason&, + base::OnceCallback<void(mojom::DialogResult)>) { + NOTREACHED_IN_MIGRATION(); + })); bool called = false; delegate_->DisplayConfirmDialog( mojom::DialogReason::New(
diff --git a/chromeos/ash/components/growth/campaigns_manager.cc b/chromeos/ash/components/growth/campaigns_manager.cc index 1bfba3b..41e3705 100644 --- a/chromeos/ash/components/growth/campaigns_manager.cc +++ b/chromeos/ash/components/growth/campaigns_manager.cc
@@ -205,8 +205,8 @@ } } -void CampaignsManager::SetTrigger(TriggeringType trigger_type) { - matcher_.SetTrigger(trigger_type); +void CampaignsManager::SetTrigger(const Trigger&& trigger_type) { + matcher_.SetTrigger(std::move(trigger_type)); } void CampaignsManager::SetActiveUrl(const GURL& url) {
diff --git a/chromeos/ash/components/growth/campaigns_manager.h b/chromeos/ash/components/growth/campaigns_manager.h index 0ff14dcd..5fce88c 100644 --- a/chromeos/ash/components/growth/campaigns_manager.h +++ b/chromeos/ash/components/growth/campaigns_manager.h
@@ -66,9 +66,9 @@ // opened app targeting. void SetOpenedApp(const std::string& app_id); - // Set the current trigger type. Used in `CampaignsMatcher` for matching - // trigger targeting. - void SetTrigger(TriggeringType trigger_type); + // Set the current trigger type and event. Used in `CampaignsMatcher` for + // matching trigger targeting. + void SetTrigger(const Trigger&& trigger_type); // Set the current active URL. Used in `CampaignsMatcher` for matching // URL targeting
diff --git a/chromeos/ash/components/growth/campaigns_manager_client.h b/chromeos/ash/components/growth/campaigns_manager_client.h index 90baf6b..65453c58 100644 --- a/chromeos/ash/components/growth/campaigns_manager_client.h +++ b/chromeos/ash/components/growth/campaigns_manager_client.h
@@ -54,6 +54,9 @@ // Returns application locale. virtual const std::string& GetApplicationLocale() const = 0; + // Returns user selected locale. + virtual const std::string& GetUserLocale() const = 0; + // Get demo mode app component version. virtual const base::Version& GetDemoModeAppVersion() const = 0;
diff --git a/chromeos/ash/components/growth/campaigns_manager_unittest.cc b/chromeos/ash/components/growth/campaigns_manager_unittest.cc index 518a88db..2964cccc 100644 --- a/chromeos/ash/components/growth/campaigns_manager_unittest.cc +++ b/chromeos/ash/components/growth/campaigns_manager_unittest.cc
@@ -251,6 +251,15 @@ .WillRepeatedly(testing::ReturnRef(app_version)); } + void MockLocales(const std::string& user_locale, + const std::string& application_locale) { + EXPECT_CALL(mock_client_, GetUserLocale()) + .WillRepeatedly(testing::ReturnRefOfCopy(std::string(user_locale))); + EXPECT_CALL(mock_client_, GetApplicationLocale()) + .WillRepeatedly( + testing::ReturnRefOfCopy(std::string(application_locale))); + } + void InitilizeCampaignsExperimentTag(const std::string& exp_tag) { base::FieldTrialParams params; params[kCampaignsExperimentTag] = exp_tag; @@ -296,6 +305,18 @@ kValidCampaignsFileTemplate, device_targeting.c_str())); } + void LoadComponentWithUserLocaleTargetings(const std::string& locales) { + std::string feature_aware_targeting = ""; + auto device_targeting = base::StringPrintf(R"( + "device": { + "userLocales": %s + } + )", + locales.c_str()); + LoadComponentAndVerifyLoadComplete(base::StringPrintf( + kValidCampaignsFileTemplate, device_targeting.c_str())); + } + void LoadComponentWithRegisteredTimeTargeting( const std::string& registerd_time_targeting) { auto device_targeting = @@ -353,7 +374,7 @@ void LoadComponentWithTriggerTargeting(const std::string& triggers) { auto session_targeting = base::StringPrintf(R"( "runtime": { - "triggers": %s + "triggerList": %s } )", triggers.c_str()); @@ -915,29 +936,47 @@ "max": %d )", current_version, current_version + 1)); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); VerifyDemoModePayload( campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } +TEST_F(CampaignsManagerTest, GetCampaignUserLocaleTargeting) { + MockLocales(/*user_locale=*/"en-IN", /*application_locale=*/"en-GB"); + LoadComponentWithUserLocaleTargetings(R"(["en-AU", "en-IN"])"); + + VerifyDemoModePayload( + campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); +} + +TEST_F(CampaignsManagerTest, GetCampaignUserLocaleTargetingMismatch) { + MockLocales(/*user_locale=*/"en-IN", /*application_locale=*/"en-GB"); + LoadComponentWithUserLocaleTargetings(R"(["en-GB", "en-AU"])"); + + ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); +} + TEST_F(CampaignsManagerTest, GetCampaignMilestoneMinMismatch) { - auto current_version = version_info::GetMajorVersionNumberAsInt(); EXPECT_CALL(mock_client_, GetApplicationLocale()) .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); + + auto current_version = version_info::GetMajorVersionNumberAsInt(); LoadComponentWithBasicDeviceTargetings(base::StringPrintf( R"( "min": %d, "max": %d )", current_version + 1, current_version + 1)); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } TEST_F(CampaignsManagerTest, GetCampaignMilestoneMaxMismatch) { + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); + auto current_version = version_info::GetMajorVersionNumberAsInt(); - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); LoadComponentWithBasicDeviceTargetings(base::StringPrintf( R"( "min": %d, @@ -949,9 +988,11 @@ } TEST_F(CampaignsManagerTest, GetCampaignMinMilestoneOnly) { - auto current_version = version_info::GetMajorVersionNumberAsInt(); EXPECT_CALL(mock_client_, GetApplicationLocale()) .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); + + auto current_version = version_info::GetMajorVersionNumberAsInt(); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("min": %d)", current_version)); @@ -960,9 +1001,9 @@ } TEST_F(CampaignsManagerTest, GetCampaignMinMilestoneOnlyMismatch) { + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); + auto current_version = version_info::GetMajorVersionNumberAsInt(); - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("min": %d)", current_version + 1)); @@ -970,9 +1011,9 @@ } TEST_F(CampaignsManagerTest, GetCampaignMaxMilestoneOnly) { + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); + auto current_version = version_info::GetMajorVersionNumberAsInt(); - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("max": %d)", current_version)); @@ -981,9 +1022,9 @@ } TEST_F(CampaignsManagerTest, GetCampaignMaxMilestoneOnlyMismatch) { + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); + auto current_version = version_info::GetMajorVersionNumberAsInt(); - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("max": %d)", current_version - 1)); @@ -991,9 +1032,10 @@ } TEST_F(CampaignsManagerTest, GetCampaignApplicationLocaleMismatch) { - auto current_version = version_info::GetMajorVersionNumberAsInt(); EXPECT_CALL(mock_client_, GetApplicationLocale()) .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-CA"))); + + auto current_version = version_info::GetMajorVersionNumberAsInt(); LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("max": %d)", current_version)); @@ -1011,6 +1053,7 @@ LoadComponentWithBasicDeviceTargetings( base::StringPrintf(R"("max": %d)", current_version), /*target_feature_aware_device=*/true); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); VerifyDemoModePayload( campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); @@ -1046,8 +1089,8 @@ } TEST_F(CampaignsManagerTest, GetCampaignTargetNotFeatureAwareDeviceMismatch) { - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); + scoped_feature_list_.InitWithFeatures( {}, {ash::features::kFeatureManagementGrowthFramework}); @@ -1487,34 +1530,44 @@ } TEST_F(CampaignsManagerTest, GetCampaignTriggers) { - campaigns_manager_->SetTrigger(TriggeringType::kAppOpened); + growth::Trigger trigger(growth::TriggerType::kAppOpened); + campaigns_manager_->SetTrigger(std::move(trigger)); - LoadComponentWithTriggerTargeting(R"([0])"); + LoadComponentWithTriggerTargeting( + R"([{"triggerType": 0, "triggerEvents": []}])"); VerifyDemoModePayload( campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } TEST_F(CampaignsManagerTest, GetCampaignTriggersOrRelationship) { - campaigns_manager_->SetTrigger(TriggeringType::kAppOpened); + growth::Trigger trigger(growth::TriggerType::kAppOpened); + campaigns_manager_->SetTrigger(std::move(trigger)); - LoadComponentWithTriggerTargeting(R"([0, 1])"); + LoadComponentWithTriggerTargeting(R"([ + {"triggerType": 0, "triggerEvents": []}, + {"triggerType": 1, "triggerEvents": []} + ])"); VerifyDemoModePayload( campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } TEST_F(CampaignsManagerTest, GetCampaignTriggersMissmatch) { - campaigns_manager_->SetTrigger(TriggeringType::kAppOpened); + growth::Trigger trigger(growth::TriggerType::kAppOpened); + campaigns_manager_->SetTrigger(std::move(trigger)); - LoadComponentWithTriggerTargeting(R"([1])"); + LoadComponentWithTriggerTargeting( + R"([{"triggerType": 1, "triggerEvents": []}])"); ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } TEST_F(CampaignsManagerTest, GetCampaignTriggersNoTrigger) { - LoadComponentWithTriggerTargeting(R"([0, 1])"); - + LoadComponentWithTriggerTargeting(R"([ + {"triggerType": 0, "triggerEvents": []}, + {"triggerType": 1, "triggerEvents": []} + ])"); ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } @@ -1594,8 +1647,7 @@ } TEST_F(CampaignsManagerTest, CampaignsFilteringTest) { - EXPECT_CALL(mock_client_, GetApplicationLocale()) - .WillRepeatedly(testing::ReturnRefOfCopy(std::string("en-US"))); + MockLocales(/*user_locale=*/"en-US", /*application_locale=*/"en-US"); LoadComponentAndVerifyLoadComplete( R"({
diff --git a/chromeos/ash/components/growth/campaigns_matcher.cc b/chromeos/ash/components/growth/campaigns_matcher.cc index 8798375..c73ce0c 100644 --- a/chromeos/ash/components/growth/campaigns_matcher.cc +++ b/chromeos/ash/components/growth/campaigns_matcher.cc
@@ -190,8 +190,8 @@ is_user_owner_ = is_user_owner; } -void CampaignsMatcher::SetTrigger(TriggeringType trigger) { - trigger_ = trigger; +void CampaignsMatcher::SetTrigger(const Trigger&& trigger) { + trigger_ = std::move(trigger); } void CampaignsMatcher::SetPrefs(PrefService* prefs) { @@ -328,7 +328,6 @@ bool CampaignsMatcher::MatchMilestone(const DeviceTargeting& targeting) const { const auto milestone = GetMilestone(); - auto min_milestone = targeting.GetMinMilestone(); if (min_milestone && milestone < min_milestone) { return false; @@ -362,6 +361,11 @@ return false; } + const auto* user_locales = targeting.GetUserLocales(); + if (user_locales && !Contains(*user_locales, client_->GetUserLocale())) { + return false; + } + const auto registered_time_targeting = targeting.GetRegisteredTime(); if (!MatchRegisteredTime(registered_time_targeting)) { return false; @@ -413,15 +417,45 @@ /*target=*/base::Time::Now()); } -bool CampaignsMatcher::MatchTriggeringType( - const std::vector<TriggeringType>& trigger_targetings) const { +bool CampaignsMatcher::MatchTriggerTargeting( + const std::vector<std::unique_ptr<TriggerTargeting>>& trigger_targetings) + const { if (trigger_targetings.empty()) { // Campaigns matched if `trigger_targetings` is empty. return true; } for (const auto& trigger : trigger_targetings) { - if (trigger == trigger_) { + auto trigger_type = trigger->GetTriggerType(); + if (!trigger_type) { + // Ignore if trigger type is missing from the targeting. + // TODO: b/341374525 - Record the error when the trigger type is missing. + continue; + } + + // TODO: b/330931877 - Add bounds check for casting to enum from value in + // campaign. + if (trigger_.type != static_cast<TriggerType>(trigger_type.value())) { + continue; + } + + // Only `kEvent` trigger needs to check event name, so other trigger type + // is matched at this point. + if (trigger_.type != TriggerType::kEvent) { + return true; + } + + const base::Value::List* trigger_events = trigger->GetTriggerEvents(); + if (!trigger_events) { + // If the trigger type is `kEvent`, but the `trigger_events` is not valid, + // does not match. + // TODO: b/341164013 - Add new specific error type for this case. + RecordCampaignsManagerError(CampaignsManagerError::kInvalidTrigger); + LOG(ERROR) << "Invalid trigger events, requires a list of strings."; + continue; + } + + if (Contains(*trigger_events, trigger_.event)) { return true; } } @@ -600,7 +634,7 @@ return true; } - return MatchTriggeringType(targeting.GetTriggers()) && + return MatchTriggerTargeting(targeting.GetTriggers()) && MatchSchedulings(targeting.GetSchedulings()) && MatchOpenedApp(targeting.GetAppsOpened()) && MatchActiveUrlRegexes(targeting.GetActiveUrlRegexes()) &&
diff --git a/chromeos/ash/components/growth/campaigns_matcher.h b/chromeos/ash/components/growth/campaigns_matcher.h index c819a43..c7ad0a2 100644 --- a/chromeos/ash/components/growth/campaigns_matcher.h +++ b/chromeos/ash/components/growth/campaigns_matcher.h
@@ -33,7 +33,7 @@ void SetOpenedApp(const std::string& app_id); void SetOobeCompleteTime(base::Time time); - void SetTrigger(TriggeringType trigger); + void SetTrigger(const Trigger&& trigger); const GURL& active_url() const { return active_url_; } void SetActiveUrl(const GURL& url); @@ -58,7 +58,8 @@ bool MatchExperimentTagTargeting(const base::Value::List* targeting) const; bool MatchOpenedApp(const std::vector<std::unique_ptr<AppTargeting>>& apps_opened_targeting) const; - bool MatchTriggeringType(const std::vector<TriggeringType>& triggers) const; + bool MatchTriggerTargeting( + const std::vector<std::unique_ptr<TriggerTargeting>>& triggers) const; bool MatchActiveUrlRegexes( const std::vector<std::string>& active_url_regrexes) const; bool MatchSessionTargeting(const SessionTargeting& targeting) const; @@ -86,7 +87,7 @@ GURL active_url_; base::Time oobe_compelete_time_; bool is_user_owner_ = false; - std::optional<TriggeringType> trigger_; + Trigger trigger_{TriggerType::kUnSpecified}; }; } // namespace growth
diff --git a/chromeos/ash/components/growth/campaigns_model.cc b/chromeos/ash/components/growth/campaigns_model.cc index 8978a73..b217780 100644 --- a/chromeos/ash/components/growth/campaigns_model.cc +++ b/chromeos/ash/components/growth/campaigns_model.cc
@@ -46,7 +46,8 @@ // Device Targeting paths. inline constexpr char kDeviceTargeting[] = "device"; -inline constexpr char kDeviceLocales[] = "locales"; +inline constexpr char kApplicationLocales[] = "locales"; +inline constexpr char kUserLocales[] = "userLocales"; inline constexpr char kMinMilestone[] = "milestone.min"; inline constexpr char kMaxMilestone[] = "milestone.max"; inline constexpr char kFeatureAware[] = "isFeatureAwareDevice"; @@ -75,7 +76,11 @@ inline constexpr char kRuntimeTargeting[] = "runtime"; // Trigger Targeting paths. -inline constexpr char kTriggerTargetings[] = "triggers"; +// Path `triggers` was used in M126 and has been deprecated since M127. +// Path `triggersList` was added for M127. +inline constexpr char kTriggerTargetings[] = "triggerList"; +inline constexpr char kTriggerType[] = "triggerType"; +inline constexpr char kTriggerEvents[] = "triggerEvents"; // Scheduling Targeting paths. inline constexpr char kSchedulingTargetings[] = "schedulings"; @@ -146,6 +151,8 @@ } // namespace +Trigger::Trigger(TriggerType type) : type(type) {} + Campaigns* GetMutableCampaignsBySlot(CampaignsPerSlot* campaigns_per_slot, Slot slot) { if (!campaigns_per_slot) { @@ -279,7 +286,11 @@ DeviceTargeting::~DeviceTargeting() = default; const base::Value::List* DeviceTargeting::GetLocales() const { - return GetListCriteria(kDeviceLocales); + return GetListCriteria(kApplicationLocales); +} + +const base::Value::List* DeviceTargeting::GetUserLocales() const { + return GetListCriteria(kUserLocales); } const std::optional<int> DeviceTargeting::GetMinMilestone() const { @@ -344,6 +355,20 @@ return config_dict_->FindList(kEventsConditions); } +// Trigger Targeting. +TriggerTargeting::TriggerTargeting(const base::Value::Dict* trigger_dict) + : trigger_dict_(trigger_dict) {} + +TriggerTargeting::~TriggerTargeting() = default; + +std::optional<int> TriggerTargeting::GetTriggerType() const { + return trigger_dict_->FindInt(kTriggerType); +} + +const base::Value::List* TriggerTargeting::GetTriggerEvents() const { + return trigger_dict_->FindList(kTriggerEvents); +} + // Time window Targeting. TimeWindowTargeting::TimeWindowTargeting( const base::Value::Dict* time_window_dict) @@ -411,12 +436,12 @@ const std::vector<std::unique_ptr<TimeWindowTargeting>> RuntimeTargeting::GetSchedulings() const { std::vector<std::unique_ptr<TimeWindowTargeting>> schedulings; - auto* scheduling_dicts = GetListCriteria(kSchedulingTargetings); - if (!scheduling_dicts) { + auto* scheduling_list = GetListCriteria(kSchedulingTargetings); + if (!scheduling_list) { return schedulings; } - for (auto& scheduling_dict : *scheduling_dicts) { + for (auto& scheduling_dict : *scheduling_list) { if (!scheduling_dict.is_dict()) { // Ignore invalid scheduling. RecordCampaignsManagerError(CampaignsManagerError::kInvalidScheduling); @@ -428,27 +453,6 @@ return schedulings; } -const std::vector<TriggeringType> RuntimeTargeting::GetTriggers() const { - std::vector<TriggeringType> triggers; - auto* triggers_list = GetListCriteria(kTriggerTargetings); - if (!triggers_list) { - return triggers; - } - - for (auto& trigger : *triggers_list) { - if (!trigger.is_int()) { - // Ignore invalid trigger. - RecordCampaignsManagerError(CampaignsManagerError::kInvalidTrigger); - continue; - } - - // TODO: b/330931877 - Add bounds check for casting to enum from value in - // campaign payload. - triggers.push_back(static_cast<TriggeringType>(trigger.GetInt())); - } - return triggers; -} - const std::vector<std::unique_ptr<AppTargeting>> RuntimeTargeting::GetAppsOpened() const { std::vector<std::unique_ptr<AppTargeting>> app_targetings; @@ -499,6 +503,26 @@ return std::make_unique<EventsTargeting>(config); } +const std::vector<std::unique_ptr<TriggerTargeting>> +RuntimeTargeting::GetTriggers() const { + std::vector<std::unique_ptr<TriggerTargeting>> triggers; + auto* triggers_list = GetListCriteria(kTriggerTargetings); + if (!triggers_list) { + return triggers; + } + + for (const auto& trigger : *triggers_list) { + if (!trigger.is_dict()) { + // Ignore invalid trigger. + RecordCampaignsManagerError(CampaignsManagerError::kInvalidTrigger); + continue; + } + + triggers.push_back(std::make_unique<TriggerTargeting>(&trigger.GetDict())); + } + return triggers; +} + // Action. Action::Action(const base::Value::Dict* action_dict) : action_dict_(action_dict) {}
diff --git a/chromeos/ash/components/growth/campaigns_model.h b/chromeos/ash/components/growth/campaigns_model.h index 53496fa..9ff1fa5 100644 --- a/chromeos/ash/components/growth/campaigns_model.h +++ b/chromeos/ash/components/growth/campaigns_model.h
@@ -40,14 +40,6 @@ // These values are deserialized from Growth Campaign, so entries should not // be renumbered and numeric values should never be reused. -enum class TriggeringType { - kAppOpened = 0, - kCampaignsLoaded = 1, - kMaxValue = kCampaignsLoaded -}; - -// These values are deserialized from Growth Campaign, so entries should not -// be renumbered and numeric values should never be reused. enum class BuiltInIcon { kRedeem, kContainerApp, kG1 }; // Supported window anchor element. @@ -57,6 +49,28 @@ kCaptionButtonContainer = 0, }; +// These values are deserialized from Growth Campaign, so entries should not +// be renumbered and numeric values should never be reused. +enum class TriggerType { + // TODO: b/340950978 - Remove when pass the trigger in GetCampaignsBySlot(). + kUnSpecified = -1, + kAppOpened = 0, + kCampaignsLoaded = 1, + kEvent = 2, + kMaxValue = kEvent +}; + +class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_GROWTH) Trigger { + public: + explicit Trigger(TriggerType type); + + TriggerType type; + + // `event` is only used for `kEvent` trigger, which needs to be matched with + // one of the event name in the `triggerEvents` in the `TriggerTargeting`. + std::string event; +}; + // Dictionary of supported targetings. For example: // { // "demoMode" : {...}, @@ -232,6 +246,7 @@ ~DeviceTargeting(); const base::Value::List* GetLocales() const; + const base::Value::List* GetUserLocales() const; const std::optional<int> GetMinMilestone() const; const std::optional<int> GetMaxMilestone() const; const std::optional<bool> GetFeatureAwareDevice() const; @@ -315,6 +330,27 @@ raw_ptr<const base::Value::Dict> config_dict_; }; +// Wrapper around trigger targeting dictionary. +// +// The structure looks like: +// { +// "triggerType": 0, +// "triggerEvents": ["a", "b"] +// } +class TriggerTargeting { + public: + explicit TriggerTargeting(const base::Value::Dict* app); + TriggerTargeting(const TriggerTargeting&) = delete; + TriggerTargeting& operator=(const TriggerTargeting) = delete; + ~TriggerTargeting(); + + std::optional<int> GetTriggerType() const; + const base::Value::List* GetTriggerEvents() const; + + private: + raw_ptr<const base::Value::Dict> trigger_dict_; +}; + // Wrapper around runtime targeting dictionary. // // The structure looks like: @@ -335,15 +371,15 @@ const std::vector<std::unique_ptr<TimeWindowTargeting>> GetSchedulings() const; - // Returns a list of triggers against the current trigger, e.g. `AppOpened`. - const std::vector<TriggeringType> GetTriggers() const; - // Returns a list of apps to be matched against the current opened app. const std::vector<std::unique_ptr<AppTargeting>> GetAppsOpened() const; const std::vector<std::string> GetActiveUrlRegexes() const; std::unique_ptr<EventsTargeting> GetEventsConfig() const; + + // Returns a list of triggers against the current trigger, e.g. `kAppOpened`. + const std::vector<std::unique_ptr<TriggerTargeting>> GetTriggers() const; }; // Wrapper around the action dictionary for performing an action, including
diff --git a/chromeos/ash/components/growth/mock_campaigns_manager_client.h b/chromeos/ash/components/growth/mock_campaigns_manager_client.h index 3f03bf58..bee91dc 100644 --- a/chromeos/ash/components/growth/mock_campaigns_manager_client.h +++ b/chromeos/ash/components/growth/mock_campaigns_manager_client.h
@@ -29,6 +29,7 @@ MOCK_METHOD(bool, IsCloudGamingDevice, (), (const, override)); MOCK_METHOD(bool, IsFeatureAwareDevice, (), (const, override)); MOCK_METHOD(std::string&, GetApplicationLocale, (), (const, override)); + MOCK_METHOD(std::string&, GetUserLocale, (), (const, override)); MOCK_METHOD(const base::Version&, GetDemoModeAppVersion, (),
diff --git a/chromeos/ash/components/login/auth/auth_session_authenticator.cc b/chromeos/ash/components/login/auth/auth_session_authenticator.cc index bf9f852..5a817e2 100644 --- a/chromeos/ash/components/login/auth/auth_session_authenticator.cc +++ b/chromeos/ash/components/login/auth/auth_session_authenticator.cc
@@ -85,7 +85,7 @@ CompleteLoginImpl(ephemeral, std::move(user_context)); } -// Implementation part, shared by CompleteLogin and ResyncEncryptedData. +// Implementation part, called by CompleteLogin. void AuthSessionAuthenticator::CompleteLoginImpl( bool ephemeral, std::unique_ptr<UserContext> context) { @@ -783,85 +783,6 @@ NOTIMPLEMENTED(); } -void AuthSessionAuthenticator::RecoverEncryptedData( - std::unique_ptr<UserContext> context, - const std::string& old_password) { - DCHECK(context); - DCHECK(!context->GetAuthSessionId().empty()); - LOGIN_LOG(USER) << "Attempting to update user password"; - - auto* password_factor = - context->GetAuthFactorsData().FindOnlinePasswordFactor(); - DCHECK(password_factor); - std::string key_label = password_factor->ref().label().value(); - - if (!context->HasReplacementKey()) { - // Assume that there was an attempt to use the key, so it is was already - // hashed. - DCHECK(context->GetKey()->GetKeyType() != Key::KEY_TYPE_PASSWORD_PLAIN); - // Make sure that the key has correct label. - context->GetKey()->SetLabel(key_label); - context->SaveKeyForReplacement(); - } - - Key auth_key(old_password); - auth_key.SetLabel(key_label); - context->SetKey(auth_key); - - AuthErrorCallback error_callback = base::BindOnce( - &AuthSessionAuthenticator::ProcessCryptohomeError, - weak_factory_.GetWeakPtr(), AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME); - - // Existing users might require encryption migration: intercept related - // error codes. - error_callback = - base::BindOnce(&AuthSessionAuthenticator::HandleMigrationRequired, - weak_factory_.GetWeakPtr(), std::move(error_callback)); - // As we are in password change flow, all auth failures should be handled - // as password changed errors to be redirected correctly. - error_callback = - base::BindOnce(&AuthSessionAuthenticator::HandlePasswordChangeDetected, - weak_factory_.GetWeakPtr(), std::move(error_callback)); - - AuthSuccessCallback success_callback = base::BindOnce( - &AuthSessionAuthenticator::NotifyAuthSuccess, weak_factory_.GetWeakPtr()); - - std::vector<AuthOperation> steps; - steps.push_back(base::BindOnce(&AuthPerformer::AuthenticateUsingKnowledgeKey, - auth_performer_->AsWeakPtr())); - steps.push_back(base::BindOnce(&AuthFactorEditor::ReplaceContextKey, - auth_factor_editor_->AsWeakPtr())); - steps.push_back(base::BindOnce(&MountPerformer::MountPersistentDirectory, - mount_performer_->AsWeakPtr())); - if (safe_mode_delegate_->IsSafeMode()) { - steps.push_back( - base::BindOnce(&AuthSessionAuthenticator::CheckOwnershipOperation, - weak_factory_.GetWeakPtr())); - } - RunOperationChain(std::move(context), std::move(steps), - std::move(success_callback), std::move(error_callback)); -} - -void AuthSessionAuthenticator::ResyncEncryptedData( - bool ephemeral, - std::unique_ptr<UserContext> context) { - LOGIN_LOG(USER) << "Re-create cryptohome"; - - AuthErrorCallback error_callback = base::BindOnce( - &AuthSessionAuthenticator::ProcessCryptohomeError, - weak_factory_.GetWeakPtr(), AuthFailure::DATA_REMOVAL_FAILED); - - AuthSuccessCallback success_callback = - base::BindOnce(&AuthSessionAuthenticator::CompleteLoginImpl, - weak_factory_.GetWeakPtr(), ephemeral); - - std::vector<AuthOperation> steps; - steps.push_back(base::BindOnce(&MountPerformer::RemoveUserDirectory, - mount_performer_->AsWeakPtr())); - RunOperationChain(std::move(context), std::move(steps), - std::move(success_callback), std::move(error_callback)); -} - void AuthSessionAuthenticator::PrepareForNewAttempt( const std::string& method_id, const std::string& long_desc) {
diff --git a/chromeos/ash/components/login/auth/auth_session_authenticator.h b/chromeos/ash/components/login/auth/auth_session_authenticator.h index 4c6f305..5631eb8 100644 --- a/chromeos/ash/components/login/auth/auth_session_authenticator.h +++ b/chromeos/ash/components/login/auth/auth_session_authenticator.h
@@ -95,10 +95,6 @@ void LoginAuthenticated(std::unique_ptr<UserContext> user_context) override; void OnAuthSuccess() override; void OnAuthFailure(const AuthFailure& error) override; - void RecoverEncryptedData(std::unique_ptr<UserContext> user_context, - const std::string& old_password) override; - void ResyncEncryptedData(bool ephemeral, - std::unique_ptr<UserContext> user_context) override; protected: ~AuthSessionAuthenticator() override;
diff --git a/chromeos/ash/components/login/auth/authenticator.h b/chromeos/ash/components/login/auth/authenticator.h index 9785ee28..78617ca4 100644 --- a/chromeos/ash/components/login/auth/authenticator.h +++ b/chromeos/ash/components/login/auth/authenticator.h
@@ -91,23 +91,6 @@ // Must be called on the UI thread. virtual void OnAuthFailure(const AuthFailure& error) = 0; - // Call these methods on the UI thread. - // If a password logs the user in online, but cannot be used to - // mount their cryptohome, we expect that a password change has - // occurred. - // Call this method to migrate the user's encrypted data - // forward to use their new password. |old_password| is the password - // their data was last encrypted with. - // |user_context| contains key with new password to be set up. - virtual void RecoverEncryptedData(std::unique_ptr<UserContext> user_context, - const std::string& old_password) = 0; - - // Call this method to erase the user's encrypted data - // and create a new cryptohome. - virtual void ResyncEncryptedData( - bool ephemeral, - std::unique_ptr<UserContext> user_context) = 0; - // Sets consumer explicitly. void SetConsumer(AuthStatusConsumer* consumer);
diff --git a/chromeos/ash/components/login/auth/login_performer.cc b/chromeos/ash/components/login/auth/login_performer.cc index e8f3afa9..708ede8 100644 --- a/chromeos/ash/components/login/auth/login_performer.cc +++ b/chromeos/ash/components/login/auth/login_performer.cc
@@ -268,22 +268,6 @@ authenticator_->LoginAuthenticated(std::move(user_context)); } -void LoginPerformer::RecoverEncryptedData(const std::string& old_password) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - authenticator_->RecoverEncryptedData( - std::make_unique<UserContext>(user_context_), old_password); - user_context_.ClearSecrets(); -} - -void LoginPerformer::ResyncEncryptedData() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - authenticator_->ResyncEncryptedData( - user_manager::UserManager::Get()->IsEphemeralAccountId( - user_context_.GetAccountId()), - std::make_unique<UserContext>(user_context_)); - user_context_.ClearSecrets(); -} - //////////////////////////////////////////////////////////////////////////////// // LoginPerformer, private:
diff --git a/chromeos/ash/components/login/auth/login_performer.h b/chromeos/ash/components/login/auth/login_performer.h index 2e182378..0136f5e 100644 --- a/chromeos/ash/components/login/auth/login_performer.h +++ b/chromeos/ash/components/login/auth/login_performer.h
@@ -103,12 +103,6 @@ void OnLocalAuthenticationRequired( std::unique_ptr<UserContext> user_context) override; - // Migrates cryptohome using |old_password| specified. - void RecoverEncryptedData(const std::string& old_password); - - // Reinitializes cryptohome with the new password. - void ResyncEncryptedData(); - // Returns latest auth error. const GoogleServiceAuthError& error() const { return last_login_failure_.error();
diff --git a/chromeos/ash/components/login/auth/stub_authenticator.cc b/chromeos/ash/components/login/auth/stub_authenticator.cc index 067a760..8658437 100644 --- a/chromeos/ash/components/login/auth/stub_authenticator.cc +++ b/chromeos/ash/components/login/auth/stub_authenticator.cc
@@ -178,27 +178,6 @@ consumer_->OnAuthFailure(failure); } -void StubAuthenticator::RecoverEncryptedData( - std::unique_ptr<UserContext> user_context, - const std::string& old_password) { - if (old_password_ != old_password) { - task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&StubAuthenticator::OnPasswordChangeDetected, this)); - return; - } - - task_runner_->PostTask( - FROM_HERE, base::BindOnce(&StubAuthenticator::OnAuthSuccess, this)); -} - -void StubAuthenticator::ResyncEncryptedData( - bool ephemeral, - std::unique_ptr<UserContext> user_context) { - task_runner_->PostTask( - FROM_HERE, base::BindOnce(&StubAuthenticator::OnAuthSuccess, this)); -} - void StubAuthenticator::LoginAuthenticated( std::unique_ptr<UserContext> user_context) { consumer_->OnAuthSuccess(*user_context);
diff --git a/chromeos/ash/components/login/auth/stub_authenticator.h b/chromeos/ash/components/login/auth/stub_authenticator.h index 321977907..2f29832 100644 --- a/chromeos/ash/components/login/auth/stub_authenticator.h +++ b/chromeos/ash/components/login/auth/stub_authenticator.h
@@ -49,10 +49,6 @@ void LoginAuthenticated(std::unique_ptr<UserContext> user_context) override; void OnAuthSuccess() override; void OnAuthFailure(const AuthFailure& failure) override; - void RecoverEncryptedData(std::unique_ptr<UserContext> user_context, - const std::string& old_password) override; - void ResyncEncryptedData(bool ephemeral, - std::unique_ptr<UserContext> user_context) override; void SetExpectedCredentials(const UserContext& user_context);
diff --git a/chromeos/components/cdm_factory_daemon/chromeos_cdm_factory.cc b/chromeos/components/cdm_factory_daemon/chromeos_cdm_factory.cc index 43a2bf8..58897553 100644 --- a/chromeos/components/cdm_factory_daemon/chromeos_cdm_factory.cc +++ b/chromeos/components/cdm_factory_daemon/chromeos_cdm_factory.cc
@@ -164,8 +164,7 @@ std::string err; switch (result) { case cdm::mojom::CdmFactory::CreateCdmStatus::kSuccess: - base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), std::move(cdm), "")); + std::move(callback).Run(std::move(cdm), ""); return; case cdm::mojom::CdmFactory::CreateCdmStatus::kNoMoreInstances: err = "Only one instance allowed"; @@ -174,8 +173,7 @@ err = "Insufficient GPU memory available"; break; } - base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), nullptr, err)); + std::move(callback).Run(nullptr, err); } } // namespace @@ -413,7 +411,8 @@ cdm->GetClientInterface(), std::move(storage_remote), std::move(output_protection_remote), cdm_origin.host(), std::move(cros_cdm_pending_receiver), - base::BindOnce(&OnCdmCreated, std::move(cdm_created_cb), std::move(cdm))); + base::BindPostTaskToCurrentDefault(base::BindOnce( + &OnCdmCreated, std::move(cdm_created_cb), std::move(cdm)))); } void ChromeOsCdmFactory::OnFactoryMojoConnectionError() {
diff --git a/chromeos/components/mahi/public/cpp/mahi_media_app_events_proxy.cc b/chromeos/components/mahi/public/cpp/mahi_media_app_events_proxy.cc index 599b48d7..5edc5e75 100644 --- a/chromeos/components/mahi/public/cpp/mahi_media_app_events_proxy.cc +++ b/chromeos/components/mahi/public/cpp/mahi_media_app_events_proxy.cc
@@ -35,7 +35,7 @@ MahiMediaAppEventsProxy* proxy) { // Only allow one scoped instance at a time. if (instance_) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return; } instance_ = this; @@ -47,7 +47,7 @@ ScopedMahiMediaAppEventsProxySetter::~ScopedMahiMediaAppEventsProxySetter() { if (instance_ != this) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return; }
diff --git a/chromeos/crosapi/mojom/BUILD.gn b/chromeos/crosapi/mojom/BUILD.gn index 2942542..4414696a 100644 --- a/chromeos/crosapi/mojom/BUILD.gn +++ b/chromeos/crosapi/mojom/BUILD.gn
@@ -50,6 +50,7 @@ "emoji_picker.mojom", "extension_info_private.mojom", "extension_keeplist.mojom", + "extension_printer.mojom", "eye_dropper.mojom", "feedback.mojom", "field_trial.mojom",
diff --git a/chromeos/crosapi/mojom/crosapi.mojom b/chromeos/crosapi/mojom/crosapi.mojom index a268772..1f64c3d7 100644 --- a/chromeos/crosapi/mojom/crosapi.mojom +++ b/chromeos/crosapi/mojom/crosapi.mojom
@@ -48,6 +48,7 @@ import "chromeos/crosapi/mojom/emoji_picker.mojom"; import "chromeos/crosapi/mojom/extension_info_private.mojom"; import "chromeos/crosapi/mojom/extension_keeplist.mojom"; +import "chromeos/crosapi/mojom/extension_printer.mojom"; import "chromeos/crosapi/mojom/eye_dropper.mojom"; import "chromeos/crosapi/mojom/feedback.mojom"; import "chromeos/crosapi/mojom/field_trial.mojom"; @@ -165,8 +166,8 @@ // please note the milestone when you added it, to help us reason about // compatibility between the client applications and older ash-chrome binaries. // -// Next version: 139 -// Next method id: 141 +// Next version: 140 +// Next method id: 142 [Stable, Uuid="8b79c34f-2bf8-4499-979a-b17cac522c1e", RenamedFrom="crosapi.mojom.AshChromeService"] interface Crosapi { @@ -392,6 +393,11 @@ [MinVersion=72] BindExtensionInfoPrivate@75( pending_receiver<ExtensionInfoPrivate> receiver); + // Binds the ExtensionPrinterService which gives ash access to lacros + // extension printers. + [MinVersion=139] BindExtensionPrinterService@141( + pending_receiver<ExtensionPrinterService> receiver); + // Deprecated in M114; use chromeos::FirewallHole directly. [MinVersion=101] REMOVED_105@105( pending_receiver<FirewallHoleServiceDeprecated> receiver);
diff --git a/chromeos/crosapi/mojom/extension_printer.mojom b/chromeos/crosapi/mojom/extension_printer.mojom new file mode 100644 index 0000000..d8e1653 --- /dev/null +++ b/chromeos/crosapi/mojom/extension_printer.mojom
@@ -0,0 +1,48 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module crosapi.mojom; + +import "mojo/public/mojom/base/unguessable_token.mojom"; +import "mojo/public/mojom/base/values.mojom"; + +// Interface between the Ash system and lacros browser. Implemented in Ash, +// Interface to allow lacros-chrome to register a service provider and to +// communicate with ash to report extension printers. +// Implemented by ash-chrome. +// +// Next version: 1. +// Next method id: 2. +[Stable, Uuid="def89e7c-8e4f-4718-92db-24f1329fcd29"] +interface ExtensionPrinterService { + // An ExtensionPrinterServiceProvider can register itself with + // ExtensionPrinterService, so that ExtensionPrinterService can communicate + // with the remote ExtensionPrinterServiceProvider associated with the main + // profile. + RegisterServiceProvider@0( + pending_remote<ExtensionPrinterServiceProvider> client); + + // Runs when a printing extension reports printers in response to a + // DispatchGetPrintersRequest. A true value of |is_done| means no more + // printers will be reported. + PrintersAdded@1(mojo_base.mojom.UnguessableToken request_id, + mojo_base.mojom.ListValue printers, bool is_done); +}; + +// Implemented by lacros-chrome. Used by ash-chrome to forward printing related +// requests to lacros-chrome. +// +// Next version: 1. +// Next method id: 1. +[Stable, Uuid="74d95a4e-56e3-4fdf-8df5-62660939dc73"] +interface ExtensionPrinterServiceProvider { + // Dispatch StartGetPrinters requests to lacros from ash-chrome. The + // |request_id| will be used when reporting printers back to ash-chrome by + // lacros printing extensions. + DispatchGetPrintersRequest@0(mojo_base.mojom.UnguessableToken request_id); + // TODO(http://b/40273973): Add Reset(). + // TODO(http://b/40273973): Add DispatchStartGetCapability(). + // TODO(http://b/40273973): Add DispatchStartPrint(). + // TODO(http://b/40273973): Add DispatchStartGrantPrinterAccess(). +};
diff --git a/chromeos/crosapi/mojom/feedback.mojom b/chromeos/crosapi/mojom/feedback.mojom index 2e003db3..f1c33a45 100644 --- a/chromeos/crosapi/mojom/feedback.mojom +++ b/chromeos/crosapi/mojom/feedback.mojom
@@ -11,7 +11,7 @@ // Note: When you add a new value, please add a test case accordingly in: // chrome/browser/feedback/show_feedback_page_lacros_browertest.cc. // -// Next MinVersion: 6 +// Next MinVersion: 7 // Next ID: 9 // [Stable, Extensible] @@ -30,6 +30,7 @@ [MinVersion=5] kFeedbackSourceProfileErrorDialog = 10, [MinVersion=5] kFeedbackSourceQuickOffice=11, [MinVersion=6] kFeedbackSourceAI=12, + [MinVersion=7] kFeedbackSourceLensOverlay=13, }; [Stable]
diff --git a/chromeos/dbus/power/fake_power_manager_client.cc b/chromeos/dbus/power/fake_power_manager_client.cc index e61dd45..cafa238 100644 --- a/chromeos/dbus/power/fake_power_manager_client.cc +++ b/chromeos/dbus/power/fake_power_manager_client.cc
@@ -126,9 +126,17 @@ render_process_manager_delegate_ = delegate; } -void FakePowerManagerClient::DecreaseScreenBrightness(bool allow_off) {} +void FakePowerManagerClient::DecreaseScreenBrightness(bool allow_off) { + // Simulate the real behavior of the platform by disabling the ambient light + // sensor when the brightness is manually changed. + SetAmbientLightSensorEnabled(false); +} -void FakePowerManagerClient::IncreaseScreenBrightness() {} +void FakePowerManagerClient::IncreaseScreenBrightness() { + // Simulate the real behavior of the platform by disabling the ambient light + // sensor when the brightness is manually changed. + SetAmbientLightSensorEnabled(false); +} void FakePowerManagerClient::SetScreenBrightness( const power_manager::SetBacklightBrightnessRequest& request) { @@ -143,6 +151,10 @@ FROM_HERE, base::BindOnce(&FakePowerManagerClient::SendScreenBrightnessChanged, weak_ptr_factory_.GetWeakPtr(), change)); + + // Simulate the real behavior of the platform by disabling the ambient light + // sensor when the brightness is manually changed. + SetAmbientLightSensorEnabled(false); } void FakePowerManagerClient::GetScreenBrightnessPercent(
diff --git a/chromeos/lacros/lacros_service.cc b/chromeos/lacros/lacros_service.cc index 186aa8e..2369947 100644 --- a/chromeos/lacros/lacros_service.cc +++ b/chromeos/lacros/lacros_service.cc
@@ -59,6 +59,7 @@ #include "chromeos/crosapi/mojom/embedded_accessibility_helper.mojom.h" #include "chromeos/crosapi/mojom/emoji_picker.mojom.h" #include "chromeos/crosapi/mojom/extension_info_private.mojom.h" +#include "chromeos/crosapi/mojom/extension_printer.mojom.h" #include "chromeos/crosapi/mojom/eye_dropper.mojom.h" #include "chromeos/crosapi/mojom/feedback.mojom.h" #include "chromeos/crosapi/mojom/field_trial.mojom.h" @@ -391,6 +392,10 @@ crosapi::mojom::ExtensionInfoPrivate, &crosapi::mojom::Crosapi::BindExtensionInfoPrivate, Crosapi::MethodMinVersions::kBindExtensionInfoPrivateMinVersion>(); + ConstructRemote< + crosapi::mojom::ExtensionPrinterService, + &crosapi::mojom::Crosapi::BindExtensionPrinterService, + Crosapi::MethodMinVersions::kBindExtensionPrinterServiceMinVersion>(); ConstructRemote<crosapi::mojom::EyeDropper, &crosapi::mojom::Crosapi::BindEyeDropper, Crosapi::MethodMinVersions::kBindEyeDropperMinVersion>();
diff --git a/chromeos/profiles/arm-exp.afdo.newest.txt b/chromeos/profiles/arm-exp.afdo.newest.txt index 017b1123..4dd446bb 100644 --- a/chromeos/profiles/arm-exp.afdo.newest.txt +++ b/chromeos/profiles/arm-exp.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-exp-126-6455.0-1715595660-benchmark-126.0.6477.0-r1-redacted.afdo.xz +chromeos-chrome-arm-exp-126-6455.0-1715595660-benchmark-127.0.6485.0-r2-redacted.afdo.xz
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index 504e1ae..cefef22 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-126-6422.19-1715600709-benchmark-127.0.6483.0-r1-redacted.afdo.xz +chromeos-chrome-arm-none-126-6422.19-1715600709-benchmark-127.0.6485.0-r2-redacted.afdo.xz
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 497657c3..6bcff2a 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-126-6455.0-1715595660-benchmark-127.0.6483.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-126-6455.0-1715595660-benchmark-127.0.6485.0-r2-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index 3d54f40f..6aa6bc4 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-126-6422.19-1715594232-benchmark-127.0.6483.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-126-6422.19-1715594232-benchmark-127.0.6485.0-r2-redacted.afdo.xz
diff --git a/clank b/clank index 9e0c16b..f9eff27 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 9e0c16ba7803a6362dc0f1504a171f38b08a8423 +Subproject commit f9eff279fd00590f59edbb76948b771ec10c9a36
diff --git a/components/account_manager_core/account_manager_facade_impl_unittest.cc b/components/account_manager_core/account_manager_facade_impl_unittest.cc index 578a595..c770ba6 100644 --- a/components/account_manager_core/account_manager_facade_impl_unittest.cc +++ b/components/account_manager_core/account_manager_facade_impl_unittest.cc
@@ -425,7 +425,7 @@ base::OnceCallback<void(const std::vector<Account>&)> dropped_callback = base::BindLambdaForTesting( [scoped_closure = std::move(scoped_closure)]( - const std::vector<Account>&) { NOTREACHED(); }); + const std::vector<Account>&) { NOTREACHED_IN_MIGRATION(); }); EXPECT_FALSE(callback_was_dropped); account_manager_facade->GetAccounts(std::move(dropped_callback)); // `dropped_callback` was destroyed without being run.
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index 242aaf2e..a70ebad 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -413,6 +413,13 @@ HidePopup(); } +// With the old focus behavior, the context menu may be opened in a +// contenteditable without AutofillDriverRouter in the browser process +// knowing about the contenteditable and therefore may have not known +// the frame. The old, hacky fix was to call +// `ShowSuggestionsForContentEditable()` in `HandleFocusChangeComplete()` +// even if `!focused_node_was_last_clicked`. This behavior has been removed +// in crrev.com/c/5502049 in the anticipation of `kAutofillNewFocusEvents`. void AutofillAgent::FocusedElementChangedDeprecated(const WebElement& element) { CHECK(!base::FeatureList::IsEnabled(features::kAutofillNewFocusEvents)); HidePopup(); @@ -1546,19 +1553,16 @@ } } - // TODO(crbug.com/1490372, b/308811729): This is not conditioned on - // `focused_node_was_last_clicked`. This has two advantages: - // - The AutofillDriverRouter is informed about the form and then can route - // ExtractForm() messages to the right frame. - // TODO(crbug.com/1490372, b/308811729): Check whether the context menu - // event arrives after this one. (Probably it does, analogously to the IME.) - // - On click into a nested contenteditable `focused_node_was_last_clicked` is - // false. The call comes from DidCompleteFocusChangeInFrame() which passes - // false since at the preceding DidReceiveLeftMouseDownOrGestureTapInNode() - // call `node.Focused()` was false. - ShowSuggestionsForContentEditable( - focused_element, - AutofillSuggestionTriggerSource::kContentEditableClicked); + // Preventing suggestions shown on contenteditable for right click or + // non-click focus. + // TODO(crbug.com/40284726): This seems to be redundant. Remove call to + // ShowSuggestionsForContentEditable. + if (focused_node_was_last_clicked || + !base::FeatureList::IsEnabled(features::kAutofillNewFocusEvents)) { + ShowSuggestionsForContentEditable( + focused_element, + AutofillSuggestionTriggerSource::kContentEditableClicked); + } } void AutofillAgent::SendFocusedInputChangedNotificationToBrowser(
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index d966ad5..af9b6c9 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn
@@ -892,6 +892,8 @@ "payments/mock_iban_access_manager.h", "payments/mock_test_payments_network_interface.cc", "payments/mock_test_payments_network_interface.h", + "payments/payments_network_interface_test_base.cc", + "payments/payments_network_interface_test_base.h", "payments/test/mock_mandatory_reauth_manager.cc", "payments/test/mock_mandatory_reauth_manager.h", "payments/test/mock_payments_window_manager.cc", @@ -989,6 +991,9 @@ "//components/translate/core/browser:test_support", "//components/ukm", "//components/ukm:test_support", + "//components/variations", + "//components/variations:test_support", + "//components/variations/net", "//components/version_info:version_info", "//google_apis:test_support", "//services/network:test_support", @@ -1191,8 +1196,6 @@ "payments/iban_save_manager_unittest.cc", "payments/legal_message_line_unittest.cc", "payments/payments_data_cleaner_unittest.cc", - "payments/payments_network_interface_test_base.cc", - "payments/payments_network_interface_test_base.h", "payments/payments_network_interface_unittest.cc", "payments/payments_requests/get_details_for_enrollment_request_unittest.cc", "payments/payments_requests/get_iban_upload_details_request_unittest.cc",
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index 881fe12..4afcd05 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -2508,17 +2508,7 @@ const FieldType trigger_field_type = trigger_autofill_field ? trigger_autofill_field->Type().GetStorableType() : UNKNOWN_TYPE; - if (!IsAddressType(trigger_field_type)) { - // Since Autofill was triggered from a field that is not classified as - // address, we consider the `field_types` (i.e, the fields found in the - // "form") to be a single unclassified field. Note that in this flow it is - // not used and only holds semantic value. - return suggestion_generator_->GetSuggestionsForProfiles( - /*field_types=*/{UNKNOWN_TYPE}, trigger_field, UNKNOWN_TYPE, - SuggestionType::kAddressEntry, trigger_source); - } - CHECK(IsAddressType(trigger_field_type)); SuggestionType current_suggestion_type = [&] { switch (external_delegate_->GetLastAcceptedSuggestionToFillForSection( trigger_autofill_field->section())) { @@ -2546,11 +2536,18 @@ case FieldTypeGroup::kUnfillable: case FieldTypeGroup::kIban: case FieldTypeGroup::kNoGroup: - // Since `trigger_field_type` is an address type: - NOTREACHED_NORETURN(); + // If Autofill was triggered from a field that is not classified as + // address, `current_suggestion_type` is irrelevant and we just use + // `SuggestionType::kAddressEntry` as a placeholder. + return SuggestionType::kAddressEntry; } NOTREACHED_NORETURN(); case SuggestionType::kAddressFieldByFieldFilling: + if (!IsAddressType(trigger_field_type)) { + // TODO(crbug.com/339543182): Is this special case reasonable? + // Shouldn't we continue with field-by-field filling? + return SuggestionType::kAddressEntry; + } return SuggestionType::kAddressFieldByFieldFilling; default: // `last_suggestion_type` is only one of the address filling suggestion @@ -2559,33 +2556,43 @@ } }(); - // Getting the filling-relevant fields so that suggestions are based only on - // those fields. Function BrowserAutofillManager::GetFieldFillingSkipReasons - // assumes that the passed FormData and FormStructure have the same size. If - // it's not the case we just assume as a fallback that all fields are - // relevant. - size_t num_fields = form_structure ? form_structure->field_count() : 0; - base::flat_map<FieldGlobalId, FieldFillingSkipReason> skip_reasons = - form_structure && form.fields.size() == num_fields - ? form_filler_->GetFieldFillingSkipReasons( - form, *form_structure, *trigger_autofill_field, - GetTargetFieldsForAddressFillingSuggestionType( - current_suggestion_type, trigger_field_type), - /*type_groups_originally_filled=*/std::nullopt, - FillingProduct::kAddress, - /*skip_unrecognized_autocomplete_fields=*/trigger_source != - AutofillSuggestionTriggerSource::kManualFallbackAddress, - /*is_refill=*/false, /*is_expired_credit_card=*/false) - : base::flat_map<FieldGlobalId, FieldFillingSkipReason>(); - FieldTypeSet field_types; - for (size_t i = 0; i < num_fields; ++i) { - const AutofillField* autofill_field = form_structure->field(i); - auto it = skip_reasons.find(autofill_field->global_id()); - if (it == skip_reasons.end() || - it->second == FieldFillingSkipReason::kNotSkipped) { - field_types.insert(autofill_field->Type().GetStorableType()); + FieldTypeSet field_types = [&] { + if (!IsAddressType(trigger_field_type)) { + // Since Autofill was triggered from a field that is not classified as + // address, we consider the `field_types` (i.e, the fields found in the + // "form") to be a single unclassified field. Note that in this flow it is + // not used and only holds semantic value. + // TODO(crbug.com/339543182): Is this special case reasonable? Shouldn't + // we pass the fields that are available? + return FieldTypeSet{UNKNOWN_TYPE}; } - } + // If the FormData and FormStructure do not have the same size, we assume + // as a fallback that all fields are fillable. + base::flat_map<FieldGlobalId, FieldFillingSkipReason> skip_reasons; + size_t num_fields = form_structure ? form_structure->field_count() : 0; + if (form_structure && form.fields.size() == num_fields) { + skip_reasons = form_filler_->GetFieldFillingSkipReasons( + form, *form_structure, *trigger_autofill_field, + GetTargetFieldsForAddressFillingSuggestionType( + current_suggestion_type, trigger_field_type), + /*type_groups_originally_filled=*/std::nullopt, + FillingProduct::kAddress, + /*skip_unrecognized_autocomplete_fields=*/trigger_source != + AutofillSuggestionTriggerSource::kManualFallbackAddress, + /*is_refill=*/false, /*is_expired_credit_card=*/false); + } + FieldTypeSet field_types; + for (size_t i = 0; i < num_fields; ++i) { + const AutofillField* autofill_field = form_structure->field(i); + auto it = skip_reasons.find(autofill_field->global_id()); + if (it == skip_reasons.end() || + it->second == FieldFillingSkipReason::kNotSkipped) { + field_types.insert(autofill_field->Type().GetStorableType()); + } + } + return field_types; + }(); + return suggestion_generator_->GetSuggestionsForProfiles( field_types, trigger_field, trigger_field_type, current_suggestion_type, trigger_source);
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc index b8aa599e4..ebc95377c 100644 --- a/components/bookmarks/browser/bookmark_codec.cc +++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -89,9 +89,20 @@ InitializeChecksum(); base::Value::Dict roots; - roots.Set(kBookmarkBarFolderNameKey, EncodeNode(bookmark_bar_node)); - roots.Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node)); - roots.Set(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node)); + + if (bookmark_bar_node) { + // If one permanent node is provided, all permanent nodes should have been + // provided. + CHECK(other_folder_node); + CHECK(mobile_folder_node); + roots.Set(kBookmarkBarFolderNameKey, EncodeNode(bookmark_bar_node)); + roots.Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node)); + roots.Set(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node)); + } else { + // No permanent node should have been provided. + CHECK(!other_folder_node); + CHECK(!mobile_folder_node); + } FinalizeChecksum(); // We are going to store the computed checksum. So set stored checksum to be @@ -113,6 +124,10 @@ const int64_t max_already_assigned_id = already_assigned_ids.empty() ? 0 : *already_assigned_ids.rbegin(); + if (sync_metadata_str) { + sync_metadata_str->clear(); + } + ids_ = std::move(already_assigned_ids); uuids_ = {base::Uuid::ParseLowercase(kRootNodeUuid), base::Uuid::ParseLowercase(kBookmarkBarNodeUuid), @@ -205,6 +220,14 @@ return false; } + if (sync_metadata_str) { + const std::string* sync_metadata_str_base64 = + value.FindString(kSyncMetadata); + if (sync_metadata_str_base64) { + base::Base64Decode(*sync_metadata_str_base64, sync_metadata_str); + } + } + const base::Value::Dict* roots = value.FindDict(kRootsKey); if (!roots) return false; // No roots, or invalid type for roots. @@ -222,13 +245,6 @@ DecodeNode(*other_folder_value, nullptr, other_folder_node); DecodeNode(*mobile_folder_value, nullptr, mobile_folder_node); - if (sync_metadata_str) { - const std::string* sync_metadata_str_base64 = - value.FindString(kSyncMetadata); - if (sync_metadata_str_base64) - base::Base64Decode(*sync_metadata_str_base64, sync_metadata_str); - } - // Need to reset the title as the title is persisted and restored from // the file. bb_node->SetTitle(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_FOLDER_NAME));
diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h index 9a5e6e4..60d33c5 100644 --- a/components/bookmarks/browser/bookmark_codec.h +++ b/components/bookmarks/browser/bookmark_codec.h
@@ -36,6 +36,9 @@ ~BookmarkCodec(); // Encodes the bookmark bar and other folders returning the JSON value. + // Either none or all permanent nodes must be null. The null case it useful to + // encode sync metadata only (which is useful in error cases, when a user may + // contain too many bookmarks in sync, server-side). base::Value::Dict Encode( const BookmarkNode* bookmark_bar_node, const BookmarkNode* other_folder_node,
diff --git a/components/bookmarks/browser/bookmark_codec_unittest.cc b/components/bookmarks/browser/bookmark_codec_unittest.cc index beb241e..8b114e0 100644 --- a/components/bookmarks/browser/bookmark_codec_unittest.cc +++ b/components/bookmarks/browser/bookmark_codec_unittest.cc
@@ -634,18 +634,48 @@ TEST_F(BookmarkCodecTest, EncodeAndDecodeSyncMetadata) { std::unique_ptr<BookmarkModel> model(CreateTestModel1()); - // Since metadata str serialized proto, it could contain no ASCII characters. + // Since metadata str serialized proto, it could contain non-ASCII characters. std::string sync_metadata_str("a/2'\""); std::string checksum; base::Value::Dict value = EncodeModel(model.get(), sync_metadata_str, &checksum); - std::string decoded_sync_metadata_str; // Decode and verify. + std::string decoded_sync_metadata_str; DecodeHelper(value, checksum, &checksum, false, &decoded_sync_metadata_str); EXPECT_EQ(sync_metadata_str, decoded_sync_metadata_str); } +TEST_F(BookmarkCodecTest, EncodeAndDecodeSyncMetadataWithoutPermanentNodes) { + // Since metadata str serialized proto, it could contain non-ASCII characters. + std::string sync_metadata_str("a/2'\""); + + BookmarkCodec encoder; + base::Value::Dict value(encoder.Encode(/*bookmark_bar_node=*/nullptr, + /*other_folder_node=*/nullptr, + /*mobile_folder_node=*/nullptr, + sync_metadata_str)); + const std::string& computed_checksum = encoder.ComputedChecksumForTest(); + const std::string& stored_checksum = encoder.StoredChecksumForTest(); + + // Computed and stored checksums should not be empty and should be equal. + EXPECT_FALSE(computed_checksum.empty()); + EXPECT_FALSE(stored_checksum.empty()); + EXPECT_EQ(computed_checksum, stored_checksum); + + // Decode and verify. + std::string decoded_sync_metadata_str; + BookmarkCodec decoder; + std::unique_ptr<BookmarkModel> model(TestBookmarkClient::CreateModel()); + + // Note that the decoder returns this as a failure case, although + // `decoded_sync_metadata_str` is still populated. + EXPECT_FALSE(Decode(&decoder, value, /*already_assigned_ids=*/{}, model.get(), + &decoded_sync_metadata_str)); + + EXPECT_EQ(sync_metadata_str, decoded_sync_metadata_str); +} + TEST_F(BookmarkCodecTest, EncodeAndDecodeGuid) { std::unique_ptr<BookmarkModel> model(CreateTestModel2());
diff --git a/components/bookmarks/browser/bookmark_model_unittest.cc b/components/bookmarks/browser/bookmark_model_unittest.cc index 3724fdf..f75f1c1 100644 --- a/components/bookmarks/browser/bookmark_model_unittest.cc +++ b/components/bookmarks/browser/bookmark_model_unittest.cc
@@ -2246,8 +2246,7 @@ // This is necessary to ensure the save completes. task_environment.FastForwardUntilNoTasksRemain(); - // Recreate the model and ensure GetBookmarksMatching() returns the url that - // was added. + // Recreate the model and ensure account nodes are loaded. model = std::make_unique<BookmarkModel>(std::make_unique<TestBookmarkClient>()); model->Load(tmp_dir.GetPath()); @@ -2261,6 +2260,52 @@ model->account_bookmark_bar_node()->children()[0]->url()); } +TEST(BookmarkModelLoadTest, AccountSyncMetadataPopulatedWithoutNodesOnLoad) { + base::test::ScopedFeatureList features{ + syncer::kEnableBookmarkFoldersForAccountStorage}; + + // Since metadata str serialized proto, it could contain non-ASCII characters. + const std::string sync_metadata_str("a/2'\""); + + // Create a model with one local-or-syncable url and no account bookmarks. + base::ScopedTempDir tmp_dir; + ASSERT_TRUE(tmp_dir.CreateUniqueTempDir()); + base::test::TaskEnvironment task_environment{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + + { + auto client = std::make_unique<TestBookmarkClient>(); + TestBookmarkClient* client_ptr = client.get(); + BookmarkModel model(std::move(client)); + model.Load(tmp_dir.GetPath()); + test::WaitForBookmarkModelToLoad(&model); + + ASSERT_EQ(nullptr, model.account_bookmark_bar_node()); + ASSERT_EQ(nullptr, model.account_other_node()); + ASSERT_EQ(nullptr, model.account_mobile_node()); + + client_ptr->SetAccountBookmarkSyncMetadataAndScheduleWrite( + sync_metadata_str); + + // This is necessary to ensure the save completes. + task_environment.FastForwardUntilNoTasksRemain(); + } + + // Recreate the model and ensure account sync metadata is passed to + // BookmarkClient although there are no account bookmarks. + auto client = std::make_unique<TestBookmarkClient>(); + TestBookmarkClient* client_ptr = client.get(); + BookmarkModel model(std::move(client)); + model.Load(tmp_dir.GetPath()); + test::WaitForBookmarkModelToLoad(&model); + + EXPECT_EQ(nullptr, model.account_bookmark_bar_node()); + EXPECT_EQ(nullptr, model.account_other_node()); + EXPECT_EQ(nullptr, model.account_mobile_node()); + + EXPECT_EQ(sync_metadata_str, client_ptr->account_bookmark_sync_metadata()); +} + TEST(BookmarkModelLoadTest, AccountNodesPopulatedOnLoadAsLocalOrSyncable) { const GURL node_url("http://google.com/"); base::test::TaskEnvironment task_environment{
diff --git a/components/bookmarks/browser/bookmark_storage.cc b/components/bookmarks/browser/bookmark_storage.cc index f3cde78..501828a 100644 --- a/components/bookmarks/browser/bookmark_storage.cc +++ b/components/bookmarks/browser/bookmark_storage.cc
@@ -47,15 +47,17 @@ model->bookmark_bar_node(), model->other_node(), model->mobile_node(), model->client()->EncodeLocalOrSyncableBookmarkSyncMetadata()); case BookmarkStorage::kSelectAccountNodes: - if (!model->account_bookmark_bar_node()) { + // Either all permanent folders or none should exist. + if (model->account_bookmark_bar_node()) { + CHECK(model->account_other_node()); + CHECK(model->account_mobile_node()); + } else { + // Encode the model even for the null-permanent-folder case in case + // there is sync metadata to persist (e.g. the notion of a user having + // too many bookmarks server-side). CHECK(!model->account_other_node()); CHECK(!model->account_mobile_node()); - return base::Value::Dict(); } - - CHECK(model->account_other_node()); - CHECK(model->account_mobile_node()); - return codec.Encode(model->account_bookmark_bar_node(), model->account_other_node(), model->account_mobile_node(),
diff --git a/components/bookmarks/browser/bookmark_storage_unittest.cc b/components/bookmarks/browser/bookmark_storage_unittest.cc index 9774c04..25897c7 100644 --- a/components/bookmarks/browser/bookmark_storage_unittest.cc +++ b/components/bookmarks/browser/bookmark_storage_unittest.cc
@@ -209,7 +209,7 @@ EXPECT_FALSE(file_content->empty()); } -TEST(BookmarkStorageTest, ShouldSaveEmptyFileToDiskIfAccountBookmarksEmpty) { +TEST(BookmarkStorageTest, ShouldSaveDespiteAccountBookmarksEmpty) { base::test::ScopedFeatureList features{ syncer::kEnableBookmarkFoldersForAccountStorage}; @@ -229,8 +229,10 @@ storage.ScheduleSave(); task_environment.FastForwardUntilNoTasksRemain(); - EXPECT_EQ(ReadFileToDict(bookmarks_file_path), - std::make_optional<base::Value::Dict>()); + std::optional<base::Value::Dict> file_content = + ReadFileToDict(bookmarks_file_path); + ASSERT_TRUE(file_content.has_value()); + EXPECT_FALSE(file_content->empty()); } } // namespace bookmarks
diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks/browser/model_loader.cc index 9a7de49..5dbf8af 100644 --- a/components/bookmarks/browser/model_loader.cc +++ b/components/bookmarks/browser/model_loader.cc
@@ -109,6 +109,11 @@ !loaded_account_bookmarks_file_as_local_or_syncable_bookmarks_for_uma); metrics::RecordIdsReassignedOnProfileLoad( metrics::StorageFileForUma::kAccount, codec.ids_reassigned()); + } else { + // In the failure case, it is still possible that sync metadata was + // decoded, which includes legit scenarios like sync metadata indicating + // that there were too many bookmarks in sync, server-side. + details->set_account_sync_metadata_str(std::move(sync_metadata_str)); } }
diff --git a/components/bookmarks/test/test_bookmark_client.cc b/components/bookmarks/test/test_bookmark_client.cc index f57ada3..b99dd08 100644 --- a/components/bookmarks/test/test_bookmark_client.cc +++ b/components/bookmarks/test/test_bookmark_client.cc
@@ -89,6 +89,12 @@ is_sync_feature_enabled_including_bookmarks_for_uma = value; } +void TestBookmarkClient::SetAccountBookmarkSyncMetadataAndScheduleWrite( + const std::string& account_bookmark_sync_metadata) { + account_bookmark_sync_metadata_ = account_bookmark_sync_metadata; + account_bookmark_sync_metadata_save_closure_.Run(); +} + LoadManagedNodeCallback TestBookmarkClient::GetLoadManagedNodeCallback() { return base::BindOnce(&TestBookmarkClient::LoadManagedNode, std::move(managed_node_)); @@ -112,7 +118,7 @@ } std::string TestBookmarkClient::EncodeAccountBookmarkSyncMetadata() { - return std::string(); + return account_bookmark_sync_metadata_; } void TestBookmarkClient::DecodeLocalOrSyncableBookmarkSyncMetadata( @@ -121,7 +127,10 @@ void TestBookmarkClient::DecodeAccountBookmarkSyncMetadata( const std::string& metadata_str, - const base::RepeatingClosure& schedule_save_closure) {} + const base::RepeatingClosure& schedule_save_closure) { + account_bookmark_sync_metadata_ = metadata_str; + account_bookmark_sync_metadata_save_closure_ = schedule_save_closure; +} base::CancelableTaskTracker::TaskId TestBookmarkClient::GetFaviconImageForPageURL(
diff --git a/components/bookmarks/test/test_bookmark_client.h b/components/bookmarks/test/test_bookmark_client.h index 6ceee9f..70972cb34 100644 --- a/components/bookmarks/test/test_bookmark_client.h +++ b/components/bookmarks/test/test_bookmark_client.h
@@ -11,6 +11,8 @@ #include <map> #include <memory> +#include "base/functional/callback.h" +#include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "components/bookmarks/browser/bookmark_client.h" @@ -67,6 +69,16 @@ // `IsSyncFeatureEnabledIncludingBookmarks()`. void SetIsSyncFeatureEnabledIncludingBookmarks(bool value); + // Returns sync metadata for account bookmarks, received via + // DecodeAccountBookmarkSyncMetadata() or modified via + // SetAccountBookmarkSyncMetadataAndScheduleWrite(). + const std::string& account_bookmark_sync_metadata() const { + return account_bookmark_sync_metadata_; + } + + void SetAccountBookmarkSyncMetadataAndScheduleWrite( + const std::string& account_bookmark_sync_metadata); + // BookmarkClient: LoadManagedNodeCallback GetLoadManagedNodeCallback() override; bool IsSyncFeatureEnabledIncludingBookmarks() override; @@ -107,6 +119,10 @@ requests_per_page_url_; bool is_sync_feature_enabled_including_bookmarks_for_uma = false; + + std::string account_bookmark_sync_metadata_; + base::RepeatingClosure account_bookmark_sync_metadata_save_closure_ = + base::DoNothing(); }; } // namespace bookmarks
diff --git a/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheet.java b/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheet.java index 6a6543b..ae8670a5 100644 --- a/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheet.java +++ b/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheet.java
@@ -1098,6 +1098,14 @@ return mContainerWidth; } + /** + * @return Whether the sheet covers the full width of the container, or is limited to only + * partial width. + */ + public boolean isFullWidth() { + return getMaxSheetWidth() >= mContainerWidth; + } + /** Center and size the sheet in its container. */ private void sizeAndPositionSheetInParent() { int maxSheetWidth = getMaxSheetWidth();
diff --git a/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetControllerImpl.java b/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetControllerImpl.java index e7bcffd..41127a48 100644 --- a/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetControllerImpl.java +++ b/components/browser_ui/bottomsheet/android/internal/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetControllerImpl.java
@@ -622,6 +622,11 @@ } @Override + public boolean isFullWidth() { + return mBottomSheet.isFullWidth(); + } + + @Override @VisibleForTesting public boolean isSmallScreen() { return mBottomSheet.isSmallScreen();
diff --git a/components/browser_ui/bottomsheet/android/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetController.java b/components/browser_ui/bottomsheet/android/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetController.java index bf2e83d..103b2ec 100644 --- a/components/browser_ui/bottomsheet/android/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetController.java +++ b/components/browser_ui/bottomsheet/android/java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetController.java
@@ -173,11 +173,17 @@ /** * @return The {@link BackPressHandler} that will handle a back press event when the bottom - * sheet is open or holds sheet content. + * sheet is open or holds sheet content. */ BackPressHandler getBottomSheetBackPressHandler(); /** + * @return Whether the sheet covers the full width of the container, or is limited to only + * partial width. + */ + boolean isFullWidth(); + + /** * @return Whether the bottom sheet is being shown on a small screen. This disables the half * sheet state. */
diff --git a/components/commerce/core/BUILD.gn b/components/commerce/core/BUILD.gn index e741d40..2e64ef5 100644 --- a/components/commerce/core/BUILD.gn +++ b/components/commerce/core/BUILD.gn
@@ -314,6 +314,7 @@ "//components/bookmarks/browser", "//components/bookmarks/test", "//components/commerce/core:proto", + "//components/commerce/core/compare:compare", "//components/commerce/core/subscriptions", "//components/optimization_guide/core", "//components/optimization_guide/proto:optimization_guide_proto",
diff --git a/components/commerce/core/mock_shopping_service.cc b/components/commerce/core/mock_shopping_service.cc index 7665bc9..d698077 100644 --- a/components/commerce/core/mock_shopping_service.cc +++ b/components/commerce/core/mock_shopping_service.cc
@@ -298,4 +298,10 @@ ON_CALL(*this, GetEntryPointInfoForNavigation) .WillByDefault(testing::Return(entry_point_info)); } + +void MockShoppingService::SetResponseForGetProductGroupForCandidateProduct( + std::optional<ProductGroup> product_group) { + ON_CALL(*this, GetProductGroupForCandidateProduct) + .WillByDefault(testing::Return(product_group)); +} } // namespace commerce
diff --git a/components/commerce/core/mock_shopping_service.h b/components/commerce/core/mock_shopping_service.h index 8656c22..da984fe7 100644 --- a/components/commerce/core/mock_shopping_service.h +++ b/components/commerce/core/mock_shopping_service.h
@@ -10,6 +10,7 @@ #include <vector> #include "components/bookmarks/browser/bookmark_model.h" +#include "components/commerce/core/compare/product_group.h" #include "components/commerce/core/shopping_service.h" #include "components/commerce/core/subscriptions/commerce_subscription.h" #include "services/network/public/cpp/shared_url_loader_factory.h" @@ -146,6 +147,10 @@ GetEntryPointInfoForNavigation, (GURL url), (override)); + MOCK_METHOD(std::optional<ProductGroup>, + GetProductGroupForCandidateProduct, + (const GURL& product_url), + (override)); // Make this mock permissive for all features but default to providing empty // data for all accessors of shopping data. @@ -188,6 +193,8 @@ std::optional<EntryPointInfo> entry_point_info); void SetResponseForGetEntryPointInfoForNavigation( std::optional<EntryPointInfo> entry_point_info); + void SetResponseForGetProductGroupForCandidateProduct( + std::optional<ProductGroup> product_group); private: // Since the discount API wants a const ref to some map, keep a default
diff --git a/components/commerce/core/shopping_service.cc b/components/commerce/core/shopping_service.cc index 46e2d8b..408b7c4 100644 --- a/components/commerce/core/shopping_service.cc +++ b/components/commerce/core/shopping_service.cc
@@ -25,6 +25,7 @@ #include "components/commerce/core/commerce_feature_list.h" #include "components/commerce/core/commerce_utils.h" #include "components/commerce/core/compare/cluster_manager.h" +#include "components/commerce/core/compare/product_group.h" #include "components/commerce/core/compare/product_specifications_server_proxy.h" #include "components/commerce/core/discounts_storage.h" #include "components/commerce/core/feature_utils.h" @@ -1788,6 +1789,14 @@ return cluster_manager_->GetEntryPointInfoForSelection(old_url, new_url); } +std::optional<ProductGroup> ShoppingService::GetProductGroupForCandidateProduct( + const GURL& product_url) { + if (!cluster_manager_) { + return std::nullopt; + } + return cluster_manager_->GetProductGroupForCandidateProduct(product_url); +} + void ShoppingService::AddClusterManagerObserver( ClusterManager::Observer* observer) { if (cluster_manager_) {
diff --git a/components/commerce/core/shopping_service.h b/components/commerce/core/shopping_service.h index e1ee25a..a61f9095 100644 --- a/components/commerce/core/shopping_service.h +++ b/components/commerce/core/shopping_service.h
@@ -121,6 +121,7 @@ class WebWrapper; enum class SubscriptionType; struct CommerceSubscription; +struct ProductGroup; // Types of shopping pages from backend. enum class ShoppingPageType { @@ -437,6 +438,8 @@ virtual std::optional<EntryPointInfo> GetEntryPointInfoForSelection( GURL old_url, GURL new_url); + virtual std::optional<ProductGroup> GetProductGroupForCandidateProduct( + const GURL& product_url); void AddClusterManagerObserver(ClusterManager::Observer* observer); void RemoveClusterManagerObserver(ClusterManager::Observer* observer);
diff --git a/components/compose/core/browser/compose_metrics.h b/components/compose/core/browser/compose_metrics.h index bfcc19e..c8b2761b 100644 --- a/components/compose/core/browser/compose_metrics.h +++ b/components/compose/core/browser/compose_metrics.h
@@ -208,6 +208,26 @@ kMaxValue = kRequestError, }; +// The output metric for the proactive nudge segmentation model. Represents what +// effect the nudge had on the user's engagement. Stored as +// "Compose.ProactiveNudge.DerivedEngagement". +enum class ProactiveNudgeDerivedEngagement { + // The user didn't interact with the nudge. + kIgnored, + // The user disabled the nudge on this site using the three-dot menu. + kNudgeDisabledOnSingleSite, + // The user disabled the nudge on all sites using the three-dot menu. + kNudgeDisabledOnAllSites, + // User clicked the nudge, but didn't press generate in Compose. + kOpenedComposeMinimalUse, + // User clicked the nudge, pressed generate at least once, but didn't accept + // the suggestion. + kGeneratedComposeSuggestion, + // User clicked, pressed generate, and accepted a suggestion. + kAcceptedComposeSuggestion, + kMaxValue = kAcceptedComposeSuggestion, +}; + // Struct containing event and logging information for an individual // |ComposeSession|. struct ComposeSessionEvents {
diff --git a/components/content_settings/browser/ui/OWNERS b/components/content_settings/browser/ui/OWNERS new file mode 100644 index 0000000..230e9a1d --- /dev/null +++ b/components/content_settings/browser/ui/OWNERS
@@ -0,0 +1 @@ +file://components/privacy_sandbox/OWNERS
diff --git a/components/content_settings/core/common/cookie_settings_base_unittest.cc b/components/content_settings/core/common/cookie_settings_base_unittest.cc index a098972c..91fe8e6 100644 --- a/components/content_settings/core/common/cookie_settings_base_unittest.cc +++ b/components/content_settings/core/common/cookie_settings_base_unittest.cc
@@ -8,8 +8,10 @@ #include "base/functional/callback.h" #include "base/notreached.h" #include "base/strings/strcat.h" +#include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "components/content_settings/core/common/content_settings.h" +#include "components/content_settings/core/common/content_settings_types.h" #include "net/base/features.h" #include "net/cookies/cookie_constants.h" #include "net/cookies/cookie_setting_override.h" @@ -23,8 +25,8 @@ constexpr char kDomain[] = "foo.com"; -using GetSettingCallback = - base::RepeatingCallback<ContentSetting(const GURL&, SettingInfo*)>; +using GetSettingCallback = base::RepeatingCallback< + ContentSetting(const GURL&, ContentSettingsType, SettingInfo*)>; ContentSettingPatternSource CreateSetting(ContentSetting setting) { return ContentSettingPatternSource( @@ -45,6 +47,17 @@ explicit CallbackCookieSettings(GetSettingCallback callback) : callback_(std::move(callback)) {} + // A simple constructor that returns a specified setting for COOKIES and BLOCK + // otherwise. + explicit CallbackCookieSettings(ContentSetting setting) + : callback_(base::BindLambdaForTesting( + [setting](const GURL&, ContentSettingsType type, SettingInfo*) { + if (type == ContentSettingsType::COOKIES) { + return setting; + } + return CONTENT_SETTING_BLOCK; + })) {} + ContentSetting GetContentSetting(const GURL& primary_url, const GURL& secondary_url, ContentSettingsType content_type, @@ -53,7 +66,7 @@ info->primary_pattern = ContentSettingsPattern::Wildcard(); info->secondary_pattern = ContentSettingsPattern::Wildcard(); } - return callback_.Run(primary_url, info); + return callback_.Run(primary_url, content_type, info); } // CookieSettingsBase: @@ -79,6 +92,7 @@ private: GetSettingCallback callback_; + ContentSettingsType type_; }; class CookieSettingsBaseTest : public testing::Test { @@ -97,16 +111,17 @@ }; TEST_F(CookieSettingsBaseTest, ShouldDeleteSessionOnly) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_SESSION_ONLY; })); + CallbackCookieSettings settings( + base::BindRepeating([](const GURL&, ContentSettingsType, SettingInfo*) { + return CONTENT_SETTING_SESSION_ONLY; + })); EXPECT_TRUE(settings.ShouldDeleteCookieOnExit( {}, kDomain, net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, ShouldNotDeleteAllowed) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_ALLOW; })); + CallbackCookieSettings settings(CONTENT_SETTING_ALLOW); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {}, kDomain, net::CookieSourceScheme::kNonSecure)); } @@ -114,8 +129,8 @@ TEST_F(CookieSettingsBaseTest, ShouldNotDeleteAllowedHttps) { base::test::ScopedFeatureList features_; features_.InitAndDisableFeature(net::features::kEnableSchemeBoundCookies); - CallbackCookieSettings settings( - base::BindRepeating([](const GURL& url, SettingInfo*) { + CallbackCookieSettings settings(base::BindRepeating( + [](const GURL& url, ContentSettingsType, SettingInfo*) { return url.SchemeIsCryptographic() ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; })); @@ -129,8 +144,8 @@ ShouldDeleteIsSchemeAwareWithSchemeBoundCookies) { base::test::ScopedFeatureList features_; features_.InitAndEnableFeature(net::features::kEnableSchemeBoundCookies); - CallbackCookieSettings settings( - base::BindRepeating([](const GURL& url, SettingInfo*) { + CallbackCookieSettings settings(base::BindRepeating( + [](const GURL& url, ContentSettingsType, SettingInfo*) { return url.SchemeIsCryptographic() ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_SESSION_ONLY; })); @@ -141,24 +156,21 @@ } TEST_F(CookieSettingsBaseTest, ShouldDeleteDomainSettingSessionOnly) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_TRUE(settings.ShouldDeleteCookieOnExit( {CreateSetting(CONTENT_SETTING_SESSION_ONLY)}, kDomain, net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, ShouldDeleteDomainThirdPartySettingSessionOnly) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_TRUE(settings.ShouldDeleteCookieOnExit( {CreateThirdPartySetting(CONTENT_SETTING_SESSION_ONLY)}, kDomain, net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, ShouldNotDeleteDomainSettingAllow) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {CreateSetting(CONTENT_SETTING_ALLOW)}, kDomain, net::CookieSourceScheme::kNonSecure)); @@ -166,8 +178,7 @@ TEST_F(CookieSettingsBaseTest, ShouldNotDeleteDomainSettingAllowAfterSessionOnly) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {CreateSetting(CONTENT_SETTING_SESSION_ONLY), CreateSetting(CONTENT_SETTING_ALLOW)}, @@ -175,39 +186,34 @@ } TEST_F(CookieSettingsBaseTest, ShouldNotDeleteDomainSettingBlock) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {CreateSetting(CONTENT_SETTING_BLOCK)}, kDomain, net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, ShouldNotDeleteNoDomainMatch) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {CreateSetting(CONTENT_SETTING_SESSION_ONLY)}, "other.com", net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, ShouldNotDeleteNoThirdPartyDomainMatch) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.ShouldDeleteCookieOnExit( {CreateThirdPartySetting(CONTENT_SETTING_SESSION_ONLY)}, "other.com", net::CookieSourceScheme::kNonSecure)); } TEST_F(CookieSettingsBaseTest, CookieAccessNotAllowedWithBlockedSetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.IsFullCookieAccessAllowed( url_, site_for_cookies_, origin_, net::CookieSettingOverrides())); } TEST_F(CookieSettingsBaseTest, CookieAccessAllowedWithAllowSetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_ALLOW; })); + CallbackCookieSettings settings(CONTENT_SETTING_ALLOW); EXPECT_TRUE(settings.IsFullCookieAccessAllowed( url_, site_for_cookies_, origin_, net::CookieSettingOverrides())); } @@ -215,10 +221,7 @@ TEST_F(CookieSettingsBaseTest, ThirdPartyCookiesOverriden) { GURL thirdPartyURL = GURL("https://3p.com"); - CallbackCookieSettings settings( - base::BindRepeating([](const GURL&, SettingInfo* setting_info) { - return CONTENT_SETTING_ALLOW; - })); + CallbackCookieSettings settings(CONTENT_SETTING_ALLOW); net::CookieSettingOverrides overrides{}; overrides.Put(net::CookieSettingOverride::kForceDisableThirdPartyCookies); @@ -232,38 +235,38 @@ } TEST_F(CookieSettingsBaseTest, CookieAccessAllowedWithSessionOnlySetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_SESSION_ONLY; })); + CallbackCookieSettings settings(CONTENT_SETTING_SESSION_ONLY); EXPECT_TRUE(settings.IsFullCookieAccessAllowed( url_, site_for_cookies_, origin_, net::CookieSettingOverrides())); } TEST_F(CookieSettingsBaseTest, LegacyCookieAccessSemantics) { - CallbackCookieSettings settings1(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_ALLOW; })); + CallbackCookieSettings settings1( + base::BindRepeating([](const GURL&, ContentSettingsType, SettingInfo*) { + return CONTENT_SETTING_ALLOW; + })); EXPECT_EQ(net::CookieAccessSemantics::LEGACY, settings1.GetCookieAccessSemanticsForDomain(std::string())); - CallbackCookieSettings settings2(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings2( + base::BindRepeating([](const GURL&, ContentSettingsType, SettingInfo*) { + return CONTENT_SETTING_BLOCK; + })); EXPECT_EQ(net::CookieAccessSemantics::NONLEGACY, settings2.GetCookieAccessSemanticsForDomain(std::string())); } TEST_F(CookieSettingsBaseTest, IsCookieSessionOnlyWithAllowSetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_ALLOW; })); + CallbackCookieSettings settings(CONTENT_SETTING_ALLOW); EXPECT_FALSE(settings.IsCookieSessionOnly(url_)); } TEST_F(CookieSettingsBaseTest, IsCookieSessionOnlyWithBlockSetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_BLOCK; })); + CallbackCookieSettings settings(CONTENT_SETTING_BLOCK); EXPECT_FALSE(settings.IsCookieSessionOnly(url_)); } TEST_F(CookieSettingsBaseTest, IsCookieSessionOnlySessionWithOnlySetting) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_SESSION_ONLY; })); + CallbackCookieSettings settings(CONTENT_SETTING_SESSION_ONLY); EXPECT_TRUE(settings.IsCookieSessionOnly(url_)); } @@ -322,8 +325,7 @@ TEST_P(CookieSettingsBaseStorageAccessAPITest, SettingOverridesForStorageAccessAPIs) { - CallbackCookieSettings settings(base::BindRepeating( - [](const GURL&, SettingInfo*) { return CONTENT_SETTING_ALLOW; })); + CallbackCookieSettings settings(CONTENT_SETTING_ALLOW); net::CookieSettingOverrides overrides = settings.SettingOverridesForStorage();
diff --git a/components/cronet/stale_host_resolver.cc b/components/cronet/stale_host_resolver.cc index 087edb16..6232e12 100644 --- a/components/cronet/stale_host_resolver.cc +++ b/components/cronet/stale_host_resolver.cc
@@ -130,8 +130,8 @@ cache_parameters.source = net::HostResolverSource::LOCAL_ONLY; cache_request_ = resolver_->inner_resolver_->CreateRequest( host_, network_anonymization_key_, net_log_, cache_parameters); - int error = - cache_request_->Start(base::BindOnce([](int error) { NOTREACHED(); })); + int error = cache_request_->Start( + base::BindOnce([](int error) { NOTREACHED_IN_MIGRATION(); })); DCHECK_NE(net::ERR_IO_PENDING, error); cache_error_ = cache_request_->GetResolveErrorInfo().error; DCHECK_NE(net::ERR_IO_PENDING, cache_error_);
diff --git a/components/cronet/url_request_context_config_unittest.cc b/components/cronet/url_request_context_config_unittest.cc index 2a8fd1b7..e5248b8 100644 --- a/components/cronet/url_request_context_config_unittest.cc +++ b/components/cronet/url_request_context_config_unittest.cc
@@ -293,8 +293,8 @@ context->host_resolver()->CreateRequest( net::HostPortPair("abcde", 80), net::NetworkAnonymizationKey(), net::NetLogWithSource(), std::nullopt); - EXPECT_EQ(net::OK, resolve_request->Start( - base::BindOnce([](int error) { NOTREACHED(); }))); + EXPECT_EQ(net::OK, resolve_request->Start(base::BindOnce( + [](int error) { NOTREACHED_IN_MIGRATION(); }))); EXPECT_TRUE(config->network_thread_priority); EXPECT_EQ(42, config->network_thread_priority.value());
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index 3131bc7..ac4d832 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -186,30 +186,12 @@ corner_radius = radii.upper_left(); } - // TODO(b/302034956): Use `ApplyRoundedCornersToSurfaceTree()` to round pip - // window as well. - // Round a pip window. Pip windows are rounded by applying rounded corner - // to host window using ui::Layer API. - // When un-pipped (window state changed from pip), we must undo the - // rounded corners of the host_window. - const int pip_corner_radius = - window_state->IsPip() ? chromeos::kPipRoundedCornerRadius : 0; - const gfx::RoundedCornersF pip_radii(pip_corner_radius); - - ui::Layer* layer = shell_surface_->host_window()->layer(); - if (layer->rounded_corner_radii() != pip_radii) { - layer->SetRoundedCornerRadius(pip_radii); - layer->SetIsFastRoundedCorner(/*enable=*/!pip_radii.IsEmpty()); - } - // Various window decorations are rounded using `kWindowCornerRadiusKey` // property. window->SetProperty(aura::client::kWindowCornerRadiusKey, corner_radius); - // If we have a pip window, ignore `window_radii`. If window_radii is null, - // skip rounding the window. - if (window_state->IsPip() || - !chromeos::features::IsRoundedWindowsEnabled() || !window_radii) { + // If window_radii is null, skip rounding the window. + if (!window_radii) { return; }
diff --git a/components/facilitated_payments/core/browser/BUILD.gn b/components/facilitated_payments/core/browser/BUILD.gn index 89774c07..d585fa6 100644 --- a/components/facilitated_payments/core/browser/BUILD.gn +++ b/components/facilitated_payments/core/browser/BUILD.gn
@@ -43,6 +43,7 @@ "facilitated_payments_manager_unittest.cc", "network_api/facilitated_payments_initiate_payment_request_details_unittest.cc", "network_api/facilitated_payments_initiate_payment_request_unittest.cc", + "network_api/facilitated_payments_network_interface_unittest.cc", ] deps = [
diff --git a/components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface_unittest.cc b/components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface_unittest.cc new file mode 100644 index 0000000..33275f8 --- /dev/null +++ b/components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface_unittest.cc
@@ -0,0 +1,126 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface.h" + +#include <cstdint> +#include <memory> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "components/autofill/core/browser/autofill_client.h" +#include "components/autofill/core/browser/payments/payments_network_interface_test_base.h" +#include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_request_details.h" +#include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace payments::facilitated { + +class FacilitatedPaymentsNetworkInterfaceTest + : public autofill::payments::PaymentsNetworkInterfaceTestBase, + public testing::Test { + public: + FacilitatedPaymentsNetworkInterfaceTest() = default; + + FacilitatedPaymentsNetworkInterfaceTest( + const FacilitatedPaymentsNetworkInterfaceTest&) = delete; + FacilitatedPaymentsNetworkInterfaceTest& operator=( + const FacilitatedPaymentsNetworkInterfaceTest&) = delete; + + ~FacilitatedPaymentsNetworkInterfaceTest() override = default; + + void SetUp() override { + SetUpTest(); + payments_network_interface_ = + std::make_unique<FacilitatedPaymentsNetworkInterface>( + test_shared_loader_factory_, identity_test_env_.identity_manager(), + &test_personal_data_.payments_data_manager()); + } + + void TearDown() override { payments_network_interface_.reset(); } + + protected: + void SendInitiatePaymentRequest() { + auto request_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentRequestDetails>(); + request_details->risk_data_ = "seems pretty risky"; + request_details->client_token_ = + std::vector<uint8_t>{'t', 'o', 'k', 'e', 'n'}; + request_details->billing_customer_number_ = 11; + request_details->merchant_payment_page_url_ = GURL("https://foo.com/bar"); + request_details->instrument_id_ = 13; + request_details->pix_code_ = "a valid code"; + payments_network_interface_->InitiatePayment( + std::move(request_details), + base::BindOnce(&FacilitatedPaymentsNetworkInterfaceTest:: + OnInitiatePaymentResponseReceived, + GetWeakPtr()), + "language-LOCALE"); + } + + std::unique_ptr<FacilitatedPaymentsInitiatePaymentResponseDetails> + response_details_; + std::unique_ptr<FacilitatedPaymentsNetworkInterface> + payments_network_interface_; + + private: + void OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult result, + std::unique_ptr<FacilitatedPaymentsInitiatePaymentResponseDetails> + response_details) { + result_ = result; + response_details_ = std::move(response_details); + } + + base::WeakPtr<FacilitatedPaymentsNetworkInterfaceTest> GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } + + base::WeakPtrFactory<FacilitatedPaymentsNetworkInterfaceTest> + weak_ptr_factory_{this}; +}; + +TEST_F(FacilitatedPaymentsNetworkInterfaceTest, + InitiatePaymentRequest_Success) { + SendInitiatePaymentRequest(); + IssueOAuthToken(); + ReturnResponse( + payments_network_interface_.get(), net::HTTP_OK, + "{\"trigger_purchase_manager\":{\"o2_action_token\":\"token\"}}"); + + // Verify the request contains necessary info like the payment details, and + // the instrument id. + EXPECT_TRUE(GetUploadData().find("payment_details") != std::string::npos); + EXPECT_TRUE(GetUploadData().find("sender_instrument_id") != + std::string::npos); + + // Verify that a success result was received because the response contained + // the action token. + EXPECT_EQ(autofill::AutofillClient::PaymentsRpcResult::kSuccess, result_); + std::vector<uint8_t> expected_action_token = {'t', 'o', 'k', 'e', 'n'}; + EXPECT_EQ(expected_action_token, response_details_->action_token_); +} + +TEST_F(FacilitatedPaymentsNetworkInterfaceTest, + InitiatePaymentRequest_Failure) { + SendInitiatePaymentRequest(); + IssueOAuthToken(); + ReturnResponse( + payments_network_interface_.get(), net::HTTP_OK, + "{\"error\":{\"user_error_message\":\"Something went wrong!\"}}"); + + // Verify the request contains necessary info like the payment details, and + // the instrument id. + EXPECT_TRUE(GetUploadData().find("payment_details") != std::string::npos); + EXPECT_TRUE(GetUploadData().find("sender_instrument_id") != + std::string::npos); + + // Verify that a failure result was received because the response contained + // error. + EXPECT_EQ(autofill::AutofillClient::PaymentsRpcResult::kPermanentFailure, + result_); + EXPECT_EQ("Something went wrong!", response_details_->error_message_.value()); +} + +} // namespace payments::facilitated
diff --git a/components/global_media_controls/media_view_utils.h b/components/global_media_controls/media_view_utils.h index 10072895..5eff306 100644 --- a/components/global_media_controls/media_view_utils.h +++ b/components/global_media_controls/media_view_utils.h
@@ -15,8 +15,11 @@ namespace global_media_controls { +// The time duration for seeking forward or backward. +inline constexpr base::TimeDelta kSeekTime = base::Seconds(10); + // The corner radius of the images in the media views. -inline constexpr int kArtworkCornerRadius = 12; +inline constexpr int kDefaultArtworkCornerRadius = 12; // View ID's. // Buttons are using the `MediaSessionAction` enum as their view IDs. To avoid
diff --git a/components/global_media_controls/public/views/chapter_item_view.cc b/components/global_media_controls/public/views/chapter_item_view.cc index 78977be..fc612b3 100644 --- a/components/global_media_controls/public/views/chapter_item_view.cc +++ b/components/global_media_controls/public/views/chapter_item_view.cc
@@ -27,7 +27,8 @@ namespace global_media_controls { namespace { -constexpr auto kItemCornerRadius = gfx::RoundedCornersF(kArtworkCornerRadius); +constexpr auto kItemCornerRadius = + gfx::RoundedCornersF(kDefaultArtworkCornerRadius); constexpr gfx::Size kImageSize(64, 40); // A `HighlightPathGenerator` that uses caller-supplied rounded rect corners. @@ -126,7 +127,7 @@ // Draws the image with rounded corners. auto path = SkPath().addRoundRect( RectToSkRect(gfx::Rect(kImageSize.width(), kImageSize.height())), - kArtworkCornerRadius, kArtworkCornerRadius); + kDefaultArtworkCornerRadius, kDefaultArtworkCornerRadius); artwork_view_->SetClipPath(path); artwork_view_->SetVisible(true);
diff --git a/components/global_media_controls/public/views/media_item_ui_detailed_view.cc b/components/global_media_controls/public/views/media_item_ui_detailed_view.cc index 090aa1e7..cd13824 100644 --- a/components/global_media_controls/public/views/media_item_ui_detailed_view.cc +++ b/components/global_media_controls/public/views/media_item_ui_detailed_view.cc
@@ -487,7 +487,7 @@ // Draw the image with rounded corners. auto path = SkPath().addRoundRect( RectToSkRect(gfx::Rect(kArtworkSize.width(), kArtworkSize.height())), - kArtworkCornerRadius, kArtworkCornerRadius); + kDefaultArtworkCornerRadius, kDefaultArtworkCornerRadius); artwork_view_->SetClipPath(path); } SchedulePaint(); @@ -618,6 +618,30 @@ void MediaItemUIDetailedView::MediaActionButtonPressed(views::Button* button) { const auto action = static_cast<MediaSessionAction>(button->GetID()); + +#if BUILDFLAG(IS_CHROMEOS_ASH) + if (action == MediaSessionAction::kSeekBackward) { + const auto backward_duration = + std::max(base::Seconds(0), position_.GetPosition() - kSeekTime); + if (item_) { + item_->SeekTo(backward_duration); + } else { + container_->SeekTo(backward_duration); + } + return; + } + if (action == MediaSessionAction::kSeekForward) { + const auto forward_duration = + std::min(position_.GetPosition() + kSeekTime, position_.duration()); + if (item_) { + item_->SeekTo(forward_duration); + } else { + container_->SeekTo(forward_duration); + } + return; + } +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + if (item_) { item_->OnMediaSessionActionButtonPressed(action); } else {
diff --git a/components/global_media_controls/public/views/media_item_ui_detailed_view_unittest.cc b/components/global_media_controls/public/views/media_item_ui_detailed_view_unittest.cc index 5060bd64..c99d02b 100644 --- a/components/global_media_controls/public/views/media_item_ui_detailed_view_unittest.cc +++ b/components/global_media_controls/public/views/media_item_ui_detailed_view_unittest.cc
@@ -612,9 +612,17 @@ auto* view = widget->SetContentsView( CreateView(MediaDisplayPage::kSystemShelfMediaDetailedView)); view->UpdateWithMediaActions({MediaSessionAction::kSeekForward}); + media_session::MediaPosition media_position( + /*playback_rate=*/1, /*duration=*/base::Seconds(58), + /*position=*/base::Seconds(5), /*end_of_media=*/false); + view->UpdateWithMediaPosition(media_position); EXPECT_CALL(item(), OnMediaSessionActionButtonPressed( - MediaSessionAction::kSeekForward)); + MediaSessionAction::kSeekForward)) + .Times(0); + EXPECT_CALL(item(), + SeekTo(::testing::AllOf(::testing::Ge(base::Seconds(15)), + ::testing::Le(base::Seconds(16))))); views::Button* button = view->GetActionButtonForTesting(MediaSessionAction::kSeekForward); EXPECT_TRUE(button && button->GetVisible()); @@ -630,15 +638,24 @@ auto* view = widget->SetContentsView( CreateView(MediaDisplayPage::kSystemShelfMediaDetailedView)); view->UpdateWithMediaActions({MediaSessionAction::kSeekBackward}); + media_session::MediaPosition media_position( + /*playback_rate=*/1, /*duration=*/base::Seconds(58), + /*position=*/base::Seconds(38), /*end_of_media=*/false); + view->UpdateWithMediaPosition(media_position); EXPECT_CALL(item(), OnMediaSessionActionButtonPressed( - MediaSessionAction::kSeekBackward)); + MediaSessionAction::kSeekBackward)) + .Times(0); + EXPECT_CALL(item(), + SeekTo(::testing::AllOf(::testing::Ge(base::Seconds(28)), + ::testing::Le(base::Seconds(29))))); views::Button* button = view->GetActionButtonForTesting(MediaSessionAction::kSeekBackward); EXPECT_TRUE(button && button->GetVisible()); views::test::ButtonTestApi(button).NotifyClick( ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 0, 0)); + testing::Mock::VerifyAndClearExpectations(this); } TEST_F(MediaItemUIDetailedViewTest, TimestampView) {
diff --git a/components/global_media_controls/public/views/media_item_ui_updated_view.cc b/components/global_media_controls/public/views/media_item_ui_updated_view.cc index e772ce29..c7f52ac4 100644 --- a/components/global_media_controls/public/views/media_item_ui_updated_view.cc +++ b/components/global_media_controls/public/views/media_item_ui_updated_view.cc
@@ -4,6 +4,7 @@ #include "components/global_media_controls/public/views/media_item_ui_updated_view.h" +#include "components/global_media_controls/media_view_utils.h" #include "components/global_media_controls/public/media_item_ui_observer.h" #include "components/global_media_controls/public/views/media_progress_view.h" #include "components/media_message_center/media_notification_item.h" @@ -51,25 +52,14 @@ constexpr gfx::Size kPlayPauseButtonSize = gfx::Size(48, 48); constexpr gfx::Size kMediaActionButtonSize = gfx::Size(24, 24); -constexpr base::TimeDelta kSeekTime = base::Seconds(10); - -// If the image does not fit the square view, scale the image to fill the view -// even if part of the image is cropped. -gfx::Size ScaleImageSizeToFitView(const gfx::Size& image_size, - const gfx::Size& view_size) { - const float scale = - std::max(view_size.width() / static_cast<float>(image_size.width()), - view_size.height() / static_cast<float>(image_size.height())); - return gfx::ScaleToFlooredSize(image_size, scale); -} - } // namespace MediaItemUIUpdatedView::MediaItemUIUpdatedView( const std::string& id, base::WeakPtr<media_message_center::MediaNotificationItem> item, media_message_center::MediaColorTheme media_color_theme, - std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view) + std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view, + std::unique_ptr<MediaItemUIFooter> footer_view) : id_(id), item_(std::move(item)), media_color_theme_(media_color_theme) { CHECK(item_); @@ -131,16 +121,11 @@ kSourceRowButtonContainerSeparator); // Create the start casting button. - if (device_selector_view) { - start_casting_button_ = CreateMediaActionButton( - source_row_button_container, kEmptyMediaActionButtonId, - vector_icons::kCastIcon, - IDS_MEDIA_MESSAGE_CENTER_MEDIA_NOTIFICATION_ACTION_SHOW_DEVICE_LIST); - start_casting_button_->SetCallback( - base::BindRepeating(&MediaItemUIUpdatedView::StartCastingButtonPressed, - base::Unretained(this))); - start_casting_button_->SetVisible(false); - } + start_casting_button_ = CreateMediaActionButton( + source_row_button_container, kEmptyMediaActionButtonId, + vector_icons::kCastIcon, + IDS_MEDIA_MESSAGE_CENTER_MEDIA_NOTIFICATION_ACTION_SHOW_DEVICE_LIST); + start_casting_button_->SetVisible(false); // Create the picture-in-picture button. picture_in_picture_button_ = CreateMediaActionButton( @@ -228,10 +213,12 @@ IDS_MEDIA_MESSAGE_CENTER_MEDIA_NOTIFICATION_ACTION_NEXT_TRACK); // Add the device selector view below the |progress_row| if there is one. - if (device_selector_view) { - device_selector_view_ = AddChildView(std::move(device_selector_view)); - device_selector_view_->SetMediaItemUIUpdatedView(this); - } + UpdateDeviceSelectorView(std::move(device_selector_view)); + + // Add the cast device footer view below the |progress_row| if there is one. + // It will only show up when this media item is being casted to another + // device. + UpdateFooterView(std::move(footer_view)); item_->SetView(this); } @@ -381,11 +368,9 @@ void MediaItemUIUpdatedView::UpdateDeviceSelectorAvailability( bool has_devices) { - CHECK(start_casting_button_); - // Do not show the start casting button if this media item is being casted to - // another device and has a footer view of stop casting button. - // TODO(yrw): Add "&& !footer_view_" when it is ready. - bool visible = has_devices; + // Do not show the start casting button for a casting media item. Only show it + // if there are available devices in the selector view. + bool visible = has_devices && !footer_view_; if (visible != start_casting_button_->GetVisible()) { start_casting_button_->SetVisible(visible); } @@ -394,6 +379,39 @@ /////////////////////////////////////////////////////////////////////////////// // MediaItemUIUpdatedView implementations: +void MediaItemUIUpdatedView::UpdateDeviceSelectorView( + std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view) { + // Remove the existing device selector view. + if (device_selector_view_) { + RemoveChildViewT(device_selector_view_); + device_selector_view_ = nullptr; + start_casting_button_->SetCallback(views::Button::PressedCallback()); + } + // Add the new device selector view. + if (device_selector_view) { + device_selector_view_ = AddChildView(std::move(device_selector_view)); + device_selector_view_->SetMediaItemUIUpdatedView(this); + start_casting_button_->SetCallback( + base::BindRepeating(&MediaItemUIUpdatedView::StartCastingButtonPressed, + base::Unretained(this))); + } +} + +void MediaItemUIUpdatedView::UpdateFooterView( + std::unique_ptr<MediaItemUIFooter> footer_view) { + // Remove the existing footer view. + if (footer_view_) { + RemoveChildViewT(footer_view_); + footer_view_ = nullptr; + } + // Add the new footer view. + if (footer_view) { + footer_view_ = AddChildView(std::move(footer_view)); + } + // Footer view changes can change the picture-in-picture button's visibility. + UpdateMediaActionButtonsVisibility(); +} + MediaActionButton* MediaItemUIUpdatedView::CreateMediaActionButton( views::View* parent, int button_id, @@ -443,6 +461,10 @@ for (views::Button* button : media_action_buttons_) { bool should_show = base::Contains( media_actions_, static_cast<MediaSessionAction>(button->GetID())); + // Do not show the picture-in-picture button for a casting media item. + if (button == picture_in_picture_button_ && footer_view_) { + should_show = false; + } if (should_show != button->GetVisible()) { button->SetVisible(should_show); should_invalidate_layout = true; @@ -474,7 +496,6 @@ } void MediaItemUIUpdatedView::UpdateCastingState() { - CHECK(start_casting_button_); CHECK(device_selector_view_); if (start_casting_button_->GetVisible()) { @@ -543,6 +564,10 @@ return device_selector_view_; } +MediaItemUIFooter* MediaItemUIUpdatedView::GetFooterForTesting() { + return footer_view_; +} + BEGIN_METADATA(MediaItemUIUpdatedView) END_METADATA
diff --git a/components/global_media_controls/public/views/media_item_ui_updated_view.h b/components/global_media_controls/public/views/media_item_ui_updated_view.h index ecfe75f3..114283e 100644 --- a/components/global_media_controls/public/views/media_item_ui_updated_view.h +++ b/components/global_media_controls/public/views/media_item_ui_updated_view.h
@@ -8,6 +8,7 @@ #include "components/global_media_controls/public/media_item_ui.h" #include "components/global_media_controls/public/views/media_action_button.h" #include "components/global_media_controls/public/views/media_item_ui_device_selector.h" +#include "components/global_media_controls/public/views/media_item_ui_footer.h" #include "components/media_message_center/media_notification_view.h" #include "components/media_message_center/notification_theme.h" #include "ui/base/metadata/metadata_header_macros.h" @@ -46,7 +47,8 @@ const std::string& id, base::WeakPtr<media_message_center::MediaNotificationItem> item, media_message_center::MediaColorTheme media_color_theme, - std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view); + std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view, + std::unique_ptr<MediaItemUIFooter> footer_view); MediaItemUIUpdatedView(const MediaItemUIUpdatedView&) = delete; MediaItemUIUpdatedView& operator=(const MediaItemUIUpdatedView&) = delete; ~MediaItemUIUpdatedView() override; @@ -83,6 +85,11 @@ void UpdateDeviceSelectorVisibility(bool visible) override; void UpdateDeviceSelectorAvailability(bool has_devices) override; + // MediaItemUIUpdatedView: + void UpdateDeviceSelectorView( + std::unique_ptr<MediaItemUIDeviceSelector> device_selector_view); + void UpdateFooterView(std::unique_ptr<MediaItemUIFooter> footer_view); + // Helper functions for testing: views::ImageView* GetArtworkViewForTesting(); views::Label* GetSourceLabelForTesting(); @@ -93,6 +100,7 @@ MediaProgressView* GetProgressViewForTesting(); MediaActionButton* GetStartCastingButtonForTesting(); MediaItemUIDeviceSelector* GetDeviceSelectorForTesting(); + MediaItemUIFooter* GetFooterForTesting(); private: MediaActionButton* CreateMediaActionButton(views::View* parent, @@ -148,6 +156,7 @@ base::WeakPtr<media_message_center::MediaNotificationItem> item_; media_message_center::MediaColorTheme media_color_theme_; raw_ptr<MediaItemUIDeviceSelector> device_selector_view_ = nullptr; + raw_ptr<MediaItemUIFooter> footer_view_ = nullptr; }; } // namespace global_media_controls
diff --git a/components/global_media_controls/public/views/media_item_ui_updated_view_unittest.cc b/components/global_media_controls/public/views/media_item_ui_updated_view_unittest.cc index 8b320524..42f7e96 100644 --- a/components/global_media_controls/public/views/media_item_ui_updated_view_unittest.cc +++ b/components/global_media_controls/public/views/media_item_ui_updated_view_unittest.cc
@@ -5,6 +5,7 @@ #include "components/global_media_controls/public/views/media_item_ui_updated_view.h" #include "components/global_media_controls/public/test/mock_media_item_ui_device_selector.h" +#include "components/global_media_controls/public/test/mock_media_item_ui_footer.h" #include "components/global_media_controls/public/test/mock_media_item_ui_observer.h" #include "components/global_media_controls/public/views/media_progress_view.h" #include "components/media_message_center/mock_media_notification_item.h" @@ -19,6 +20,7 @@ namespace global_media_controls { using ::global_media_controls::test::MockMediaItemUIDeviceSelector; +using ::global_media_controls::test::MockMediaItemUIFooter; using ::global_media_controls::test::MockMediaItemUIObserver; using ::media_message_center::test::MockMediaNotificationItem; using ::media_session::mojom::MediaSessionAction; @@ -49,7 +51,7 @@ device_selector_ = device_selector.get(); view_ = widget_->SetContentsView(std::make_unique<MediaItemUIUpdatedView>( kTestId, item_->GetWeakPtr(), media_message_center::MediaColorTheme(), - std::move(device_selector))); + std::move(device_selector), /*footer_view=*/nullptr)); observer_ = std::make_unique<NiceMock<MockMediaItemUIObserver>>(); view_->AddObserver(observer_.get()); @@ -277,4 +279,17 @@ ->GetTargetInkDropState()); } +TEST_F(MediaItemUIUpdatedViewTest, FooterViewCheck) { + EnableAllMediaActions(); + auto* pip_button = view()->GetMediaActionButtonForTesting( + MediaSessionAction::kEnterPictureInPicture); + EXPECT_TRUE(pip_button->GetVisible()); + + auto footer_view = std::make_unique<NiceMock<MockMediaItemUIFooter>>(); + auto* footer_ptr = footer_view.get(); + view()->UpdateFooterView(std::move(footer_view)); + EXPECT_FALSE(pip_button->GetVisible()); + EXPECT_EQ(footer_ptr, view()->GetFooterForTesting()); +} + } // namespace global_media_controls
diff --git a/components/lens/lens_features.cc b/components/lens/lens_features.cc index 1871dde..e18784d7 100644 --- a/components/lens/lens_features.cc +++ b/components/lens/lens_features.cc
@@ -94,6 +94,9 @@ const base::FeatureParam<bool> kIsFindInPageEntryPointEnabled{ &kLensOverlay, "find-in-page-entry-point", false}; +const base::FeatureParam<bool> kUseBrowserDarkModeSettingForLensOverlay{ + &kLensOverlay, "use-browser-dark-mode-setting", true}; + constexpr base::FeatureParam<std::string> kLensOverlayEndpointUrl{ &kLensOverlay, "endpoint-url", "https://lensfrontend-pa.googleapis.com/v1/crupload"}; @@ -348,4 +351,8 @@ return kIsFindInPageEntryPointEnabled.Get(); } +bool UseBrowserDarkModeSettingForLensOverlay() { + return kUseBrowserDarkModeSettingForLensOverlay.Get(); +} + } // namespace lens::features
diff --git a/components/lens/lens_features.h b/components/lens/lens_features.h index 38420a92..dc083341 100644 --- a/components/lens/lens_features.h +++ b/components/lens/lens_features.h
@@ -320,6 +320,11 @@ COMPONENT_EXPORT(LENS_FEATURES) extern bool IsFindInPageEntryPointEnabled(); +// Returns whether or not to read the browser dark mode setting +// for Lens Overlay. If false, it will fall back to light mode. +COMPONENT_EXPORT(LENS_FEATURES) +extern bool UseBrowserDarkModeSettingForLensOverlay(); + } // namespace lens::features #endif // COMPONENTS_LENS_LENS_FEATURES_H_
diff --git a/components/media_message_center/notification_theme.h b/components/media_message_center/notification_theme.h index 51e6a2b..73769af 100644 --- a/components/media_message_center/notification_theme.h +++ b/components/media_message_center/notification_theme.h
@@ -66,6 +66,9 @@ // Color ID for device selector view borders. ui::ColorId device_selector_border_color_id = 0; + // Color ID for device selector view foreground. + ui::ColorId device_selector_foreground_color_id = 0; + // Color ID for device selector view background. ui::ColorId device_selector_background_color_id = 0;
diff --git a/components/metrics/structured/recorder.h b/components/metrics/structured/recorder.h index 04371f8c..b9bbf8f5 100644 --- a/components/metrics/structured/recorder.h +++ b/components/metrics/structured/recorder.h
@@ -44,6 +44,8 @@ // TODO(b/282031543): Remove this class and merge remaining logic into // structured_metrics_recorder.h since the Record() is exposed via // StructuredMetricsClient interface now. +// +// TODO(b/339914565): Move recording off of the UI sequence onto an IO sequence. class Recorder { public: class RecorderImpl { @@ -69,6 +71,8 @@ void SetUiTaskRunner( const scoped_refptr<base::SequencedTaskRunner> ui_task_runner); + base::SequencedTaskRunner* GetUiTaskRunner() { return ui_task_runner_.get(); } + void SetRecorder(RecorderImpl* recorder); void UnsetRecorder(RecorderImpl* recorder);
diff --git a/components/metrics/structured/structured_metrics_recorder.cc b/components/metrics/structured/structured_metrics_recorder.cc index ffb99df3..c67eec1 100644 --- a/components/metrics/structured/structured_metrics_recorder.cc +++ b/components/metrics/structured/structured_metrics_recorder.cc
@@ -64,23 +64,26 @@ void StructuredMetricsRecorder::ProvideEventMetrics( ChromeUserMetricsExtension& uma_proto) { - if (!CanProvideMetrics()) { + if (!CanProvideMetrics() || !event_storage_->HasEvents()) { return; } + LockStorage(); + // Get the events from event storage. auto events = event_storage_->TakeEvents(); - if (events.size() == 0) { - return; - } + ReleaseStorage(); StructuredDataProto& structured_data = *uma_proto.mutable_structured_data(); *structured_data.mutable_events() = std::move(events); LogUploadSizeBytes(structured_data.ByteSizeLong()); LogNumEventsInUpload(structured_data.events_size()); +} +void StructuredMetricsRecorder::ProvideLogMetadata( + ChromeUserMetricsExtension& uma_proto) { // Applies custom metadata providers. Recorder::GetInstance()->OnProvideIndependentMetrics(&uma_proto); } @@ -227,7 +230,11 @@ NotifyEventRecorded(event_proto); // Add new event to storage. - event_storage_->AddEvent(event_proto); + if (storage_lock_.load()) { + locked_events_.push_back(event_proto); + } else { + event_storage_->AddEvent(event_proto); + } test_callback_on_record_.Run(); } @@ -458,4 +465,32 @@ } } +void StructuredMetricsRecorder::LockStorage() { + storage_lock_.store(true); +} + +void StructuredMetricsRecorder::ReleaseStorage() { + storage_lock_.store(false); + + StoreLockedEvents(); +} + +void StructuredMetricsRecorder::StoreLockedEvents() { + base::SequencedTaskRunner* task_runner = + Recorder::GetInstance()->GetUiTaskRunner(); + + if (!task_runner->RunsTasksInCurrentSequence()) { + task_runner->PostTask( + FROM_HERE, base::BindOnce(&StructuredMetricsRecorder::StoreLockedEvents, + weak_factory_.GetWeakPtr())); + return; + } + + for (const auto& event : locked_events_) { + event_storage_->AddEvent(event); + } + + locked_events_.clear(); +} + } // namespace metrics::structured
diff --git a/components/metrics/structured/structured_metrics_recorder.h b/components/metrics/structured/structured_metrics_recorder.h index 1fd04fb..ed17861 100644 --- a/components/metrics/structured/structured_metrics_recorder.h +++ b/components/metrics/structured/structured_metrics_recorder.h
@@ -4,6 +4,7 @@ #ifndef COMPONENTS_METRICS_STRUCTURED_STRUCTURED_METRICS_RECORDER_H_ #define COMPONENTS_METRICS_STRUCTURED_STRUCTURED_METRICS_RECORDER_H_ +#include <atomic> #include <deque> #include <memory> #include <optional> @@ -71,6 +72,12 @@ // fields. virtual void ProvideEventMetrics(ChromeUserMetricsExtension& uma_proto); + // Provides any additional metadata needed by the UMA proto. + // + // This should be called on the UI thread. + // If this method is overwritten the base implementation must be called. + virtual void ProvideLogMetadata(ChromeUserMetricsExtension& uma_proto); + // Returns true if ready to provide metrics via ProvideEventMetrics. bool CanProvideMetrics(); @@ -225,6 +232,17 @@ InitState init_state_; private: + // Lock and release event storage. This is to mitigate a potential race + // condition between TakeEvents() and RecordEvent(). + // + // If storage is locked then recorded events are stored in-memory until + // storage is released. + void LockStorage(); + void ReleaseStorage(); + + // Once storage is released then record in-memory events into storage. + void StoreLockedEvents(); + // Tracks the recording state signalled to the metrics provider by // OnRecordingEnabled and OnRecordingDisabled. This is false until // OnRecordingEnabled is called, which sets it true if structured metrics' @@ -243,6 +261,13 @@ base::ObserverList<Observer> watchers_; + // A flag to determine if the storage has been locked without actually + // acquiring a lock. + std::atomic_bool storage_lock_; + + // Events recorded while recording was locked. + std::vector<StructuredEventProto> locked_events_; + // Callbacks for tests whenever an event is recorded. base::RepeatingClosure test_callback_on_record_ = base::DoNothing();
diff --git a/components/metrics/structured/structured_metrics_recorder_unittest.cc b/components/metrics/structured/structured_metrics_recorder_unittest.cc index 02309cc..508b231 100644 --- a/components/metrics/structured/structured_metrics_recorder_unittest.cc +++ b/components/metrics/structured/structured_metrics_recorder_unittest.cc
@@ -283,6 +283,7 @@ StructuredDataProto GetEventMetrics() { ChromeUserMetricsExtension uma_proto; recorder_->ProvideEventMetrics(uma_proto); + recorder_->ProvideLogMetadata(uma_proto); Wait(); return uma_proto.structured_data(); }
diff --git a/components/metrics/structured/structured_metrics_service.cc b/components/metrics/structured/structured_metrics_service.cc index fb69c72..3d75aa46 100644 --- a/components/metrics/structured/structured_metrics_service.cc +++ b/components/metrics/structured/structured_metrics_service.cc
@@ -4,6 +4,13 @@ #include "components/metrics/structured/structured_metrics_service.h" +#include <memory> + +#include "base/run_loop.h" +#include "base/task/bind_post_task.h" +#include "base/task/sequenced_task_runner.h" +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" #include "components/metrics/metrics_log.h" #include "components/metrics/metrics_service_client.h" #include "components/metrics/structured/reporting/structured_metrics_reporting_service.h" @@ -22,7 +29,11 @@ structured_metrics_enabled_( base::FeatureList::IsEnabled(metrics::features::kStructuredMetrics) && base::FeatureList::IsEnabled(kEnabledStructuredMetricsService)), - client_(client) { + client_(client), + task_runner_(base::ThreadPool::CreateSequencedTaskRunner( + {base::TaskPriority::BEST_EFFORT, base::MayBlock(), + // Blocking because the works being done isn't to expensive. + base::TaskShutdownBehavior::BLOCK_SHUTDOWN})) { CHECK(client_); CHECK(local_state); CHECK(recorder_); @@ -119,11 +130,14 @@ metrics::MetricsLogsEventManager::CreateReason reason) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // The log should not be built if there aren't any events to log. - // This is mirroring a check in RotateLogsAndSend. if (!recorder_->event_storage()->HasEvents()) { return; } - BuildAndStoreLog(reason); + + ChromeUserMetricsExtension uma_proto; + InitializeUmaProto(uma_proto); + CollectEventsAndStoreLog(std::move(uma_proto), reason); + reporting_service_->log_store()->TrimAndPersistUnsentLogs(true); } @@ -150,23 +164,77 @@ return; } + // If we do not have any logs then nothing to do. if (!reporting_service_->log_store()->has_unsent_logs()) { - BuildAndStoreLog(metrics::MetricsLogsEventManager::CreateReason::kPeriodic); + CreateLogs(metrics::MetricsLogsEventManager::CreateReason::kPeriodic, + /*notify_scheduler=*/true); + return; } + + // If we already have a completed log then we can upload here. reporting_service_->Start(); scheduler_->RotationFinished(); } -void StructuredMetricsService::BuildAndStoreLog( - metrics::MetricsLogsEventManager::CreateReason reason) { - ChromeUserMetricsExtension uma_proto; +void StructuredMetricsService::CreateLogs( + metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + +// An async version is used on Ash because events could potentially be stored on +// disk and must be accessed from an IO sequence. +// Other platforms (Windows, Mac, and Linux), the events are stored only +// in-memory and thus a blocking function isn't needed. +#if BUILDFLAG(IS_CHROMEOS_ASH) + BuildAndStoreLog(reason, notify_scheduler); +#else + BuildAndStoreLogSync(reason, notify_scheduler); +#endif +} + +void StructuredMetricsService::BuildAndStoreLog( + metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler) { + ChromeUserMetricsExtension uma_proto; InitializeUmaProto(uma_proto); - recorder_->ProvideEventMetrics(uma_proto); + + task_runner_->PostTaskAndReply( + FROM_HERE, + base::BindOnce(&StructuredMetricsService::CollectEventsAndStoreLog, + base::Unretained(this), std::move(uma_proto), reason), + base::BindOnce(&StructuredMetricsService::OnCollectEventsAndStoreLog, + base::Unretained(this), notify_scheduler)); +} + +void StructuredMetricsService::BuildAndStoreLogSync( + metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + ChromeUserMetricsExtension uma_proto; + InitializeUmaProto(uma_proto); + + CollectEventsAndStoreLog(std::move(uma_proto), reason); + + OnCollectEventsAndStoreLog(notify_scheduler); +} + +void StructuredMetricsService::CollectEventsAndStoreLog( + ChromeUserMetricsExtension&& uma_proto, + metrics::MetricsLogsEventManager::CreateReason reason) { + recorder_->ProvideEventMetrics(uma_proto); // Potentially blocking. const std::string serialized_log = SerializeLog(uma_proto); reporting_service_->StoreLog(serialized_log, reason); } +void StructuredMetricsService::OnCollectEventsAndStoreLog( + bool notify_scheduler) { + reporting_service_->Start(); + if (notify_scheduler) { + scheduler_->RotationFinished(); + } +} + void StructuredMetricsService::Initialize() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!initialize_complete_); @@ -184,6 +252,8 @@ uma_proto.set_product(product); } + recorder_->ProvideLogMetadata(uma_proto); + SystemProfileProto* system_profile = uma_proto.mutable_system_profile(); metrics::MetricsLog::RecordCoreSystemProfile(client_, system_profile); } @@ -211,7 +281,9 @@ } if (!reporting_service_->log_store()->has_unsent_logs()) { - BuildAndStoreLog(metrics::MetricsLogsEventManager::CreateReason::kUnknown); + CreateLogs(metrics::MetricsLogsEventManager::CreateReason::kUnknown, + /*notify_scheduler=*/false); + return; } reporting_service_->Start(); }
diff --git a/components/metrics/structured/structured_metrics_service.h b/components/metrics/structured/structured_metrics_service.h index 3f9fb31..c7d9525 100644 --- a/components/metrics/structured/structured_metrics_service.h +++ b/components/metrics/structured/structured_metrics_service.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/memory/weak_ptr.h" +#include "base/task/sequenced_task_runner.h" #include "components/metrics/structured/reporting/structured_metrics_reporting_service.h" #include "components/metrics/structured/structured_metrics_recorder.h" #include "components/metrics/structured/structured_metrics_scheduler.h" @@ -94,8 +95,44 @@ // Creates a new log and sends any currently stages logs. void RotateLogsAndSend(); - // Collects the events from the recorder and builds a new log. - void BuildAndStoreLog(metrics::MetricsLogsEventManager::CreateReason reason); + // Collects the events from the recorder and builds a new log on a separate + // task. + // + // An upload is triggered once the task is completed. + void BuildAndStoreLog(metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler); + + // Collects the events from the recorder and builds a new log on the current + // thread. + // + // An upload is triggered after the log has been stored. + // Used on Windows, Mac, and Linux and during shutdown. + void BuildAndStoreLogSync( + metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler); + + // Populates an UMA proto with data that must be accessed form the UI + // sequence. A task to collect events is posted which updates the created UMA + // proto. On Windows, Mac, and Linux logs are built synchronously. + // + // Must be called from the UI sequence. + void CreateLogs(metrics::MetricsLogsEventManager::CreateReason reason, + bool notify_scheduler); + + // Collects events from the EventStorage. The log is also serialized and + // stored in |log_store_|. + // + // Must be called from an IO sequence. + void CollectEventsAndStoreLog( + ChromeUserMetricsExtension&& uma_proto, + metrics::MetricsLogsEventManager::CreateReason reason); + + // Once a log has been created, start an upload. Potentially, notify the log + // rotation scheduler. + // + // |notify_scheduler| is only false when an upload is attempted when the + // service starts. + void OnCollectEventsAndStoreLog(bool notify_scheduler); // Starts the initialization process for |this|. void Initialize(); @@ -146,6 +183,9 @@ SEQUENCE_CHECKER(sequence_checker_); + // An IO task runner for creating logs. + scoped_refptr<base::SequencedTaskRunner> task_runner_; + base::WeakPtrFactory<StructuredMetricsService> weak_factory_{this}; };
diff --git a/components/metrics/structured/structured_metrics_service_unittest.cc b/components/metrics/structured/structured_metrics_service_unittest.cc index 904b11b..f0fb3d4 100644 --- a/components/metrics/structured/structured_metrics_service_unittest.cc +++ b/components/metrics/structured/structured_metrics_service_unittest.cc
@@ -65,6 +65,8 @@ prefs_.registry()); } + ~StructuredMetricsServiceTest() override = default; + void SetUp() override { feature_list_.InitWithFeatures({kEnabledStructuredMetricsService}, {}); @@ -82,17 +84,16 @@ void TearDown() override { StructuredMetricsClient::Get()->UnsetDelegate(); } void Init() { - auto key_data_provider = std::make_unique<TestKeyDataProvider>( - DeviceKeyFilePath(), ProfileKeyFilePath()); + auto key_data_provider = + std::make_unique<TestKeyDataProvider>(DeviceKeyFilePath()); TestKeyDataProvider* test_key_data_provider = key_data_provider.get(); auto recorder = std::make_unique<StructuredMetricsRecorder>( std::move(key_data_provider), std::make_unique<TestEventStorage>()); - // Register the profile with the key data provider. - test_key_data_provider->OnProfileAdded(temp_dir_.GetPath()); - service_ = std::make_unique<StructuredMetricsService>(&client_, &prefs_, std::move(recorder)); + // Register the profile with the key data provider. + test_key_data_provider->OnProfileAdded(temp_dir_.GetPath()); Wait(); } @@ -207,6 +208,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1.0))); + Wait(); service_->Purge(); service_->Flush(metrics::MetricsLogsEventManager::CreateReason::kUnknown); @@ -225,6 +227,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1.0))); + Wait(); service_->Flush(metrics::MetricsLogsEventManager::CreateReason::kUnknown); @@ -247,11 +250,13 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1))); + Wait(); service_->Flush(metrics::MetricsLogsEventManager::CreateReason::kUnknown); const auto uma_proto = GetPersistedLog(); EXPECT_THAT(uma_proto.structured_data().events().size(), 2); + service_.reset(); } TEST_F(StructuredMetricsServiceTest, SystemProfileFilled) { @@ -264,6 +269,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1))); + Wait(); service_->Flush(metrics::MetricsLogsEventManager::CreateReason::kUnknown); @@ -285,6 +291,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1))); + Wait(); DisableRecording(); @@ -292,6 +299,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1))); + Wait(); EnableRecording(); @@ -310,6 +318,7 @@ std::move(TestEventOne().SetTestMetricTwo(1))); StructuredMetricsClient::Record( std::move(TestEventSeven().SetTestMetricSeven(1))); + Wait(); // Will flush the log. service_.reset();
diff --git a/components/optimization_guide/core/model_execution/model_execution_fetcher.cc b/components/optimization_guide/core/model_execution/model_execution_fetcher.cc index 60b5c7e..d0bab1a 100644 --- a/components/optimization_guide/core/model_execution/model_execution_fetcher.cc +++ b/components/optimization_guide/core/model_execution/model_execution_fetcher.cc
@@ -140,7 +140,7 @@ return MISSING_TRAFFIC_ANNOTATION; case ModelBasedCapabilityKey::kPromptApi: // On-device only feature. - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return MISSING_TRAFFIC_ANNOTATION; } }
diff --git a/components/optimization_guide/core/model_execution/model_execution_manager.cc b/components/optimization_guide/core/model_execution/model_execution_manager.cc index e6117af..7f5c817c 100644 --- a/components/optimization_guide/core/model_execution/model_execution_manager.cc +++ b/components/optimization_guide/core/model_execution/model_execution_manager.cc
@@ -182,6 +182,7 @@ return; } + did_register_for_supplementary_on_device_models_ = true; model_provider_->AddObserverForOptimizationTargetModel( proto::OptimizationTarget::OPTIMIZATION_TARGET_TEXT_SAFETY, /*model_metadata=*/std::nullopt, this); @@ -191,8 +192,7 @@ } ModelExecutionManager::~ModelExecutionManager() { - if (model_provider_ && on_device_model_service_controller_ && - features::ShouldUseTextSafetyClassifierModel()) { + if (did_register_for_supplementary_on_device_models_) { model_provider_->RemoveObserverForOptimizationTargetModel( proto::OptimizationTarget::OPTIMIZATION_TARGET_TEXT_SAFETY, this); model_provider_->RemoveObserverForOptimizationTargetModel(
diff --git a/components/optimization_guide/core/model_execution/model_execution_manager.h b/components/optimization_guide/core/model_execution/model_execution_manager.h index 3abb4985..36fdd7ca 100644 --- a/components/optimization_guide/core/model_execution/model_execution_manager.h +++ b/components/optimization_guide/core/model_execution/model_execution_manager.h
@@ -133,6 +133,9 @@ scoped_refptr<OnDeviceModelServiceController> on_device_model_service_controller_; + // Whether the user registered for supplementary on-device models. + bool did_register_for_supplementary_on_device_models_ = false; + SEQUENCE_CHECKER(sequence_checker_); // Used to get `weak_ptr_` to self.
diff --git a/components/optimization_guide/core/model_execution/model_execution_manager_unittest.cc b/components/optimization_guide/core/model_execution/model_execution_manager_unittest.cc index 58238e5..a866313 100644 --- a/components/optimization_guide/core/model_execution/model_execution_manager_unittest.cc +++ b/components/optimization_guide/core/model_execution/model_execution_manager_unittest.cc
@@ -176,6 +176,8 @@ PrefService* local_state() { return local_state_.get(); } + void Reset() { model_execution_manager_ = nullptr; } + private: base::test::TaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; @@ -710,6 +712,9 @@ kDisallowed)); CreateModelExecutionManager(); EXPECT_FALSE(model_provider()->was_registered()); + + // Reset manager to make sure removing observer doesn't crash. + Reset(); } } // namespace
diff --git a/components/optimization_guide/core/model_execution/on_device_model_adaptation_controller_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_adaptation_controller_unittest.cc index 04139d8..5cee27f3 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_adaptation_controller_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_adaptation_controller_unittest.cc
@@ -41,8 +41,7 @@ {"on_device_model_context_token_chunk_size", "4"}, {"on_device_model_topk", "1"}, {"on_device_model_temperature", "0"}}}, - {features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}}}, + {features::kTextSafetyClassifier, {}}, {features::kOptimizationGuideComposeOnDeviceEval, {{}}}, {features::internal::kModelAdaptationCompose, {{}}}}, {});
diff --git a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc index 86a2f2a7..23843cc 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc
@@ -141,7 +141,7 @@ return; } base_model_spec_ = state->GetBaseModelSpec(); - if (!base_model_spec_) { + if (!switches::GetOnDeviceModelExecutionOverride() && !base_model_spec_) { RecordAdaptationModelAvailability( feature_, OnDeviceModelAdaptationAvailability::kBaseModelSpecInvalid); return; @@ -152,8 +152,10 @@ "type.googleapis.com/" "google.internal.chrome.optimizationguide.v1.OnDeviceBaseModelMetadata"); proto::OnDeviceBaseModelMetadata model_metadata; - model_metadata.set_base_model_version(base_model_spec_->model_version); - model_metadata.set_base_model_name(base_model_spec_->model_name); + if (base_model_spec_) { + model_metadata.set_base_model_version(base_model_spec_->model_version); + model_metadata.set_base_model_name(base_model_spec_->model_name); + } model_metadata.SerializeToString(any_metadata.mutable_value()); model_provider_->AddObserverForOptimizationTargetModel( @@ -213,18 +215,19 @@ return base::unexpected( OnDeviceModelAdaptationAvailability::kAdaptationModelInvalid); } - if (!base_model_spec_) { - return base::unexpected( - OnDeviceModelAdaptationAvailability::kBaseModelUnavailable); - } - // When base model override was specified, skip the incompatibility check. - if (!switches::GetOnDeviceModelExecutionOverride() && - (supported_model_spec->base_model_name() != - base_model_spec_->model_name || - supported_model_spec->base_model_version() != - base_model_spec_->model_version)) { - return base::unexpected( - OnDeviceModelAdaptationAvailability::kAdaptationModelIncompatible); + // Check for incompatibility when base model override is not specified + if (!switches::GetOnDeviceModelExecutionOverride()) { + if (!base_model_spec_) { + return base::unexpected( + OnDeviceModelAdaptationAvailability::kBaseModelUnavailable); + } + if (supported_model_spec->base_model_name() != + base_model_spec_->model_name || + supported_model_spec->base_model_version() != + base_model_spec_->model_version) { + return base::unexpected( + OnDeviceModelAdaptationAvailability::kAdaptationModelIncompatible); + } } auto weights_file = model_info->GetAdditionalFileWithBaseName(
diff --git a/components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h b/components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h index ff1babe6..a9a2790a 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h +++ b/components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h
@@ -53,6 +53,8 @@ const google::protobuf::MessageLite& request, const std::string& text) const; + bool CanSkipTextSafety() const { return config_.can_skip_text_safety(); } + private: friend class base::RefCounted<OnDeviceModelFeatureAdapter>; ~OnDeviceModelFeatureAdapter();
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc index 6c94bab..05e6d85 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc
@@ -74,17 +74,22 @@ OnDeviceModelEligibilityReason OnDeviceModelServiceController::CanCreateSession( ModelBasedCapabilityKey feature) { - if (!base::FeatureList::IsEnabled( - features::kOptimizationGuideOnDeviceModel)) { - return OnDeviceModelEligibilityReason::kFeatureNotEnabled; + if (on_device_component_state_manager_) { + on_device_component_state_manager_->OnDeviceEligibleFeatureUsed(); } if (!model_metadata_) { return OnDeviceModelEligibilityReason::kModelNotAvailable; } + // Check feature config. + auto adapter = GetFeatureAdapter(feature); + if (!adapter) { + return OnDeviceModelEligibilityReason::kConfigNotAvailableForFeature; + } // Check safety info. - if (features::GetOnDeviceModelMustUseSafetyModel()) { + if (features::ShouldUseTextSafetyClassifierModel() && + !adapter->CanSkipTextSafety()) { if (!safety_model_info_) { return OnDeviceModelEligibilityReason::kSafetyModelNotAvailable; } @@ -103,10 +108,6 @@ } } - if (!GetFeatureAdapter(feature)) { - return OnDeviceModelEligibilityReason::kConfigNotAvailableForFeature; - } - if (!features::internal::IsOnDeviceModelEnabled(feature)) { return OnDeviceModelEligibilityReason::kFeatureExecutionNotEnabled; } @@ -127,10 +128,6 @@ base::WeakPtr<ModelQualityLogsUploaderService> model_quality_uploader_service, const std::optional<SessionConfigParams>& config_params) { - if (on_device_component_state_manager_) { - on_device_component_state_manager_->OnDeviceEligibleFeatureUsed(); - } - OnDeviceModelEligibilityReason reason = CanCreateSession(feature); CHECK_NE(reason, OnDeviceModelEligibilityReason::kUnknown); base::UmaHistogramEnumeration( @@ -146,32 +143,31 @@ on_device_model::ModelAssetPaths model_paths; model_paths.weights = model_metadata_->model_path().Append(kWeightsFile); - // TODO(b:336356889): Move the text safety and language detection model config - // to the model adaptation controller. - std::optional<proto::FeatureTextSafetyConfiguration> safety_config; + auto adapter = GetFeatureAdapter(feature); + CHECK(adapter); + + // Populate the model paths even if they are not needed for the current + // feature, since the base model remote could be used for subsequent features. if (safety_model_info_) { + model_paths.ts_data = safety_model_info_->GetDataPath(); + model_paths.ts_sp_model = safety_model_info_->GetSpModelPath(); + } + if (language_detection_model_path_) { + model_paths.language_detection_model = *language_detection_model_path_; + } + + std::optional<proto::FeatureTextSafetyConfiguration> safety_config; + if (features::ShouldUseTextSafetyClassifierModel() && + !adapter->CanSkipTextSafety()) { + CHECK(safety_model_info_); safety_config = safety_model_info_->GetConfig(ToModelExecutionFeatureProto(feature)); - - if (safety_config) { - model_paths.ts_data = safety_model_info_->GetDataPath(); - model_paths.ts_sp_model = safety_model_info_->GetSpModelPath(); - - if (!safety_config->allowed_languages().empty() && - language_detection_model_path_) { - model_paths.language_detection_model = *language_detection_model_path_; - } - } - } - if (features::GetOnDeviceModelMustUseSafetyModel()) { CHECK(safety_config); CHECK(!model_paths.ts_data.empty() && !model_paths.ts_sp_model.empty()); if (!safety_config->allowed_languages().empty()) { CHECK(!model_paths.language_detection_model.empty()); } } - auto adapter = GetFeatureAdapter(feature); - CHECK(adapter); std::optional<on_device_model::AdaptationAssetPaths> adaptation_assets; if (features::internal::IsOnDeviceModelAdaptationEnabled(feature)) {
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc index 8cc9bf5..3928580 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc
@@ -97,8 +97,7 @@ {"on_device_model_context_token_chunk_size", "4"}, {"on_device_model_topk", "1"}, {"on_device_model_temperature", "0"}}}, - {features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}}}}, + {features::kTextSafetyClassifier, {}}}, {}); prefs::RegisterLocalStatePrefs(pref_service_.registry()); @@ -133,6 +132,7 @@ WriteFeatureConfig(*params.config, params.config2); } else { proto::OnDeviceModelExecutionFeatureConfig default_config; + default_config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, default_config); WriteFeatureConfig(default_config); } @@ -436,6 +436,8 @@ {}); proto::OnDeviceModelExecutionFeatureConfig config_compose, config_test; + config_compose.set_can_skip_text_safety(true); + config_test.set_can_skip_text_safety(true); PopulateConfigForFeature(ModelBasedCapabilityKey::kCompose, config_compose); PopulateConfigForFeature(ModelBasedCapabilityKey::kTest, config_test); @@ -809,11 +811,10 @@ } TEST_F(OnDeviceModelServiceControllerTest, SessionRequiresSafetyModel) { - Initialize(); - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeatureWithParameters( - features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "true"}}); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); // No safety model received yet. { @@ -991,6 +992,23 @@ "Compose", OnDeviceModelEligibilityReason::kSuccess, 1); } + + // No safety model received yet but feature flag should disable safety check. + { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature(features::kTextSafetyClassifier); + base::HistogramTester histogram_tester; + + test_controller_->MaybeUpdateSafetyModel(std::nullopt); + EXPECT_TRUE(test_controller_->CreateSession( + kFeature, base::DoNothing(), logger_.GetWeakPtr(), nullptr, + /*config_params=*/std::nullopt)); + + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceModelEligibilityReason." + "Compose", + OnDeviceModelEligibilityReason::kSuccess, 1); + } } TEST(SafetyConfigTest, MissingScoreIsUnsafe) { @@ -1022,12 +1040,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, DefaultOutputSafetyPasses) { - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "true"}, - {"on_device_retract_unsafe_content", "true"}}); + {{"on_device_retract_unsafe_content", "true"}}); { auto safety_config = @@ -1072,12 +1093,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, DefaultOutputSafetyFails) { - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "true"}, - {"on_device_retract_unsafe_content", "true"}}); + {{"on_device_retract_unsafe_content", "true"}}); { auto safety_config = @@ -1117,12 +1141,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, SafetyModelUsedButNoRetract) { - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "true"}, - {"on_device_retract_unsafe_content", "false"}}); + {{"on_device_retract_unsafe_content", "false"}}); { auto safety_config = @@ -1168,7 +1195,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1219,7 +1249,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { auto safety_config = @@ -1232,6 +1265,10 @@ AddPageUrlSubstitution(input_template); check->mutable_safety_category_thresholds()->Add(ForbidUnsafe()); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should pass the default raw output safety check @@ -1269,7 +1306,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "false"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { auto safety_config = @@ -1321,7 +1361,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { auto safety_config = @@ -1334,6 +1377,10 @@ AddPageUrlSubstitution(input_template); // Omitted check thresholds, should fallback to default. SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should pass the default raw output safety check @@ -1372,7 +1419,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1387,6 +1437,10 @@ AddPageUrlSubstitution(input_template); check->mutable_safety_category_thresholds()->Add(ForbidUnsafe()); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should pass the default raw output safety check @@ -1426,6 +1480,10 @@ AddPageUrlSubstitution(input_template); check->mutable_safety_category_thresholds()->Add(ForbidUnsafe()); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should pass the default raw output safety check @@ -1526,7 +1584,10 @@ feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1542,6 +1603,10 @@ check->mutable_safety_category_thresholds()->Add(ForbidUnsafe()); check->set_check_language_only(true); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should pass the default raw output safety check @@ -1580,10 +1645,12 @@ base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}, - {"on_device_retract_unsafe_content", "true"}}); + {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1598,6 +1665,10 @@ input_template->set_string_template("safe_text in esperanto: %s"); AddStringValueSubstitution(input_template); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should be used in the raw output check. @@ -1635,10 +1706,12 @@ base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}, - {"on_device_retract_unsafe_content", "true"}}); + {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1653,6 +1726,10 @@ input_template->set_string_template("unsafe_text in esperanto: %s"); AddStringValueSubstitution(input_template); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should be used in the raw output check. @@ -1691,10 +1768,12 @@ base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}, - {"on_device_retract_unsafe_content", "true"}}); + {{"on_device_retract_unsafe_content", "true"}}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { // Configure a request safety check on the PageUrl. @@ -1707,6 +1786,10 @@ input_template->set_string_template("safe_text in unknown language: %s"); AddStringValueSubstitution(input_template); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } // This should be used in the raw output check. @@ -1741,12 +1824,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, SafetyModelDarkMode) { - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}, - {"on_device_retract_unsafe_content", "false"}}); + {{"on_device_retract_unsafe_content", "false"}}); { auto safety_config = @@ -1755,6 +1841,10 @@ safety_config->mutable_safety_category_thresholds()->Add( RequireReasonable()); SetFeatureTextSafetyConfiguration(std::move(safety_config)); + + std::unique_ptr<optimization_guide::ModelInfo> ld_model_info = + TestModelInfoBuilder().SetVersion(123).Build(); + test_controller_->SetLanguageDetectionModel(*ld_model_info); } auto session = test_controller_->CreateSession( @@ -1786,12 +1876,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, SafetyModelDarkModeNoFeatureConfig) { - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(true); + Initialize({.config = config}); + base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeatureWithParameters( features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "false"}, - {"on_device_retract_unsafe_content", "false"}}); + {{"on_device_retract_unsafe_content", "false"}}); proto::TextSafetyModelMetadata model_metadata; auto* other_feature_safety_config = @@ -2206,6 +2299,7 @@ TEST_F(OnDeviceModelServiceControllerTest, AddContextInvalidConfig) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); config.set_feature(ToModelExecutionFeatureProto(kFeature)); Initialize({.config = config}); @@ -2236,6 +2330,7 @@ TEST_F(OnDeviceModelServiceControllerTest, ExecuteInvalidConfig) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); config.set_feature(ToModelExecutionFeatureProto(kFeature)); Initialize({.config = config}); @@ -2386,6 +2481,7 @@ TEST_F(OnDeviceModelServiceControllerTest, RedactedField) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeatureWithRedactRule(config, "bar"); Initialize({.config = config}); @@ -2430,6 +2526,7 @@ TEST_F(OnDeviceModelServiceControllerTest, RejectedField) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeatureWithRedactRule(config, "bar", proto::RedactBehavior::REJECT); Initialize({.config = config}); @@ -2465,6 +2562,7 @@ TEST_F(OnDeviceModelServiceControllerTest, UsePreviousResponseForRewrite) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeatureWithRedactRule(config, "bar"); // Add a rule that identifies `previous_response` of `rewrite_params`. auto& output_config = *config.mutable_output_config(); @@ -2491,6 +2589,7 @@ TEST_F(OnDeviceModelServiceControllerTest, ReplacementText) { proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeatureWithRedactRule(config, "bar") .set_replacement_string("[redacted]"); Initialize({.config = config}); @@ -2715,6 +2814,7 @@ base::HistogramTester histogram_tester; proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, config); Initialize({.config = config}); @@ -2747,6 +2847,7 @@ base::HistogramTester histogram_tester; proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, config); // Set input url proto field for text safety to just be user input. auto* input_url_proto_field = config.mutable_text_safety_fallback_config() @@ -2827,6 +2928,7 @@ base::HistogramTester histogram_tester; proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, config); // Create an empty ts fallback config which is valid and will call the // fallback. @@ -2906,6 +3008,7 @@ base::HistogramTester histogram_tester; proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, config); // Create an empty ts fallback config which is valid and will call the // fallback. @@ -2961,6 +3064,7 @@ feature_list.InitAndEnableFeature(features::kTextSafetyRemoteFallback); proto::OnDeviceModelExecutionFeatureConfig config; + config.set_can_skip_text_safety(true); PopulateConfigForFeature(kFeature, config); // Create an empty ts fallback config which is valid and will call the // fallback. @@ -3071,7 +3175,11 @@ {{"on_device_text_safety_token_interval", "0"}}}, }, {}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + { auto safety_config = std::make_unique<proto::FeatureTextSafetyConfiguration>(); @@ -3143,7 +3251,11 @@ {{"on_device_text_safety_token_interval", "3"}}}, }, {}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); + { auto safety_config = std::make_unique<proto::FeatureTextSafetyConfiguration>(); @@ -3203,13 +3315,15 @@ {{features::kOptimizationGuideOnDeviceModel, {{"on_device_model_retract_repeats", "false"}}}, {features::kTextSafetyClassifier, - {{"on_device_must_use_safety_model", "true"}, - {"on_device_retract_unsafe_content", "true"}, + {{"on_device_retract_unsafe_content", "true"}, {"on_device_text_safety_token_interval", base::NumberToString(GetParam())}}}}, {}); - Initialize(); + proto::OnDeviceModelExecutionFeatureConfig config; + PopulateConfigForFeature(kFeature, config); + config.set_can_skip_text_safety(false); + Initialize({.config = config}); { auto safety_config =
diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc index caf19eb2..62b2a33 100644 --- a/components/optimization_guide/core/optimization_guide_features.cc +++ b/components/optimization_guide/core/optimization_guide_features.cc
@@ -752,12 +752,6 @@ return kOnDeviceModelShouldRetractUnsafeContent.Get(); } -bool GetOnDeviceModelMustUseSafetyModel() { - static const base::FeatureParam<bool> kOnDeviceModelMustUseSafetyModel{ - &kTextSafetyClassifier, "on_device_must_use_safety_model", false}; - return kOnDeviceModelMustUseSafetyModel.Get(); -} - bool ShouldUseTextSafetyClassifierModel() { return base::FeatureList::IsEnabled(kTextSafetyClassifier); }
diff --git a/components/optimization_guide/core/optimization_guide_features.h b/components/optimization_guide/core/optimization_guide_features.h index 2017cb6..622acf8 100644 --- a/components/optimization_guide/core/optimization_guide_features.h +++ b/components/optimization_guide/core/optimization_guide_features.h
@@ -445,10 +445,6 @@ COMPONENT_EXPORT(OPTIMIZATION_GUIDE_FEATURES) bool GetOnDeviceModelRetractUnsafeContent(); -// Returns true if the safety model must be used. -COMPONENT_EXPORT(OPTIMIZATION_GUIDE_FEATURES) -bool GetOnDeviceModelMustUseSafetyModel(); - // Whether we should initiate download of the text safety classifier model. COMPONENT_EXPORT(OPTIMIZATION_GUIDE_FEATURES) bool ShouldUseTextSafetyClassifierModel();
diff --git a/components/optimization_guide/core/prediction_manager.cc b/components/optimization_guide/core/prediction_manager.cc index 5b870db..5695dfd2 100644 --- a/components/optimization_guide/core/prediction_manager.cc +++ b/components/optimization_guide/core/prediction_manager.cc
@@ -357,10 +357,6 @@ static_cast<int>( *base_model_info.supported_model_engine_versions().begin())); - if (switches::IsModelOverridePresent()) { - return; - } - if (!ShouldFetchModels(off_the_record_, component_updates_enabled_provider_.Run())) { return; @@ -401,21 +397,16 @@ prediction_model_download_manager_->CancelAllPendingDownloads(); } - // NOTE: ALL PRECONDITIONS FOR THIS FUNCTION MUST BE CHECKED ABOVE THIS LINE. - // It is assumed that if we proceed past here, that a fetch will at least be - // attempted. - - if (!prediction_model_fetcher_) { - prediction_model_fetcher_ = std::make_unique<PredictionModelFetcherImpl>( - url_loader_factory_, - features::GetOptimizationGuideServiceGetModelsURL()); - } - std::vector<proto::ModelInfo> models_info = std::vector<proto::ModelInfo>(); models_info.reserve(model_registration_info_map_.size()); // For now, we will fetch for all registered optimization targets. for (const auto& registration_info : model_registration_info_map_) { + if (GetModelOverrideForOptimizationTarget(registration_info.first)) { + // Do not download models that were overriden. + continue; + } + proto::ModelInfo model_info(base_model_info); model_info.set_optimization_target(registration_info.first); if (registration_info.second.metadata) { @@ -439,6 +430,19 @@ RecordLifecycleState(registration_info.first, ModelDeliveryEvent::kGetModelsRequest); } + if (models_info.empty()) { + return; + } + + // NOTE: ALL PRECONDITIONS FOR THIS FUNCTION MUST BE CHECKED ABOVE THIS LINE. + // It is assumed that if we proceed past here, that a fetch will at least be + // attempted. + + if (!prediction_model_fetcher_) { + prediction_model_fetcher_ = std::make_unique<PredictionModelFetcherImpl>( + url_loader_factory_, + features::GetOptimizationGuideServiceGetModelsURL()); + } bool fetch_initiated = prediction_model_fetcher_->FetchOptimizationGuideServiceModels( @@ -630,13 +634,15 @@ void PredictionManager::OnModelReady(const base::FilePath& base_model_dir, const proto::PredictionModel& model) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (switches::IsModelOverridePresent()) { - return; - } - DCHECK(model.model_info().has_version() && model.model_info().has_optimization_target()); + if (GetModelOverrideForOptimizationTarget( + model.model_info().optimization_target())) { + // Skip updating the model if override is present. + return; + } + RecordModelUpdateVersion(model.model_info()); RecordLifecycleState(model.model_info().optimization_target(), ModelDeliveryEvent::kModelDownloaded);
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 9026cba..5015c9c 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 9026cbaf11679a8d8aaf6ae05dc7e8d016487961 +Subproject commit 5015c9cb9b8a8b5bd5dcfd6cbaa7b41e1d2af2d7
diff --git a/components/optimization_guide/proto/on_device_model_execution_config.proto b/components/optimization_guide/proto/on_device_model_execution_config.proto index cce6a33e..2bc556e 100644 --- a/components/optimization_guide/proto/on_device_model_execution_config.proto +++ b/components/optimization_guide/proto/on_device_model_execution_config.proto
@@ -34,6 +34,9 @@ // The config used to construct the request for server fallback text safety // evaluation. optional TextSafetyFallbackConfig text_safety_fallback_config = 4; + + // Whether text safety can be skipped for this feature, if not configured. + optional bool can_skip_text_safety = 5; } message OnDeviceModelExecutionInputConfig {
diff --git a/components/performance_manager/features.cc b/components/performance_manager/features.cc index 41613d0..26269ff 100644 --- a/components/performance_manager/features.cc +++ b/components/performance_manager/features.cc
@@ -15,13 +15,9 @@ namespace performance_manager::features { -BASE_FEATURE(kRunOnMainThread, - "RunPerformanceManagerOnMainThread", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kRunOnMainThreadSync, "RunPerformanceManagerOnMainThreadSync", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); #if !BUILDFLAG(IS_ANDROID) BASE_FEATURE(kBackgroundTabLoadingFromPerformanceManager,
diff --git a/components/performance_manager/graph/policies/process_priority_policy.cc b/components/performance_manager/graph/policies/process_priority_policy.cc index 17a01118..dc269a5 100644 --- a/components/performance_manager/graph/policies/process_priority_policy.cc +++ b/components/performance_manager/graph/policies/process_priority_policy.cc
@@ -73,8 +73,7 @@ // If the PM is already running on the UI thread, improve performance by // skipping the thread-hop. - if (base::FeatureList::IsEnabled(features::kRunOnMainThread) || - base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)) { + if (base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)) { SetProcessPriorityOnUIThread(process_node->GetRenderProcessHostProxy(), foreground); return;
diff --git a/components/performance_manager/graph/policies/process_priority_policy_unittest.cc b/components/performance_manager/graph/policies/process_priority_policy_unittest.cc index 4f021c2..538ffb7 100644 --- a/components/performance_manager/graph/policies/process_priority_policy_unittest.cc +++ b/components/performance_manager/graph/policies/process_priority_policy_unittest.cc
@@ -51,20 +51,13 @@ })); } -struct PMThreadingConfiguration { - bool run_on_main_thread; - bool run_on_main_thread_sync; -}; - // Tests ProcessPriorityPolicy in different threading configurations. -class ProcessPriorityPolicyTest - : public PerformanceManagerTestHarness, - public ::testing::WithParamInterface<PMThreadingConfiguration> { +class ProcessPriorityPolicyTest : public PerformanceManagerTestHarness, + public ::testing::WithParamInterface<bool> { public: ProcessPriorityPolicyTest() { - scoped_feature_list_.InitWithFeatureStates( - {{features::kRunOnMainThread, GetParam().run_on_main_thread}, - {features::kRunOnMainThreadSync, GetParam().run_on_main_thread_sync}}); + scoped_feature_list_.InitWithFeatureState(features::kRunOnMainThreadSync, + GetParam()); } ProcessPriorityPolicyTest(const ProcessPriorityPolicyTest&) = delete; @@ -118,18 +111,7 @@ base::RepeatingClosure quit_closure_ = task_environment()->QuitClosure(); }; -INSTANTIATE_TEST_SUITE_P( - , - ProcessPriorityPolicyTest, - ::testing::Values( - PMThreadingConfiguration{.run_on_main_thread = false, - .run_on_main_thread_sync = false}, - - PMThreadingConfiguration{.run_on_main_thread = true, - .run_on_main_thread_sync = false}, - - PMThreadingConfiguration{.run_on_main_thread = false, - .run_on_main_thread_sync = true})); +INSTANTIATE_TEST_SUITE_P(, ProcessPriorityPolicyTest, ::testing::Bool()); } // namespace
diff --git a/components/performance_manager/performance_manager_impl.cc b/components/performance_manager/performance_manager_impl.cc index e12fe60..72535a56 100644 --- a/components/performance_manager/performance_manager_impl.cc +++ b/components/performance_manager/performance_manager_impl.cc
@@ -210,17 +210,10 @@ std::unique_ptr<PerformanceManagerImpl> instance = base::WrapUnique(new PerformanceManagerImpl()); - if (base::FeatureList::IsEnabled(features::kRunOnMainThread)) { - // Invoke `OnStartImpl()` synchronously instead of via a posted task, so - // that any call to `CallOnGraphImpl()` that follows can access - // `g_performance_manager->ui_task_runner_`. - instance->OnStartImpl(std::move(on_start)); - } else { - GetTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&PerformanceManagerImpl::OnStartImpl, - base::Unretained(instance.get()), std::move(on_start))); - } + GetTaskRunner()->PostTask( + FROM_HERE, + base::BindOnce(&PerformanceManagerImpl::OnStartImpl, + base::Unretained(instance.get()), std::move(on_start))); return instance; } @@ -348,30 +341,11 @@ PerformanceManagerImpl::PerformanceManagerImpl() { DETACH_FROM_SEQUENCE(sequence_checker_); - if (base::FeatureList::IsEnabled(features::kRunOnMainThread)) { - ui_task_runner_ = GetUITaskRunner(); - } } // static scoped_refptr<base::SequencedTaskRunner> PerformanceManagerImpl::GetTaskRunner() { - if (base::FeatureList::IsEnabled(features::kRunOnMainThread)) { - CHECK(!base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)); - // Used the cached runner, if available. This prevents doing repeated - // lookups. - if (g_performance_manager) - return g_performance_manager->ui_task_runner_; - // Our semantics are that this always returns a valid task runner as long - // as there is a task environment alive. We can't cache this in a local - // static variable because it will become invalid across test boundaries. - // Note that this doesn't result in a new task runner being created; it - // simply causes a table lookup to find the existing task runner with the - // appropriate type, which will be the same task runner that was cached by - // |g_performance_manager| while it was alive. - return GetUITaskRunner(); - } - if (base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)) { return TaskRunnerWithSynchronousRunOnUIThread::GetInstance(); }
diff --git a/components/performance_manager/public/features.h b/components/performance_manager/public/features.h index 2eab928..4e3ae5c0 100644 --- a/components/performance_manager/public/features.h +++ b/components/performance_manager/public/features.h
@@ -15,15 +15,8 @@ namespace performance_manager::features { -// If enabled the PM runs on the main (UI) thread. Cannot be enabled -// simultaneously with `kRunOnMainThreadSync`. -BASE_DECLARE_FEATURE(kRunOnMainThread); - // If enabled, the PM runs on the main (UI) thread *and* tasks posted to the PM -// TaskRunner from the main (UI) thread run synchronously. Cannot be enabled -// simultaneously with `kRunOnMainThread`. This is a standalone feature rather -// than a param on `kRunOnMainThreadSync` because accessing the state of a -// `base::Feature` is faster than accessing the state of a `base::FeatureParam`. +// TaskRunner from the main (UI) thread run synchronously. BASE_DECLARE_FEATURE(kRunOnMainThreadSync); #if !BUILDFLAG(IS_ANDROID)
diff --git a/components/performance_manager/resource_attribution/query_scheduler_unittest.cc b/components/performance_manager/resource_attribution/query_scheduler_unittest.cc index 7aacca6..17f7974 100644 --- a/components/performance_manager/resource_attribution/query_scheduler_unittest.cc +++ b/components/performance_manager/resource_attribution/query_scheduler_unittest.cc
@@ -53,13 +53,12 @@ namespace { using performance_manager::features::kResourceAttributionIncludeOrigins; -using performance_manager::features::kRunOnMainThread; using performance_manager::features::kRunOnMainThreadSync; using ::testing::_; +using ::testing::Bool; using ::testing::ElementsAre; using ::testing::IsEmpty; using ::testing::UnorderedElementsAre; -using ::testing::Values; using ::testing::WithParamInterface; std::unique_ptr<QueryParams> CreateQueryParams( @@ -92,7 +91,7 @@ class ResourceAttrQuerySchedulerTest : public performance_manager::GraphTestHarness, - public WithParamInterface<const base::Feature*> { + public WithParamInterface<bool> { protected: using Super = performance_manager::GraphTestHarness; @@ -100,7 +99,7 @@ std::vector<base::test::FeatureRef> enabled_features{ kResourceAttributionIncludeOrigins}; if (GetParam()) { - enabled_features.push_back(*GetParam()); + enabled_features.push_back(kRunOnMainThreadSync); } scoped_feature_list_.InitWithFeatures(enabled_features, {}); } @@ -122,32 +121,20 @@ FakeMemoryMeasurementDelegateFactory memory_delegate_factory_; }; -INSTANTIATE_TEST_SUITE_P(All, - ResourceAttrQuerySchedulerTest, - Values(nullptr, - &kRunOnMainThread, - &kRunOnMainThreadSync)); +INSTANTIATE_TEST_SUITE_P(All, ResourceAttrQuerySchedulerTest, Bool()); class ResourceAttrQuerySchedulerPMTest : public performance_manager::PerformanceManagerTestHarness, - public WithParamInterface<const base::Feature*> { + public WithParamInterface<bool> { protected: ResourceAttrQuerySchedulerPMTest() { - std::vector<base::test::FeatureRef> enabled_features; - if (GetParam()) { - enabled_features.push_back(*GetParam()); - } - scoped_feature_list_.InitWithFeatures(enabled_features, {}); + scoped_feature_list_.InitWithFeatureState(kRunOnMainThreadSync, GetParam()); } base::test::ScopedFeatureList scoped_feature_list_; }; -INSTANTIATE_TEST_SUITE_P(All, - ResourceAttrQuerySchedulerPMTest, - Values(nullptr, - &kRunOnMainThread, - &kRunOnMainThreadSync)); +INSTANTIATE_TEST_SUITE_P(All, ResourceAttrQuerySchedulerPMTest, Bool()); TEST_P(ResourceAttrQuerySchedulerTest, AddRemoveQueries) { performance_manager::MockMultiplePagesWithMultipleProcessesGraph mock_graph(
diff --git a/components/performance_manager/v8_memory/v8_memory_test_helpers.cc b/components/performance_manager/v8_memory/v8_memory_test_helpers.cc index 4c4204e..50c13ec 100644 --- a/components/performance_manager/v8_memory/v8_memory_test_helpers.cc +++ b/components/performance_manager/v8_memory/v8_memory_test_helpers.cc
@@ -180,8 +180,7 @@ void V8MemoryPerformanceManagerTestHarness::SetUp() { PerformanceManagerTestHarness::SetUp(); - if (!base::FeatureList::IsEnabled(features::kRunOnMainThread) && - !base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)) { + if (!base::FeatureList::IsEnabled(features::kRunOnMainThreadSync)) { // Precondition: CallOnGraph must run on a different sequence. Note that // all tasks passed to CallOnGraph will only run when run_loop.Run() is // called.
diff --git a/components/permissions/permission_request_manager_unittest.cc b/components/permissions/permission_request_manager_unittest.cc index 7f7fe24..faf6dff3 100644 --- a/components/permissions/permission_request_manager_unittest.cc +++ b/components/permissions/permission_request_manager_unittest.cc
@@ -574,14 +574,15 @@ QuicklyDeletedRequest(const GURL& requesting_origin, RequestType request_type, PermissionRequestGestureType gesture_type) - : PermissionRequest(requesting_origin, - request_type, - gesture_type == PermissionRequestGestureType::GESTURE, - base::BindLambdaForTesting( - [](ContentSetting result, - bool is_one_time, - bool is_final_decision) { NOTREACHED(); }), - base::NullCallback()) {} + : PermissionRequest( + requesting_origin, + request_type, + gesture_type == PermissionRequestGestureType::GESTURE, + base::BindLambdaForTesting( + [](ContentSetting result, + bool is_one_time, + bool is_final_decision) { NOTREACHED_IN_MIGRATION(); }), + base::NullCallback()) {} static std::unique_ptr<QuicklyDeletedRequest> CreateRequest( MockPermissionRequest* request) {
diff --git a/components/safe_browsing/content/browser/client_side_detection_host.cc b/components/safe_browsing/content/browser/client_side_detection_host.cc index db4b430..4fddd61 100644 --- a/components/safe_browsing/content/browser/client_side_detection_host.cc +++ b/components/safe_browsing/content/browser/client_side_detection_host.cc
@@ -392,7 +392,7 @@ // We want to limit the number of requests, but if we're dumping features // for debugging, allow us to exceed the report limit. if (!HasDebugFeatureDirectory() && csd_service_ && - csd_service_->OverPhishingReportLimit()) { + csd_service_->AtPhishingReportLimit()) { DontClassifyForPhishing( PreClassificationCheckResult::NO_CLASSIFY_TOO_MANY_REPORTS); }
diff --git a/components/safe_browsing/content/browser/client_side_detection_service.cc b/components/safe_browsing/content/browser/client_side_detection_service.cc index 2b9ee37..392205b 100644 --- a/components/safe_browsing/content/browser/client_side_detection_service.cc +++ b/components/safe_browsing/content/browser/client_side_detection_service.cc
@@ -111,7 +111,22 @@ prefs::kSafeBrowsingScoutReportingEnabled, base::BindRepeating(&ClientSideDetectionService::OnPrefsUpdated, base::Unretained(this))); - // Do an initial check of the prefs. + + // If we fail to load the report times, we will not know how many pings the + // user has sent already. In this case, we will assume the user has sent + // enough pings and skip the phishing URL check. + // TODO: (andysjlim): clean up the ifs and logs if the uma never logs false. + if (LoadPhishingReportTimesFromPrefs()) { + skip_phishing_request_check_ = false; + base::UmaHistogramBoolean( + "SBClientPhishing.LoadReportTimesFromPrefAtServiceCreationSuccessful", + true); + } else { + base::UmaHistogramBoolean( + "SBClientPhishing.LoadReportTimesFromPrefAtServiceCreationSuccessful", + false); + } + // Do an initial check of the prefs. OnPrefsUpdated(); } @@ -303,6 +318,11 @@ resource_request->url = GetClientReportUrl(kClientReportPhishingUrl); resource_request->method = "POST"; resource_request->load_flags = net::LOAD_DISABLE_CACHE; + + // Record that we made a request. Logged before the request is made + // to ensure it gets recorded. + AddPhishingReport(base::Time::Now()); + auto loader = network::SimpleURLLoader::Create(std::move(resource_request), traffic_annotation); loader->AttachStringForUpload(request_data, "application/octet-stream"); @@ -319,9 +339,6 @@ info->phishing_url = GURL(request->url()); client_phishing_reports_[loader_ptr] = std::move(info); - // Record that we made a request - AddPhishingReport(base::Time::Now()); - // The following is to log this ClientPhishingRequest on any open // chrome://safe-browsing pages. If no such page is open, the request is // dropped and the |request| object deleted. @@ -416,15 +433,23 @@ } } -bool ClientSideDetectionService::OverPhishingReportLimit() { +bool ClientSideDetectionService::AtPhishingReportLimit() { + base::UmaHistogramBoolean("SBClientPhishing.SkipPhishingRequestCheck", + skip_phishing_request_check_); + // If |skip_phishing_request_check_| is true, that means we failed to load the + // report times from prefs before from class initialization. + if (skip_phishing_request_check_) { + return true; + } + // `delegate_` and prefs can be null in unit tests. if (base::FeatureList::IsEnabled(kSafeBrowsingDailyPhishingReportsLimit) && (delegate_ && delegate_->GetPrefs()) && IsEnhancedProtectionEnabled(*delegate_->GetPrefs())) { - return GetPhishingNumReports() > + return GetPhishingNumReports() >= kSafeBrowsingDailyPhishingReportsLimitESB.Get(); } - return GetPhishingNumReports() > kMaxReportsPerInterval; + return GetPhishingNumReports() >= kMaxReportsPerInterval; } int ClientSideDetectionService::GetPhishingNumReports() { @@ -443,6 +468,8 @@ } if (!delegate_ || !delegate_->GetPrefs()) { + base::UmaHistogramBoolean("SBClientPhishing.AddPhishingReportSuccessful", + false); return; } @@ -452,11 +479,14 @@ } delegate_->GetPrefs()->SetList(prefs::kSafeBrowsingCsdPingTimestamps, std::move(time_list)); + base::UmaHistogramBoolean("SBClientPhishing.AddPhishingReportSuccessful", + true); } -void ClientSideDetectionService::LoadPhishingReportTimesFromPrefs() { +bool ClientSideDetectionService::LoadPhishingReportTimesFromPrefs() { + // delegate and prefs can be null in unit tests. if (!delegate_ || !delegate_->GetPrefs()) { - return; + return false; } phishing_report_times_.clear(); @@ -465,6 +495,8 @@ phishing_report_times_.push_back( base::Time::FromSecondsSinceUnixEpoch(timestamp.GetDouble())); } + + return true; } // static
diff --git a/components/safe_browsing/content/browser/client_side_detection_service.h b/components/safe_browsing/content/browser/client_side_detection_service.h index 2f91b8d..a1cf7af 100644 --- a/components/safe_browsing/content/browser/client_side_detection_service.h +++ b/components/safe_browsing/content/browser/client_side_detection_service.h
@@ -140,9 +140,9 @@ // Returns true and sets is_phishing if url is in the cache and valid. virtual bool GetValidCachedResult(const GURL& url, bool* is_phishing); - // Returns true if we have sent more than kMaxReportsPerInterval phishing + // Returns true if we have sent at least kMaxReportsPerInterval phishing // reports in the last kReportsInterval. - virtual bool OverPhishingReportLimit(); + virtual bool AtPhishingReportLimit(); // Sends a model to each renderer. virtual void SendModelToRenderers(); @@ -212,6 +212,8 @@ ServiceObjectDeletedBeforeCallbackDone); FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, SendClientReportPhishingRequest); + FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, + GetNumReportTestWhenPrefsPreloaded); FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, GetNumReportTest); FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, GetNumReportTestESB); FRIEND_TEST_ALL_PREFIXES(ClientSideDetectionServiceTest, @@ -266,7 +268,8 @@ void AddPhishingReport(base::Time timestamp); // Populates |phishing_report_times_| with the data stored in local prefs. - void LoadPhishingReportTimesFromPrefs(); + // Return bool value represents whether the load was successful or not. + bool LoadPhishingReportTimesFromPrefs(); // Returns the URL that will be used for phishing requests. static GURL GetClientReportUrl(const std::string& report_url); @@ -274,6 +277,11 @@ // content::RenderProcessHostCreationObserver: void OnRenderProcessHostCreated(content::RenderProcessHost* rph) override; + // If we fail to load the report times, we will not know how many pings the + // user has sent already. In this case, we will assume the user has sent + // enough pings and skip the phishing URL check. + bool skip_phishing_request_check_ = true; + // Whether the service is running or not. When the service is not running, // it won't download the model nor report detected phishing URLs. bool enabled_ = false;
diff --git a/components/services/storage/public/cpp/filesystem/filesystem_impl.cc b/components/services/storage/public/cpp/filesystem/filesystem_impl.cc index 965f343..7a311d7 100644 --- a/components/services/storage/public/cpp/filesystem/filesystem_impl.cc +++ b/components/services/storage/public/cpp/filesystem/filesystem_impl.cc
@@ -277,8 +277,10 @@ #if !BUILDFLAG(IS_FUCHSIA) base::File::Error error = file.Lock(base::File::LockMode::kExclusive); - if (error != base::File::FILE_OK) + if (error != base::File::FILE_OK) { + UnlockFileLocal(path); return base::unexpected(error); + } #endif return file;
diff --git a/components/supervised_user/OWNERS b/components/supervised_user/OWNERS index 9db576a4..961c5b8 100644 --- a/components/supervised_user/OWNERS +++ b/components/supervised_user/OWNERS
@@ -4,15 +4,16 @@ # These CLs will be automatically reassigned to a reviewer within # about 5 minutes. This approach helps our team to load-balance incoming # reviews. Googlers can read more about this at go/gwsq-gerrit. +chrome-family-kids-reviews@google.com # ChromeOS -agawronska@chromium.org -courtneywong@chromium.org +agawronska@chromium.org #{LAST_RESORT_SUGGESTION} +courtneywong@chromium.org #{LAST_RESORT_SUGGESTION} # Chrome Browser -fernandex@chromium.org -ljjlee@google.com -tju@google.com +fernandex@chromium.org #{LAST_RESORT_SUGGESTION} +ljjlee@google.com #{LAST_RESORT_SUGGESTION} +tju@google.com #{LAST_RESORT_SUGGESTION} # Previous owner, feel free to add for any questions or historical context: # treib@chromium.org
diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index d776e5d0..03a4c6e1 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn
@@ -214,6 +214,7 @@ "skip_next.icon", "skip_previous.icon", "sms.icon", + "stop_circle.icon", "storage_access.icon", "storage_access_off.icon", "submenu_arrow.icon",
diff --git a/components/vector_icons/stop_circle.icon b/components/vector_icons/stop_circle.icon new file mode 100644 index 0000000..7e7ba20 --- /dev/null +++ b/components/vector_icons/stop_circle.icon
@@ -0,0 +1,42 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 960, +FILL_RULE_NONZERO, +MOVE_TO, 320, 640, +R_H_LINE_TO, 320, +R_V_LINE_TO, -320, +H_LINE_TO, 320, +R_V_LINE_TO, 320, +CLOSE, +MOVE_TO, 480, 880, +R_QUADRATIC_TO, -83, 0, -156, -31.5f, +QUADRATIC_TO_SHORTHAND, 197, 763, +R_QUADRATIC_TO, -54, -54, -85.5f, -127, +QUADRATIC_TO_SHORTHAND, 80, 480, +R_QUADRATIC_TO, 0, -83, 31.5f, -156, +QUADRATIC_TO_SHORTHAND, 197, 197, +R_QUADRATIC_TO, 54, -54, 127, -85.5f, +QUADRATIC_TO_SHORTHAND, 480, 80, +R_QUADRATIC_TO, 83, 0, 156, 31.5f, +QUADRATIC_TO_SHORTHAND, 763, 197, +R_QUADRATIC_TO, 54, 54, 85.5f, 127, +QUADRATIC_TO_SHORTHAND, 880, 480, +R_QUADRATIC_TO, 0, 83, -31.5f, 156, +QUADRATIC_TO_SHORTHAND, 763, 763, +R_QUADRATIC_TO, -54, 54, -127, 85.5f, +QUADRATIC_TO_SHORTHAND, 480, 880, +CLOSE, +R_MOVE_TO, 0, -80, +R_QUADRATIC_TO, 134, 0, 227, -93, +R_QUADRATIC_TO, 93, -93, 93, -227, +R_QUADRATIC_TO, 0, -134, -93, -227, +R_QUADRATIC_TO, -93, -93, -227, -93, +R_QUADRATIC_TO, -134, 0, -227, 93, +R_QUADRATIC_TO, -93, 93, -93, 227, +R_QUADRATIC_TO, 0, 134, 93, 227, +R_QUADRATIC_TO, 93, 93, 227, 93, +CLOSE, +R_MOVE_TO, 0, -320, +CLOSE
diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc index e07b952..f11d1da 100644 --- a/components/viz/common/features.cc +++ b/components/viz/common/features.cc
@@ -411,7 +411,7 @@ // Use BlitRequests for copy requests made by ViewTransition. BASE_FEATURE(kBlitRequestsForViewTransition, "BlitRequestsForViewTransition", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); bool IsDelegatedCompositingEnabled() { return base::FeatureList::IsEnabled(kDelegatedCompositing);
diff --git a/components/viz/host/gpu_host_impl.cc b/components/viz/host/gpu_host_impl.cc index 903507a..f105bb6 100644 --- a/components/viz/host/gpu_host_impl.cc +++ b/components/viz/host/gpu_host_impl.cc
@@ -78,7 +78,7 @@ FontRenderParams() = default; - ~FontRenderParams() { NOTREACHED(); } + ~FontRenderParams() { NOTREACHED_IN_MIGRATION(); } THREAD_CHECKER(thread_checker_); std::optional<gfx::FontRenderParams> params_;
diff --git a/components/viz/service/display/direct_renderer.cc b/components/viz/service/display/direct_renderer.cc index 1e2b15f..6c495e3 100644 --- a/components/viz/service/display/direct_renderer.cc +++ b/components/viz/service/display/direct_renderer.cc
@@ -99,41 +99,20 @@ } void DirectRenderer::InitializeViewport(DrawingFrame* frame, - const gfx::Rect& draw_rect, - const gfx::Rect& viewport_rect, - const gfx::Size& surface_size) { - DCHECK_GE(viewport_rect.x(), 0); - DCHECK_GE(viewport_rect.y(), 0); - DCHECK_LE(viewport_rect.right(), surface_size.width()); - DCHECK_LE(viewport_rect.bottom(), surface_size.height()); - bool flip_y = FlippedFramebuffer(); - if (flip_y) { - frame->target_to_device_transform = gfx::OrthoProjectionTransform( - draw_rect.x(), draw_rect.right(), draw_rect.bottom(), draw_rect.y()); - } else { - frame->target_to_device_transform = gfx::OrthoProjectionTransform( - draw_rect.x(), draw_rect.right(), draw_rect.y(), draw_rect.bottom()); - } - - gfx::Rect window_rect = viewport_rect; - if (flip_y) - window_rect.set_y(surface_size.height() - viewport_rect.bottom()); - frame->target_to_device_transform.PostConcat( - gfx::WindowTransform(window_rect.x(), window_rect.y(), - window_rect.width(), window_rect.height())); - current_draw_rect_ = draw_rect; - current_viewport_rect_ = viewport_rect; - current_surface_size_ = surface_size; - current_window_space_viewport_ = window_rect; + const gfx::Size& viewport_size) { + const gfx::Rect draw_rect = frame->current_render_pass->output_rect; + frame->target_to_device_transform = gfx::OrthoProjectionTransform( + draw_rect.x(), draw_rect.right(), draw_rect.y(), draw_rect.bottom()); + frame->target_to_device_transform.PostConcat(gfx::WindowTransform( + 0, 0, viewport_size.width(), viewport_size.height())); + current_viewport_size_ = viewport_size; } gfx::Rect DirectRenderer::MoveFromDrawToWindowSpace( const gfx::Rect& draw_rect) const { gfx::Rect window_rect = draw_rect; - window_rect -= current_draw_rect_.OffsetFromOrigin(); - window_rect += current_viewport_rect_.OffsetFromOrigin(); - if (FlippedFramebuffer()) - window_rect.set_y(current_surface_size_.height() - window_rect.bottom()); + window_rect -= + current_frame()->current_render_pass->output_rect.OffsetFromOrigin(); return window_rect; } @@ -465,10 +444,10 @@ } gfx::Rect DirectRenderer::DeviceViewportRectInDrawSpace() const { - gfx::Rect device_viewport_rect(current_frame()->device_viewport_size); - device_viewport_rect -= current_viewport_rect_.OffsetFromOrigin(); - device_viewport_rect += current_draw_rect_.OffsetFromOrigin(); - return device_viewport_rect; + gfx::Rect device_viewport_size(current_frame()->device_viewport_size); + device_viewport_size += + current_frame()->root_render_pass->output_rect.OffsetFromOrigin(); + return device_viewport_size; } gfx::Rect DirectRenderer::OutputSurfaceRectInDrawSpace() const { @@ -853,9 +832,7 @@ // BindFramebufferToTexture(). if (is_root && !output_surface_->capabilities().renderer_allocates_images) { BindFramebufferToOutputSurface(); - InitializeViewport(current_frame(), render_pass->output_rect, - gfx::Rect(current_frame()->device_viewport_size), - current_frame()->device_viewport_size); + InitializeViewport(current_frame(), current_frame()->device_viewport_size); return; } @@ -874,11 +851,7 @@ return; BindFramebufferToTexture(render_pass->id); - InitializeViewport(current_frame(), render_pass->output_rect, - gfx::Rect(render_pass->output_rect.size()), - // If the render pass backing is cached, we might have - // bigger size comparing to the size that was generated. - GetRenderPassBackingPixelSize(render_pass->id)); + InitializeViewport(current_frame(), render_pass->output_rect.size()); } gfx::Rect DirectRenderer::ComputeScissorRectForRenderPass(
diff --git a/components/viz/service/display/direct_renderer.h b/components/viz/service/display/direct_renderer.h index d9bd73b..b932719 100644 --- a/components/viz/service/display/direct_renderer.h +++ b/components/viz/service/display/direct_renderer.h
@@ -223,10 +223,7 @@ const gfx::RectF& quad_rect); // This function takes DrawingFrame as an argument because RenderPass drawing // code uses its computations for buffer sizing. - void InitializeViewport(DrawingFrame* frame, - const gfx::Rect& draw_rect, - const gfx::Rect& viewport_rect, - const gfx::Size& surface_size); + void InitializeViewport(DrawingFrame* frame, const gfx::Size& viewport_size); gfx::Rect MoveFromDrawToWindowSpace(const gfx::Rect& draw_rect) const; gfx::Rect DeviceViewportRectInDrawSpace() const; @@ -313,7 +310,6 @@ // return that quad, otherwise return null. virtual const DrawQuad* CanPassBeDrawnDirectly( const AggregatedRenderPass* pass); - virtual bool FlippedFramebuffer() const = 0; virtual void EnsureScissorTestDisabled() = 0; virtual void DidChangeVisibility() = 0; virtual void CopyDrawnRenderPass( @@ -394,15 +390,11 @@ bool visible_ = false; bool disable_color_checks_for_testing_ = false; - // For use in coordinate conversion, this stores the output rect, viewport - // rect (= unflipped version of glViewport rect), the size of target - // framebuffer, and the current window space viewport. During a draw, this - // stores the values for the current render pass; in between draws, they - // retain the values for the root render pass of the last draw. - gfx::Rect current_draw_rect_; - gfx::Rect current_viewport_rect_; - gfx::Size current_surface_size_; - gfx::Rect current_window_space_viewport_; + // For use in deciding whether to enable the scissor rect test. + // + // During a draw, this stores the value for the current render pass; between + // draws, it retains the value for the root render pass of the last draw. + gfx::Size current_viewport_size_; DrawingFrame* current_frame() { DCHECK(current_frame_valid_);
diff --git a/components/viz/service/display/null_renderer.cc b/components/viz/service/display/null_renderer.cc index bdedbc9..b5da1df 100644 --- a/components/viz/service/display/null_renderer.cc +++ b/components/viz/service/display/null_renderer.cc
@@ -45,10 +45,6 @@ return gfx::Size(); } -bool NullRenderer::FlippedFramebuffer() const { - return false; -} - void NullRenderer::CopyDrawnRenderPass( const copy_output::RenderPassGeometry& geometry, std::unique_ptr<CopyOutputRequest> request) {}
diff --git a/components/viz/service/display/null_renderer.h b/components/viz/service/display/null_renderer.h index c673706..486d6b3e 100644 --- a/components/viz/service/display/null_renderer.h +++ b/components/viz/service/display/null_renderer.h
@@ -48,7 +48,6 @@ const gfx::QuadF* clip_region) override {} void BeginDrawingFrame() override; void FinishDrawingFrame() override {} - bool FlippedFramebuffer() const override; void EnsureScissorTestDisabled() override {} void DidChangeVisibility() override {} void CopyDrawnRenderPass(const copy_output::RenderPassGeometry& geometry,
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index 84bb829..ba1a2454 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -1383,12 +1383,6 @@ #endif } -bool SkiaRenderer::FlippedFramebuffer() const { - // TODO(weiliangc): Make sure flipped correctly for Windows. - // (crbug.com/644851) - return false; -} - void SkiaRenderer::EnsureScissorTestDisabled() { scissor_rect_.reset(); } @@ -1503,7 +1497,7 @@ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("viz.quads"), "SkiaRenderer::BeginDrawingRenderPass"); - if (render_pass_update_rect == current_viewport_rect_) { + if (render_pass_update_rect == gfx::Rect(current_viewport_size_)) { EnsureScissorTestDisabled(); } else { SetScissorTestRect(render_pass_update_rect);
diff --git a/components/viz/service/display/skia_renderer.h b/components/viz/service/display/skia_renderer.h index 6197955..509f41c 100644 --- a/components/viz/service/display/skia_renderer.h +++ b/components/viz/service/display/skia_renderer.h
@@ -112,7 +112,6 @@ void FinishDrawingRenderPass() override; void BeginDrawingFrame() override; void FinishDrawingFrame() override; - bool FlippedFramebuffer() const override; void EnsureScissorTestDisabled() override; void CopyDrawnRenderPass(const copy_output::RenderPassGeometry& geometry, std::unique_ptr<CopyOutputRequest> request) override;
diff --git a/components/viz/service/display/software_renderer.cc b/components/viz/service/display/software_renderer.cc index e0be2bf..acbded3b 100644 --- a/components/viz/service/display/software_renderer.cc +++ b/components/viz/service/display/software_renderer.cc
@@ -127,10 +127,6 @@ output_surface_->SwapBuffers(std::move(output_frame)); } -bool SoftwareRenderer::FlippedFramebuffer() const { - return false; -} - void SoftwareRenderer::EnsureScissorTestDisabled() { is_scissor_enabled_ = false; } @@ -232,7 +228,7 @@ const AggregatedRenderPass* render_pass, bool needs_clear, const gfx::Rect& render_pass_update_rect) { - if (render_pass_update_rect == current_viewport_rect_) { + if (render_pass_update_rect == gfx::Rect(current_viewport_size_)) { EnsureScissorTestDisabled(); } else { SetScissorTestRect(render_pass_update_rect);
diff --git a/components/viz/service/display/software_renderer.h b/components/viz/service/display/software_renderer.h index f72b85a..a9cda79 100644 --- a/components/viz/service/display/software_renderer.h +++ b/components/viz/service/display/software_renderer.h
@@ -68,7 +68,6 @@ void DoDrawQuad(const DrawQuad* quad, const gfx::QuadF* draw_region) override; void BeginDrawingFrame() override; void FinishDrawingFrame() override; - bool FlippedFramebuffer() const override; void EnsureScissorTestDisabled() override; void CopyDrawnRenderPass(const copy_output::RenderPassGeometry& geometry, std::unique_ptr<CopyOutputRequest> request) override;
diff --git a/components/viz/service/frame_sinks/compositor_frame_sink_support.cc b/components/viz/service/frame_sinks/compositor_frame_sink_support.cc index 5549f14..61b3f16 100644 --- a/components/viz/service/frame_sinks/compositor_frame_sink_support.cc +++ b/components/viz/service/frame_sinks/compositor_frame_sink_support.cc
@@ -698,8 +698,8 @@ pending_frames_.push_back(FrameData{.local_frame = true}); Surface* surface = surface_manager_->GetSurfaceForId(surface_id); - auto frame_rejected_callback = - base::ScopedClosureRunner(base::BindOnce([] { NOTREACHED(); })); + auto frame_rejected_callback = base::ScopedClosureRunner( + base::BindOnce([] { NOTREACHED_IN_MIGRATION(); })); auto frame_index = ++last_frame_index_; Surface::QueueFrameResult result = surface->QueueFrame( std::move(frame), frame_index, std::move(frame_rejected_callback));
diff --git a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContent.java b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContent.java index d949137..8862979 100644 --- a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContent.java +++ b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContent.java
@@ -8,6 +8,7 @@ import androidx.annotation.Nullable; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.components.browser_ui.bottomsheet.BottomSheetContent; import org.chromium.components.webapps.R; @@ -19,8 +20,19 @@ // This content's priority. private @ContentPriority int mPriority = ContentPriority.LOW; - public PwaRestoreBottomSheetContent(PwaRestoreBottomSheetView view) { + // Helps keep track of whether the Back button was pressed. + private final ObservableSupplierImpl<Boolean> mBackPressStateChangedSupplier = + new ObservableSupplierImpl<>(); + + // The handler to notify when the (Android) Back button is pressed. + Runnable mOsBackButtonClicked; + + public PwaRestoreBottomSheetContent( + PwaRestoreBottomSheetView view, Runnable onOsBackButtonClicked) { mView = view; + + mOsBackButtonClicked = onOsBackButtonClicked; + mBackPressStateChangedSupplier.set(true); } public void setPriority(@ContentPriority int priority) { @@ -54,6 +66,16 @@ } @Override + public ObservableSupplierImpl<Boolean> getBackPressStateChangedSupplier() { + return mBackPressStateChangedSupplier; + } + + @Override + public void onBackPressed() { + mOsBackButtonClicked.run(); + } + + @Override public int getVerticalScrollOffset() { return 0; }
diff --git a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContentTest.java b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContentTest.java index b105ca7..6a867fd5 100644 --- a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContentTest.java +++ b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetContentTest.java
@@ -45,7 +45,8 @@ .useConstructor(mActivity) .defaultAnswer(Mockito.RETURNS_MOCKS)); PwaRestoreBottomSheetContent pwaRestoreBottomSheetContent = - new PwaRestoreBottomSheetContent((PwaRestoreBottomSheetView) mockedView); + new PwaRestoreBottomSheetContent( + (PwaRestoreBottomSheetView) mockedView, /* onOsBackButtonClicked= */ null); Assert.assertTrue(pwaRestoreBottomSheetContent.getContentView() != null); Assert.assertTrue(pwaRestoreBottomSheetContent.getToolbarView() != null);
diff --git a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinator.java b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinator.java index b2670189..b9f43781 100644 --- a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinator.java +++ b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinator.java
@@ -12,6 +12,7 @@ import androidx.annotation.NonNull; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.webapps.pwa_restore_ui.PwaRestoreProperties.ViewState; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.PropertyModelChangeProcessor; @@ -50,14 +51,14 @@ mView = new PwaRestoreBottomSheetView(activity); mView.initialize(backArrowId); - mContent = new PwaRestoreBottomSheetContent(mView); + mContent = new PwaRestoreBottomSheetContent(mView, this::onOsBackButtonClicked); mMediator = new PwaRestoreBottomSheetMediator( apps, activity, this::onReviewButtonClicked, this::onRestoreButtonClicked, - this::onBackButtonClicked); + this::onDialogBackButtonClicked); PropertyModelChangeProcessor.create( mMediator.getModel(), mView, PwaRestoreBottomSheetViewBinder::bind); @@ -77,11 +78,22 @@ mController.expandSheet(); } - protected void onBackButtonClicked() { + protected void onDialogBackButtonClicked() { mMediator.setPeekingState(); mController.collapseSheet(/* animate= */ true); } + protected void onOsBackButtonClicked() { + if (mMediator.getModel().get(PwaRestoreProperties.VIEW_STATE) == ViewState.VIEW_PWA_LIST) { + // When the Android Back button is pressed while showing the PWA list, we should go back + // to the initial stage (essentially do what the Back button on the dialog does). + onDialogBackButtonClicked(); + } else { + // If we are already in initial stage, we should just close the dialog. + mController.hideContent(mContent, /* animate= */ true); + } + } + protected void onRestoreButtonClicked() { mController.hideContent(mContent, /* animate= */ true); }
diff --git a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinatorTest.java b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinatorTest.java index 169ec08..ec307b4 100644 --- a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinatorTest.java +++ b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetCoordinatorTest.java
@@ -165,12 +165,28 @@ coordinator.getModelForTesting().get(PwaRestoreProperties.VIEW_STATE)); verify(mBottomSheetControllerMock, times(1)).expandSheet(); - coordinator.onBackButtonClicked(); + coordinator.onDialogBackButtonClicked(); - // Clicking the Back button results in the sheet going back to peeking state. + // Clicking the Dialog Back button results in the sheet going back to peeking state. Assert.assertEquals( ViewState.PREVIEW, coordinator.getModelForTesting().get(PwaRestoreProperties.VIEW_STATE)); verify(mBottomSheetControllerMock, times(1)).collapseSheet(eq(true)); + + coordinator.onReviewButtonClicked(); + + // Clicking the Review button (again) results in the sheet expanding. + Assert.assertEquals( + ViewState.VIEW_PWA_LIST, + coordinator.getModelForTesting().get(PwaRestoreProperties.VIEW_STATE)); + verify(mBottomSheetControllerMock, times(2)).expandSheet(); + + coordinator.onOsBackButtonClicked(); + + // Clicking the OS Back button results in the sheet going back to peeking state. + Assert.assertEquals( + ViewState.PREVIEW, + coordinator.getModelForTesting().get(PwaRestoreProperties.VIEW_STATE)); + verify(mBottomSheetControllerMock, times(2)).collapseSheet(eq(true)); } }
diff --git a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetViewRenderTest.java b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetViewRenderTest.java index f58c78e..0a1a11b 100644 --- a/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetViewRenderTest.java +++ b/components/webapps/browser/android/java/src/org/chromium/components/webapps/pwa_restore_ui/PwaRestoreBottomSheetViewRenderTest.java
@@ -7,6 +7,7 @@ import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Color; +import android.os.Looper; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; @@ -83,6 +84,12 @@ MockitoAnnotations.initMocks(this); mocker.mock(PwaRestoreBottomSheetMediatorJni.TEST_HOOKS, mNativeMock); Mockito.when(mNativeMock.initialize(Mockito.any())).thenReturn(0L); + + // Avoid runtime error during test: 'Can't create handler inside thread that has not called + // Looper.prepare()'. + if (Looper.myLooper() == null) { + Looper.prepare(); + } } public PwaRestoreBottomSheetViewRenderTest(boolean nightModeEnabled) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 622ae55d..42ad9b4 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2246,8 +2246,6 @@ "webauth/client_data_json.h", "webauth/webauth_request_security_checker.cc", "webauth/webauth_request_security_checker.h", - "webid/digital_credentials/digital_identity_provider_utils.cc", - "webid/digital_credentials/digital_identity_provider_utils.h", "webid/digital_credentials/digital_identity_request_impl.cc", "webid/digital_credentials/digital_identity_request_impl.h", "webid/fake_identity_request_dialog_controller.cc", @@ -3201,8 +3199,6 @@ "web_contents/web_contents_android.h", "web_contents/web_contents_view_android.cc", "web_contents/web_contents_view_android.h", - "webid/digital_credentials/digital_identity_provider_android.cc", - "webid/digital_credentials/digital_identity_provider_android.h", ] deps += [
diff --git a/content/browser/accessibility/browser_accessibility_fuchsia.cc b/content/browser/accessibility/browser_accessibility_fuchsia.cc index 7cc5cdd6..86babf45 100644 --- a/content/browser/accessibility/browser_accessibility_fuchsia.cc +++ b/content/browser/accessibility/browser_accessibility_fuchsia.cc
@@ -83,6 +83,10 @@ UpdateNode(); } +ui::AXPlatformNode* BrowserAccessibilityFuchsia::GetAXPlatformNode() const { + return platform_node_; +} + BrowserAccessibilityFuchsia* ToBrowserAccessibilityFuchsia( BrowserAccessibility* obj) { return static_cast<BrowserAccessibilityFuchsia*>(obj);
diff --git a/content/browser/accessibility/browser_accessibility_fuchsia.h b/content/browser/accessibility/browser_accessibility_fuchsia.h index b069f72..dffc512 100644 --- a/content/browser/accessibility/browser_accessibility_fuchsia.h +++ b/content/browser/accessibility/browser_accessibility_fuchsia.h
@@ -45,6 +45,7 @@ // BrowserAccessibility overrides. void OnDataChanged() override; void OnLocationChanged() override; + ui::AXPlatformNode* GetAXPlatformNode() const override; bool AccessibilityPerformAction(const ui::AXActionData& action_data) override; // Returns this object's AXUniqueID as a uint32_t.
diff --git a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc index 3052f01d..9a17aad 100644 --- a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc +++ b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
@@ -158,7 +158,9 @@ absl::visit( base::Overloaded{ - [](const AttributionReport::EventLevelData&) { NOTREACHED(); }, + [](const AttributionReport::EventLevelData&) { + NOTREACHED_IN_MIGRATION(); + }, [&](const AttributionReport::AggregatableAttributionData& data) { source_time = data.source.source_time(); source_debug_key = data.source.debug_key();
diff --git a/content/browser/device_posture/foldable_apis_origin_trial_browsertest.cc b/content/browser/device_posture/foldable_apis_origin_trial_browsertest.cc index e20a9b14..80c750f 100644 --- a/content/browser/device_posture/foldable_apis_origin_trial_browsertest.cc +++ b/content/browser/device_posture/foldable_apis_origin_trial_browsertest.cc
@@ -7,7 +7,6 @@ #include "base/test/scoped_feature_list.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/render_widget_host_observer.h" -#include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" @@ -15,8 +14,6 @@ #include "content/public/test/url_loader_interceptor.h" #include "content/shell/browser/shell.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/public/common/features_generated.h" -#include "third_party/blink/public/mojom/device_posture/device_posture_provider.mojom.h" #include "url/gurl.h" namespace content { @@ -73,10 +70,6 @@ } void SetUpFoldableState() { - web_contents_impl() - ->GetDevicePostureProvider() - ->OverrideDevicePostureForEmulation( - blink::mojom::DevicePostureType::kFolded); const int kDisplayFeatureLength = 10; DisplayFeature emulated_display_feature{ DisplayFeature::Orientation::kVertical, @@ -89,7 +82,7 @@ root->current_frame_host()->GetRenderWidgetHost(); root_widget->SynchronizeVisualProperties(); // We need to wait that visual properties are updated before we test the - // CSS APIs of Viewport Segments and Device Posture. + // CSS APIs of Viewport Segments. while (root_widget->visual_properties_ack_pending_for_testing()) { TestRenderWidgetHostObserver(root_widget).WaitForVisualPropertiesUpdate(); } @@ -110,8 +103,11 @@ bool HasDevicePostureCSSApi() { return EvalJs(shell(), + "window.matchMedia('(device-posture: continuous)').matches") + .ExtractBool() || + EvalJs(shell(), "window.matchMedia('(device-posture: folded)').matches") - .ExtractBool(); + .ExtractBool(); } bool HasViewportSegmentsApi() { @@ -139,14 +135,8 @@ std::unique_ptr<content::URLLoaderInterceptor> interceptor_; }; -// TODO(crbug.com/339983706): Fix flaky test on macOS. -#if BUILDFLAG(IS_MAC) -#define MAYBE_ValidOriginTrialToken DISABLED_ValidOriginTrialToken -#else -#define MAYBE_ValidOriginTrialToken ValidOriginTrialToken -#endif IN_PROC_BROWSER_TEST_F(FoldableAPIsOriginTrialBrowserTest, - MAYBE_ValidOriginTrialToken) { + ValidOriginTrialToken) { ASSERT_TRUE(NavigateToURL(shell(), kValidTokenUrl)); SetUpFoldableState(); EXPECT_TRUE(HasDevicePostureApi());
diff --git a/content/browser/devtools/protocol/fetch_handler.cc b/content/browser/devtools/protocol/fetch_handler.cc index 4329ba2..1ee6360 100644 --- a/content/browser/devtools/protocol/fetch_handler.cc +++ b/content/browser/devtools/protocol/fetch_handler.cc
@@ -148,7 +148,7 @@ void sendFailure(const DispatchResponse& response) override { callback_->sendFailure(response); } - void fallThrough() override { NOTREACHED(); } + void fallThrough() override { NOTREACHED_IN_MIGRATION(); } ~CallbackWrapper() override {} std::unique_ptr<Callback> callback_;
diff --git a/content/browser/direct_sockets/direct_sockets_udp_browsertest.cc b/content/browser/direct_sockets/direct_sockets_udp_browsertest.cc index 1dcae92..6d0d22d69 100644 --- a/content/browser/direct_sockets/direct_sockets_udp_browsertest.cc +++ b/content/browser/direct_sockets/direct_sockets_udp_browsertest.cc
@@ -103,7 +103,7 @@ std::move(listener_receiver_remote)); server_socket_.set_disconnect_handler( - base::BindLambdaForTesting([]() { NOTREACHED(); })); + base::BindLambdaForTesting([]() { NOTREACHED_IN_MIGRATION(); })); net::IPEndPoint server_addr(net::IPAddress::IPv4Localhost(), 0); auto server_helper =
diff --git a/content/browser/indexed_db/indexed_db_bucket_context.cc b/content/browser/indexed_db/indexed_db_bucket_context.cc index e3ea676..3eca4d1 100644 --- a/content/browser/indexed_db/indexed_db_bucket_context.cc +++ b/content/browser/indexed_db/indexed_db_bucket_context.cc
@@ -186,6 +186,9 @@ // * It times out the request if the quota manager is taking too long. struct GetBucketSpaceRequestWrapper { static constexpr base::TimeDelta kTimeoutDuration = base::Seconds(45); + // The timeout is split into 3 steps. See similar logic in + // IndexedDBTransaction::kMaxTimeoutStrikes for reasoning. + static constexpr int kTimeoutFraction = 3; explicit GetBucketSpaceRequestWrapper( base::OnceCallback<void(storage::QuotaErrorOr<int64_t>)> callback) @@ -202,10 +205,20 @@ ~GetBucketSpaceRequestWrapper() { InvokeCallback(); } void StartTimer() { - timeout.Start(FROM_HERE, - kTimeoutDuration - (base::TimeTicks::Now() - start_time), - base::BindOnce(&GetBucketSpaceRequestWrapper::InvokeCallback, - base::Unretained(this))); + timeout.Start( + FROM_HERE, + (timeouts_observed + 1) * (kTimeoutDuration / kTimeoutFraction) - + (base::TimeTicks::Now() - start_time), + base::BindOnce(&GetBucketSpaceRequestWrapper::TimeOut, + base::Unretained(this))); + } + + void TimeOut() { + if (++timeouts_observed == kTimeoutFraction) { + InvokeCallback(); + } else { + StartTimer(); + } } void InvokeCallback() { @@ -214,21 +227,22 @@ } static const char kDroppedRequest[] = - "IndexedDB.QuotaCheckTime.DroppedRequest"; - static const char kSuccess[] = "IndexedDB.QuotaCheckTime.Success"; - static const char kQuotaError[] = "IndexedDB.QuotaCheckTime.QuotaError"; + "IndexedDB.QuotaCheckTime2.DroppedRequest"; + static const char kSuccess[] = "IndexedDB.QuotaCheckTime2.Success"; + static const char kQuotaError[] = "IndexedDB.QuotaCheckTime2.QuotaError"; const char* histogram = result_value ? result_value->has_value() ? kSuccess : kQuotaError : kDroppedRequest; base::UmaHistogramCustomTimes( histogram, base::TimeTicks::Now() - start_time, base::Milliseconds(1), - kTimeoutDuration, /*buckets=*/50U); + kTimeoutDuration * 2, /*buckets=*/50U); std::move(wrapped_callback) .Run(result_value.value_or( base::unexpected(storage::QuotaError::kUnknownError))); } + int timeouts_observed = 0; base::OneShotTimer timeout; base::OnceCallback<void(storage::QuotaErrorOr<int64_t>)> wrapped_callback; std::optional<storage::QuotaErrorOr<int64_t>> result_value;
diff --git a/content/browser/indexed_db/indexed_db_bucket_context_unittest.cc b/content/browser/indexed_db/indexed_db_bucket_context_unittest.cc index f590861..02341de 100644 --- a/content/browser/indexed_db/indexed_db_bucket_context_unittest.cc +++ b/content/browser/indexed_db/indexed_db_bucket_context_unittest.cc
@@ -94,7 +94,7 @@ EXPECT_TRUE(success_future2.Get()); EXPECT_FALSE(success_future3.Get()); - tester.ExpectTotalCount("IndexedDB.QuotaCheckTime.Success", 1); + tester.ExpectTotalCount("IndexedDB.QuotaCheckTime2.Success", 1); } TEST_F(IndexedDBBucketContextTest, CanUseDiskSpaceCaching) {
diff --git a/content/browser/indexed_db/indexed_db_connection_coordinator.cc b/content/browser/indexed_db/indexed_db_connection_coordinator.cc index 841fa7e..0333bea2 100644 --- a/content/browser/indexed_db/indexed_db_connection_coordinator.cc +++ b/content/browser/indexed_db/indexed_db_connection_coordinator.cc
@@ -561,11 +561,15 @@ state_ = RequestState::kDone; } - void BindTransactionReceiver() override { NOTREACHED(); } + void BindTransactionReceiver() override { NOTREACHED_IN_MIGRATION(); } - void UpgradeTransactionStarted(int64_t old_version) override { NOTREACHED(); } + void UpgradeTransactionStarted(int64_t old_version) override { + NOTREACHED_IN_MIGRATION(); + } - void UpgradeTransactionFinished(bool committed) override { NOTREACHED(); } + void UpgradeTransactionFinished(bool committed) override { + NOTREACHED_IN_MIGRATION(); + } // The delete requests should always be run during force close. bool ShouldPruneForForceClose() override { return false; }
diff --git a/content/browser/interest_group/auction_process_manager_unittest.cc b/content/browser/interest_group/auction_process_manager_unittest.cc index 8a59e6ba..53b096cd 100644 --- a/content/browser/interest_group/auction_process_manager_unittest.cc +++ b/content/browser/interest_group/auction_process_manager_unittest.cc
@@ -83,8 +83,9 @@ void LoadSellerWorklet( mojo::PendingReceiver<auction_worklet::mojom::SellerWorklet> seller_worklet, - mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector< + mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool should_pause_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> url_loader_factory, mojo::PendingRemote<auction_worklet::mojom::AuctionNetworkEventsHandler>
diff --git a/content/browser/interest_group/auction_runner_unittest.cc b/content/browser/interest_group/auction_runner_unittest.cc index 6e475e7..83d81fb 100644 --- a/content/browser/interest_group/auction_runner_unittest.cc +++ b/content/browser/interest_group/auction_runner_unittest.cc
@@ -4180,6 +4180,44 @@ } } +TEST_F(AuctionRunnerTest, WorkletServiceGetNextSellerWorkletThreadIndex) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeatureWithParameters( + features::kFledgeSellerWorkletThreadPool, + {{"seller_worklet_thread_pool_size", "4"}}); + + mojo::PendingRemote<auction_worklet::mojom::AuctionWorkletService> + auction_worklet_service_remote1; + mojo::PendingReceiver<auction_worklet::mojom::AuctionWorkletService> + auction_worklet_service_receiver1 = + auction_worklet_service_remote1.InitWithNewPipeAndPassReceiver(); + + mojo::PendingRemote<auction_worklet::mojom::AuctionWorkletService> + auction_worklet_service_remote2; + mojo::PendingReceiver<auction_worklet::mojom::AuctionWorkletService> + auction_worklet_service_receiver2 = + auction_worklet_service_remote2.InitWithNewPipeAndPassReceiver(); + + auto auction_worklet_service1 = + auction_worklet::AuctionWorkletServiceImpl::CreateForService( + std::move(auction_worklet_service_receiver1)); + + auto auction_worklet_service2 = + auction_worklet::AuctionWorkletServiceImpl::CreateForService( + std::move(auction_worklet_service_receiver2)); + + // It uses a round-robin scheduling, and the state is shared among the + // worklet services in the same process. + EXPECT_EQ(auction_worklet_service1->GetNextSellerWorkletThreadIndex(), 0u); + EXPECT_EQ(auction_worklet_service1->GetNextSellerWorkletThreadIndex(), 1u); + EXPECT_EQ(auction_worklet_service1->GetNextSellerWorkletThreadIndex(), 2u); + EXPECT_EQ(auction_worklet_service2->GetNextSellerWorkletThreadIndex(), 3u); + EXPECT_EQ(auction_worklet_service2->GetNextSellerWorkletThreadIndex(), 0u); + EXPECT_EQ(auction_worklet_service2->GetNextSellerWorkletThreadIndex(), 1u); + EXPECT_EQ(auction_worklet_service1->GetNextSellerWorkletThreadIndex(), 2u); + EXPECT_EQ(auction_worklet_service1->GetNextSellerWorkletThreadIndex(), 3u); +} + TEST_F(AuctionRunnerTest, PauseBidder) { pause_worklet_url_ = kBidder2Url;
diff --git a/content/browser/interest_group/auction_worklet_manager.cc b/content/browser/interest_group/auction_worklet_manager.cc index 0224bff..b526961 100644 --- a/content/browser/interest_group/auction_worklet_manager.cc +++ b/content/browser/interest_group/auction_worklet_manager.cc
@@ -184,7 +184,7 @@ mojo::Remote<auction_worklet::mojom::SellerWorklet> seller_worklet_; // This must be destroyed before the worklet it's passed, since it hangs on to // a raw pointer to it. - std::unique_ptr<DebuggableAuctionWorklet> worklet_debug_; + std::vector<std::unique_ptr<DebuggableAuctionWorklet>> worklet_debugs_; // If true, we will split callback notifications into small batches. bool split_up_notifications_; @@ -383,19 +383,22 @@ worklet_info_.needs_cors_for_additional_bid, rfh->frame_tree_node()->frame_tree_node_id()); + CHECK(worklet_debugs_.empty()); + switch (worklet_info_.type) { case WorkletType::kBidder: { mojo::PendingReceiver<auction_worklet::mojom::BidderWorklet> worklet_receiver = bidder_worklet_.BindNewPipeAndPassReceiver(); - worklet_debug_ = base::WrapUnique(new DebuggableAuctionWorklet( + worklet_debugs_.push_back(base::WrapUnique(new DebuggableAuctionWorklet( delegate->GetFrame(), process_handle_, worklet_info_.script_url, - bidder_worklet_.get())); + bidder_worklet_.get()))); + process_handle_.GetService()->LoadBidderWorklet( std::move(worklet_receiver), worklet_manager_->MaybeBindAuctionSharedStorageHost( delegate->GetFrame(), url::Origin::Create(worklet_info_.script_url)), - worklet_debug_->should_pause_on_start(), + worklet_debugs_[0]->should_pause_on_start(), std::move(url_loader_factory), std::move(auction_network_events_handler), worklet_info_.script_url, worklet_info_.wasm_url, worklet_info_.signals_url, @@ -412,15 +415,36 @@ case WorkletType::kSeller: { mojo::PendingReceiver<auction_worklet::mojom::SellerWorklet> worklet_receiver = seller_worklet_.BindNewPipeAndPassReceiver(); - worklet_debug_ = base::WrapUnique(new DebuggableAuctionWorklet( - delegate->GetFrame(), process_handle_, worklet_info_.script_url, - seller_worklet_.get())); + + std::vector< + mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost>> + shared_storage_hosts; + + for (size_t i = 0; + i < static_cast<size_t>( + features::kFledgeSellerWorkletThreadPoolSize.Get()); + ++i) { + worklet_debugs_.push_back(base::WrapUnique(new DebuggableAuctionWorklet( + delegate->GetFrame(), process_handle_, worklet_info_.script_url, + seller_worklet_.get(), + /*thread_index=*/i))); + + // For `DebuggableAuctionWorklet` created synchronously for the same + // frame, they should have the same `should_pause_on_start()` state. + if (i > 0) { + CHECK_EQ(worklet_debugs_[i]->should_pause_on_start(), + worklet_debugs_[i - 1]->should_pause_on_start()); + } + + shared_storage_hosts.push_back( + worklet_manager_->MaybeBindAuctionSharedStorageHost( + delegate->GetFrame(), + url::Origin::Create(worklet_info_.script_url))); + } + process_handle_.GetService()->LoadSellerWorklet( - std::move(worklet_receiver), - worklet_manager_->MaybeBindAuctionSharedStorageHost( - delegate->GetFrame(), - url::Origin::Create(worklet_info_.script_url)), - worklet_debug_->should_pause_on_start(), + std::move(worklet_receiver), std::move(shared_storage_hosts), + worklet_debugs_[0]->should_pause_on_start(), std::move(url_loader_factory), std::move(auction_network_events_handler), worklet_info_.script_url, worklet_info_.signals_url, worklet_manager_->top_window_origin(),
diff --git a/content/browser/interest_group/auction_worklet_manager_unittest.cc b/content/browser/interest_group/auction_worklet_manager_unittest.cc index 60018ea..64d31801 100644 --- a/content/browser/interest_group/auction_worklet_manager_unittest.cc +++ b/content/browser/interest_group/auction_worklet_manager_unittest.cc
@@ -571,8 +571,9 @@ void LoadSellerWorklet( mojo::PendingReceiver<auction_worklet::mojom::SellerWorklet> seller_worklet_receiver, - mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector< + mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool should_pause_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory,
diff --git a/content/browser/interest_group/debuggable_auction_worklet.cc b/content/browser/interest_group/debuggable_auction_worklet.cc index 29dddf2d..f4f7386ba 100644 --- a/content/browser/interest_group/debuggable_auction_worklet.cc +++ b/content/browser/interest_group/debuggable_auction_worklet.cc
@@ -36,7 +36,7 @@ (*bidder_worklet)->ConnectDevToolsAgent(std::move(agent)); } else { absl::get<auction_worklet::mojom::SellerWorklet*>(worklet_) - ->ConnectDevToolsAgent(std::move(agent), /*thread_index=*/0); + ->ConnectDevToolsAgent(std::move(agent), thread_index_); } } @@ -59,12 +59,14 @@ RenderFrameHostImpl* owning_frame, AuctionProcessManager::ProcessHandle& process_handle, const GURL& url, - auction_worklet::mojom::SellerWorklet* seller_worklet) + auction_worklet::mojom::SellerWorklet* seller_worklet, + size_t thread_index) : owning_frame_(owning_frame), process_handle_(process_handle), url_(url), unique_id_(base::Uuid::GenerateRandomV4().AsLowercaseString()), - worklet_(seller_worklet) { + worklet_(seller_worklet), + thread_index_(thread_index) { DebuggableAuctionWorkletTracker::GetInstance()->NotifyCreated( this, should_pause_on_start_); RequestPid();
diff --git a/content/browser/interest_group/debuggable_auction_worklet.h b/content/browser/interest_group/debuggable_auction_worklet.h index 58cfee4d..0e700a76 100644 --- a/content/browser/interest_group/debuggable_auction_worklet.h +++ b/content/browser/interest_group/debuggable_auction_worklet.h
@@ -83,7 +83,8 @@ RenderFrameHostImpl* owning_frame, AuctionProcessManager::ProcessHandle& process_handle, const GURL& url, - auction_worklet::mojom::SellerWorklet* seller_worklet); + auction_worklet::mojom::SellerWorklet* seller_worklet, + size_t thread_index); // Unregisters `this` from DebuggableAuctionWorkletTracker, and notifies // NotifyDestroyed() observers. @@ -107,6 +108,8 @@ auction_worklet::mojom::SellerWorklet*> worklet_; + size_t thread_index_ = 0; + base::WeakPtrFactory<DebuggableAuctionWorklet> weak_ptr_factory_{this}; };
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index 4563c6a..2ec6028 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -24475,10 +24475,103 @@ base::test::ScopedFeatureList feature_list_; }; +// Opted-in buyers will receive real time histograms. Since real time reporting +// URLs have same path and different reporting origins, but this browser test +// always replaces requests' hosts to "127.0.0.1" and only handles requests +// based on their paths, we cannot test different origin sellers' and buyers' +// real time reports at the same time (they'll be treated as the same request). IN_PROC_BROWSER_TEST_F(AuctionConfigRealTimeReportingEnabledTest, RealTimeReporting) { const char kHostA[] = "a.test"; const char kHostB[] = "b.test"; + + // Setting a small reporting interval to run the test faster. + manager_->set_reporting_interval_for_testing(base::Milliseconds(1)); + manager_->set_max_report_queue_length_for_testing(50); + manager_->set_max_active_report_requests_for_testing(50); + + URLLoaderMonitor url_loader_monitor; + + GURL test_url = + embedded_https_test_server().GetURL(kHostA, "/page_with_iframe.html"); + ASSERT_TRUE(NavigateToURL(shell(), test_url)); + url::Origin test_origin = url::Origin::Create(test_url); + GURL ad_url = + embedded_https_test_server().GetURL(kHostA, "/echo?render_cars"); + url::Origin test_origin_b = + url::Origin::Create(embedded_https_test_server().GetURL(kHostB, "/echo")); + + EXPECT_EQ( + kSuccess, + JoinInterestGroupAndVerify( + /*owner=*/test_origin, + /*name=*/"cars", + /*priority=*/0.0, + /*execution_mode=*/ + blink::InterestGroup::ExecutionMode::kCompatibilityMode, + /*bidding_url=*/ + embedded_https_test_server().GetURL( + kHostA, + "/interest_group/bidding_logic_with_real_time_reporting.js"), + /*ads=*/{{{ad_url, /*metadata=*/std::nullopt}}})); + + // Only opt in buyer, otherwise seller will send a real time report as well. + const char kConfigTemplate[] = R"({ + seller: $1, + decisionLogicURL: $2, + interestGroupBuyers: [$3], + perBuyerRealTimeReportingConfig: { + $3: {type: 'default-local-reporting'} + } + })"; + + std::string auction_config = JsReplace( + kConfigTemplate, test_origin_b, + embedded_https_test_server().GetURL( + kHostB, "/interest_group/decision_logic_with_real_time_reporting.js"), + test_origin); + RunAuctionAndWaitForURLAndNavigateIframe(auction_config, ad_url); + + const GURL expected_report_url = embedded_https_test_server().GetURL( + "a.test", "/.well-known/interest-group/real-time-report"); + + WaitForUrl(expected_report_url); + std::optional<network::ResourceRequest> request = + url_loader_monitor.WaitForUrl(expected_report_url); + ASSERT_TRUE(request); + EXPECT_EQ(net::HttpRequestHeaders::kPostMethod, request->method); + EXPECT_EQ(network::mojom::CredentialsMode::kOmit, request->credentials_mode); + EXPECT_EQ(network::mojom::RedirectMode::kError, request->redirect_mode); + EXPECT_EQ(test_origin, request->request_initiator); + + std::string content_type; + EXPECT_TRUE(request->headers.GetHeader(net::HttpRequestHeaders::kContentType, + &content_type)); + EXPECT_EQ("application/json", content_type); + + ASSERT_TRUE(request->trusted_params); + const net::IsolationInfo& isolation_info = + request->trusted_params->isolation_info; + EXPECT_EQ(net::IsolationInfo::RequestType::kOther, + isolation_info.request_type()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); +} + +// Opted-in sellers will receive real time histograms, even though they don't +// call the API (same for buyers). +IN_PROC_BROWSER_TEST_F(AuctionConfigRealTimeReportingEnabledTest, + RealTimeReportingWithoutCallingAPI) { + const char kHostA[] = "a.test"; + const char kHostB[] = "b.test"; + + // Setting a small reporting interval to run the test faster. + manager_->set_reporting_interval_for_testing(base::Milliseconds(1)); + manager_->set_max_report_queue_length_for_testing(50); + manager_->set_max_active_report_requests_for_testing(50); + + URLLoaderMonitor url_loader_monitor; + GURL test_url = embedded_https_test_server().GetURL(kHostA, "/page_with_iframe.html"); ASSERT_TRUE(NavigateToURL(shell(), test_url)); @@ -24505,9 +24598,6 @@ decisionLogicURL: $2, interestGroupBuyers: [$3], sellerRealTimeReportingConfig: {type: 'default-local-reporting'}, - perBuyerRealTimeReportingConfig: { - $3: {type: 'default-local-reporting'} - } })"; std::string auction_config = @@ -24517,18 +24607,30 @@ test_origin); RunAuctionAndWaitForURLAndNavigateIframe(auction_config, ad_url); - // Both the buyer and the seller will receive a real time histogram, even - // though they didn't call the API, since they both opted-in. - const GURL kExpectedRealTimeReportUrls[] = { - embedded_https_test_server().GetURL( - "a.test", "/.well-known/interest-group/real-time-report"), - embedded_https_test_server().GetURL( - "b.test", "/.well-known/interest-group/real-time-report")}; + const GURL expected_report_url = embedded_https_test_server().GetURL( + "b.test", "/.well-known/interest-group/real-time-report"); - for (const auto& expected_report_url : kExpectedRealTimeReportUrls) { - SCOPED_TRACE(expected_report_url); - WaitForUrl(expected_report_url); - } + WaitForUrl(expected_report_url); + std::optional<network::ResourceRequest> request = + url_loader_monitor.WaitForUrl(expected_report_url); + ASSERT_TRUE(request); + EXPECT_EQ(net::HttpRequestHeaders::kPostMethod, request->method); + EXPECT_EQ(network::mojom::CredentialsMode::kOmit, request->credentials_mode); + EXPECT_EQ(network::mojom::RedirectMode::kError, request->redirect_mode); + EXPECT_EQ(test_origin, request->request_initiator); + + std::string content_type; + EXPECT_TRUE(request->headers.GetHeader(net::HttpRequestHeaders::kContentType, + &content_type)); + EXPECT_EQ("application/json", content_type); + + ASSERT_TRUE(request->trusted_params); + const net::IsolationInfo& isolation_info = + request->trusted_params->isolation_info; + EXPECT_EQ(net::IsolationInfo::RequestType::kOther, + isolation_info.request_type()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); } } // namespace
diff --git a/content/browser/interest_group/mock_auction_process_manager.cc b/content/browser/interest_group/mock_auction_process_manager.cc index 73cc37b2..b92cdb82 100644 --- a/content/browser/interest_group/mock_auction_process_manager.cc +++ b/content/browser/interest_group/mock_auction_process_manager.cc
@@ -561,8 +561,9 @@ void MockAuctionProcessManager::LoadSellerWorklet( mojo::PendingReceiver<auction_worklet::mojom::SellerWorklet> seller_worklet_receiver, - mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector< + mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool should_pause_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory,
diff --git a/content/browser/interest_group/mock_auction_process_manager.h b/content/browser/interest_group/mock_auction_process_manager.h index cfe92e25..7afb0ee 100644 --- a/content/browser/interest_group/mock_auction_process_manager.h +++ b/content/browser/interest_group/mock_auction_process_manager.h
@@ -391,7 +391,7 @@ mojo::PendingReceiver<auction_worklet::mojom::BidderWorklet> bidder_worklet_receiver, mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + shared_storage_host, bool pause_for_debugger_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory, @@ -408,8 +408,9 @@ void LoadSellerWorklet( mojo::PendingReceiver<auction_worklet::mojom::SellerWorklet> seller_worklet_receiver, - mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector< + mojo::PendingRemote<auction_worklet::mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool should_pause_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory,
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc index d4209e9..9d53cea 100644 --- a/content/browser/media/capture/desktop_capture_device.cc +++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -853,7 +853,9 @@ break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } if (capturer)
diff --git a/content/browser/media/capture/fake_video_capture_stack.cc b/content/browser/media/capture/fake_video_capture_stack.cc index 5c40ff057b..d74a7d7 100644 --- a/content/browser/media/capture/fake_video_capture_stack.cc +++ b/content/browser/media/capture/fake_video_capture_stack.cc
@@ -297,7 +297,7 @@ capture_stack_->SetStarted(); } - void OnStartedUsingGpuDecode() override { NOTREACHED(); } + void OnStartedUsingGpuDecode() override { NOTREACHED_IN_MIGRATION(); } void OnStopped() override {}
diff --git a/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc b/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc index 025bef7a..6d84a96 100644 --- a/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc +++ b/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc
@@ -220,7 +220,7 @@ MOCK_METHOD1(OnLog, void(const std::string& message)); MOCK_METHOD0(OnStarted, void()); MOCK_METHOD0(OnStopped, void()); - void OnStartedUsingGpuDecode() final { NOTREACHED(); } + void OnStartedUsingGpuDecode() final { NOTREACHED_IN_MIGRATION(); } base::ReadOnlySharedMemoryRegion TakeBufferHandle(int buffer_id) { DCHECK_NOT_ON_DEVICE_THREAD();
diff --git a/content/browser/mojo_binder_policy_applier_unittest.cc b/content/browser/mojo_binder_policy_applier_unittest.cc index a78c436..cef99a9f 100644 --- a/content/browser/mojo_binder_policy_applier_unittest.cc +++ b/content/browser/mojo_binder_policy_applier_unittest.cc
@@ -59,7 +59,7 @@ } // mojom::TestInterfaceForDefer implementation. - void Ping(PingCallback callback) override { NOTREACHED(); } + void Ping(PingCallback callback) override { NOTREACHED_IN_MIGRATION(); } // Will be called when MojoBinderPolicyApplier::ApplyPolicyToBinder() // handles a kCancel binding request.
diff --git a/content/browser/preloading/prefetch/prefetch_streaming_url_loader_unittest.cc b/content/browser/preloading/prefetch/prefetch_streaming_url_loader_unittest.cc index d67e474..6de74f9 100644 --- a/content/browser/preloading/prefetch/prefetch_streaming_url_loader_unittest.cc +++ b/content/browser/preloading/prefetch/prefetch_streaming_url_loader_unittest.cc
@@ -1074,8 +1074,9 @@ // on_receive_head_callback_ is not called, and is passed to the // follow up PrefetchStreamingURLLoader that will follow the redirect // in the other network context. - std::get<0>(GetParam()) ? base::BindOnce([]() { NOTREACHED(); }) - : base::OnceClosure(), + std::get<0>(GetParam()) + ? base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }) + : base::OnceClosure(), response_reader->GetWeakPtr()); // Simulate a redirect that should not be followed by the URL loader.
diff --git a/content/browser/preloading/preloading_attempt_impl.cc b/content/browser/preloading/preloading_attempt_impl.cc index 0a22e8a..b82b4ae 100644 --- a/content/browser/preloading/preloading_attempt_impl.cc +++ b/content/browser/preloading/preloading_attempt_impl.cc
@@ -12,7 +12,6 @@ #include "content/browser/preloading/preloading.h" #include "content/browser/preloading/preloading_config.h" #include "content/public/browser/preloading.h" -#include "content/public/common/content_features.h" #include "services/metrics/public/cpp/metrics_utils.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_recorder.h" @@ -219,7 +218,8 @@ // instance does not have the opportunity to set the // `is_accurate_triggering_` flag to true in this case. if (preloading_type_ != PreloadingType::kPrefetch) { - if (!base::FeatureList::IsEnabled(features::kPrerender2NoVarySearch)) { + if (!base::FeatureList::IsEnabled( + blink::features::kPrerender2NoVarySearch)) { // TODO(crbug.com/41494389): is_accurate_triggering_ needs to be updated // accordingly in the case when prerender is matched via No-Vary-Search // matching.
diff --git a/content/browser/preloading/prerender/prerender_browsertest.cc b/content/browser/preloading/prerender/prerender_browsertest.cc index 084a2d5..bbfa9e7 100644 --- a/content/browser/preloading/prerender/prerender_browsertest.cc +++ b/content/browser/preloading/prerender/prerender_browsertest.cc
@@ -829,7 +829,8 @@ class NoVarySearchPrerenderBrowserTest : public PrerenderBrowserTest { public: NoVarySearchPrerenderBrowserTest() { - feature_list_.InitAndEnableFeature(features::kPrerender2NoVarySearch); + feature_list_.InitAndEnableFeature( + blink::features::kPrerender2NoVarySearch); } ~NoVarySearchPrerenderBrowserTest() override = default;
diff --git a/content/browser/preloading/prerender/prerender_host.cc b/content/browser/preloading/prerender/prerender_host.cc index eb15129c..ae2768b 100644 --- a/content/browser/preloading/prerender/prerender_host.cc +++ b/content/browser/preloading/prerender/prerender_host.cc
@@ -463,7 +463,7 @@ // No-Vary-Search header. auto* navigation_request = NavigationRequest::From(navigation_handle); CHECK(navigation_request->IsInPrerenderedMainFrame()); - if (base::FeatureList::IsEnabled(features::kPrerender2NoVarySearch) && + if (base::FeatureList::IsEnabled(blink::features::kPrerender2NoVarySearch) && IsInitialNavigation(*navigation_request) && navigation_request->response() && navigation_request->response()->parsed_headers && @@ -864,7 +864,8 @@ } else { // TODO(crbug.com/41494389): We should check for No-Vary-Search match // here. - if (!base::FeatureList::IsEnabled(features::kPrerender2NoVarySearch)) { + if (!base::FeatureList::IsEnabled( + blink::features::kPrerender2NoVarySearch)) { CHECK_EQ(potential_activation.url, common_params_->url); } }
diff --git a/content/browser/preloading/prerender/prerender_host_unittest.cc b/content/browser/preloading/prerender/prerender_host_unittest.cc index 3036540..9e85d22 100644 --- a/content/browser/preloading/prerender/prerender_host_unittest.cc +++ b/content/browser/preloading/prerender/prerender_host_unittest.cc
@@ -334,10 +334,10 @@ bool is_nvs_header_enabled = GetParam(); if (is_nvs_header_enabled) { scoped_feature_list_.InitAndEnableFeature( - features::kPrerender2NoVarySearch); + blink::features::kPrerender2NoVarySearch); } else { scoped_feature_list_.InitAndDisableFeature( - features::kPrerender2NoVarySearch); + blink::features::kPrerender2NoVarySearch); } }
diff --git a/content/browser/preloading/prerender/prerender_no_vary_search_commit_deferring_condition.cc b/content/browser/preloading/prerender/prerender_no_vary_search_commit_deferring_condition.cc index 4858e67..eda4d108 100644 --- a/content/browser/preloading/prerender/prerender_no_vary_search_commit_deferring_condition.cc +++ b/content/browser/preloading/prerender/prerender_no_vary_search_commit_deferring_condition.cc
@@ -5,12 +5,12 @@ #include "content/browser/preloading/prerender/prerender_no_vary_search_commit_deferring_condition.h" #include "base/memory/ptr_util.h" -#include "content/browser/preloading/prerender/prerender_features.h" #include "content/browser/preloading/prerender/prerender_host.h" #include "content/browser/renderer_host/frame_tree.h" #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/renderer_host/navigation_request.h" #include "content/public/browser/render_frame_host.h" +#include "third_party/blink/public/common/features.h" namespace content { @@ -36,7 +36,7 @@ NavigationType navigation_type, std::optional<int> candidate_prerender_frame_tree_node_id) { // Don't create if No-Vary-Search support for prerender is not enabled. - if (!base::FeatureList::IsEnabled(features::kPrerender2NoVarySearch)) { + if (!base::FeatureList::IsEnabled(blink::features::kPrerender2NoVarySearch)) { return nullptr; } @@ -59,7 +59,7 @@ : CommitDeferringCondition(navigation_request), candidate_prerender_frame_tree_node_id_( candidate_prerender_frame_tree_node_id) { - CHECK(base::FeatureList::IsEnabled(features::kPrerender2NoVarySearch)); + CHECK(base::FeatureList::IsEnabled(blink::features::kPrerender2NoVarySearch)); CHECK_NE(candidate_prerender_frame_tree_node_id_, RenderFrameHost::kNoFrameTreeNodeId); }
diff --git a/content/browser/private_aggregation/private_aggregation_host.cc b/content/browser/private_aggregation/private_aggregation_host.cc index 88e6775..d8f6839b 100644 --- a/content/browser/private_aggregation/private_aggregation_host.cc +++ b/content/browser/private_aggregation/private_aggregation_host.cc
@@ -9,6 +9,7 @@ #include <bit> #include <iterator> #include <map> +#include <memory> #include <optional> #include <string> #include <utility> @@ -28,6 +29,7 @@ #include "base/ranges/algorithm.h" #include "base/time/time.h" #include "base/timer/elapsed_timer.h" +#include "base/timer/timer.h" #include "base/uuid.h" #include "base/values.h" #include "components/aggregation_service/aggregation_coordinator_utils.h" @@ -120,12 +122,10 @@ blink::mojom::DebugModeDetailsPtr report_debug_details = blink::mojom::DebugModeDetails::New(); - // True if a timeout is specified by the client. - bool timeout_enabled = false; - // If a timeout is specified by the client, this timer will be used to - // schedule the timeout task. - base::OneShotTimer timeout_timer; + // schedule the timeout task. This should be nullptr iff no timeout is + // specified by the client. + std::unique_ptr<base::OneShotTimer> timeout_timer; }; PrivateAggregationHost::PrivateAggregationHost( @@ -217,34 +217,31 @@ filtering_id_max_bytes == kDefaultFilteringIdMaxBytes) { return false; } + mojo::ReceiverId id = receiver_set_.Add( + this, std::move(pending_receiver), + ReceiverContext{.worklet_origin = std::move(worklet_origin), + .top_frame_origin = std::move(top_frame_origin), + .api_for_budgeting = api_for_budgeting, + .context_id = std::move(context_id), + .aggregation_coordinator_origin = + std::move(aggregation_coordinator_origin), + .filtering_id_max_bytes = filtering_id_max_bytes}); - auto receiver_context = base::WrapUnique( - new ReceiverContext{.worklet_origin = std::move(worklet_origin), - .top_frame_origin = std::move(top_frame_origin), - .api_for_budgeting = api_for_budgeting, - .context_id = std::move(context_id), - .aggregation_coordinator_origin = - std::move(aggregation_coordinator_origin), - .filtering_id_max_bytes = filtering_id_max_bytes}); - - ReceiverContext* receiver_context_raw_ptr = receiver_context.get(); - - mojo::ReceiverId id = receiver_set_.Add(this, std::move(pending_receiver), - std::move(receiver_context)); + ReceiverContext* receiver_context_raw_ptr = receiver_set_.GetContext(id); if (timeout) { CHECK(timeout->is_positive()); pipes_with_timeout_count_++; - receiver_context_raw_ptr->timeout_enabled = true; + receiver_context_raw_ptr->timeout_timer = + std::make_unique<base::OneShotTimer>(); - // Passing `base::Unretained(this)` and `receiver_context_raw_ptr` is safe - // here: `this` owns the the receiver context, and the receiver context owns - // the timer. - receiver_context_raw_ptr->timeout_timer.Start( + // Passing `base::Unretained(this)` is safe as `this` owns the receiver + // context and the receiver context owns the timer. + receiver_context_raw_ptr->timeout_timer->Start( FROM_HERE, *timeout, base::BindOnce(&PrivateAggregationHost::OnTimeoutBeforeDisconnect, - base::Unretained(this), id, receiver_context_raw_ptr)); + base::Unretained(this), id)); } auto emplace_result = pipe_duration_timers_.emplace(id, base::ElapsedTimer()); @@ -273,12 +270,12 @@ std::vector<blink::mojom::AggregatableReportHistogramContributionPtr> contribution_ptrs) { const url::Origin& reporting_origin = - receiver_set_.current_context()->worklet_origin; + receiver_set_.current_context().worklet_origin; CHECK(network::IsOriginPotentiallyTrustworthy(reporting_origin), base::NotFatalUntil::M128); if (!GetContentClient()->browser()->IsPrivateAggregationAllowed( - &*browser_context_, receiver_set_.current_context()->top_frame_origin, + &*browser_context_, receiver_set_.current_context().top_frame_origin, reporting_origin, /*out_block_is_site_setting_specific=*/nullptr)) { CloseCurrentPipe(PipeResult::kApiDisabledInSettings); return; @@ -290,7 +287,7 @@ base::span<ContributionPtr> incoming_ptrs{contribution_ptrs}; std::vector<Contribution>& accepted = - receiver_set_.current_context()->contributions; + receiver_set_.current_context().contributions; // Null pointers should fail mojo validation. CHECK(base::ranges::none_of(incoming_ptrs, &ContributionPtr::is_null), @@ -311,7 +308,7 @@ incoming_ptrs, [&](const ContributionPtr& contribution) { return static_cast<size_t>( std::bit_width(contribution->filtering_id.value_or(0))) > - 8 * receiver_set_.current_context()->filtering_id_max_bytes; + 8 * receiver_set_.current_context().filtering_id_max_bytes; })) { mojo::ReportBadMessage("Filtering ID too big for max bytes"); CloseCurrentPipe(PipeResult::kFilteringIdInvalid); @@ -326,7 +323,7 @@ const size_t num_remaining = kMaxNumberOfContributions - accepted.size(); if (incoming_ptrs.size() > num_remaining) { - receiver_set_.current_context()->too_many_contributions = true; + receiver_set_.current_context().too_many_contributions = true; incoming_ptrs = incoming_ptrs.first(num_remaining); } @@ -430,14 +427,14 @@ void PrivateAggregationHost::EnableDebugMode( blink::mojom::DebugKeyPtr debug_key) { - if (receiver_set_.current_context()->report_debug_details->is_enabled) { + if (receiver_set_.current_context().report_debug_details->is_enabled) { mojo::ReportBadMessage("EnableDebugMode() called multiple times"); CloseCurrentPipe(PipeResult::kEnableDebugModeCalledMultipleTimes); return; } - receiver_set_.current_context()->report_debug_details->is_enabled = true; - receiver_set_.current_context()->report_debug_details->debug_key = + receiver_set_.current_context().report_debug_details->is_enabled = true; + receiver_set_.current_context().report_debug_details->debug_key = std::move(debug_key); } @@ -450,8 +447,8 @@ RecordPipeResultHistogram(pipe_result); - if (receiver_set_.current_context()->timeout_enabled) { - CHECK(receiver_set_.current_context()->timeout_timer.IsRunning()); + if (receiver_set_.current_context().timeout_timer) { + CHECK(receiver_set_.current_context().timeout_timer->IsRunning()); pipes_with_timeout_count_--; RecordTimeoutResultHistogram(TimeoutResult::kCanceledDueToError); } @@ -461,9 +458,9 @@ pipe_duration_timers_.erase(current_receiver); } -void PrivateAggregationHost::OnTimeoutBeforeDisconnect( - mojo::ReceiverId id, - ReceiverContext* receiver_context) { +void PrivateAggregationHost::OnTimeoutBeforeDisconnect(mojo::ReceiverId id) { + ReceiverContext* receiver_context = receiver_set_.GetContext(id); + SendReportOnTimeoutOrDisconnect(*receiver_context, /*remaining_timeout=*/base::TimeDelta()); @@ -478,22 +475,23 @@ void PrivateAggregationHost::OnReceiverDisconnected() { pipe_duration_timers_.erase(receiver_set_.current_receiver()); - ReceiverContext& current_context = *receiver_set_.current_context(); - if (!current_context.timeout_enabled) { + ReceiverContext& current_context = receiver_set_.current_context(); + if (!current_context.timeout_timer) { SendReportOnTimeoutOrDisconnect(current_context, /*remaining_timeout=*/base::TimeDelta()); return; } // The timeout hasn't been reached. - CHECK(current_context.timeout_timer.IsRunning()); + CHECK(current_context.timeout_timer->IsRunning()); pipes_with_timeout_count_--; RecordTimeoutResultHistogram( TimeoutResult::kOccurredAfterRemoteDisconnection); base::TimeDelta remaining_timeout = - current_context.timeout_timer.desired_run_time() - base::TimeTicks::Now(); + current_context.timeout_timer->desired_run_time() - + base::TimeTicks::Now(); SendReportOnTimeoutOrDisconnect(current_context, remaining_timeout); } @@ -546,7 +544,7 @@ base::Time report_issued_time = now + remaining_timeout; bool should_not_delay_this_report = - should_not_delay_reports_ || receiver_context.timeout_enabled; + should_not_delay_reports_ || receiver_context.timeout_timer; ReportRequestGenerator report_request_generator = base::BindOnce( GenerateReportRequest, std::move(timeout_or_disconnect_timer),
diff --git a/content/browser/private_aggregation/private_aggregation_host.h b/content/browser/private_aggregation/private_aggregation_host.h index 6fd63c43..1f8994e 100644 --- a/content/browser/private_aggregation/private_aggregation_host.h +++ b/content/browser/private_aggregation/private_aggregation_host.h
@@ -8,7 +8,6 @@ #include <stddef.h> #include <map> -#include <memory> #include <optional> #include <string> #include <vector> @@ -171,8 +170,7 @@ void CloseCurrentPipe(PipeResult pipe_result); - void OnTimeoutBeforeDisconnect(mojo::ReceiverId id, - ReceiverContext* receiver_context); + void OnTimeoutBeforeDisconnect(mojo::ReceiverId id); void OnReceiverDisconnected(); @@ -189,8 +187,7 @@ PrivateAggregationBudgeter::BudgetDeniedBehavior)> on_report_request_details_received_; - mojo::ReceiverSet<blink::mojom::PrivateAggregationHost, - std::unique_ptr<ReceiverContext>> + mojo::ReceiverSet<blink::mojom::PrivateAggregationHost, ReceiverContext> receiver_set_; // A map containing a timer tracking the duration of time that each mojo pipe
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc index 7261994..1fb69f9c 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
@@ -33,7 +33,6 @@ // Trace ids are generated in sequence in practice, but in these tests, we don't // care about the value, so we'll just use a constant. -const int kTraceEventId = 5; const char kUrl[] = "http://www.foo.bar.com/subpage/1"; void AddFakeComponentsWithTimeStamp( @@ -157,47 +156,6 @@ raw_ptr<ContentBrowserClient> old_browser_client_; }; -TEST_F(RenderWidgetHostLatencyTrackerTest, TestValidEventTiming) { - base::TimeTicks now = base::TimeTicks::Now(); - - ui::LatencyInfo latency_info; - latency_info.set_trace_id(kTraceEventId); - latency_info.set_source_event_type(ui::SourceEventType::WHEEL); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, - now + base::Milliseconds(60)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, - now + base::Milliseconds(50)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, - now + base::Milliseconds(40)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::DISPLAY_COMPOSITOR_RECEIVED_FRAME_COMPONENT, - now + base::Milliseconds(30)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - now + base::Milliseconds(20)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, now + base::Milliseconds(10)); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT, now); - - viz_tracker()->OnGpuSwapBuffersCompleted({latency_info}); - - // When last_event_time of the end_component is less than the first_event_time - // of the start_component, zero is recorded instead of a negative value. - histogram_tester().ExpectUniqueSample( - "Event.Latency.ScrollBegin.Wheel.TimeToScrollUpdateSwapBegin4", 0, 1); -} - // Flaky on Android. https://crbug.com/970841 #if BUILDFLAG(IS_ANDROID) #define MAYBE_TestWheelToFirstScrollHistograms \ @@ -249,16 +207,6 @@ source_id, "Event.ScrollBegin.Wheel", {"TimeToScrollUpdateSwapBegin", "TimeToHandled", "IsMainThread"}, total_ukm_entry_count); - - // UMA histograms. - EXPECT_TRUE( - HistogramSizeEq("Event.Latency.ScrollUpdate." - "TimeToScrollUpdateSwapBegin2", - 0)); - EXPECT_TRUE( - HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." - "TimeToScrollUpdateSwapBegin4", - 1)); } } } @@ -312,16 +260,6 @@ source_id, "Event.ScrollUpdate.Wheel", {"TimeToScrollUpdateSwapBegin", "TimeToHandled", "IsMainThread"}, total_ukm_entry_count); - - // UMA histograms. - EXPECT_TRUE( - HistogramSizeEq("Event.Latency.ScrollUpdate." - "TimeToScrollUpdateSwapBegin2", - 1)); - EXPECT_TRUE( - HistogramSizeEq("Event.Latency.ScrollBegin.Wheel." - "TimeToScrollUpdateSwapBegin4", - 0)); } } } @@ -416,53 +354,4 @@ begin_rwh_timestamp); } -TEST_F(RenderWidgetHostLatencyTrackerTest, KeyEndToEndLatency) { - // These numbers are sensitive to where the histogram buckets are. - int event_timestamps_microseconds[] = {11, 24}; - - ui::LatencyInfo latency_info; - latency_info.set_trace_id(kTraceEventId); - latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS); - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, - base::TimeTicks() + base::Microseconds(event_timestamps_microseconds[0])); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - base::TimeTicks() + base::Microseconds(event_timestamps_microseconds[0])); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, - base::TimeTicks() + base::Microseconds(event_timestamps_microseconds[1])); - - latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT, - base::TimeTicks() + base::Microseconds(event_timestamps_microseconds[1])); - - viz_tracker()->OnGpuSwapBuffersCompleted({latency_info}); - - EXPECT_THAT( - histogram_tester().GetAllSamples("Event.Latency.EndToEnd.KeyPress"), - ElementsAre(Bucket( - event_timestamps_microseconds[1] - event_timestamps_microseconds[0], - 1))); -} - -TEST_F(RenderWidgetHostLatencyTrackerTest, TouchpadPinchEvents) { - ui::LatencyInfo latency; - latency.set_trace_id(kTraceEventId); - latency.set_source_event_type(ui::SourceEventType::TOUCHPAD); - latency.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, - base::TimeTicks() + base::Milliseconds(1)); - latency.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - base::TimeTicks() + base::Milliseconds(3)); - AddFakeComponentsWithTimeStamp(*tracker(), &latency, - base::TimeTicks() + base::Milliseconds(5)); - viz_tracker()->OnGpuSwapBuffersCompleted({latency}); - - EXPECT_TRUE(HistogramSizeEq("Event.Latency.EndToEnd.TouchpadPinch2", 1)); -} - } // namespace content
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index b4e2feb5..97e81998 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -843,7 +843,9 @@ // TODO(crbug.com/40247147): Combine FinalizeRequest and // FinalizeMediaAccessRequest, implement it for the remaining subclasses and // make it into on pure virtual function. - virtual void FinalizeRequest(const std::string& label) { NOTREACHED(); } + virtual void FinalizeRequest(const std::string& label) { + NOTREACHED_IN_MIGRATION(); + } virtual void FinalizeMediaAccessRequest( const std::string& label, @@ -853,7 +855,9 @@ virtual void FinalizeRequestFailed(MediaStreamRequestResult result) = 0; - virtual void FinalizeChangeDevice(const std::string& label) { NOTREACHED(); } + virtual void FinalizeChangeDevice(const std::string& label) { + NOTREACHED_IN_MIGRATION(); + } virtual void OnRequestStateChangeFromBrowser( const std::string& label,
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc index e18217b..cd2df59 100644 --- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -3697,7 +3697,8 @@ // Call RequestAXSnapshotTree method. The browser process should not crash. auto params = mojom::SnapshotAccessibilityTreeParams::New(); rfh->RequestAXTreeSnapshot( - base::BindOnce([](const ui::AXTreeUpdate& snapshot) { NOTREACHED(); }), + base::BindOnce( + [](const ui::AXTreeUpdate& snapshot) { NOTREACHED_IN_MIGRATION(); }), std::move(params)); base::RunLoop().RunUntilIdle();
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index 13b92ca..c6b6609 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -229,6 +229,7 @@ const std::vector<std::unique_ptr<ui::TouchEvent>>& touches) override; ui::mojom::VirtualKeyboardMode GetVirtualKeyboardMode() override; viz::SurfaceId GetFallbackSurfaceIdForTesting() const override; + void ResetGestureDetection() override; // ui::EventHandlerAndroid implementation. bool OnTouchEvent(const ui::MotionEventAndroid& m) override; @@ -318,7 +319,6 @@ bool OnTouchHandleEvent(const ui::MotionEvent& event); int GetTouchHandleHeight(); - void ResetGestureDetection(); void SetDoubleTapSupportEnabled(bool enabled); void SetMultiTouchZoomSupportEnabled(bool enabled);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 0997fdea..9989a02 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2544,6 +2544,13 @@ return !!popup_parent_host_view_; } +void RenderWidgetHostViewAura::ResetGestureDetection() { + // TODO(bokan): See the Android implementation - Aura likely needs to + // implement this as well so that suppressing input + // (WebContentsImpl::IgnoreInputEvents) doesn't continue to generate gestures + // which can confuse event validation. +} + bool RenderWidgetHostViewAura::FocusedFrameHasStickyActivation() const { // Unless user has interacted with the iframe, we shouldn't be displaying VK // or fire geometrychange event.
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 754a89f..88918269 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -133,6 +133,7 @@ void NotifyVirtualKeyboardOverlayRect( const gfx::Rect& keyboard_rect) override; bool IsHTMLFormPopup() const override; + void ResetGestureDetection() override; // Overridden from RenderWidgetHostViewBase: void InitAsPopup(RenderWidgetHostView* parent_host_view,
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 6aa5a5f..d79eb66 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -648,6 +648,8 @@ return screen_infos_; } +void RenderWidgetHostViewBase::ResetGestureDetection() {} + float RenderWidgetHostViewBase::GetDeviceScaleFactor() const { return screen_infos_.current().device_scale_factor; }
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index c0cf753..5a957b0 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -127,6 +127,7 @@ override; display::ScreenInfo GetScreenInfo() const override; display::ScreenInfos GetScreenInfos() const override; + virtual void ResetGestureDetection(); // RenderWidgetHostViewInput implementation base::WeakPtr<RenderWidgetHostViewInput> GetInputWeakPtr() override;
diff --git a/content/browser/service_worker/service_worker_single_script_update_checker.cc b/content/browser/service_worker/service_worker_single_script_update_checker.cc index 39ccd54..96d6cb5 100644 --- a/content/browser/service_worker/service_worker_single_script_update_checker.cc +++ b/content/browser/service_worker/service_worker_single_script_update_checker.cc
@@ -101,7 +101,7 @@ ~WrappedIOBuffer() override = default; // This is to make sure that the vtable is not merged with other classes. - virtual void dummy() { NOTREACHED(); } + virtual void dummy() { NOTREACHED_IN_MIGRATION(); } }; ServiceWorkerSingleScriptUpdateChecker::ServiceWorkerSingleScriptUpdateChecker(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 5165187a6..eb8806d 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2724,6 +2724,16 @@ wc->web_input_event_audit_callbacks_.erase(*callback_id); } else { --wc->ignore_input_events_count_; + // Reset gesture detection so that we don't continue to generate new + // gestures from suppressed touches. These suppressed gestures would + // otherwise confuse the event stream validator when input is + // re-enabled. + if (wc->ignore_input_events_count_ == 0) { + if (auto* view = wc->GetRenderWidgetHostView()) { + static_cast<RenderWidgetHostViewBase*>(view) + ->ResetGestureDetection(); + } + } } } },
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 770e7db4..0b48d2fa 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -1386,13 +1386,10 @@ shell3->web_contents()->GetFirstWebContentsInLiveOriginalOpenerChain()); } -// TODO(clamy): Make the test work on Windows and on Mac. On Mac and Windows, -// there seem to be an issue with the ShellJavascriptDialogManager. -// Flaky on all platforms: https://crbug.com/655628 // Test that if a BeforeUnload dialog is destroyed due to the commit of a // cross-site navigation, it will not reset the loading state. IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, - DISABLED_NoResetOnBeforeUnloadCanceledOnCommit) { + NoResetOnBeforeUnloadCanceledOnCommit) { ASSERT_TRUE(embedded_test_server()->Start()); const GURL kStartURL( embedded_test_server()->GetURL("/hang_before_unload.html")); @@ -1403,11 +1400,16 @@ EXPECT_TRUE(NavigateToURL(shell(), kStartURL)); // Start a cross-site navigation that will not commit for the moment. + // This intentionally does not trigger a BeforeUnload dialog because the + // main frame has never had user activation. TestNavigationManager cross_site_delayer(shell()->web_contents(), kCrossSiteURL); shell()->LoadURL(kCrossSiteURL); EXPECT_TRUE(cross_site_delayer.WaitForRequestStart()); + // Disable beforeunload timer to prevent flakiness. + PrepContentsForBeforeUnloadTest(shell()->web_contents()); + // Click on a link in the page. This will show the BeforeUnload dialog. // Ensure the dialog is not dismissed, which will cause it to still be // present when the cross-site navigation later commits.
diff --git a/content/browser/webid/digital_credentials/digital_identity_provider_utils.cc b/content/browser/webid/digital_credentials/digital_identity_provider_utils.cc deleted file mode 100644 index 43e1fb0..0000000 --- a/content/browser/webid/digital_credentials/digital_identity_provider_utils.cc +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/browser/webid/digital_credentials/digital_identity_provider_utils.h" - -#include "build/build_config.h" - -#if BUILDFLAG(IS_ANDROID) -#include "content/browser/webid/digital_credentials/digital_identity_provider_android.h" -#endif - -namespace content { - -std::unique_ptr<DigitalIdentityProvider> CreateDigitalIdentityProvider() { -#if BUILDFLAG(IS_ANDROID) - return std::make_unique<DigitalIdentityProviderAndroid>(); -#else - return nullptr; -#endif -} - -} // namespace content
diff --git a/content/browser/webid/digital_credentials/digital_identity_provider_utils.h b/content/browser/webid/digital_credentials/digital_identity_provider_utils.h deleted file mode 100644 index cc5b81a..0000000 --- a/content/browser/webid/digital_credentials/digital_identity_provider_utils.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_UTILS_H_ -#define CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_UTILS_H_ - -#include <memory> - -#include "content/common/content_export.h" -#include "content/public/browser/digital_identity_provider.h" - -namespace content { - -CONTENT_EXPORT std::unique_ptr<DigitalIdentityProvider> -CreateDigitalIdentityProvider(); - -} // namespace content - -#endif // CONTENT_BROWSER_WEBID_DIGITAL_CREDENTIALS_DIGITAL_IDENTITY_PROVIDER_UTILS_H_
diff --git a/content/browser/webid/digital_credentials/digital_identity_request_impl.cc b/content/browser/webid/digital_credentials/digital_identity_request_impl.cc index 76c436b1..071a3d7 100644 --- a/content/browser/webid/digital_credentials/digital_identity_request_impl.cc +++ b/content/browser/webid/digital_credentials/digital_identity_request_impl.cc
@@ -9,7 +9,6 @@ #include "base/metrics/histogram_functions.h" #include "base/values.h" #include "content/browser/renderer_host/render_frame_host_impl.h" -#include "content/browser/webid/digital_credentials/digital_identity_provider_utils.h" #include "content/browser/webid/flags.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" @@ -220,7 +219,7 @@ return; } - provider_ = CreateProvider(); + provider_ = GetContentClient()->browser()->CreateDigitalIdentityProvider(); if (!provider_) { CompleteRequest("", RequestStatusForMetrics::kErrorOther); return; @@ -256,16 +255,4 @@ weak_ptr_factory_.GetWeakPtr(), response)); } -std::unique_ptr<DigitalIdentityProvider> -DigitalIdentityRequestImpl::CreateProvider() { - // A provider may only be created in browser tests by this moment. - std::unique_ptr<DigitalIdentityProvider> provider = - GetContentClient()->browser()->CreateDigitalIdentityProvider(); - - if (!provider) { - return CreateDigitalIdentityProvider(); - } - return provider; -} - } // namespace content
diff --git a/content/browser/webid/digital_credentials/digital_identity_request_impl.h b/content/browser/webid/digital_credentials/digital_identity_request_impl.h index 29ae0eda..1ead40fb 100644 --- a/content/browser/webid/digital_credentials/digital_identity_request_impl.h +++ b/content/browser/webid/digital_credentials/digital_identity_request_impl.h
@@ -79,8 +79,6 @@ const std::string& response, DigitalIdentityProvider::RequestStatusForMetrics status_for_metrics); - std::unique_ptr<DigitalIdentityProvider> CreateProvider(); - std::unique_ptr<DigitalIdentityProvider> provider_; RequestCallback callback_;
diff --git a/content/browser/webrtc/webrtc_internals.cc b/content/browser/webrtc/webrtc_internals.cc index ef91e1dc..810ba62f 100644 --- a/content/browser/webrtc/webrtc_internals.cc +++ b/content/browser/webrtc/webrtc_internals.cc
@@ -684,7 +684,9 @@ EnableAudioDebugRecordingsOnAllRenderProcessHosts(); break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } }
diff --git a/content/common/features.cc b/content/common/features.cc index 587f0f3..48d7b90 100644 --- a/content/common/features.cc +++ b/content/common/features.cc
@@ -223,6 +223,15 @@ "FledgeDelayPostAuctionInterestGroupUpdate", base::FEATURE_DISABLED_BY_DEFAULT); +// Enables multi-threaded seller worklet. +BASE_FEATURE(kFledgeSellerWorkletThreadPool, + "FledgeSellerWorkletThreadPool", + base::FEATURE_ENABLED_BY_DEFAULT); + +// The number of seller worklet threads. +const base::FeatureParam<int> kFledgeSellerWorkletThreadPoolSize{ + &kFledgeSellerWorkletThreadPool, "seller_worklet_thread_pool_size", 1}; + // Enables fixes for matching src: local() for web fonts correctly against full // font name or postscript name. Rolling out behind a flag, as enabling this // enables a font indexer on Android which we need to test in the field first.
diff --git a/content/common/features.h b/content/common/features.h index 371add8d..8c5e0904 100644 --- a/content/common/features.h +++ b/content/common/features.h
@@ -52,6 +52,9 @@ kFledgeLimitNumAuctionsParam; CONTENT_EXPORT BASE_DECLARE_FEATURE(kFledgeUseInterestGroupCache); CONTENT_EXPORT BASE_DECLARE_FEATURE(kFledgeDelayPostAuctionInterestGroupUpdate); +CONTENT_EXPORT BASE_DECLARE_FEATURE(kFledgeSellerWorkletThreadPool); +CONTENT_EXPORT extern const base::FeatureParam<int> + kFledgeSellerWorkletThreadPoolSize; CONTENT_EXPORT BASE_DECLARE_FEATURE(kFontSrcLocalMatching); #if !BUILDFLAG(IS_ANDROID) CONTENT_EXPORT BASE_DECLARE_FEATURE(kForwardMemoryPressureEventsToGpuProcess);
diff --git a/content/common/gpu_pre_sandbox_hook_linux.cc b/content/common/gpu_pre_sandbox_hook_linux.cc index f5df3c66..08cafb3 100644 --- a/content/common/gpu_pre_sandbox_hook_linux.cc +++ b/content/common/gpu_pre_sandbox_hook_linux.cc
@@ -327,7 +327,7 @@ "/usr/lib64/libdrm_amdgpu.so.1", "/usr/lib64/libdrm_radeon.so.1", "/usr/lib64/libdrm_nouveau.so.2", "/usr/lib64/dri/crocus_dri.so", "/usr/lib64/dri/i965_dri.so", "/usr/lib64/dri/iris_dri.so", - "/usr/lib64/dri/swrast_dri.so", + "/usr/lib64/dri/swrast_dri.so", "/usr/lib64/libzstd.so.1", // Allow libglvnd files and libs. "/usr/share/glvnd/egl_vendor.d", "/usr/share/glvnd/egl_vendor.d/50_mesa.json",
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index 725a0f6..c32089a 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -341,7 +341,6 @@ "java/src/org/chromium/content/browser/webcontents/EmptyInternalAccessDelegate.java", "java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java", "java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java", - "java/src/org/chromium/content/browser/webid/DigitalIdentityProvider.java", "java/src/org/chromium/content_public/browser/ActionModeCallback.java", "java/src/org/chromium/content_public/browser/ActionModeCallbackHelper.java", "java/src/org/chromium/content_public/browser/AdditionalNavigationParams.java", @@ -404,6 +403,7 @@ "java/src/org/chromium/content_public/browser/WebContentsStatics.java", "java/src/org/chromium/content_public/browser/selection/SelectionActionMenuDelegate.java", "java/src/org/chromium/content_public/browser/selection/SelectionDropdownMenuDelegate.java", + "java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegateFactory.java", ] public_deps = [ ":identity_credentials_java" ] @@ -414,6 +414,7 @@ sources = [ "java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegate.java", "java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegateImpl.java", + "java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegate.java", ] deps = [ "//base:base_java" ] jar_excluded_patterns = [ "*/IdentityCredentialsDelegateImpl.class" ] @@ -514,7 +515,6 @@ "java/src/org/chromium/content/browser/sms/SmsProviderGms.java", "java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java", "java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java", - "java/src/org/chromium/content/browser/webid/DigitalIdentityProvider.java", "java/src/org/chromium/content_public/browser/ContentFeatureMap.java", "java/src/org/chromium/content_public/browser/ContentWebFeatureUsageUtils.java", "java/src/org/chromium/content_public/browser/LoadCommittedDetails.java", @@ -704,7 +704,6 @@ "junit/src/org/chromium/content/browser/sms/SmsProviderGmsTest.java", "junit/src/org/chromium/content/browser/webcontents/WebContentsImplTest.java", "junit/src/org/chromium/content/browser/webcontents/WebContentsObserverProxyTest.java", - "junit/src/org/chromium/content/browser/webid/DigitalIdentityProviderTest.java", "junit/src/org/chromium/content_public/browser/MessagePayloadTest.java", ]
diff --git a/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegate.java b/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegate.java index e737d20..29f2233 100644 --- a/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegate.java +++ b/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegate.java
@@ -4,54 +4,6 @@ package org.chromium.content.browser.webid; -import android.app.Activity; - -import org.chromium.base.Promise; - -/** - * Delegate interface for calling into GMSCore's private identity credentials. - * - * <p>There are two implementations of this interface, in two different repositories. To update this - * interface without breaking the builds independently, you have to: - * - * <p>Step 0) Current state - * - * <p>Upstream: Interface: get(int) PublicImpl: get(int) - * - * <p>Downstream: Impl: get(int) - * - * <p>Step 1) CL#1 in chromium - * - * <p>Upstream: Interface: default get(int), default get(int, string) PublicImpl: get(int, string) - * - * <p>Downstream: Impl: get(int) - * - * <p>Step 2) CL#2 in //clank - * - * <p>Upstream: Interface: default get(int), default get(int, string) PublicImpl: get(int, string) - * - * <p>Downstream: Impl: get(int, string) - * - * <p>Step 3) CL#3 in chromium - * - * <p>Upstream: Interface: get(int, string) PublicImpl: get(int, string) - * - * <p>Downstream: Impl: get(int, string) - * - * <p>Once GMSCore publishes this API publicly, we can have a single implementation. - * - * <p>TODO(crbug.com/40279841) delete this once GMSCore publishes this API. - */ -public interface IdentityCredentialsDelegate { - public default Promise<String> get(String origin, String request) { - return Promise.rejected(); - } - - public default Promise<byte[]> get(Activity activity, String origin, String request) { - return Promise.rejected(); - } - - public default Promise<Void> register(Activity activity, byte[] credential, byte[] matcher) { - return Promise.rejected(); - } -} +/** TODO(crbug.com/332562244): Delete once all implementers are ported to content_public version. */ +public interface IdentityCredentialsDelegate + extends org.chromium.content_public.browser.webid.IdentityCredentialsDelegate {}
diff --git a/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegateImpl.java b/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegateImpl.java index b39d61e0..288e4f7 100644 --- a/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegateImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/webid/IdentityCredentialsDelegateImpl.java
@@ -4,6 +4,8 @@ package org.chromium.content.browser.webid; +import org.chromium.content_public.browser.webid.IdentityCredentialsDelegate; + /** * Public no-op implementation of IdentityCredentialsDelegate. *
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegate.java b/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegate.java new file mode 100644 index 0000000..90518c9 --- /dev/null +++ b/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegate.java
@@ -0,0 +1,57 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.content_public.browser.webid; + +import android.app.Activity; + +import org.chromium.base.Promise; + +/** + * Delegate interface for calling into GMSCore's private identity credentials. + * + * <p>There are two implementations of this interface, in two different repositories. To update this + * interface without breaking the builds independently, you have to: + * + * <p>Step 0) Current state + * + * <p>Upstream: Interface: get(int) PublicImpl: get(int) + * + * <p>Downstream: Impl: get(int) + * + * <p>Step 1) CL#1 in chromium + * + * <p>Upstream: Interface: default get(int), default get(int, string) PublicImpl: get(int, string) + * + * <p>Downstream: Impl: get(int) + * + * <p>Step 2) CL#2 in //clank + * + * <p>Upstream: Interface: default get(int), default get(int, string) PublicImpl: get(int, string) + * + * <p>Downstream: Impl: get(int, string) + * + * <p>Step 3) CL#3 in chromium + * + * <p>Upstream: Interface: get(int, string) PublicImpl: get(int, string) + * + * <p>Downstream: Impl: get(int, string) + * + * <p>Once GMSCore publishes this API publicly, we can have a single implementation. + * + * <p>TODO(crbug.com/40279841) delete this once GMSCore publishes this API. + */ +public interface IdentityCredentialsDelegate { + public default Promise<String> get(String origin, String request) { + return Promise.rejected(); + } + + public default Promise<byte[]> get(Activity activity, String origin, String request) { + return Promise.rejected(); + } + + public default Promise<Void> register(Activity activity, byte[] credential, byte[] matcher) { + return Promise.rejected(); + } +}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegateFactory.java b/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegateFactory.java new file mode 100644 index 0000000..98b755b --- /dev/null +++ b/content/public/android/java/src/org/chromium/content_public/browser/webid/IdentityCredentialsDelegateFactory.java
@@ -0,0 +1,14 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.content_public.browser.webid; + +import org.chromium.content.browser.webid.IdentityCredentialsDelegateImpl; + +/** Factory class for building {@link IdentityCredentialsDelegate} objects. */ +public class IdentityCredentialsDelegateFactory { + public static IdentityCredentialsDelegate createDefault() { + return new IdentityCredentialsDelegateImpl(); + } +}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/webid/OWNERS b/content/public/android/java/src/org/chromium/content_public/browser/webid/OWNERS new file mode 100644 index 0000000..cfed0af3 --- /dev/null +++ b/content/public/android/java/src/org/chromium/content_public/browser/webid/OWNERS
@@ -0,0 +1 @@ +file://content/browser/webid/OWNERS
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 03d5550f..a9c7beb 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -647,13 +647,6 @@ "PrefetchRedirects", base::FEATURE_ENABLED_BY_DEFAULT); -// Prerender2 support for No-Vary-Search header. Enables prerender matching -// at navigation time using non-exact URL matching based on the prerender -// No-Vary-Search header. -BASE_FEATURE(kPrerender2NoVarySearch, - "Prerender2NoVarySearch", - base::FEATURE_DISABLED_BY_DEFAULT); - // Enables exposure of ads APIs in the renderer: Attribution Reporting, // FLEDGE, Topics, along with a number of other features actively in development // within these APIs.
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 7d47188a..836e744 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -158,7 +158,6 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrefetchBrowserInitiatedTriggers); CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrefetchNewLimits); CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrefetchRedirects); -CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrerender2NoVarySearch); CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrivacySandboxAdsAPIsOverride); CONTENT_EXPORT BASE_DECLARE_FEATURE(kPrivateNetworkAccessForNavigations); CONTENT_EXPORT BASE_DECLARE_FEATURE(
diff --git a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/DigitalCredentialProviderUtils.java b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/DigitalCredentialProviderUtils.java index 5d55fb2..a496791 100644 --- a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/DigitalCredentialProviderUtils.java +++ b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/DigitalCredentialProviderUtils.java
@@ -5,8 +5,7 @@ package org.chromium.content_public.browser.test.util; import org.chromium.base.Promise; -import org.chromium.content.browser.webid.DigitalIdentityProvider; -import org.chromium.content.browser.webid.IdentityCredentialsDelegate; +import org.chromium.content_public.browser.webid.IdentityCredentialsDelegate; /** Used to mock IdentityCredentialsDelegate in tests. */ public class DigitalCredentialProviderUtils { @@ -17,8 +16,4 @@ return Promise.rejected(); } } - - public static void setDelegateForTesting(MockIdentityCredentialsDelegate delegate) { - DigitalIdentityProvider.setDelegateForTesting(delegate); - } }
diff --git a/content/renderer/pepper/host_var_tracker_unittest.cc b/content/renderer/pepper/host_var_tracker_unittest.cc index d96b4ba7..3c06edb2 100644 --- a/content/renderer/pepper/host_var_tracker_unittest.cc +++ b/content/renderer/pepper/host_var_tracker_unittest.cc
@@ -56,7 +56,7 @@ PepperTryCatchForTest(const PepperTryCatchForTest&) = delete; PepperTryCatchForTest& operator=(const PepperTryCatchForTest&) = delete; - void SetException(const char* message) override { NOTREACHED(); } + void SetException(const char* message) override { NOTREACHED_IN_MIGRATION(); } bool HasException() override { return false; } v8::Local<v8::Context> GetContext() override { return instance_->GetIsolate()->GetCurrentContext();
diff --git a/content/renderer/pepper/v8_var_converter_unittest.cc b/content/renderer/pepper/v8_var_converter_unittest.cc index e05e7f8..d6cad09a 100644 --- a/content/renderer/pepper/v8_var_converter_unittest.cc +++ b/content/renderer/pepper/v8_var_converter_unittest.cc
@@ -69,7 +69,9 @@ ~MockResourceConverter() override {} void Reset() override {} bool NeedsFlush() override { return false; } - void Flush(base::OnceCallback<void(bool)> callback) override { NOTREACHED(); } + void Flush(base::OnceCallback<void(bool)> callback) override { + NOTREACHED_IN_MIGRATION(); + } bool FromV8Value(v8::Local<v8::Object> val, v8::Local<v8::Context> context, PP_Var* result,
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 9dd563c..9739981 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -631,8 +631,7 @@ BindHostReceiver(compositing_mode_reporter_.BindNewPipeAndPassReceiver()); compositing_mode_reporter_->AddCompositingModeWatcher( - compositing_mode_watcher_receiver_.BindNewPipeAndPassRemote( - main_thread_scheduler_->CompositorTaskRunner())); + compositing_mode_watcher_receiver_.BindNewPipeAndPassRemote()); } variations_observer_ = std::make_unique<VariationsRenderThreadObserver>();
diff --git a/content/services/auction_worklet/auction_worklet_service_impl.cc b/content/services/auction_worklet/auction_worklet_service_impl.cc index 39e52c07..2186493 100644 --- a/content/services/auction_worklet/auction_worklet_service_impl.cc +++ b/content/services/auction_worklet/auction_worklet_service_impl.cc
@@ -13,6 +13,7 @@ #include "base/memory/ref_counted.h" #include "base/sequence_checker.h" #include "base/synchronization/waitable_event.h" +#include "content/common/features.h" #include "content/services/auction_worklet/auction_v8_helper.h" #include "content/services/auction_worklet/bidder_worklet.h" #include "content/services/auction_worklet/public/mojom/auction_worklet_service.mojom.h" @@ -24,6 +25,12 @@ namespace auction_worklet { +namespace { + +static size_t g_next_seller_worklet_thread_index = 0; + +} // namespace + // V8HelperHolder exists to make sure we don't end up creating a fresh V8 thread // every time a new service instance is created. It itself must be accessed from // a single thread, and should be destroyed before task scheduling is shut down. @@ -60,13 +67,22 @@ } static scoped_refptr<V8HelperHolder> SellerInstance( - ProcessModel process_model) { - if (!g_seller_instance) { - g_seller_instance = - new V8HelperHolder(process_model, WorkletType::kSeller); + ProcessModel process_model, + size_t thread_index) { + if (!g_seller_instances) { + g_seller_instances = new std::vector<V8HelperHolder*>(); } - DCHECK_CALLED_ON_VALID_SEQUENCE(g_seller_instance->sequence_checker_); - return g_seller_instance; + + while (g_seller_instances->size() <= thread_index) { + g_seller_instances->push_back( + new V8HelperHolder(process_model, WorkletType::kSeller, + /*thread_index=*/g_seller_instances->size())); + } + + DCHECK_CALLED_ON_VALID_SEQUENCE( + g_seller_instances->at(thread_index)->sequence_checker_); + + return g_seller_instances->at(thread_index); } const scoped_refptr<AuctionV8Helper>& V8Helper() { @@ -85,10 +101,19 @@ private: friend class base::RefCounted<V8HelperHolder>; - explicit V8HelperHolder(ProcessModel process_model, WorkletType worklet_type) - : process_model_(process_model), worklet_type_(worklet_type) { + explicit V8HelperHolder(ProcessModel process_model, + WorkletType worklet_type, + size_t thread_index = 0) + : process_model_(process_model), + worklet_type_(worklet_type), + thread_index_(thread_index) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK_EQ(*GetHelperHolderInstance(), nullptr); + + if (worklet_type_ == WorkletType::kBidder) { + DCHECK_EQ(g_bidder_instance, nullptr); + } else { + DCHECK_EQ(g_seller_instances->size(), thread_index_); + } } ~V8HelperHolder() { @@ -103,9 +128,25 @@ wait_for_v8_shutdown_.Wait(); } - V8HelperHolder** instance = GetHelperHolderInstance(); - DCHECK_EQ(*instance, this); - *instance = nullptr; + if (worklet_type_ == WorkletType::kBidder) { + DCHECK_EQ(g_bidder_instance, this); + g_bidder_instance = nullptr; + } else { + DCHECK_EQ(g_seller_instances->at(thread_index_), this); + g_seller_instances->at(thread_index_) = nullptr; + + size_t alive_instances_count = + std::count_if(g_seller_instances->begin(), g_seller_instances->end(), + [](V8HelperHolder* instance) { return !!instance; }); + + if (alive_instances_count == 0) { + g_seller_instances->clear(); + delete g_seller_instances; + g_seller_instances = nullptr; + + g_next_seller_worklet_thread_index = 0; + } + } } void FinishedDestroying() { @@ -115,20 +156,13 @@ wait_for_v8_shutdown_.Signal(); } - V8HelperHolder** GetHelperHolderInstance() { - if (worklet_type_ == WorkletType::kBidder) { - return &g_bidder_instance; - } else { - return &g_seller_instance; - } - } - static V8HelperHolder* g_bidder_instance; - static V8HelperHolder* g_seller_instance; + static std::vector<V8HelperHolder*>* g_seller_instances; scoped_refptr<AuctionV8Helper> auction_v8_helper_; const ProcessModel process_model_; const WorkletType worklet_type_; + size_t thread_index_ = 0; base::WaitableEvent wait_for_v8_shutdown_; SEQUENCE_CHECKER(sequence_checker_); @@ -136,8 +170,9 @@ AuctionWorkletServiceImpl::V8HelperHolder* AuctionWorkletServiceImpl::V8HelperHolder::g_bidder_instance = nullptr; -AuctionWorkletServiceImpl::V8HelperHolder* - AuctionWorkletServiceImpl::V8HelperHolder::g_seller_instance = nullptr; + +std::vector<AuctionWorkletServiceImpl::V8HelperHolder*>* + AuctionWorkletServiceImpl::V8HelperHolder::g_seller_instances = nullptr; // static void AuctionWorkletServiceImpl::CreateForRenderer( @@ -162,9 +197,15 @@ mojo::PendingReceiver<mojom::AuctionWorkletService> receiver) : auction_bidder_v8_helper_holder_( V8HelperHolder::BidderInstance(process_model)), - auction_seller_v8_helper_holder_( - V8HelperHolder::SellerInstance(process_model)), - receiver_(this, std::move(receiver)) {} + receiver_(this, std::move(receiver)) { + for (size_t i = 0; + i < + static_cast<size_t>(features::kFledgeSellerWorkletThreadPoolSize.Get()); + ++i) { + auction_seller_v8_helper_holders_.push_back( + V8HelperHolder::SellerInstance(process_model, /*thread_index=*/i)); + } +} AuctionWorkletServiceImpl::~AuctionWorkletServiceImpl() = default; @@ -172,7 +213,9 @@ AuctionWorkletServiceImpl::AuctionV8HelpersForTesting() { std::vector<scoped_refptr<AuctionV8Helper>> result; result.push_back(auction_bidder_v8_helper_holder_->V8Helper()); - result.push_back(auction_seller_v8_helper_holder_->V8Helper()); + for (const auto& v8_helper_holder : auction_seller_v8_helper_holders_) { + result.push_back(v8_helper_holder->V8Helper()); + } return result; } @@ -212,8 +255,8 @@ void AuctionWorkletServiceImpl::LoadSellerWorklet( mojo::PendingReceiver<mojom::SellerWorklet> seller_worklet_receiver, - mojo::PendingRemote<mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector<mojo::PendingRemote<mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool pause_for_debugger_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory, @@ -224,14 +267,16 @@ const url::Origin& top_window_origin, mojom::AuctionWorkletPermissionsPolicyStatePtr permissions_policy_state, std::optional<uint16_t> experiment_group_id) { - std::vector<mojo::PendingRemote<mojom::AuctionSharedStorageHost>> - shared_storage_hosts; - shared_storage_hosts.push_back(std::move(shared_storage_host_remote)); + std::vector<scoped_refptr<AuctionV8Helper>> v8_helpers; + for (size_t i = 0; i < auction_seller_v8_helper_holders_.size(); ++i) { + v8_helpers.push_back(auction_seller_v8_helper_holders_[i]->V8Helper()); + } + + CHECK_EQ(v8_helpers.size(), shared_storage_hosts.size()); auto seller_worklet = std::make_unique<SellerWorklet>( - std::vector{auction_seller_v8_helper_holder_->V8Helper()}, - std::move(shared_storage_hosts), pause_for_debugger_on_start, - std::move(pending_url_loader_factory), + std::move(v8_helpers), std::move(shared_storage_hosts), + pause_for_debugger_on_start, std::move(pending_url_loader_factory), std::move(auction_network_events_handler), decision_logic_url, trusted_scoring_signals_url, top_window_origin, std::move(permissions_policy_state), experiment_group_id, @@ -249,7 +294,10 @@ } size_t AuctionWorkletServiceImpl::GetNextSellerWorkletThreadIndex() { - return 0; + size_t result = g_next_seller_worklet_thread_index++; + g_next_seller_worklet_thread_index %= + auction_seller_v8_helper_holders_.size(); + return result; } void AuctionWorkletServiceImpl::DisconnectSellerWorklet(
diff --git a/content/services/auction_worklet/auction_worklet_service_impl.h b/content/services/auction_worklet/auction_worklet_service_impl.h index 794b3de..4b37f6d 100644 --- a/content/services/auction_worklet/auction_worklet_service_impl.h +++ b/content/services/auction_worklet/auction_worklet_service_impl.h
@@ -75,8 +75,8 @@ std::optional<uint16_t> experiment_group_id) override; void LoadSellerWorklet( mojo::PendingReceiver<mojom::SellerWorklet> seller_worklet_receiver, - mojo::PendingRemote<mojom::AuctionSharedStorageHost> - shared_storage_host_remote, + std::vector<mojo::PendingRemote<mojom::AuctionSharedStorageHost>> + shared_storage_hosts, bool pause_for_debugger_on_start, mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory, @@ -111,7 +111,7 @@ // V8HelperHolder may need to block to get V8 shutdown cleanly, which is // helped by worklets not being around to produce more work. scoped_refptr<V8HelperHolder> auction_bidder_v8_helper_holder_; - scoped_refptr<V8HelperHolder> auction_seller_v8_helper_holder_; + std::vector<scoped_refptr<V8HelperHolder>> auction_seller_v8_helper_holders_; // This is bound when created via CreateForService(); in case of // CreateForRenderer() an external SelfOwnedReceiver is used instead.
diff --git a/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom b/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom index 75c59d5..a9fae99 100644 --- a/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom +++ b/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom
@@ -125,9 +125,10 @@ // already, since it's on the AuctionWorkletService pipe instead of the // SellerWorklet pipe. // - // `shared_storage_host` The pipe for the BidderWorklet to send shared storage - // requests to the browser process. Will be null if the `kSharedStorageAPI` - // feature or the "shared-storage" permissions policy is disabled. + // `shared_storage_hosts` The pipes for the SellerWorklet threads to send + // shared storage requests to the browser process. Will all be null if the + // `kSharedStorageAPI` feature or the "shared-storage" permissions policy is + // disabled. // // `pause_for_debugger_on_start` If this is true, the worklet should not // commence any work until it gets a Runtime.runIfWaitingForDebugger debugger @@ -150,7 +151,7 @@ // server and as part of AuctionConfig. LoadSellerWorklet( pending_receiver<SellerWorklet> seller_worklet, - pending_remote<AuctionSharedStorageHost>? shared_storage_host, + array<pending_remote<AuctionSharedStorageHost>?> shared_storage_hosts, bool pause_for_debugger_on_start, pending_remote<network.mojom.URLLoaderFactory> url_loader_factory, pending_remote<AuctionNetworkEventsHandler> auction_network_events_handler,
diff --git a/content/shell/browser/shell_devtools_bindings.cc b/content/shell/browser/shell_devtools_bindings.cc index 9b91a8a..2bf2f54 100644 --- a/content/shell/browser/shell_devtools_bindings.cc +++ b/content/shell/browser/shell_devtools_bindings.cc
@@ -143,7 +143,9 @@ bindings_->loaders_.erase(bindings_->loaders_.find(this)); } - void OnRetry(base::OnceClosure start_retry) override { NOTREACHED(); } + void OnRetry(base::OnceClosure start_retry) override { + NOTREACHED_IN_MIGRATION(); + } const int stream_id_; const int request_id_;
diff --git a/content/shell/renderer/shell_content_renderer_client.cc b/content/shell/renderer/shell_content_renderer_client.cc index a57df96..14b59b0 100644 --- a/content/shell/renderer/shell_content_renderer_client.cc +++ b/content/shell/renderer/shell_content_renderer_client.cc
@@ -154,7 +154,7 @@ std::move(callback).Run(); } - void WriteToPreloadedPipe() override { NOTREACHED(); } + void WriteToPreloadedPipe() override { NOTREACHED_IN_MIGRATION(); } mojo::Receiver<mojom::TestService> receiver_; };
diff --git a/content/test/content_test_bundle_data.filelist b/content/test/content_test_bundle_data.filelist index 4bc61b4..df8f928 100644 --- a/content/test/content_test_bundle_data.filelist +++ b/content/test/content_test_bundle_data.filelist
@@ -6691,6 +6691,8 @@ data/interest_group/bidding_logic_use_wasm.js.mock-http-headers data/interest_group/bidding_logic_with_debugging_report.js data/interest_group/bidding_logic_with_debugging_report.js.mock-http-headers +data/interest_group/bidding_logic_with_real_time_reporting.js +data/interest_group/bidding_logic_with_real_time_reporting.js.mock-http-headers data/interest_group/bidding_logic_with_size.js data/interest_group/bidding_logic_with_size.js.mock-http-headers data/interest_group/bidding_no_direct_from_seller_signals_validator.js @@ -6719,6 +6721,8 @@ data/interest_group/decision_logic_throws.js.mock-http-headers data/interest_group/decision_logic_with_debugging_report.js data/interest_group/decision_logic_with_debugging_report.js.mock-http-headers +data/interest_group/decision_logic_with_real_time_reporting.js +data/interest_group/decision_logic_with_real_time_reporting.js.mock-http-headers data/interest_group/decision_no_direct_from_seller_signals_validator.js data/interest_group/decision_no_direct_from_seller_signals_validator.js.mock-http-headers data/interest_group/decision_simple_direct_from_seller_signals_validator.js
diff --git a/content/test/data/accessibility/regression/option-accessible-name-is-select-expected-blink.txt b/content/test/data/accessibility/regression/option-accessible-name-is-select-expected-blink.txt index b0c1ea87..10dd19e 100644 --- a/content/test/data/accessibility/regression/option-accessible-name-is-select-expected-blink.txt +++ b/content/test/data/accessibility/regression/option-accessible-name-is-select-expected-blink.txt
@@ -7,6 +7,6 @@ ++++++comboBoxSelect collapsed required name='How often?' invalidState=true ++++++++menuListPopup invisible ++++++++++menuListOption selected=true -++++++++++menuListOption invisible selected=false -++++++++++menuListOption invisible selected=false -++++++++++menuListOption invisible selected=false +++++++++++menuListOption invisible name='Week' selected=false +++++++++++menuListOption invisible name='Month' selected=false +++++++++++menuListOption invisible name='Year' selected=false
diff --git a/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js b/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js new file mode 100644 index 0000000..bead38b8 --- /dev/null +++ b/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js
@@ -0,0 +1,20 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Basic generate bid script that offers a bid of 1 using the first ad's +// `renderURL`. +function generateBid( + interestGroup, auctionSignals, perBuyerSignals, trustedBiddingSignals, + browserSignals) { + const ad = interestGroup.ads[0]; + realTimeReporting.contributeToRealTimeHistogram(101, {priorityWeight: 0.5}); + return {'ad': interestGroup.name, 'bid': 1, 'render': ad.renderURL}; +} + +function reportWin( + auctionSignals, perBuyerSignals, sellerSignals, browserSignals) { + sendReportTo( + browserSignals.interestGroupOwner + '/echoall?report_bidder/' + + browserSignals.interestGroupName); +}
diff --git a/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js.mock-http-headers b/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js.mock-http-headers new file mode 100644 index 0000000..a1c1c883 --- /dev/null +++ b/content/test/data/interest_group/bidding_logic_with_real_time_reporting.js.mock-http-headers
@@ -0,0 +1,3 @@ +HTTP/1.1 200 OK +Content-Type: Application/Javascript +Ad-Auction-Allowed: true
diff --git a/content/test/data/interest_group/decision_logic_with_real_time_reporting.js b/content/test/data/interest_group/decision_logic_with_real_time_reporting.js new file mode 100644 index 0000000..2dee4c5 --- /dev/null +++ b/content/test/data/interest_group/decision_logic_with_real_time_reporting.js
@@ -0,0 +1,14 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function scoreAd( + adMetadata, bid, auctionConfig, trustedScoringSignals, browserSignals) { + realTimeReporting.contributeToRealTimeHistogram( + 200 + bid, {priorityWeight: 1.5}); + return bid; +} + +function reportResult(auctionConfig, browserSignals) { + sendReportTo(auctionConfig.seller + '/echoall?report_seller'); +}
diff --git a/content/test/data/interest_group/decision_logic_with_real_time_reporting.js.mock-http-headers b/content/test/data/interest_group/decision_logic_with_real_time_reporting.js.mock-http-headers new file mode 100644 index 0000000..a1c1c883 --- /dev/null +++ b/content/test/data/interest_group/decision_logic_with_real_time_reporting.js.mock-http-headers
@@ -0,0 +1,3 @@ +HTTP/1.1 200 OK +Content-Type: Application/Javascript +Ad-Auction-Allowed: true
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 2b0b3b1..11661bc6 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -486,9 +486,6 @@ # Failures on Windows with SkiaGraphite crbug.com/329235191 [ graphite-enabled nvidia-0x2184 win10 ] Pixel_WebGL_PremultipliedAlpha_False [ Failure ] -# Failures on Mac Asan with Graphite -crbug.com/338071687 [ mac angle-metal asan graphite-enabled intel-0x3e9b passthrough ] Pixel_Canvas2DBlitText [ Failure ] - # Tab change tests failing to find foreground tabs crbug.com/338574386 [ mac angle-metal apple-angle-metal-renderer:-apple-m1 passthrough ] Pixel_Canvas2DTabSwitch [ Failure ] crbug.com/338574386 [ mac angle-metal apple-angle-metal-renderer:-apple-m1 passthrough ] Pixel_Canvas2DTabSwitch_SoftwareCompositing [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index 01584cd..fd831363 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -189,9 +189,7 @@ # WebGL's accelerated canvas capture is currently only supported on Win, Mac, ChromeOS. crbug.com/1201009 [ linux ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_OneCopy [ Failure ] -crbug.com/1201009 [ fuchsia ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_OneCopy [ Failure ] crbug.com/1201009 [ linux ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_TwoCopy_Accelerated [ Failure ] -crbug.com/1201009 [ fuchsia ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_TwoCopy_Accelerated [ Failure ] @@ -212,11 +210,11 @@ crbug.com/329138770 [ win graphite-enabled ] SwapChainTraceTest_CanvasLowLatencyWebGLAlphaFalse [ Failure ] crbug.com/329138770 [ win graphite-enabled ] SwapChainTraceTest_CanvasLowLatencyWebGLDrawImage [ Failure ] crbug.com/329138770 [ win graphite-enabled ] SwapChainTraceTest_CanvasLowLatencyWebGLRoundedCorners [ Failure ] -crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_ComputePipelineCrossOriginsCacheMisses [ Failure ] +crbug.com/329138770 [ graphite-enabled release-x64 win10 ] WebGPUCachingTraceTest_ComputePipelineCrossOriginsCacheMisses [ Failure ] crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_ComputePipelineDifferentOrigins [ Failure ] -crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_ComputePipelineIncognito [ Failure ] +crbug.com/329138770 [ graphite-enabled release-x64 win10 ] WebGPUCachingTraceTest_ComputePipelineIncognito [ Failure ] crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_RenderPipelineCrossOriginsCacheMisses [ Failure ] -crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_RenderPipelineDifferentOrigins [ Failure ] +crbug.com/329138770 [ graphite-enabled release-x64 win10 ] WebGPUCachingTraceTest_RenderPipelineDifferentOrigins [ Failure ] crbug.com/329138770 [ graphite-enabled release-x64 win10 ] WebGPUCachingTraceTest_RenderPipelineIncognito [ Failure ]
diff --git a/device/fido/fido_request_handler_unittest.cc b/device/fido/fido_request_handler_unittest.cc index d5572eb..f344c47 100644 --- a/device/fido/fido_request_handler_unittest.cc +++ b/device/fido/fido_request_handler_unittest.cc
@@ -129,7 +129,7 @@ void OnSampleCollected(int remaining_samples) override {} - void FinishCollectToken() override { NOTREACHED(); } + void FinishCollectToken() override { NOTREACHED_IN_MIGRATION(); } private: TransportAvailabilityNotificationReceiver
diff --git a/docs/updater/functional_spec.md b/docs/updater/functional_spec.md index 55748a9..980a208 100644 --- a/docs/updater/functional_spec.md +++ b/docs/updater/functional_spec.md
@@ -954,13 +954,13 @@ #### COM interfaces (Windows only) The updater exposes -[IPolicyStatus3](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/app/server/win/updater_legacy_idl.template;l=555?q=IPolicyStatus3&ss=chromium) +[IPolicyStatus4](https://source.chromium.org/search?q=IPolicyStatus4%20file:updater_legacy_idl.template) and the corresponding `IDispatch` implementation to provide clients such as Chrome the ability to query the updater enterprise policies. A client can `CoCreateInstance` the `PolicyStatusUserClass` or the `PolicyStatusSystemClass` to get the corresponding policy status object and -query it via the `IPolicyStatus3` methods. +query it via the `IPolicyStatus4` methods. #### Deploying enterprise applications via updater policy For each application that needs to be deployed via the updater, the policy for @@ -1670,10 +1670,12 @@ the value is propagated on the client so being able to verify that the updater picks up the policy can help debug propagation issues as well. -The IPolicyStatus/IPolicyStatus2/IPolicyStatus3 interfaces therefore expose this -functionality that can be queried and shown in chrome://policy. +The IPolicyStatus/IPolicyStatus2/IPolicyStatus3/IPolicyStatus4 interfaces +therefore expose this functionality that can be queried and shown in +chrome://policy. -[IPolicyStatus/IPolicyStatus2/IPolicyStatus3 interface definition](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/app/server/win/updater_legacy_idl.template?q=IPolicyStatus) +[IPolicyStatus/IPolicyStatus2/IPolicyStatus3/IPolicyStatus4 interface definition] +(https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/app/server/win/updater_legacy_idl.template?q=IPolicyStatus) ## Uninstallation On Mac and Linux, if the application was registered with an existence path
diff --git a/docs/website b/docs/website index 2b7cfaa..12e229a 160000 --- a/docs/website +++ b/docs/website
@@ -1 +1 @@ -Subproject commit 2b7cfaa61f6bba49ecef7b8b050188c6a2103b66 +Subproject commit 12e229a0a2a544144430dfa389933ccc869ad72b
diff --git a/docs/webui_using_lit.md b/docs/webui_using_lit.md new file mode 100644 index 0000000..f44f19ba --- /dev/null +++ b/docs/webui_using_lit.md
@@ -0,0 +1,757 @@ +# Using Lit in Chromium WebUI Development + +[TOC] + +## Background + +This documentation focuses on using Lit in the context of Chromium WebUI, +and on compatibility between Lit and Polymer elements, since much of Chromium +WebUI is currently written in Polymer. It assumes familiarity with the +following: + +* Web Components: The basic foundation on which Lit is built. See + [Introduction to Web Components from MDN](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) and the related + [MDN guide for custom elements](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements). +* Lit framework, see [official docs](https://lit.dev/docs/), and especially + the [Reactive properties, Lifecycle](https://lit.dev/docs/components/lifecycle/) + and [Expressions](https://lit.dev/docs/templates/expressions/) sections. +* Lit vs Polymer differences. See + [Lit for Polymer users](https://lit.dev/articles/lit-for-polymer-users/), + covering some general Lit/Polymer compatibility and migration issues + +***promo +For developers unfamiliar with these, the external sources linked above are +recommended before continuing with this documentation. +*** + +## Chromium WebUI Infrastructure: CrLitElement base class +<code>[CrLitElement](https://source.chromium.org/chromium/chromium/src/+/main:third_party/lit/v3_0/cr_lit_element.ts;l=1?q=cr_lit_element&sq=&ss=chromium%2Fchromium%2Fsrc)</code> is provided as a base class for Chromium WebUI development. It contains code to + +1. Reduce the amount of boilerplate code necessary for individual elements. +2. Improve compatibility with elements using Polymer (necessary in a codebase + that is using both Polymer and Lit). +3. Make Polymer -> Lit migrations easier + +***promo +Lit custom elements in Chromium should inherit from the `CrLitElement` class. +*** + +Specific features of `CrLitElement` include: + +1. Forces initial rendering to be synchronous when + 1. The element’s connectedCallback runs + 2. The element is focused before the connectedCallback has run + 3. Child elements are accessed with `this.$` before the connectedCallback + has run + + This means that there is no need to call `await element.updateComplete` + before accessing the element’s DOM in certain cases: + 1. Immediately after attaching it + 2. When doing something like focusing the element or accessing its children + with `element.$` in a Polymer parent’s `connectedCallback()`, which may + run before the Lit child’s `connectedCallback()`. + + For more detail on this, see the inline documentation in `CrLitElement`. +2. “$” proxy to allow accessing child elements by ID with `this.$.id`, to match + the behavior of Polymer, which does the same thing. +3. Implementation of `notify: true` for properties. Setting this will cause + `CrLitElement` to fire `foo-changed` events in the `updated()` lifecycle + callback, whenever some property `foo` with `notify: true` set is changed. + This allows compatibility with Polymer parent element two-way bindings, but + is not exactly the same; see more details below. +4. Changes Lit’s default property/attribute mapping to match the mapping used + in Polymer - i.e. property `fooBar` will be mapped to attribute `foo-bar`, + not the Lit default of `foobar` + +## Lit and Polymer Data Bindings Compatibility +Two-way bindings are not natively supported in Lit. As mentioned above, +basic compatibility is provided by the `CrLitElement` base class’s +implementation of `notify: true`. However, these events differ from the Polymer +two-way binding behavior. +* In Polymer two-way bindings, the child element only fires a `-changed` + event if the property is modified from the child. The child element does not + fire the event if the property value is set from the parent. +* The equivalent code in `CrLitElement` can’t differentiate whether the + property was set from the parent or the child itself and always fires the + `-changed` event when the value changes. + +*** promo +When migrating parent or child elements to Lit, any code directly handling +`-changed` events in the parent should either be agnostic to whether the +corresponding property was changed from the parent or the child, or should check +that the new value in the event differs from the current parent value. +*** + +Example: a `-changed` event handler that logs a metric indicating something was +changed from the child (e.g. due to user input) should add a check before +logging that the new value is in fact new, and was not set by the parent via the +data binding. + +The behavior difference for two-way bindings can be seen by playing with this [Lit playground example](https://lit.dev/playground/#project=W3sibmFtZSI6InRvcC1lbGVtZW50LnRzIiwiY29udGVudCI6ImltcG9ydCB7UG9seW1lckVsZW1lbnQsIGh0bWx9IGZyb20gJ0Bwb2x5bWVyL3BvbHltZXInO1xuaW1wb3J0IHtjdXN0b21FbGVtZW50LCBwcm9wZXJ0eX0gZnJvbSAnQHBvbHltZXIvZGVjb3JhdG9ycyc7XG5pbXBvcnQge0NyRHVtbXlQb2x5bWVyRWxlbWVudH0gZnJvbSAnLi9jcl9kdW1teV9wb2x5bWVyLmpzJztcbmltcG9ydCB7Q3JEdW1teUxpdEVsZW1lbnR9IGZyb20gJy4vY3JfZHVtbXlfbGl0LmpzJztcbmltcG9ydCAnLi9jcl9kdW1teV9saXQuanMnO1xuaW1wb3J0ICcuL2NyX2R1bW15X3BvbHltZXIuanMnO1xuXG5AY3VzdG9tRWxlbWVudCgndG9wLWVsZW1lbnQnKVxuY2xhc3MgVG9wRWxlbWVudCBleHRlbmRzIFBvbHltZXJFbGVtZW50IHtcbiAgc3RhdGljIGdldCB0ZW1wbGF0ZSgpIHtcbiAgICByZXR1cm4gaHRtbGBcbiAgICAgIDxzdHlsZT5cbiAgICAgICAgOmhvc3Qge1xuICAgICAgICAgIGNvbG9yOiBibHVlO1xuICAgICAgICAgIGRpc3BsYXk6YmxvY2s7XG4gICAgICAgICAgYm9yZGVyOiAycHggc29saWQgYmx1ZTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgI2NoaWxkcmVuIHtcbiAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgIGdhcDogMTBweDtcbiAgICAgICAgfVxuICAgICAgPC9zdHlsZT5cbiAgICAgIDxkaXY-UE9MWU1FUiBQQVJFTlQ8L2Rpdj5cbiAgICAgIDxsYWJlbD5TZXQgUG9seW1lciBwYXJlbnQgdmFsdWU6IDxpbnB1dCB0eXBlPVwibnVtYmVyXCIgb24taW5wdXQ9XCJvbklucHV0X1wiPjwvaW5wdXQ-PC9sYWJlbD5cbiAgICAgIDxkaXYgaWQ9XCJjaGlsZHJlblwiPlxuICAgICAgPGNyLWR1bW15LXBvbHltZXIgdmFsdWU9XCJ7e3ZhbHVlUG9seW1lcn19XCIgb24tdmFsdWUtY2hhbmdlZD1cIm9uUG9seW1lclZhbHVlQ2hhbmdlZF9cIj48L2NyLWR1bW15LXBvbHltZXI-XG4gICAgICA8Y3ItZHVtbXktbGl0IHZhbHVlPVwie3t2YWx1ZUxpdH19XCIgb24tdmFsdWUtY2hhbmdlZD1cIm9uTGl0VmFsdWVDaGFuZ2VkX1wiPjwvY3ItZHVtbXktbGl0PlxuICAgICAgPC9kaXY-XG4gICAgICA8ZGl2IGlkPVwibG9nXCI-PC9kaXY-XG4gICAgYDtcbiAgfVxuICBcbiAgc3RhdGljIGdldCBwcm9wZXJ0aWVzKCkge1xuICAgIHJldHVybiB7XG4gICAgICB2YWx1ZVBvbHltZXI6IHt0eXBlOiBOdW1iZXJ9LFxuICAgICAgdmFsdWVMaXQ6IHt0eXBlOiBOdW1iZXJ9LFxuICAgIH07XG4gIH1cbiAgXG4gIHZhbHVlTGl0OiBudW1iZXI7XG4gIHZhbHVlUG9seW1lcjogbnVtYmVyO1xuICBcbiAgb25JbnB1dF8oKSB7ICAgIFxuICAgIHRoaXMudmFsdWVQb2x5bWVyID0gTnVtYmVyKHRoaXMuc2hhZG93Um9vdC5xdWVyeVNlbGVjdG9yKCdpbnB1dCcpLnZhbHVlKTtcbiAgICB0aGlzLnZhbHVlTGl0ID0gdGhpcy52YWx1ZVBvbHltZXI7XG4gIH1cbiAgXG4gIG9uUG9seW1lclZhbHVlQ2hhbmdlZF8oZSkge1xuICAgIGNvbnN0IGR1bW15ID0gdGhpcy5zaGFkb3dSb290IS5xdWVyeVNlbGVjdG9yKCdjci1kdW1teS1wb2x5bWVyJykgYXMgQ3JEdW1teVBvbHltZXJFbGVtZW50O1xuICAgIHRoaXMuJC5sb2cudGV4dENvbnRlbnQgKz0gJ3BvbHltZXItdmFsdWUtY2hhbmdlZCB0byAnICsgZS5kZXRhaWwudmFsdWUgKyAnLi4uICAnO1xuICB9XG4gICBvbkxpdFZhbHVlQ2hhbmdlZF8oZSkge1xuICAgIGNvbnN0IGR1bW15ID0gdGhpcy5zaGFkb3dSb290IS5xdWVyeVNlbGVjdG9yKCdjci1kdW1teS1saXQnKSBhcyBDckR1bW15TGl0RWxlbWVudDtcbiAgICB0aGlzLiQubG9nLnRleHRDb250ZW50ICs9ICdsaXQtdmFsdWUtY2hhbmdlZCB0byAnICsgZS5kZXRhaWwudmFsdWUgKyAnLi4uICAnO1xuICB9XG59O1xuXG4ifSx7Im5hbWUiOiJwYWNrYWdlLmpzb24iLCJjb250ZW50Ijoie1xuICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgXCJsaXRcIjogXCJeMy4wLjBcIixcbiAgICBcIkBsaXQvcmVhY3RpdmUtZWxlbWVudFwiOiBcIl4yLjAuMFwiLFxuICAgIFwibGl0LWVsZW1lbnRcIjogXCJeNC4wLjBcIixcbiAgICBcImxpdC1odG1sXCI6IFwiXjMuMC4wXCJcbiAgfVxufSIsImhpZGRlbiI6dHJ1ZX0seyJuYW1lIjoiaW5kZXguaHRtbCIsImNvbnRlbnQiOiI8IURPQ1RZUEUgaHRtbD5cbjxoZWFkPlxuICA8c2NyaXB0IHR5cGU9XCJtb2R1bGVcIiBzcmM9XCIuL3RvcC1lbGVtZW50LmpzXCI-PC9zY3JpcHQ-XG4gIDxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiIHNyYz1cIi4vdG9wLWVsZW1lbnQtbGl0LmpzXCI-PC9zY3JpcHQ-XG48L2hlYWQ-XG48Ym9keT5cbiAgPHRvcC1lbGVtZW50PjwvdG9wLWVsZW1lbnQ-XG4gIDx0b3AtZWxlbWVudC1saXQ-PC90b3AtZWxlbWVudC1saXQ-XG48L2JvZHk-XG4ifSx7Im5hbWUiOiJjcl9kdW1teV9wb2x5bWVyLnRzIiwiY29udGVudCI6ImltcG9ydCB7UG9seW1lckVsZW1lbnQsIGh0bWx9IGZyb20gJ0Bwb2x5bWVyL3BvbHltZXInO1xuaW1wb3J0IHtjdXN0b21FbGVtZW50LCBwcm9wZXJ0eX0gZnJvbSAnQHBvbHltZXIvZGVjb3JhdG9ycyc7XG5cbkBjdXN0b21FbGVtZW50KCdjci1kdW1teS1wb2x5bWVyJylcbmV4cG9ydCBjbGFzcyBDckR1bW15UG9seW1lckVsZW1lbnQgZXh0ZW5kcyBQb2x5bWVyRWxlbWVudCB7XG4gIHN0YXRpYyBnZXQgdGVtcGxhdGUoKSB7XG4gICAgcmV0dXJuIGh0bWxgXG4gICAgICAgPHN0eWxlPlxuICAgICAgICA6aG9zdCB7XG4gICAgICAgICAgYm9yZGVyOiAycHggc29saWQgYmx1ZTtcbiAgICAgICAgICBjb2xvcjogYmx1ZTtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgfVxuICAgICAgIDwvc3R5bGU-XG4gICAgICAgPGRpdj5Qb2x5bWVyIGNoaWxkIHZhbHVlIGlzOiBbW3ZhbHVlXV08L2Rpdj5cbiAgICBgO1xuICB9XG4gIFxuICBzdGF0aWMgZ2V0IHByb3BlcnRpZXMoKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHZhbHVlOiB7dHlwZTogTnVtYmVyLCBub3RpZnk6IHRydWV9LFxuICAgIH07XG4gIH1cbiAgXG4gIHZhbHVlOiBudW1iZXIgPSAxO1xufSJ9LHsibmFtZSI6InRvcC1lbGVtZW50LWxpdC50cyIsImNvbnRlbnQiOiJpbXBvcnQge0xpdEVsZW1lbnQsIGh0bWwsIG5vdGhpbmd9IGZyb20gJ2xpdCc7XG5pbXBvcnQge2N1c3RvbUVsZW1lbnR9IGZyb20gJ2xpdC9kZWNvcmF0b3JzLmpzJztcblxuaW1wb3J0IHtDckR1bW15UG9seW1lckVsZW1lbnR9IGZyb20gJy4vY3JfZHVtbXlfcG9seW1lci5qcyc7XG5pbXBvcnQgJy4vY3JfZHVtbXlfcG9seW1lci5qcyc7XG5pbXBvcnQge0NyRHVtbXlMaXRFbGVtZW50fSBmcm9tICcuL2NyX2R1bW15X2xpdC5qcyc7XG5pbXBvcnQgJy4vY3JfZHVtbXlfbGl0LmpzJztcblxuQGN1c3RvbUVsZW1lbnQoJ3RvcC1lbGVtZW50LWxpdCcpXG5jbGFzcyBUb3BFbGVtZW50TGl0IGV4dGVuZHMgTGl0RWxlbWVudCB7XG4gIG92ZXJyaWRlIHJlbmRlcigpIHtcbiAgICByZXR1cm4gaHRtbGBcbiAgICAgIDxzdHlsZT5cbiAgICAgICAgOmhvc3Qge1xuICAgICAgICAgIGJvcmRlcjogMnB4IHNvbGlkIGdyZWVuO1xuICAgICAgICAgIGNvbG9yOiBncmVlbjtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgI2NoaWxkcmVuIHtcbiAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgIGdhcDogMTBweDtcbiAgICAgICAgfVxuICAgICAgPC9zdHlsZT5cbiAgICAgIDxkaXY-TElUIFBBUkVOVDwvZGl2PlxuICAgICAgPGxhYmVsPlNldCBMaXQgcGFyZW50IHZhbHVlOiA8aW5wdXQgdHlwZT1cIm51bWJlclwiIEBpbnB1dD1cIiR7dGhpcy5vbklucHV0X31cIj48L2lucHV0PjwvbGFiZWw-XG4gICAgICA8ZGl2IGlkPVwiY2hpbGRyZW5cIj5cbiAgICAgIDxjci1kdW1teS1wb2x5bWVyIHZhbHVlPVwiJHt0aGlzLnZhbHVlUG9seW1lciB8fCBub3RoaW5nfVwiIEB2YWx1ZS1jaGFuZ2VkPVwiJHt0aGlzLm9uUG9seW1lclZhbHVlQ2hhbmdlZF99XCI-PC9jci1kdW1teS1wb2x5bWVyPlxuICAgICAgPGNyLWR1bW15LWxpdCB2YWx1ZT1cIiR7dGhpcy52YWx1ZUxpdCB8fCBub3RoaW5nfVwiIEB2YWx1ZS1jaGFuZ2VkPVwiJHt0aGlzLm9uTGl0VmFsdWVDaGFuZ2VkX31cIj48L2NyLWR1bW15LWxpdD5cbiAgICAgIDwvZGl2PlxuICAgICAgPGRpdiBpZD1cImxvZ1wiPjwvZGl2PlxuICAgIGA7XG4gIH1cblxuICBzdGF0aWMgb3ZlcnJpZGUgZ2V0IHByb3BlcnRpZXMoKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHZhbHVlUG9seW1lcjoge3R5cGU6IE51bWJlcn0sXG4gICAgICB2YWx1ZUxpdDoge3R5cGU6IE51bWJlcn0sXG4gICAgfTtcbiAgfVxuICBcbiAgdmFsdWVQb2x5bWVyOiBudW1iZXI7XG4gIHZhbHVlTGl0OiBudW1iZXI7XG4gIFxuICBvbklucHV0XygpIHtcbiAgICB0aGlzLnZhbHVlUG9seW1lciA9IE51bWJlcih0aGlzLnNoYWRvd1Jvb3QucXVlcnlTZWxlY3RvcignaW5wdXQnKS52YWx1ZSk7XG4gICAgdGhpcy52YWx1ZUxpdCA9IHRoaXMudmFsdWVQb2x5bWVyO1xuICB9XG4gIFxuICBvblBvbHltZXJWYWx1ZUNoYW5nZWRfKGUpIHtcbiAgICBjb25zdCBkdW1teSA9IHRoaXMuc2hhZG93Um9vdCEucXVlcnlTZWxlY3RvcignY3ItZHVtbXktcG9seW1lcicpIGFzIENyRHVtbXlQb2x5bWVyRWxlbWVudDtcbiAgICB0aGlzLnNoYWRvd1Jvb3QhLnF1ZXJ5U2VsZWN0b3IoJyNsb2cnKS50ZXh0Q29udGVudCArPSAncG9seW1lci12YWx1ZS1jaGFuZ2VkIHRvICcgKyBlLmRldGFpbC52YWx1ZSArICcuLi4gICc7XG4gIH1cbiAgXG4gIG9uTGl0VmFsdWVDaGFuZ2VkXyhlKSB7XG4gICAgY29uc3QgZHVtbXkgPSB0aGlzLnNoYWRvd1Jvb3QhLnF1ZXJ5U2VsZWN0b3IoJ2NyLWR1bW15LWxpdCcpIGFzIENyRHVtbXlMaXRFbGVtZW50O1xuICAgIHRoaXMuc2hhZG93Um9vdCEucXVlcnlTZWxlY3RvcignI2xvZycpLnRleHRDb250ZW50ICs9ICdsaXQtdmFsdWUtY2hhbmdlZCB0byAnICsgZS5kZXRhaWwudmFsdWUgKyAnLi4uICAnO1xuICB9XG59XG4gIn0seyJuYW1lIjoiY3JfZHVtbXlfbGl0LnRzIiwiY29udGVudCI6ImltcG9ydCB7TGl0RWxlbWVudCwgaHRtbCwgUHJvcGVydHlWYWx1ZXN9IGZyb20gJ2xpdCc7XG5pbXBvcnQge2N1c3RvbUVsZW1lbnR9IGZyb20gJ2xpdC9kZWNvcmF0b3JzLmpzJztcblxuQGN1c3RvbUVsZW1lbnQoJ2NyLWR1bW15LWxpdCcpXG5leHBvcnQgY2xhc3MgQ3JEdW1teUxpdEVsZW1lbnQgZXh0ZW5kcyBMaXRFbGVtZW50IHtcbiAgb3ZlcnJpZGUgcmVuZGVyKCkge1xuICAgIHJldHVybiBodG1sYFxuICAgICAgPHN0eWxlPlxuICAgICAgICA6aG9zdCB7XG4gICAgICAgICAgYm9yZGVyOiAycHggc29saWQgZ3JlZW47XG4gICAgICAgICAgY29sb3I6IGdyZWVuO1xuICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICB9XG4gICAgICA8L3N0eWxlPlxuICAgICAgPGRpdj5MaXQgY2hpbGQgdmFsdWUgaXM6ICR7dGhpcy52YWx1ZX08L2Rpdj5cbiAgICBgO1xuICB9XG5cbiAgc3RhdGljIG92ZXJyaWRlIGdldCBwcm9wZXJ0aWVzKCkge1xuICAgIHJldHVybiB7XG4gICAgICB2YWx1ZToge3R5cGU6IE51bWJlcn0sXG4gICAgfTtcbiAgfVxuICBcbiAgb3ZlcnJpZGUgY29ubmVjdGVkQ2FsbGJhY2soKSB7XG4gICAgc3VwZXIuY29ubmVjdGVkQ2FsbGJhY2soKTtcbiAgICBcbiAgICB0aGlzLnBlcmZvcm1VcGRhdGUoKTtcbiAgfVxuIFxuICB2YWx1ZTogbnVtYmVyID0gMTtcbiAgXG4gIC8vIEltcGxlbWVudGF0aW9uIG9mIG5vdGlmeTogdHJ1ZSBmcm9tIENyTGl0RWxlbWVudFxuICBvdmVycmlkZSB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBQcm9wZXJ0eVZhbHVlczx0aGlzPikge1xuICAgIGlmIChjaGFuZ2VkUHJvcGVydGllcy5oYXMoJ3ZhbHVlJykpIHtcbiAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudChuZXcgQ3VzdG9tRXZlbnQoJ3ZhbHVlLWNoYW5nZWQnLCB7IGJ1YmJsZXM6IHRydWUsIGNvbXBvc2VkOiB0cnVlLCBkZXRhaWw6IHsgdmFsdWU6IHRoaXMudmFsdWUgfX0pKTtcbiAgICB9XG4gIH1cbn0ifV0). +Modifying initialization of the properties in the different parent and child +elements in this playground example reveals that there are also differences +in behavior on initialization. These differences are also documented in the +following table: + +| |Property initialized in both parent and child|Property initialized in parent only|Property initialized in child only|Property uninitialized in both parent adnd child| +|---|---|---|---|---| +|**Polymer parent hosting Polymer child**|Parent value propagates to child. No `-changed` event fired.|Parent value propagates to child. No `-changed` event fired.|Child value propagates to parent. `-changed` event fired.|Property is left undefined. No events fired.| +|**Polymer parent hosting Lit child**|Parent value propagates to child. `-changed` event fired.|Parent value propagates to child. `-changed` event fired.|Child value propagates to parent. `-changed` event fired.|Property is left undefined. No events fired.| +|**Lit parent hosting Polymer child**|Parent value propagates to child. `-changed` event fired.|Parent value propagates to child. `-changed` event fired.|Child value propagates to parent if binding is using attribute syntax\*. If using property syntax\*\*, parent `undefined` value takes precedence and `-changed` event fires with `undefined`.|Property is left undefined. No events fired.| +|**Lit parent hosting Lit child**|Parent value propagates to child. `-changed` event fired.|Parent value propagates to child. `-changed` event fired.| Child value propagates to parent if binding is using attribute syntax\*. If using property syntax\*\*, parent `undefined` value takes precedence and `-changed` event fires with `undefined`.|Property is left undefined. No events fired.| + +***aside +\* attribute syntax: `value="${this.childValue || nothing}"` + +\*\* property syntax: `.value="${this.value}" `Note that this syntax must be used for anything that is not a boolean, string, or number. +*** + +## Polymer iron/paper elements alternatives +Previously, code in Chromium WebUI relied heavily on the Polymer library of +elements in addition to the Polymer framework itself. The following table +captures the list of elements that were still being used in Desktop WebUI code +when the WebUI team started exploring Lit as an alternative to Polymer, and +discusses the recommended future approach for each. Some of these +elements have subsequently been removed from Desktop (non-CrOS) builds, and more +will be removed over time. + +*** note +Note: `iron-` and `paper-` elements are +[no longer recommended even for Polymer UIs.](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/web/web.md#Polymer) +*** + +|POLYMER LIBRARY ELEMENT|RECOMMENDED APPROACH| +|-----------------------|--------------------| +|`iron-list`|Consider using a simple `items.map(...)` pattern. If you have a very large number of elements and need `iron-list` for its re-use of nodes, currently you will need to use `iron-list` itself (and consequently pull in Polymer, ~90kb).| +|`iron-icon`|Use `cr-icon`.| +|`iron-collapse`|Use `cr-collapse`.| +|`paper-spinner`|Style `throbber.svg` with CSS as needed.| +|`paper-styles`|Do not use, these styles are pre-2023 refresh and have been removed on non-CrOS builds.| +|`iron-flex-layout`|Do not use, use standard CSS to style elements.| +|`iron-a11y-announcer`|Use `cr-a11y-announcer`| +|`iron-location`/`iron-query-params`|Use `CrRouter` or custom code.| +|`iron-scroll-target-behavior`|Do not use.| +|`paper-progress`|Use either `cr-progress` or the native `<progress>` element with CSS styling.| +|`iron-iconset-svg`/`iron-meta`|Use `cr-iconset` and `IconsetMap`.| +|`iron-media-query`|Do not use, use `window.matchMedia()`.| +|`iron-pages`|Do not use, replace with equivalent conditional rendering or use `cr-page-selector`.| +|`iron-scroll-threshold`|Do not use.| +|`iron-resizable-behavior`|Do not use. `ResizeObserver`s can be used to trigger changes in items that need to be modified when something is resized.| +|`paper-tooltip`|Use `cr-tooltip`.| +|`iron-a11y-keys`|Do not use.| +|`iron-selector`/`iron-selectable-behavior`|Use `CrSelectableMixin`.| + +## Anatomy of a Lit-based element +In Chromium WebUI, Lit based custom elements are defined using 3 files: +1. A \*`.ts` file defining the element, which imports the template from the + \*`.html.js` file and the style from the \*`.css.js` file. +2. A \*`.css` file containing the element’s styling. This file is run through + `css_to_wrapper` at build time to create a \*`.css.js` file that the + element’s \*`.ts` file can import the styles from. +3. A \*`.html.ts` file containing the element’s HTML template. This file can be + either + * auto-generated from a checked-in `*.html` file via `html_to_wrapper` + (preferred approach for Polymer->Lit migrations), OR + * directly be checked in to the repository (preferred approach for new Lit + code, or post migration cleanups) + +***note +Note: This differs from Polymer based custom elements in Chromium, which +typically use only 2 files: a `.html` file containing both the element’s +template and its styling, and a `.ts` file containing the element definition. +*** + +Example `.ts` file: +``` +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import '//resources/cr_elements/cr_input/cr_input.js'; + +import {CrLitElement} from '//resources/lit/v3_0/lit.rollup.js'; +import {getCss} from './my_example.css.js'; +import {getHtml} from './my_example.html.js'; + +export interface MyExampleElement { + $: { + input: HTMLElement, + }; +} + +export class MyExampleElement extends CrLitElement { + static get is() { + return 'my-example'; + } + + static override get styles() { + return getCss(); + } + + override render() { + return getHtml.bind(this)(); + } + + static override get properties() { + return { + disabled: { + type: Boolean, + reflect: true, + }, + myValue: {type: String}, + }; + } + + disabled: boolean = false; + myValue: string = 'hello world'; + + // Referenced from the template, so must be protected (not private). + protected onInputValueChanged_(e: CustomEvent<string>) { + this.myValue = e.detail.value; + } +} + +declare global { + interface HTMLElementTagNameMap { + 'my-example': MyExampleElement; + } +} + +customElements.define(MyExampleElement.is, MyExampleElement); +``` + +Example CSS file: +``` +/* Copyright 2024 The Chromium Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #import=//resources/cr_elements/cr_shared_vars.css.js + * #scheme=relative + * #css_wrapper_metadata_end */ + +#input { + background-color: blue; + --cr-input-error-display: none; +} + +:host([disabled]) #input { + background-color: gray; +} +``` + +***note +CSS files holding Lit element styles should begin with metadata comments, +between 2 lines marked with `#css_wrapper_metadata_start` and +`#css_wrapper_metadata_end`. These comments tell `css_to_wrapper()` how to +generate the wrapper `.css.ts` file. +* `style-lit` indicates this is a Lit style file +* imports are specified with `#import=//import/path/for/file` +* includes (not used in this particular example) are specified with + `#include="style-name-1 style-name-2"` +* `scheme=relative` indicates imports should be scheme-relative + (i.e. use “`//resources`”) +*** + +Example `.html.ts `file: +``` +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {html} from '//resources/lit/v3_0/lit.rollup.js'; +import type {MyExampleElement} from './my_example.js'; + +export function getHtml(this: MyExampleElement) { + return html` + <div>Input something</div> + <cr-input id="input" .value="${this.myValue}" + ?disabled="${this.disabled}" + @value-changed="${this.onInputValueChanged_}"> + </cr-input>`; +} +``` + +`BUILD.gn` file configuration: +``` +build_webui("build") { + … + # Use non_web_component_files since the .html.ts file is checked in. + non_web_component_files = [ + "my_example.html.ts", + "my_example.ts", + ] + # Unlike Polymer, when using Lit non-shared CSS code resides in dedicated + # CSS files passed to css_to_wrapper. + css_files = [ + "my_example.css", + ] + # Other TS Compiler related arguments… + ts_deps = [ + "//ui/webui/resources/cr_elements:build_ts", + "//third_party/lit/v3_0:build_ts", + ] +} +``` +***note +Note that unlike for Polymer custom elements, +both `.ts` and `.html.ts` files are passed as `non_web_component_files`. This +indicates to `build_webui()` that they do not have a corresponding `.html` file +that needs to be passed to `html_to_wrapper()` (since in the case of Lit +elements, `.html.ts` files are checked in directly). +*** + +## Polymer to Lit migrations + +Many of the boilerplate steps for migrating from Polymer to Lit are documented +in the [readme](https://chromium.googlesource.com/chromium/src/+/main/ui/webui/resources/tools/codemods/lit_migration.md) +in the Lit migration [script](https://source.chromium.org/chromium/chromium/src/+/main:ui/webui/resources/tools/codemods/lit_migration.py) +folder. + +***promo +Most of the basic boilerplate migration steps can be automated using the +migration script. +*** + +The script can be invoked to begin migrating an element from Polymer to Lit as +follows (replace the `most_visited.ts` file path with the file being migrated): + +``` +python3 ui/webui/resources/tools/codemods/lit_migration.py \ + --file ui/webui/resources/cr_components/most_visited/most_visited.ts +``` + +The rest of this section describes migration steps that cannot be automated +using the script. + +### Computed properties +Computed properties in Polymer may not be needed after migrating Lit, if the +properties are simply used to populate some part of the element’s template and +are not reflected as attributes or double-bound to a Polymer parent. Lit +automatically re-renders any changed parts of the template without needing to +have the individual properties listed as parameters in the HTML template, so +in these cases the computation method can be used directly in the template +without specifying parameters. An example of this follows. + +Polymer HTML template snippet: +``` +<cr-button hidden="[[hideButton_]]">Click Me</cr-button> +``` + +In the Polymer element definition: +``` +static get properties() { + return { + loading: Boolean, + showingDialog: Boolean, + hideButton_: { + type: Boolean, + computed: 'computeHideButton_(loading, showingDialog)', + }, + }; +} +// Other code goes here + +private computeHideButton_(): boolean { + return !this.loading && !this.showingDialog; +} +``` + +This could be rewritten in Lit, omitting the `hideButton_` property entirely. + +Equivalent Lit HTML template snippet: +``` +<cr-button ?hidden="${this.computeHideButton_()}">Click Me</cr-button> +``` + +Equivalent Lit element definition: +``` +static get properties() { + return { + loading: {type: Boolean}, + showingDialog: {type: Boolean}, + }; +} +// Other code goes here +// Anything referenced in the HTML template needs to be protected, not +// private. +protected computeHideButton_(): boolean { + return !this.loading && !this.showingDialog; +} +``` + +In other cases, where computed properties are bound to other elements, used as +attributes, or are needed for other internal logic, they can be computed in the +`willUpdate()` lifecycle callback when the properties that they depend on change +as in the following example: +``` +override willUpdate(changedProperties: PropertyValues<this>) { + super.willUpdate(changedProperties); + + if (changedProperties.has('value')) { + const values = (this.value || '').split(','); + this.multipleValues_ = values.length > 1; + } +} +``` + +### Observers +Observer code should be triggered in either the `willUpdate()` lifecycle +callback or the `updated()` lifecycle callback, depending on whether it is +internal logic or requires accessing the element’s DOM: +* Any code that measures or queries the element’s DOM belongs in `updated()` + to avoid measuring or querying before rendering has actually completed for + the current cycle. +* Otherwise, updates to other reactive properties should generally be put in + `willUpdate() `so that any resulting template changes from these property + updates can be batched with the other changes in a single update, rather + than triggering a second round of updates. + +Consider the following Polymer code, with a complex observer: +``` +static get properties() { + return { + max: Number, + min: Number, + value: Number, + }; +} + +static get observers() { + return [ 'onValueSet_(min, max, value)' ]; +} + +private onValueSet_() { + this.value = Math.min(Math.max(this.value, this.min), this.max); + const demo = this.shadowRoot!.querySelector('#demo'); + if (demo) { + demo.style.height = `${this.value}px`; + } +} +``` + +The Lit migrated code would look as follows, with the observer code split +into `willUpdate()` and `updated()` based on whether it accesses the DOM: +``` +static override get properties() { + return { + max: {type: Number}, + min: {type: Number}, + value: {type: Number}, + }; +} + +override willUpdate(changedProperties: PropertyValues<this>) { + super.willUpdate(changedProperties); + // Clamp value in willUpdate() so we don't trigger a second update + // cycle for the same changes. + if (changedProperties.has('min') || changedProperties.has('max') || + changedProperties.has('value')) { + this.value = Math.min(Math.max(this.value, this.min), this.max); + } +} + +override updated(changedProperties: PropertyValues<this>) { + super.updated(changedProperties); + + // Querying and modifying the DOM should happen in updated(). + if (changedProperties.has('value')) { + const demo = this.shadowRoot!.querySelector('#demo'); + if (demo) { + demo.style.height = `${this.value}px`; + } + } +} +``` + +### dom-if +Polymer `<template is="dom-if">` should generally be replaced by ternary +statements in the `.html.ts` file of the form +`${condition ? html`<some-html>` : ''}`. Example simplified from +`cr-toolbar`: + +Polymer `cr_toolbar.html`: +``` +<div id="content"> + <template is="dom-if" if="[[showMenu]]" restamp> + <cr-icon-button id="menuButton" class="no-overlap" + iron-icon="cr20:menu" on-click="onMenuClick_"> + </cr-icon-button> + </template> + <h1>[[pageName]]</h1> +</div> +``` + +Lit `cr_toolbar.html.ts`: +``` +<div id="content"> + ${this.showMenu ? html` + <cr-icon-button id="menuButton" class="no-overlap" + iron-icon="cr20:menu" @click="${this.onMenuClick_}"> + </cr-icon-button>` : ''} + <h1>${this.pageName}</h1> +</div> +``` + +***note +Lit conditional rendering is specifically similar to a dom-if template +that uses `restamp` (like the example above). This represents the vast majority +of cases in Chromium WebUI code. +*** + +### dom-repeat +Polymer `<template is="dom-repeat">` should generally be replaced by a `map()` +call, of the form +`${this.myItems.map((item, index) => html`<div>item.name</div>`)}`. + +Unlike in Polymer where events triggered from elements in the template are +augmented with data about the item and index they are associated with (i.e. the +`DomRepeatEvent` data), event handlers connected to elements in a repeated +subtree in Lit receive the original event without any additional data. + +*** promo +When migrating to Lit, event handlers that use the `DomRepeatEvent'`s `item` +and/or `index` need to use a different method to get this information. +*** + +One possibility is to set the index or item as data attributes on elements that +fire events, as seen in the example that follows. + +From the Polymer element template: +``` +<template is="dom-repeat" items="[[listItems]]"> + <div class="item-container [[getSelectedClass_(item, selectedItem)]]"> + <cr-button id="[[getItemId_(index)]]" on-click="onItemClick_"> + [[item.name]] + </cr-button> + </div> +</template> +``` + +From the Polymer element definition: +``` +private getItemId_(index: number): string { + return 'listItemId' + index; +} + +private getSelectedClass_(item: ListItemType): string { + return (item === this.selectedItem) ? 'selected' : ''; +} + +private onItemClick_(e: DomRepeatEvent<ListItemType>) { + this.selectedItem = e.model.item; + // Autoscroll to selected item if it is not completely visible. + const list = + this.shadowRoot!.querySelectorAll<HTMLElement>('.item-container'); + const selectedElement = list[e.model.index]; + assert(selectedElement!.classList.contains('selected')); + selectedElement!.scrollIntoViewIfNeeded(); +} +``` + +Lit template: +``` +${this.listItems.map((item, index) => html` + <div class="item-container ${this.getSelectedClass_(item)}"> + <cr-button id="${this.getItemId_(index)}" + data-index="${index}" @click="${this.onItemClick_}"> + ${item.name} + </cr-button> + </div> +`)} +``` +***note +Note the `data-index` setting the `data` attribute on the +`cr-button` that triggers the click handler. +*** + +From the Lit element definition file: +``` +protected getItemId_(index: number): string { + return 'listItemId' + index; +} + +protected getSelectedClass_(item: ListItemType): string { + return item === this.selectedItem ? 'selected' : ''; +} + +protected onItemClick_(e: Event) { + const currentTarget = e.currentTarget as HTMLElement; + + // Use dataset to get the index set in the .html.ts template. + const index = Number(currentTarget.dataset['index']); + this.selectedItem = this.listItems[index]; + + // Autoscroll to selected item if it is not completely visible. + const list = + this.shadowRoot!.querySelectorAll<HTMLElement>('.item-container'); + const selectedElement = list[index]; + selectedElement!.scrollIntoViewIfNeeded(); +} +``` + +### Using composition for more complex dom-if/dom-repeat cases +In more complex cases, composition in the Lit `.html.ts` file may be more +readable and easier to maintain than directly replacing dom-ifs and dom-repeats +as described above. Composition involves the use of helper functions called from +the main `getHtml()` function to define portions of the element’s HTML template. + +Cases where this has proven useful include: +1. Nested `<template is="dom-if">` and/or `<template is="dom-repeat">` +2. dom-repeats using the `filter` option + +An example based on a simplified form of `cr-url-list-item`, which uses +composition, follows. + +From the Polymer `.html` template: +``` +<div class="folder-and-count"> + <template is="dom-if" if="[[shouldShowFolderImages_(size)]]" restamp> + <template is="dom-repeat" items="[[imageUrls]]" + filter="shouldShowImageUrl_"> + <div class="image-container" hidden$="[[!firstImageLoaded_]]"> + <img is="cr-auto-img" auto-src="[[item]]" draggable="false"> + </div> + </template> + </template> + <div class="count">[[getDisplayedCount_(count)]]</div> +</div> +``` + +From the Polymer element definition: +``` +private shouldShowImageUrl_(_url: string, index: number) { + return index <= 1; +} + +private shouldShowFolderImages_(): boolean { + return this.size !== CrUrlListItemSize.COMPACT; +} + +private getDisplayedCount_() { + if (this.count && this.count > 999) { + // The square to display the count only fits 3 characters. + return '99+'; + } + + return this.count; +} +``` + +From the Lit `.html.ts` template file: +``` +import {html} from '//resources/lit/v3_0/lit.rollup.js'; + +import type {CrUrlListItemElement} from './cr_url_list_item.js'; + +function getImageHtml(this: CrUrlListItemElement, + item: string, index: number) { + // Replaces dom-repeat's |filter| property by returning empty if the + // filter function returns false for this item and index. + if (!this.shouldShowImageUrl_(item, index)) { + return ''; + } + + return html` +<div class="image-container" ?hidden="${!this.firstImageLoaded_}"> + <img is="cr-auto-img" auto-src="${item}" draggable="false"> +</div>`; +} + +function getFolderImagesHtml(this: CrUrlListItemElement) { + // Replaces dom-if by returning empty string if condition is false. + if (!this.shouldShowFolderImages_()) { + return ''; + } + + // Replaces dom-repeat with map() + return html`${ + this.imageUrls.map( + (item, index) => getImageHtml.bind(this)(item, index))}`; +} + +export function getHtml(this: CrUrlListItemElement) { + return html` +/* other content here */ + <div class="folder-and-count"> + ${getFolderImagesHtml.bind(this)()} + <div class="count">${this.getDisplayedCount_()}</div> + </div> +/* other content */ +`; +} +``` + +From the Lit element definition: +``` +protected getDisplayedCount_(): string { + if (this.count && this.count > 999) { + // The square to display the count only fits 3 characters. + return '99+'; + } + + return this.count === undefined ? '' : this.count.toString(); +} + +protected shouldShowImageUrl_(_url: string, index: number): boolean { + return index <= 1; +} + +protected shouldShowFolderImages_(): boolean { + return this.size !== CrUrlListItemSize.COMPACT; +} +``` + +## Additional Lit and Polymer differences +### Testing + +A large number of unit tests do something like the following: +``` +// Validate that the input is disabled when invalid is set. +myTestElement.invalid = true; +assertTrue(myTestElement.$.input.disabled); +``` + +This assumes that setting `invalid` synchronously updates the DOM of the test +element. If the test element is a Lit-based element, this is no longer the case, +and we need to wait for a render cycle to complete. There are a couple of ways +to do this: + +1. Preferred: Use `await microtasksFinished()` test helper method from + chrome://webui-test/test\_util.js. This method awaits a setTimeout of 0 which + allows any render cycles to complete (useful if there may be multiple Lit + elements that need to finish updating before assertions). +2. Directly `await myTestElement.updateComplete` (waits for the test element’s + render cycle). + +Updated example: +``` +// Validate that the input is disabled when invalid is set. +myTestElement.invalid = true; +await microtasksFinished(); +assertTrue(myTestElement.$.input.disabled); +``` + +*** note +Note: for many test cases, it is less fragile to directly wait on an event +or BrowserProxy call that should be triggered by an action in a test, instead +of either assuming everything is synchronous or waiting on framework-dependent +test helpers like `microtasksFinished()` or the Polymer +`waitAfterNextRender()/flushTasks()` that do not actually guarantee that +anything specific has happened. +*** + +### Use of the `hidden` attribute +As documented in the [styleguide](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/web/web.md#Polymer), +in Polymer the `hidden` attribute was recommended over `<template is="dom-if">` +for cases of showing and hiding small amounts of HTML or a single element. In +Lit, since conditional rendering does not rely on adding a custom element like +dom-if, there is not the same potential performance downside to using +conditional rendering instead of the `hidden` attribute. + +***promo +In Lit, conditional rendering can be used instead of the +`hidden` attribute in most cases, and should always be used anywhere +`<template is="dom-if">` would previously have been used in Polymer code. +***
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn index 40190eae..0d818eb 100644 --- a/extensions/BUILD.gn +++ b/extensions/BUILD.gn
@@ -169,6 +169,7 @@ "//extensions/browser", "//extensions/browser:test_support", "//extensions/browser/api", + "//extensions/browser/api/storage:settings_namespace", "//extensions/browser/updater", "//extensions/common", "//extensions/common:core_api_provider",
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 94a12b9b..c84daa2 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -189,9 +189,6 @@ "api/scripting/scripting_constants.h", "api/scripting/scripting_utils.cc", "api/scripting/scripting_utils.h", - "api/storage/settings_namespace.cc", - "api/storage/settings_namespace.h", - "api/storage/settings_observer.h", "api/system_display/display_info_provider.cc", "api/system_display/display_info_provider.h", "api/system_display/system_display_api.cc", @@ -625,6 +622,8 @@ "//content/public/browser:browser", "//content/public/common", "//extensions:extensions_browser_resources", + "//extensions/browser/api/storage:settings_namespace", + "//extensions/browser/api/storage:settings_observer", "//extensions/browser/api/virtual_keyboard_private:virtual_keyboard_delegate", "//extensions/browser/guest_view/web_view/web_ui", "//extensions/browser/updater:keepalive", @@ -1006,6 +1005,7 @@ "//extensions:extensions_browser_resources", "//extensions:test_support", "//extensions/browser/api/declarative_net_request/filter_list_converter:unit_tests", + "//extensions/browser/api/storage:settings_namespace", "//extensions/browser/updater:updater", "//extensions/buildflags", "//extensions/common",
diff --git a/extensions/browser/api/serial/serial_apitest.cc b/extensions/browser/api/serial/serial_apitest.cc index 2dcee58..6fb8a5c 100644 --- a/extensions/browser/api/serial/serial_apitest.cc +++ b/extensions/browser/api/serial/serial_apitest.cc
@@ -138,7 +138,7 @@ NOTREACHED_IN_MIGRATION(); } - void Drain(DrainCallback callback) override { NOTREACHED(); } + void Drain(DrainCallback callback) override { NOTREACHED_IN_MIGRATION(); } void GetControlSignals(GetControlSignalsCallback callback) override { auto signals = device::mojom::SerialPortControlSignals::New();
diff --git a/extensions/browser/api/sockets_udp/test_udp_echo_server.cc b/extensions/browser/api/sockets_udp/test_udp_echo_server.cc index 38feb4f..f864afd9b 100644 --- a/extensions/browser/api/sockets_udp/test_udp_echo_server.cc +++ b/extensions/browser/api/sockets_udp/test_udp_echo_server.cc
@@ -70,7 +70,7 @@ udp_listener_receiver_.BindNewPipeAndPassRemote()); server_socket_.set_disconnect_handler( - base::BindLambdaForTesting([]() { NOTREACHED(); })); + base::BindLambdaForTesting([]() { NOTREACHED_IN_MIGRATION(); })); net::IPEndPoint server_addr(net::IPAddress::IPv4Localhost(), 0); auto server_helper =
diff --git a/extensions/browser/api/storage/BUILD.gn b/extensions/browser/api/storage/BUILD.gn index 190bcc4b..62d7d0d 100644 --- a/extensions/browser/api/storage/BUILD.gn +++ b/extensions/browser/api/storage/BUILD.gn
@@ -7,6 +7,28 @@ assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.") +source_set("settings_observer") { + sources = [ "settings_observer.h" ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + public_deps = [ + "//base", + "//extensions/common/api", + ] +} + +source_set("settings_namespace") { + sources = [ + "settings_namespace.cc", + "settings_namespace.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + public_deps = [ "//base" ] +} + source_set("storage") { sources = [ "backend_task_runner.cc", @@ -34,6 +56,8 @@ configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ + ":settings_namespace", + ":settings_observer", "//base", "//components/keyed_service/content", "//components/value_store",
diff --git a/extensions/renderer/extension_localization_throttle_unittest.cc b/extensions/renderer/extension_localization_throttle_unittest.cc index 404187fe..22febcad 100644 --- a/extensions/renderer/extension_localization_throttle_unittest.cc +++ b/extensions/renderer/extension_localization_throttle_unittest.cc
@@ -72,7 +72,7 @@ cancel_error_code_ = error_code; cancel_custom_reason_ = std::string(custom_reason); } - void Resume() override { NOTREACHED(); } + void Resume() override { NOTREACHED_IN_MIGRATION(); } void UpdateDeferredResponseHead( network::mojom::URLResponseHeadPtr new_response_head,
diff --git a/gpu/command_buffer/client/client_discardable_manager_unittest.cc b/gpu/command_buffer/client/client_discardable_manager_unittest.cc index 93da1fe1..c1ca438 100644 --- a/gpu/command_buffer/client/client_discardable_manager_unittest.cc +++ b/gpu/command_buffer/client/client_discardable_manager_unittest.cc
@@ -18,8 +18,10 @@ NOTREACHED_IN_MIGRATION(); return State(); } - void Flush(int32_t put_offset) override { NOTREACHED(); } - void OrderingBarrier(int32_t put_offset) override { NOTREACHED(); } + void Flush(int32_t put_offset) override { NOTREACHED_IN_MIGRATION(); } + void OrderingBarrier(int32_t put_offset) override { + NOTREACHED_IN_MIGRATION(); + } State WaitForTokenInRange(int32_t start, int32_t end) override { NOTREACHED_IN_MIGRATION(); @@ -31,7 +33,9 @@ NOTREACHED_IN_MIGRATION(); return State(); } - void SetGetBuffer(int32_t transfer_buffer_id) override { NOTREACHED(); } + void SetGetBuffer(int32_t transfer_buffer_id) override { + NOTREACHED_IN_MIGRATION(); + } scoped_refptr<gpu::Buffer> CreateTransferBuffer( uint32_t size, int32_t* id,
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc index e722bf7c..b17683de 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc
@@ -26,6 +26,15 @@ namespace { +// Formats supported by CreateSharedImage() for uploading initial data. +bool IsFormatSupportedForInitialData(viz::SharedImageFormat format) { + // The set of formats is artificially limited to avoid needing to handle + // formats outside of what is required. If more are needed, we may need to + // adjust our initial data's packing or the |D3D11_SUBRESOURCE_DATA|'s pitch. + return format == viz::SinglePlaneFormat::kRGBA_8888 || + format == viz::SinglePlaneFormat::kBGRA_8888; +} + // Formats supported by CreateSharedImage() with no GpuMemoryBufferHandle. DXGI_FORMAT GetDXGIFormatForCreateTexture(viz::SharedImageFormat format) { if (format == viz::SinglePlaneFormat::kRGBA_F16) { @@ -390,7 +399,7 @@ D3D11_SUBRESOURCE_DATA initial_data = {}; if (!pixel_data.empty()) { - if (format != viz::SinglePlaneFormat::kRGBA_8888) { + if (!IsFormatSupportedForInitialData(format)) { LOG(ERROR) << "Unsupported format: " << format.ToString(); return nullptr; } @@ -525,7 +534,7 @@ gfx::GpuMemoryBufferType gmb_type, GrContextType gr_context_type, base::span<const uint8_t> pixel_data) { - if (!pixel_data.empty() && format != viz::SinglePlaneFormat::kRGBA_8888) { + if (!pixel_data.empty() && !IsFormatSupportedForInitialData(format)) { return false; }
diff --git a/gpu/command_buffer/service/shared_image/shared_image_factory.cc b/gpu/command_buffer/service/shared_image/shared_image_factory.cc index f065ee0..d6cd0c4 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_factory.cc
@@ -178,22 +178,29 @@ } // namespace -// Overrides for flat_set lookups: -bool operator<( +std::size_t +SharedImageFactory::SharedImageRepresentationFactoryRefHash::operator()( + const std::unique_ptr<SharedImageRepresentationFactoryRef>& o) const { + return std::hash<gpu::Mailbox>{}(o->mailbox()); +} + +std::size_t +SharedImageFactory::SharedImageRepresentationFactoryRefHash::operator()( + const gpu::Mailbox& m) const { + return std::hash<gpu::Mailbox>{}(m); +} + +bool SharedImageFactory::SharedImageRepresentationFactoryRefKeyEqual:: +operator()( const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs, - const std::unique_ptr<SharedImageRepresentationFactoryRef>& rhs) { - return lhs->mailbox() < rhs->mailbox(); + const std::unique_ptr<SharedImageRepresentationFactoryRef>& rhs) const { + return lhs->mailbox() == rhs->mailbox(); } -bool operator<( - const Mailbox& lhs, - const std::unique_ptr<SharedImageRepresentationFactoryRef>& rhs) { - return lhs < rhs->mailbox(); -} - -bool operator<(const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs, - const Mailbox& rhs) { - return lhs->mailbox() < rhs; +bool SharedImageFactory::SharedImageRepresentationFactoryRefKeyEqual:: +operator()(const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs, + const gpu::Mailbox& rhs) const { + return lhs->mailbox() == rhs; } SharedImageFactory::SharedImageFactory(
diff --git a/gpu/command_buffer/service/shared_image/shared_image_factory.h b/gpu/command_buffer/service/shared_image/shared_image_factory.h index 8e6d29f2..004bfb4 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_factory.h +++ b/gpu/command_buffer/service/shared_image/shared_image_factory.h
@@ -7,9 +7,9 @@ #include <memory> #include <string> +#include <unordered_set> #include <vector> -#include "base/containers/flat_set.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "build/build_config.h" @@ -179,9 +179,28 @@ // is no shared context. const GrContextType gr_context_type_; + struct SharedImageRepresentationFactoryRefHash { + using is_transparent = void; + std::size_t operator()( + const std::unique_ptr<SharedImageRepresentationFactoryRef>& o) const; + std::size_t operator()(const gpu::Mailbox& m) const; + }; + + struct SharedImageRepresentationFactoryRefKeyEqual { + using is_transparent = void; + bool operator()( + const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs, + const std::unique_ptr<SharedImageRepresentationFactoryRef>& rhs) const; + bool operator()( + const std::unique_ptr<SharedImageRepresentationFactoryRef>& lhs, + const gpu::Mailbox& rhs) const; + }; + // The set of SharedImages which have been created (and are being kept alive) // by this factory. - base::flat_set<std::unique_ptr<SharedImageRepresentationFactoryRef>> + std::unordered_set<std::unique_ptr<SharedImageRepresentationFactoryRef>, + SharedImageRepresentationFactoryRefHash, + SharedImageRepresentationFactoryRefKeyEqual> shared_images_; // Array of all the backing factories to choose from for creating shared
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index f7c468e..3f0151fd 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -138,13 +138,13 @@ } Capabilities GetCapabilities() override { return {}; } GLCapabilities GetGLCapabilities() override { return {}; } - void RestoreGlobalState() const override { NOTREACHED(); } - void ClearAllAttributes() const override { NOTREACHED(); } - void RestoreAllAttributes() const override { NOTREACHED(); } + void RestoreGlobalState() const override { NOTREACHED_IN_MIGRATION(); } + void ClearAllAttributes() const override { NOTREACHED_IN_MIGRATION(); } + void RestoreAllAttributes() const override { NOTREACHED_IN_MIGRATION(); } void RestoreState(const gles2::ContextState* prev_state) override { NOTREACHED_IN_MIGRATION(); } - void RestoreActiveTexture() const override { NOTREACHED(); } + void RestoreActiveTexture() const override { NOTREACHED_IN_MIGRATION(); } void RestoreAllTextureUnitAndSamplerBindings( const gles2::ContextState* prev_state) const override { NOTREACHED_IN_MIGRATION(); @@ -152,17 +152,27 @@ void RestoreActiveTextureUnitBinding(unsigned int target) const override { NOTREACHED_IN_MIGRATION(); } - void RestoreBufferBinding(unsigned int target) override { NOTREACHED(); } - void RestoreBufferBindings() const override { NOTREACHED(); } - void RestoreFramebufferBindings() const override { NOTREACHED(); } - void RestoreRenderbufferBindings() override { NOTREACHED(); } - void RestoreProgramBindings() const override { NOTREACHED(); } - void RestoreTextureState(unsigned service_id) override { NOTREACHED(); } + void RestoreBufferBinding(unsigned int target) override { + NOTREACHED_IN_MIGRATION(); + } + void RestoreBufferBindings() const override { NOTREACHED_IN_MIGRATION(); } + void RestoreFramebufferBindings() const override { + NOTREACHED_IN_MIGRATION(); + } + void RestoreRenderbufferBindings() override { NOTREACHED_IN_MIGRATION(); } + void RestoreProgramBindings() const override { NOTREACHED_IN_MIGRATION(); } + void RestoreTextureState(unsigned service_id) override { + NOTREACHED_IN_MIGRATION(); + } void RestoreTextureUnitBindings(unsigned unit) const override { NOTREACHED_IN_MIGRATION(); } - void RestoreVertexAttribArray(unsigned index) override { NOTREACHED(); } - void RestoreAllExternalTextureBindingsIfNeeded() override { NOTREACHED(); } + void RestoreVertexAttribArray(unsigned index) override { + NOTREACHED_IN_MIGRATION(); + } + void RestoreAllExternalTextureBindingsIfNeeded() override { + NOTREACHED_IN_MIGRATION(); + } QueryManager* GetQueryManager() override { NOTREACHED_IN_MIGRATION(); return nullptr; @@ -171,7 +181,7 @@ base::OnceClosure callback) override { NOTREACHED_IN_MIGRATION(); } - void CancelAllQueries() override { NOTREACHED(); } + void CancelAllQueries() override { NOTREACHED_IN_MIGRATION(); } gles2::GpuFenceManager* GetGpuFenceManager() override { NOTREACHED_IN_MIGRATION(); return nullptr;
diff --git a/gpu/command_buffer/tests/compressed_texture_test.cc b/gpu/command_buffer/tests/compressed_texture_test.cc index ae202ca..6884be6e 100644 --- a/gpu/command_buffer/tests/compressed_texture_test.cc +++ b/gpu/command_buffer/tests/compressed_texture_test.cc
@@ -182,7 +182,8 @@ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return LoadTextureDXT1(true); case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: return LoadTextureDXT3(); case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return LoadTextureDXT5(); - default: NOTREACHED(); + default: + NOTREACHED_IN_MIGRATION(); } return 0; }
diff --git a/gpu/command_buffer/tests/decoder_perftest.cc b/gpu/command_buffer/tests/decoder_perftest.cc index afb16747..b69bfb9b 100644 --- a/gpu/command_buffer/tests/decoder_perftest.cc +++ b/gpu/command_buffer/tests/decoder_perftest.cc
@@ -266,7 +266,7 @@ NOTREACHED_IN_MIGRATION(); } - void CancelAllQueries() override { NOTREACHED(); } + void CancelAllQueries() override { NOTREACHED_IN_MIGRATION(); } void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override { NOTREACHED_IN_MIGRATION(); @@ -278,9 +278,9 @@ NOTREACHED_IN_MIGRATION(); } - void SetLock(base::Lock*) override { NOTREACHED(); } + void SetLock(base::Lock*) override { NOTREACHED_IN_MIGRATION(); } - void EnsureWorkVisible() override { NOTREACHED(); } + void EnsureWorkVisible() override { NOTREACHED_IN_MIGRATION(); } gpu::CommandBufferNamespace GetNamespaceID() const override { return gpu::CommandBufferNamespace::INVALID; @@ -290,7 +290,7 @@ return gpu::CommandBufferId(); } - void FlushPendingWork() override { NOTREACHED(); } + void FlushPendingWork() override { NOTREACHED_IN_MIGRATION(); } uint64_t GenerateFenceSyncRelease() override { NOTREACHED_IN_MIGRATION();
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 3792e09b..2496794 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -31,6 +31,8 @@ "'headless_enable_commands' is not compatible with 'headless_use_embedded_resources'.") } +bundle_hyphen_data = (is_linux || is_win) && !headless_use_embedded_resources + # Headless defines config applied to every target below. config("headless_defines_config") { defines = [] @@ -626,6 +628,10 @@ "//third_party/pywebsocket3/", ] + if (bundle_hyphen_data) { + data += [ "$root_out_dir/hyphen-data/hyph-en-us.hyb" ] + } + data_deps = [] if (headless_enable_commands) { @@ -651,6 +657,10 @@ defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + if (headless_use_embedded_resources) { + defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] + } + deps = [ ":headless_shell_lib", "//base", @@ -712,6 +722,10 @@ ] } + if (bundle_hyphen_data) { + deps += [ "//third_party/hyphenation-patterns:bundle_hyphen_data" ] + } + configs += [ ":headless_defines_config" ] } @@ -894,6 +908,10 @@ deps += [ "//sandbox/mac:seatbelt" ] } + if (bundle_hyphen_data) { + deps += [ "//third_party/hyphenation-patterns:bundle_hyphen_data" ] + } + configs += [ ":headless_defines_config", "//build/config/compiler:wexit_time_destructors",
diff --git a/headless/lib/browser/headless_content_browser_client.cc b/headless/lib/browser/headless_content_browser_client.cc index e4be49f9..77cf03c 100644 --- a/headless/lib/browser/headless_content_browser_client.cc +++ b/headless/lib/browser/headless_content_browser_client.cc
@@ -398,4 +398,13 @@ network_service->SetExplicitlyAllowedPorts(explicitly_allowed_ports); } +void HeadlessContentBrowserClient::GetHyphenationDictionary( + base::OnceCallback<void(const base::FilePath&)> callback) { + base::FilePath dir; + if (base::PathService::Get(base::DIR_EXE, &dir)) { + dir = dir.AppendASCII("hyphen-data"); + std::move(callback).Run(dir); + } +} + } // namespace headless
diff --git a/headless/lib/browser/headless_content_browser_client.h b/headless/lib/browser/headless_content_browser_client.h index 90cc52b9..eae1297 100644 --- a/headless/lib/browser/headless_content_browser_client.h +++ b/headless/lib/browser/headless_content_browser_client.h
@@ -112,6 +112,9 @@ void OnNetworkServiceCreated( ::network::mojom::NetworkService* network_service) override; + void GetHyphenationDictionary( + base::OnceCallback<void(const base::FilePath&)> callback) override; + private: class StubBadgeService;
diff --git a/headless/test/data/protocol/sanity/auto-hyphenation-expected.txt b/headless/test/data/protocol/sanity/auto-hyphenation-expected.txt new file mode 100644 index 0000000..d13ee79 --- /dev/null +++ b/headless/test/data/protocol/sanity/auto-hyphenation-expected.txt
@@ -0,0 +1,2 @@ +Tests text auto hyphenation. +PASS \ No newline at end of file
diff --git a/headless/test/data/protocol/sanity/auto-hyphenation.js b/headless/test/data/protocol/sanity/auto-hyphenation.js new file mode 100644 index 0000000..017c476 --- /dev/null +++ b/headless/test/data/protocol/sanity/auto-hyphenation.js
@@ -0,0 +1,40 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +(async function(testRunner) { + const html = ` + <html> + <style> + div { + font: 50px/1 monospace; + width: 4ch; + hyphens: auto; + } + </style> + + <body lang="en"> + <div id="hyphenated-text">reallylongwordwithnobreaks</div> + </body> + + <script> + function getHyphenatedTextSize() { + const element = document.getElementById("hyphenated-text"); + return {width: element.offsetWidth, height: element.offsetHeight}; + } + </script> + </html> + `; + const {session} = + await testRunner.startHTML(html, 'Tests text auto hyphenation.'); + + const {width, height} = + await session.evaluate('window.getHyphenatedTextSize();'); + + if (height > width) { + testRunner.log('PASS'); + } else { + testRunner.log(`FAIL: text size: ${width}x${height}`); + } + + testRunner.completeTest(); +})
diff --git a/headless/test/headless_protocol_browsertest.cc b/headless/test/headless_protocol_browsertest.cc index 4d923978..633834da 100644 --- a/headless/test/headless_protocol_browsertest.cc +++ b/headless/test/headless_protocol_browsertest.cc
@@ -372,6 +372,10 @@ HEADLESS_PROTOCOL_TEST(RequestFullscreen, "sanity/request-fullscreen.js") +#if !defined(HEADLESS_USE_EMBEDDED_RESOURCES) +HEADLESS_PROTOCOL_TEST(AutoHyphenation, "sanity/auto-hyphenation.js") +#endif + class HeadlessProtocolBrowserTestWithProxy : public HeadlessProtocolBrowserTest { public:
diff --git a/infra/config/generated/cq-builders.md b/infra/config/generated/cq-builders.md index 1296fec..101e611 100644 --- a/infra/config/generated/cq-builders.md +++ b/infra/config/generated/cq-builders.md
@@ -356,6 +356,7 @@ Location filters: * [`//chromecast/.+`](https://cs.chromium.org/chromium/src/chromecast/) + * [`//build/fuchsia/sdk_override.txt`](https://cs.chromium.org/search?q=+file:build/fuchsia/sdk_override.txt) * [fuchsia-x64-accessibility-rel](https://ci.chromium.org/p/chromium/builders/try/fuchsia-x64-accessibility-rel) ([definition](https://cs.chromium.org/search?q=+file:/try/.*\.star$+""fuchsia-x64-accessibility-rel""))
diff --git a/infra/config/generated/cq-usage/full.cfg b/infra/config/generated/cq-usage/full.cfg index 22410451..3f0443f3 100644 --- a/infra/config/generated/cq-usage/full.cfg +++ b/infra/config/generated/cq-usage/full.cfg
@@ -1481,6 +1481,11 @@ location_filters { gerrit_host_regexp: ".*" gerrit_project_regexp: ".*" + path_regexp: "build/fuchsia/sdk_override.txt" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" path_regexp: "docs/.+" exclude: true }
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index f198eb9f..6097a0e 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -2507,6 +2507,11 @@ location_filters { gerrit_host_regexp: ".*" gerrit_project_regexp: ".*" + path_regexp: "build/fuchsia/sdk_override.txt" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" path_regexp: "docs/.+" exclude: true }
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index 33bc967..b0cf95d 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -8036,11 +8036,6 @@ short_name: "x64" } builders { - name: "buildbucket/luci.chromium.ci/Dawn Mac x64 Experimental Release (AMD)" - category: "ToT|Mac|AMD" - short_name: "exp" - } - builders { name: "buildbucket/luci.chromium.ci/Dawn Mac x64 Release (AMD)" category: "ToT|Mac|AMD" short_name: "x64" @@ -10742,11 +10737,6 @@ short_name: "dbg" } builders { - name: "buildbucket/luci.chromium.ci/Mac FYI Experimental Retina Release (AMD)" - category: "Mac|AMD|Retina" - short_name: "exp" - } - builders { name: "buildbucket/luci.chromium.ci/Mac FYI Retina ASAN (AMD)" category: "Mac|AMD|Retina" short_name: "asn"
diff --git a/infra/config/generated/testing/mixins.pyl b/infra/config/generated/testing/mixins.pyl index 9d121ee..e4216ee 100644 --- a/infra/config/generated/testing/mixins.pyl +++ b/infra/config/generated/testing/mixins.pyl
@@ -1018,7 +1018,7 @@ 'cpu': 'x86-64', 'gpu': '1002:67ef', 'hidpi': '1', - 'os': 'Mac-13.5|Mac-14.4.1', + 'os': 'Mac-14.4.1', 'pool': 'chromium.tests.gpu', 'display_attached': '1', },
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index bccde7c0..189bf2b 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -267,16 +267,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 127.0.6484.0', + 'description': 'Run with ash-chrome version 127.0.6486.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v127.0.6484.0', - 'revision': 'version:127.0.6484.0', + 'location': 'lacros_version_skew_tests_v127.0.6486.0', + 'revision': 'version:127.0.6486.0', }, ], },
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.star b/infra/config/subprojects/chromium/ci/chromium.android.star index b183f37..0c38afc 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.star
@@ -636,7 +636,6 @@ ci.thin_tester( name = "Oreo Phone Tester", - branch_selector = branches.selector.ANDROID_BRANCHES, triggered_by = ["ci/Android arm64 Builder (dbg)"], builder_spec = builder_config.builder_spec( execution_mode = builder_config.execution_mode.TEST,
diff --git a/infra/config/subprojects/chromium/ci/chromium.dawn.star b/infra/config/subprojects/chromium/ci/chromium.dawn.star index 7628d34..de14bc8 100644 --- a/infra/config/subprojects/chromium/ci/chromium.dawn.star +++ b/infra/config/subprojects/chromium/ci/chromium.dawn.star
@@ -1059,10 +1059,10 @@ run_tests_serially = True, ), # Uncomment this entry when this experimental tester is actually in use. - console_view_entry = consoles.console_view_entry( - category = "ToT|Mac|AMD", - short_name = "exp", - ), + # console_view_entry = consoles.console_view_entry( + # category = "ToT|Mac|AMD", + # short_name = "exp", + # ), list_view = "chromium.gpu.experimental", )
diff --git a/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star b/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star index b01c297..cb8e9c4 100644 --- a/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star
@@ -1124,10 +1124,10 @@ run_tests_serially = True, ), # Uncomment this entry when this experimental tester is actually in use. - console_view_entry = consoles.console_view_entry( - category = "Mac|AMD|Retina", - short_name = "exp", - ), + # console_view_entry = consoles.console_view_entry( + # category = "Mac|AMD|Retina", + # short_name = "exp", + # ), list_view = "chromium.gpu.experimental", )
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star index 127c1fb..7e5c9d58 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star
@@ -702,7 +702,6 @@ try_.builder( name = "android-oreo-arm64-dbg", - branch_selector = branches.selector.ANDROID_BRANCHES, mirrors = [ "ci/Android arm64 Builder (dbg)", "ci/Oreo Phone Tester",
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star b/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star index dd347f9a..2b15a4f8 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star
@@ -46,11 +46,13 @@ ], ), main_list_view = "try", - # This is the only bot that builds //chromecast code for Fuchsia on ARM64 - # so trigger it when changes are made. tryjob = try_.job( location_filters = [ + # This is the only bot that builds //chromecast code for Fuchsia on + # ARM64, so trigger it when changes are made. "chromecast/.+", + # Always trigger this builder when drilling the fuchsia-sdk. + "build/fuchsia/sdk_override.txt", ], ), )
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 5d826af..229b37a 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ] }
diff --git a/infra/config/targets/mixins.star b/infra/config/targets/mixins.star index b028f85..4aa37a3 100644 --- a/infra/config/targets/mixins.star +++ b/infra/config/targets/mixins.star
@@ -1312,7 +1312,7 @@ "cpu": "x86-64", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "display_attached": "1", },
diff --git a/internal b/internal index 4e05864..342050d 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 4e05864666c58f0cc169127b45bd44f103b594fc +Subproject commit 342050dfbbbfe808eb799cd2fe817987cf111f57
diff --git a/ios/chrome/app/application_delegate/BUILD.gn b/ios/chrome/app/application_delegate/BUILD.gn index 2590214..0fb3679 100644 --- a/ios/chrome/app/application_delegate/BUILD.gn +++ b/ios/chrome/app/application_delegate/BUILD.gn
@@ -61,6 +61,8 @@ "//ios/chrome/browser/shared/public/commands", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/shared/public/features:system_flags", + "//ios/chrome/browser/signin/model", + "//ios/chrome/browser/signin/model:test_support", "//ios/chrome/browser/tabs/model", "//ios/chrome/browser/ui/main", "//ios/chrome/browser/ui/safe_mode",
diff --git a/ios/chrome/app/application_delegate/app_state.mm b/ios/chrome/app/application_delegate/app_state.mm index b6b1099..6ea4102cc 100644 --- a/ios/chrome/app/application_delegate/app_state.mm +++ b/ios/chrome/app/application_delegate/app_state.mm
@@ -342,19 +342,21 @@ } // Don't go further with foregrounding the app when the app has not passed // safe mode yet or was initialized from the background. - if (self.initStage <= InitStageSafeMode || !_applicationInBackground) + if (self.initStage <= InitStageSafeMode || !_applicationInBackground) { return; + } _applicationInBackground = NO; - // TODO(crbug.com/325596368): Signal this for every browser state, so this - // update and the feature_engagement::TrackerFactory() update need to happen - // in parallel. Maybe: add per-profile observer methods. - if (self.mainBrowserState) { - AuthenticationServiceFactory::GetForBrowserState(self.mainBrowserState) + std::vector<ChromeBrowserState*> loadedBrowserStates = + GetApplicationContext() + ->GetChromeBrowserStateManager() + ->GetLoadedBrowserStates(); + for (ChromeBrowserState* chromeBrowserState : loadedBrowserStates) { + AuthenticationServiceFactory::GetForBrowserState(chromeBrowserState) ->OnApplicationWillEnterForeground(); if (base::FeatureList::IsEnabled(enterprise_idle::kIdleTimeout)) { enterprise_idle::IdleServiceFactory::GetForBrowserState( - self.mainBrowserState) + chromeBrowserState) ->OnApplicationWillEnterForeground(); } } @@ -366,8 +368,9 @@ [metricsMediator updateMetricsStateBasedOnPrefsUserTriggered:NO]; // Send any feedback that might be still on temporary storage. - if (ios::provider::IsUserFeedbackSupported()) + if (ios::provider::IsUserFeedbackSupported()) { ios::provider::UploadAllPendingUserFeedback(); + } GetApplicationContext()->OnAppEnterForeground(); @@ -376,10 +379,6 @@ connectedScenes:self.connectedScenes]; [memoryHelper resetForegroundMemoryWarningCount]; - std::vector<ChromeBrowserState*> loadedBrowserStates = - GetApplicationContext() - ->GetChromeBrowserStateManager() - ->GetLoadedBrowserStates(); for (ChromeBrowserState* chromeBrowserState : loadedBrowserStates) { feature_engagement::Tracker* tracker = feature_engagement::TrackerFactory::GetForBrowserState(
diff --git a/ios/chrome/app/application_delegate/app_state_unittest.mm b/ios/chrome/app/application_delegate/app_state_unittest.mm index 8368706..7abbf4b 100644 --- a/ios/chrome/app/application_delegate/app_state_unittest.mm +++ b/ios/chrome/app/application_delegate/app_state_unittest.mm
@@ -3,7 +3,6 @@ // found in the LICENSE file. #import "ios/chrome/app/application_delegate/app_state.h" -#import "ios/chrome/app/application_delegate/app_state+Testing.h" #import <memory> @@ -13,6 +12,7 @@ #import "base/ios/ios_util.h" #import "base/test/task_environment.h" #import "ios/chrome/app/app_startup_parameters.h" +#import "ios/chrome/app/application_delegate/app_state+Testing.h" #import "ios/chrome/app/application_delegate/app_state_observer.h" #import "ios/chrome/app/application_delegate/fake_startup_information.h" #import "ios/chrome/app/application_delegate/memory_warning_helper.h" @@ -38,6 +38,9 @@ #import "ios/chrome/browser/shared/public/commands/command_dispatcher.h" #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/features/system_flags.h" +#import "ios/chrome/browser/signin/model/authentication_service.h" +#import "ios/chrome/browser/signin/model/authentication_service_factory.h" +#import "ios/chrome/browser/signin/model/fake_authentication_service_delegate.h" #import "ios/chrome/browser/ui/safe_mode/safe_mode_coordinator.h" #import "ios/chrome/browser/ui/scoped_iphone_portrait_only/scoped_iphone_portrait_only.h" #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" @@ -208,6 +211,10 @@ void SetUp() override { BlockCleanupTest::SetUp(); TestChromeBrowserState::Builder test_cbs_builder; + test_cbs_builder.AddTestingFactory( + AuthenticationServiceFactory::GetInstance(), + base::BindRepeating(AuthenticationServiceFactory::GetDefaultFactory())); + browser_state_manager_ = std::make_unique<TestChromeBrowserStateManager>( test_cbs_builder.Build()); TestingApplicationContext::GetGlobal()->SetChromeBrowserStateManager( @@ -215,6 +222,9 @@ browser_state_ = browser_state_manager_->GetLastUsedBrowserStateForTesting(); + AuthenticationServiceFactory::CreateAndInitializeForBrowserState( + browser_state_.get(), + std::make_unique<FakeAuthenticationServiceDelegate>()); } void TearDown() override {
diff --git a/ios/chrome/app/application_delegate/metrics_mediator.h b/ios/chrome/app/application_delegate/metrics_mediator.h index 371c11a1..9097048 100644 --- a/ios/chrome/app/application_delegate/metrics_mediator.h +++ b/ios/chrome/app/application_delegate/metrics_mediator.h
@@ -9,7 +9,6 @@ #include "base/containers/span.h" -@protocol ConnectionInformation; @class SceneState; @protocol StartupInformation; namespace feature_engagement {
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index 12a9e702..80f1024 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -564,20 +564,40 @@ const FeatureEntry::FeatureParam kRichAutocompletionImplementationLabel[] = { {kRichAutocompletionParam, kRichAutocompletionParamLabel}}; -const FeatureEntry::FeatureParam kRichAutocompletionImplementationTextField[] = - {{kRichAutocompletionParam, kRichAutocompletionParamTextField}}; const FeatureEntry::FeatureParam - kRichAutocompletionImplementationNoAdditionalText[] = { - {kRichAutocompletionParam, kRichAutocompletionParamNoAdditionalText}}; + kRichAutocompletionImplementationTextField3Chars[] = { + {kRichAutocompletionParam, kRichAutocompletionParamTextField}, + {"RichAutocompletionAutocompleteShortcutTextMinChar", "3"}}; +const FeatureEntry::FeatureParam + kRichAutocompletionImplementationTextField4Chars[] = { + {kRichAutocompletionParam, kRichAutocompletionParamTextField}, + {"RichAutocompletionAutocompleteShortcutTextMinChar", "4"}}; +const FeatureEntry::FeatureParam + kRichAutocompletionImplementationNoAdditionalText3Chars[] = { + {kRichAutocompletionParam, kRichAutocompletionParamNoAdditionalText}, + {"RichAutocompletionAutocompleteShortcutTextMinChar", "3"}}; +const FeatureEntry::FeatureParam + kRichAutocompletionImplementationNoAdditionalText4Chars[] = { + {kRichAutocompletionParam, kRichAutocompletionParamNoAdditionalText}, + {"RichAutocompletionAutocompleteShortcutTextMinChar", "4"}}; const FeatureEntry::FeatureVariation kRichAutocompletionImplementationVariations[] = { {"In Label", kRichAutocompletionImplementationLabel, std::size(kRichAutocompletionImplementationLabel), nullptr}, - {"In TextField", kRichAutocompletionImplementationTextField, - std::size(kRichAutocompletionImplementationTextField), nullptr}, - {"No Additional Text", - kRichAutocompletionImplementationNoAdditionalText, - std::size(kRichAutocompletionImplementationNoAdditionalText), nullptr}, + {"In TextField, 3 Min Chars", + kRichAutocompletionImplementationTextField3Chars, + std::size(kRichAutocompletionImplementationTextField3Chars), nullptr}, + {"In TextField, 4 Min Chars", + kRichAutocompletionImplementationTextField4Chars, + std::size(kRichAutocompletionImplementationTextField4Chars), nullptr}, + {"No Additional Text, 3 Min Chars", + kRichAutocompletionImplementationNoAdditionalText3Chars, + std::size(kRichAutocompletionImplementationNoAdditionalText3Chars), + nullptr}, + {"No Additional Text, 4 Min Chars", + kRichAutocompletionImplementationNoAdditionalText4Chars, + std::size(kRichAutocompletionImplementationNoAdditionalText4Chars), + nullptr}, }; const FeatureEntry::FeatureParam kOneTapForMapsConsentModeDefault[] = {
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 0108a02f..b0fe720 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -746,11 +746,6 @@ const char kOmniboxHttpsUpgradesDescription[] = "Enables HTTPS upgrades for omnibox navigations typed without a scheme"; -const char kOmniboxInspireMeName[] = "Omnibox Trending Queries"; -const char kOmniboxInspireMeDescription[] = - "When enabled, appends additional suggestions based on local trends and " - "optionally extends the ZPS limit."; - const char kOmniboxInspireMeSignedOutName[] = "Omnibox Trending Queries For Signed-Out users"; const char kOmniboxInspireMeSignedOutDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index b9f226c..02d2acd 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -647,10 +647,6 @@ extern const char kOmniboxHttpsUpgradesName[]; extern const char kOmniboxHttpsUpgradesDescription[]; -// Title and description for the Inspire Me omnibox flag. -extern const char kOmniboxInspireMeName[]; -extern const char kOmniboxInspireMeDescription[]; - // Title and description for the Inspire Me for Signed Out Users omnibox flag. extern const char kOmniboxInspireMeSignedOutName[]; extern const char kOmniboxInspireMeSignedOutDescription[];
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm index 13e995e..7ae7b05 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm
@@ -77,10 +77,6 @@ #import "ui/base/device_form_factor.h" #import "url/gurl.h" -BASE_FEATURE(kEnableFocusOmniboxWorkaround, - "EnableFocusOmniboxWorkaround", - base::FEATURE_ENABLED_BY_DEFAULT); - namespace { const size_t kMaxURLDisplayChars = 32 * 1024; } // namespace @@ -352,12 +348,7 @@ if (immediately) { [self loadURLForQuery:sanitizedQuery]; } else { - // TODO(crbug.com/40275343): Clean up the kill switch and else branch. - if (base::FeatureList::IsEnabled(kEnableFocusOmniboxWorkaround)) { - [self focusOmnibox]; - } else { - [self.omniboxCoordinator focusOmnibox]; - } + [self focusOmnibox]; [self.omniboxCoordinator insertTextToOmnibox:base::SysUTF16ToNSString(sanitizedQuery)]; }
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/quick_delete_egtest.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/quick_delete_egtest.mm index 87722d92..580ee923 100644 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/quick_delete_egtest.mm +++ b/ios/chrome/browser/ui/settings/clear_browsing_data/quick_delete_egtest.mm
@@ -127,7 +127,8 @@ // Tests the selection time range for the browsing data deletion: the time range // selection is shown with the pref value and a new selection updates the pref. -- (void)testTimeRangeForDeletionSelection { +// TODO(crbug.com/341306396): Reenable after fix. +- (void)DISALBED_testTimeRangeForDeletionSelection { // Set pref to the last hour. [ChromeEarlGrey setIntegerValue:static_cast<int>(browsing_data::TimePeriod::LAST_HOUR)
diff --git a/ios/chrome/browser/web/model/chrome_main_parts.mm b/ios/chrome/browser/web/model/chrome_main_parts.mm index 4cac679..b0114e4 100644 --- a/ios/chrome/browser/web/model/chrome_main_parts.mm +++ b/ios/chrome/browser/web/model/chrome_main_parts.mm
@@ -9,6 +9,7 @@ #import "base/allocator/partition_alloc_support.h" #import "base/check_op.h" #import "base/feature_list.h" +#import "base/features.h" #import "base/files/file_path.h" #import "base/ios/ios_util.h" #import "base/memory/ptr_util.h" @@ -235,6 +236,11 @@ // initialization is handled in PreMainMessageLoopRun since it posts tasks. SetUpFieldTrials(command_line_variation_ids); + // Initialize //base features that depend on the `FeatureList`. Don't force + // emitting profiler metadata since the profiler doesn't run on iOS. + base::features::Init( + base::features::EmitThreadControllerProfilerMetadata::kFeatureDependent); + // Set metrics upload for stack/heap profiles. IOSThreadProfiler::SetBrowserProcessReceiverCallback(base::BindRepeating( &metrics::CallStackProfileMetricsProvider::ReceiveProfile));
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm index 6041890f..7a695cc 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
@@ -806,10 +806,11 @@ } + (void)stopAllWebStatesLoading { - // TODO(crbug.com/327330181): Avoid using - // mainController.browserProviderInterface. + if (!chrome_test_util::GetForegroundActiveScene()) { + return; + } WebStateList* web_state_list = - chrome_test_util::GetMainController() + chrome_test_util::GetForegroundActiveScene() .browserProviderInterface.currentBrowserProvider.browser ->GetWebStateList(); for (int index = 0; index < web_state_list->count(); ++index) { @@ -1367,10 +1368,8 @@ #pragma mark - Keyboard Command Utilities + (NSInteger)registeredKeyCommandCount { - // TODO(crbug.com/327330181): Avoid using - // mainController.browserProviderInterface. UIViewController* browserViewController = - chrome_test_util::GetMainController() + chrome_test_util::GetForegroundActiveScene() .browserProviderInterface.mainBrowserProvider.viewController; // The BVC delegates its key commands to its next responder, // KeyCommandsProvider.
diff --git a/ios/components/security_interstitials/safe_browsing/url_checker_delegate_impl.mm b/ios/components/security_interstitials/safe_browsing/url_checker_delegate_impl.mm index 02cf08fd..4aba3da 100644 --- a/ios/components/security_interstitials/safe_browsing/url_checker_delegate_impl.mm +++ b/ios/components/security_interstitials/safe_browsing/url_checker_delegate_impl.mm
@@ -124,7 +124,7 @@ void UrlCheckerDelegateImpl::NotifySuspiciousSiteDetected( const base::RepeatingCallback<content::WebContents*()>& web_contents_getter) { - NOTREACHED_IN_MIGRATION(); + // TODO(crbug.com/40817491): Implement reporting for suspicious sites. } const safe_browsing::SBThreatTypeSet& UrlCheckerDelegateImpl::GetThreatTypes() {
diff --git a/ios/web/content/BUILD.gn b/ios/web/content/BUILD.gn index a9107f1..1996eef 100644 --- a/ios/web/content/BUILD.gn +++ b/ios/web/content/BUILD.gn
@@ -76,13 +76,18 @@ source_set("ui") { sources = [ + "ui/content_context_menu_controller.h", + "ui/content_context_menu_controller.mm", "ui/web_contents_view_delegate_impl.h", "ui/web_contents_view_delegate_impl.mm", ] deps = [ + ":content", "//base", "//content/public/browser", + "//ios/web/public:public", + "//ios/web/public/ui:ui", ] }
diff --git a/ios/web/content/ui/content_context_menu_controller.h b/ios/web/content/ui/content_context_menu_controller.h new file mode 100644 index 0000000..c03eba7 --- /dev/null +++ b/ios/web/content/ui/content_context_menu_controller.h
@@ -0,0 +1,39 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_CONTENT_UI_CONTENT_CONTEXT_MENU_CONTROLLER_H_ +#define IOS_WEB_CONTENT_UI_CONTENT_CONTEXT_MENU_CONTROLLER_H_ + +#import <memory> + +#import "base/memory/ref_counted.h" + +namespace content { +struct ContextMenuParams; +class RenderFrameHost; +} // namespace content + +class IOSWebContentsUIButtonHolder; + +class ContentContextMenuController + : public base::RefCountedThreadSafe<ContentContextMenuController> { + public: + ContentContextMenuController(); + + ContentContextMenuController(const ContentContextMenuController&) = delete; + ContentContextMenuController& operator=(const ContentContextMenuController&) = + delete; + + void ShowContextMenu(content::RenderFrameHost& render_frame_host, + const content::ContextMenuParams& params); + + private: + friend class base::RefCountedThreadSafe<ContentContextMenuController>; + virtual ~ContentContextMenuController(); + + // A hidden button used for displaying context menus. + std::unique_ptr<IOSWebContentsUIButtonHolder> hidden_button_; +}; + +#endif // IOS_WEB_CONTENT_UI_CONTENT_CONTEXT_MENU_CONTROLLER_H_
diff --git a/ios/web/content/ui/content_context_menu_controller.mm b/ios/web/content/ui/content_context_menu_controller.mm new file mode 100644 index 0000000..e44d2dc --- /dev/null +++ b/ios/web/content/ui/content_context_menu_controller.mm
@@ -0,0 +1,181 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web/content/ui/content_context_menu_controller.h" + +#import <UIKit/UIKit.h> + +#import "base/apple/foundation_util.h" +#import "content/public/browser/context_menu_params.h" +#import "content/public/browser/render_widget_host_view.h" +#import "content/public/browser/web_contents.h" +#import "ios/web/content/web_state/content_web_state.h" +#import "ios/web/public/ui/context_menu_params.h" +#import "ios/web/public/web_state_delegate.h" +#import "services/network/public/mojom/referrer_policy.mojom.h" + +// A hidden button used only for creating context menus. The only way to +// programmatically trigger a context menu on iOS is to trigger the primary +// action of a button that shows a context menu as its primary action. +@interface ContextMenuHiddenButton : UIButton + +// The frame determines the position at which the context menu is shown. ++ (instancetype)buttonWithFrame:(CGRect)frame + contextMenuParams:(content::ContextMenuParams)params + forWebContents:(content::WebContents*)webContents + forView:(UIView*)view; +@end + +@implementation ContextMenuHiddenButton { + content::ContextMenuParams _params; + base::WeakPtr<content::WebContents> _webContents; + UIView* _view; +} + ++ (instancetype)buttonWithFrame:(CGRect)frame + contextMenuParams:(content::ContextMenuParams)params + forWebContents:(content::WebContents*)webContents + forView:(UIView*)view { + ContextMenuHiddenButton* button = + [ContextMenuHiddenButton buttonWithType:UIButtonTypeSystem]; + button.hidden = YES; + button.userInteractionEnabled = NO; + button.contextMenuInteractionEnabled = YES; + button.showsMenuAsPrimaryAction = YES; + button.frame = frame; + button.layer.zPosition = CGFLOAT_MIN; + button->_params = params; + button->_webContents = webContents->GetWeakPtr(); + button->_view = view; + return button; +} + +#pragma mark - Private + +- (NSString*)convertToNSString:(const std::u16string&)string { + return [[NSString alloc] initWithBytes:string.data() + length:string.size() * sizeof(char16_t) + encoding:NSUTF16LittleEndianStringEncoding]; +} + +- (web::ReferrerPolicy)convertToWebReferrerPolicy: + (network::mojom::ReferrerPolicy)policy { + switch (policy) { + case network::mojom::ReferrerPolicy::kAlways: + return web::ReferrerPolicy::ReferrerPolicyAlways; + case network::mojom::ReferrerPolicy::kDefault: + return web::ReferrerPolicy::ReferrerPolicyDefault; + case network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade: + return web::ReferrerPolicy::ReferrerPolicyNoReferrerWhenDowngrade; + case network::mojom::ReferrerPolicy::kNever: + return web::ReferrerPolicy::ReferrerPolicyNever; + case network::mojom::ReferrerPolicy::kOrigin: + return web::ReferrerPolicy::ReferrerPolicyOrigin; + case network::mojom::ReferrerPolicy::kOriginWhenCrossOrigin: + return web::ReferrerPolicy::ReferrerPolicyOriginWhenCrossOrigin; + case network::mojom::ReferrerPolicy::kStrictOriginWhenCrossOrigin: + return web::ReferrerPolicy::ReferrerPolicyStrictOriginWhenCrossOrigin; + case network::mojom::ReferrerPolicy::kSameOrigin: + return web::ReferrerPolicy::ReferrerPolicySameOrigin; + case network::mojom::ReferrerPolicy::kStrictOrigin: + return web::ReferrerPolicy::ReferrerPolicyStrictOrigin; + } + NOTREACHED(); + return web::ReferrerPolicy::ReferrerPolicyDefault; +} + +- (web::ContextMenuParams)webContextMenuParams { + // TODO(crbug.com/333767962): The 'title_attribute' is intentionally not set + // to match the Chrome on WebKit behavior that the link URL is displayed at + // the top of the context menu. + web::ContextMenuParams web_params; + web_params.is_main_frame = !_params.is_subframe; + web_params.link_url = _params.link_url; + web_params.referrer_policy = + [self convertToWebReferrerPolicy:_params.referrer_policy]; + web_params.src_url = _params.src_url; + web_params.view = _view; + web_params.location.x = _params.x; + web_params.location.y = _params.y; + web_params.text = [self convertToNSString:_params.link_text]; + web_params.alt_text = [self convertToNSString:_params.alt_text]; + return web_params; +} + +- (UIContextMenuConfiguration*)contextMenuInteraction: + (UIContextMenuInteraction*)interaction + configurationForMenuAtLocation:(CGPoint)location { + web::ContentWebState* web_state = + static_cast<web::ContentWebState*>(_webContents->GetDelegate()); + DCHECK(web_state); + + __block UIContextMenuConfiguration* config = nil; + if (web_state && web_state->GetDelegate()) { + web_state->GetDelegate()->ContextMenuConfiguration( + web_state, [self webContextMenuParams], + ^(UIContextMenuConfiguration* conf) { + config = conf; + }); + } + + [super contextMenuInteraction:interaction + configurationForMenuAtLocation:location]; + return config; +} + +- (void)contextMenuInteraction:(UIContextMenuInteraction*)interaction + willEndForConfiguration:(UIContextMenuConfiguration*)configuration + animator:(id<UIContextMenuInteractionAnimating>)animator { + [super contextMenuInteraction:interaction + willEndForConfiguration:configuration + animator:animator]; + if (_webContents) { + _webContents->NotifyContextMenuClosed(_params.link_followed); + } +} + +@end + +namespace { + +gfx::NativeView GetContentNativeView(content::WebContents* web_contents) { + content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView(); + if (!rwhv) { + return gfx::NativeView(); + } + return rwhv->GetNativeView(); +} + +} // namespace + +class IOSWebContentsUIButtonHolder { + public: + UIButton* __strong button_; +}; + +ContentContextMenuController::ContentContextMenuController() { + hidden_button_ = std::make_unique<IOSWebContentsUIButtonHolder>(); +} + +ContentContextMenuController::~ContentContextMenuController() = default; + +void ContentContextMenuController::ShowContextMenu( + content::RenderFrameHost& render_frame_host, + const content::ContextMenuParams& params) { + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(&render_frame_host); + + UIView* view = base::apple::ObjCCastStrict<UIView>( + GetContentNativeView(web_contents).Get()); + CGRect frame = CGRectMake(params.x, params.y, 0, 0); + + [hidden_button_->button_ removeFromSuperview]; + hidden_button_->button_ = + [ContextMenuHiddenButton buttonWithFrame:frame + contextMenuParams:params + forWebContents:web_contents + forView:view]; + [view addSubview:hidden_button_->button_]; + [hidden_button_->button_ performPrimaryAction]; +}
diff --git a/ios/web/content/ui/web_contents_view_delegate_impl.mm b/ios/web/content/ui/web_contents_view_delegate_impl.mm index 254aa52..151c446 100644 --- a/ios/web/content/ui/web_contents_view_delegate_impl.mm +++ b/ios/web/content/ui/web_contents_view_delegate_impl.mm
@@ -7,8 +7,10 @@ #import <memory> #import "content/public/browser/context_menu_params.h" +#import "content/public/browser/render_frame_host.h" #import "content/public/browser/web_contents.h" #import "content/public/browser/web_contents_view_delegate.h" +#import "ios/web/content/ui/content_context_menu_controller.h" WebContentsViewDelegateImpl::WebContentsViewDelegateImpl( content::WebContents* web_contents) @@ -19,12 +21,12 @@ void WebContentsViewDelegateImpl::ShowContextMenu( content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) { - NOTIMPLEMENTED(); + scoped_refptr<ContentContextMenuController> context_menu_controller( + new ContentContextMenuController()); + context_menu_controller->ShowContextMenu(render_frame_host, params); } -void WebContentsViewDelegateImpl::DismissContextMenu() { - NOTIMPLEMENTED(); -} +void WebContentsViewDelegateImpl::DismissContextMenu() {} std::unique_ptr<content::WebContentsViewDelegate> CreateWebContentsViewDelegate( content::WebContents* web_contents) {
diff --git a/ios/web/content/web_state/content_web_state.mm b/ios/web/content/web_state/content_web_state.mm index da23dd86..9f542a0 100644 --- a/ios/web/content/web_state/content_web_state.mm +++ b/ios/web/content/web_state/content_web_state.mm
@@ -191,7 +191,7 @@ } WebStateDelegate* ContentWebState::GetDelegate() { - return nullptr; + return delegate_; } std::unique_ptr<WebState> ContentWebState::Clone() const {
diff --git a/ios/web/favicon/favicon_callbacks_inttest.mm b/ios/web/favicon/favicon_callbacks_inttest.mm index 738cb45..8ea989f 100644 --- a/ios/web/favicon/favicon_callbacks_inttest.mm +++ b/ios/web/favicon/favicon_callbacks_inttest.mm
@@ -37,7 +37,9 @@ favicon_url_candidates_ = candidates; favicon_url_updated_ = true; } - void WebStateDestroyed(WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } private: bool favicon_url_updated_ = false;
diff --git a/ios/web/navigation/crw_wk_navigation_handler_inttest.mm b/ios/web/navigation/crw_wk_navigation_handler_inttest.mm index 1c24589..1736868 100644 --- a/ios/web/navigation/crw_wk_navigation_handler_inttest.mm +++ b/ios/web/navigation/crw_wk_navigation_handler_inttest.mm
@@ -67,7 +67,9 @@ } } - void WebStateDestroyed(web::WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(web::WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } bool did_finish() const { return did_finish_; } web::HttpsUpgradeType failed_https_upgrade_type() const {
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm index cd6d1efc..7ef4347 100644 --- a/ios/web/test/web_int_test.mm +++ b/ios/web/test/web_int_test.mm
@@ -49,7 +49,9 @@ page_loaded_ = true; } - void WebStateDestroyed(web::WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(web::WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } private: GURL expected_url_;
diff --git a/ios/web/web_state/permissions_inttest.mm b/ios/web/web_state/permissions_inttest.mm index 78c9604..4772994 100644 --- a/ios/web/web_state/permissions_inttest.mm +++ b/ios/web/web_state/permissions_inttest.mm
@@ -40,7 +40,9 @@ WebStateObserverMock& operator=(const WebStateObserverMock&) = delete; MOCK_METHOD2(PermissionStateChanged, void(web::WebState*, web::Permission)); - void WebStateDestroyed(web::WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(web::WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } }; // Web client that simulates prerendering for testing purpose.
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm index dda56324..355cc80 100644 --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -1222,7 +1222,9 @@ int title_change_count() { return title_change_count_; } // WebStateObserver overrides: void TitleWasSet(WebState* web_state) override { title_change_count_++; } - void WebStateDestroyed(WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } private: int title_change_count_ = 0;
diff --git a/ios/web/web_state/web_state_observer_inttest.mm b/ios/web/web_state/web_state_observer_inttest.mm index 0880e0e..8ee0f17 100644 --- a/ios/web/web_state/web_state_observer_inttest.mm +++ b/ios/web/web_state/web_state_observer_inttest.mm
@@ -724,7 +724,9 @@ MOCK_METHOD1(DidStopLoading, void(WebState*)); MOCK_METHOD2(PageLoaded, void(WebState*, PageLoadCompletionStatus)); MOCK_METHOD1(DidChangeBackForwardState, void(WebState*)); - void WebStateDestroyed(WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } }; // Mocks WebStateObserver navigation callbacks, including TitleWasSet. @@ -744,7 +746,9 @@ MOCK_METHOD2(PageLoaded, void(WebState*, PageLoadCompletionStatus)); MOCK_METHOD1(DidChangeBackForwardState, void(WebState*)); MOCK_METHOD1(TitleWasSet, void(WebState*)); - void WebStateDestroyed(WebState* web_state) override { NOTREACHED(); } + void WebStateDestroyed(WebState* web_state) override { + NOTREACHED_IN_MIGRATION(); + } }; // Mocks WebStatePolicyDecider decision callbacks.
diff --git a/ios_internal b/ios_internal index 777169d..54145af 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 777169d126a0d105da7e96ff3f5afcb2cb9482fb +Subproject commit 54145af98bd28f2dad4c56e23740832d19980c64
diff --git a/ipc/ipc_channel_common.cc b/ipc/ipc_channel_common.cc index d5f1ccde..66badf1 100644 --- a/ipc/ipc_channel_common.cc +++ b/ipc/ipc_channel_common.cc
@@ -66,11 +66,17 @@ return nullptr; } -void Channel::Pause() { NOTREACHED(); } +void Channel::Pause() { + NOTREACHED_IN_MIGRATION(); +} -void Channel::Unpause(bool flush) { NOTREACHED(); } +void Channel::Unpause(bool flush) { + NOTREACHED_IN_MIGRATION(); +} -void Channel::Flush() { NOTREACHED(); } +void Channel::Flush() { + NOTREACHED_IN_MIGRATION(); +} void Channel::SetUrgentMessageObserver(UrgentMessageObserver* observer) { // Ignored for non-mojo channels.
diff --git a/ipc/ipc_channel_mojo_unittest.cc b/ipc/ipc_channel_mojo_unittest.cc index 5c8f014..6ac9c774 100644 --- a/ipc/ipc_channel_mojo_unittest.cc +++ b/ipc/ipc_channel_mojo_unittest.cc
@@ -275,7 +275,7 @@ void OnChannelConnected(int32_t peer_pid) override {} - void OnChannelError() override { NOTREACHED(); } + void OnChannelError() override { NOTREACHED_IN_MIGRATION(); } void OnAssociatedInterfaceRequest( const std::string& interface_name, @@ -288,7 +288,7 @@ private: // IPC::mojom::TestStructPasser: - void Pass(IPC::mojom::TestStructPtr) override { NOTREACHED(); } + void Pass(IPC::mojom::TestStructPtr) override { NOTREACHED_IN_MIGRATION(); } mojo::AssociatedReceiver<IPC::mojom::TestStructPasser> receiver_{this}; }; @@ -313,7 +313,7 @@ std::move(connect_closure_).Run(); } - void OnChannelError() override { NOTREACHED(); } + void OnChannelError() override { NOTREACHED_IN_MIGRATION(); } private: base::OnceClosure connect_closure_; @@ -797,7 +797,9 @@ std::move(callback).Run(next_expected_value_); } - void RequestValue(RequestValueCallback callback) override { NOTREACHED(); } + void RequestValue(RequestValueCallback callback) override { + NOTREACHED_IN_MIGRATION(); + } void RequestQuit(RequestQuitCallback callback) override { std::move(callback).Run();
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 4a51cbf9..f3a9951 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h
@@ -396,10 +396,10 @@ } \ break; -#define IPC_MESSAGE_UNHANDLED_ERROR() \ - IPC_MESSAGE_UNHANDLED(NOTREACHED() << \ - "Invalid message with type = " << \ - ipc_message__.type()) +#define IPC_MESSAGE_UNHANDLED_ERROR() \ + IPC_MESSAGE_UNHANDLED(NOTREACHED_IN_MIGRATION() \ + << "Invalid message with type = " \ + << ipc_message__.type()) #define IPC_END_MESSAGE_MAP() \ } \
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index a0c7f527..56e98f51 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc
@@ -147,7 +147,7 @@ SyncChannel* channel() { return channel_.get(); } // Functions for derived classes to implement if they wish. virtual void Run() { } - virtual void OnAnswer(int* answer) { NOTREACHED(); } + virtual void OnAnswer(int* answer) { NOTREACHED_IN_MIGRATION(); } virtual void OnAnswerDelay(Message* reply_msg) { // The message handler map below can only take one entry for // SyncChannelTestMsg_AnswerToLife, so since some classes want @@ -159,7 +159,7 @@ SyncChannelTestMsg_AnswerToLife::WriteReplyParams(reply_msg, answer); Send(reply_msg); } - virtual void OnDouble(int in, int* out) { NOTREACHED(); } + virtual void OnDouble(int in, int* out) { NOTREACHED_IN_MIGRATION(); } virtual void OnDoubleDelay(int in, Message* reply_msg) { int result; OnDouble(in, &result);
diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java index d7525e93..ca9a665 100644 --- a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java
@@ -12,6 +12,7 @@ import androidx.annotation.RequiresApi; import org.jni_zero.CalledByNative; +import org.jni_zero.CalledByNativeForTesting; import org.jni_zero.JNINamespace; import org.jni_zero.NativeMethods; @@ -289,6 +290,9 @@ mMediaDrm.setOnEventListener(new EventListener()); mMediaDrm.setOnExpirationUpdateListener(new ExpirationUpdateListener(), null); mMediaDrm.setOnKeyStatusChangeListener(new KeyStatusChangeListener(), null); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + mMediaDrm.setOnSessionLostStateListener(new SessionLostStateListener(), null); + } if (isWidevine()) { mMediaDrm.setPropertyString(PRIVACY_MODE, ENABLE); @@ -1312,10 +1316,20 @@ } } + @CalledByNativeForTesting + private boolean setPropertyStringForTesting(String property, String value) { + try { + mMediaDrm.setPropertyString(property, value); + } catch (Exception e) { + Log.e(TAG, "Failed to set property %s", property, e); + return false; + } + return true; + } + /** - * Start provisioning. Returns true if a provisioning request can be - * generated and has been forwarded to C++ code for handling, false - * otherwise. + * Start provisioning. Returns true if a provisioning request can be generated and has been + * forwarded to C++ code for handling, false otherwise. */ private boolean startProvisioning() { Log.d(TAG, "startProvisioning"); @@ -1710,6 +1724,39 @@ } } + // TODO(b/263310318): Add tests using setPropertyStringForTesting("drmErrorTest", "lostState") + // which triggers this onSessionLostState for ClearKey. Android's ClearKey is not currently used + // as we use AesDecryptor, so implement tests once we make the switch to Android's ClearKey. + @RequiresApi(Build.VERSION_CODES.Q) + private class SessionLostStateListener implements MediaDrm.OnSessionLostStateListener { + + @Override + public void onSessionLostState(MediaDrm md, byte[] drmSessionId) { + final SessionId sessionId = getSessionIdByDrmId(drmSessionId); + + deferEventHandleIfNeeded( + sessionId, + new Runnable() { + @Override + public void run() { + if (sessionId == null) { + Log.w( + TAG, + "SessionLost: Unknown session %s", + SessionId.toHexString(drmSessionId)); + return; + } + + Log.d(TAG, "SessionLost: " + sessionId.toHexString()); + // TODO(crbug.com/40181810): Consider passing a reason for sessionClosed + // that more closely + // represents a lost state. + onSessionClosed(sessionId); + } + }); + } + } + private class KeyStatusChangeListener implements MediaDrm.OnKeyStatusChangeListener { private List<KeyStatus> getKeysInfo(List<MediaDrm.KeyStatus> keyInformation) { List<KeyStatus> keysInfo = new ArrayList<KeyStatus>();
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc index cb2af70..f26af9f 100644 --- a/media/base/android/media_drm_bridge.cc +++ b/media/base/android/media_drm_bridge.cc
@@ -734,6 +734,21 @@ IsSecureCodecRequired()); } +bool MediaDrmBridge::SetPropertyStringForTesting( + const std::string& property_name, + const std::string& property_value) { + JNIEnv* env = AttachCurrentThread(); + + ScopedJavaLocalRef<jstring> j_property_name_string = + ConvertUTF8ToJavaString(env, property_name); + + ScopedJavaLocalRef<jstring> j_property_value_string = + ConvertUTF8ToJavaString(env, property_value); + + return Java_MediaDrmBridge_setPropertyStringForTesting( // IN-TEST + env, j_media_drm_, j_property_name_string, j_property_value_string); +} + //------------------------------------------------------------------------------ // The following OnXxx functions are called from Java. The implementation must // only do minimal work and then post tasks to avoid reentrancy issues.
diff --git a/media/base/android/media_drm_bridge.h b/media/base/android/media_drm_bridge.h index 2fff5ee8..d857273d 100644 --- a/media/base/android/media_drm_bridge.h +++ b/media/base/android/media_drm_bridge.h
@@ -184,6 +184,12 @@ // should make sure that the callbacks are posted to the correct thread. void SetMediaCryptoReadyCB(MediaCryptoReadyCB media_crypto_ready_cb); + // Sets 'property_name' with 'property_value' in MediaDrm. This can + // potentially throw exceptions if the property_name does not exist for the + // key system, or if there is an issue with the property_value. + bool SetPropertyStringForTesting(const std::string& property_name, + const std::string& property_value); + // All the OnXxx functions below are called from Java. The implementation must // only do minimal work and then post tasks to avoid reentrancy issues.
diff --git a/media/filters/decoder_selector_unittest.cc b/media/filters/decoder_selector_unittest.cc index 45bd321..52ee72494 100644 --- a/media/filters/decoder_selector_unittest.cc +++ b/media/filters/decoder_selector_unittest.cc
@@ -296,8 +296,8 @@ DecoderSelectorTest(const DecoderSelectorTest&) = delete; DecoderSelectorTest& operator=(const DecoderSelectorTest&) = delete; - void OnWaiting(WaitingReason reason) { NOTREACHED(); } - void OnOutput(scoped_refptr<Output> output) { NOTREACHED(); } + void OnWaiting(WaitingReason reason) { NOTREACHED_IN_MIGRATION(); } + void OnOutput(scoped_refptr<Output> output) { NOTREACHED_IN_MIGRATION(); } MOCK_METHOD0_T(NoDecoderSelected, void()); MOCK_METHOD1_T(OnDecoderSelected, void(int));
diff --git a/media/filters/pipeline_controller_unittest.cc b/media/filters/pipeline_controller_unittest.cc index 76f8541..5aea85b7 100644 --- a/media/filters/pipeline_controller_unittest.cc +++ b/media/filters/pipeline_controller_unittest.cc
@@ -144,8 +144,8 @@ void OnResumed() { was_resumed_ = true; } // Pipeline::Client overrides - void OnError(PipelineStatus status) override { NOTREACHED(); } - void OnFallback(PipelineStatus status) override { NOTREACHED(); } + void OnError(PipelineStatus status) override { NOTREACHED_IN_MIGRATION(); } + void OnFallback(PipelineStatus status) override { NOTREACHED_IN_MIGRATION(); } void OnEnded() override {} void OnMetadata(const PipelineMetadata& metadata) override {} void OnBufferingStateChange(BufferingState state,
diff --git a/media/fuchsia/video/fuchsia_video_decoder_unittest.cc b/media/fuchsia/video/fuchsia_video_decoder_unittest.cc index fad0ea92..3f445ed 100644 --- a/media/fuchsia/video/fuchsia_video_decoder_unittest.cc +++ b/media/fuchsia/video/fuchsia_video_decoder_unittest.cc
@@ -420,7 +420,7 @@ // gfx::ClientNativePixmap implementation. bool Map() override { NOTREACHED_NORETURN(); } - void Unmap() override { NOTREACHED(); } + void Unmap() override { NOTREACHED_IN_MIGRATION(); } size_t GetNumberOfPlanes() const override { NOTREACHED_NORETURN(); } void* GetMemoryAddress(size_t plane) const override { NOTREACHED_NORETURN(); } int GetStride(size_t plane) const override { NOTREACHED_NORETURN(); }
diff --git a/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc b/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc index 038491c6..0cbad4b7 100644 --- a/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc +++ b/media/gpu/sandbox/hardware_video_decoding_sandbox_hook_linux.cc
@@ -27,7 +27,7 @@ // chrome/browser/ash/arc/video/gpu_arc_video_service_host.cc depends on it and // that file is built for ash-chrome regardless of VA-API/V4L2. That means that // bots like linux-chromeos-rel end up compiling this presandbox hook (thus the -// NOTREACHED()s in some places here). +// NOTREACHED_IN_MIGRATION()s in some places here). namespace media { namespace {
diff --git a/media/muxers/mp4_muxer_delegate.cc b/media/muxers/mp4_muxer_delegate.cc index d7c7441..94e6855 100644 --- a/media/muxers/mp4_muxer_delegate.cc +++ b/media/muxers/mp4_muxer_delegate.cc
@@ -126,7 +126,7 @@ DVLOG(1) << __func__ << ", " << params.AsHumanReadableString(); if (!video_track_index_.has_value()) { - // TODO(crbug.com/333614631): Potential issue for the first frame. + // TODO(crbug.com/339841680): Potential issue for the first frame. if (!is_key_frame) { CHECK_EQ(params.codec, VideoCodec::kVP9); DVLOG(1) << __func__ << ", not a key frame";
diff --git a/media/muxers/webm_muxer.cc b/media/muxers/webm_muxer.cc index 9d12917..b1b57cd0 100644 --- a/media/muxers/webm_muxer.cc +++ b/media/muxers/webm_muxer.cc
@@ -374,6 +374,13 @@ << GetCodecName(video_params->codec); if (!video_track_index_) { + // TODO(crbug.com/339841680): Potential issue for the first frame. + if (!frame.is_keyframe) { + CHECK_EQ(video_params->codec, VideoCodec::kVP9); + DVLOG(1) << __func__ << ", not a key frame"; + return true; + } + // |track_index_|, cannot be zero (!), initialize WebmMuxer in that case. // http://www.matroska.org/technical/specs/index.html#Tracks video_codec_ = video_params->codec;
diff --git a/media/renderers/audio_renderer_impl_unittest.cc b/media/renderers/audio_renderer_impl_unittest.cc index 3018ddb..692dad65 100644 --- a/media/renderers/audio_renderer_impl_unittest.cc +++ b/media/renderers/audio_renderer_impl_unittest.cc
@@ -233,7 +233,7 @@ // RendererClient implementation. MOCK_METHOD1(OnError, void(PipelineStatus)); - void OnFallback(PipelineStatus status) override { NOTREACHED(); } + void OnFallback(PipelineStatus status) override { NOTREACHED_IN_MIGRATION(); } void OnEnded() override { CHECK(!ended_); ended_ = true;
diff --git a/media/renderers/video_frame_rgba_to_yuva_converter.cc b/media/renderers/video_frame_rgba_to_yuva_converter.cc index 5d90fa3..8df0a17 100644 --- a/media/renderers/video_frame_rgba_to_yuva_converter.cc +++ b/media/renderers/video_frame_rgba_to_yuva_converter.cc
@@ -46,23 +46,15 @@ return false; } -#if BUILDFLAG(IS_WIN) - // CopyToGpuMemoryBuffer is only supported for D3D shared images on Windows. - if (!provider->SharedImageInterface()->GetCapabilities().shared_image_d3d) { - DVLOG(1) << "CopyToGpuMemoryBuffer not supported."; - return false; - } -#endif // BUILDFLAG(IS_WIN) - ri->WaitSyncTokenCHROMIUM(src_mailbox_holder.sync_token.GetConstData()); + if (dst_video_frame->shared_image_format_type() == SharedImageFormatType::kLegacy) { SkYUVAInfo yuva_info = VideoFrameYUVMailboxesHolder::VideoFrameGetSkYUVAInfo(dst_video_frame); gpu::Mailbox yuva_mailboxes[SkYUVAInfo::kMaxPlanes]; for (int plane = 0; plane < yuva_info.numPlanes(); ++plane) { - gpu::MailboxHolder dst_mailbox_holder = - dst_video_frame->mailbox_holder(plane); + const auto& dst_mailbox_holder = dst_video_frame->mailbox_holder(plane); ri->WaitSyncTokenCHROMIUM(dst_mailbox_holder.sync_token.GetConstData()); yuva_mailboxes[plane] = dst_mailbox_holder.mailbox; } @@ -70,7 +62,7 @@ yuva_info.yuvColorSpace(), yuva_info.planeConfig(), yuva_info.subsampling(), yuva_mailboxes, src_mailbox_holder.mailbox); } else { - gpu::MailboxHolder dst_mailbox_holder = dst_video_frame->mailbox_holder(0); + const auto& dst_mailbox_holder = dst_video_frame->mailbox_holder(0); ri->WaitSyncTokenCHROMIUM(dst_mailbox_holder.sync_token.GetConstData()); // `unpack_flip_y` should be set if the surface origin of the source @@ -98,35 +90,11 @@ } ri->Flush(); -#if BUILDFLAG(IS_WIN) - // For shared memory GMBs on Windows we needed to explicitly request a copy - // from the shared image GPU texture to the GMB. - DCHECK(dst_video_frame->HasGpuMemoryBuffer()); - DCHECK_EQ(dst_video_frame->GetGpuMemoryBuffer()->GetType(), - gfx::SHARED_MEMORY_BUFFER); - - gpu::SyncToken blit_done_sync_token; - ri->GenUnverifiedSyncTokenCHROMIUM(blit_done_sync_token.GetData()); - - auto* sii = provider->SharedImageInterface(); - for (size_t plane = 0; plane < dst_video_frame->NumTextures(); ++plane) { - const auto& mailbox = dst_video_frame->mailbox_holder(plane).mailbox; - sii->CopyToGpuMemoryBuffer(blit_done_sync_token, mailbox); - } - - // Synchronize RasterInterface with SharedImageInterface. We want to generate - // the final SyncToken from the RasterInterface since callers might be using - // RasterInterface::Finish() to ensure synchronization in cases where - // SignalSyncToken can't be used (e.g. webrtc video frame adapter). - auto copy_to_gmb_done_sync_token = sii->GenUnverifiedSyncToken(); - ri->WaitSyncTokenCHROMIUM(copy_to_gmb_done_sync_token.GetData()); -#endif // BUILDFLAG(IS_WIN) - // Make access to the `dst_video_frame` wait on copy completion. We also // update the ReleaseSyncToken here since it's used when the underlying // GpuMemoryBuffer and SharedImage resources are returned to the pool. gpu::SyncToken completion_sync_token; - ri->GenSyncTokenCHROMIUM(completion_sync_token.GetData()); + ri->GenUnverifiedSyncTokenCHROMIUM(completion_sync_token.GetData()); SimpleSyncTokenClient simple_client(completion_sync_token); for (size_t plane = 0; plane < dst_video_frame->NumTextures(); ++plane) { dst_video_frame->UpdateMailboxHolderSyncToken(plane, &simple_client);
diff --git a/media/renderers/video_frame_rgba_to_yuva_converter.h b/media/renderers/video_frame_rgba_to_yuva_converter.h index 1ad4d7c..2840648 100644 --- a/media/renderers/video_frame_rgba_to_yuva_converter.h +++ b/media/renderers/video_frame_rgba_to_yuva_converter.h
@@ -29,8 +29,7 @@ // Copy the specified source texture to the destination video frame, doing // color space conversion and RGB to YUV conversion. Waits for all sync // tokens in `src_mailbox_holder` and `dst_video_frame` before doing the -// copy. Populates `completion_sync_token` with a sync token after the copy. -// Updates `dst_video_frame`'s sync token. +// copy. Updates `dst_video_frame`'s sync token to wait on copy completion. MEDIA_EXPORT bool CopyRGBATextureToVideoFrame( viz::RasterContextProvider* raster_context_provider, viz::SharedImageFormat src_format, @@ -38,7 +37,7 @@ const gfx::ColorSpace& src_color_space, GrSurfaceOrigin src_surface_origin, const gpu::MailboxHolder& src_mailbox_holder, - media::VideoFrame* dst_video_frame); + VideoFrame* dst_video_frame); } // namespace media
diff --git a/mojo/core/channel.cc b/mojo/core/channel.cc index bc6e96d..0af1315 100644 --- a/mojo/core/channel.cc +++ b/mojo/core/channel.cc
@@ -112,7 +112,9 @@ ~IpczMessage() override = default; // Channel::Message: - void SetHandles(std::vector<PlatformHandle>) override { NOTREACHED(); } + void SetHandles(std::vector<PlatformHandle>) override { + NOTREACHED_IN_MIGRATION(); + } void SetHandles(std::vector<PlatformHandleInTransit>) override { NOTREACHED_IN_MIGRATION(); }
diff --git a/mojo/core/channel_mac.cc b/mojo/core/channel_mac.cc index ce4a3ed..4bdac8e 100644 --- a/mojo/core/channel_mac.cc +++ b/mojo/core/channel_mac.cc
@@ -24,6 +24,7 @@ #include "base/logging.h" #include "base/mac/scoped_mach_msg_destroy.h" #include "base/message_loop/message_pump_for_io.h" +#include "base/numerics/byte_conversions.h" #include "base/task/current_thread.h" #include "base/task/single_thread_task_runner.h" #include "base/thread_annotations.h" @@ -444,8 +445,11 @@ descriptor->type = MACH_MSG_OOL_DESCRIPTOR; ++body->msgh_descriptor_count; } else { - auto* data_size = buffer.MutableObject<uint64_t>(); - *data_size = message->data_num_bytes(); + // Mach message structs are all 4-byte aligned, but `uint64_t` is 8-byte + // aligned on 64-bit architectures. To avoid alignment issues, write the + // size as bytes. + buffer.MutableSpan<uint8_t, 8>()->copy_from( + base::U64ToNativeEndian(message->data_num_bytes())); auto data = buffer.MutableSpan<char>(message->data_num_bytes()); memcpy(data.data(), message->data(), message->data_num_bytes()); @@ -671,8 +675,12 @@ reinterpret_cast<vm_address_t>(descriptor->address), descriptor->size); } else { - auto* data_size_ptr = buffer.Object<uint64_t>(); - payload = buffer.Span<const char>(*data_size_ptr); + // Mach message structs are all 4-byte aligned, but `uint64_t` is 8-byte + // aligned on 64-bit architectures. To avoid alignment issues, write the + // size as bytes. + uint64_t data_size = + base::U64FromNativeEndian(*buffer.Span<uint8_t, 8>()); + payload = buffer.Span<const char>(data_size); } if (payload.empty()) {
diff --git a/mojo/core/message_unittest.cc b/mojo/core/message_unittest.cc index 5a14fb1..bc852cbc 100644 --- a/mojo/core/message_unittest.cc +++ b/mojo/core/message_unittest.cc
@@ -121,8 +121,10 @@ void GetSerializedSize(size_t* num_bytes, size_t* num_handles) override { NOTREACHED_IN_MIGRATION(); } - void SerializeHandles(MojoHandle* handles) override { NOTREACHED(); } - void SerializePayload(void* buffer) override { NOTREACHED(); } + void SerializeHandles(MojoHandle* handles) override { + NOTREACHED_IN_MIGRATION(); + } + void SerializePayload(void* buffer) override { NOTREACHED_IN_MIGRATION(); } base::OnceClosure destruction_callback_; };
diff --git a/mojo/core/trap_unittest.cc b/mojo/core/trap_unittest.cc index de71931..0d68e6a 100644 --- a/mojo/core/trap_unittest.cc +++ b/mojo/core/trap_unittest.cc
@@ -871,8 +871,8 @@ // Add a trigger whose condition is always satisfied so we can't arm. Arming // should fail with only this new watch's information. - uintptr_t writable_c_context = - helper.CreateContext([](const MojoTrapEvent&) { NOTREACHED(); }); + uintptr_t writable_c_context = helper.CreateContext( + [](const MojoTrapEvent&) { NOTREACHED_IN_MIGRATION(); }); MojoHandle c, d; CreateMessagePipe(&c, &d); @@ -1017,7 +1017,8 @@ EXPECT_EQ(MOJO_RESULT_OK, helper.CreateTrap(&t)); uintptr_t readable_a_context = helper.CreateContextWithCancel( - [](const MojoTrapEvent&) { NOTREACHED(); }, [&] { wait.Signal(); }); + [](const MojoTrapEvent&) { NOTREACHED_IN_MIGRATION(); }, + [&] { wait.Signal(); }); uintptr_t readable_c_context = helper.CreateContext([&](const MojoTrapEvent& event) { @@ -1080,8 +1081,8 @@ MojoHandle t; EXPECT_EQ(MOJO_RESULT_OK, helper.CreateTrap(&t)); - uintptr_t readable_a_context = - helper.CreateContext([](const MojoTrapEvent&) { NOTREACHED(); }); + uintptr_t readable_a_context = helper.CreateContext( + [](const MojoTrapEvent&) { NOTREACHED_IN_MIGRATION(); }); uintptr_t readable_c_context = helper.CreateContext([&](const MojoTrapEvent& event) {
diff --git a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc index 72d3dcf..e8b1607 100644 --- a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc +++ b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc
@@ -141,7 +141,7 @@ else echo_handler_.Run(value, std::move(callback)); } - void Send(int32_t value) override { NOTREACHED(); } + void Send(int32_t value) override { NOTREACHED_IN_MIGRATION(); } ReceiverType* receiver() { return &receiver_; }
diff --git a/mojo/public/cpp/bindings/tests/idle_tracking_unittest.cc b/mojo/public/cpp/bindings/tests/idle_tracking_unittest.cc index 12f7e7d..d3f24b4 100644 --- a/mojo/public/cpp/bindings/tests/idle_tracking_unittest.cc +++ b/mojo/public/cpp/bindings/tests/idle_tracking_unittest.cc
@@ -70,8 +70,9 @@ TestServiceImpl impl(remote.BindNewPipeAndPassReceiver()); base::RunLoop loop; - remote.set_idle_handler(base::TimeDelta(), - base::BindRepeating([] { NOTREACHED(); })); + remote.set_idle_handler(base::TimeDelta(), base::BindRepeating([] { + NOTREACHED_IN_MIGRATION(); + })); remote.FlushAsyncForTesting(loop.QuitClosure()); EXPECT_EQ(0u, remote.GetNumUnackedMessagesForTesting()); loop.Run(); @@ -105,8 +106,9 @@ TestServiceImpl impl(remote.BindNewPipeAndPassReceiver()); impl.HoldNextPingPong(); - remote.set_idle_handler(base::TimeDelta(), - base::BindRepeating([] { NOTREACHED(); })); + remote.set_idle_handler(base::TimeDelta(), base::BindRepeating([] { + NOTREACHED_IN_MIGRATION(); + })); bool idle = false; bool replied = false; @@ -162,8 +164,9 @@ // First see that we can bind another receiver and that the Remote does not // invoke its idle handler even though its number of unacked messages goes to // zero. - remote.set_idle_handler(base::TimeDelta(), - base::BindRepeating([] { NOTREACHED(); })); + remote.set_idle_handler(base::TimeDelta(), base::BindRepeating([] { + NOTREACHED_IN_MIGRATION(); + })); Remote<mojom::KeepAlive> keepalive; remote->BindKeepAlive(keepalive.BindNewPipeAndPassReceiver()); EXPECT_EQ(1u, remote.GetNumUnackedMessagesForTesting()); @@ -214,8 +217,9 @@ // First see that we can bind another receiver and that the Remote does not // invoke its idle handler even though its number of unacked messages goes to // zero. - remote.set_idle_handler(base::TimeDelta(), - base::BindRepeating([] { NOTREACHED(); })); + remote.set_idle_handler(base::TimeDelta(), base::BindRepeating([] { + NOTREACHED_IN_MIGRATION(); + })); Remote<mojom::KeepAlive> keepalive; remote->BindKeepAlive(keepalive.BindNewPipeAndPassReceiver()); EXPECT_EQ(1u, remote.GetNumUnackedMessagesForTesting());
diff --git a/mojo/public/cpp/bindings/tests/receiver_unittest.cc b/mojo/public/cpp/bindings/tests/receiver_unittest.cc index 34418925..6361869 100644 --- a/mojo/public/cpp/bindings/tests/receiver_unittest.cc +++ b/mojo/public/cpp/bindings/tests/receiver_unittest.cc
@@ -520,8 +520,9 @@ { // Attempt to dispatch another message after the WeakPtr is invalidated. - impl.set_ping_handler(base::BindRepeating([] { NOTREACHED(); })); - remote->Ping(base::BindOnce([] { NOTREACHED(); })); + impl.set_ping_handler( + base::BindRepeating([] { NOTREACHED_IN_MIGRATION(); })); + remote->Ping(base::BindOnce([] { NOTREACHED_IN_MIGRATION(); })); // The receiver will close its end of the pipe which will trigger a // disconnect on |remote|.
diff --git a/mojo/public/cpp/platform/platform_channel_server_posix.cc b/mojo/public/cpp/platform/platform_channel_server_posix.cc index 914c93e..d5b11ec 100644 --- a/mojo/public/cpp/platform/platform_channel_server_posix.cc +++ b/mojo/public/cpp/platform/platform_channel_server_posix.cc
@@ -66,7 +66,9 @@ PlatformChannelEndpoint{PlatformHandle{std::move(socket)}}); } - void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanWriteWithoutBlocking(int fd) override { + NOTREACHED_IN_MIGRATION(); + } private: void Stop() {
diff --git a/mojo/public/cpp/system/tests/simple_watcher_unittest.cc b/mojo/public/cpp/system/tests/simple_watcher_unittest.cc index b193006e..5688c42c 100644 --- a/mojo/public/cpp/system/tests/simple_watcher_unittest.cc +++ b/mojo/public/cpp/system/tests/simple_watcher_unittest.cc
@@ -31,7 +31,7 @@ } SimpleWatcher::ReadyCallback NotReached() { - return OnReady([](MojoResult) { NOTREACHED(); }); + return OnReady([](MojoResult) { NOTREACHED_IN_MIGRATION(); }); } class SimpleWatcherTest : public testing::Test {
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.data b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.data new file mode 100644 index 0000000..918c757 --- /dev/null +++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.data
@@ -0,0 +1,26 @@ +[dist4]message_header // num_bytes +[u4]0 // version +[u4]0 // interface ID +[u4]23 // name +[u4]0 // flags +[u4]0 // padding +[anchr]message_header + +[dist4]method23_params +[u4]0 // version +[dist8]param0_ptr // param0: array<bool?> +[dist8]param1_ptr // param1: array<uint32?> +[anchr]method23_params + +[anchr]param0_ptr +[dist4]param0_member // num_bytes +[u4]0 // num_elements +[anchr]param0_member + +[anchr]param1_ptr +[dist4]param1_member // num_bytes +[u4]2 // num_elements +[u4]0 // bitfield +[u4]0 // element 0 + // truncated and missing element here +[anchr]param1_member
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.expected b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.expected new file mode 100644 index 0000000..5a1ec4e --- /dev/null +++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.expected
@@ -0,0 +1 @@ +VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.data b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.data new file mode 100644 index 0000000..e969e41 --- /dev/null +++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.data
@@ -0,0 +1,52 @@ +[dist4]message_header // num_bytes +[u4]0 // version +[u4]0 // interface ID +[u4]24 // name +[u4]0 // flags +[u4]0 // padding +[anchr]message_header + +[dist4]method24_params +[u4]0 // version +[dist8]param0_ptr // param0: map<uint32, bool?> +[dist8]param1_ptr // param1: map<uint32, uint64?> +[anchr]method24_params + +[anchr]param0_ptr +[dist4]param0_map_data_struct_header // num_bytes +[u4]0 // version +[dist8]param0_key_array_ptr +[dist8]param0_value_array_ptr +[anchr]param0_map_data_struct_header + +[anchr]param0_key_array_ptr +[dist4]param0_key_array_member // num_bytes +[u4]0 // num_elements +[anchr]param0_key_array_member + +[anchr]param0_value_array_ptr +[dist4]param0_value_array_member // num_bytes +[u4]0 // num_elements +[anchr]param0_value_array_member + +[anchr]param1_ptr +[dist4]param1_map_data_struct_header // num_bytes +[u4]0 // version +[dist8]param1_key_array_ptr +[dist8]param1_value_array_ptr +[anchr]param1_map_data_struct_header + +[anchr]param1_key_array_ptr +[dist4]param1_key_array_member // num_bytes +[u4]2 // num_elements +[u4]1 // key +[u4]2 // key +[anchr]param1_key_array_member + +[anchr]param1_value_array_ptr +[dist4]param1_value_array_member // num_bytes +[u4]2 // num_elements +[u8]0 // bitfield +[u8]6 // value + // truncated and missing element here +[anchr]param1_value_array_member
diff --git a/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.expected b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.expected new file mode 100644 index 0000000..5a1ec4e --- /dev/null +++ b/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.expected
@@ -0,0 +1 @@ +VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER
diff --git a/mojo/public/interfaces/bindings/tests/validation_data_files.gni b/mojo/public/interfaces/bindings/tests/validation_data_files.gni index d4977330..955b86c2 100644 --- a/mojo/public/interfaces/bindings/tests/validation_data_files.gni +++ b/mojo/public/interfaces/bindings/tests/validation_data_files.gni
@@ -145,8 +145,12 @@ "data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.expected", "data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.data", "data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.expected", + "data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.data", + "data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.expected", "data/validation/conformance_mthd23_good.data", "data/validation/conformance_mthd23_good.expected", + "data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.data", + "data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.expected", "data/validation/conformance_mthd24_good.data", "data/validation/conformance_mthd24_good.expected", "data/validation/conformance_mthd2_good.data",
diff --git a/mojo/public/interfaces/bindings/tests/validation_unittest_bundle_data.filelist b/mojo/public/interfaces/bindings/tests/validation_unittest_bundle_data.filelist index 362f6b7..9494cf6c4 100644 --- a/mojo/public/interfaces/bindings/tests/validation_unittest_bundle_data.filelist +++ b/mojo/public/interfaces/bindings/tests/validation_unittest_bundle_data.filelist
@@ -146,10 +146,14 @@ //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.expected //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.data //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.expected +//mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.data +//mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_array_of_optionals_less_than_necessary_bytes.expected //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_good.data //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd23_good.expected //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_good.data //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_good.expected +//mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.data +//mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd24_map_of_optionals_less_than_necessary_bytes.expected //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd2_good.data //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd2_good.expected //mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd2_multiple_pointers_to_same_struct.data
diff --git a/net/cookies/cookie_partition_key.cc b/net/cookies/cookie_partition_key.cc index 41e6131..ce0335b3 100644 --- a/net/cookies/cookie_partition_key.cc +++ b/net/cookies/cookie_partition_key.cc
@@ -122,8 +122,8 @@ std::optional<CookiePartitionKey> CookiePartitionKey::FromNetworkIsolationKey( const NetworkIsolationKey& network_isolation_key, - SiteForCookies site_for_cookies, - SchemefulSite request_site, + const SiteForCookies& site_for_cookies, + const SchemefulSite& request_site, bool main_frame_navigation) { if (cookie_util::PartitionedCookiesDisabledByCommandLine()) { return std::nullopt;
diff --git a/net/cookies/cookie_partition_key.h b/net/cookies/cookie_partition_key.h index 7bf6840..0e5252a 100644 --- a/net/cookies/cookie_partition_key.h +++ b/net/cookies/cookie_partition_key.h
@@ -14,7 +14,6 @@ #include "net/base/net_export.h" #include "net/base/network_isolation_key.h" #include "net/base/schemeful_site.h" -#include "net/cookies/site_for_cookies.h" #include "url/gurl.h" #if !BUILDFLAG(CRONET_BUILD) @@ -23,6 +22,8 @@ namespace net { +class SiteForCookies; + class NET_EXPORT CookiePartitionKey { public: class NET_EXPORT SerializedCookiePartitionKey { @@ -99,8 +100,8 @@ // is the url of the context running the code. static std::optional<CookiePartitionKey> FromNetworkIsolationKey( const NetworkIsolationKey& network_isolation_key, - SiteForCookies site_for_cookies, - SchemefulSite request_site, + const SiteForCookies& site_for_cookies, + const SchemefulSite& request_site, bool main_frame_navigation); // Create a new CookiePartitionKey from the site of an existing
diff --git a/net/disk_cache/blockfile/stress_support.h b/net/disk_cache/blockfile/stress_support.h index 87b8778a..efaef2d 100644 --- a/net/disk_cache/blockfile/stress_support.h +++ b/net/disk_cache/blockfile/stress_support.h
@@ -20,7 +20,7 @@ // #define STRESS_CACHE_EXTENDED_VALIDATION 1 #if defined(NET_BUILD_STRESS_CACHE) -#define STRESS_NOTREACHED() NOTREACHED() +#define STRESS_NOTREACHED() NOTREACHED_IN_MIGRATION() #define STRESS_DCHECK(a) DCHECK(a) #else // We don't support streams with these macros, but that's a small price to pay
diff --git a/net/http/bidirectional_stream_unittest.cc b/net/http/bidirectional_stream_unittest.cc index 6f359ee..669d4ce7 100644 --- a/net/http/bidirectional_stream_unittest.cc +++ b/net/http/bidirectional_stream_unittest.cc
@@ -333,7 +333,7 @@ } } - void OnDataSent() override { NOTREACHED(); } + void OnDataSent() override { NOTREACHED_IN_MIGRATION(); } void OnDataRead(int bytes_read) override { if (phase_ == ON_HEADERS_RECEIVED) {
diff --git a/net/http/http_stream_factory_unittest.cc b/net/http/http_stream_factory_unittest.cc index 4d04429..2a705cb 100644 --- a/net/http/http_stream_factory_unittest.cc +++ b/net/http/http_stream_factory_unittest.cc
@@ -970,12 +970,12 @@ response_headers_ = response_headers.Clone(); loop_.Quit(); } - void OnDataRead(int bytes_read) override { NOTREACHED(); } - void OnDataSent() override { NOTREACHED(); } + void OnDataRead(int bytes_read) override { NOTREACHED_IN_MIGRATION(); } + void OnDataSent() override { NOTREACHED_IN_MIGRATION(); } void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override { NOTREACHED_IN_MIGRATION(); } - void OnFailed(int error) override { NOTREACHED(); } + void OnFailed(int error) override { NOTREACHED_IN_MIGRATION(); } base::RunLoop loop_; spdy::Http2HeaderBlock response_headers_; };
diff --git a/net/nqe/network_quality_estimator_util.cc b/net/nqe/network_quality_estimator_util.cc index f6093e1..3a1d56b 100644 --- a/net/nqe/network_quality_estimator_util.cc +++ b/net/nqe/network_quality_estimator_util.cc
@@ -35,7 +35,8 @@ network_anonymization_key, net_log, parameters); - int rv = request->Start(base::BindOnce([](int error) { NOTREACHED(); })); + int rv = request->Start( + base::BindOnce([](int error) { NOTREACHED_IN_MIGRATION(); })); DCHECK_NE(rv, ERR_IO_PENDING); if (rv == OK && request->GetAddressResults() &&
diff --git a/net/quic/bidirectional_stream_quic_impl_unittest.cc b/net/quic/bidirectional_stream_quic_impl_unittest.cc index e763b8b..1978ea77 100644 --- a/net/quic/bidirectional_stream_quic_impl_unittest.cc +++ b/net/quic/bidirectional_stream_quic_impl_unittest.cc
@@ -371,7 +371,7 @@ TestDelegateBase::OnHeadersReceived(headers_copy); } - void OnDataSent() override { NOTREACHED(); } + void OnDataSent() override { NOTREACHED_IN_MIGRATION(); } void OnDataRead(int bytes_read) override { DCHECK_NE(ON_HEADERS_RECEIVED, phase_);
diff --git a/net/reporting/reporting_endpoint_manager_unittest.cc b/net/reporting/reporting_endpoint_manager_unittest.cc index f0edb77..813f782 100644 --- a/net/reporting/reporting_endpoint_manager_unittest.cc +++ b/net/reporting/reporting_endpoint_manager_unittest.cc
@@ -129,7 +129,7 @@ bool delivery_success) override { NOTREACHED_IN_MIGRATION(); } - void RemoveAllReports() override { NOTREACHED(); } + void RemoveAllReports() override { NOTREACHED_IN_MIGRATION(); } size_t GetFullReportCountForTesting() const override { NOTREACHED_IN_MIGRATION(); return 0; @@ -170,12 +170,14 @@ void RemoveClientsForOrigin(const url::Origin& origin) override { NOTREACHED_IN_MIGRATION(); } - void RemoveAllClients() override { NOTREACHED(); } + void RemoveAllClients() override { NOTREACHED_IN_MIGRATION(); } void RemoveEndpointGroup( const ReportingEndpointGroupKey& group_key) override { NOTREACHED_IN_MIGRATION(); } - void RemoveEndpointsForUrl(const GURL& url) override { NOTREACHED(); } + void RemoveEndpointsForUrl(const GURL& url) override { + NOTREACHED_IN_MIGRATION(); + } void RemoveSourceAndEndpoints( const base::UnguessableToken& reporting_source) override { NOTREACHED_IN_MIGRATION(); @@ -194,7 +196,7 @@ NOTREACHED_IN_MIGRATION(); return 0; } - void Flush() override { NOTREACHED(); } + void Flush() override { NOTREACHED_IN_MIGRATION(); } ReportingEndpoint GetV1EndpointForTesting( const base::UnguessableToken& reporting_source, const std::string& endpoint_name) const override {
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_logging_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_logging_impl.h index ee3f1ce..f0da53d8 100644 --- a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_logging_impl.h +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_logging_impl.h
@@ -78,7 +78,7 @@ #define QUICHE_CHROMIUM_DLOG_IF_0 QUICHE_CHROMIUM_DLOG_IF_ERROR #endif -#define QUICHE_NOTREACHED_IMPL() NOTREACHED() +#define QUICHE_NOTREACHED_IMPL() NOTREACHED_IN_MIGRATION() #define QUICHE_PLOG_IMPL(severity) DVLOG(1)
diff --git a/pdf/ink/BUILD.gn b/pdf/ink/BUILD.gn index a422bd76..deeb751 100644 --- a/pdf/ink/BUILD.gn +++ b/pdf/ink/BUILD.gn
@@ -23,6 +23,7 @@ visibility = [ "//pdf/*" ] sources = [ + "ink_affine_transform.h", "ink_brush.cc", "ink_brush.h", "ink_brush_behavior.h",
diff --git a/pdf/ink/ink_affine_transform.h b/pdf/ink/ink_affine_transform.h new file mode 100644 index 0000000..6c6db5c --- /dev/null +++ b/pdf/ink/ink_affine_transform.h
@@ -0,0 +1,28 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PDF_INK_INK_AFFINE_TRANSFORM_H_ +#define PDF_INK_INK_AFFINE_TRANSFORM_H_ + +namespace chrome_pdf { + +// NOTE: This is the equivalent to the following 3x3 matrix: +// +// a b c +// d e f +// 0 0 1 +// +// Thus the identity matrix is {1, 0, 0, 0, 1, 0}, and not {1, 0, 0, 1, 0, 0}. +struct InkAffineTransform { + float a; + float b; + float c; + float d; + float e; + float f; +}; + +} // namespace chrome_pdf + +#endif // PDF_INK_INK_AFFINE_TRANSFORM_H_
diff --git a/pdf/ink/ink_skia_renderer.h b/pdf/ink/ink_skia_renderer.h index d5190694a..23faf88 100644 --- a/pdf/ink/ink_skia_renderer.h +++ b/pdf/ink/ink_skia_renderer.h
@@ -14,25 +14,10 @@ class InkInProgressStroke; class InkStroke; +struct InkAffineTransform; class InkSkiaRenderer { public: - // NOTE: This is the equivalent to the following 3x3 matrix: - // - // a b c - // d e f - // 0 0 1 - // - // Thus the identity matrix is {1, 0, 0, 0, 1, 0}, and not {1, 0, 0, 1, 0, 0}. - struct AffineTransform { - float a; - float b; - float c; - float d; - float e; - float f; - }; - static std::unique_ptr<InkSkiaRenderer> Create(); InkSkiaRenderer(const InkSkiaRenderer&) = delete; @@ -42,11 +27,11 @@ // TODO(thestig): Remove `context` parameter. virtual bool Draw(GrDirectContext* context, const InkInProgressStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) = 0; virtual bool Draw(GrDirectContext* context, const InkStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) = 0; protected:
diff --git a/pdf/ink/stub/BUILD.gn b/pdf/ink/stub/BUILD.gn index 2892974d..70d171b 100644 --- a/pdf/ink/stub/BUILD.gn +++ b/pdf/ink/stub/BUILD.gn
@@ -17,6 +17,7 @@ "ink_skia_renderer_stub.cc", "ink_skia_renderer_stub.h", "ink_stroke_input_batch_stub.cc", + "ink_stroke_input_batch_stub.h", ] configs += [ "//pdf:strict" ]
diff --git a/pdf/ink/stub/ink_in_progress_stroke_stub.cc b/pdf/ink/stub/ink_in_progress_stroke_stub.cc index f39404d8..e77ae06 100644 --- a/pdf/ink/stub/ink_in_progress_stroke_stub.cc +++ b/pdf/ink/stub/ink_in_progress_stroke_stub.cc
@@ -12,7 +12,7 @@ // static std::unique_ptr<InkInProgressStroke> InkInProgressStroke::Create() { - return nullptr; + return std::make_unique<InkInProgressStrokeStub>(); } InkInProgressStrokeStub::~InkInProgressStrokeStub() = default; @@ -22,13 +22,15 @@ bool InkInProgressStrokeStub::EnqueueInputs( const InkStrokeInputBatch* real_inputs, const InkStrokeInputBatch* predicted_inputs) { - return false; + // Pretend enqueuing succeeded, even though nothing is done here. + return true; } void InkInProgressStrokeStub::FinishInputs() {} bool InkInProgressStrokeStub::UpdateShape(float current_elapsed_time_seconds) { - return false; + // Pretend shape update succeeded, even though nothing is done here. + return true; } std::unique_ptr<InkStroke> InkInProgressStrokeStub::CopyToStroke() const {
diff --git a/pdf/ink/stub/ink_skia_renderer_stub.cc b/pdf/ink/stub/ink_skia_renderer_stub.cc index d77ed11..0bd1504 100644 --- a/pdf/ink/stub/ink_skia_renderer_stub.cc +++ b/pdf/ink/stub/ink_skia_renderer_stub.cc
@@ -15,14 +15,14 @@ bool InkSkiaRendererStub::Draw(GrDirectContext* context, const InkInProgressStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) { return false; } bool InkSkiaRendererStub::Draw(GrDirectContext* context, const InkStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) { return false; }
diff --git a/pdf/ink/stub/ink_skia_renderer_stub.h b/pdf/ink/stub/ink_skia_renderer_stub.h index e96f3c9..d4a1f12 100644 --- a/pdf/ink/stub/ink_skia_renderer_stub.h +++ b/pdf/ink/stub/ink_skia_renderer_stub.h
@@ -13,11 +13,11 @@ public: bool Draw(GrDirectContext* context, const InkInProgressStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) override; bool Draw(GrDirectContext* context, const InkStroke& stroke, - const AffineTransform& object_to_canvas, + const InkAffineTransform& object_to_canvas, SkCanvas& canvas) override; };
diff --git a/pdf/ink/stub/ink_stroke_input_batch_stub.cc b/pdf/ink/stub/ink_stroke_input_batch_stub.cc index 15fcd87e..6ab39f4 100644 --- a/pdf/ink/stub/ink_stroke_input_batch_stub.cc +++ b/pdf/ink/stub/ink_stroke_input_batch_stub.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 "pdf/ink/ink_stroke_input_batch.h" +#include "pdf/ink/stub/ink_stroke_input_batch_stub.h" #include <memory> @@ -11,7 +11,11 @@ // static std::unique_ptr<InkStrokeInputBatch> InkStrokeInputBatch::Create( const std::vector<InkStrokeInput>& inputs) { - return nullptr; + return std::make_unique<InkStrokeInputBatchStub>(); } +InkStrokeInputBatchStub::InkStrokeInputBatchStub() = default; + +InkStrokeInputBatchStub::~InkStrokeInputBatchStub() = default; + } // namespace chrome_pdf
diff --git a/pdf/ink/stub/ink_stroke_input_batch_stub.h b/pdf/ink/stub/ink_stroke_input_batch_stub.h new file mode 100644 index 0000000..a04f3aa8 --- /dev/null +++ b/pdf/ink/stub/ink_stroke_input_batch_stub.h
@@ -0,0 +1,20 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PDF_INK_STUB_INK_STROKE_INPUT_BATCH_STUB_H_ +#define PDF_INK_STUB_INK_STROKE_INPUT_BATCH_STUB_H_ + +#include "pdf/ink/ink_stroke_input_batch.h" + +namespace chrome_pdf { + +class InkStrokeInputBatchStub : public InkStrokeInputBatch { + public: + InkStrokeInputBatchStub(); + ~InkStrokeInputBatchStub(); +}; + +} // namespace chrome_pdf + +#endif // PDF_INK_STUB_INK_STROKE_INPUT_BATCH_STUB_H_
diff --git a/pdf/ink_module.cc b/pdf/ink_module.cc index 2d6a396..eb68ca691 100644 --- a/pdf/ink_module.cc +++ b/pdf/ink_module.cc
@@ -171,20 +171,9 @@ return false; } - auto stroke = InkInProgressStroke::Create(); - std::unique_ptr<InkBrush> brush = CreateBrush(); - CHECK(brush); - stroke->Start(*brush); - // TODO(crbug.com/335524380): Add `event` to `ink_inputs_`? - auto input_batch = InkStrokeInputBatch::Create(ink_inputs_); - CHECK(input_batch); - bool enqueue_results = stroke->EnqueueInputs(input_batch.get(), nullptr); - CHECK(enqueue_results); - stroke->FinishInputs(); - bool update_results = stroke->UpdateShape(0); - CHECK(update_results); - ink_strokes_.push_back(stroke->CopyToStroke()); + ConvertInkInputsIntoStroke(); + // Reset input fields. ink_inputs_.clear(); ink_start_time_ = std::nullopt; @@ -222,4 +211,21 @@ enabled_ = message.FindBool("enable").value(); } +void InkModule::ConvertInkInputsIntoStroke() { + auto stroke = InkInProgressStroke::Create(); + CHECK(stroke); + std::unique_ptr<InkBrush> brush = CreateBrush(); + CHECK(brush); + stroke->Start(*brush); + // TODO(crbug.com/335524380): Add `event` to `ink_inputs_`? + auto input_batch = InkStrokeInputBatch::Create(ink_inputs_); + CHECK(input_batch); + bool enqueue_results = stroke->EnqueueInputs(input_batch.get(), nullptr); + CHECK(enqueue_results); + stroke->FinishInputs(); + bool update_results = stroke->UpdateShape(0); + CHECK(update_results); + ink_strokes_.push_back(stroke->CopyToStroke()); +} + } // namespace chrome_pdf
diff --git a/pdf/ink_module.h b/pdf/ink_module.h index f024923..c463ba3 100644 --- a/pdf/ink_module.h +++ b/pdf/ink_module.h
@@ -67,6 +67,9 @@ void HandleSetAnnotationBrushMessage(const base::Value::Dict& message); void HandleSetAnnotationModeMessage(const base::Value::Dict& message); + // Convert `ink_inputs_` into an entry in `ink_strokes_`. + void ConvertInkInputsIntoStroke(); + const raw_ref<Client> client_; bool enabled_ = false;
diff --git a/pdf/ink_module_unittest.cc b/pdf/ink_module_unittest.cc index 7279dfb9..2e4cb1f 100644 --- a/pdf/ink_module_unittest.cc +++ b/pdf/ink_module_unittest.cc
@@ -4,10 +4,16 @@ #include "pdf/ink_module.h" +#include <vector> + #include "base/test/scoped_feature_list.h" #include "base/values.h" #include "pdf/pdf_features.h" +#include "pdf/test/mouse_event_builder.h" #include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/input/web_mouse_event.h" +#include "ui/gfx/geometry/rect_f.h" namespace chrome_pdf { @@ -22,13 +28,38 @@ // InkModule::Client: int VisiblePageIndexFromPoint(const gfx::PointF& point) override { - // TODO(crbug.com/335524380): Implement. + // Assumes that all pages are visible. + for (size_t i = 0; i < pages_layout_.size(); ++i) { + if (pages_layout_[i].Contains(point)) { + return i; + } + } + + // Point is not over a page in the viewer plane. return -1; } + + // Provide the sequence of pages and the coordinates and dimensions for how + // they are laid out in a viewer plane. It is upon the caller to ensure the + // positioning makes sense (e.g., pages do not overlap). + void set_pages_layout(const std::vector<gfx::RectF>& pages_layout) { + pages_layout_ = pages_layout; + } + + private: + std::vector<gfx::RectF> pages_layout_; }; class InkModuleTest : public testing::Test { protected: + base::Value::Dict CreateSetAnnotationModeMessage(bool enable) { + base::Value::Dict message; + message.Set("type", "setAnnotationMode"); + message.Set("enable", enable); + return message; + } + + FakeClient& client() { return client_; } InkModule& ink_module() { return ink_module_; } private: @@ -47,9 +78,7 @@ TEST_F(InkModuleTest, HandleSetAnnotationModeMessage) { EXPECT_FALSE(ink_module().enabled()); - base::Value::Dict message; - message.Set("type", "setAnnotationMode"); - message.Set("enable", false); + base::Value::Dict message = CreateSetAnnotationModeMessage(/*enable=*/false); EXPECT_TRUE(ink_module().OnMessage(message)); EXPECT_FALSE(ink_module().enabled()); @@ -63,6 +92,57 @@ EXPECT_FALSE(ink_module().enabled()); } +class InkModuleStrokeTest : public InkModuleTest { + protected: + void RunStrokeCheckTest(bool annotation_mode_enabled) { + EXPECT_TRUE(ink_module().OnMessage( + CreateSetAnnotationModeMessage(annotation_mode_enabled))); + EXPECT_EQ(annotation_mode_enabled, ink_module().enabled()); + + // Single page layout that matches visible area. + constexpr gfx::RectF kPage(0.0f, 0.0f, 50.0f, 60.0f); + client().set_pages_layout({kPage}); + + constexpr gfx::PointF kMouseDownLocation(10.0f, 15.0f); + constexpr gfx::PointF kMouseMoveLocation(20.0f, 25.0f); + constexpr gfx::PointF kMouseUpLocation(30.0f, 17.0f); + + // Mouse events should only be handled when annotation mode is enabled. + blink::WebMouseEvent mouse_down_event = + MouseEventBuilder() + .CreateLeftClickAtPosition(kMouseDownLocation) + .Build(); + EXPECT_EQ(annotation_mode_enabled, + ink_module().HandleInputEvent(mouse_down_event)); + + blink::WebMouseEvent mouse_move_event = + MouseEventBuilder() + .SetType(blink::WebInputEvent::Type::kMouseMove) + .SetPosition(kMouseMoveLocation) + .Build(); + EXPECT_EQ(annotation_mode_enabled, + ink_module().HandleInputEvent(mouse_move_event)); + + blink::WebMouseEvent mouse_up_event = + MouseEventBuilder() + .SetType(blink::WebInputEvent::Type::kMouseUp) + .SetPosition(kMouseUpLocation) + .SetButton(blink::WebPointerProperties::Button::kLeft) + .SetClickCount(1) + .Build(); + EXPECT_EQ(annotation_mode_enabled, + ink_module().HandleInputEvent(mouse_up_event)); + } +}; + +TEST_F(InkModuleStrokeTest, NoAnnotationIfNotEnabled) { + RunStrokeCheckTest(/*annotation_mode_enabled=*/false); +} + +TEST_F(InkModuleStrokeTest, AnnotationIfEnabled) { + RunStrokeCheckTest(/*annotation_mode_enabled=*/true); +} + } // namespace } // namespace chrome_pdf
diff --git a/ppapi/proxy/video_capture_resource.cc b/ppapi/proxy/video_capture_resource.cc index b11c68c..debd956 100644 --- a/ppapi/proxy/video_capture_resource.cc +++ b/ppapi/proxy/video_capture_resource.cc
@@ -61,7 +61,7 @@ PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( PpapiPluginMsg_VideoCapture_OnBufferReady, OnPluginMsgOnBufferReady) - PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(NOTREACHED()) + PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(NOTREACHED_IN_MIGRATION()) PPAPI_END_MESSAGE_MAP() }
diff --git a/ppapi/proxy/websocket_resource.cc b/ppapi/proxy/websocket_resource.cc index 1a2076c..32d21f0 100644 --- a/ppapi/proxy/websocket_resource.cc +++ b/ppapi/proxy/websocket_resource.cc
@@ -352,7 +352,7 @@ PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( PpapiPluginMsg_WebSocket_ClosedReply, OnPluginMsgClosedReply) - PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(NOTREACHED()) + PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(NOTREACHED_IN_MIGRATION()) PPAPI_END_MESSAGE_MAP() }
diff --git a/remoting/protocol/connection_tester.cc b/remoting/protocol/connection_tester.cc index b0703d0..a9b4036 100644 --- a/remoting/protocol/connection_tester.cc +++ b/remoting/protocol/connection_tester.cc
@@ -160,7 +160,7 @@ void OnMessageReceived(std::unique_ptr<CompoundBuffer> message) override { NOTREACHED_IN_MIGRATION(); } - void OnMessagePipeClosed() override { NOTREACHED(); } + void OnMessagePipeClosed() override { NOTREACHED_IN_MIGRATION(); } private: raw_ptr<MessagePipe> pipe_;
diff --git a/remoting/signaling/ftl_message_reception_channel_unittest.cc b/remoting/signaling/ftl_message_reception_channel_unittest.cc index 8236293..f4d9d55 100644 --- a/remoting/signaling/ftl_message_reception_channel_unittest.cc +++ b/remoting/signaling/ftl_message_reception_channel_unittest.cc
@@ -97,7 +97,7 @@ } base::OnceClosure NotReachedClosure() { - return base::BindOnce([]() { NOTREACHED(); }); + return base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); }); } base::RepeatingCallback<void(const ProtobufHttpStatus&)>
diff --git a/services/audio/loopback_stream_unittest.cc b/services/audio/loopback_stream_unittest.cc index 2e7fbb88..485a0778 100644 --- a/services/audio/loopback_stream_unittest.cc +++ b/services/audio/loopback_stream_unittest.cc
@@ -83,7 +83,7 @@ MOCK_METHOD1(OnError, void(media::mojom::InputStreamErrorCode)); MOCK_METHOD0(DidStartRecording, void()); - void OnMutedStateChanged(bool) override { NOTREACHED(); } + void OnMutedStateChanged(bool) override { NOTREACHED_IN_MIGRATION(); } private: mojo::Receiver<media::mojom::AudioInputStreamClient> client_receiver_{this};
diff --git a/services/device/BUILD.gn b/services/device/BUILD.gn index ff82fd1..298bf92 100644 --- a/services/device/BUILD.gn +++ b/services/device/BUILD.gn
@@ -153,7 +153,7 @@ "geolocation/geolocation_impl_unittest.cc", "geolocation/geolocation_provider_impl_unittest.cc", "geolocation/geolocation_service_unittest.cc", - "geolocation/location_arbitrator_unittest.cc", + "geolocation/location_provider_manager_unittest.cc", "geolocation/network_location_provider_unittest.cc", "geolocation/position_cache_impl_unittest.cc", "geolocation/public_ip_address_geolocator_unittest.cc",
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn index ea4c903..af0dea6 100644 --- a/services/device/geolocation/BUILD.gn +++ b/services/device/geolocation/BUILD.gn
@@ -28,8 +28,8 @@ "geolocation_provider.h", "geolocation_provider_impl.cc", "geolocation_provider_impl.h", - "location_arbitrator.cc", - "location_arbitrator.h", + "location_provider_manager.cc", + "location_provider_manager.h", "network_location_request.cc", "network_location_request.h", "position_cache.h",
diff --git a/services/device/geolocation/geolocation_provider_impl.cc b/services/device/geolocation/geolocation_provider_impl.cc index 5c694b0..8e79c9c 100644 --- a/services/device/geolocation/geolocation_provider_impl.cc +++ b/services/device/geolocation/geolocation_provider_impl.cc
@@ -23,7 +23,7 @@ #include "build/build_config.h" #include "components/device_event_log/device_event_log.h" #include "net/base/network_change_notifier.h" -#include "services/device/geolocation/location_arbitrator.h" +#include "services/device/geolocation/location_provider_manager.h" #include "services/device/geolocation/position_cache_impl.h" #include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/geolocation/geoposition.h" @@ -201,12 +201,12 @@ } #endif Stop(); - DCHECK(!arbitrator_); + DCHECK(!location_provider_manager_); } -void GeolocationProviderImpl::SetArbitratorForTesting( - std::unique_ptr<LocationProvider> arbitrator) { - arbitrator_ = std::move(arbitrator); +void GeolocationProviderImpl::SetLocationProviderManagerForTesting( + std::unique_ptr<LocationProvider> location_provider_manager) { + location_provider_manager_ = std::move(location_provider_manager); } bool GeolocationProviderImpl::OnGeolocationThread() const { @@ -302,19 +302,19 @@ void GeolocationProviderImpl::StopProviders() { DCHECK(OnGeolocationThread()); - DCHECK(arbitrator_); + DCHECK(location_provider_manager_); GEOLOCATION_LOG(DEBUG) << "Stop provider."; - arbitrator_->StopProvider(); + location_provider_manager_->StopProvider(); OnInternalsUpdated(); } void GeolocationProviderImpl::StartProviders(bool enable_high_accuracy, bool enable_diagnostics) { DCHECK(OnGeolocationThread()); - DCHECK(arbitrator_); + DCHECK(location_provider_manager_); GEOLOCATION_LOG(DEBUG) << "Start provider: high_accuracy=" << enable_high_accuracy; - arbitrator_->StartProvider(enable_high_accuracy); + location_provider_manager_->StartProvider(enable_high_accuracy); if (enable_diagnostics) { // Enable diagnostics in the case where internals observers are added before // the provider is started. @@ -334,8 +334,8 @@ return; } DCHECK(OnGeolocationThread()); - DCHECK(arbitrator_); - arbitrator_->OnPermissionGranted(); + DCHECK(location_provider_manager_); + location_provider_manager_->OnPermissionGranted(); } void GeolocationProviderImpl::NotifyClients( @@ -378,8 +378,9 @@ void GeolocationProviderImpl::Init() { DCHECK(OnGeolocationThread()); - if (arbitrator_) + if (location_provider_manager_) { return; + } LocationProvider::LocationProviderUpdateCallback callback = base::BindRepeating(&GeolocationProviderImpl::OnLocationUpdate, @@ -393,7 +394,7 @@ DCHECK(!net::NetworkChangeNotifier::CreateIfNeeded()) << "PositionCacheImpl needs a global NetworkChangeNotifier"; - arbitrator_ = std::make_unique<LocationArbitrator>( + location_provider_manager_ = std::make_unique<LocationProviderManager>( g_custom_location_provider_callback.Get(), g_geolocation_system_permission_manager, std::move(url_loader_factory), g_api_key.Get(), @@ -405,12 +406,12 @@ base::Unretained(this)), base::BindRepeating(&GeolocationProviderImpl::OnNetworkLocationReceived, base::Unretained(this))); - arbitrator_->SetUpdateCallback(callback); + location_provider_manager_->SetUpdateCallback(callback); } void GeolocationProviderImpl::CleanUp() { DCHECK(OnGeolocationThread()); - arbitrator_.reset(); + location_provider_manager_.reset(); } void GeolocationProviderImpl::AddInternalsObserver( @@ -424,7 +425,7 @@ return; } internals_observers_.Add(std::move(observer)); - if (!arbitrator_) { + if (!location_provider_manager_) { std::move(callback).Run(nullptr); return; } @@ -458,7 +459,7 @@ mojom::GeolocationDiagnosticsPtr result = mojom::GeolocationDiagnostics::New(); - arbitrator_->FillDiagnostics(*result); + location_provider_manager_->FillDiagnostics(*result); return result; }
diff --git a/services/device/geolocation/geolocation_provider_impl.h b/services/device/geolocation/geolocation_provider_impl.h index 974250b8..47257c4 100644 --- a/services/device/geolocation/geolocation_provider_impl.h +++ b/services/device/geolocation/geolocation_provider_impl.h
@@ -50,7 +50,7 @@ // // It also implements GeolocationSystemPermissionManager::PermissionObserver on // supported platforms. Monitors system permission changes to manage the -// LocationArbitrator and report permission errors to clients. +// LocationProviderManager and report permission errors to clients. // // THREADING // @@ -83,7 +83,7 @@ bool HighAccuracyLocationInUse() override; void OverrideLocationForTesting(mojom::GeopositionResultPtr result) override; - // Callback from the LocationArbitrator. Public for testing. + // Callback from the LocationProviderManager. Public for testing. void OnLocationUpdate(const LocationProvider* provider, mojom::GeopositionResultPtr result); @@ -136,7 +136,8 @@ // Safe to call while there are no GeolocationProviderImpl clients // registered. - void SetArbitratorForTesting(std::unique_ptr<LocationProvider> arbitrator); + void SetLocationProviderManagerForTesting( + std::unique_ptr<LocationProvider> location_provider_manager); // mojom::GeolocationInternals implementation: void AddInternalsObserver( @@ -172,8 +173,8 @@ void StopProviders(); // Starts the geolocation providers or updates their options (delegates to - // arbitrator). If `enable_diagnostics` is true, also enables geolocation - // diagnostics. + // location_provider_manager). If `enable_diagnostics` is true, also enables + // geolocation diagnostics. void StartProviders(bool enable_high_accuracy, bool enable_diagnostics); // Updates the providers on the geolocation thread, which must be running. @@ -248,7 +249,7 @@ const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; // Only to be used on the geolocation thread. - std::unique_ptr<LocationProvider> arbitrator_; + std::unique_ptr<LocationProvider> location_provider_manager_; mojo::Receiver<mojom::GeolocationControl> control_receiver_{this};
diff --git a/services/device/geolocation/geolocation_provider_impl_unittest.cc b/services/device/geolocation/geolocation_provider_impl_unittest.cc index 6ec5a5a..541306be 100644 --- a/services/device/geolocation/geolocation_provider_impl_unittest.cc +++ b/services/device/geolocation/geolocation_provider_impl_unittest.cc
@@ -140,7 +140,9 @@ return GeolocationProviderImpl::GetInstance(); } - FakeLocationProvider* arbitrator() { return arbitrator_; } + FakeLocationProvider* location_provider_manager() { + return location_provider_manager_; + } void SetSystemPermission(LocationSystemPermissionStatus status) { #if BUILDFLAG(IS_APPLE) || BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED) @@ -151,7 +153,7 @@ void RunUntilIdle() { task_environment_.RunUntilIdle(); } // Called on test thread. - void SetFakeArbitrator(); + void SetFakeLocationProviderManager(); bool ProvidersStarted(); void SendMockLocation(const mojom::GeopositionResult& result); @@ -185,17 +187,18 @@ base::ThreadChecker thread_checker_; // Owned by the GeolocationProviderImpl class. - raw_ptr<FakeLocationProvider> arbitrator_ = nullptr; + raw_ptr<FakeLocationProvider> location_provider_manager_ = nullptr; - // True if |arbitrator_| is started. + // True if |location_provider_manager_| is started. bool is_started_; }; -void GeolocationProviderTest::SetFakeArbitrator() { - ASSERT_FALSE(arbitrator_); - auto arbitrator = std::make_unique<FakeLocationProvider>(); - arbitrator_ = arbitrator.get(); - provider()->SetArbitratorForTesting(std::move(arbitrator)); +void GeolocationProviderTest::SetFakeLocationProviderManager() { + ASSERT_FALSE(location_provider_manager_); + auto location_provider_manager = std::make_unique<FakeLocationProvider>(); + location_provider_manager_ = location_provider_manager.get(); + provider()->SetLocationProviderManagerForTesting( + std::move(location_provider_manager)); } bool GeolocationProviderTest::ProvidersStarted() { @@ -214,7 +217,7 @@ void GeolocationProviderTest::GetProvidersStarted() { DCHECK(provider()->task_runner()->BelongsToCurrentThread()); - is_started_ = arbitrator()->state() != + is_started_ = location_provider_manager()->state() != mojom::GeolocationDiagnostics::ProviderState::kStopped; } @@ -224,8 +227,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); provider()->task_runner()->PostTask( FROM_HERE, base::BindOnce(&GeolocationProviderImpl::OnLocationUpdate, - base::Unretained(provider()), arbitrator_, - result.Clone())); + base::Unretained(provider()), + location_provider_manager_, result.Clone())); } // Regression test for http://crbug.com/59377 @@ -237,7 +240,7 @@ } TEST_F(GeolocationProviderTest, StartStop) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); EXPECT_FALSE(provider()->IsRunning()); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); base::CallbackListSubscription subscription = @@ -253,7 +256,7 @@ } TEST_F(GeolocationProviderTest, StalePositionNotSent) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); { @@ -299,7 +302,7 @@ } TEST_F(GeolocationProviderTest, OverrideLocationForTesting) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); provider()->OverrideLocationForTesting(error_result_->Clone()); @@ -362,7 +365,7 @@ EXPECT_CALL(observer, OnDiagnosticsChanged).WillOnce([&](auto diagnostics) { provider_started_future.SetValue(std::move(diagnostics)); }); - SetFakeArbitrator(); + SetFakeLocationProviderManager(); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); base::CallbackListSubscription subscription = provider()->AddLocationUpdateCallback(base::DoNothing(), @@ -398,7 +401,7 @@ TEST_F(GeolocationProviderTest, MultipleDiagnosticsObservers) { // Add a subscription so the provider will be started. - SetFakeArbitrator(); + SetFakeLocationProviderManager(); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); base::CallbackListSubscription subscription = provider()->AddLocationUpdateCallback(base::DoNothing(), @@ -477,7 +480,7 @@ /*enabled_features=*/{}, /*disabled_features=*/{features::kGeolocationDiagnosticsObserver}); base::RunLoop loop; - SetFakeArbitrator(); + SetFakeLocationProviderManager(); SetSystemPermission(LocationSystemPermissionStatus::kAllowed); // Add a subscription so the provider will be started. @@ -504,7 +507,7 @@ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED) TEST_F(GeolocationProviderTest, StartProviderAfterSystemPermissionGranted) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); // The default system permission state is kUndetermined. Adding a location // observer should not start provider and observer's callback should not be @@ -543,7 +546,7 @@ } TEST_F(GeolocationProviderTest, AddCallbackWhenSystemPermissionDenied) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); // Set system permission state from kUndetermined to kDenied. SetSystemPermission(LocationSystemPermissionStatus::kDenied); @@ -573,7 +576,7 @@ TEST_F(GeolocationProviderTest, ReportPermissionDeniedOnSystemPermissionDenied) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); // Set system permission state from kUndetermined to kAllowed. SetSystemPermission(LocationSystemPermissionStatus::kAllowed); @@ -619,7 +622,7 @@ TEST_F(GeolocationProviderTest, SystemPermissionAllowedAfterSystemPermissionDenied) { - SetFakeArbitrator(); + SetFakeLocationProviderManager(); // Set system permission state from kUndetermined to kDenied. SetSystemPermission(LocationSystemPermissionStatus::kDenied);
diff --git a/services/device/geolocation/location_arbitrator.cc b/services/device/geolocation/location_provider_manager.cc similarity index 84% rename from services/device/geolocation/location_arbitrator.cc rename to services/device/geolocation/location_provider_manager.cc index c3b4717..691a8242 100644 --- a/services/device/geolocation/location_arbitrator.cc +++ b/services/device/geolocation/location_provider_manager.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 "services/device/geolocation/location_arbitrator.h" +#include "services/device/geolocation/location_provider_manager.h" #include <map> #include <memory> @@ -24,10 +24,10 @@ // To avoid oscillations, set this to twice the expected update interval of a // a GPS-type location provider (in case it misses a beat) plus a little. -const base::TimeDelta LocationArbitrator::kFixStaleTimeoutTimeDelta = +const base::TimeDelta LocationProviderManager::kFixStaleTimeoutTimeDelta = base::Seconds(11); -LocationArbitrator::LocationArbitrator( +LocationProviderManager::LocationProviderManager( CustomLocationProviderCallback custom_location_provider_getter, GeolocationSystemPermissionManager* geolocation_system_permission_manager, const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory, @@ -47,22 +47,22 @@ network_request_callback_(std::move(network_request_callback)), network_response_callback_(std::move(network_response_callback)) {} -LocationArbitrator::~LocationArbitrator() { +LocationProviderManager::~LocationProviderManager() { // Release the global wifi polling policy state. WifiPollingPolicy::Shutdown(); } -bool LocationArbitrator::HasPermissionBeenGrantedForTest() const { +bool LocationProviderManager::HasPermissionBeenGrantedForTest() const { return is_permission_granted_; } -void LocationArbitrator::OnPermissionGranted() { +void LocationProviderManager::OnPermissionGranted() { is_permission_granted_ = true; for (const auto& provider : providers_) provider->OnPermissionGranted(); } -void LocationArbitrator::StartProvider(bool enable_high_accuracy) { +void LocationProviderManager::StartProvider(bool enable_high_accuracy) { is_running_ = true; enable_high_accuracy_ = enable_high_accuracy; @@ -72,11 +72,11 @@ DoStartProviders(); } -void LocationArbitrator::DoStartProviders() { +void LocationProviderManager::DoStartProviders() { if (providers_.empty()) { // If no providers are available, we report an error to avoid // callers waiting indefinitely for a reply. - arbitrator_update_callback_.Run( + location_update_callback_.Run( this, mojom::GeopositionResult::NewError(mojom::GeopositionError::New( mojom::GeopositionErrorCode::kPositionUnavailable, "", ""))); return; @@ -86,7 +86,7 @@ } } -void LocationArbitrator::StopProvider() { +void LocationProviderManager::StopProvider() { // Reset the reference location state (provider+result) // so that future starts use fresh locations from // the newly constructed providers. @@ -97,18 +97,18 @@ is_running_ = false; } -void LocationArbitrator::RegisterProvider( +void LocationProviderManager::RegisterProvider( std::unique_ptr<LocationProvider> provider) { if (!provider) return; provider->SetUpdateCallback(base::BindRepeating( - &LocationArbitrator::OnLocationUpdate, base::Unretained(this))); + &LocationProviderManager::OnLocationUpdate, base::Unretained(this))); if (is_permission_granted_) provider->OnPermissionGranted(); providers_.push_back(std::move(provider)); } -void LocationArbitrator::RegisterProviders() { +void LocationProviderManager::RegisterProviders() { if (custom_location_provider_getter_) { auto custom_provider = custom_location_provider_getter_.Run(); if (custom_provider) { @@ -127,7 +127,7 @@ RegisterProvider(NewNetworkLocationProvider(url_loader_factory_, api_key_)); } -void LocationArbitrator::OnLocationUpdate( +void LocationProviderManager::OnLocationUpdate( const LocationProvider* provider, mojom::GeopositionResultPtr new_result) { DCHECK(new_result); @@ -140,14 +140,14 @@ } position_provider_ = provider; result_ = std::move(new_result); - arbitrator_update_callback_.Run(this, result_.Clone()); + location_update_callback_.Run(this, result_.Clone()); } -const mojom::GeopositionResult* LocationArbitrator::GetPosition() { +const mojom::GeopositionResult* LocationProviderManager::GetPosition() { return result_.get(); } -void LocationArbitrator::FillDiagnostics( +void LocationProviderManager::FillDiagnostics( mojom::GeolocationDiagnostics& diagnostics) { if (!is_running_ || providers_.empty()) { diagnostics.provider_state = @@ -170,14 +170,14 @@ } } -void LocationArbitrator::SetUpdateCallback( +void LocationProviderManager::SetUpdateCallback( const LocationProviderUpdateCallback& callback) { DCHECK(!callback.is_null()); - arbitrator_update_callback_ = callback; + location_update_callback_ = callback; } std::unique_ptr<LocationProvider> -LocationArbitrator::NewNetworkLocationProvider( +LocationProviderManager::NewNetworkLocationProvider( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, const std::string& api_key) { DCHECK(url_loader_factory); @@ -193,7 +193,7 @@ } std::unique_ptr<LocationProvider> -LocationArbitrator::NewSystemLocationProvider() { +LocationProviderManager::NewSystemLocationProvider() { #if BUILDFLAG(IS_APPLE) CHECK(geolocation_system_permission_manager_); return device::NewSystemLocationProvider( @@ -205,11 +205,11 @@ #endif } -base::Time LocationArbitrator::GetTimeNow() const { +base::Time LocationProviderManager::GetTimeNow() const { return base::Time::Now(); } -bool LocationArbitrator::IsNewPositionBetter( +bool LocationProviderManager::IsNewPositionBetter( const mojom::GeopositionResult& old_result, const mojom::GeopositionResult& new_result, bool from_same_provider) const {
diff --git a/services/device/geolocation/location_arbitrator.h b/services/device/geolocation/location_provider_manager.h similarity index 88% rename from services/device/geolocation/location_arbitrator.h rename to services/device/geolocation/location_provider_manager.h index acd0a37..a599e54 100644 --- a/services/device/geolocation/location_arbitrator.h +++ b/services/device/geolocation/location_provider_manager.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 SERVICES_DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_H_ -#define SERVICES_DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_H_ +#ifndef SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_ +#define SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_ #include <stdint.h> #include <memory> @@ -34,7 +34,7 @@ // This class is responsible for handling updates from multiple underlying // providers and resolving them to a single 'best' location fix at any given // moment. -class LocationArbitrator : public LocationProvider { +class LocationProviderManager : public LocationProvider { public: // The TimeDelta newer a location provider has to be that it's worth // switching to this location provider on the basis of it being fresher @@ -42,8 +42,8 @@ static const base::TimeDelta kFixStaleTimeoutTimeDelta; // If the |custom_location_provider_getter| callback returns nullptr, then - // LocationArbitrator uses the default system location provider. - LocationArbitrator( + // LocationProviderManager uses the default system location provider. + LocationProviderManager( CustomLocationProviderCallback custom_location_provider_getter, GeolocationSystemPermissionManager* geolocation_system_permission_manager, const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory, @@ -53,9 +53,9 @@ NetworkLocationProvider::NetworkRequestCallback network_request_callback, NetworkLocationProvider::NetworkResponseCallback network_response_callback); - LocationArbitrator(const LocationArbitrator&) = delete; - LocationArbitrator& operator=(const LocationArbitrator&) = delete; - ~LocationArbitrator() override; + LocationProviderManager(const LocationProviderManager&) = delete; + LocationProviderManager& operator=(const LocationProviderManager&) = delete; + ~LocationProviderManager() override; static GURL DefaultNetworkProviderURL(); bool HasPermissionBeenGrantedForTest() const; @@ -79,7 +79,7 @@ virtual base::Time GetTimeNow() const; private: - friend class TestingLocationArbitrator; + friend class TestingLocationProviderManager; // Provider will either be added to |providers_| or // deleted on error (e.g. it fails to start). @@ -89,7 +89,7 @@ // Tells all registered providers to start. // If |providers_| is empty, immediately provides // GeopositionErrorCode::kPositionUnavailable to the client via - // |arbitrator_update_callback_|. + // |location_update_callback_|. void DoStartProviders(); // Gets called when a provider has a new position. @@ -112,7 +112,7 @@ bool enable_high_accuracy_; bool is_permission_granted_ = false; bool is_running_ = false; // Tracks whether providers should be running. - LocationProvider::LocationProviderUpdateCallback arbitrator_update_callback_; + LocationProvider::LocationProviderUpdateCallback location_update_callback_; std::unique_ptr<PositionCache> position_cache_; // must outlive `providers_` std::vector<std::unique_ptr<LocationProvider>> providers_; // The provider which supplied the current |result_| @@ -139,4 +139,4 @@ } // namespace device -#endif // SERVICES_DEVICE_GEOLOCATION_LOCATION_ARBITRATOR_H_ +#endif // SERVICES_DEVICE_GEOLOCATION_LOCATION_PROVIDER_MANAGER_H_
diff --git a/services/device/geolocation/location_arbitrator_unittest.cc b/services/device/geolocation/location_provider_manager_unittest.cc similarity index 70% rename from services/device/geolocation/location_arbitrator_unittest.cc rename to services/device/geolocation/location_provider_manager_unittest.cc index 37cba7cd..bb66182a 100644 --- a/services/device/geolocation/location_arbitrator_unittest.cc +++ b/services/device/geolocation/location_provider_manager_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "services/device/geolocation/location_arbitrator.h" +#include "services/device/geolocation/location_provider_manager.h" #include <memory> #include <utility> @@ -78,21 +78,22 @@ } // namespace -class TestingLocationArbitrator : public LocationArbitrator { +class TestingLocationProviderManager : public LocationProviderManager { public: - TestingLocationArbitrator( + TestingLocationProviderManager( LocationProviderUpdateCallback callback, const CustomLocationProviderCallback& provider_getter, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, bool should_use_system_location_provider = false) - : LocationArbitrator(std::move(provider_getter), - /*geolocation_system_permission_manager=*/nullptr, - std::move(url_loader_factory), - std::string() /* api_key */, - std::make_unique<FakePositionCache>(), - /*internals_updated_closure=*/base::DoNothing(), - /*network_request_callback=*/base::DoNothing(), - /*network_response_callback=*/base::DoNothing()), + : LocationProviderManager( + std::move(provider_getter), + /*geolocation_system_permission_manager=*/nullptr, + std::move(url_loader_factory), + std::string() /* api_key */, + std::make_unique<FakePositionCache>(), + /*internals_updated_closure=*/base::DoNothing(), + /*network_request_callback=*/base::DoNothing(), + /*network_response_callback=*/base::DoNothing()), should_use_system_location_provider_( should_use_system_location_provider) { SetUpdateCallback(callback); @@ -128,24 +129,25 @@ bool should_use_system_location_provider_; }; -class GeolocationLocationArbitratorTest : public testing::Test { +class GeolocationLocationProviderManagerTest : public testing::Test { protected: - GeolocationLocationArbitratorTest() + GeolocationLocationProviderManagerTest() : observer_(new MockLocationObserver), url_loader_factory_(new network::TestSharedURLLoaderFactory()) {} - // Initializes |arbitrator_| with the specified |url_loader_factory|, which - // may be null. - void InitializeArbitrator( + // Initializes |location_provider_manager_| with the specified + // |url_loader_factory|, which may be null. + void InitializeLocationProviderManager( CustomLocationProviderCallback provider_getter, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, bool should_use_system_location_provider = false) { const LocationProvider::LocationProviderUpdateCallback callback = base::BindRepeating(&MockLocationObserver::OnLocationUpdate, base::Unretained(observer_.get())); - arbitrator_ = std::make_unique<TestingLocationArbitrator>( - callback, std::move(provider_getter), std::move(url_loader_factory), - should_use_system_location_provider); + location_provider_manager_ = + std::make_unique<TestingLocationProviderManager>( + callback, std::move(provider_getter), std::move(url_loader_factory), + should_use_system_location_provider); } // testing::Test @@ -166,40 +168,42 @@ base::TimeDelta SwitchOnFreshnessCliff() { // Add 1, to ensure it meets any greater-than test. - return LocationArbitrator::kFixStaleTimeoutTimeDelta + + return LocationProviderManager::kFixStaleTimeoutTimeDelta + base::Milliseconds(1); } FakeLocationProvider* network_location_provider() { - return arbitrator_->network_location_provider_.get(); + return location_provider_manager_->network_location_provider_.get(); } FakeLocationProvider* system_location_provider() { - return arbitrator_->system_location_provider_; + return location_provider_manager_->system_location_provider_; } const std::unique_ptr<MockLocationObserver> observer_; - std::unique_ptr<TestingLocationArbitrator> arbitrator_; + std::unique_ptr<TestingLocationProviderManager> location_provider_manager_; base::test::TaskEnvironment task_environment_; scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; }; // Basic test of the text fixture. -TEST_F(GeolocationLocationArbitratorTest, CreateDestroy) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), nullptr); - EXPECT_TRUE(arbitrator_); - EXPECT_EQ(arbitrator_->state(), +TEST_F(GeolocationLocationProviderManagerTest, CreateDestroy) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + nullptr); + EXPECT_TRUE(location_provider_manager_); + EXPECT_EQ(location_provider_manager_->state(), mojom::GeolocationDiagnostics::ProviderState::kStopped); - arbitrator_.reset(); + location_provider_manager_.reset(); SUCCEED(); } // Tests OnPermissionGranted(). -TEST_F(GeolocationLocationArbitratorTest, OnPermissionGranted) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), nullptr); - EXPECT_FALSE(arbitrator_->HasPermissionBeenGrantedForTest()); - arbitrator_->OnPermissionGranted(); - EXPECT_TRUE(arbitrator_->HasPermissionBeenGrantedForTest()); +TEST_F(GeolocationLocationProviderManagerTest, OnPermissionGranted) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + nullptr); + EXPECT_FALSE(location_provider_manager_->HasPermissionBeenGrantedForTest()); + location_provider_manager_->OnPermissionGranted(); + EXPECT_TRUE(location_provider_manager_->HasPermissionBeenGrantedForTest()); // Can't check the provider has been notified without going through the // motions to create the provider (see next test). EXPECT_FALSE(network_location_provider()); @@ -207,14 +211,14 @@ } // Tests basic operation (single position fix) network location provider. -TEST_F(GeolocationLocationArbitratorTest, NormalUsageNetwork) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), - url_loader_factory_); - ASSERT_TRUE(arbitrator_); +TEST_F(GeolocationLocationProviderManagerTest, NormalUsageNetwork) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + url_loader_factory_); + ASSERT_TRUE(location_provider_manager_); EXPECT_FALSE(network_location_provider()); EXPECT_FALSE(system_location_provider()); - arbitrator_->StartProvider(false); + location_provider_manager_->StartProvider(false); ASSERT_TRUE(network_location_provider()); EXPECT_FALSE(system_location_provider()); @@ -233,21 +237,21 @@ } EXPECT_FALSE(network_location_provider()->is_permission_granted()); - EXPECT_FALSE(arbitrator_->HasPermissionBeenGrantedForTest()); - arbitrator_->OnPermissionGranted(); - EXPECT_TRUE(arbitrator_->HasPermissionBeenGrantedForTest()); + EXPECT_FALSE(location_provider_manager_->HasPermissionBeenGrantedForTest()); + location_provider_manager_->OnPermissionGranted(); + EXPECT_TRUE(location_provider_manager_->HasPermissionBeenGrantedForTest()); EXPECT_TRUE(network_location_provider()->is_permission_granted()); } // Tests basic operation (single position fix) system location provider. -TEST_F(GeolocationLocationArbitratorTest, NormalUsageSystem) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), - url_loader_factory_, true); - ASSERT_TRUE(arbitrator_); +TEST_F(GeolocationLocationProviderManagerTest, NormalUsageSystem) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + url_loader_factory_, true); + ASSERT_TRUE(location_provider_manager_); EXPECT_FALSE(network_location_provider()); EXPECT_FALSE(system_location_provider()); - arbitrator_->StartProvider(false); + location_provider_manager_->StartProvider(false); EXPECT_FALSE(network_location_provider()); ASSERT_TRUE(system_location_provider()); @@ -266,28 +270,28 @@ } EXPECT_FALSE(system_location_provider()->is_permission_granted()); - EXPECT_FALSE(arbitrator_->HasPermissionBeenGrantedForTest()); - arbitrator_->OnPermissionGranted(); - EXPECT_TRUE(arbitrator_->HasPermissionBeenGrantedForTest()); + EXPECT_FALSE(location_provider_manager_->HasPermissionBeenGrantedForTest()); + location_provider_manager_->OnPermissionGranted(); + EXPECT_TRUE(location_provider_manager_->HasPermissionBeenGrantedForTest()); EXPECT_TRUE(system_location_provider()->is_permission_granted()); } // Tests basic operation (single position fix) with no network location // provider, no system location provider and a custom system location provider. -TEST_F(GeolocationLocationArbitratorTest, CustomSystemProviderOnly) { +TEST_F(GeolocationLocationProviderManagerTest, CustomSystemProviderOnly) { FakeLocationProvider* fake_location_provider = nullptr; - InitializeArbitrator( + InitializeLocationProviderManager( base::BindLambdaForTesting([&]() -> std::unique_ptr<LocationProvider> { auto provider = std::make_unique<FakeLocationProvider>(); fake_location_provider = provider.get(); return provider; }), nullptr, true); - ASSERT_TRUE(arbitrator_); + ASSERT_TRUE(location_provider_manager_); EXPECT_FALSE(network_location_provider()); EXPECT_FALSE(system_location_provider()); - arbitrator_->StartProvider(false); + location_provider_manager_->StartProvider(false); EXPECT_FALSE(network_location_provider()); EXPECT_FALSE(system_location_provider()); @@ -305,18 +309,18 @@ } EXPECT_FALSE(fake_location_provider->is_permission_granted()); - EXPECT_FALSE(arbitrator_->HasPermissionBeenGrantedForTest()); - arbitrator_->OnPermissionGranted(); - EXPECT_TRUE(arbitrator_->HasPermissionBeenGrantedForTest()); + EXPECT_FALSE(location_provider_manager_->HasPermissionBeenGrantedForTest()); + location_provider_manager_->OnPermissionGranted(); + EXPECT_TRUE(location_provider_manager_->HasPermissionBeenGrantedForTest()); EXPECT_TRUE(fake_location_provider->is_permission_granted()); } // Tests flipping from Low to High accuracy mode as requested by a location // observer. -TEST_F(GeolocationLocationArbitratorTest, SetObserverOptions) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), - url_loader_factory_); - arbitrator_->StartProvider(false); +TEST_F(GeolocationLocationProviderManagerTest, SetObserverOptions) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + url_loader_factory_); + location_provider_manager_->StartProvider(false); ASSERT_TRUE(network_location_provider()); EXPECT_FALSE(system_location_provider()); EXPECT_EQ(mojom::GeolocationDiagnostics::ProviderState::kLowAccuracy, @@ -324,17 +328,17 @@ SetReferencePosition(network_location_provider()); EXPECT_EQ(mojom::GeolocationDiagnostics::ProviderState::kLowAccuracy, network_location_provider()->state()); - arbitrator_->StartProvider(true); + location_provider_manager_->StartProvider(true); EXPECT_EQ(mojom::GeolocationDiagnostics::ProviderState::kHighAccuracy, network_location_provider()->state()); } -// Verifies that the arbitrator doesn't retain pointers to old providers after -// it has stopped and then restarted (crbug.com/240956). -TEST_F(GeolocationLocationArbitratorTest, TwoOneShotsIsNewPositionBetter) { - InitializeArbitrator(base::BindRepeating(&NullLocationProvider), - url_loader_factory_); - arbitrator_->StartProvider(false); +// Verifies that the location_provider_manager_ doesn't retain pointers to old +// providers after it has stopped and then restarted (crbug.com/240956). +TEST_F(GeolocationLocationProviderManagerTest, TwoOneShotsIsNewPositionBetter) { + InitializeLocationProviderManager(base::BindRepeating(&NullLocationProvider), + url_loader_factory_); + location_provider_manager_->StartProvider(false); ASSERT_TRUE(network_location_provider()); EXPECT_FALSE(system_location_provider()); @@ -343,14 +347,14 @@ CheckLastPositionInfo(3, 139, 100); // Restart providers to simulate a one-shot request. - arbitrator_->StopProvider(); + location_provider_manager_->StopProvider(); // To test 240956, perform a throwaway alloc. // This convinces the allocator to put the providers in a new memory location. std::unique_ptr<FakeLocationProvider> dummy_provider( new FakeLocationProvider); - arbitrator_->StartProvider(false); + location_provider_manager_->StartProvider(false); // Advance the time a short while to simulate successive calls. AdvanceTimeNow(base::Milliseconds(5));
diff --git a/services/device/geolocation/network_location_provider_unittest.cc b/services/device/geolocation/network_location_provider_unittest.cc index b8c9fc4..a1e11fc 100644 --- a/services/device/geolocation/network_location_provider_unittest.cc +++ b/services/device/geolocation/network_location_provider_unittest.cc
@@ -29,7 +29,6 @@ #include "build/build_config.h" #include "net/base/net_errors.h" #include "services/device/geolocation/fake_position_cache.h" -#include "services/device/geolocation/location_arbitrator.h" #include "services/device/geolocation/mock_wifi_data_provider.h" #include "services/device/geolocation/wifi_data_provider.h" #include "services/device/public/cpp/device_features.h"
diff --git a/services/device/geolocation/network_location_request.cc b/services/device/geolocation/network_location_request.cc index 30a7c15..3f6c053 100644 --- a/services/device/geolocation/network_location_request.cc +++ b/services/device/geolocation/network_location_request.cc
@@ -33,7 +33,6 @@ #include "net/base/net_errors.h" #include "net/http/http_status_code.h" #include "net/traffic_annotation/network_traffic_annotation.h" -#include "services/device/geolocation/location_arbitrator.h" #include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/geolocation/geoposition.h" #include "services/device/public/mojom/geolocation_internals.mojom.h"
diff --git a/services/device/public/cpp/test/fake_serial_port_manager.cc b/services/device/public/cpp/test/fake_serial_port_manager.cc index 8b88e295..e76c697 100644 --- a/services/device/public/cpp/test/fake_serial_port_manager.cc +++ b/services/device/public/cpp/test/fake_serial_port_manager.cc
@@ -53,7 +53,7 @@ NOTREACHED_IN_MIGRATION(); } - void Drain(DrainCallback callback) override { NOTREACHED(); } + void Drain(DrainCallback callback) override { NOTREACHED_IN_MIGRATION(); } void GetControlSignals(GetControlSignalsCallback callback) override { NOTREACHED_IN_MIGRATION(); @@ -69,7 +69,9 @@ NOTREACHED_IN_MIGRATION(); } - void GetPortInfo(GetPortInfoCallback callback) override { NOTREACHED(); } + void GetPortInfo(GetPortInfoCallback callback) override { + NOTREACHED_IN_MIGRATION(); + } void Close(bool flush, CloseCallback callback) override { std::move(callback).Run();
diff --git a/services/device/usb/mojo/device_impl_unittest.cc b/services/device/usb/mojo/device_impl_unittest.cc index 2d401f7..002e4b3 100644 --- a/services/device/usb/mojo/device_impl_unittest.cc +++ b/services/device/usb/mojo/device_impl_unittest.cc
@@ -580,7 +580,7 @@ EXPECT_CALL(device_client, OnDeviceClosed()).Times(0); device->Open(base::BindOnce( - [](mojom::UsbOpenDeviceResultPtr result) { NOTREACHED(); })); + [](mojom::UsbOpenDeviceResultPtr result) { NOTREACHED_IN_MIGRATION(); })); device.reset(); base::RunLoop().RunUntilIdle();
diff --git a/services/network/proxy_auto_config_library_unittest.cc b/services/network/proxy_auto_config_library_unittest.cc index e85d2499..484701b 100644 --- a/services/network/proxy_auto_config_library_unittest.cc +++ b/services/network/proxy_auto_config_library_unittest.cc
@@ -998,7 +998,7 @@ mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote; // NOTREACHED() because the request below should never complete. MockClient client(remote.InitWithNewPipeAndPassReceiver(), - base::BindOnce([]() { NOTREACHED(); })); + base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); impl_->AddRequest(std::move(remote)); // Once all the tasks are run, `impl_` is guaranteed to be deleted. task_environment_.RunUntilIdle(); @@ -1108,9 +1108,9 @@ // This second client will be disconnected as MyIpAddressImpl runs and should // never receive results. mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote2; - std::unique_ptr<MockClient> client2 = - std::make_unique<MockClient>(remote2.InitWithNewPipeAndPassReceiver(), - base::BindOnce([]() { NOTREACHED(); })); + std::unique_ptr<MockClient> client2 = std::make_unique<MockClient>( + remote2.InitWithNewPipeAndPassReceiver(), + base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); // Post a task that deletes |client2|. base::SequencedTaskRunner::GetCurrentDefault()->PostTask( @@ -1156,16 +1156,16 @@ impl_->SetHostResolverProcForTest(host_resolver_proc_); mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote1; - std::unique_ptr<MockClient> client1 = - std::make_unique<MockClient>(remote1.InitWithNewPipeAndPassReceiver(), - base::BindOnce([]() { NOTREACHED(); })); + std::unique_ptr<MockClient> client1 = std::make_unique<MockClient>( + remote1.InitWithNewPipeAndPassReceiver(), + base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); // This second client will be disconnected as MyIpAddressImpl runs and should // never receive results. mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote2; - std::unique_ptr<MockClient> client2 = - std::make_unique<MockClient>(remote2.InitWithNewPipeAndPassReceiver(), - base::BindOnce([]() { NOTREACHED(); })); + std::unique_ptr<MockClient> client2 = std::make_unique<MockClient>( + remote2.InitWithNewPipeAndPassReceiver(), + base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); // Post a task that deletes |client1|. base::SequencedTaskRunner::GetCurrentDefault()->PostTask( @@ -1214,9 +1214,9 @@ // This client will be disconnected as MyIpAddressImpl runs and should never // receive results. mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote1; - std::unique_ptr<MockClient> client1 = - std::make_unique<MockClient>(remote1.InitWithNewPipeAndPassReceiver(), - base::BindOnce([]() { NOTREACHED(); })); + std::unique_ptr<MockClient> client1 = std::make_unique<MockClient>( + remote1.InitWithNewPipeAndPassReceiver(), + base::BindOnce([]() { NOTREACHED_IN_MIGRATION(); })); // This client will receive the results. mojo::PendingRemote<proxy_resolver::mojom::HostResolverRequestClient> remote2;
diff --git a/services/network/shared_dictionary/shared_dictionary_manager_on_disk_unittest.cc b/services/network/shared_dictionary/shared_dictionary_manager_on_disk_unittest.cc index 17f1a6f..b19d668 100644 --- a/services/network/shared_dictionary/shared_dictionary_manager_on_disk_unittest.cc +++ b/services/network/shared_dictionary/shared_dictionary_manager_on_disk_unittest.cc
@@ -309,7 +309,7 @@ // `dict2` shares the same RefCountedSharedDictionary with `dict1`. So // ReadAll() must synchronously return OK. EXPECT_EQ(net::OK, dict2->ReadAll(base::BindLambdaForTesting( - [&](int rv) { NOTREACHED(); }))); + [&](int rv) { NOTREACHED_IN_MIGRATION(); }))); // `dict2` shares the same IOBuffer with `dict1`. EXPECT_EQ(dict1->data(), dict2->data()); EXPECT_EQ(dict1->size(), dict2->size());
diff --git a/services/network/shared_dictionary/shared_dictionary_manager_unittest.cc b/services/network/shared_dictionary/shared_dictionary_manager_unittest.cc index b3bbff5..8c062b3f 100644 --- a/services/network/shared_dictionary/shared_dictionary_manager_unittest.cc +++ b/services/network/shared_dictionary/shared_dictionary_manager_unittest.cc
@@ -1125,8 +1125,8 @@ // Read and check the dictionary binary. switch (GetManagerType()) { case TestManagerType::kInMemory: { - EXPECT_EQ(net::OK, - dict->ReadAll(base::BindOnce([](int rv) { NOTREACHED(); }))); + EXPECT_EQ(net::OK, dict->ReadAll(base::BindOnce( + [](int rv) { NOTREACHED_IN_MIGRATION(); }))); break; } case TestManagerType::kOnDisk: {
diff --git a/services/network/shared_dictionary/shared_dictionary_on_disk_unittest.cc b/services/network/shared_dictionary/shared_dictionary_on_disk_unittest.cc index be7f953e..6d48b6a0 100644 --- a/services/network/shared_dictionary/shared_dictionary_on_disk_unittest.cc +++ b/services/network/shared_dictionary/shared_dictionary_on_disk_unittest.cc
@@ -91,7 +91,9 @@ auto dictionary = std::make_unique<SharedDictionaryOnDisk>( expected_size, hash, /*id*/ "", disk_cache_key_token, disk_cache.get(), - /*disk_cache_error_callback=*/base::BindOnce([]() { NOTREACHED(); })); + /*disk_cache_error_callback=*/base::BindOnce([]() { + NOTREACHED_IN_MIGRATION(); + })); EXPECT_EQ(expected_size, dictionary->size()); EXPECT_EQ(hash, dictionary->hash()); @@ -155,7 +157,9 @@ auto dictionary = std::make_unique<SharedDictionaryOnDisk>( expected_size, hash, /*id=*/"", disk_cache_key_token, disk_cache.get(), - /*disk_cache_error_callback=*/base::BindOnce([]() { NOTREACHED(); })); + /*disk_cache_error_callback=*/base::BindOnce([]() { + NOTREACHED_IN_MIGRATION(); + })); bool read_all_finished = false; EXPECT_EQ(net::ERR_IO_PENDING, @@ -213,7 +217,9 @@ auto dictionary = std::make_unique<SharedDictionaryOnDisk>( expected_size, hash, /*id=*/"", disk_cache_key_token, disk_cache.get(), - /*disk_cache_error_callback=*/base::BindOnce([]() { NOTREACHED(); })); + /*disk_cache_error_callback=*/base::BindOnce([]() { + NOTREACHED_IN_MIGRATION(); + })); bool read_all_finished = false; EXPECT_EQ(net::ERR_IO_PENDING, @@ -268,7 +274,9 @@ auto dictionary = std::make_unique<SharedDictionaryOnDisk>( expected_size, hash, /*id=*/"", disk_cache_key_token, disk_cache.get(), - /*disk_cache_error_callback=*/base::BindOnce([]() { NOTREACHED(); })); + /*disk_cache_error_callback=*/base::BindOnce([]() { + NOTREACHED_IN_MIGRATION(); + })); // ReadAll() synchronously returns OK. EXPECT_EQ(net::OK, dictionary->ReadAll(base::BindLambdaForTesting(
diff --git a/services/network/url_loader_unittest.cc b/services/network/url_loader_unittest.cc index 39b75da..7da65d6 100644 --- a/services/network/url_loader_unittest.cc +++ b/services/network/url_loader_unittest.cc
@@ -161,7 +161,8 @@ // this method, as URLLoaders don't expect to be alive after they invoke their // delete callback. URLLoader::DeleteCallback NeverInvokedDeleteLoaderCallback() { - return base::BindOnce([](URLLoader* /* loader*/) { NOTREACHED(); }); + return base::BindOnce( + [](URLLoader* /* loader*/) { NOTREACHED_IN_MIGRATION(); }); } constexpr char kTestAuthURL[] = "/auth-basic?password=PASS&realm=REALM";
diff --git a/services/service_manager/tests/connect/connect_unittest.cc b/services/service_manager/tests/connect/connect_unittest.cc index 788fb23..cd8b0d18 100644 --- a/services/service_manager/tests/connect/connect_unittest.cc +++ b/services/service_manager/tests/connect/connect_unittest.cc
@@ -458,7 +458,8 @@ base::RunLoop wait_for_error_loop; base::RunLoop wait_for_connect_loop; proxy.reset(); - target->CallOnNextBindInterface(base::BindOnce([] { NOTREACHED(); })); + target->CallOnNextBindInterface( + base::BindOnce([] { NOTREACHED_IN_MIGRATION(); })); connector()->Connect( specific_identity, proxy.BindNewPipeAndPassReceiver(), base::BindLambdaForTesting([&](mojom::ConnectResult result,
diff --git a/services/webnn/coreml/graph_builder.cc b/services/webnn/coreml/graph_builder.cc index bf73ee2..7fa31bb 100644 --- a/services/webnn/coreml/graph_builder.cc +++ b/services/webnn/coreml/graph_builder.cc
@@ -117,6 +117,7 @@ constexpr char kOpReshapeTypeName[] = "reshape"; constexpr char kOpSigmoidTypeName[] = "sigmoid"; constexpr char kOpSliceTypeName[] = "slice_by_size"; +constexpr char kOpSoftmaxTypeName[] = "softmax"; constexpr char kOpSoftplusTypeName[] = "softplus"; constexpr char kOpSoftsignTypeName[] = "softsign"; constexpr char kOpTanhTypeName[] = "tanh"; @@ -557,7 +558,12 @@ GraphBuilder::GraphBuilder(const mojom::GraphInfo& graph_info, base::FilePath ml_package_dir) : graph_info_(graph_info), - internal_operand_id_(graph_info_->id_to_operand_map.rbegin()->first + 1), + internal_operand_id_( + base::ranges::max_element( + graph_info_->id_to_operand_map, + {}, + [](const auto& id_operand) { return id_operand.first; }) + ->first), result_(std::make_unique<Result>(std::move(ml_package_dir))) {} GraphBuilder::~GraphBuilder() = default; @@ -734,6 +740,11 @@ RETURN_IF_ERROR(AddOperationForSlice(*operation->get_slice(), block)); break; } + case mojom::Operation::Tag::kSoftmax: { + RETURN_IF_ERROR( + AddOperationForSoftmax(*operation->get_softmax(), block)); + break; + } case mojom::Operation::Tag::kTranspose: { RETURN_IF_ERROR( AddOperationForTranspose(*operation->get_transpose(), block)); @@ -749,7 +760,6 @@ case mojom::Operation::Tag::kLstmCell: case mojom::Operation::Tag::kPad: case mojom::Operation::Tag::kPrelu: - case mojom::Operation::Tag::kSoftmax: case mojom::Operation::Tag::kSplit: case mojom::Operation::Tag::kTriangular: case mojom::Operation::Tag::kWhere: @@ -908,8 +918,9 @@ .second); if (operand.dimensions.empty()) { - uint64_t internal_operand_id = GenerateInternalOperandInfo( - OperandTypeToMILDataType(operand.data_type), {}); + ASSIGN_OR_RETURN(uint64_t internal_operand_id, + GenerateInternalOperandInfo( + OperandTypeToMILDataType(operand.data_type), {})); RETURN_IF_ERROR( AddOperationForReshape(input_id, internal_operand_id, block)); id_to_operand_info_map()[input_id].coreml_name = @@ -1293,8 +1304,9 @@ if (!operation.activation.is_null()) { const OperandInfo& output_operand = GetOperandInfo(operation.output_operand_id); - uint64_t internal_operand_id = GenerateInternalOperandInfo( - output_operand.mil_data_type, output_operand.dimensions); + ASSIGN_OR_RETURN(uint64_t internal_operand_id, + GenerateInternalOperandInfo(output_operand.mil_data_type, + output_operand.dimensions)); PopulateNamedValueType(internal_operand_id, *op->add_outputs()); @@ -1453,9 +1465,10 @@ if (is_logical_binary_operation) { // The output of logical binary ops need to be cast from a boolean // tensor that CoreML provides to an UInt8 that WebNN expects. - uint64_t internal_output_id = GenerateInternalOperandInfo( - CoreML::Specification::MILSpec::DataType::BOOL, - GetOperandInfo(output_operand_id).dimensions); + ASSIGN_OR_RETURN(uint64_t internal_output_id, + GenerateInternalOperandInfo( + CoreML::Specification::MILSpec::DataType::BOOL, + GetOperandInfo(output_operand_id).dimensions)); PopulateNamedValueType(internal_output_id, *op->add_outputs()); RETURN_IF_ERROR( @@ -1671,8 +1684,9 @@ operation.output_operand_id, block); } - uint64_t matmul_output = GenerateInternalOperandInfo( - a_operand_info.mil_data_type, matmul_dimensions); + ASSIGN_OR_RETURN(uint64_t matmul_output, + GenerateInternalOperandInfo(a_operand_info.mil_data_type, + matmul_dimensions)); RETURN_IF_ERROR(AddOperationForMatmul( operation.a_operand_id, operation.b_operand_id, operation.a_transpose, operation.b_transpose, matmul_output, block)); @@ -1689,11 +1703,14 @@ } uint64_t with_alpha_output = operation.output_operand_id; if (operation.c_operand_id) { - with_alpha_output = GenerateInternalOperandInfo( - a_operand_info.mil_data_type, matmul_dimensions); + ASSIGN_OR_RETURN(with_alpha_output, + GenerateInternalOperandInfo(a_operand_info.mil_data_type, + matmul_dimensions)); } - uint64_t alpha_operand_id = GenerateInternalOperandInfo( - CoreML::Specification::MILSpec::DataType::FLOAT32, /*dimensions=*/{}); + ASSIGN_OR_RETURN(uint64_t alpha_operand_id, + GenerateInternalOperandInfo( + CoreML::Specification::MILSpec::DataType::FLOAT32, + /*dimensions=*/{})); RETURN_IF_ERROR(AddInternalConstantWithValue( alpha_operand_id, CreateScalarImmediateValue(operation.alpha), block)); @@ -1721,13 +1738,16 @@ ops::kGemm, kOptionC, MILDataTypeToOperandType(c_operand_info.mil_data_type))); } - uint64_t beta_operand_id = GenerateInternalOperandInfo( - CoreML::Specification::MILSpec::DataType::FLOAT32, /*dimensions=*/{}); + ASSIGN_OR_RETURN(uint64_t beta_operand_id, + GenerateInternalOperandInfo( + CoreML::Specification::MILSpec::DataType::FLOAT32, + /*dimensions=*/{})); RETURN_IF_ERROR(AddInternalConstantWithValue( beta_operand_id, CreateScalarImmediateValue(operation.beta), block)); - uint64_t with_beta_output = GenerateInternalOperandInfo( - a_operand_info.mil_data_type, matmul_dimensions); + ASSIGN_OR_RETURN(uint64_t with_beta_output, + GenerateInternalOperandInfo(a_operand_info.mil_data_type, + matmul_dimensions)); RETURN_IF_ERROR(AddOperationForElementwiseBinary( c_operand_id, beta_operand_id, with_beta_output, mojom::ElementWiseBinary::Kind::kMul, block)); @@ -1784,8 +1804,9 @@ // emulated by: mul(x, hardsigmoid(x, alpha=1.0/6, beta=0.5)) const OperandInfo& input_operand_info = GetOperandInfo(operation.input_operand_id); - uint64_t hardsigmoid_output = GenerateInternalOperandInfo( - input_operand_info.mil_data_type, input_operand_info.dimensions); + ASSIGN_OR_RETURN(uint64_t hardsigmoid_output, + GenerateInternalOperandInfo(input_operand_info.mil_data_type, + input_operand_info.dimensions)); // TODO: crbug.com/339238741 - Use float16 when input type is float16. constexpr static float alpha = float(1.0 / 6); @@ -1880,13 +1901,16 @@ // Perform: mul(alpha, a) // // TODO: crbug.com/339238741 - Use float16 when the input is float16. - uint64_t alpha_operand_id = GenerateInternalOperandInfo( - CoreML::Specification::MILSpec::DataType::FLOAT32, /*dimensions=*/{}); + ASSIGN_OR_RETURN(uint64_t alpha_operand_id, + GenerateInternalOperandInfo( + CoreML::Specification::MILSpec::DataType::FLOAT32, + /*dimensions=*/{})); RETURN_IF_ERROR(AddInternalConstantWithValue( alpha_operand_id, CreateScalarImmediateValue(operation.alpha), block)); - uint64_t mul_output = GenerateInternalOperandInfo( - input_operand_info.mil_data_type, input_operand_info.dimensions); + ASSIGN_OR_RETURN(uint64_t mul_output, + GenerateInternalOperandInfo(input_operand_info.mil_data_type, + input_operand_info.dimensions)); RETURN_IF_ERROR(AddOperationForElementwiseBinary( /*lhs_operand_id=*/operation.input_operand_id, /*rhs_operand_id=*/alpha_operand_id, @@ -1896,8 +1920,10 @@ // Perform: add(mul_output, beta) // // TODO: crbug.com/339238741 - Use float16 when the input is float16. - uint64_t beta_operand_id = GenerateInternalOperandInfo( - CoreML::Specification::MILSpec::DataType::FLOAT32, /*dimensions=*/{}); + ASSIGN_OR_RETURN(uint64_t beta_operand_id, + GenerateInternalOperandInfo( + CoreML::Specification::MILSpec::DataType::FLOAT32, + /*dimensions=*/{})); RETURN_IF_ERROR(AddInternalConstantWithValue( beta_operand_id, CreateScalarImmediateValue(operation.beta), block)); @@ -2271,6 +2297,26 @@ return base::ok(); } +base::expected<void, mojom::ErrorPtr> GraphBuilder::AddOperationForSoftmax( + const mojom::Softmax& operation, + CoreML::Specification::MILSpec::Block& block) { + const OperandInfo& input_operand_info = + GetOperandInfo(operation.input_operand_id); + CHECK(kFloatDataTypes.contains(input_operand_info.mil_data_type)); + + CoreML::Specification::MILSpec::Operation* op = block.add_operations(); + op->set_type(kOpSoftmaxTypeName); + + SetInputWithName(*op->mutable_inputs(), kOpParamX, + input_operand_info.coreml_name); + + // TODO: crbug.com/341341298 - support axis parameter. + SetInputWithValue(*op->mutable_inputs(), kOpParamAxis, + CreateScalarImmediateValue<int32_t>(-1)); + PopulateNamedValueType(operation.output_operand_id, *op->add_outputs()); + return base::ok(); +} + base::expected<void, mojom::ErrorPtr> GraphBuilder::AddOperationForTranspose( const mojom::Transpose& operation, CoreML::Specification::MILSpec::Block& block) { @@ -2477,10 +2523,15 @@ return base::ok(); } -uint64_t GraphBuilder::GenerateInternalOperandInfo( +base::expected<uint64_t, mojom::ErrorPtr> +GraphBuilder::GenerateInternalOperandInfo( CoreML::Specification::MILSpec::DataType mil_data_type, base::span<const uint32_t> dimensions) { - uint64_t operand_id = internal_operand_id_++; + internal_operand_id_++; + if (!internal_operand_id_.IsValid()) { + return NewUnknownError("Number of operands in graph exceeds limit."); + } + uint64_t operand_id = internal_operand_id_.ValueOrDie(); // Prefix is added to internal operands generated for WebNN operations that // need to be decomposed into multiple CoreML operations. CHECK(id_to_operand_info_map()
diff --git a/services/webnn/coreml/graph_builder.h b/services/webnn/coreml/graph_builder.h index ea1a53b..a2a93ae 100644 --- a/services/webnn/coreml/graph_builder.h +++ b/services/webnn/coreml/graph_builder.h
@@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "base/memory/stack_allocated.h" +#include "base/numerics/checked_math.h" #include "base/types/expected.h" #include "services/webnn/public/mojom/webnn_error.mojom-forward.h" #include "services/webnn/public/mojom/webnn_graph.mojom.h" @@ -304,6 +305,9 @@ [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddOperationForSlice( const mojom::Slice& operation, CoreML::Specification::MILSpec::Block& block); + [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddOperationForSoftmax( + const mojom::Softmax& operation, + CoreML::Specification::MILSpec::Block& block); [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddOperationForTranspose( const mojom::Transpose& operation, CoreML::Specification::MILSpec::Block& block); @@ -367,7 +371,8 @@ SetupMlPackageDirStructure(); std::string GetCoreMLNameFromOperand(uint64_t operand_id); - [[nodiscard]] uint64_t GenerateInternalOperandInfo( + [[nodiscard]] base::expected<uint64_t, mojom::ErrorPtr> + GenerateInternalOperandInfo( CoreML::Specification::MILSpec::DataType mil_data_type, base::span<const uint32_t> dimensions); @@ -378,7 +383,7 @@ // Used to generate unique names for internal operands generated for WebNN // operations that need to be decomposed into multiple CoreML operations. - uint64_t internal_operand_id_; + base::CheckedNumeric<uint64_t> internal_operand_id_; CoreML::Specification::Model ml_model_; raw_ptr<CoreML::Specification::MILSpec::Program> program_;
diff --git a/services/webnn/tflite/graph_builder.cc b/services/webnn/tflite/graph_builder.cc index b75b755..debdd74e 100644 --- a/services/webnn/tflite/graph_builder.cc +++ b/services/webnn/tflite/graph_builder.cc
@@ -1072,9 +1072,11 @@ case mojom::ElementWiseUnary::Kind::kTan: CHECK(kFloatDataTypes.contains(input_data_type)); return SerializeTan(op); - case mojom::ElementWiseUnary::Kind::kErf: case mojom::ElementWiseUnary::Kind::kReciprocal: CHECK(kFloatDataTypes.contains(input_data_type)); + return SerializeReciprocal(op); + case mojom::ElementWiseUnary::Kind::kErf: + CHECK(kFloatDataTypes.contains(input_data_type)); return base::unexpected( base::StrCat({base::ToString(op.kind), " is not implemented."})); } @@ -1518,6 +1520,29 @@ builder_.CreateVector<int32_t>(op_outputs)); } +auto GraphBuilder::SerializeReciprocal( + const mojom::ElementWiseUnary& reciprocal) + -> base::expected<OperatorOffset, std::string> { + // Emulate the reciprocal operation whose calculation follows the expression + // `1 / x`. + // + // TODO(crbug.com/339654398): Support 16-bit float with dequantize operator + // https://www.tensorflow.org/mlir/tfl_ops#tfldequantize_tfldequantizeop. + const mojom::Operand& input_operand = GetOperand(reciprocal.input_operand_id); + if (input_operand.data_type == mojom::Operand::DataType::kFloat16) { + return base::unexpected("The 16-bit float data type isn't supported."); + } + CHECK_EQ(input_operand.data_type, mojom::Operand::DataType::kFloat32); + const int32_t constant_tensor_index = SerializeTensorWithBuffer<float>( + /*buffer=*/std::array<float, 1>{1.0}, + /*dimensions=*/{}); + + return SerializeBinaryOperation( + ::tflite::BuiltinOperator_DIV, constant_tensor_index, + operand_to_index_map_.at(reciprocal.input_operand_id), + operand_to_index_map_.at(reciprocal.output_operand_id)); +} + auto GraphBuilder::SerializeReduce(const mojom::Reduce& reduce) -> base::expected<OperatorOffset, std::string> { // Serialize the axes tensor to reduce input tensor.
diff --git a/services/webnn/tflite/graph_builder.h b/services/webnn/tflite/graph_builder.h index ab4929c4..750a569 100644 --- a/services/webnn/tflite/graph_builder.h +++ b/services/webnn/tflite/graph_builder.h
@@ -197,6 +197,8 @@ const mojom::Pool2d& pool2d); base::expected<OperatorOffset, std::string> SerializePrelu( const mojom::Prelu& prelu); + base::expected<OperatorOffset, std::string> SerializeReciprocal( + const mojom::ElementWiseUnary& reciprocal); base::expected<OperatorOffset, std::string> SerializeReduce( const mojom::Reduce& reduce); OperatorOffset SerializeRelu(const mojom::Relu& relu);
diff --git a/services/webnn/webnn_graph_impl_backend_test.cc b/services/webnn/webnn_graph_impl_backend_test.cc index 6534a57..ef75175 100644 --- a/services/webnn/webnn_graph_impl_backend_test.cc +++ b/services/webnn/webnn_graph_impl_backend_test.cc
@@ -359,6 +359,7 @@ "BuildAndComputeSingleOperatorRelu", "BuildAndComputeSingleOperatorSigmoid", "BuildAndComputeSliceOperator", + "BuildAndComputeSingleOperatorSoftmax", "BuildAndComputeSingleOperatorSoftsign", "BuildAndComputeSingleOperatorTanh", "BuildAndComputeSingleOperatorTranspose",
diff --git a/sql/error_delegate_util.cc b/sql/error_delegate_util.cc index 562b754..8c19fccca 100644 --- a/sql/error_delegate_util.cc +++ b/sql/error_delegate_util.cc
@@ -4,7 +4,7 @@ #include "sql/error_delegate_util.h" -#include <ostream> // Needed to compile NOTREACHED() with operator <<. +#include <ostream> // Needed to compile NOTREACHED_IN_MIGRATION() with operator <<. #include <string> #include "base/files/file_path.h"
diff --git a/sql/sqlite_result_code.cc b/sql/sqlite_result_code.cc index c6478006..aa342ec 100644 --- a/sql/sqlite_result_code.cc +++ b/sql/sqlite_result_code.cc
@@ -5,7 +5,7 @@ #include "sql/sqlite_result_code.h" #include <cstddef> -#include <ostream> // Needed to compile NOTREACHED() with operator <<. +#include <ostream> // Needed to compile NOTREACHED_IN_MIGRATION() with operator <<. #include <set> #include <string> #include <string_view>
diff --git a/storage/browser/file_system/recursive_operation_delegate_unittest.cc b/storage/browser/file_system/recursive_operation_delegate_unittest.cc index fce9e023..e7b1830 100644 --- a/storage/browser/file_system/recursive_operation_delegate_unittest.cc +++ b/storage/browser/file_system/recursive_operation_delegate_unittest.cc
@@ -54,7 +54,7 @@ const std::vector<LogEntry>& log_entries() const { return log_entries_; } // RecursiveOperationDelegate overrides. - void Run() override { NOTREACHED(); } + void Run() override { NOTREACHED_IN_MIGRATION(); } void RunRecursively() override { StartRecursiveOperation(root_, FileSystemOperation::ERROR_BEHAVIOR_ABORT,
diff --git a/styleguide/c++/c++.md b/styleguide/c++/c++.md index f6796da..617a258 100644 --- a/styleguide/c++/c++.md +++ b/styleguide/c++/c++.md
@@ -324,7 +324,7 @@ historically it was not supported on all platforms, and it does not seem to outperform #include guards even on platforms which do support it. -## CHECK(), DCHECK(), NOTREACHED_NORETURN() and NOTREACHED() +## CHECK(), DCHECK(), NOTREACHED_NORETURN() and NOTREACHED_IN_MIGRATION() Use the `CHECK()` family of macros to both document and verify invariants. * Exception: If the invariant is known to be too expensive to verify in
diff --git a/styleguide/c++/checks.md b/styleguide/c++/checks.md index 5fd5920..3d307ab 100644 --- a/styleguide/c++/checks.md +++ b/styleguide/c++/checks.md
@@ -1,4 +1,4 @@ -# CHECK(), DCHECK(), NOTREACHED_NORETURN() and NOTREACHED() +# CHECK(), DCHECK(), NOTREACHED_NORETURN() and NOTREACHED_IN_MIGRATION() `CHECK()`, `DCHECK()`, `NOTREACHED_NORETURN()` and `NOTREACHED()` are all used to ensure that invariants hold. They document (and verify) programmer
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index c45ba07..ad8a64e 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -10595,6 +10595,7 @@ { "args": [ "--avd-config=../../tools/android/avd/proto/android_v_google_apis_x64.textpb", + "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter", "--gs-results-bucket=chromium-result-details", "--recover-devices" ], @@ -10642,6 +10643,7 @@ { "args": [ "--avd-config=../../tools/android/avd/proto/android_v_google_apis_x64.textpb", + "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_15.content_unittests.filter", "--gs-results-bucket=chromium-result-details", "--recover-devices" ],
diff --git a/testing/buildbot/chromium.angle.json b/testing/buildbot/chromium.angle.json index 07ef80a..9bd605d 100644 --- a/testing/buildbot/chromium.angle.json +++ b/testing/buildbot/chromium.angle.json
@@ -687,7 +687,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -717,7 +717,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -758,7 +758,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -796,7 +796,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -836,7 +836,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -874,7 +874,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -913,7 +913,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -951,7 +951,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -988,7 +988,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false,
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 20fef546..700c61f6 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5487,9 +5487,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5499,8 +5499,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -5643,9 +5643,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5655,8 +5655,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 571c3c3..dd58288 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -19664,9 +19664,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19676,8 +19676,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -19820,9 +19820,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19832,8 +19832,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.dawn.json b/testing/buildbot/chromium.dawn.json index 152eaac..46f5c58 100644 --- a/testing/buildbot/chromium.dawn.json +++ b/testing/buildbot/chromium.dawn.json
@@ -6581,7 +6581,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6609,7 +6609,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6636,7 +6636,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6664,7 +6664,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6692,7 +6692,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6718,7 +6718,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6749,7 +6749,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6780,7 +6780,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6804,7 +6804,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6837,7 +6837,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6870,7 +6870,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6907,7 +6907,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6947,7 +6947,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -6981,7 +6981,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -7014,7 +7014,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -7053,7 +7053,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -7095,7 +7095,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -7625,357 +7625,23 @@ ] }, "Dawn Mac x64 Experimental Release (AMD)": { - "gtest_tests": [ - { - "args": [ - "--enable-implicit-device-sync", - "--use-gpu-in-tests", - "--exclusive-device-type-preference=discrete,integrated", - "--test-launcher-retry-limit=0", - "--test-launcher-batch-limit=512" - ], - "ci_only": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_implicit_device_sync_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_end2end_tests/" - }, - { - "args": [ - "--enable-toggles=skip_validation", - "--use-gpu-in-tests", - "--exclusive-device-type-preference=discrete,integrated", - "--test-launcher-retry-limit=0", - "--test-launcher-batch-limit=512" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_skip_validation_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_end2end_tests/" - }, - { - "args": [ - "--use-gpu-in-tests", - "--exclusive-device-type-preference=discrete,integrated", - "--test-launcher-retry-limit=0", - "--test-launcher-batch-limit=512" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_end2end_tests/" - }, - { - "args": [ - "--enable-backend-validation", - "--use-gpu-in-tests", - "--exclusive-device-type-preference=discrete,integrated", - "--test-launcher-retry-limit=0", - "--test-launcher-batch-limit=512" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_validation_layers_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_end2end_tests/" - }, - { - "args": [ - "--use-wire", - "--use-gpu-in-tests", - "--exclusive-device-type-preference=discrete,integrated", - "--test-launcher-retry-limit=0", - "--test-launcher-batch-limit=512" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dawn_end2end_wire_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_end2end_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_end2end_tests/" - }, - { - "args": [ - "--use-cmd-decoder=passthrough", - "--use-gl=angle", - "--use-gpu-in-tests" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_tests_passthrough", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--use-gpu-in-tests", - "--git-revision=${got_revision}" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_unittests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_unittests", - "test_id_prefix": "ninja://ui/gl:gl_unittests/" - } - ], "isolated_scripts": [ { "args": [ - "--override-steps=1", - "--gtest-benchmark-name=dawn_perf_tests", - "-v" - ], - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "dawn_perf_tests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dawn_perf_tests", - "test_id_prefix": "ninja://third_party/dawn/src/dawn/tests:dawn_perf_tests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_gpu_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_unittests", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_unittests/" - }, - { - "args": [ - "--flag-specific=webgpu", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11" - ], - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webgpu_blink_web_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "webgpu_blink_web_tests", - "test_id_prefix": "ninja://:webgpu_blink_web_tests/" - }, - { - "args": [ - "--flag-specific=webgpu-with-backend-validation", - "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11" - ], - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webgpu_blink_web_tests_with_backend_validation", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "webgpu_blink_web_tests", - "test_id_prefix": "ninja://:webgpu_blink_web_tests/" - }, - { - "args": [ - "webgpu_cts", + "noop_sleep", "--show-stdout", "--browser=release", "--passthrough", "-v", "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--enforce-browser-version", - "--jobs=4", - "--use-webgpu-power-preference=default-high-performance" + "--jobs=4" ], "merge": { "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "webgpu_cts_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, + "name": "noop_sleep_tests", "swarming": { "dimensions": { "cpu": "x86-64", @@ -7989,202 +7655,8 @@ "hard_timeout": 1800, "idempotent": false, "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 14 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgpu_cts", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", - "--enforce-browser-version", - "--enable-dawn-backend-validation", - "--jobs=4", - "--use-webgpu-power-preference=default-high-performance" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgpu_cts_with_validation_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 14 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "--flag-specific=webgpu-swiftshader", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11" - ], - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webgpu_swiftshader_blink_web_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "webgpu_blink_web_tests", - "test_id_prefix": "ninja://:webgpu_blink_web_tests/" - }, - { - "args": [ - "--flag-specific=webgpu-swiftshader-with-backend-validation", - "--timeout-ms=30000", - "--initialize-webgpu-adapter-at-startup-timeout-ms=60000", - "--platform=mac-mac11" - ], - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webgpu_swiftshader_blink_web_tests_with_backend_validation", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "webgpu_blink_web_tests", - "test_id_prefix": "ninja://:webgpu_blink_web_tests/" - }, - { - "args": [ - "webgpu_cts", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", - "--enforce-browser-version", - "--use-webgpu-adapter=swiftshader", - "--test-filter=*web_platform*", - "--jobs=4", - "--use-webgpu-power-preference=default-high-performance" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgpu_swiftshader_web_platform_cts_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgpu_cts", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", - "--enforce-browser-version", - "--use-webgpu-adapter=swiftshader", - "--test-filter=*web_platform*", - "--enable-dawn-backend-validation", - "--jobs=4", - "--use-webgpu-power-preference=default-high-performance" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgpu_swiftshader_web_platform_cts_with_validation_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, "test": "telemetry_gpu_integration_test", "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" } @@ -8247,7 +7719,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8275,7 +7747,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8302,7 +7774,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8330,7 +7802,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8358,7 +7830,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8384,7 +7856,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8415,7 +7887,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8446,7 +7918,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8470,7 +7942,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8503,7 +7975,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8536,7 +8008,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8573,7 +8045,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8613,7 +8085,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8647,7 +8119,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8680,7 +8152,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8719,7 +8191,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -8761,7 +8233,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800,
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index df86a74..0e54115 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -41840,9 +41840,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41851,8 +41851,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -41990,9 +41990,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42001,8 +42001,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -43339,9 +43339,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43351,8 +43351,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -43495,9 +43495,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43507,8 +43507,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -44820,9 +44820,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44831,8 +44831,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -44970,9 +44970,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44981,8 +44981,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index c7273757..8e32e13 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -12579,463 +12579,10 @@ ] }, "Mac FYI Experimental Retina Release (AMD)": { - "gtest_tests": [ - { - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_unittests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--use-cmd-decoder=passthrough", - "--use-gl=angle", - "--use-gpu-in-tests" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_tests_passthrough", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--use-gpu-in-tests", - "--git-revision=${got_revision}" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_unittests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_unittests", - "test_id_prefix": "ninja://ui/gl:gl_unittests/" - }, - { - "args": [ - "--use-gpu-in-tests" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gles2_conform_test", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gles2_conform_test", - "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gpu_unittests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "args": [ - "--gtest_filter=*Detection*", - "--use-gpu-in-tests" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "services_unittests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "args": [ - "--enable-gpu", - "--test-launcher-bot-mode", - "--test-launcher-jobs=1", - "--gtest_filter=TabCaptureApiPixelTest.EndToEnd*" - ], - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "tab_capture_end2end_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - } - ], "isolated_scripts": [ { "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=gl --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "context_lost_gl_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "context_lost_metal_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --enable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "context_lost_metal_passthrough_graphite_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "expected_color", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=gl --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "expected_color_pixel_gl_passthrough_ganesh_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "expected_color", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "expected_color_pixel_metal_passthrough_ganesh_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "expected_color", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --enable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "expected_color_pixel_metal_passthrough_graphite_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "gpu_process", + "noop_sleep", "--show-stdout", "--browser=release", "--passthrough", @@ -13048,761 +12595,7 @@ "merge": { "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "gpu_process_launch_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "hardware_accelerated_feature", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "hardware_accelerated_feature_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "info_collection", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", - "--enforce-browser-version", - "--expected-vendor-id", - "1002", - "--expected-device-id", - "67ef", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "info_collection_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=gl --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "pixel_skia_gold_gl_passthrough_ganesh_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "pixel_skia_gold_metal_passthrough_ganesh_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --enable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "pixel_skia_gold_metal_passthrough_graphite_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=gl --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "screenshot_sync_gl_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "screenshot_sync_metal_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --enable-features=SkiaGraphite", - "--enforce-browser-version", - "--dont-restore-color-profile-after-test", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "screenshot_sync_metal_passthrough_graphite_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "trace_test", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "trace_test", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webcodecs", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=gl --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webcodecs_gl_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webcodecs", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webcodecs_metal_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webcodecs", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle --use-angle=metal --enable-features=SkiaGraphite", - "--enforce-browser-version", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webcodecs_metal_passthrough_graphite_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl2_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--webgl-conformance-version=2.0.1", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_mac_runtimes.json", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl2_conformance_gl_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 20 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl2_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=metal --use-cmd-decoder=passthrough --enable-features=EGLDualGPURendering,ForceHighPerformanceGPUForWebGL,SkiaGraphite", - "--enforce-browser-version", - "--webgl-conformance-version=2.0.1", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_mac_runtimes.json", - "--enable-metal-debug-layers", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl2_conformance_metal_passthrough_graphite_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 20 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl1_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_mac_runtimes.json", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_gl_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl1_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=metal --use-cmd-decoder=passthrough --enable-features=EGLDualGPURendering,ForceHighPerformanceGPUForWebGL --disable-features=SkiaGraphite", - "--enforce-browser-version", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_mac_runtimes.json", - "--enable-metal-debug-layers", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_metal_passthrough_ganesh_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl1_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=metal --use-cmd-decoder=passthrough --enable-features=EGLDualGPURendering,ForceHighPerformanceGPUForWebGL,SkiaGraphite", - "--enforce-browser-version", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_mac_runtimes.json", - "--enable-metal-debug-layers", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_metal_passthrough_graphite_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "cpu": "x86-64", - "display_attached": "1", - "gpu": "1002:67ef", - "hidpi": "1", - "os": "Mac-14.4.1", - "pool": "chromium.tests.gpu" - }, - "expiration": 21600, - "hard_timeout": 1800, - "idempotent": false, - "io_timeout": 1800, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_integration_test", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl1_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=swiftshader --use-cmd-decoder=passthrough --force_high_performance_gpu", - "--enforce-browser-version", - "--test-filter=conformance/rendering/gl-drawelements.html", - "--jobs=4" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_swangle_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, + "name": "noop_sleep_tests", "swarming": { "containment_type": "AUTO", "dimensions": { @@ -17242,7 +16035,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17270,7 +16063,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17302,7 +16095,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17327,7 +16120,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17349,7 +16142,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17375,7 +16168,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17403,7 +16196,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17442,7 +16235,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17489,7 +16282,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17536,7 +16329,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17575,7 +16368,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17613,7 +16406,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17653,7 +16446,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17693,7 +16486,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17733,7 +16526,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17760,7 +16553,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17788,7 +16581,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17820,7 +16613,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17845,7 +16638,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17867,7 +16660,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17893,7 +16686,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17932,7 +16725,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -17979,7 +16772,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18017,7 +16810,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18055,7 +16848,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18097,7 +16890,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18144,7 +16937,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18183,7 +16976,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18221,7 +17014,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18260,7 +17053,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18288,7 +17081,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18316,7 +17109,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18348,7 +17141,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18373,7 +17166,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18395,7 +17188,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18421,7 +17214,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18449,7 +17242,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18488,7 +17281,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18526,7 +17319,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18573,7 +17366,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18620,7 +17413,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18658,7 +17451,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18696,7 +17489,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18743,7 +17536,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18790,7 +17583,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18829,7 +17622,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18868,7 +17661,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18906,7 +17699,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18944,7 +17737,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -18982,7 +17775,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -19022,7 +17815,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -19064,7 +17857,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -19104,7 +17897,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -19145,7 +17938,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800, @@ -19184,7 +17977,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "hard_timeout": 1800,
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index 5e66c17..0030277 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -2152,7 +2152,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2181,7 +2181,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2214,7 +2214,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2254,7 +2254,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2302,7 +2302,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2341,7 +2341,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2380,7 +2380,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2423,7 +2423,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2471,7 +2471,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2511,7 +2511,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2550,7 +2550,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2591,7 +2591,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2619,7 +2619,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2648,7 +2648,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2681,7 +2681,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2710,7 +2710,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2750,7 +2750,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2798,7 +2798,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2837,7 +2837,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2876,7 +2876,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2919,7 +2919,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -2967,7 +2967,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -3007,7 +3007,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -3046,7 +3046,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" }, @@ -3087,7 +3087,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu", "puppet_env": "production" },
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index f4860f6..a37d17ba 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -15763,12 +15763,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -15778,8 +15778,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": { @@ -15939,12 +15939,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 127.0.6484.0", + "description": "Run with ash-chrome version 127.0.6486.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -15954,8 +15954,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v127.0.6484.0", - "revision": "version:127.0.6484.0" + "location": "lacros_version_skew_tests_v127.0.6486.0", + "revision": "version:127.0.6486.0" } ], "dimensions": {
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index 2d7db34c..3ce5157 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -211,6 +211,7 @@ "//testing/buildbot/filters/android.emulator_12.content_shell_test_apk.filter", "//testing/buildbot/filters/android.emulator_12l.content_shell_test_apk.filter", "//testing/buildbot/filters/android.emulator_13.content_shell_test_apk.filter", + "//testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter", ] }
diff --git a/testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter b/testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter new file mode 100644 index 0000000..20824106 --- /dev/null +++ b/testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter
@@ -0,0 +1,32 @@ +# TODO(rnanjappan) : Create separate bugs for failing tests +-org.chromium.net.AndroidProxySelectorTest.* + +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarInputCopy +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarInputCut +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarInputPaste +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarPasswordCopy +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarPasswordCut +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarPasswordPaste +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarPlainTextCopy +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarPlainTextCut +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarTextAreaCopy +-org.chromium.content.browser.ContentTextSelectionTest.testSelectActionBarTextAreaCut + +-org.chromium.content.browser.input.ImeTest.testImeCopy +-org.chromium.content.browser.input.ImeTest.testImeCut +-org.chromium.content.browser.input.ImeTest.testImePaste +-org.chromium.content.browser.input.ImeTest.testKeyboardNotDismissedAfterCopySelection + +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testDeleteGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testDeleteRangeGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testInsertGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testJoinOrSplitGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testRemoveSpaceGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testSelectGesture +-org.chromium.content.browser.input.StylusGestureEndToEndTest.testSelectRangeGesture + +-org.chromium.content.browser.accessibility.WebContentsAccessibilityTest.testPerformAction_copy +-org.chromium.content.browser.accessibility.WebContentsAccessibilityTest.testPerformAction_cut +-org.chromium.content.browser.accessibility.WebContentsAccessibilityTest.testPerformAction_paste + +-org.chromium.net.NetworkChangeNotifierTest.testNetworkChangeNotifierJavaObservers \ No newline at end of file
diff --git a/testing/buildbot/filters/android.emulator_15.gwp_asan_unittests.filter b/testing/buildbot/filters/android.emulator_15.gwp_asan_unittests.filter index 07be196..1a14d0e9 100644 --- a/testing/buildbot/filters/android.emulator_15.gwp_asan_unittests.filter +++ b/testing/buildbot/filters/android.emulator_15.gwp_asan_unittests.filter
@@ -1,4 +1,4 @@ # crbug.com/328565730 +-CrashAnalyzerTest.StackTraceCollection -CrashAnalyzerTest.InternalError --LightweightDetectorAnalyzerTest.InternalError --LightweightDetectorAnalyzerTest.UseAfterFree \ No newline at end of file +-VaryLightweightDetectorMode/LightweightDetectorAnalyzerTest.* \ No newline at end of file
diff --git a/testing/buildbot/filters/android.emulator_15.unit_tests.filter b/testing/buildbot/filters/android.emulator_15.unit_tests.filter index db91dfa4..efd63f0f 100644 --- a/testing/buildbot/filters/android.emulator_15.unit_tests.filter +++ b/testing/buildbot/filters/android.emulator_15.unit_tests.filter
@@ -1,6 +1,6 @@ -SigninManagerAndroidTest.* -SigninManagerAndroidWithLocalUpmTest.* -ChromeBrowsingDataRemoverDelegateOriginTrialsTest.* - -ChromeBrowsingDataRemoverDelegateTest.AllTypesAreGettingDeleted -ChromeBrowsingDataRemoverDelegateTest.RemovePersistentIsolatedOrigins \ No newline at end of file +# TODO (rnanjappan) : Create separate bugs for failing tests +-SigninManagerAndroidTest.* +-SigninManagerAndroidWithLocalUpmTest.* +-ChromeBrowsingDataRemoverDelegateOriginTrialsTest.* +-ChromeBrowsingDataRemoverDelegateTest.AllTypesAreGettingDeleted +-ChromeBrowsingDataRemoverDelegateTest.RemovePersistentIsolatedOrigins \ No newline at end of file
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl index 9d121ee..e4216ee 100644 --- a/testing/buildbot/mixins.pyl +++ b/testing/buildbot/mixins.pyl
@@ -1018,7 +1018,7 @@ 'cpu': 'x86-64', 'gpu': '1002:67ef', 'hidpi': '1', - 'os': 'Mac-13.5|Mac-14.4.1', + 'os': 'Mac-14.4.1', 'pool': 'chromium.tests.gpu', 'display_attached': '1', },
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index cd5753af..657f309 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -2152,6 +2152,11 @@ '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_13.content_shell_test_apk.filter', ], }, + 'android-15-x64-fyi-rel': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_15.content_shell_test_apk.filter', + ], + }, # If you change this, make similar changes in android-x86-code-coverage below 'android-oreo-x86-rel': { 'swarming': { @@ -2200,6 +2205,11 @@ '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_14.content_unittests.filter', ], }, + 'android-15-x64-fyi-rel': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_15.content_unittests.filter', + ], + }, 'android-mte-arm64-rel': { 'args': [ '--test-launcher-filter-file=../../testing/buildbot/filters/android.mte.content_unittests.filter',
diff --git a/testing/buildbot/tryserver.chromium.mac.json b/testing/buildbot/tryserver.chromium.mac.json index bbac3e9..d64f8c1 100644 --- a/testing/buildbot/tryserver.chromium.mac.json +++ b/testing/buildbot/tryserver.chromium.mac.json
@@ -17,7 +17,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -81,7 +81,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -143,7 +143,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -226,7 +226,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -296,7 +296,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -375,7 +375,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -463,7 +463,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -542,7 +542,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -612,7 +612,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -686,7 +686,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -809,7 +809,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -897,7 +897,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -977,7 +977,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1049,7 +1049,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1120,7 +1120,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1226,7 +1226,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1332,7 +1332,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1402,7 +1402,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1475,7 +1475,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1551,7 +1551,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1626,7 +1626,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false, @@ -1699,7 +1699,7 @@ "display_attached": "1", "gpu": "1002:67ef", "hidpi": "1", - "os": "Mac-13.5|Mac-14.4.1", + "os": "Mac-14.4.1", "pool": "chromium.tests.gpu" }, "idempotent": false,
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index bccde7c0..189bf2b 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -267,16 +267,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 127.0.6484.0', + 'description': 'Run with ash-chrome version 127.0.6486.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6484.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v127.0.6486.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v127.0.6484.0', - 'revision': 'version:127.0.6484.0', + 'location': 'lacros_version_skew_tests_v127.0.6486.0', + 'revision': 'version:127.0.6486.0', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 50558c7..ab2ba691 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2642,9 +2642,7 @@ # the gpu_noop_sleep_telemetry_test test should be used. Otherwise, this # should have the same test_suites as 'Dawn Mac x64 Release (AMD)'. 'test_suites': { - 'gpu_telemetry_tests': 'gpu_dawn_telemetry_tests', - 'gtest_tests': 'gpu_dawn_integration_gtests_passthrough', - 'isolated_scripts': 'gpu_dawn_isolated_scripts', + 'gpu_telemetry_tests': 'gpu_noop_sleep_telemetry_test', }, }, 'Dawn Mac x64 Experimental Release (Intel)': { @@ -4372,8 +4370,7 @@ # should have the combination of test_suites as 'Mac FYI Retina Release (AMD)' # and 'Mac Retina Release (AMD)'. 'test_suites': { - 'gtest_tests': 'gpu_fyi_mac_release_gtests', - 'gpu_telemetry_tests': 'gpu_fyi_only_mac_release_telemetry_tests', + 'gpu_telemetry_tests': 'gpu_noop_sleep_telemetry_test', }, }, 'Mac FYI Experimental Retina Release (Apple M2)': {
diff --git a/testing/libfuzzer/proto/skia_image_filter_proto_converter.cc b/testing/libfuzzer/proto/skia_image_filter_proto_converter.cc index 59f0341..ec6574c 100644 --- a/testing/libfuzzer/proto/skia_image_filter_proto_converter.cc +++ b/testing/libfuzzer/proto/skia_image_filter_proto_converter.cc
@@ -2117,7 +2117,9 @@ msg, field_descriptor)); break; } - default: { NOTREACHED(); } + default: { + NOTREACHED_IN_MIGRATION(); + } } continue; // Skip field if it is optional and it is unset.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 9dda856..938c4f37 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -4724,6 +4724,27 @@ ] } ], + "ConcurrentViewTransitionsSPA": [ + { + "platforms": [ + "android_webview", + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "ConcurrentViewTransitionsSPA" + ] + } + ] + } + ], "ConditionalImageResize": [ { "platforms": [ @@ -8711,6 +8732,21 @@ ] } ], + "GlobalVaapiLock": [ + { + "platforms": [ + "chromeos" + ], + "experiments": [ + { + "name": "Disabled", + "disable_features": [ + "GlobalVaapiLock" + ] + } + ] + } + ], "GoogleLensDesktopContentMenuTranslate": [ { "platforms": [ @@ -13804,6 +13840,27 @@ ] } ], + "PMProcessPriorityPolicy": [ + { + "platforms": [ + "android", + "android_webview", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "PMProcessPriorityPolicy" + ] + } + ] + } + ], "PageAllocatorRetryOnCommitFailure": [ { "platforms": [ @@ -16053,6 +16110,29 @@ ] } ], + "ProtectedAudienceMultiThreadedSellerWorklet": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "TwoThreads", + "params": { + "seller_worklet_thread_pool_size": "2" + }, + "enable_features": [ + "FledgeSellerWorkletThreadPool" + ] + } + ] + } + ], "ProtectedAudienceScoreAdRenderSize": [ { "platforms": [ @@ -16117,26 +16197,6 @@ ] } ], - "ProtectedAudiencesEnableDeprecatedRenderURLReplacements": [ - { - "platforms": [ - "android", - "chromeos", - "chromeos_lacros", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "FledgeDeprecatedRenderURLReplacements" - ] - } - ] - } - ], "ProtectedAudiencesHeaderDirectFromSellerSignalsStudy": [ { "platforms": [ @@ -17254,9 +17314,8 @@ ], "experiments": [ { - "name": "EnabledBoth", + "name": "Enabled", "enable_features": [ - "PMProcessPriorityPolicy", "RunPerformanceManagerOnMainThreadSync" ] } @@ -20202,7 +20261,6 @@ { "name": "Enabled", "params": { - "on_device_must_use_safety_model": "false", "on_device_retract_unsafe_content": "false", "on_device_text_safety_token_interval": "10" },
diff --git a/third_party/angle b/third_party/angle index 8f6b295..a00babd 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 8f6b295aac73fc2c6a2954778b6c701b9805ebbd +Subproject commit a00babd8a64d4e7b983cdb450528c7f8ba70596f
diff --git a/third_party/blink/common/crash_helpers.cc b/third_party/blink/common/crash_helpers.cc index 8b25478..0377439 100644 --- a/third_party/blink/common/crash_helpers.cc +++ b/third_party/blink/common/crash_helpers.cc
@@ -11,7 +11,7 @@ namespace internal { NOINLINE void CrashIntentionally() { - // NOTE(shess): Crash directly rather than using NOTREACHED() so + // NOTE(shess): Crash directly rather than using NOTREACHED_IN_MIGRATION() so // that the signature is easier to triage in crash reports. // // Linker's ICF feature may merge this function with other functions with the
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 4ed959f..c48ed03 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -1847,6 +1847,10 @@ "Prerender2EarlyDocumentLifecycleUpdate", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kPrerender2NoVarySearch, + "Prerender2NoVarySearch", + base::FEATURE_DISABLED_BY_DEFAULT); + // Enable limiting previews loading hints to specific resource types. BASE_FEATURE(kPreviewsResourceLoadingHintsSpecificResourceTypes, "PreviewsResourceLoadingHintsSpecificResourceTypes",
diff --git a/third_party/blink/public/blink_resources.grd b/third_party/blink/public/blink_resources.grd index b36fe3cf..e1d09b9 100644 --- a/third_party/blink/public/blink_resources.grd +++ b/third_party/blink/public/blink_resources.grd
@@ -31,7 +31,6 @@ <include name="IDR_UASTYLE_FULLSCREEN_CSS" file="../renderer/core/css/fullscreen.css" type="BINDATA" compress="brotli"/> <include name="IDR_UASTYLE_TRANSITION_CSS" file="../renderer/core/css/transition.css" type="BINDATA" compress="brotli"/> <include name="IDR_UASTYLE_TRANSITION_ANIMATIONS_CSS" file="../renderer/core/css/transition_animations.css" type="BINDATA" compress="brotli"/> - <include name="IDR_UASTYLE_AUTO_SIZES_CSS" file="../renderer/core/css/auto_sizes.css" type="BINDATA" compress="brotli"/> <include name="IDR_DOCUMENTXMLTREEVIEWER_CSS" file="../renderer/core/xml/DocumentXMLTreeViewer.css" type="BINDATA" compress="brotli"/> <include name="IDR_DOCUMENTXMLTREEVIEWER_JS" file="../renderer/core/xml/DocumentXMLTreeViewer.js" type="BINDATA" compress="brotli"/> <include name="IDR_VALIDATION_BUBBLE_ICON" file="../renderer/core/html/forms/resources/input_alert.svg" type="BINDATA" compress="brotli"/>
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index a41afcd..01915db9 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -1191,6 +1191,11 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( kPrerender2EarlyDocumentLifecycleUpdate); +// Prerender2 support for No-Vary-Search header. Enables prerender matching +// at navigation time using non-exact URL matching based on the prerender +// No-Vary-Search header. +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2NoVarySearch); + // Enables to run prerendering for new tabs (e.g., target="_blank"). // See https://crbug.com/1350676. BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrerender2InNewTab);
diff --git a/third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom b/third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom index 9dedc21..053224b8 100644 --- a/third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom +++ b/third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom
@@ -23,15 +23,15 @@ kOversizedImages = 6, // Controls the layout size of intrinsically sized images and videos. When // disabled, default size (300 x 150) is used to prevent relayout. - kUnsizedMedia = 7, + // kUnsizedMedia = 7, // Removed. // Restricts the usage of layout-causing animations in a document. - kLayoutAnimations = 8, + // kLayoutAnimations = 8, // Removed. // Controls the ability of the document to use several dynamic markup API // which interfere with document's input stream (document.write(), // document.close(), etc.). - kDocumentWrite = 9, + // kDocumentWrite = 9, // Removed. // Controls whether synchronous script elements will run. - kSyncScript = 10, + // kSyncScript = 10, // Removed. // Controls whether or not the JS Self-Profiling API is enabled. kJSProfiling = 11, // Controls use of synchronous XMLHTTPRequest API.
diff --git a/third_party/blink/public/platform/scheduler/test/web_fake_thread_scheduler.h b/third_party/blink/public/platform/scheduler/test/web_fake_thread_scheduler.h index 74dd16e6..9af605e 100644 --- a/third_party/blink/public/platform/scheduler/test/web_fake_thread_scheduler.h +++ b/third_party/blink/public/platform/scheduler/test/web_fake_thread_scheduler.h
@@ -21,7 +21,6 @@ // RendererScheduler implementation. std::unique_ptr<MainThread> CreateMainThread() override; - scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner() override; std::unique_ptr<WebAgentGroupScheduler> CreateWebAgentGroupScheduler() override; void SetRendererHidden(bool hidden) override;
diff --git a/third_party/blink/public/platform/scheduler/test/web_mock_thread_scheduler.h b/third_party/blink/public/platform/scheduler/test/web_mock_thread_scheduler.h index 253c479..d630871 100644 --- a/third_party/blink/public/platform/scheduler/test/web_mock_thread_scheduler.h +++ b/third_party/blink/public/platform/scheduler/test/web_mock_thread_scheduler.h
@@ -30,8 +30,6 @@ scoped_refptr<base::SingleThreadTaskRunner>()); MOCK_METHOD0(DeprecatedDefaultTaskRunner, scoped_refptr<base::SingleThreadTaskRunner>()); - MOCK_METHOD0(CompositorTaskRunner, - scoped_refptr<base::SingleThreadTaskRunner>()); MOCK_METHOD0(InputTaskRunner, scoped_refptr<base::SingleThreadTaskRunner>()); MOCK_METHOD0(LoadingTaskRunner, scoped_refptr<base::SingleThreadTaskRunner>());
diff --git a/third_party/blink/public/platform/scheduler/web_thread_scheduler.h b/third_party/blink/public/platform/scheduler/web_thread_scheduler.h index b51540b..daa595e 100644 --- a/third_party/blink/public/platform/scheduler/web_thread_scheduler.h +++ b/third_party/blink/public/platform/scheduler/web_thread_scheduler.h
@@ -50,9 +50,6 @@ // Returns main thread scheduler for the main thread of the current process. static WebThreadScheduler& MainThreadScheduler(); - // Returns the compositor task runner. - virtual scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner(); - // Returns a default task runner. This is basically same as the default task // runner, but is explicitly allowed to run JavaScript. For the detail, see // the comment at blink::ThreadScheduler::DeprecatedDefaultTaskRunner.
diff --git a/third_party/blink/renderer/bindings/core/v8/async_iterable.h b/third_party/blink/renderer/bindings/core/v8/async_iterable.h index 10f598a..00d9943 100644 --- a/third_party/blink/renderer/bindings/core/v8/async_iterable.h +++ b/third_party/blink/renderer/bindings/core/v8/async_iterable.h
@@ -49,7 +49,9 @@ // ScriptPromiseResolverBase for the return result has been created. // // [1] https://webidl.spec.whatwg.org/#asynchronous-iterator-return - virtual void AsyncIteratorReturn(ScriptValue value) { NOTREACHED(); } + virtual void AsyncIteratorReturn(ScriptValue value) { + NOTREACHED_IN_MIGRATION(); + } bool HasPendingPromise() const { return pending_promise_resolver_ != nullptr;
diff --git a/third_party/blink/renderer/bindings/core/v8/module_record_test.cc b/third_party/blink/renderer/bindings/core/v8/module_record_test.cc index 54cc165..69d099d 100644 --- a/third_party/blink/renderer/bindings/core/v8/module_record_test.cc +++ b/third_party/blink/renderer/bindings/core/v8/module_record_test.cc
@@ -50,7 +50,9 @@ // Implements ModuleRecordResolver: void RegisterModuleScript(const ModuleScript*) override {} - void UnregisterModuleScript(const ModuleScript*) override { NOTREACHED(); } + void UnregisterModuleScript(const ModuleScript*) override { + NOTREACHED_IN_MIGRATION(); + } const ModuleScript* GetModuleScriptFromModuleRecord( v8::Local<v8::Module>) const override {
diff --git a/third_party/blink/renderer/bindings/core/v8/script_decoder_test.cc b/third_party/blink/renderer/bindings/core/v8/script_decoder_test.cc index 8f92bff..ccef2bc7 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_decoder_test.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_decoder_test.cc
@@ -47,9 +47,9 @@ decoded_data_ = decoded_data; digest_ = std::move(digest); } - void DidFinishLoadingBody() override { NOTREACHED(); } - void DidFailLoadingBody() override { NOTREACHED(); } - void DidCancelLoadingBody() override { NOTREACHED(); } + void DidFinishLoadingBody() override { NOTREACHED_IN_MIGRATION(); } + void DidFailLoadingBody() override { NOTREACHED_IN_MIGRATION(); } + void DidCancelLoadingBody() override { NOTREACHED_IN_MIGRATION(); } const Deque<Vector<char>>& raw_data() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc b/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc index 6d1485b..4a55017 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc
@@ -436,7 +436,7 @@ WasmDataLoaderClient& operator=(const WasmDataLoaderClient&) = delete; void DidFetchDataLoadedCustomFormat() override {} - void DidFetchDataLoadFailed() override { NOTREACHED(); } + void DidFetchDataLoadFailed() override { NOTREACHED_IN_MIGRATION(); } void Abort() override { loader_->AbortFromClient(); } void Trace(Visitor* visitor) const override {
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/union.py b/third_party/blink/renderer/bindings/scripts/bind_gen/union.py index 0273d6e0..0da23034 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/union.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/union.py
@@ -715,10 +715,11 @@ class_name=cg_context.class_name) func_def.set_base_template_vars(cg_context.template_bindings()) node = CxxSwitchNode(cond="content_type_") - node.append(case=None, - body=[T("NOTREACHED();"), - T("return nullptr;")], - should_add_break=False) + node.append( + case=None, + body=[T("NOTREACHED_IN_MIGRATION();"), + T("return nullptr;")], + should_add_break=False) for member in subunion_members: node.append(case=member.content_type(), body=F("return MakeGarbageCollected<{}>({}());", @@ -835,7 +836,7 @@ body.extend([ branches, EmptyNode(), - TextNode("NOTREACHED();"), + TextNode("NOTREACHED_IN_MIGRATION();"), TextNode("return v8::Local<v8::Value>();"), ])
diff --git a/third_party/blink/renderer/build/scripts/make_policy_helper.py b/third_party/blink/renderer/build/scripts/make_policy_helper.py index 2e6caf9..e05fece 100644 --- a/third_party/blink/renderer/build/scripts/make_policy_helper.py +++ b/third_party/blink/renderer/build/scripts/make_policy_helper.py
@@ -30,11 +30,13 @@ for name in permissions_policy_name.split('-') ]) + name_to_permissions_policy_map = {} for feature in self.json5_file.name_dictionaries: if feature['permissions_policy_name']: feature['devtools_enum_name'] = to_devtools_enum_format( feature['permissions_policy_name']) permissions_policy_features.append(feature) + name_to_permissions_policy_map[feature['name']] = feature elif feature['document_policy_name']: document_policy_features.append(feature) else: @@ -73,6 +75,8 @@ self._input_files, 'permissions_policy_features': permissions_policy_features, + 'name_to_permissions_policy_map': + name_to_permissions_policy_map, 'document_policy_features': document_policy_features, 'pp_origin_trial_dependency_map':
diff --git a/third_party/blink/renderer/build/scripts/templates/policy_helper.cc.tmpl b/third_party/blink/renderer/build/scripts/templates/policy_helper.cc.tmpl index 443800b..40cb8f80 100644 --- a/third_party/blink/renderer/build/scripts/templates/policy_helper.cc.tmpl +++ b/third_party/blink/renderer/build/scripts/templates/policy_helper.cc.tmpl
@@ -30,24 +30,57 @@ // permissions policy to allow use of the feature in subframes (The framed // document will still require a valid origin trial token to use the feature in // this scenario). -const FeatureNameMap& GetDefaultFeatureNameMap() { - DEFINE_STATIC_LOCAL(FeatureNameMap, default_feature_name_map, ()); - if (default_feature_name_map.empty()) { - {% for feature in permissions_policy_features %} - {% if not feature.depends_on or feature.name in pp_origin_trial_dependency_map %} - default_feature_name_map.Set(k{{feature.name}}PolicyName, - mojom::PermissionsPolicyFeature::k{{feature.name}}); +const FeatureNameMap GetDefaultFeatureNameMap(bool is_isolated_context) { + DEFINE_STATIC_LOCAL(FeatureNameMapCache, default_feature_name_map_cache, ()); + FeatureNameMapCacheKey key(is_isolated_context); + if (default_feature_name_map_cache.Contains(key) && + !default_feature_name_map_cache.at(key).empty()) { + return default_feature_name_map_cache.at(key); + } + + FeatureNameMap default_feature_name_map; + {% for feature in permissions_policy_features %} + {% if not feature.depends_on or feature.name in pp_origin_trial_dependency_map %} + {% if feature.visibility == "All" %} + default_feature_name_map.Set( + k{{feature.name}}PolicyName, + mojom::PermissionsPolicyFeature::k{{feature.name}}); + {% elif feature.visibility == "IsolatedContext" %} + if (is_isolated_context) { + default_feature_name_map.Set( + k{{feature.name}}PolicyName, + mojom::PermissionsPolicyFeature::k{{feature.name}}); + } + {% endif %} + {% endif %} + {% endfor %} + {% for runtime_feature_name, dependent_features in runtime_to_permissions_policy_map.items() | sort %} + if (RuntimeEnabledFeatures::{{runtime_feature_name}}Enabled()) { + {% for feature in dependent_features %} + {% if name_to_permissions_policy_map[feature].visibility == "All" %} + default_feature_name_map.Set(k{{feature}}PolicyName, + mojom::PermissionsPolicyFeature::k{{feature}}); + {% elif name_to_permissions_policy_map[feature].visibility == "IsolatedContext" %} + if (is_isolated_context) { + default_feature_name_map.Set( + k{{feature}}PolicyName, + mojom::PermissionsPolicyFeature::k{{feature}}); + } {% endif %} {% endfor %} - {% for runtime_feature_name, dependent_features in runtime_to_permissions_policy_map.items() | sort %} - if (RuntimeEnabledFeatures::{{runtime_feature_name}}Enabled()) { - {% for feature in dependent_features %} - default_feature_name_map.Set(k{{feature}}PolicyName, - mojom::PermissionsPolicyFeature::k{{feature}}); - {% endfor %} - } - {% endfor %} } + {% endfor %} + + // Before we set |key| in the hash to be the map, check that it's empty. + if (default_feature_name_map_cache.Contains(key)) { + CHECK(default_feature_name_map_cache.at(key).empty()); + } + + // The contents of |default_feature_name_map| are copied into + // |default_feature_name_map_cache| here, which is declared static + // local above. + default_feature_name_map_cache.Set(key, default_feature_name_map); + return default_feature_name_map; } @@ -112,13 +145,29 @@ return false; } -String PermissionsPolicyFeatureToProtocol(mojom::blink::PermissionsPolicyFeature feature) { +String PermissionsPolicyFeatureToProtocol(mojom::blink::PermissionsPolicyFeature feature, ExecutionContext* execution_context) { + if (execution_context && execution_context->IsIsolatedContext()) { + switch (feature) { + {% for feature in permissions_policy_features %} + {% if feature.visibility == "IsolatedContext" %} + case mojom::blink::PermissionsPolicyFeature::k{{feature.name}}: + return protocol::Page::PermissionsPolicyFeatureEnum::{{feature.devtools_enum_name}}; + {% endif %} + {% endfor %} + default: + break; + } + } switch (feature) { {% for feature in permissions_policy_features %} + {% if feature.visibility == "All" %} case mojom::blink::PermissionsPolicyFeature::k{{feature.name}}: return protocol::Page::PermissionsPolicyFeatureEnum::{{feature.devtools_enum_name}}; + {% endif %} {% endfor %} - case mojom::blink::PermissionsPolicyFeature::kNotFound: + default: + // This default case also handles the mojom entry for + // mojom::blink::PermissionsPolicyFeature::kNotFound. NOTREACHED_IN_MIGRATION(); return ""; }
diff --git a/third_party/blink/renderer/core/animation/animatable.cc b/third_party/blink/renderer/core/animation/animatable.cc index 60c3f07a3..6ff3f91b 100644 --- a/third_party/blink/renderer/core/animation/animatable.cc +++ b/third_party/blink/renderer/core/animation/animatable.cc
@@ -26,7 +26,6 @@ #include "third_party/blink/renderer/core/css/style_sheet_contents.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/element.h" -#include "third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/geometry/calculation_value.h" @@ -35,23 +34,6 @@ namespace blink { namespace { -// A helper method which is used to trigger a violation report for cases where -// the |element.animate| API is used to animate a CSS property which is blocked -// by the permissions policy 'layout-animations'. -void ReportPermissionsPolicyViolationsIfNecessary( - ExecutionContext& context, - const KeyframeEffectModelBase& effect) { - for (const auto& property_handle : effect.Properties()) { - if (!property_handle.IsCSSProperty()) - continue; - const auto& css_property = property_handle.GetCSSProperty(); - if (LayoutAnimationsPolicy::AffectedCSSProperties().Contains( - &css_property)) { - LayoutAnimationsPolicy::ReportViolation(css_property, context); - } - } -} - V8UnionKeyframeEffectOptionsOrUnrestrictedDouble* CoerceEffectOptions( const V8UnionKeyframeAnimationOptionsOrUnrestrictedDouble* options) { switch (options->GetContentType()) { @@ -94,8 +76,6 @@ if (!element->GetExecutionContext()) return nullptr; - ReportPermissionsPolicyViolationsIfNecessary(*element->GetExecutionContext(), - *effect->Model()); if (!options->IsKeyframeAnimationOptions()) return element->GetDocument().Timeline().Play(effect, exception_state); @@ -149,8 +129,6 @@ if (!element->GetExecutionContext()) return nullptr; - ReportPermissionsPolicyViolationsIfNecessary(*element->GetExecutionContext(), - *effect->Model()); return element->GetDocument().Timeline().Play(effect, exception_state); }
diff --git a/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc b/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc index fe7d4ed..013338d 100644 --- a/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc +++ b/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc
@@ -7,7 +7,6 @@ #include <memory> #include <utility> -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h" #include "third_party/blink/renderer/core/animation/css_angle_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_aspect_ratio_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_basic_shape_interpolation_type.h" @@ -67,7 +66,6 @@ #include "third_party/blink/renderer/core/css/property_registry.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h" -#include "third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -75,10 +73,7 @@ CSSInterpolationTypesMap::CSSInterpolationTypesMap( const PropertyRegistry* registry, const Document& document) - : document_(document), registry_(registry) { - allow_all_animations_ = document.GetExecutionContext()->IsFeatureEnabled( - blink::mojom::blink::DocumentPolicyFeature::kLayoutAnimations); -} + : document_(document), registry_(registry) {} static const PropertyRegistration* GetRegistration( const PropertyRegistry* registry, @@ -95,11 +90,7 @@ using ApplicableTypesMap = HashMap<PropertyHandle, std::unique_ptr<const InterpolationTypes>>; DEFINE_STATIC_LOCAL(ApplicableTypesMap, all_applicable_types_map, ()); - DEFINE_STATIC_LOCAL(ApplicableTypesMap, composited_applicable_types_map, ()); - // Reduce motion currently allows no interpolation. When some properties are - // allowed to interpolate we may need to support the combination of - // reduce_motion && !allow_all_animations_ separately. DEFINE_STATIC_LOCAL(ApplicableTypesMap, reduce_motion_applicable_types_map, ()); @@ -115,8 +106,7 @@ ApplicableTypesMap& applicable_types_map = reduce_motion ? reduce_motion_applicable_types_map - : (allow_all_animations_ ? all_applicable_types_map - : composited_applicable_types_map); + : all_applicable_types_map; auto entry = applicable_types_map.find(property); if (entry != applicable_types_map.end()) @@ -133,12 +123,7 @@ PropertyHandle used_property = property.IsCSSProperty() ? property : PropertyHandle(css_property); - // TODO(crbug.com/838263): Support site-defined list of acceptable properties - // through permissions policy declarations. - bool property_maybe_blocked_by_permissions_policy = - LayoutAnimationsPolicy::AffectedCSSProperties().Contains(&css_property); - if (!reduce_motion && (allow_all_animations_ || - !property_maybe_blocked_by_permissions_policy)) { + if (!reduce_motion) { switch (css_property.PropertyID()) { case CSSPropertyID::kBaselineShift: case CSSPropertyID::kBorderBottomWidth:
diff --git a/third_party/blink/renderer/core/animation/interpolable_filter.h b/third_party/blink/renderer/core/animation/interpolable_filter.h index da0e6bee..77c04ff 100644 --- a/third_party/blink/renderer/core/animation/interpolable_filter.h +++ b/third_party/blink/renderer/core/animation/interpolable_filter.h
@@ -57,7 +57,7 @@ NOTREACHED_IN_MIGRATION(); return false; } - void Scale(double scale) final { NOTREACHED(); } + void Scale(double scale) final { NOTREACHED_IN_MIGRATION(); } void Add(const InterpolableValue& other) final; void AssertCanInterpolateWith(const InterpolableValue& other) const final;
diff --git a/third_party/blink/renderer/core/animation/interpolable_transform_list.h b/third_party/blink/renderer/core/animation/interpolable_transform_list.h index 061a9fe..1286103 100644 --- a/third_party/blink/renderer/core/animation/interpolable_transform_list.h +++ b/third_party/blink/renderer/core/animation/interpolable_transform_list.h
@@ -49,8 +49,8 @@ NOTREACHED_IN_MIGRATION(); return false; } - void Scale(double scale) final { NOTREACHED(); } - void Add(const InterpolableValue& other) final { NOTREACHED(); } + void Scale(double scale) final { NOTREACHED_IN_MIGRATION(); } + void Add(const InterpolableValue& other) final { NOTREACHED_IN_MIGRATION(); } void AssertCanInterpolateWith(const InterpolableValue& other) const final; void Trace(Visitor* v) const override {
diff --git a/third_party/blink/renderer/core/css/auto_sizes.css b/third_party/blink/renderer/core/css/auto_sizes.css deleted file mode 100644 index 05f9b693..0000000 --- a/third_party/blink/renderer/core/css/auto_sizes.css +++ /dev/null
@@ -1,12 +0,0 @@ -/* - * Copyright 2024 The Chromium Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -@namespace "http://www.w3.org/1999/xhtml"; - -img:is([sizes="auto" i], [sizes^="auto," i]) { - contain: size !important; - contain-intrinsic-size: 300px 150px; -}
diff --git a/third_party/blink/renderer/core/css/css_default_style_sheets.cc b/third_party/blink/renderer/core/css/css_default_style_sheets.cc index 8224fa7..c2a57a68 100644 --- a/third_party/blink/renderer/core/css/css_default_style_sheets.cc +++ b/third_party/blink/renderer/core/css/css_default_style_sheets.cc
@@ -130,7 +130,6 @@ stylable_select_style_sheet_.Clear(); stylable_select_forced_colors_style_sheet_.Clear(); marker_style_sheet_.Clear(); - auto_sizes_style_sheet_.Clear(); permission_element_style_sheet_.Clear(); // Recreate the default style sheet to clean up possible SVG resources. String default_rules = UncompressResourceAsASCIIString(IDR_UASTYLE_HTML_CSS) + @@ -358,14 +357,6 @@ changed_default_style = true; } - if (!auto_sizes_style_sheet_ && IsA<HTMLImageElement>(element) && - RuntimeEnabledFeatures::AutoSizeLazyLoadedImagesEnabled()) { - auto_sizes_style_sheet_ = ParseUASheet( - UncompressResourceAsASCIIString(IDR_UASTYLE_AUTO_SIZES_CSS)); - AddRulesToDefaultStyleSheets(auto_sizes_style_sheet_, NamespaceType::kHTML); - changed_default_style = true; - } - DCHECK(!default_html_style_->Features().HasIdsInSelectors()); return changed_default_style; } @@ -517,7 +508,6 @@ visitor->Trace(stylable_select_style_sheet_); visitor->Trace(stylable_select_forced_colors_style_sheet_); visitor->Trace(marker_style_sheet_); - visitor->Trace(auto_sizes_style_sheet_); visitor->Trace(default_json_document_style_); }
diff --git a/third_party/blink/renderer/core/css/css_default_style_sheets.h b/third_party/blink/renderer/core/css/css_default_style_sheets.h index b138afa..22f5c84 100644 --- a/third_party/blink/renderer/core/css/css_default_style_sheets.h +++ b/third_party/blink/renderer/core/css/css_default_style_sheets.h
@@ -102,9 +102,6 @@ StyleSheetContents* ForcedColorsStyleSheet() { return forced_colors_style_sheet_.Get(); } - StyleSheetContents* AutoSizesStyleSheet() { - return auto_sizes_style_sheet_.Get(); - } CORE_EXPORT void PrepareForLeakDetection(); @@ -170,7 +167,6 @@ Member<StyleSheetContents> stylable_select_forced_colors_style_sheet_; Member<StyleSheetContents> marker_style_sheet_; Member<StyleSheetContents> forced_colors_style_sheet_; - Member<StyleSheetContents> auto_sizes_style_sheet_; std::unique_ptr<UAStyleSheetLoader> media_controls_style_sheet_loader_; };
diff --git a/third_party/blink/renderer/core/css/css_math_expression_node.cc b/third_party/blink/renderer/core/css/css_math_expression_node.cc index 220a6d98..e875af59 100644 --- a/third_party/blink/renderer/core/css/css_math_expression_node.cc +++ b/third_party/blink/renderer/core/css/css_math_expression_node.cc
@@ -2936,12 +2936,8 @@ const CSSLengthResolver& length_resolver) const { DCHECK(IsScopedValue()); AnchorSpecifierValue* anchor_specifier = AnchorSpecifierValue::Default(); - if (const auto* auto_value = - DynamicTo<CSSIdentifierValue>(anchor_specifier_.Get())) { - DCHECK_EQ(auto_value->GetValueID(), CSSValueID::kAuto); - anchor_specifier = AnchorSpecifierValue::Auto(); - } else if (const auto* custom_ident = - DynamicTo<CSSCustomIdentValue>(anchor_specifier_.Get())) { + if (const auto* custom_ident = + DynamicTo<CSSCustomIdentValue>(anchor_specifier_.Get())) { length_resolver.ReferenceTreeScope(); anchor_specifier = MakeGarbageCollected<AnchorSpecifierValue>( *MakeGarbageCollected<ScopedCSSName>(custom_ident->Value(), @@ -3227,11 +3223,7 @@ // |anchor_specifier| may be omitted to represent the default anchor. const CSSValue* anchor_specifier = - css_parsing_utils::ConsumeIdent<CSSValueID::kAuto>(tokens); - if (!anchor_specifier) { - anchor_specifier = css_parsing_utils::ConsumeDashedIdent(tokens, context_); - } tokens.ConsumeWhitespace(); const CSSValue* value = nullptr;
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_context.cc b/third_party/blink/renderer/core/css/parser/css_parser_context.cc index 5918427..bcf96854c 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_context.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_context.cc
@@ -18,7 +18,6 @@ #include "third_party/blink/renderer/core/html/html_document.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/page/page.h" -#include "third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -249,25 +248,6 @@ return (document_.Get()) ? document_.Get()->GetExecutionContext() : nullptr; } -void CSSParserContext::ReportLayoutAnimationsViolationIfNeeded( - const StyleRuleKeyframe& rule) const { - if (!document_ || !document_->GetExecutionContext()) { - return; - } - for (unsigned i = 0; i < rule.Properties().PropertyCount(); ++i) { - CSSPropertyID id = rule.Properties().PropertyAt(i).Id(); - if (id == CSSPropertyID::kVariable) { - continue; - } - const CSSProperty& property = CSSProperty::Get(id); - if (!LayoutAnimationsPolicy::AffectedCSSProperties().Contains(&property)) { - continue; - } - LayoutAnimationsPolicy::ReportViolation(property, - *document_->GetExecutionContext()); - } -} - bool CSSParserContext::IsForMarkupSanitization() const { return document_ && document_->IsForMarkupSanitization(); }
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_context.h b/third_party/blink/renderer/core/css/parser/css_parser_context.h index d05133f6..81c37d0 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_context.h +++ b/third_party/blink/renderer/core/css/parser/css_parser_context.h
@@ -24,7 +24,6 @@ class CSSStyleSheet; class Document; class ExecutionContext; -class StyleRuleKeyframe; class StyleSheetContents; enum class SecureContextMode; @@ -124,12 +123,6 @@ const DOMWrapperWorld* JavascriptWorld() const { return world_.Get(); } - // TODO(ekaramad): We currently only report @keyframes violations. We need to - // report CSS transitions as well (https://crbug.com/906147). - // TODO(ekaramad): We should provide a source location in the violation - // report (https://crbug.com/906150, ). - void ReportLayoutAnimationsViolationIfNeeded(const StyleRuleKeyframe&) const; - bool IsForMarkupSanitization() const; // Overrides |mode_| of a CSSParserContext within the scope, allowing us to
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_impl.cc b/third_party/blink/renderer/core/css/parser/css_parser_impl.cc index 7c36ccf..c76b0d0f 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_impl.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_impl.cc
@@ -920,12 +920,7 @@ } CSSParserTokenStream::BlockGuard guard(stream); - StyleRuleKeyframe* keyframe_style_rule = - ConsumeKeyframeStyleRule(prelude, prelude_offset, stream); - if (keyframe_style_rule) { - context_->ReportLayoutAnimationsViolationIfNeeded(*keyframe_style_rule); - } - return keyframe_style_rule; + return ConsumeKeyframeStyleRule(prelude, prelude_offset, stream); } if (allowed_rules == kFontFeatureRules) { // We get here if something other than an at rule (e.g. @swash,
diff --git a/third_party/blink/renderer/core/css/properties/longhand.h b/third_party/blink/renderer/core/css/properties/longhand.h index 5ec7b972..5f41a0a4 100644 --- a/third_party/blink/renderer/core/css/properties/longhand.h +++ b/third_party/blink/renderer/core/css/properties/longhand.h
@@ -38,8 +38,12 @@ const CSSParserLocalContext& local_tokenizer) const { return nullptr; } - virtual void ApplyInitial(StyleResolverState&) const { NOTREACHED(); } - virtual void ApplyInherit(StyleResolverState&) const { NOTREACHED(); } + virtual void ApplyInitial(StyleResolverState&) const { + NOTREACHED_IN_MIGRATION(); + } + virtual void ApplyInherit(StyleResolverState&) const { + NOTREACHED_IN_MIGRATION(); + } virtual void ApplyValue(StyleResolverState&, const CSSValue&, ValueMode) const {
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 9394565..600030c 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -3423,9 +3423,6 @@ return; } - if (!AllowedToUseDynamicMarkUpInsertion("open", exception_state)) - return; - if (entered_window && !entered_window->GetFrame()) return; @@ -3895,9 +3892,6 @@ return; } - if (!AllowedToUseDynamicMarkUpInsertion("close", exception_state)) - return; - close(); } @@ -4504,9 +4498,6 @@ void Document::write(v8::Isolate* isolate, const Vector<String>& text, ExceptionState& exception_state) { - if (!AllowedToUseDynamicMarkUpInsertion("write", exception_state)) - return; - StringBuilder builder; for (const String& string : text) builder.Append(string); @@ -4521,9 +4512,6 @@ void Document::writeln(v8::Isolate* isolate, const Vector<String>& text, ExceptionState& exception_state) { - if (!AllowedToUseDynamicMarkUpInsertion("writeln", exception_state)) - return; - StringBuilder builder; for (const String& string : text) builder.Append(string); @@ -7703,32 +7691,6 @@ }); } -bool Document::AllowedToUseDynamicMarkUpInsertion( - const char* api_name, - ExceptionState& exception_state) { - if (!RuntimeEnabledFeatures::ExperimentalPoliciesEnabled()) { - return true; - } - if (!GetFrame() || GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kDocumentWrite, - ReportOptions::kReportOnFailure)) { - return true; - } - - // TODO(ekaramad): Throwing an exception seems an ideal resolution to mishaps - // in using the API against the policy. But this cannot be applied to cross- - // origin as there are security risks involved. We should perhaps unload the - // whole frame instead of throwing. - exception_state.ThrowDOMException( - DOMExceptionCode::kNotAllowedError, - String::Format( - "The use of method '%s' has been blocked by permissions policy. The " - "feature " - "'document-write' is disabled in this document.", - api_name)); - return false; -} - ukm::UkmRecorder* Document::UkmRecorder() { if (!ukm_recorder_) { mojo::Remote<ukm::mojom::UkmRecorderFactory> factory;
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index 9631069e..cce9847 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h
@@ -2307,11 +2307,6 @@ const AtomicString& BodyAttributeValue(const QualifiedName&) const; void SetBodyAttribute(const QualifiedName&, const AtomicString&); - // Returns true if use of |method_name| for markup insertion is allowed by - // permissions policy; otherwise returns false and throws a DOM exception. - bool AllowedToUseDynamicMarkUpInsertion(const char* method_name, - ExceptionState&); - void SetFreezingInProgress(bool is_freezing_in_progress) { is_freezing_in_progress_ = is_freezing_in_progress; }
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 24a12e0..13c1ba4 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -1164,18 +1164,8 @@ return rare_data.AttributeMap(); } -Vector<AtomicString> Element::getAttributeNames() const { - Vector<AtomicString> attributesVector; - if (!hasAttributes()) { - return attributesVector; - } - - AttributeCollection attributes = element_data_->Attributes(); - attributesVector.ReserveInitialCapacity(attributes.size()); - for (const Attribute& attr : attributes) { - attributesVector.UncheckedAppend(attr.GetName().ToString()); - } - return attributesVector; +AttributeNamesView Element::getAttributeNames() const { + return bindings::Transform<AttributeToNameTransform>(Attributes()); } inline ElementRareDataVector* Element::GetElementRareData() const { @@ -7871,6 +7861,9 @@ if (change.ShouldUpdatePseudoElement(*element)) { bool generate_pseudo = CanGeneratePseudoElement(pseudo_id); if (generate_pseudo) { + if (auto* cache = GetDocument().ExistingAXObjectCache()) { + cache->RemoveSubtree(this, /*remove_root*/ false); + } element->RecalcStyle(change.ForPseudoElement(), style_recalc_context); if (element->NeedsReattachLayoutTree() && !PseudoElementLayoutObjectIsNeeded(element->GetComputedStyle(),
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index 1d2d539..52e65ca 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -53,6 +53,7 @@ #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/trustedtypes/trusted_types_util.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/bindings/transform_view.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/region_capture_crop_id.h" @@ -141,6 +142,15 @@ using ScrollOffset = gfx::Vector2dF; +struct AttributeToNameTransform { + String operator()(const Attribute& attr) const { + return attr.GetName().ToString(); + } +}; + +using AttributeNamesView = + bindings::TransformedView<AttributeCollection, AttributeToNameTransform>; + enum SpellcheckAttributeState { kSpellcheckAttributeTrue, kSpellcheckAttributeFalse, @@ -602,7 +612,7 @@ // For exposing to DOM only. NamedNodeMap* attributesForBindings() const; - Vector<AtomicString> getAttributeNames() const; + AttributeNamesView getAttributeNames() const; enum class AttributeModificationReason { kDirectly,
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 667b0f2a..c9a76d1 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -460,7 +460,7 @@ }; virtual void NotifyLoadedSheetAndAllCriticalSubresources( LoadedSheetErrorStatus) {} - virtual void SetToPendingState() { NOTREACHED(); } + virtual void SetToPendingState() { NOTREACHED_IN_MIGRATION(); } bool HasName() const { DCHECK(!IsTextNode());
diff --git a/third_party/blink/renderer/core/dom/raw_data_document_parser.h b/third_party/blink/renderer/core/dom/raw_data_document_parser.h index 1cf791d..fc87ea8 100644 --- a/third_party/blink/renderer/core/dom/raw_data_document_parser.h +++ b/third_party/blink/renderer/core/dom/raw_data_document_parser.h
@@ -47,7 +47,7 @@ private: void insert(const String&) final {} - void Append(const String&) final { NOTREACHED(); } + void Append(const String&) final { NOTREACHED_IN_MIGRATION(); } }; } // namespace blink
diff --git a/third_party/blink/renderer/core/execution_context/agent.cc b/third_party/blink/renderer/core/execution_context/agent.cc index 15e5df2..ee573a92 100644 --- a/third_party/blink/renderer/core/execution_context/agent.cc +++ b/third_party/blink/renderer/core/execution_context/agent.cc
@@ -94,6 +94,14 @@ } // static +void Agent::ResetIsIsolatedContextForTest() { +#if DCHECK_IS_ON() + is_isolated_context_set = false; +#endif + is_isolated_context = false; +} + +// static void Agent::SetIsIsolatedContext(bool value) { #if DCHECK_IS_ON() if (is_isolated_context_set)
diff --git a/third_party/blink/renderer/core/execution_context/agent.h b/third_party/blink/renderer/core/execution_context/agent.h index 49c1a81..acabaa0 100644 --- a/third_party/blink/renderer/core/execution_context/agent.h +++ b/third_party/blink/renderer/core/execution_context/agent.h
@@ -75,6 +75,7 @@ // TODO(mkwst): We need a specification for these restrictions: // https://crbug.com/1206150. static bool IsIsolatedContext(); + static void ResetIsIsolatedContextForTest(); // Only called from blink::SetIsIsolatedContext. static void SetIsIsolatedContext(bool value);
diff --git a/third_party/blink/renderer/core/execution_context/security_context_init.cc b/third_party/blink/renderer/core/execution_context/security_context_init.cc index ad5b185d..b9be46a8 100644 --- a/third_party/blink/renderer/core/execution_context/security_context_init.cc +++ b/third_party/blink/renderer/core/execution_context/security_context_init.cc
@@ -231,12 +231,14 @@ for (const auto& policy : container_policy) { if (!base::Contains(blink::kFencedFrameAllowedFeatures, policy.feature)) { + bool is_isolated_context = + execution_context_ && execution_context_->IsIsolatedContext(); execution_context_->AddConsoleMessage( MakeGarbageCollected<ConsoleMessage>( mojom::blink::ConsoleMessageSource::kSecurity, mojom::blink::ConsoleMessageLevel::kWarning, "The permissions policy '" + - GetNameForFeature(policy.feature) + + GetNameForFeature(policy.feature, is_isolated_context) + "' is disallowed in fenced frames and will not be " "enabled.")); }
diff --git a/third_party/blink/renderer/core/fetch/body_stream_buffer.cc b/third_party/blink/renderer/core/fetch/body_stream_buffer.cc index 75473ab..b95f37b2 100644 --- a/third_party/blink/renderer/core/fetch/body_stream_buffer.cc +++ b/third_party/blink/renderer/core/fetch/body_stream_buffer.cc
@@ -89,7 +89,7 @@ client_->DidFetchDataLoadFailed(); } - void Abort() override { NOTREACHED(); } + void Abort() override { NOTREACHED_IN_MIGRATION(); } void Trace(Visitor* visitor) const override { visitor->Trace(buffer_);
diff --git a/third_party/blink/renderer/core/fetch/fetch_data_loader.h b/third_party/blink/renderer/core/fetch/fetch_data_loader.h index 8b839c8..9c07975 100644 --- a/third_party/blink/renderer/core/fetch/fetch_data_loader.h +++ b/third_party/blink/renderer/core/fetch/fetch_data_loader.h
@@ -43,8 +43,12 @@ virtual void DidFetchDataLoadedArrayBuffer(DOMArrayBuffer*) { NOTREACHED_IN_MIGRATION(); } - virtual void DidFetchDataLoadedFormData(FormData*) { NOTREACHED(); } - virtual void DidFetchDataLoadedString(const String&) { NOTREACHED(); } + virtual void DidFetchDataLoadedFormData(FormData*) { + NOTREACHED_IN_MIGRATION(); + } + virtual void DidFetchDataLoadedString(const String&) { + NOTREACHED_IN_MIGRATION(); + } // This is called synchronously from FetchDataLoader::Start() to provide // the target data pipe. This may be a pipe extracted from the consumer // or a new pipe that data will be copied into. @@ -56,11 +60,11 @@ // to |out_data_pipe|, and |out_data_pipe| is closed or aborted. // This may be called synchronously from FetchDataLoader::Start() or // delayed to a later task. - virtual void DidFetchDataLoadedDataPipe() { NOTREACHED(); } + virtual void DidFetchDataLoadedDataPipe() { NOTREACHED_IN_MIGRATION(); } // This function is called when a "custom" FetchDataLoader (none of the // ones listed above) finishes loading. - virtual void DidFetchDataLoadedCustomFormat() { NOTREACHED(); } + virtual void DidFetchDataLoadedCustomFormat() { NOTREACHED_IN_MIGRATION(); } virtual void DidFetchDataLoadFailed() = 0;
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index 8de1793..0feb686f 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -603,7 +603,9 @@ } // Construct the permissions policy violation report. - const String& feature_name = GetNameForFeature(feature); + bool is_isolated_context = + GetExecutionContext() && GetExecutionContext()->IsIsolatedContext(); + const String& feature_name = GetNameForFeature(feature, is_isolated_context); const String& disp_str = (disposition == mojom::blink::PolicyDisposition::kReport ? "report" : "enforce");
diff --git a/third_party/blink/renderer/core/frame/visual_viewport.h b/third_party/blink/renderer/core/frame/visual_viewport.h index 4eb5dab..8444e27f 100644 --- a/third_party/blink/renderer/core/frame/visual_viewport.h +++ b/third_party/blink/renderer/core/frame/visual_viewport.h
@@ -248,7 +248,9 @@ // WebViewImpl explicitly rather than via // ScrollingCoordinator::DidCompositorScroll() since it needs to be set in // tandem with the page scale delta. - void DidCompositorScroll(const gfx::PointF&) final { NOTREACHED(); } + void DidCompositorScroll(const gfx::PointF&) final { + NOTREACHED_IN_MIGRATION(); + } // Visual Viewport API implementation. double OffsetLeft() const;
diff --git a/third_party/blink/renderer/core/html/build.gni b/third_party/blink/renderer/core/html/build.gni index b368188d..fdf60f5 100644 --- a/third_party/blink/renderer/core/html/build.gni +++ b/third_party/blink/renderer/core/html/build.gni
@@ -457,8 +457,6 @@ "media/media_custom_controls_fullscreen_detector.h", "media/media_document.cc", "media/media_document.h", - "media/media_element_parser_helpers.cc", - "media/media_element_parser_helpers.h", "media/media_error.h", "media/media_fragment_uri_parser.cc", "media/media_fragment_uri_parser.h",
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h index 161338ad1..13ce0227 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h +++ b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h
@@ -264,11 +264,11 @@ virtual void ResetUsageTracking() {} virtual int LayerCount() const { return 0; } - virtual void setFontForTesting(const String&) { NOTREACHED(); } + virtual void setFontForTesting(const String&) { NOTREACHED_IN_MIGRATION(); } // WebGL-specific interface virtual bool UsingSwapChain() const { return false; } - virtual void MarkLayerComposited() { NOTREACHED(); } + virtual void MarkLayerComposited() { NOTREACHED_IN_MIGRATION(); } virtual sk_sp<SkData> PaintRenderingResultsToDataArray(SourceDrawingBuffer) { NOTREACHED_IN_MIGRATION(); return nullptr; @@ -280,7 +280,9 @@ // WebGL & WebGPU-specific interface virtual void SetHdrMetadata(const gfx::HDRMetadata& hdr_metadata) {} - virtual void SetFilterQuality(cc::PaintFlags::FilterQuality) { NOTREACHED(); } + virtual void SetFilterQuality(cc::PaintFlags::FilterQuality) { + NOTREACHED_IN_MIGRATION(); + } virtual void Reshape(int width, int height) {} virtual int ExternallyAllocatedBufferCountPerPixel() { NOTREACHED_IN_MIGRATION();
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context_host.h b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context_host.h index 34ebdaa..3fddca7 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context_host.h +++ b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context_host.h
@@ -108,6 +108,17 @@ // blink::CanvasImageSource bool IsOffscreenCanvas() const override; + // This method attempts to ensure that the canvas' resource exists on the GPU. + // A HTMLCanvasElement can downgrade itself from GPU to CPU when readback + // occurs too frequently, so a canvas may exist on the CPU even if the browser + // is normally GPU-capable. + // Returns true if the canvas resources live on the GPU. If the canvas needed + // to be migrated off of the CPU, the canvas resource provider and canvas 2D + // layer bridge will be destroyed and recreated; when this occurs, any + // existing pointers to these objects will be invalidated. If the canvas + // resource provider did not exist at all, it may be created. + virtual bool EnableAcceleration() = 0; + protected: ~CanvasRenderingContextHost() override = default;
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index 9b76da2e..2eefbb2 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -1572,18 +1572,34 @@ } void HTMLCanvasElement::WillDrawImageTo2DContext(CanvasImageSource* source) { - if (SharedGpuContext::AllowSoftwareToAcceleratedCanvasUpgrade() && - source->IsAccelerated() && (GetRasterMode() == RasterMode::kCPU) && - ShouldAccelerate()) { - SetPreferred2DRasterMode(RasterModeHint::kPreferGPU); - std::unique_ptr<Canvas2DLayerBridge> surface = Create2DLayerBridge(); - if (surface) { - ReplaceExisting2dLayerBridge(std::move(surface)); + // If the source is GPU-accelerated, and the canvas is not, but could be... + if (source->IsAccelerated() && ShouldAccelerate() && + GetRasterMode() == RasterMode::kCPU) { + // Recreate the canvas in GPU raster mode, and update its contents. + if (RecreateCanvasInGPURasterMode()) { SetNeedsCompositingUpdate(); } } } +bool HTMLCanvasElement::EnableAcceleration() { + return GetRasterMode() == RasterMode::kCPU ? RecreateCanvasInGPURasterMode() + : true; +} + +bool HTMLCanvasElement::RecreateCanvasInGPURasterMode() { + if (!SharedGpuContext::AllowSoftwareToAcceleratedCanvasUpgrade()) { + return false; + } + SetPreferred2DRasterMode(RasterModeHint::kPreferGPU); + std::unique_ptr<Canvas2DLayerBridge> surface = Create2DLayerBridge(); + if (!surface) { + return false; + } + ReplaceExisting2dLayerBridge(std::move(surface)); + return true; +} + scoped_refptr<Image> HTMLCanvasElement::GetSourceImageForCanvas( FlushReason reason, SourceImageStatus* status,
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h index a042102..d4efe680 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h
@@ -228,6 +228,7 @@ void DisableAcceleration(std::unique_ptr<CanvasResourceProvider> new_provider_for_testing = nullptr); + bool EnableAcceleration() final; // ImageBitmapSource implementation gfx::Size BitmapSourceSize() const override; @@ -378,6 +379,8 @@ static std::pair<blink::Image*, float> BrokenCanvas( float device_scale_factor); + bool RecreateCanvasInGPURasterMode(); + FRIEND_TEST_ALL_PREFIXES(HTMLCanvasElementTest, BrokenCanvasHighRes); HeapHashSet<WeakMember<CanvasDrawListener>> listeners_;
diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_party/blink/renderer/core/html/html_image_element.cc index fd92bee..694bb3d4 100644 --- a/third_party/blink/renderer/core/html/html_image_element.cc +++ b/third_party/blink/renderer/core/html/html_image_element.cc
@@ -24,7 +24,6 @@ #include "third_party/blink/renderer/core/html/html_image_element.h" #include "third_party/blink/public/common/loader/lcp_critical_path_predictor_util.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/v8_image_bitmap_options.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" @@ -111,10 +110,6 @@ form_was_set_by_parser_(false), element_created_by_parser_(created_by_parser), is_fallback_image_(false), - is_default_overridden_intrinsic_size_( - !document.IsImageDocument() && GetExecutionContext() && - !GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kUnsizedMedia)), is_legacy_format_or_unoptimized_image_(false), is_ad_related_(false), is_lcp_element_(false), @@ -676,10 +671,6 @@ } PhysicalSize HTMLImageElement::DensityCorrectedIntrinsicDimensions() const { - if (IsDefaultIntrinsicSize()) { - return PhysicalSize(LayoutUnit(LayoutReplaced::kDefaultWidth), - LayoutUnit(LayoutReplaced::kDefaultHeight)); - } ImageResourceContent* image_content = GetImageLoader().GetContent(); if (!image_content || !image_content->HasImage()) return PhysicalSize();
diff --git a/third_party/blink/renderer/core/html/html_image_element.h b/third_party/blink/renderer/core/html/html_image_element.h index 75eba5c..8252fd19 100644 --- a/third_party/blink/renderer/core/html/html_image_element.h +++ b/third_party/blink/renderer/core/html/html_image_element.h
@@ -110,10 +110,6 @@ void setHeight(unsigned); void setWidth(unsigned); - bool IsDefaultIntrinsicSize() const { - return is_default_overridden_intrinsic_size_; - } - int x() const; int y() const; @@ -282,7 +278,6 @@ bool form_was_set_by_parser_ : 1; bool element_created_by_parser_ : 1; bool is_fallback_image_ : 1; - bool is_default_overridden_intrinsic_size_ : 1; // This flag indicates if the image violates one or more optimized image // policies. When any policy is violated, the image should be rendered as a // placeholder image.
diff --git a/third_party/blink/renderer/core/html/media/html_audio_element.h b/third_party/blink/renderer/core/html/media/html_audio_element.h index 432b8e4..6ac50373 100644 --- a/third_party/blink/renderer/core/html/media/html_audio_element.h +++ b/third_party/blink/renderer/core/html/media/html_audio_element.h
@@ -51,7 +51,7 @@ void MediaRemotingStarted( const WebString& remote_device_friendly_name) override {} void MediaRemotingStopped(int error_code) override {} - void OnPictureInPictureStateChange() final { NOTREACHED(); } + void OnPictureInPictureStateChange() final { NOTREACHED_IN_MIGRATION(); } }; } // namespace blink
diff --git a/third_party/blink/renderer/core/html/media/html_video_element.cc b/third_party/blink/renderer/core/html/media/html_video_element.cc index eca5b1a..57a9cf1 100644 --- a/third_party/blink/renderer/core/html/media/html_video_element.cc +++ b/third_party/blink/renderer/core/html/media/html_video_element.cc
@@ -32,7 +32,6 @@ #include "cc/paint/paint_canvas.h" #include "media/base/video_frame.h" #include "third_party/blink/public/common/features.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h" #include "third_party/blink/public/platform/web_fullscreen_video_status.h" #include "third_party/blink/renderer/bindings/core/v8/v8_fullscreen_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_image_bitmap_options.h" @@ -91,10 +90,6 @@ is_persistent_(false), is_auto_picture_in_picture_(false), is_effectively_fullscreen_(false), - is_default_overridden_intrinsic_size_( - !document.IsMediaDocument() && GetExecutionContext() && - !GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kUnsizedMedia)), video_has_played_(false), mostly_filling_viewport_(false) { if (document.GetSettings()) { @@ -231,16 +226,12 @@ } unsigned HTMLVideoElement::videoWidth() const { - if (is_default_overridden_intrinsic_size_) - return LayoutReplaced::kDefaultWidth; if (!GetWebMediaPlayer()) return 0; return GetWebMediaPlayer()->NaturalSize().width(); } unsigned HTMLVideoElement::videoHeight() const { - if (is_default_overridden_intrinsic_size_) - return LayoutReplaced::kDefaultHeight; if (!GetWebMediaPlayer()) return 0; return GetWebMediaPlayer()->NaturalSize().height();
diff --git a/third_party/blink/renderer/core/html/media/html_video_element.h b/third_party/blink/renderer/core/html/media/html_video_element.h index 65b94ad..fb7f1c7 100644 --- a/third_party/blink/renderer/core/html/media/html_video_element.h +++ b/third_party/blink/renderer/core/html/media/html_video_element.h
@@ -69,10 +69,6 @@ gfx::Size videoVisibleSize() const; - bool IsDefaultIntrinsicSize() const { - return is_default_overridden_intrinsic_size_; - } - // Fullscreen void webkitEnterFullscreen(); void webkitExitFullscreen(); @@ -260,8 +256,6 @@ // is fullscreen. bool is_effectively_fullscreen_ : 1; - bool is_default_overridden_intrinsic_size_ : 1; - bool video_has_played_ : 1; // True, if the video element occupies most of the viewport.
diff --git a/third_party/blink/renderer/core/html/media/media_element_parser_helpers.cc b/third_party/blink/renderer/core/html/media/media_element_parser_helpers.cc deleted file mode 100644 index cd7d2f8..0000000 --- a/third_party/blink/renderer/core/html/media/media_element_parser_helpers.cc +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2018 The Chromium Authors -// 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/core/html/media/media_element_parser_helpers.h" - -#include "third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom-blink.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" -#include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/layout/layout_object.h" - -namespace blink { - -namespace media_element_parser_helpers { - -void CheckUnsizedMediaViolation(const LayoutObject* layout_object, - bool send_report) { - const ComputedStyle& style = layout_object->StyleRef(); - bool is_unsized = !style.LogicalWidth().IsSpecified() && - !style.LogicalHeight().IsSpecified(); - if (is_unsized) { - layout_object->GetDocument().GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kUnsizedMedia, - send_report ? ReportOptions::kReportOnFailure - : ReportOptions::kDoNotReport); - } -} - -} // namespace media_element_parser_helpers - -} // namespace blink
diff --git a/third_party/blink/renderer/core/html/media/media_element_parser_helpers.h b/third_party/blink/renderer/core/html/media/media_element_parser_helpers.h deleted file mode 100644 index fd9619c..0000000 --- a/third_party/blink/renderer/core/html/media/media_element_parser_helpers.h +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2018 The Chromium Authors -// 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_CORE_HTML_MEDIA_MEDIA_ELEMENT_PARSER_HELPERS_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_MEDIA_MEDIA_ELEMENT_PARSER_HELPERS_H_ - -namespace blink { - -class LayoutObject; - -namespace media_element_parser_helpers { - -// When |layout_object| is not properly styled (according to -// PermissionsPolicyFeature::kUnsizedMedia) this invocation counts a potential -// violation. If |send_report| is set, then an actual violation report is -// generated. -void CheckUnsizedMediaViolation(const LayoutObject* layout_object, - bool send_report); - -} // namespace media_element_parser_helpers - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_HTML_MEDIA_MEDIA_ELEMENT_PARSER_HELPERS_H_
diff --git a/third_party/blink/renderer/core/html/parser/html_view_source_parser.h b/third_party/blink/renderer/core/html/parser/html_view_source_parser.h index 4343ac0..0142f6ec 100644 --- a/third_party/blink/renderer/core/html/parser/html_view_source_parser.h +++ b/third_party/blink/renderer/core/html/parser/html_view_source_parser.h
@@ -44,7 +44,7 @@ private: // DocumentParser - void insert(const String&) override { NOTREACHED(); } + void insert(const String&) override { NOTREACHED_IN_MIGRATION(); } void Append(const String&) override; void Finish() override;
diff --git a/third_party/blink/renderer/core/html/resources/html.css b/third_party/blink/renderer/core/html/resources/html.css index ca8481e..62b4e44 100644 --- a/third_party/blink/renderer/core/html/resources/html.css +++ b/third_party/blink/renderer/core/html/resources/html.css
@@ -1541,4 +1541,11 @@ text-decoration: -internal-grammar-error-color grammar-error; } +@supports blink-feature(AutoSizeLazyLoadedImages) { + img:is([sizes="auto" i], [sizes^="auto," i]) { + contain: size !important; + contain-intrinsic-size: 300px 150px; + } +} + /* noscript is handled internally, as it depends on settings. */
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index 636e073..3f4cab99 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -893,7 +893,10 @@ auto feature_states = std::make_unique< protocol::Array<protocol::Page::PermissionsPolicyFeatureState>>(); - for (const auto& entry : blink::GetDefaultFeatureNameMap()) { + bool is_isolated_context = + frame->DomWindow() && frame->DomWindow()->IsIsolatedContext(); + for (const auto& entry : + blink::GetDefaultFeatureNameMap(is_isolated_context)) { const String& feature_name = entry.key; const mojom::blink::PermissionsPolicyFeature feature = entry.value; @@ -906,7 +909,8 @@ std::unique_ptr<protocol::Page::PermissionsPolicyFeatureState> feature_state = protocol::Page::PermissionsPolicyFeatureState::create() - .setFeature(blink::PermissionsPolicyFeatureToProtocol(feature)) + .setFeature(blink::PermissionsPolicyFeatureToProtocol( + feature, frame->DomWindow())) .setAllowed(!locator.has_value()) .build();
diff --git a/third_party/blink/renderer/core/layout/hit_test_location.cc b/third_party/blink/renderer/core/layout/hit_test_location.cc index 4e06679d..143ce3c4 100644 --- a/third_party/blink/renderer/core/layout/hit_test_location.cc +++ b/third_party/blink/renderer/core/layout/hit_test_location.cc
@@ -119,6 +119,17 @@ return true; } +constexpr int kMaxRectHitTestVerbs = 500; + +// The Path::Intersects(const gfx::QuadF&, ...) functions have O(N^2) behavior, +// so to avoid performance issues we only call these functions for "shorter" +// Paths and fallback to using the single-point (approximately the centroid of +// the quad/rect) code-path - this matches behavior prior to +// crrev.com/c/5307520. See crbug.com/337338049 and crbug.com/341136034. +bool CanUseRectHitTestForPath(const Path& path) { + return path.GetSkPath().countVerbs() <= kMaxRectHitTestVerbs; +} + } // namespace HitTestLocation::HitTestLocation() @@ -253,7 +264,7 @@ } bool HitTestLocation::Intersects(const Path& path) const { - if (is_rect_based_) { + if (is_rect_based_ && CanUseRectHitTestForPath(path)) { return path.Intersects(transformed_rect_); } return path.Contains(transformed_point_); @@ -261,7 +272,7 @@ bool HitTestLocation::Intersects(const Path& path, WindRule winding_rule) const { - if (is_rect_based_) { + if (is_rect_based_ && CanUseRectHitTestForPath(path)) { return path.Intersects(transformed_rect_, winding_rule); } return path.Contains(transformed_point_, winding_rule);
diff --git a/third_party/blink/renderer/core/layout/layout_image.cc b/third_party/blink/renderer/core/layout/layout_image.cc index 5f6f8d3..86fda4f7 100644 --- a/third_party/blink/renderer/core/layout/layout_image.cc +++ b/third_party/blink/renderer/core/layout/layout_image.cc
@@ -28,7 +28,6 @@ #include "third_party/blink/renderer/core/layout/layout_image.h" -#include "third_party/blink/public/common/permissions_policy/permissions_policy.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" @@ -36,7 +35,6 @@ #include "third_party/blink/renderer/core/html/html_area_element.h" #include "third_party/blink/renderer/core/html/html_image_element.h" #include "third_party/blink/renderer/core/html/media/html_video_element.h" -#include "third_party/blink/renderer/core/html/media/media_element_parser_helpers.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" @@ -147,7 +145,7 @@ if (!did_increment_visually_non_empty_pixel_count_) { // At a zoom level of 1 the image is guaranteed to have an integer size. View()->GetFrameView()->IncrementVisuallyNonEmptyPixelCount( - gfx::ToFlooredSize(ImageSizeOverriddenByIntrinsicSize(1.0f))); + gfx::ToFlooredSize(image_resource_->ImageSize(1.0f))); did_increment_visually_non_empty_pixel_count_ = true; } @@ -186,7 +184,7 @@ PhysicalSize old_intrinsic_size = IntrinsicSize(); PhysicalSize new_intrinsic_size = PhysicalSize::FromSizeFRound( - ImageSizeOverriddenByIntrinsicSize(StyleRef().EffectiveZoom())); + image_resource_->ImageSize(StyleRef().EffectiveZoom())); UpdateIntrinsicSizeIfNeeded(new_intrinsic_size); // In the case of generated image content using :before/:after/content, we @@ -308,44 +306,6 @@ return inside; } -bool LayoutImage::HasOverriddenIntrinsicSize() const { - NOT_DESTROYED(); - if (!RuntimeEnabledFeatures::ExperimentalPoliciesEnabled()) - return false; - auto* image_element = DynamicTo<HTMLImageElement>(GetNode()); - return image_element && image_element->IsDefaultIntrinsicSize(); -} - -gfx::SizeF LayoutImage::ImageSizeOverriddenByIntrinsicSize( - float multiplier) const { - NOT_DESTROYED(); - if (!HasOverriddenIntrinsicSize()) - return image_resource_->ImageSize(multiplier); - - gfx::SizeF overridden_intrinsic_size(kDefaultWidth, kDefaultHeight); - if (multiplier != 1) { - overridden_intrinsic_size.Scale(multiplier); - if (overridden_intrinsic_size.width() < 1.0f) - overridden_intrinsic_size.set_width(1.0f); - if (overridden_intrinsic_size.height() < 1.0f) - overridden_intrinsic_size.set_height(1.0f); - } - - return overridden_intrinsic_size; -} - -bool LayoutImage::OverrideIntrinsicSizingInfo( - IntrinsicSizingInfo& intrinsic_sizing_info) const { - NOT_DESTROYED(); - if (!HasOverriddenIntrinsicSize()) - return false; - - gfx::SizeF overridden_intrinsic_size(kDefaultWidth, kDefaultHeight); - intrinsic_sizing_info.size = overridden_intrinsic_size; - intrinsic_sizing_info.aspect_ratio = intrinsic_sizing_info.size; - return true; -} - bool LayoutImage::CanApplyObjectViewBox() const { if (!EmbeddedSVGImage()) { return true; @@ -360,28 +320,27 @@ IntrinsicSizingInfo& intrinsic_sizing_info) const { NOT_DESTROYED(); DCHECK(!ShouldApplySizeContainment()); - if (!OverrideIntrinsicSizingInfo(intrinsic_sizing_info)) { - if (EmbeddedSVGImage()) { - intrinsic_sizing_info = - image_resource_->GetNaturalDimensions(StyleRef().EffectiveZoom()); + if (EmbeddedSVGImage()) { + intrinsic_sizing_info = + image_resource_->GetNaturalDimensions(StyleRef().EffectiveZoom()); - if (auto view_box_size = ComputeObjectViewBoxSizeForIntrinsicSizing()) { - DCHECK(intrinsic_sizing_info.has_width); - DCHECK(intrinsic_sizing_info.has_height); - intrinsic_sizing_info.size = *view_box_size; - } - - // The value returned by LayoutImageResource will be in zoomed CSS - // pixels, but for the 'scale-down' object-fit value we want "zoomed - // device pixels", so undo the DPR part here. - if (StyleRef().GetObjectFit() == EObjectFit::kScaleDown) { - intrinsic_sizing_info.size.InvScale(ImageDevicePixelRatio()); - } - return; + if (auto view_box_size = ComputeObjectViewBoxSizeForIntrinsicSizing()) { + DCHECK(intrinsic_sizing_info.has_width); + DCHECK(intrinsic_sizing_info.has_height); + intrinsic_sizing_info.size = *view_box_size; } - LayoutReplaced::ComputeIntrinsicSizingInfo(intrinsic_sizing_info); + // The value returned by LayoutImageResource will be in zoomed CSS + // pixels, but for the 'scale-down' object-fit value we want "zoomed + // device pixels", so undo the DPR part here. + if (StyleRef().GetObjectFit() == EObjectFit::kScaleDown) { + intrinsic_sizing_info.size.InvScale(ImageDevicePixelRatio()); + } + return; } + + LayoutReplaced::ComputeIntrinsicSizingInfo(intrinsic_sizing_info); + // Don't compute an intrinsic ratio to preserve historical WebKit behavior if // we're painting alt text and/or a broken image. // Video is excluded from this behavior because video elements have a default @@ -405,20 +364,6 @@ return DynamicTo<SVGImage>(cached_image->GetImage()); } -void LayoutImage::UpdateAfterLayout() { - NOT_DESTROYED(); - LayoutBox::UpdateAfterLayout(); - Node* node = GetNode(); - if (auto* image_element = DynamicTo<HTMLImageElement>(node)) { - media_element_parser_helpers::CheckUnsizedMediaViolation( - this, image_element->IsDefaultIntrinsicSize()); - image_element->SetAutoSizesUsecounter(); - } else if (auto* video_element = DynamicTo<HTMLVideoElement>(node)) { - media_element_parser_helpers::CheckUnsizedMediaViolation( - this, video_element->IsDefaultIntrinsicSize()); - } -} - void LayoutImage::MutableForPainting::UpdatePaintedRect( const PhysicalRect& paint_rect) { // As an optimization for sprite sheets, an image may use the cull rect when
diff --git a/third_party/blink/renderer/core/layout/layout_image.h b/third_party/blink/renderer/core/layout/layout_image.h index c114f01..4a866e9e 100644 --- a/third_party/blink/renderer/core/layout/layout_image.h +++ b/third_party/blink/renderer/core/layout/layout_image.h
@@ -105,8 +105,6 @@ return "LayoutImage"; } - void UpdateAfterLayout() override; - class MutableForPainting : public LayoutObject::MutableForPainting { public: void UpdatePaintedRect(const PhysicalRect& paint_rect);
diff --git a/third_party/blink/renderer/core/layout/layout_video.cc b/third_party/blink/renderer/core/layout/layout_video.cc index 650f2ba..89c66b65 100644 --- a/third_party/blink/renderer/core/layout/layout_video.cc +++ b/third_party/blink/renderer/core/layout/layout_video.cc
@@ -79,14 +79,6 @@ HTMLVideoElement* video = VideoElement(); DCHECK(video); - if (RuntimeEnabledFeatures::ExperimentalPoliciesEnabled()) { - if (video->IsDefaultIntrinsicSize()) { - PhysicalSize size = DefaultSize(); - size.Scale(scale); - return size; - } - } - auto display_mode = GetDisplayMode(); // Special case: If the poster image is the "default poster image", we should
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_image.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_image.cc index 586e510..70bfb1c9 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_image.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_image.cc
@@ -25,7 +25,6 @@ #include "third_party/blink/renderer/core/layout/svg/layout_svg_image.h" -#include "third_party/blink/renderer/core/html/media/media_element_parser_helpers.h" #include "third_party/blink/renderer/core/layout/hit_test_location.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" #include "third_party/blink/renderer/core/layout/intrinsic_sizing_info.h" @@ -76,14 +75,6 @@ LayoutSVGModelObject::WillBeDestroyed(); } -bool LayoutSVGImage::HasOverriddenIntrinsicSize() const { - NOT_DESTROYED(); - if (!RuntimeEnabledFeatures::ExperimentalPoliciesEnabled()) - return false; - auto* svg_image_element = DynamicTo<SVGImageElement>(GetElement()); - return svg_image_element && svg_image_element->IsDefaultIntrinsicSize(); -} - gfx::SizeF LayoutSVGImage::CalculateObjectSize() const { NOT_DESTROYED(); @@ -100,15 +91,10 @@ const gfx::SizeF kDefaultObjectSize(LayoutReplaced::kDefaultWidth, LayoutReplaced::kDefaultHeight); IntrinsicSizingInfo sizing_info; - if (HasOverriddenIntrinsicSize()) { - sizing_info.size = kDefaultObjectSize; - sizing_info.aspect_ratio = sizing_info.size; - } else { - if (!image_resource_->HasImage() || image_resource_->ErrorOccurred()) { - return gfx::SizeF(style_size.x(), style_size.y()); - } - sizing_info = image_resource_->GetNaturalDimensions(1); + if (!image_resource_->HasImage() || image_resource_->ErrorOccurred()) { + return gfx::SizeF(style_size.x(), style_size.y()); } + sizing_info = image_resource_->GetNaturalDimensions(1); const gfx::SizeF concrete_object_size = ConcreteObjectSize(sizing_info, kDefaultObjectSize); @@ -174,10 +160,6 @@ bool LayoutSVGImage::UpdateAfterSVGLayout(const SVGLayoutInfo& layout_info, bool bbox_changed) { - if (auto* svg_image_element = DynamicTo<SVGImageElement>(GetElement())) { - media_element_parser_helpers::CheckUnsizedMediaViolation( - this, svg_image_element->IsDefaultIntrinsicSize()); - } if (bbox_changed) { SetShouldDoFullPaintInvalidation(PaintInvalidationReason::kSVGResource);
diff --git a/third_party/blink/renderer/core/loader/web_bundle/script_web_bundle_rule_test.cc b/third_party/blink/renderer/core/loader/web_bundle/script_web_bundle_rule_test.cc index 70733ff..6c8a4e8 100644 --- a/third_party/blink/renderer/core/loader/web_bundle/script_web_bundle_rule_test.cc +++ b/third_party/blink/renderer/core/loader/web_bundle/script_web_bundle_rule_test.cc
@@ -25,7 +25,9 @@ std::optional<mojom::ConsoleMessageCategory>) override { message_ = message; } - void AddConsoleMessageImpl(ConsoleMessage*, bool) override { NOTREACHED(); } + void AddConsoleMessageImpl(ConsoleMessage*, bool) override { + NOTREACHED_IN_MIGRATION(); + } String message_; };
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc index 93df15ea..08f557f7 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -469,6 +469,19 @@ return GetRasterMode() == RasterMode::kGPU; } +bool OffscreenCanvas::EnableAcceleration() { + // Unlike HTML canvases, offscreen canvases don't automatically shift between + // CPU and GPU. Instead, we just return true if the canvas exists on GPU, or + // false if the canvas is CPU-bound. If the canvas' resource provider doesn't + // exist yet, we create it here. + // Note that `OffscreenCanvas::IsAccelerated` above is not equivalent! This + // returns false if the canvas resource provider doesn't exist yet, even if it + // will be an accelerated canvas once it has been created. + CanvasResourceProvider* provider = + GetOrCreateCanvasResourceProvider(RasterModeHint::kPreferGPU); + return provider->IsAccelerated(); +} + bool OffscreenCanvas::HasPlaceholderCanvas() const { return placeholder_canvas_id_ != kInvalidDOMNodeId; }
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h index 1c917e02..c1a3c79 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h
@@ -181,6 +181,9 @@ // overrides CanvasImageSource::IsAccelerated() bool IsAccelerated() const final; + // overrides CanvasRenderingContextHost::EnableAcceleration() + bool EnableAcceleration() final; + DispatchEventResult HostDispatchEvent(Event* event) override { return DispatchEvent(*event); }
diff --git a/third_party/blink/renderer/core/paint/outline_painter_test.cc b/third_party/blink/renderer/core/paint/outline_painter_test.cc index 1c6eb328..4d03a2e 100644 --- a/third_party/blink/renderer/core/paint/outline_painter_test.cc +++ b/third_party/blink/renderer/core/paint/outline_painter_test.cc
@@ -72,8 +72,9 @@ path.close(); // Collapsed contour should not cause crash and should be ignored. OutlinePainter::IterateRightAnglePathForTesting( - path, WTF::BindRepeating( - [](const Vector<OutlinePainter::Line>&) { NOTREACHED(); })); + path, WTF::BindRepeating([](const Vector<OutlinePainter::Line>&) { + NOTREACHED_IN_MIGRATION(); + })); } } // namespace blink
diff --git a/third_party/blink/renderer/core/permissions_policy/build.gni b/third_party/blink/renderer/core/permissions_policy/build.gni index 8cb7f79..2cf712d 100644 --- a/third_party/blink/renderer/core/permissions_policy/build.gni +++ b/third_party/blink/renderer/core/permissions_policy/build.gni
@@ -12,8 +12,6 @@ "permissions_policy_devtools_support.h", "permissions_policy_devtools_support.cc", "iframe_policy.h", - "layout_animations_policy.cc", - "layout_animations_policy.h", "policy_helper.h", ]
diff --git a/third_party/blink/renderer/core/permissions_policy/document_policy_features.json5 b/third_party/blink/renderer/core/permissions_policy/document_policy_features.json5 index 4659402..d5a8814c 100644 --- a/third_party/blink/renderer/core/permissions_policy/document_policy_features.json5 +++ b/third_party/blink/renderer/core/permissions_policy/document_policy_features.json5
@@ -102,34 +102,6 @@ depends_on: ["ExperimentalPolicies"], }, { - name: "UnsizedMedia", - document_policy_name: "unsized-media", - value_type: "Bool", - default_value: "true", - depends_on: ["ExperimentalPolicies"], - }, - { - name: "LayoutAnimations", - document_policy_name: "layout-animations", - value_type: "Bool", - default_value: "true", - depends_on: ["ExperimentalPolicies"], - }, - { - name: "DocumentWrite", - document_policy_name: "document-write", - value_type: "Bool", - default_value: "true", - depends_on: ["ExperimentalPolicies"], - }, - { - name: "SyncScript", - document_policy_name: "sync-script", - value_type: "Bool", - default_value: "true", - depends_on: ["ExperimentalPolicies"], - }, - { name: "JSProfiling", document_policy_name: "js-profiling", value_type: "Bool",
diff --git a/third_party/blink/renderer/core/permissions_policy/dom_feature_policy.cc b/third_party/blink/renderer/core/permissions_policy/dom_feature_policy.cc index a751a35..e8e61fe1 100644 --- a/third_party/blink/renderer/core/permissions_policy/dom_feature_policy.cc +++ b/third_party/blink/renderer/core/permissions_policy/dom_feature_policy.cc
@@ -19,9 +19,11 @@ namespace blink { bool FeatureAvailable(const String& feature, ExecutionContext* ec) { - return GetDefaultFeatureNameMap().Contains(feature) && + bool is_isolated_context = ec && ec->IsIsolatedContext(); + return GetDefaultFeatureNameMap(is_isolated_context).Contains(feature) && (!DisabledByOriginTrial(feature, ec)) && - (!IsFeatureForMeasurementOnly(GetDefaultFeatureNameMap().at(feature))); + (!IsFeatureForMeasurementOnly( + GetDefaultFeatureNameMap(is_isolated_context).at(feature))); } DOMFeaturePolicy::DOMFeaturePolicy(ExecutionContext* context) @@ -36,7 +38,10 @@ ? WebFeature::kFeaturePolicyJSAPIAllowsFeatureIFrame : WebFeature::kFeaturePolicyJSAPIAllowsFeatureDocument); if (FeatureAvailable(feature, execution_context)) { - auto feature_name = GetDefaultFeatureNameMap().at(feature); + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); + auto feature_name = + GetDefaultFeatureNameMap(is_isolated_context).at(feature); return GetPolicy()->IsFeatureEnabled(feature_name); } @@ -69,7 +74,9 @@ return false; } - auto feature_name = GetDefaultFeatureNameMap().at(feature); + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); + auto feature_name = GetDefaultFeatureNameMap(is_isolated_context).at(feature); return GetPolicy()->IsFeatureEnabledForOrigin(feature_name, origin->ToUrlOrigin()); } @@ -94,8 +101,11 @@ ? WebFeature::kFeaturePolicyJSAPIAllowedFeaturesIFrame : WebFeature::kFeaturePolicyJSAPIAllowedFeaturesDocument); Vector<String> allowed_features; + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); for (const String& feature : GetAvailableFeatures(execution_context)) { - auto feature_name = GetDefaultFeatureNameMap().at(feature); + auto feature_name = + GetDefaultFeatureNameMap(is_isolated_context).at(feature); if (GetPolicy()->IsFeatureEnabled(feature_name)) allowed_features.push_back(feature); } @@ -111,8 +121,11 @@ IsIFramePolicy() ? WebFeature::kFeaturePolicyJSAPIGetAllowlistIFrame : WebFeature::kFeaturePolicyJSAPIGetAllowlistDocument); + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); if (FeatureAvailable(feature, execution_context)) { - auto feature_name = GetDefaultFeatureNameMap().at(feature); + auto feature_name = + GetDefaultFeatureNameMap(is_isolated_context).at(feature); const PermissionsPolicy::Allowlist allowlist = GetPolicy()->GetAllowlistForFeature(feature_name);
diff --git a/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.cc b/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.cc deleted file mode 100644 index 7ab1031..0000000 --- a/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.cc +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2018 The Chromium Authors -// 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/core/permissions_policy/layout_animations_policy.h" - -#include "third_party/blink/public/common/permissions_policy/document_policy_features.h" -#include "third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom-blink.h" -#include "third_party/blink/renderer/core/css/properties/css_property.h" -#include "third_party/blink/renderer/core/css/properties/longhands.h" -#include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" - -namespace blink { -namespace { -String GetViolationMessage(const CSSProperty& property) { - return String::Format( - "Document policy violation: CSS property '%s' violates document policy " - "'%s' which is disabled in this document", - property.GetPropertyNameString().Utf8().c_str(), - GetDocumentPolicyFeatureInfoMap() - .at(mojom::blink::DocumentPolicyFeature::kLayoutAnimations) - .feature_name.c_str()); -} -} // namespace - -LayoutAnimationsPolicy::LayoutAnimationsPolicy() = default; - -// static -const HashSet<const CSSProperty*>& -LayoutAnimationsPolicy::AffectedCSSProperties() { - DEFINE_STATIC_LOCAL( - HashSet<const CSSProperty*>, properties, - ({&GetCSSPropertyBottom(), &GetCSSPropertyHeight(), &GetCSSPropertyLeft(), - &GetCSSPropertyRight(), &GetCSSPropertyTop(), &GetCSSPropertyWidth()})); - return properties; -} - -// static -void LayoutAnimationsPolicy::ReportViolation( - const CSSProperty& animated_property, - ExecutionContext& context) { - DCHECK(AffectedCSSProperties().Contains(&animated_property)); - context.IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kLayoutAnimations, - ReportOptions::kReportOnFailure, GetViolationMessage(animated_property)); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h b/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h deleted file mode 100644 index f5cc5006..0000000 --- a/third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2018 The Chromium Authors -// 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_CORE_PERMISSIONS_POLICY_LAYOUT_ANIMATIONS_POLICY_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_PERMISSIONS_POLICY_LAYOUT_ANIMATIONS_POLICY_H_ - -#include "third_party/blink/public/common/permissions_policy/permissions_policy.h" -#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -#include "third_party/blink/renderer/platform/wtf/hash_set.h" -#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" - -namespace blink { -class CSSProperty; -class ExecutionContext; - -// Helper methods for for 'layout-animations' (kLayoutAnimations) permissions -// policy. -class LayoutAnimationsPolicy { - DISALLOW_NEW(); - - public: - LayoutAnimationsPolicy(const LayoutAnimationsPolicy&) = delete; - LayoutAnimationsPolicy& operator=(const LayoutAnimationsPolicy&) = delete; - - // Returns a set of the CSS properties which are affected by the permissions - // policy 'layout-animations'. - static const HashSet<const CSSProperty*>& AffectedCSSProperties(); - - // Generates a violation report for the blocked |animation_property| only if - // the feature 'layout-animations' is disabled in |document|. Invoking - // this method emits a potential violation of the 'layout-animations' policy - // which is tracked by - // Blink.UserCounters.FeaturePolicy.PotentialViolation. - static void ReportViolation(const CSSProperty& animated_property, - ExecutionContext& context); - - private: - LayoutAnimationsPolicy(); -}; - -} // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_PERMISSIONS_POLICY_LAYOUT_ANIMATIONS_POLICY_H_
diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 index e808f50..4a4ea0d 100644 --- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 +++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5
@@ -52,6 +52,17 @@ default_value_behind_flag: { default: [], valid_type: "list", + }, + + // "visibility" specifies which contexts a feature should be visible to. If + // a features is not visibile to a document, it cannot be granted, but also + // will not be exposed in `document.featurePolicy.features()`. + visibility: { + default: "All", + valid_values: [ + "All", + "IsolatedContext" + ] } }, @@ -219,6 +230,7 @@ name: "DirectSockets", permissions_policy_name: "direct-sockets", depends_on: ["DirectSockets"], + visibility: "IsolatedContext", }, { name: "DisplayCapture", @@ -385,6 +397,7 @@ name: "SmartCard", permissions_policy_name: "smart-card", depends_on: ["SmartCard"], + visibility: "IsolatedContext", }, { name: "SpeakerSelection", @@ -400,6 +413,7 @@ name: "SubApps", permissions_policy_name: "sub-apps", depends_on: ["DesktopPWAsSubApps"], + visibility: "IsolatedContext", }, { name: "SyncXHR", @@ -438,6 +452,7 @@ name: "WebPrinting", permissions_policy_name: "web-printing", depends_on: ["WebPrinting"], + visibility: "IsolatedContext", }, { name: "WebShare",
diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc b/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc index bcebe92..52bd441a 100644 --- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc +++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc
@@ -547,13 +547,17 @@ PolicyParserMessageBuffer& feature_policy_logger, PolicyParserMessageBuffer& permissions_policy_logger, ExecutionContext* execution_context) { + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); ParsedPermissionsPolicy permissions_policy = ParsingContext(permissions_policy_logger, origin, nullptr, - GetDefaultFeatureNameMap(), execution_context) + GetDefaultFeatureNameMap(is_isolated_context), + execution_context) .ParsePermissionsPolicy(permissions_policy_header); ParsedPermissionsPolicy feature_policy = ParsingContext(feature_policy_logger, origin, nullptr, - GetDefaultFeatureNameMap(), execution_context) + GetDefaultFeatureNameMap(is_isolated_context), + execution_context) .ParseFeaturePolicy(feature_policy_header); FeatureObserver observer; @@ -570,7 +574,9 @@ permissions_policy.push_back(policy_declaration); } else { overlap_features.push_back( - GetNameForFeature(policy_declaration.feature).Ascii().c_str()); + GetNameForFeature(policy_declaration.feature, is_isolated_context) + .Ascii() + .c_str()); } } @@ -595,8 +601,11 @@ scoped_refptr<const SecurityOrigin> src_origin, PolicyParserMessageBuffer& logger, ExecutionContext* execution_context) { + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); return ParsingContext(logger, self_origin, src_origin, - GetDefaultFeatureNameMap(), execution_context) + GetDefaultFeatureNameMap(is_isolated_context), + execution_context) .ParseFeaturePolicy(policy); } @@ -605,8 +614,11 @@ scoped_refptr<const SecurityOrigin> origin, PolicyParserMessageBuffer& logger, ExecutionContext* execution_context) { + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); return ParsingContext(logger, origin, /*src_origin=*/nullptr, - GetDefaultFeatureNameMap(), execution_context) + GetDefaultFeatureNameMap(is_isolated_context), + execution_context) .ParsePolicyFromNode(policy); } @@ -695,7 +707,9 @@ const Vector<String> GetAvailableFeatures(ExecutionContext* execution_context) { Vector<String> available_features; - for (const auto& feature : GetDefaultFeatureNameMap()) { + bool is_isolated_context = + execution_context && execution_context->IsIsolatedContext(); + for (const auto& feature : GetDefaultFeatureNameMap(is_isolated_context)) { if (!DisabledByOriginTrial(feature.key, execution_context) && !IsFeatureForMeasurementOnly(feature.value)) { available_features.push_back(feature.key); @@ -704,9 +718,9 @@ return available_features; } -const String& GetNameForFeature( - mojom::blink::PermissionsPolicyFeature feature) { - for (const auto& entry : GetDefaultFeatureNameMap()) { +const String GetNameForFeature(mojom::blink::PermissionsPolicyFeature feature, + bool is_isolated_context) { + for (const auto& entry : GetDefaultFeatureNameMap(is_isolated_context)) { if (entry.value == feature) { return entry.key; }
diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h b/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h index 589f6bd..f591611 100644 --- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h +++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h
@@ -137,8 +137,9 @@ CORE_EXPORT void AllowFeatureEverywhere(mojom::blink::PermissionsPolicyFeature, ParsedPermissionsPolicy&); -CORE_EXPORT const String& GetNameForFeature( - mojom::blink::PermissionsPolicyFeature); +CORE_EXPORT const String +GetNameForFeature(mojom::blink::PermissionsPolicyFeature, + bool is_isolated_context); } // namespace blink
diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc b/third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc index 564b6d2..3aa55b1 100644 --- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc +++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc
@@ -7,14 +7,18 @@ #include "base/ranges/algorithm.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/permissions_policy/origin_with_possible_wildcards.h" #include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" +#include "third_party/blink/renderer/core/execution_context/agent.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/loader/empty_clients.h" #include "third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h" +#include "third_party/blink/renderer/core/permissions_policy/policy_helper.h" #include "third_party/blink/renderer/core/testing/page_test_base.h" #include "third_party/blink/renderer/platform/testing/task_environment.h" #include "url/gurl.h" @@ -1517,5 +1521,41 @@ test::TaskEnvironment task_environment_; }; +class FeaturePolicyVisibilityTest + : public testing::Test, + public testing::WithParamInterface</*is_isolated=*/bool> { + public: + FeaturePolicyVisibilityTest() : is_isolated_(GetParam()) { + feature_list_.InitWithFeatures( + /*enabled_features=*/{features::kDirectSockets}, + /*disabled_features=*/{}); + } + + bool GetIsIsolated() { return is_isolated_; } + + private: + test::TaskEnvironment task_environment_; + base::test::ScopedFeatureList feature_list_; + bool is_isolated_{false}; +}; + +INSTANTIATE_TEST_SUITE_P(All, FeaturePolicyVisibilityTest, testing::Bool()); + +TEST_P(FeaturePolicyVisibilityTest, VerifyIsolated) { + EXPECT_TRUE(RuntimeEnabledFeatures::DirectSocketsEnabled()); + + auto dummy_page_holder = std::make_unique<DummyPageHolder>(); + ExecutionContext* execution_context = + dummy_page_holder->GetFrame().DomWindow(); + Agent::ResetIsIsolatedContextForTest(); + Agent::SetIsIsolatedContext(GetIsIsolated()); + bool is_isolated_context = execution_context->IsIsolatedContext(); + EXPECT_EQ(is_isolated_context, GetIsIsolated()); + const String kDirectSocketsFeature = "direct-sockets"; + EXPECT_EQ(GetDefaultFeatureNameMap(is_isolated_context) + .Contains(kDirectSocketsFeature), + GetIsIsolated()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/permissions_policy/policy_helper.h b/third_party/blink/renderer/core/permissions_policy/policy_helper.h index a42018b..7e50fa59 100644 --- a/third_party/blink/renderer/core/permissions_policy/policy_helper.h +++ b/third_party/blink/renderer/core/permissions_policy/policy_helper.h
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "third_party/blink/renderer/platform/wtf/hash_set.h" +#include "third_party/blink/renderer/platform/wtf/hash_traits.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/vector.h" @@ -59,17 +60,42 @@ bool discard_message_ = false; }; +struct FeatureNameMapCacheKey { + bool IsIsolatedContext = false; + bool is_deleted_value = false; + bool is_empty_value = false; + + FeatureNameMapCacheKey() : is_empty_value(true) {} + explicit FeatureNameMapCacheKey(const bool& IsIsolatedContext) + : IsIsolatedContext(IsIsolatedContext) {} + explicit FeatureNameMapCacheKey(WTF::HashTableDeletedValueType) + : is_deleted_value(true) {} + + bool IsHashTableDeletedValue() const { return is_deleted_value; } + + bool operator==(const FeatureNameMapCacheKey& other) const { + return IsIsolatedContext == other.IsIsolatedContext && + is_deleted_value == other.is_deleted_value && + is_empty_value == other.is_empty_value; + } + bool operator!=(const FeatureNameMapCacheKey& other) const { + return !(*this == other); + } +}; using FeatureNameMap = HashMap<String, mojom::blink::PermissionsPolicyFeature>; +using FeatureNameMapCache = HashMap<FeatureNameMapCacheKey, FeatureNameMap>; using DocumentPolicyFeatureSet = HashSet<mojom::blink::DocumentPolicyFeature>; +class ExecutionContext; class FeatureContext; // This method defines the feature names which will be recognized by the parser // for the Permissions-Policy HTTP header and the <iframe> "allow" attribute, as // well as the features which will be recognized by the document or iframe // policy object. -const FeatureNameMap& GetDefaultFeatureNameMap(); +CORE_EXPORT const FeatureNameMap +GetDefaultFeatureNameMap(bool is_isolated_context); // This method defines the feature names which will be recognized by the parser // for the Document-Policy HTTP header and the <iframe> "policy" attribute, as @@ -94,8 +120,30 @@ // Converts |mojom::blink::PermissionsPolicyFeature| to enum used in devtools // protocol. String PermissionsPolicyFeatureToProtocol( - mojom::blink::PermissionsPolicyFeature); + mojom::blink::PermissionsPolicyFeature, + ExecutionContext*); } // namespace blink +namespace WTF { + +// A helper that defines the hash function and the invalid 'empty value' that +// HashMap should use internally. +template <> +struct HashTraits<blink::FeatureNameMapCacheKey> + : SimpleClassHashTraits<blink::FeatureNameMapCacheKey> { + static unsigned GetHash(const blink::FeatureNameMapCacheKey& key) { + unsigned hash = HashInt(key.IsIsolatedContext); + AddIntToHash(hash, key.is_deleted_value); + AddIntToHash(hash, key.is_empty_value); + return hash; + } + static const bool kEmptyValueIsZero = false; + static blink::FeatureNameMapCacheKey EmptyValue() { + return blink::FeatureNameMapCacheKey(); + } +}; + +} // namespace WTF + #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PERMISSIONS_POLICY_POLICY_HELPER_H_
diff --git a/third_party/blink/renderer/core/script/script_loader.cc b/third_party/blink/renderer/core/script/script_loader.cc index 2d70be4..f48f770c 100644 --- a/third_party/blink/renderer/core/script/script_loader.cc +++ b/third_party/blink/renderer/core/script/script_loader.cc
@@ -28,10 +28,7 @@ #include "base/metrics/histogram_functions.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" #include "third_party/blink/public/common/features.h" -#include "third_party/blink/public/common/permissions_policy/permissions_policy.h" #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h" -#include "third_party/blink/public/mojom/permissions_policy/policy_disposition.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -541,29 +538,6 @@ return network::mojom::CredentialsMode::kOmit; } -// https://github.com/WICG/document-policy/issues/2 -bool ShouldBlockSyncScriptForDocumentPolicy( - const ScriptElementBase* element, - ScriptLoader::ScriptTypeAtPrepare script_type, - bool parser_inserted) { - if (element->GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kSyncScript)) { - return false; - } - - // Non-classic scripts don't block parsing. - if (script_type == ScriptLoader::ScriptTypeAtPrepare::kModule || - script_type == ScriptLoader::ScriptTypeAtPrepare::kImportMap || - script_type == ScriptLoader::ScriptTypeAtPrepare::kSpeculationRules || - script_type == ScriptLoader::ScriptTypeAtPrepare::kWebBundle || - !parser_inserted) - return false; - - if (!element->HasSourceAttribute()) - return true; - return !element->DeferAttributeValue() && !element->AsyncAttributeValue(); -} - // <specdef href="https://html.spec.whatwg.org/C/#prepare-the-script-element"> PendingScript* ScriptLoader::PrepareScript( ParserBlockingInlineOption parser_blocking_inline_option, @@ -684,15 +658,6 @@ if (!IsScriptForEventSupported()) return nullptr; - if (ShouldBlockSyncScriptForDocumentPolicy(element_.Get(), GetScriptType(), - parser_inserted_)) { - context_window->ReportDocumentPolicyViolation( - mojom::blink::DocumentPolicyFeature::kSyncScript, - mojom::blink::PolicyDisposition::kEnforce, - "Synchronous script execution is disabled by Document Policy"); - return nullptr; - } - // 14. is handled below. // <spec step="21">Let classic script CORS setting be the current state of
diff --git a/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.h b/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.h index 785255e..fb21d9d8 100644 --- a/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.h +++ b/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.h
@@ -76,13 +76,13 @@ void WillRemoveHorizontalScrollbar(Scrollbar&) final; bool SetScrollbarsVisibleForTesting(bool) final { return true; } void DidChangeUserVisibleScrollOffset(const ScrollOffset&) final; - void UpdateScrollerStyle() final { NOTREACHED(); } + void UpdateScrollerStyle() final { NOTREACHED_IN_MIGRATION(); } bool ScrollbarPaintTimerIsActive() const final { NOTREACHED_IN_MIGRATION(); return false; } - void StartScrollbarPaintTimer() final { NOTREACHED(); } - void StopScrollbarPaintTimer() final { NOTREACHED(); } + void StartScrollbarPaintTimer() final { NOTREACHED_IN_MIGRATION(); } + void StopScrollbarPaintTimer() final { NOTREACHED_IN_MIGRATION(); } void Dispose() final; private:
diff --git a/third_party/blink/renderer/core/style/anchor_specifier_value.cc b/third_party/blink/renderer/core/style/anchor_specifier_value.cc index fbc5854..e5f63ca 100644 --- a/third_party/blink/renderer/core/style/anchor_specifier_value.cc +++ b/third_party/blink/renderer/core/style/anchor_specifier_value.cc
@@ -19,14 +19,6 @@ return instance; } -// static -AnchorSpecifierValue* AnchorSpecifierValue::Auto() { - DEFINE_STATIC_LOCAL(Persistent<AnchorSpecifierValue>, instance, - {MakeGarbageCollected<AnchorSpecifierValue>( - base::PassKey<AnchorSpecifierValue>(), Type::kAuto)}); - return instance; -} - AnchorSpecifierValue::AnchorSpecifierValue(base::PassKey<AnchorSpecifierValue>, Type type) : type_(type) {
diff --git a/third_party/blink/renderer/core/style/anchor_specifier_value.h b/third_party/blink/renderer/core/style/anchor_specifier_value.h index 5f44a00..16f8c64 100644 --- a/third_party/blink/renderer/core/style/anchor_specifier_value.h +++ b/third_party/blink/renderer/core/style/anchor_specifier_value.h
@@ -21,22 +21,19 @@ public: enum class Type { kDefault, - kAuto, kNamed, }; // Creates a named value. explicit AnchorSpecifierValue(const ScopedCSSName&); - // Gets or creates the default/auto keyword values. + // Gets or creates the default keyword value. static AnchorSpecifierValue* Default(); - static AnchorSpecifierValue* Auto(); // For creating the keyword values only. explicit AnchorSpecifierValue(base::PassKey<AnchorSpecifierValue>, Type type); bool IsDefault() const { return type_ == Type::kDefault; } - bool IsAuto() const { return type_ == Type::kAuto; } bool IsNamed() const { return type_ == Type::kNamed; } const ScopedCSSName& GetName() const { DCHECK(IsNamed());
diff --git a/third_party/blink/renderer/core/svg/svg_image_element.cc b/third_party/blink/renderer/core/svg/svg_image_element.cc index 58ce3a4e..b653fbe 100644 --- a/third_party/blink/renderer/core/svg/svg_image_element.cc +++ b/third_party/blink/renderer/core/svg/svg_image_element.cc
@@ -21,8 +21,6 @@ #include "third_party/blink/renderer/core/svg/svg_image_element.h" -#include "third_party/blink/public/mojom/permissions_policy/document_policy_feature.mojom-blink.h" -#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css/style_change_reason.h" #include "third_party/blink/renderer/core/frame/web_feature.h" @@ -41,10 +39,6 @@ : SVGGraphicsElement(svg_names::kImageTag, document), SVGURIReference(this), ActiveScriptWrappable<SVGImageElement>({}), - is_default_overridden_intrinsic_size_( - GetExecutionContext() && - !GetExecutionContext()->IsFeatureEnabled( - mojom::blink::DocumentPolicyFeature::kUnsizedMedia)), x_(MakeGarbageCollected<SVGAnimatedLength>( this, svg_names::kXAttr,
diff --git a/third_party/blink/renderer/core/svg/svg_image_element.h b/third_party/blink/renderer/core/svg/svg_image_element.h index 65aebd8..cbcaa5d 100644 --- a/third_party/blink/renderer/core/svg/svg_image_element.h +++ b/third_party/blink/renderer/core/svg/svg_image_element.h
@@ -67,10 +67,6 @@ return GetImageLoader().GetContent(); } - bool IsDefaultIntrinsicSize() const { - return is_default_overridden_intrinsic_size_; - } - void SetImageForTest(ImageResourceContent* content) { GetImageLoader().SetImageForTest(content); } @@ -106,8 +102,6 @@ void CollectExtraStyleForPresentationAttribute( MutableCSSPropertyValueSet* style) override; - bool is_default_overridden_intrinsic_size_; - Member<SVGAnimatedLength> x_; Member<SVGAnimatedLength> y_; Member<SVGAnimatedLength> width_;
diff --git a/third_party/blink/renderer/core/xml/parser/xml_document_parser.h b/third_party/blink/renderer/core/xml/parser/xml_document_parser.h index 47af4e6..94d10ad 100644 --- a/third_party/blink/renderer/core/xml/parser/xml_document_parser.h +++ b/third_party/blink/renderer/core/xml/parser/xml_document_parser.h
@@ -129,7 +129,7 @@ private: // From DocumentParser - void insert(const String&) override { NOTREACHED(); } + void insert(const String&) override { NOTREACHED_IN_MIGRATION(); } void Append(const String&) override; void Finish() override; void ExecuteScriptsWaitingForResources() final;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 1c445864..8c805e7 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -1408,14 +1408,6 @@ SerializeAriaNotificationAttributes( AXObjectCache().RetrieveAriaNotifications(this), node_data); - - // Return early. The following attributes are unnecessary for ignored nodes. - // Exception: focusable ignored nodes are fully serialized, so that reasonable - // verbalizations can be made if they actually receive focus. - if (IsIgnored() && - !node_data->HasState(ax::mojom::blink::State::kFocusable)) { - return; - } } void AXObject::SerializeBoundingBoxAttributes(ui::AXNodeData& dst) const { @@ -4655,7 +4647,7 @@ AXObjectSet visited_copy = visited; text_alternative = TextFromElements( true, visited_copy, elements_from_attribute, related_objects); - if (!text_alternative.IsNull()) { + if (!text_alternative.ContainsOnlyWhitespaceOrEmpty()) { if (name_sources) { NameSource& source = name_sources->back(); source.type = name_from;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index e7f3578d..122ce89 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -5080,9 +5080,9 @@ return; } - TRACE_EVENT0("accessibility", "ProcessLocationChanges"); + TRACE_EVENT0("accessibility", "SerializeLocationChanges"); SCOPED_UMA_HISTOGRAM_TIMER_MICROS( - "Accessibility.Performance.ProcessLocationChanges"); + "Accessibility.Performance.SerializeLocationChanges"); // Ensure enough time has passed since last locations serialization. Document& document = GetDocument();
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc index c823dab8..0d6ce317 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc +++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
@@ -3507,22 +3507,48 @@ return nullptr; } - // We can't rely on the HTMLCanvasElement, because the canvas may not actually - // exist in the HTML. (e.g. `new OffscreenCanvas` has no HTML element.) - // We also can't use GetImage() here, because that will return null if the - // canvas is brand new. We always want an image, even if the canvas doesn't - // have a bridge yet. + // Prepare to flush the canvas to a WebGPU texture. FinalizeFrame(FlushReason::kWebGPUTexture); + + // We will need to access the canvas' resource provider in order to snapshot + // its image below. CanvasRenderingContextHost* host = GetCanvasRenderingContextHost(); - scoped_refptr<StaticBitmapImage> image = - host->GetOrCreateCanvasResourceProvider(RasterModeHint::kPreferGPU) - ->Snapshot(FlushReason::kWebGPUTexture); - if (!image) { + if (!host) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "Unable to access canvas image."); return nullptr; } + // Ensure that the canvas host lives on the GPU. This call is a no-op if the + // host is already accelerated. + // TODO(crbug.com/340911120): if the user requested WillReadFrequently, do we + // want to behave differently here? + const bool host_is_accelerated = host->EnableAcceleration(); + + // A texture needs to exist on the GPU. If we aren't able to enable + // acceleration, the canvas pixels live on the CPU and we weren't able to + // transfer them; in that case, WebGPU access is not possible. + CanvasResourceProvider* provider = + host->GetOrCreateCanvasResourceProvider(RasterModeHint::kPreferGPU); + if (!host_is_accelerated || !provider || !provider->IsAccelerated()) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "Unable to transfer canvas to GPU."); + return nullptr; + } + + // Snapshot the image from the CanvasResourceProvider. + // We use Snapshot instead of GetImage here to ensure that we get an image, + // even if the canvas is empty. + // TODO(crbug.com/340922308): when possible, we should steal the existing + // texture from the resource provider, instead of cloning it. + scoped_refptr<StaticBitmapImage> image = + provider->Snapshot(FlushReason::kWebGPUTexture); + if (!image) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "Unable to snapshot the canvas image."); + return nullptr; + } + SkImageInfo image_info = image->GetSkImageInfo(); scoped_refptr<WebGPUMailboxTexture> texture = WebGPUMailboxTexture::FromStaticBitmapImage( @@ -3532,7 +3558,7 @@ /*is_dummy_mailbox_texture=*/false); if (!texture) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, - "Unable to access canvas texture."); + "Unable to transfer canvas to WebGPU."); return nullptr; } @@ -3583,7 +3609,8 @@ return true; } -void BaseRenderingContext2D::endWebGPUAccess(ExceptionState& exception_state) { +void BaseRenderingContext2D::endWebGPUAccess(blink::GPUTexture* tex, + ExceptionState& exception_state) { // If the context is lost or doesn't exist, this call should be a no-op. // We don't want to throw an exception or attempt any changes if // `endWebGPUAccess` is called during teardown. @@ -3600,12 +3627,13 @@ return; } - // Prevent unbalanced calls to endWebGPUAccess without an earlier call to - // beginWebGPUAccess. - if (!webgpu_access_texture_) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidStateError, - "This canvas is not currently in use by WebGPU."); + // We allow the caller to pass in any reasonable texture. + // TODO(crbug.com/339846593): we do not yet honor the passed-in texture. + // Below this point, our code is still written in terms of + // `webgpu_access_texture_`. This will be fixed in a followup. + if (tex->Destroyed()) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "The texture has been destroyed."); return; }
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h index a797e29b..95c97f01 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h +++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h
@@ -281,20 +281,15 @@ // WebGPU pipeline. The canvas' image can be used as a texture, or the texture // can be bound as a color attachment and modified. After beginWebGPUAccess is // called, the Canvas2D context will become unavailable until endWebGPUAccess - // is called. All other method calls to the context (including additional - // calls to beginWebGPUAccess) will throw InvalidStateError. + // is called. GPUTexture* beginWebGPUAccess(const CanvasWebGPUAccessOption*, ExceptionState& exception_state); - // Returns the canvas' back-buffer texture to Canvas2D after a prior call - // to beginWebGPUAccess. The GPUTexture becomes inaccessible to WebGPU; any - // modifications made to the texture will be preserved. The Canvas2D context - // is restored, and Canvas2D method calls will function normally once more. - // Throws InvalidStateError if a matching call to beginWebGPUAccess was not - // performed. - // Generates a GPUValidationError if the GPUTexture is used after + // Replaces the canvas' back-buffer texture with the passed-in GPUTexture. + // The GPUTexture immediately becomes inaccessible to WebGPU. + // A GPUValidationError will occur if the GPUTexture is used after // endWebGPUAccess is called. - void endWebGPUAccess(ExceptionState& exception_state); + void endWebGPUAccess(blink::GPUTexture* tex, ExceptionState& exception_state); // Returns the format of the GPUTexture that beginWebGPUAccess will return. // This is useful if you need to create the WebGPU render pipeline before
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_web_gpu_access.idl b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_web_gpu_access.idl index c831657..1679e41 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_web_gpu_access.idl +++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_web_gpu_access.idl
@@ -9,6 +9,6 @@ SecureContext ] interface mixin CanvasWebGPUAccess { [RaisesException] GPUTexture beginWebGPUAccess(CanvasWebGPUAccessOption options); - [RaisesException] undefined endWebGPUAccess(); + [RaisesException] undefined endWebGPUAccess(GPUTexture tex); GPUTextureFormat getTextureFormat(); };
diff --git a/third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h b/third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h index 7b24a0c4..65ef626 100644 --- a/third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h +++ b/third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h
@@ -59,7 +59,7 @@ V8RenderingContext* AsV8RenderingContext() final; V8OffscreenRenderingContext* AsV8OffscreenRenderingContext() final; void PageVisibilityChanged() override {} - void Stop() final { NOTREACHED(); } + void Stop() final { NOTREACHED_IN_MIGRATION(); } void ClearRect(double x, double y, double width, double height) override { BaseRenderingContext2D::clearRect(x, y, width, height); }
diff --git a/third_party/blink/renderer/modules/clipboard/clipboard_reader.cc b/third_party/blink/renderer/modules/clipboard/clipboard_reader.cc index a14ee62..24fb9a3f 100644 --- a/third_party/blink/renderer/modules/clipboard/clipboard_reader.cc +++ b/third_party/blink/renderer/modules/clipboard/clipboard_reader.cc
@@ -55,7 +55,9 @@ } private: - void NextRead(Vector<uint8_t> utf8_bytes) override { NOTREACHED(); } + void NextRead(Vector<uint8_t> utf8_bytes) override { + NOTREACHED_IN_MIGRATION(); + } }; // Reads an image from the System Clipboard as a Blob with text/plain content.
diff --git a/third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper_unittest.cc b/third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper_unittest.cc index 68d334db..c42e696e 100644 --- a/third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper_unittest.cc +++ b/third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper_unittest.cc
@@ -53,7 +53,9 @@ NOTREACHED_IN_MIGRATION(); } - void ReceiveMore(uint32_t num_additional_datagrams) override { NOTREACHED(); } + void ReceiveMore(uint32_t num_additional_datagrams) override { + NOTREACHED_IN_MIGRATION(); + } const Vector<uint8_t>& GetReceivedData() const { return data_; } void Trace(cppgc::Visitor* visitor) const {}
diff --git a/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.cc b/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.cc index 97e21603..0eb4e746 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.cc
@@ -21,21 +21,29 @@ namespace blink { -ExceptionCode WebCdmExceptionToExceptionCode( - WebContentDecryptionModuleException cdm_exception) { +void WebCdmExceptionToPromiseRejection( + ScriptPromiseResolverBase* resolver, + WebContentDecryptionModuleException cdm_exception, + const String& message) { switch (cdm_exception) { case kWebContentDecryptionModuleExceptionTypeError: - return ToExceptionCode(ESErrorType::kTypeError); + resolver->RejectWithTypeError(message); + return; case kWebContentDecryptionModuleExceptionNotSupportedError: - return ToExceptionCode(DOMExceptionCode::kNotSupportedError); + resolver->RejectWithDOMException(DOMExceptionCode::kNotSupportedError, + message); + return; case kWebContentDecryptionModuleExceptionInvalidStateError: - return ToExceptionCode(DOMExceptionCode::kInvalidStateError); + resolver->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, + message); + return; case kWebContentDecryptionModuleExceptionQuotaExceededError: - return ToExceptionCode(DOMExceptionCode::kQuotaExceededError); + resolver->RejectWithDOMException(DOMExceptionCode::kQuotaExceededError, + message); + return; } NOTREACHED_IN_MIGRATION(); - return ToExceptionCode(DOMExceptionCode::kUnknownError); } ContentDecryptionModuleResultPromise::ContentDecryptionModuleResultPromise( @@ -51,8 +59,9 @@ NOTREACHED_IN_MIGRATION(); if (!IsValidToFulfillPromise()) return; - Reject(ToExceptionCode(DOMExceptionCode::kInvalidStateError), - "Unexpected completion."); + resolver_->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, + "Unexpected completion."); + resolver_.Clear(); } void ContentDecryptionModuleResultPromise::CompleteWithContentDecryptionModule( @@ -60,8 +69,9 @@ NOTREACHED_IN_MIGRATION(); if (!IsValidToFulfillPromise()) return; - Reject(ToExceptionCode(DOMExceptionCode::kInvalidStateError), - "Unexpected completion."); + resolver_->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, + "Unexpected completion."); + resolver_.Clear(); } void ContentDecryptionModuleResultPromise::CompleteWithSession( @@ -69,16 +79,18 @@ NOTREACHED_IN_MIGRATION(); if (!IsValidToFulfillPromise()) return; - Reject(ToExceptionCode(DOMExceptionCode::kInvalidStateError), - "Unexpected completion."); + resolver_->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, + "Unexpected completion."); + resolver_.Clear(); } void ContentDecryptionModuleResultPromise::CompleteWithKeyStatus( WebEncryptedMediaKeyInformation::KeyStatus) { if (!IsValidToFulfillPromise()) return; - Reject(ToExceptionCode(DOMExceptionCode::kInvalidStateError), - "Unexpected completion."); + resolver_->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, + "Unexpected completion."); + resolver_.Clear(); } void ContentDecryptionModuleResultPromise::CompleteWithError( @@ -118,21 +130,8 @@ result.Append(')'); } - Reject(WebCdmExceptionToExceptionCode(exception_code), result.ToString()); -} -void ContentDecryptionModuleResultPromise::Reject(ExceptionCode code, - const String& error_message) { - DCHECK(IsValidToFulfillPromise()); - - ScriptState::Scope scope(resolver_->GetScriptState()); - ExceptionState exception_state( - resolver_->GetScriptState()->GetIsolate(), - ExceptionContextType::kOperationInvoke, - EncryptedMediaUtils::GetInterfaceName(api_type_), - EncryptedMediaUtils::GetPropertyName(api_type_)); - exception_state.ThrowException(code, error_message); - resolver_->Reject(exception_state); - + WebCdmExceptionToPromiseRejection(resolver_, exception_code, + result.ToString()); resolver_.Clear(); }
diff --git a/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.h b/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.h index 9a17cccc..e1541c6 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.h +++ b/third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.h
@@ -13,8 +13,9 @@ namespace blink { -ExceptionCode WebCdmExceptionToExceptionCode( - WebContentDecryptionModuleException); +void WebCdmExceptionToPromiseRejection(ScriptPromiseResolverBase*, + WebContentDecryptionModuleException, + const String& message); // This class wraps the promise resolver to simplify creation of // ContentDecryptionModuleResult objects. The default implementations of the @@ -66,9 +67,6 @@ resolver_.Clear(); } - // Rejects the promise with a DOMException. - void Reject(ExceptionCode, const String& error_message); - ExecutionContext* GetExecutionContext() const; // Determine if it's OK to resolve/reject this promise.
diff --git a/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.cc b/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.cc index cca67c9..b851f08 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.cc
@@ -156,45 +156,6 @@ return "not-allowed"; } -// static -const char* EncryptedMediaUtils::GetInterfaceName(EmeApiType type) { - switch (type) { - case EmeApiType::kCreateMediaKeys: - return "MediaKeySystemAccess"; - case EmeApiType::kSetServerCertificate: - case EmeApiType::kGetStatusForPolicy: - return "MediaKeys"; - case EmeApiType::kGenerateRequest: - case EmeApiType::kLoad: - case EmeApiType::kUpdate: - case EmeApiType::kClose: - case EmeApiType::kRemove: - return "MediaKeySession"; - } -} - -// static -const char* EncryptedMediaUtils::GetPropertyName(EmeApiType type) { - switch (type) { - case EmeApiType::kCreateMediaKeys: - return "createMediaKeys"; - case EmeApiType::kSetServerCertificate: - return "setServerCertificate"; - case EmeApiType::kGetStatusForPolicy: - return "getStatusForPolicy"; - case EmeApiType::kGenerateRequest: - return "generateRequest"; - case EmeApiType::kLoad: - return "load"; - case EmeApiType::kUpdate: - return "update"; - case EmeApiType::kClose: - return "close"; - case EmeApiType::kRemove: - return "remove"; - } -} - WebEncryptedMediaClient* EncryptedMediaUtils::GetEncryptedMediaClientFromLocalDOMWindow( LocalDOMWindow* window) {
diff --git a/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.h b/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.h index 22b5da0e..9a9a767 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.h +++ b/third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.h
@@ -79,11 +79,6 @@ static WebEncryptedMediaClient* GetEncryptedMediaClientFromLocalDOMWindow( LocalDOMWindow*); - - // Get interface and property name for |type|, e.t. "MediaKeys" and "load", - // respectively. - static const char* GetInterfaceName(EmeApiType type); - static const char* GetPropertyName(EmeApiType type); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc b/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc index a5a43ec..cb50dfc 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc
@@ -34,9 +34,13 @@ public: static ScriptPromise<IDLUndefined> Create(ScriptState*, HTMLMediaElement&, - MediaKeys*); + MediaKeys*, + const ExceptionContext&); - SetMediaKeysHandler(ScriptState*, HTMLMediaElement&, MediaKeys*); + SetMediaKeysHandler(ScriptState*, + HTMLMediaElement&, + MediaKeys*, + const ExceptionContext&); SetMediaKeysHandler(const SetMediaKeysHandler&) = delete; SetMediaKeysHandler& operator=(const SetMediaKeysHandler&) = delete; @@ -52,10 +56,12 @@ void SetNewMediaKeys(); void Finish(); - void Fail(ExceptionCode, const String& error_message); + void Fail(WebContentDecryptionModuleException, const String& error_message); - void ClearFailed(ExceptionCode, const String& error_message); - void SetFailed(ExceptionCode, const String& error_message); + void ClearFailed(WebContentDecryptionModuleException, + const String& error_message); + void SetFailed(WebContentDecryptionModuleException, + const String& error_message); Member<ScriptPromiseResolver<IDLUndefined>> resolver_; // Keep media element alive until promise is fulfilled @@ -69,7 +75,9 @@ }; typedef base::OnceCallback<void()> SuccessCallback; -typedef base::OnceCallback<void(ExceptionCode, const String&)> FailureCallback; +typedef base::OnceCallback<void(WebContentDecryptionModuleException, + const String&)> + FailureCallback; // Represents the result used when setContentDecryptionModule() is called. // Calls |success| if result is resolved, |failure| if result is rejected. @@ -91,7 +99,7 @@ WebContentDecryptionModule*) override { NOTREACHED_IN_MIGRATION(); std::move(failure_callback_) - .Run(ToExceptionCode(DOMExceptionCode::kInvalidStateError), + .Run(kWebContentDecryptionModuleExceptionInvalidStateError, "Unexpected completion."); } @@ -99,7 +107,7 @@ WebContentDecryptionModuleResult::SessionStatus status) override { NOTREACHED_IN_MIGRATION(); std::move(failure_callback_) - .Run(ToExceptionCode(DOMExceptionCode::kInvalidStateError), + .Run(kWebContentDecryptionModuleExceptionInvalidStateError, "Unexpected completion."); } @@ -107,7 +115,7 @@ WebEncryptedMediaKeyInformation::KeyStatus key_status) override { NOTREACHED_IN_MIGRATION(); std::move(failure_callback_) - .Run(ToExceptionCode(DOMExceptionCode::kInvalidStateError), + .Run(kWebContentDecryptionModuleExceptionInvalidStateError, "Unexpected completion."); } @@ -129,8 +137,7 @@ DVLOG(EME_LOG_LEVEL) << __func__ << ": promise rejected with code " << code << " and message: " << result.ToString(); - std::move(failure_callback_) - .Run(WebCdmExceptionToExceptionCode(code), result.ToString()); + std::move(failure_callback_).Run(code, result.ToString()); } private: @@ -141,17 +148,21 @@ ScriptPromise<IDLUndefined> SetMediaKeysHandler::Create( ScriptState* script_state, HTMLMediaElement& element, - MediaKeys* media_keys) { + MediaKeys* media_keys, + const ExceptionContext& exception_context) { SetMediaKeysHandler* handler = MakeGarbageCollected<SetMediaKeysHandler>( - script_state, element, media_keys); + script_state, element, media_keys, exception_context); return handler->resolver_->Promise(); } -SetMediaKeysHandler::SetMediaKeysHandler(ScriptState* script_state, - HTMLMediaElement& element, - MediaKeys* media_keys) +SetMediaKeysHandler::SetMediaKeysHandler( + ScriptState* script_state, + HTMLMediaElement& element, + MediaKeys* media_keys, + const ExceptionContext& exception_context) : resolver_(MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>( - script_state)), + script_state, + exception_context)), element_(element), new_media_keys_(media_keys), made_reservation_(false), @@ -186,7 +197,7 @@ if (new_media_keys_) { if (!new_media_keys_->ReserveForMediaElement(element_.Get())) { this_element.is_attaching_media_keys_ = false; - Fail(ToExceptionCode(DOMExceptionCode::kQuotaExceededError), + Fail(kWebContentDecryptionModuleExceptionQuotaExceededError, "The MediaKeys object is already in use by another media element."); return; } @@ -278,7 +289,7 @@ resolver_->Resolve(); } -void SetMediaKeysHandler::Fail(ExceptionCode code, +void SetMediaKeysHandler::Fail(WebContentDecryptionModuleException code, const String& error_message) { // Reset ownership of |m_newMediaKeys|. if (made_reservation_) @@ -289,15 +300,10 @@ .is_attaching_media_keys_); // Reject promise with an appropriate error. - ScriptState::Scope scope(resolver_->GetScriptState()); - ExceptionState exception_state(resolver_->GetScriptState()->GetIsolate(), - ExceptionContextType::kOperationInvoke, - "HTMLMediaElement", "setMediaKeys"); - exception_state.ThrowException(code, error_message); - resolver_->Reject(exception_state); + WebCdmExceptionToPromiseRejection(resolver_, code, error_message); } -void SetMediaKeysHandler::ClearFailed(ExceptionCode code, +void SetMediaKeysHandler::ClearFailed(WebContentDecryptionModuleException code, const String& error_message) { DVLOG(EME_LOG_LEVEL) << __func__ << "(" << code << ", " << error_message << ")"; @@ -311,7 +317,7 @@ Fail(code, error_message); } -void SetMediaKeysHandler::SetFailed(ExceptionCode code, +void SetMediaKeysHandler::SetFailed(WebContentDecryptionModuleException code, const String& error_message) { DVLOG(EME_LOG_LEVEL) << __func__ << "(" << code << ", " << error_message << ")"; @@ -401,7 +407,8 @@ this_element.is_attaching_media_keys_ = true; // 4. Let promise be a new promise. Remaining steps done in handler. - return SetMediaKeysHandler::Create(script_state, element, media_keys); + return SetMediaKeysHandler::Create(script_state, element, media_keys, + exception_state.GetContext()); } // Create a MediaEncryptedEvent for WD EME.
diff --git a/third_party/blink/renderer/modules/encryptedmedia/media_key_session.cc b/third_party/blink/renderer/modules/encryptedmedia/media_key_session.cc index 2e41bb4..4b2476ba 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/media_key_session.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/media_key_session.cc
@@ -550,8 +550,8 @@ // (Done in constructor.) // 9. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); NewSessionResultPromise* result = MakeGarbageCollected<NewSessionResultPromise>(resolver, config_, this); @@ -649,8 +649,8 @@ // (Available as getExecutionContext()->getSecurityOrigin() anytime.) // 7. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLBoolean>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLBoolean>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); LoadSessionResultPromise* result = MakeGarbageCollected<LoadSessionResultPromise>(resolver, config_, this); @@ -774,8 +774,8 @@ DOMArrayBuffer::Create(response.Data(), response.ByteLength()); // 5. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); SimpleResultPromise* result = MakeGarbageCollected<SimpleResultPromise>( resolver, config_, this, EmeApiType::kUpdate); @@ -824,8 +824,8 @@ return CreateRejectedPromiseNotCallable(exception_state); // 3. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); CloseSessionResultPromise* result = MakeGarbageCollected<CloseSessionResultPromise>(resolver, config_, this); @@ -881,8 +881,8 @@ return CreateRejectedPromiseNotCallable(exception_state); // 3. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLUndefined>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); SimpleResultPromise* result = MakeGarbageCollected<SimpleResultPromise>( resolver, config_, this, EmeApiType::kRemove);
diff --git a/third_party/blink/renderer/modules/encryptedmedia/media_keys.cc b/third_party/blink/renderer/modules/encryptedmedia/media_keys.cc index 73e17c4..15e352a5 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/media_keys.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/media_keys.cc
@@ -369,8 +369,8 @@ server_certificate.Data(), server_certificate.ByteLength()); // 4. Let promise be a new promise. - auto* resolver = - MakeGarbageCollected<ScriptPromiseResolver<IDLBoolean>>(script_state); + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<IDLBoolean>>( + script_state, exception_state.GetContext()); auto promise = resolver->Promise(); SetCertificateResultPromise* result = MakeGarbageCollected<SetCertificateResultPromise>(resolver, config_, @@ -432,7 +432,7 @@ // Let promise be a new promise. auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<V8MediaKeyStatus>>( - script_state); + script_state, exception_state.GetContext()); GetStatusForPolicyResultPromise* result = MakeGarbageCollected<GetStatusForPolicyResultPromise>( resolver, config_, min_hdcp_version, this);
diff --git a/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.cc b/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.cc index b3a87f4..5bad582 100644 --- a/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.cc +++ b/third_party/blink/renderer/modules/filesystem/file_system_dispatcher.cc
@@ -70,7 +70,9 @@ callbacks_->DidFail(error_code); } - void DidWrite(int64_t byte_count, bool complete) override { NOTREACHED(); } + void DidWrite(int64_t byte_count, bool complete) override { + NOTREACHED_IN_MIGRATION(); + } private: std::unique_ptr<EntriesCallbacks> callbacks_;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc index 610f11a2..3e4512b 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
@@ -612,17 +612,13 @@ const MLOperand* b, ExceptionState& exception_state) { if (a->DataType() != b->DataType()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kDataError, - "The input operand data types don't match."); + exception_state.ThrowTypeError("The input operand data types don't match."); return nullptr; } std::optional<Vector<uint32_t>> dims_output = BroadcastShapes(a->Dimensions(), b->Dimensions()); if (!dims_output) { - exception_state.ThrowDOMException( - DOMExceptionCode::kDataError, - "The input shapes are not broadcastable."); + exception_state.ThrowTypeError("The input shapes are not broadcastable."); return nullptr; } @@ -638,8 +634,7 @@ auto output = MLOperand::ValidateAndCreateOutput(builder, data_type, dims_output.value(), binary); if (!output.has_value()) { - exception_state.ThrowDOMException(DOMExceptionCode::kDataError, - output.error()); + exception_state.ThrowTypeError(output.error()); return nullptr; } binary->Connect({a, b}, {output.value()});
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc index e501ef6..98ec683e 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc
@@ -723,124 +723,6 @@ return output; } -class MLGraphBuilderElementWiseBinaryTest - : public testing::TestWithParam< - webnn::mojom::blink::ElementWiseBinary::Kind> { - public: - void TestElementWiseBinary() { - V8TestingScope scope; - MLGraphBuilder* builder = - CreateMLGraphBuilder(scope.GetExecutionContext(), - scope.GetScriptState(), scope.GetExceptionState()); - const auto& kind = GetParam(); - SCOPED_TRACE(testing::Message() << "Testing operator: " - << ElementWiseBinaryKindToString(kind)); - { - // Testing building with two input dimensions - {8, 1, 6, 1} and {7, 1, - // 5}. Both the a and b dimensions have axes with length one that are - // expanded to a larger size during the broadcast operation. - // a_dimensions (4d) 8 * 1 * 6 * 1 - // b_dimensions (3d) 7 * 1 * 5 - // output_dimenions (4d) 8 * 7 * 6 * 5 - auto* a = BuildInput(builder, "a", {8, 1, 6, 1}, - V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* b = BuildInput(builder, "b", {7, 1, 5}, - V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* output = BuildElementWiseBinary(scope, builder, kind, a, b); - EXPECT_EQ(output->Dimensions(), Vector<uint32_t>({8, 7, 6, 5})); - } - { - // Testing building with two input dimensions - {4, 2, 1} and {4}. - // a_dimensions (3d) 4 * 2 * 1 - // b_dimensions (1d) 4 - // output_dimenions (3d) 4 * 2 * 4 - auto* a = BuildInput(builder, "a", {4, 2, 1}, - V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* b = - BuildInput(builder, "b", {4}, V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* output = BuildElementWiseBinary(scope, builder, kind, a, b); - EXPECT_EQ(output->Dimensions(), Vector<uint32_t>({4, 2, 4})); - } - { - // Testing scalar broadcasting by building with two input dimensions - - // {4, 2, 4} and {}. - auto* a = BuildInput(builder, "a", {4, 2, 4}, - V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* b = - BuildInput(builder, "b", {}, V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* output = BuildElementWiseBinary(scope, builder, kind, a, b); - EXPECT_EQ(output->Dimensions(), Vector<uint32_t>({4, 2, 4})); - } - { - // Test throwing exception when the input shapes are not broadcastable. - auto* a = - BuildInput(builder, "a", {4, 2}, V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* b = - BuildInput(builder, "b", {4}, V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* output = BuildElementWiseBinaryOperator(builder, scope, a, b, kind); - EXPECT_THAT(output, testing::IsNull()); - EXPECT_EQ(ToExceptionCode(DOMExceptionCode::kDataError), - scope.GetExceptionState().Code()); - EXPECT_EQ(scope.GetExceptionState().Message(), - "The input shapes are not broadcastable."); - } - { - // Test throwing exception when the input types don't match. - auto* a = - BuildInput(builder, "a", {4, 2}, V8MLOperandDataType::Enum::kFloat32, - scope.GetExceptionState()); - auto* b = BuildInput(builder, "b", {1}, V8MLOperandDataType::Enum::kInt32, - scope.GetExceptionState()); - auto* output = BuildElementWiseBinaryOperator(builder, scope, a, b, kind); - EXPECT_THAT(output, testing::IsNull()); - EXPECT_EQ(ToExceptionCode(DOMExceptionCode::kDataError), - scope.GetExceptionState().Code()); - EXPECT_EQ(scope.GetExceptionState().Message(), - "The input operand data types don't match."); - } - } - - private: - test::TaskEnvironment task_environment_; -}; - -TEST_P(MLGraphBuilderElementWiseBinaryTest, TestElementWiseBinary) { - TestElementWiseBinary(); -} - -constexpr webnn::mojom::blink::ElementWiseBinary::Kind - kAllElementWiseBinaryOperators[] = { - webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - webnn::mojom::blink::ElementWiseBinary::Kind::kSub, - webnn::mojom::blink::ElementWiseBinary::Kind::kMul, - webnn::mojom::blink::ElementWiseBinary::Kind::kDiv, - webnn::mojom::blink::ElementWiseBinary::Kind::kMin, - webnn::mojom::blink::ElementWiseBinary::Kind::kMax, - webnn::mojom::blink::ElementWiseBinary::Kind::kPow, - webnn::mojom::blink::ElementWiseBinary::Kind::kEqual, - webnn::mojom::blink::ElementWiseBinary::Kind::kGreater, - webnn::mojom::blink::ElementWiseBinary::Kind::kGreaterOrEqual, - webnn::mojom::blink::ElementWiseBinary::Kind::kLesser, - webnn::mojom::blink::ElementWiseBinary::Kind::kLesserOrEqual, -}; -static_assert( - 1 + static_cast<size_t>( - webnn::mojom::blink::ElementWiseBinary::Kind::kMaxValue) == - 12); - -INSTANTIATE_TEST_SUITE_P(ElementWiseBinaryTest, - MLGraphBuilderElementWiseBinaryTest, - ::testing::ValuesIn(kAllElementWiseBinaryOperators), - TestParamElementWiseBinaryKindToString); - TEST_F(MLGraphBuilderTest, Cast) { V8TestingScope scope; auto* builder =
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_mojo_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_mojo_test.cc index 0f6ba43..5b4ce272 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_mojo_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_mojo_test.cc
@@ -1390,303 +1390,6 @@ } } -struct ElementWiseBinaryTester { - OperandInfoBlink lhs; - OperandInfoBlink rhs; - OperandInfoMojo expected_out; - - void Test(MLGraphTestMojo& helper, - V8TestingScope& scope, - MLGraphBuilder* builder) { - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kAdd); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kSub); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kMul); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kDiv); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kMin); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kMax); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kPow); - } - - void TestLogicalComparison(MLGraphTestMojo& helper, - V8TestingScope& scope, - MLGraphBuilder* builder) { - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kEqual); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kGreater); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kGreaterOrEqual); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kLesser); - Test(helper, scope, builder, - webnn::mojom::blink::ElementWiseBinary::Kind::kLesserOrEqual); - } - - void Test(MLGraphTestMojo& helper, - V8TestingScope& scope, - MLGraphBuilder* builder, - webnn::mojom::blink::ElementWiseBinary::Kind kind) { - // Build the graph. - auto* lhs_operand = BuildInput(builder, "lhs", lhs.dimensions, - lhs.data_type, scope.GetExceptionState()); - auto* rhs_operand = BuildInput(builder, "rhs", rhs.dimensions, - rhs.data_type, scope.GetExceptionState()); - auto* output_operand = - BuildElementWiseBinary(scope, builder, kind, lhs_operand, rhs_operand); - auto [graph, error_name, error_message] = - helper.BuildGraph(scope, builder, {{"output", output_operand}}); - ASSERT_THAT(graph, testing::NotNull()); - - auto graph_info = helper.GetGraphInfo(); - // Verify the graph information of mojo are as expected. - EXPECT_EQ(graph_info->id_to_operand_map.size(), 3u); - EXPECT_EQ(graph_info->input_operands.size(), 2u); - // Verify the left `mojo::Operand`. - auto lhs_operand_id = graph_info->input_operands[0]; - auto lhs_operand_iter = graph_info->id_to_operand_map.find(lhs_operand_id); - ASSERT_TRUE(lhs_operand_iter != graph_info->id_to_operand_map.end()); - EXPECT_EQ(lhs_operand_iter->value->kind, - blink_mojom::Operand::Kind::kInput); - EXPECT_EQ(lhs_operand_iter->value->data_type, - mojo::BlinkOperandTypeToMojo(lhs.data_type)); - EXPECT_EQ(lhs_operand_iter->value->dimensions, lhs.dimensions); - EXPECT_EQ(lhs_operand_iter->value->name, "lhs"); - // Verify the right `mojo::Operand`. - auto rhs_operand_id = graph_info->input_operands[1]; - auto rhs_operand_iter = graph_info->id_to_operand_map.find(rhs_operand_id); - ASSERT_TRUE(rhs_operand_iter != graph_info->id_to_operand_map.end()); - EXPECT_EQ(rhs_operand_iter->value->kind, - blink_mojom::Operand::Kind::kInput); - EXPECT_EQ(rhs_operand_iter->value->data_type, - mojo::BlinkOperandTypeToMojo(rhs.data_type)); - EXPECT_EQ(rhs_operand_iter->value->dimensions, rhs.dimensions); - EXPECT_EQ(rhs_operand_iter->value->name, "rhs"); - // Verify the output `mojo::Operand`. - auto output_operand_id = graph_info->output_operands[0]; - auto output_operand_iter = - graph_info->id_to_operand_map.find(output_operand_id); - ASSERT_TRUE(output_operand_iter != graph_info->id_to_operand_map.end()); - EXPECT_EQ(output_operand_iter->value->kind, - blink_mojom::Operand::Kind::kOutput); - EXPECT_EQ(output_operand_iter->value->data_type, expected_out.data_type); - EXPECT_EQ(output_operand_iter->value->dimensions, expected_out.dimensions); - EXPECT_EQ(output_operand_iter->value->name, "output"); - // Verify the `mojo::Operator`. - ASSERT_EQ(graph_info->operations.size(), 1u); - auto& operation = graph_info->operations[0]; - EXPECT_TRUE(operation->is_element_wise_binary()); - auto& binary_mojo = operation->get_element_wise_binary(); - - blink_mojom::ElementWiseBinary::Kind binary_kind; - switch (kind) { - case webnn::mojom::blink::ElementWiseBinary::Kind::kAdd: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kAdd; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kSub: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kSub; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kMul: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kMul; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kDiv: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kDiv; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kMin: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kMin; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kMax: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kMax; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kPow: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kPow; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kEqual: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kEqual; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kGreater: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kGreater; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kGreaterOrEqual: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kGreaterOrEqual; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kLesser: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kLesser; - break; - case webnn::mojom::blink::ElementWiseBinary::Kind::kLesserOrEqual: - binary_kind = blink_mojom::ElementWiseBinary::Kind::kLesserOrEqual; - break; - } - EXPECT_EQ(binary_mojo->kind, binary_kind); - EXPECT_EQ(binary_mojo->lhs_operand_id, lhs_operand_id); - EXPECT_EQ(binary_mojo->rhs_operand_id, rhs_operand_id); - EXPECT_EQ(binary_mojo->output_operand_id, output_operand_id); - } -}; - -TEST_P(MLGraphTestMojo, ElementWiseBinaryLogicalTest) { - V8TestingScope scope; - // Bind fake WebNN Context in the service for testing. - ScopedWebNNServiceBinder scoped_setup_binder(*this, scope); - - auto* options = MLContextOptions::Create(); - // Create WebNN Context with GPU device type. - options->setDeviceType(V8MLDeviceType::Enum::kGpu); - auto* builder = CreateGraphBuilder(scope, options); - ASSERT_THAT(builder, testing::NotNull()); - - { - // Test element-wise operators for two 0-D scalars. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {}}} - .TestLogicalComparison(*this, scope, builder); - } - { - // Test element-wise operators for two 1-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {2}}} - .TestLogicalComparison(*this, scope, builder); - } - { - // Test element-wise operators for two 2-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat16, - .dimensions = {3, 7}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat16, - .dimensions = {3, 7}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {3, 7}}} - .TestLogicalComparison(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 2-D tensor. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kInt32, - .dimensions = {5, 3}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kInt32, - .dimensions = {5, 1}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {5, 3}}} - .TestLogicalComparison(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 3-D tensor. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kInt8, - .dimensions = {4, 2, 1}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kInt8, - .dimensions = {4}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {4, 2, 4}}} - .TestLogicalComparison(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 4-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kUint8, - .dimensions = {8, 1, 6, 1}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kUint8, - .dimensions = {7, 1, 5}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {8, 7, 6, 5}}} - .TestLogicalComparison(*this, scope, builder); - } -} - -TEST_P(MLGraphTestMojo, ElementWiseBinaryTest) { - V8TestingScope scope; - // Bind fake WebNN Context in the service for testing. - ScopedWebNNServiceBinder scoped_setup_binder(*this, scope); - - auto* options = MLContextOptions::Create(); - // Create WebNN Context with GPU device type. - options->setDeviceType(V8MLDeviceType::Enum::kGpu); - auto* builder = CreateGraphBuilder(scope, options); - ASSERT_THAT(builder, testing::NotNull()); - { - // Test element-wise operators for two 0-D scalars. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kFloat32, - .dimensions = {}}} - .Test(*this, scope, builder); - } - { - // Test element-wise operators for two 1-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kFloat32, - .dimensions = {2}}} - .Test(*this, scope, builder); - } - { - // Test element-wise operators for two 2-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat16, - .dimensions = {3, 7}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat16, - .dimensions = {3, 7}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kFloat16, - .dimensions = {3, 7}}} - .Test(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 2-D tensor. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kInt32, - .dimensions = {5, 3}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kInt32, - .dimensions = {5, 1}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kInt32, - .dimensions = {5, 3}}} - .Test(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 3-D tensor. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kInt8, - .dimensions = {4, 2, 1}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kInt8, - .dimensions = {4}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kInt8, - .dimensions = {4, 2, 4}}} - .Test(*this, scope, builder); - } - { - // Test element-wise operators for broadcasting to 4-D tensors. - ElementWiseBinaryTester{ - .lhs = {.data_type = V8MLOperandDataType::Enum::kUint8, - .dimensions = {8, 1, 6, 1}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kUint8, - .dimensions = {7, 1, 5}}, - .expected_out = {.data_type = blink_mojom::Operand::DataType::kUint8, - .dimensions = {8, 7, 6, 5}}} - .Test(*this, scope, builder); - } -} - struct SoftmaxTester { OperandInfoBlink input; OperandInfoMojo expected;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc index a4c0b29..70b019e 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc
@@ -37,219 +37,6 @@ class MLGraphTest : public MLGraphTestBase {}; template <typename T> -struct ElementWiseBinaryTester { - webnn::mojom::blink::ElementWiseBinary::Kind kind; - OperandInfo<T> lhs; - OperandInfo<T> rhs; - Vector<T> expected; - - void Test(MLGraphTest& helper, V8TestingScope& scope) { - // Build the graph. - auto* builder = - CreateMLGraphBuilder(scope.GetExecutionContext(), - scope.GetScriptState(), scope.GetExceptionState()); - auto* lhs_operand = BuildInput(builder, "lhs", lhs.dimensions, - lhs.data_type, scope.GetExceptionState()); - auto* rhs_operand = BuildInput(builder, "rhs", rhs.dimensions, - rhs.data_type, scope.GetExceptionState()); - auto* output_operand = - BuildElementWiseBinary(scope, builder, kind, lhs_operand, rhs_operand); - auto [graph, error_name, error_message] = - helper.BuildGraph(scope, builder, {{"output", output_operand}}); - ASSERT_THAT(graph, testing::NotNull()); - - // Compute the graph. - MLNamedArrayBufferViews inputs( - {{"lhs", CreateArrayBufferViewForOperand(lhs_operand, lhs.values)}, - {"rhs", CreateArrayBufferViewForOperand(rhs_operand, rhs.values)}}); - MLNamedArrayBufferViews outputs( - {{"output", CreateArrayBufferViewForOperand(output_operand)}}); - std::tie(error_name, error_message) = - helper.ComputeGraph(scope, graph, inputs, outputs); - EXPECT_TRUE(error_name.IsNull()); - auto results = GetArrayBufferViewValues<T>(outputs[0].second); - EXPECT_EQ(results, expected); - } -}; - -TEST_P(MLGraphTest, ElementWiseBinaryTest) { - V8TestingScope scope; - { - // Test element-wise add operator for two 0-D scalars. - // The expected results should be the sum of the values of the two input - // scalars. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}, - .values = {2.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}, - .values = {3.0}}, - .expected = {5.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for two 1-D tensors. - // The expected results should be the sum of the values of the two input - // tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}, - .values = {1.0, 2.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}, - .values = {3.0, 4.0}}, - .expected = {4.0, 6.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for two 2-D tensors. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2, 2}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2, 2}, - .values = {5.0, 6.0, 7.0, 8.0}}, - .expected = {6.0, 8.0, 10.0, 12.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for 0-D scalar broadcasting to 2-D - // tensor. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2, 2}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {}, - .values = {5.0}}, - .expected = {6.0, 7.0, 8.0, 9.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for 1-D tensor broadcasting to 2-D - // tensor. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2, 2}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2}, - .values = {5.0, 6.0}}, - .expected = {6.0, 8.0, 8.0, 10.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for 3-D tensor broadcasting to 3-D - // tensor. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {2, 1, 2}, - .values = {5.0, 6.0, 7.0, 8.0}}, - .expected = {6.0, 8.0, 8.0, 10.0, 8.0, 10.0, 10.0, 12.0}} - .Test(*this, scope); - } - { - // Test element-wise add operator for two 4-D tensors - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kAdd, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {5.0, 6.0, 7.0, 8.0}}, - .expected = {6.0, 8.0, 10.0, 12.0}} - .Test(*this, scope); - } - { - // Test element-wise sub operator for two 4-D tensors. - // The expected results should be the difference of the values of the two - // input tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kSub, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {5.0, 6.0, 7.0, 8.0}}, - .expected = {-4.0, -4.0, -4.0, -4.0}} - .Test(*this, scope); - } - { - // Test element-wise mul operator for two 4-D tensors. - // The expected results should be the product of the values of the two - // input tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kMul, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 2.0, 3.0, 4.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {5.0, 6.0, 7.0, 8.0}}, - .expected = {5.0, 12.0, 21.0, 32.0}} - .Test(*this, scope); - } - { - // Test element-wise div operator for two 4-D tensors. - // The expected results should be the quotient of the values of the two - // input tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kDiv, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {3.0, 4.0, 6.0, 8.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 2.0, 2.0, 2.0}}, - .expected = {3.0, 2.0, 3.0, 4.0}} - .Test(*this, scope); - } - { - // Test element-wise min operator for two 4-D tensors. - // The expected results should be the lesser values of the two input - // tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kMin, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 4.0, 5.0, 8.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {2.0, 3.0, 6.0, 7.0}}, - .expected = {1.0, 3.0, 5.0, 7.0}} - .Test(*this, scope); - } - { - // Test element-wise max operator for two 4-D tensors. - // The expected results should be the greater values of the two input - // tensors, element-wise. - ElementWiseBinaryTester<float>{ - .kind = webnn::mojom::blink::ElementWiseBinary::Kind::kMax, - .lhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {1.0, 4.0, 5.0, 8.0}}, - .rhs = {.data_type = V8MLOperandDataType::Enum::kFloat32, - .dimensions = {1, 2, 2, 1}, - .values = {2.0, 3.0, 6.0, 7.0}}, - .expected = {2.0, 4.0, 6.0, 8.0}} - .Test(*this, scope); - } -} - -template <typename T> struct PowTester { OperandInfo<T> lhs; OperandInfo<T> rhs;
diff --git a/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc b/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc index 2e3affef..46dd6bf5 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc
@@ -42,8 +42,8 @@ payments::mojom::blink::PaymentDetailsPtr update_with_details) override { NOTREACHED_IN_MIGRATION(); } - void OnPaymentDetailsNotUpdated() override { NOTREACHED(); } - void Abort() override { NOTREACHED(); } + void OnPaymentDetailsNotUpdated() override { NOTREACHED_IN_MIGRATION(); } + void Abort() override { NOTREACHED_IN_MIGRATION(); } void Complete(payments::mojom::PaymentComplete result) override { NOTREACHED_IN_MIGRATION(); }
diff --git a/third_party/blink/renderer/modules/payments/payment_request_optional_total_test.cc b/third_party/blink/renderer/modules/payments/payment_request_optional_total_test.cc index 00b7d0f..9b9e801 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_optional_total_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_optional_total_test.cc
@@ -40,13 +40,13 @@ payments::mojom::blink::PaymentDetailsPtr update_with_details) override { NOTREACHED_IN_MIGRATION(); } - void OnPaymentDetailsNotUpdated() override { NOTREACHED(); } - void Abort() override { NOTREACHED(); } + void OnPaymentDetailsNotUpdated() override { NOTREACHED_IN_MIGRATION(); } + void Abort() override { NOTREACHED_IN_MIGRATION(); } void Complete(payments::mojom::PaymentComplete result) override { NOTREACHED_IN_MIGRATION(); } - void CanMakePayment() override { NOTREACHED(); } - void HasEnrolledInstrument() override { NOTREACHED(); } + void CanMakePayment() override { NOTREACHED_IN_MIGRATION(); } + void HasEnrolledInstrument() override { NOTREACHED_IN_MIGRATION(); } mojo::PendingRemote<payments::mojom::blink::PaymentRequest> CreatePendingRemoteAndBind() {
diff --git a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc index 1831430..4567339 100644 --- a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc +++ b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc
@@ -337,7 +337,7 @@ if (Match(Wildcard(), node_name, config_.drop_attributes_)) { for (const auto& name : element->getAttributeNames()) { - element->removeAttribute(name); + element->removeAttribute(AtomicString(name)); UseCounter::Count(window->GetExecutionContext(), WebFeature::kSanitizerAPIActionTaken); } @@ -384,7 +384,7 @@ } if (drop) { - element->removeAttribute(name); + element->removeAttribute(AtomicString(name)); UseCounter::Count(window->GetExecutionContext(), WebFeature::kSanitizerAPIActionTaken); }
diff --git a/third_party/blink/renderer/modules/service_worker/web_service_worker_fetch_context_impl_test.cc b/third_party/blink/renderer/modules/service_worker/web_service_worker_fetch_context_impl_test.cc index 3ad6f3de..ed57e147 100644 --- a/third_party/blink/renderer/modules/service_worker/web_service_worker_fetch_context_impl_test.cc +++ b/third_party/blink/renderer/modules/service_worker/web_service_worker_fetch_context_impl_test.cc
@@ -38,7 +38,7 @@ return throttles; } - void SetOnline(bool is_online) override { NOTREACHED(); } + void SetOnline(bool is_online) override { NOTREACHED_IN_MIGRATION(); } }; test::TaskEnvironment task_environment_; };
diff --git a/third_party/blink/renderer/modules/webaudio/audio_destination_handler.h b/third_party/blink/renderer/modules/webaudio/audio_destination_handler.h index 9e0516f..139c570 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_destination_handler.h +++ b/third_party/blink/renderer/modules/webaudio/audio_destination_handler.h
@@ -24,7 +24,7 @@ // The method MUST NOT be invoked when rendering a graph because the // destination node is a sink. Instead, this node gets pulled by the // underlying renderer (audio hardware or worker thread). - void Process(uint32_t) final { NOTREACHED(); } + void Process(uint32_t) final { NOTREACHED_IN_MIGRATION(); } virtual void StartRendering() = 0; virtual void StopRendering() = 0;
diff --git a/third_party/blink/renderer/modules/webcodecs/decoder_selector.cc b/third_party/blink/renderer/modules/webcodecs/decoder_selector.cc index 72fa46ac..e76ce65 100644 --- a/third_party/blink/renderer/modules/webcodecs/decoder_selector.cc +++ b/third_party/blink/renderer/modules/webcodecs/decoder_selector.cc
@@ -31,7 +31,9 @@ ~NullDemuxerStream() override = default; - void Read(uint32_t count, ReadCB read_cb) override { NOTREACHED(); } + void Read(uint32_t count, ReadCB read_cb) override { + NOTREACHED_IN_MIGRATION(); + } void Configure(DecoderConfigType config);
diff --git a/third_party/blink/renderer/modules/webcodecs/decoder_selector_test.cc b/third_party/blink/renderer/modules/webcodecs/decoder_selector_test.cc index eb09a328..344dd5a23 100644 --- a/third_party/blink/renderer/modules/webcodecs/decoder_selector_test.cc +++ b/third_party/blink/renderer/modules/webcodecs/decoder_selector_test.cc
@@ -143,7 +143,7 @@ WebCodecsDecoderSelectorTest& operator=(const WebCodecsDecoderSelectorTest&) = delete; - void OnOutput(scoped_refptr<Output> output) { NOTREACHED(); } + void OnOutput(scoped_refptr<Output> output) { NOTREACHED_IN_MIGRATION(); } MOCK_METHOD1_T(OnDecoderSelected, void(int));
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index c4bcbf8..9d6d8f6 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -509,6 +509,7 @@ "bindings/to_blink_string.cc", "bindings/to_blink_string.h", "bindings/trace_wrapper_v8_reference.h", + "bindings/transform_view.h", "bindings/union_base.cc", "bindings/union_base.h", "bindings/v8_binding.cc", @@ -2105,6 +2106,7 @@ "audio/vector_math_test.cc", "bindings/parkable_string_test.cc", "bindings/runtime_call_stats_test.cc", + "bindings/transform_view_test.cc", "disk_data_allocator_test.cc", "disk_data_allocator_test_utils.h", "exported/file_path_conversion_test.cc",
diff --git a/third_party/blink/renderer/platform/bindings/transform_view.h b/third_party/blink/renderer/platform/bindings/transform_view.h new file mode 100644 index 0000000..14e413d --- /dev/null +++ b/third_party/blink/renderer/platform/bindings/transform_view.h
@@ -0,0 +1,107 @@ +// Copyright 2024 The Chromium Authors +// 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_BINDINGS_TRANSFORM_VIEW_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_TRANSFORM_VIEW_H_ + +#include <concepts> +#include <iterator> + +namespace blink::bindings { + +// This is somewhat similar in spirit to std::range::views, but really lean, +// mean and specifically tailored to exposing ranges of blink data to the +// generated bindings where those expect an IDLSequence<>. +// Some limitations include: +// - TransformedView only offers a forward iterator, even if +// unedrlying collection can offer better iterators; +// - No sentinel support +// - Transform instance is not accepted as an argument or preserved +// across calls. +// All of these may be re-evaluated if new usages arise. + +template <typename Range, typename Transform> + requires(std::forward_iterator<decltype(std::begin( + std::declval<const Range&>()))> && + std::regular_invocable<Transform, + decltype(*std::begin( + std::declval<const Range&>()))>) +class TransformedView { + public: + class TransformingIterator { + public: + using inner_iterator = decltype(std::begin(std::declval<const Range&>())); + using inner_value_t = std::iter_value_t<inner_iterator>; + + // std::iterator interface + // TODO(caseq): It may be nice to follow the category of the + // underlying iterator instead of just offering a forward one. + // We don't want to implement the entire bunch of operations required + // by random_access_iterator so far, but we need to be able to compute + // size for current use cases, so we offer size if underlying iterator + // is a random access one. + using iterator_category = std::forward_iterator_tag; + using value_type = decltype(std::declval<Transform>()( + std::declval<const inner_value_t&>())); + + TransformingIterator() = default; + explicit TransformingIterator(inner_iterator it) : it_(it) {} + TransformingIterator(const TransformingIterator& r) = default; + TransformingIterator& operator=(const TransformingIterator& r) = default; + + bool operator==(const TransformingIterator& r) const { + return it_ == r.it_; + } + bool operator!=(const TransformingIterator& r) const { + return it_ != r.it_; + } + TransformingIterator& operator++() { + ++it_; + return *this; + } + TransformingIterator operator++(int) { return TransformingIterator(it_++); } + + value_type operator*() const { return Transform()(*it_); } + + size_t operator-(const TransformingIterator& r) const + requires(std::random_access_iterator<inner_iterator>) + { + return it_ - r.it_; + } + + private: + inner_iterator it_; + }; + + using inner_iterator = decltype(std::begin(std::declval<const Range&>())); + using iterator_t = TransformingIterator; + using value_type = iterator_t::value_type; + + TransformedView(inner_iterator begin, inner_iterator end) + : begin_(begin), end_(end) {} + explicit TransformedView(const Range& r) + : begin_(std::begin(r)), end_(std::end(r)) {} + + iterator_t begin() const { return begin_; } + iterator_t end() const { return end_; } + + size_t size() const + requires(std::random_access_iterator<inner_iterator>) + { + return end_ - begin_; + } + bool empty() const { return begin_ == end_; } + + iterator_t begin_; + iterator_t end_; +}; + +template <typename TransformFunc, typename Range> +auto Transform(const Range& range) { + return TransformedView<Range, TransformFunc>(range); +} + +} // namespace blink::bindings + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_TRANSFORM_VIEW_H_
diff --git a/third_party/blink/renderer/platform/bindings/transform_view_test.cc b/third_party/blink/renderer/platform/bindings/transform_view_test.cc new file mode 100644 index 0000000..8ec07513 --- /dev/null +++ b/third_party/blink/renderer/platform/bindings/transform_view_test.cc
@@ -0,0 +1,52 @@ +// Copyright 2024 The Chromium Authors +// 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/bindings/transform_view.h" + +#include <functional> + +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + +namespace blink::bindings { +namespace { + +struct to_string { + WTF::String operator()(int n) const { return WTF::String::Number(n); } +}; + +static_assert(std::forward_iterator< + decltype(Transform<to_string>(std::vector<int>()).begin())>); + +TEST(TransformView, Empty) { + EXPECT_THAT(Transform<std::identity>(std::vector<int>{}), testing::IsEmpty()); + EXPECT_THAT(Transform<std::identity>(std::vector<int>{}), testing::SizeIs(0)); +} + +TEST(TransformView, Basic) { + std::vector<int> in{1, 2, 3}; + EXPECT_THAT(Transform<std::identity>(in).size(), testing::Eq(3ul)); + EXPECT_THAT(Transform<std::identity>(in), testing::SizeIs(3)); + EXPECT_THAT(Transform<std::identity>(in), testing::ElementsAre(1, 2, 3)); + EXPECT_THAT(Transform<std::negate<int>>(in), + testing::ElementsAre(-1, -2, -3)); + static int arr[] = {5, 6, 7}; + EXPECT_THAT(Transform<std::negate<int>>(arr), + testing::ElementsAre(-5, -6, -7)); +} + +TEST(TransformView, DifferentType) { + std::vector<int> in{1, 2, 3}; + EXPECT_THAT(Transform<to_string>(in), testing::ElementsAre("1", "2", "3")); +} + +TEST(TransformView, NonRandomAccessIterator) { + std::set<int> in{1, 2, 3}; + EXPECT_THAT(Transform<std::negate<int>>(in), + testing::UnorderedElementsAre(-1, -2, -3)); +} + +} // namespace +} // namespace blink::bindings
diff --git a/third_party/blink/renderer/platform/graphics/DEPS b/third_party/blink/renderer/platform/graphics/DEPS index 1a40396..8ba80d5b 100644 --- a/third_party/blink/renderer/platform/graphics/DEPS +++ b/third_party/blink/renderer/platform/graphics/DEPS
@@ -42,6 +42,7 @@ "+media/base/video_transformation.h", "+media/base/video_types.h", "+media/base/video_util.h", + "+media/base/simple_sync_token_client.h", "+media/base/wait_and_replace_sync_token_client.h", "+media/media_buildflags.h", "+media/renderers/paint_canvas_video_renderer.h",
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc index 0ee32543..fa98e27c 100644 --- a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc +++ b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
@@ -135,7 +135,9 @@ last_decoded_size_ = new_size; } bool ShouldPauseAnimation(const Image*) override { return false; } - void AsyncLoadCompleted(const Image*) override { NOTREACHED(); } + void AsyncLoadCompleted(const Image*) override { + NOTREACHED_IN_MIGRATION(); + } void Changed(const Image*) override {}
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.h b/third_party/blink/renderer/platform/graphics/canvas_resource.h index 431d475..fda1786 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.h +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.h
@@ -364,7 +364,7 @@ bool OriginClean() const final { return is_origin_clean_; } void SetOriginClean(bool value) final { is_origin_clean_ = value; } - void TakeSkImage(sk_sp<SkImage> image) final { NOTREACHED(); } + void TakeSkImage(sk_sp<SkImage> image) final { NOTREACHED_IN_MIGRATION(); } void NotifyResourceLost() final; bool NeedsReadLockFences() const final { // If the resource is not accelerated, it will be written to on the CPU. We
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h index ca9301e..701de91 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
@@ -89,12 +89,14 @@ return false; } - virtual void EnsureSyncTokenVerified() { NOTREACHED(); } + virtual void EnsureSyncTokenVerified() { NOTREACHED_IN_MIGRATION(); } virtual gpu::MailboxHolder GetMailboxHolder() const { NOTREACHED_IN_MIGRATION(); return gpu::MailboxHolder(); } - virtual void UpdateSyncToken(const gpu::SyncToken&) { NOTREACHED(); } + virtual void UpdateSyncToken(const gpu::SyncToken&) { + NOTREACHED_IN_MIGRATION(); + } // For gpu based images the Usage is a bitmap indicating set of API(s) and // underlying gpu::SharedImage may be used with.
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc b/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc index 323df80..0345a13 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc +++ b/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
@@ -104,8 +104,8 @@ } // Not used by VideoFrameSubmitter. - void SetWantsAnimateOnlyBeginFrames() override { NOTREACHED(); } - void SetAutoNeedsBeginFrame() override { NOTREACHED(); } + void SetWantsAnimateOnlyBeginFrames() override { NOTREACHED_IN_MIGRATION(); } + void SetAutoNeedsBeginFrame() override { NOTREACHED_IN_MIGRATION(); } void SubmitCompositorFrame( const viz::LocalSurfaceId& local_surface_id,
diff --git a/third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.cc b/third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.cc index 40517d9d..2dab08784 100644 --- a/third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.cc +++ b/third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.cc
@@ -16,6 +16,7 @@ #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/common/shared_image_capabilities.h" +#include "media/base/simple_sync_token_client.h" #include "media/base/video_frame.h" #include "media/renderers/video_frame_rgba_to_yuva_converter.h" #include "media/video/gpu_video_accelerator_factories.h" @@ -30,6 +31,12 @@ namespace { +#if BUILDFLAG(IS_WIN) +BASE_FEATURE(kUseCopyToGpuMemoryBufferAsync, + "UseCopyToGpuMemoryBufferAsync", + base::FEATURE_ENABLED_BY_DEFAULT); +#endif + class Context : public media::RenderableGpuMemoryBufferVideoFramePool::Context { public: explicit Context(base::WeakPtr<blink::WebGraphicsContext3DProviderWrapper> @@ -145,6 +152,126 @@ return nullptr; } +namespace { +void SignalGpuCompletion( + base::WeakPtr<blink::WebGraphicsContext3DProviderWrapper> ctx_wrapper, + GLenum query_target, + base::OnceClosure callback) { + DCHECK(ctx_wrapper); + auto* context_provider = ctx_wrapper->ContextProvider(); + DCHECK(context_provider); + auto* raster_context_provider = context_provider->RasterContextProvider(); + DCHECK(raster_context_provider); + auto* ri = raster_context_provider->RasterInterface(); + DCHECK(ri); + + unsigned query_id = 0; + ri->GenQueriesEXT(1, &query_id); + ri->BeginQueryEXT(query_target, query_id); + ri->EndQueryEXT(query_target); + + auto on_query_done_lambda = + [](base::WeakPtr<blink::WebGraphicsContext3DProviderWrapper> ctx_wrapper, + unsigned query_id, base::OnceClosure wrapped_callback) { + if (ctx_wrapper) { + if (auto* ctx_provider = ctx_wrapper->ContextProvider()) { + if (auto* ri_provider = ctx_provider->RasterContextProvider()) { + auto* ri = ri_provider->RasterInterface(); + ri->DeleteQueriesEXT(1, &query_id); + } + } + } + std::move(wrapped_callback).Run(); + }; + + auto* context_support = raster_context_provider->ContextSupport(); + DCHECK(context_support); + context_support->SignalQuery( + query_id, base::BindOnce(on_query_done_lambda, std::move(ctx_wrapper), + query_id, std::move(callback))); +} + +#if BUILDFLAG(IS_WIN) +void CopyToGpuMemoryBuffer( + base::WeakPtr<blink::WebGraphicsContext3DProviderWrapper> ctx_wrapper, + media::VideoFrame* dst_frame, + base::OnceClosure callback) { + DCHECK(dst_frame->HasGpuMemoryBuffer()); + DCHECK_EQ(dst_frame->GetGpuMemoryBuffer()->GetType(), + gfx::SHARED_MEMORY_BUFFER); + + DCHECK(ctx_wrapper); + auto* context_provider = ctx_wrapper->ContextProvider(); + DCHECK(context_provider); + auto* raster_context_provider = context_provider->RasterContextProvider(); + DCHECK(raster_context_provider); + auto* ri = raster_context_provider->RasterInterface(); + DCHECK(ri); + + gpu::SyncToken blit_done_sync_token; + ri->GenUnverifiedSyncTokenCHROMIUM(blit_done_sync_token.GetData()); + + auto* sii = context_provider->SharedImageInterface(); + DCHECK(sii); + + bool use_async_copy = + base::FeatureList::IsEnabled(kUseCopyToGpuMemoryBufferAsync) && + dst_frame->shared_image_format_type() == + media::SharedImageFormatType::kSharedImageFormat; + + if (use_async_copy) { + auto copy_to_gmb_done_lambda = [](base::OnceClosure callback, + bool success) { + if (!success) { + DLOG(ERROR) << "CopyToGpuMemoryBufferAsync failed!"; + base::debug::DumpWithoutCrashing(); + } + std::move(callback).Run(); + }; + + const auto& mailbox = dst_frame->mailbox_holder(0).mailbox; + sii->CopyToGpuMemoryBufferAsync( + blit_done_sync_token, mailbox, + base::BindOnce(std::move(copy_to_gmb_done_lambda), + std::move(callback))); + } else { + for (size_t plane = 0; plane < dst_frame->NumTextures(); ++plane) { + const auto& mailbox = dst_frame->mailbox_holder(plane).mailbox; + sii->CopyToGpuMemoryBuffer(blit_done_sync_token, mailbox); + } + } + + // Synchronize RasterInterface with SharedImageInterface. + auto copy_to_gmb_done_sync_token = sii->GenUnverifiedSyncToken(); + ri->WaitSyncTokenCHROMIUM(copy_to_gmb_done_sync_token.GetData()); + + // Make access to the `dst_frame` wait on copy completion. We also update the + // ReleaseSyncToken here since it's used when the underlying GpuMemoryBuffer + // and SharedImage resources are returned to the pool. This is not necessary + // since we'll set the empty sync token on the video frame on GPU completion. + // But if we ever refactor this code to have a "don't wait for GMB" mode, the + // correct sync token on the video frame will be needed. + gpu::SyncToken completion_sync_token; + ri->GenUnverifiedSyncTokenCHROMIUM(completion_sync_token.GetData()); + media::SimpleSyncTokenClient simple_client(completion_sync_token); + for (size_t plane = 0; plane < dst_frame->NumTextures(); ++plane) { + dst_frame->UpdateMailboxHolderSyncToken(plane, &simple_client); + } + dst_frame->UpdateReleaseSyncToken(&simple_client); + + // Do not use a query to track copy completion on Windows when using the new + // CopyToGpuMemoryBufferAsync API which performs an async copy that cannot be + // tracked using the command buffer. + if (!use_async_copy) { + // On Windows, shared memory CopyToGpuMemoryBuffer will do synchronization + // on its own. No need for GL_COMMANDS_COMPLETED_CHROMIUM QueryEXT. + SignalGpuCompletion(std::move(ctx_wrapper), GL_COMMANDS_ISSUED_CHROMIUM, + std::move(callback)); + } +} +#endif +} // namespace + bool WebGraphicsContext3DVideoFramePool::CopyRGBATextureToVideoFrame( viz::SharedImageFormat src_format, const gfx::Size& src_size, @@ -167,68 +294,57 @@ return false; #if BUILDFLAG(IS_WIN) - // CopyRGBATextureToVideoFrame below needs D3D shared images on Windows so - // early out before creating the GMB since it's going to fail anyway. + // CopyToGpuMemoryBuffer is only supported for D3D shared images on Windows. if (!context_provider->SharedImageInterface() ->GetCapabilities() .shared_image_d3d) { + DVLOG(1) << "CopyToGpuMemoryBuffer not supported."; return false; } #endif // BUILDFLAG(IS_WIN) auto dst_frame = pool_->MaybeCreateVideoFrame(src_size, dst_color_space); - if (!dst_frame) - return false; - - auto* ri = raster_context_provider->RasterInterface(); - DCHECK(ri); - unsigned query_id = 0; - ri->GenQueriesEXT(1, &query_id); - -#if BUILDFLAG(IS_WIN) - // On Windows, GMB data read will do synchronization on its own. - // No need for GL_COMMANDS_COMPLETED_CHROMIUM QueryEXT. - GLenum queryTarget = GL_COMMANDS_ISSUED_CHROMIUM; -#else - // QueryEXT functions are used to make sure that CopyRGBATextureToVideoFrame() - // texture copy is complete before we access GMB data. - GLenum queryTarget = GL_COMMANDS_COMPLETED_CHROMIUM; -#endif - ri->BeginQueryEXT(queryTarget, query_id); - - const bool copy_succeeded = media::CopyRGBATextureToVideoFrame( - raster_context_provider, src_format, src_size, src_color_space, - src_surface_origin, src_mailbox_holder, dst_frame.get()); - if (!copy_succeeded) { - ri->DeleteQueriesEXT(1, &query_id); + if (!dst_frame) { return false; } - ri->EndQueryEXT(queryTarget); + if (!media::CopyRGBATextureToVideoFrame( + raster_context_provider, src_format, src_size, src_color_space, + src_surface_origin, src_mailbox_holder, dst_frame.get())) { + return false; + } - auto on_query_done_cb = - [](scoped_refptr<media::VideoFrame> frame, - base::WeakPtr<blink::WebGraphicsContext3DProviderWrapper> ctx_wrapper, - unsigned query_id, int flow_id, FrameReadyCallback callback) { - if (ctx_wrapper) { - if (auto* ctx_provider = ctx_wrapper->ContextProvider()) { - if (auto* ri_provider = ctx_provider->RasterContextProvider()) { - auto* ri = ri_provider->RasterInterface(); - ri->DeleteQueriesEXT(1, &query_id); - } - } - } + // VideoFrame::UpdateMailboxHolderSyncToken requires that the video frame have + // a single owner. So cache the pointer for later use after the std::move(). + [[maybe_unused]] auto* dst_frame_ptr = dst_frame.get(); + auto wrapped_callback = base::BindOnce( + [](scoped_refptr<media::VideoFrame> frame, FrameReadyCallback callback, + int flow_id) { TRACE_EVENT_INSTANT("media", "CopyRGBATextureToVideoFrame", perfetto::TerminatingFlow::ProcessScoped(flow_id)); + // We can just clear the sync token from the video frame now that we've + // synchronized with the GPU. + gpu::SyncToken empty_sync_token; + media::SimpleSyncTokenClient simple_client(empty_sync_token); + for (size_t plane = 0; plane < frame->NumTextures(); ++plane) { + frame->UpdateMailboxHolderSyncToken(plane, &simple_client); + } + frame->UpdateReleaseSyncToken(&simple_client); std::move(callback).Run(std::move(frame)); - }; + }, + std::move(dst_frame), std::move(callback), flow_id); - auto* context_support = raster_context_provider->ContextSupport(); - DCHECK(context_support); - context_support->SignalQuery( - query_id, - base::BindOnce(on_query_done_cb, dst_frame, weak_context_provider_, - query_id, flow_id, std::move(callback))); +#if BUILDFLAG(IS_WIN) + // For shared memory GMBs on Windows we needed to explicitly request a copy + // from the shared image GPU texture to the GMB. + CopyToGpuMemoryBuffer(weak_context_provider_, dst_frame_ptr, + std::move(wrapped_callback)); +#else + // QueryEXT functions are used to make sure that CopyRGBATextureToVideoFrame() + // texture copy is complete before we access GMB data. + SignalGpuCompletion(weak_context_provider_, GL_COMMANDS_COMPLETED_CHROMIUM, + std::move(wrapped_callback)); +#endif return true; }
diff --git a/third_party/blink/renderer/platform/loader/fetch/media_timing.h b/third_party/blink/renderer/platform/loader/fetch/media_timing.h index 30c09ad..283e8055 100644 --- a/third_party/blink/renderer/platform/loader/fetch/media_timing.h +++ b/third_party/blink/renderer/platform/loader/fetch/media_timing.h
@@ -47,7 +47,9 @@ // TODO(iclelland): Change this so that it applies to static images as well. virtual bool IsPaintedFirstFrame() const = 0; - virtual void SetFirstVideoFrameTime(base::TimeTicks) { NOTREACHED(); } + virtual void SetFirstVideoFrameTime(base::TimeTicks) { + NOTREACHED_IN_MIGRATION(); + } virtual base::TimeTicks GetFirstVideoFrameTime() const = 0; // Returns the loading priority used for the image.
diff --git a/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader_unittest.cc b/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader_unittest.cc index 115e8cc..3ee748cf 100644 --- a/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader_unittest.cc +++ b/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader_unittest.cc
@@ -521,7 +521,9 @@ // single PostTask. class ChunkingLoaderClient : public WebNavigationBodyLoader::Client { public: - void BodyDataReceived(base::span<const char> data) override { NOTREACHED(); } + void BodyDataReceived(base::span<const char> data) override { + NOTREACHED_IN_MIGRATION(); + } void DecodedBodyDataReceived(const WebString& data, const WebEncodingData& encoding_data, base::span<const char> encoded_data) override {
diff --git a/third_party/blink/renderer/platform/mediastream/media_stream_track_platform.h b/third_party/blink/renderer/platform/mediastream/media_stream_track_platform.h index 946f39be..38f2fc2 100644 --- a/third_party/blink/renderer/platform/mediastream/media_stream_track_platform.h +++ b/third_party/blink/renderer/platform/mediastream/media_stream_track_platform.h
@@ -184,7 +184,9 @@ // Add an audio sink to the track. This function must only be called for audio // tracks. It will trigger a OnSetFormat() call on the |sink| before the first // chunk of audio is delivered. - virtual void AddSink(WebMediaStreamAudioSink* sink) { NOTREACHED(); } + virtual void AddSink(WebMediaStreamAudioSink* sink) { + NOTREACHED_IN_MIGRATION(); + } // Add a video sink to track. This function must only be called for video // tracks. The |sink| will receive video track state changes on the main // render thread and video frames in the |callback| method on the IO-thread.
diff --git a/third_party/blink/renderer/platform/network/http_parsers_test.cc b/third_party/blink/renderer/platform/network/http_parsers_test.cc index d9a97145..25825b20 100644 --- a/third_party/blink/renderer/platform/network/http_parsers_test.cc +++ b/third_party/blink/renderer/platform/network/http_parsers_test.cc
@@ -1035,6 +1035,16 @@ false, // expected_vary_on_key_order true // expected_vary_by_default }, + // Vary on multiple search params but don't vary on search params order. + { + "HTTP/1.1 200 OK\r\n" + R"(No-Vary-Search: key-order, params, except=("a" "b" "c"))" + "\r\n\r\n", // raw_headers + {}, // expected_no_vary_params + Vector<String>({"a", "b", "c"}), // expected_vary_params + false, // expected_vary_on_key_order + false // expected_vary_by_default + }, }; return test_data; }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 572be51f..af37113d 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1736,7 +1736,7 @@ // Protected Audience ad auction config. name: "FledgeDeprecatedRenderURLReplacements", public: true, - status: "test", + status: "stable", }, { name: "FledgeDirectFromSellerSignalsHeaderAdSlot",
diff --git a/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc b/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc index 2e369b5..f84a93af 100644 --- a/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc +++ b/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc
@@ -295,11 +295,6 @@ return base::SingleThreadTaskRunner::GetCurrentDefault(); } - scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner() override { - DCHECK(WTF::IsMainThread()); - return base::SingleThreadTaskRunner::GetCurrentDefault(); - } - scoped_refptr<base::SingleThreadTaskRunner> V8TaskRunner() override { DCHECK(WTF::IsMainThread()); return base::SingleThreadTaskRunner::GetCurrentDefault();
diff --git a/third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc b/third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc index c7c0f7d1..7af3067 100644 --- a/third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc +++ b/third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc
@@ -45,12 +45,6 @@ // Stubs for main thread only virtual functions. scoped_refptr<base::SingleThreadTaskRunner> -WebThreadScheduler::CompositorTaskRunner() { - NOTREACHED_IN_MIGRATION(); - return nullptr; -} - -scoped_refptr<base::SingleThreadTaskRunner> WebThreadScheduler::DeprecatedDefaultTaskRunner() { NOTREACHED_IN_MIGRATION(); return nullptr;
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc index edc8bfc..be2b1d8 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc
@@ -268,12 +268,6 @@ find_in_page_budget_pool_controller_( new FindInPageBudgetPoolController(this)), control_task_queue_(helper_.ControlMainThreadTaskQueue()), - compositor_task_queue_(helper_.NewTaskQueue( - MainThreadTaskQueue::QueueCreationParams( - MainThreadTaskQueue::QueueType::kCompositor) - .SetShouldMonitorQuiescence(true) - .SetPrioritisationType(MainThreadTaskQueue::QueueTraits:: - PrioritisationType::kCompositor))), back_forward_cache_ipc_tracking_task_queue_(helper_.NewTaskQueue( MainThreadTaskQueue::QueueCreationParams( MainThreadTaskQueue::QueueType::kIPCTrackingForCachedPages) @@ -298,10 +292,6 @@ // Compositor task queue and default task queue should be managed by // WebThreadScheduler. Control task queue should not. task_runners_.emplace(helper_.DefaultMainThreadTaskQueue(), nullptr); - task_runners_.emplace(compositor_task_queue_, - compositor_task_queue_->CreateQueueEnabledVoter()); - main_thread_only().idle_time_estimator.AddCompositorTaskQueue( - compositor_task_queue_); back_forward_cache_ipc_tracking_task_runner_ = back_forward_cache_ipc_tracking_task_queue_->CreateTaskRunner( @@ -323,8 +313,6 @@ v8_task_queue_->CreateTaskRunner(TaskType::kMainThreadTaskQueueV8); v8_low_priority_task_runner_ = v8_low_priority_task_queue_->CreateTaskRunner( TaskType::kMainThreadTaskQueueV8LowPriority); - compositor_task_runner_ = compositor_task_queue_->CreateTaskRunner( - TaskType::kMainThreadTaskQueueCompositor); control_task_runner_ = helper_.ControlMainThreadTaskQueue()->CreateTaskRunner( TaskType::kMainThreadTaskQueueControl); non_waking_task_runner_ = non_waking_task_queue_->CreateTaskRunner( @@ -667,12 +655,6 @@ return helper_.DeprecatedDefaultTaskRunner(); } -scoped_refptr<MainThreadTaskQueue> -MainThreadSchedulerImpl::CompositorTaskQueue() { - helper_.CheckOnValidThread(); - return compositor_task_queue_; -} - scoped_refptr<MainThreadTaskQueue> MainThreadSchedulerImpl::V8TaskQueue() { helper_.CheckOnValidThread(); return v8_task_queue_; @@ -2067,11 +2049,6 @@ } scoped_refptr<base::SingleThreadTaskRunner> -MainThreadSchedulerImpl::CompositorTaskRunner() { - return compositor_task_runner_; -} - -scoped_refptr<base::SingleThreadTaskRunner> MainThreadSchedulerImpl::NonWakingTaskRunner() { return non_waking_task_runner_; }
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h index cdf1604..c6d7d805b 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h
@@ -156,7 +156,6 @@ ~MainThreadSchedulerImpl() override; // WebThreadScheduler implementation: - scoped_refptr<base::SingleThreadTaskRunner> CompositorTaskRunner() override; scoped_refptr<base::SingleThreadTaskRunner> DeprecatedDefaultTaskRunner() override; std::unique_ptr<MainThread> CreateMainThread() override; @@ -654,7 +653,6 @@ find_in_page_budget_pool_controller_; const scoped_refptr<MainThreadTaskQueue> control_task_queue_; - const scoped_refptr<MainThreadTaskQueue> compositor_task_queue_; scoped_refptr<MainThreadTaskQueue> virtual_time_control_task_queue_; scoped_refptr<MainThreadTaskQueue> back_forward_cache_ipc_tracking_task_queue_; @@ -673,7 +671,6 @@ scoped_refptr<base::SingleThreadTaskRunner> v8_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> v8_low_priority_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> non_waking_task_runner_; scoped_refptr<base::SingleThreadTaskRunner>
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl_unittest.cc b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl_unittest.cc index a196143..82b4aa9 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl_unittest.cc
@@ -135,7 +135,9 @@ return false; } - void Coalesce(const WebInputEvent& event) override { NOTREACHED(); } + void Coalesce(const WebInputEvent& event) override { + NOTREACHED_IN_MIGRATION(); + } }; class FakeTouchEvent : public blink::WebTouchEvent {
diff --git a/third_party/blink/renderer/platform/scheduler/test/web_fake_thread_scheduler.cc b/third_party/blink/renderer/platform/scheduler/test/web_fake_thread_scheduler.cc index 02b616e..16e667e 100644 --- a/third_party/blink/renderer/platform/scheduler/test/web_fake_thread_scheduler.cc +++ b/third_party/blink/renderer/platform/scheduler/test/web_fake_thread_scheduler.cc
@@ -23,11 +23,6 @@ return nullptr; } -scoped_refptr<base::SingleThreadTaskRunner> -WebFakeThreadScheduler::CompositorTaskRunner() { - return GetSingleThreadTaskRunnerForTesting(); -} - std::unique_ptr<WebAgentGroupScheduler> WebFakeThreadScheduler::CreateWebAgentGroupScheduler() { return std::make_unique<WebAgentGroupScheduler>(
diff --git a/third_party/blink/renderer/platform/webrtc/DEPS b/third_party/blink/renderer/platform/webrtc/DEPS index 12ee7d8..07ab7296 100644 --- a/third_party/blink/renderer/platform/webrtc/DEPS +++ b/third_party/blink/renderer/platform/webrtc/DEPS
@@ -9,6 +9,7 @@ "+gpu/command_buffer/client/gpu_memory_buffer_manager.h", "+gpu/command_buffer/client/raster_interface.h", "+gpu/command_buffer/client/shared_image_interface.h", + "+gpu/command_buffer/common/shared_image_capabilities.h", "+media/renderers/video_frame_rgba_to_yuva_converter.h", "+cc/trees/raster_context_provider_wrapper.h", ],
diff --git a/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc b/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc index dc9678a..4308a2d 100644 --- a/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc +++ b/third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.cc
@@ -17,10 +17,11 @@ #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h" +#include "gpu/command_buffer/common/shared_image_capabilities.h" +#include "media/base/simple_sync_token_client.h" #include "media/base/video_frame.h" #include "media/base/video_types.h" #include "media/base/video_util.h" -#include "media/base/wait_and_replace_sync_token_client.h" #include "media/renderers/video_frame_rgba_to_yuva_converter.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_video_frame_pool.h" @@ -195,13 +196,29 @@ // Since ConvertToWebRtcVideoFrameBuffer will always produce an opaque frame // (unless the input is already I420A), we allow using GMB readback from // ABGR/ARGB to NV12. - return gpu_factories && - (format == media::PIXEL_FORMAT_XBGR || - format == media::PIXEL_FORMAT_XRGB || - format == media::PIXEL_FORMAT_ABGR || - format == media::PIXEL_FORMAT_ARGB) && - WebGraphicsContext3DVideoFramePool:: - IsGpuMemoryBufferReadbackFromTextureEnabled(); + if (format != media::PIXEL_FORMAT_XBGR && + format != media::PIXEL_FORMAT_XRGB && + format != media::PIXEL_FORMAT_ABGR && + format != media::PIXEL_FORMAT_ARGB) { + return false; + } + if (!gpu_factories) { + return false; + } + if (!gpu_factories->SharedImageInterface()) { + return false; + } +#if BUILDFLAG(IS_WIN) + // CopyToGpuMemoryBuffer is only supported for D3D shared images on Windows. + if (!gpu_factories->SharedImageInterface() + ->GetCapabilities() + .shared_image_d3d) { + DVLOG(1) << "CopyToGpuMemoryBuffer not supported."; + return false; + } +#endif // BUILDFLAG(IS_WIN) + return WebGraphicsContext3DVideoFramePool:: + IsGpuMemoryBufferReadbackFromTextureEnabled(); } scoped_refptr<media::VideoFrame> @@ -269,11 +286,44 @@ dst_frame->set_timestamp(source_frame->timestamp()); dst_frame->set_metadata(source_frame->metadata()); + auto* ri = raster_context_provider->RasterInterface(); + DCHECK(ri); + +#if BUILDFLAG(IS_WIN) + // For shared memory GMBs on Windows we needed to explicitly request a + // copy from the shared image GPU texture to the GMB. + DCHECK(dst_frame->HasGpuMemoryBuffer()); + DCHECK_EQ(dst_frame->GetGpuMemoryBuffer()->GetType(), + gfx::SHARED_MEMORY_BUFFER); + gpu::SyncToken blit_done_sync_token; + ri->GenUnverifiedSyncTokenCHROMIUM(blit_done_sync_token.GetData()); + + auto* sii = raster_context_provider->SharedImageInterface(); + for (size_t plane = 0; plane < dst_frame->NumTextures(); ++plane) { + const auto& mailbox = dst_frame->mailbox_holder(plane).mailbox; + sii->CopyToGpuMemoryBuffer(blit_done_sync_token, mailbox); + } + + // Synchronize RasterInterface with SharedImageInterface. + auto copy_to_gmb_done_sync_token = sii->GenUnverifiedSyncToken(); + ri->WaitSyncTokenCHROMIUM(copy_to_gmb_done_sync_token.GetData()); +#endif // BUILDFLAG(IS_WIN) + // RI::Finish() makes sure that CopyRGBATextureToVideoFrame() finished // texture copy before we call ConstructVideoFrameFromGpu(). It's not // the best way to wait for completion, but it's the only sync way // to wait, and making this function async is currently impractical. - raster_context_provider->RasterInterface()->Finish(); + ri->Finish(); + + // We can just clear the sync token from the video frame now that we've + // synchronized with the GPU. + gpu::SyncToken empty_sync_token; + media::SimpleSyncTokenClient simple_client(empty_sync_token); + for (size_t plane = 0; plane < dst_frame->NumTextures(); ++plane) { + dst_frame->UpdateMailboxHolderSyncToken(plane, &simple_client); + } + dst_frame->UpdateReleaseSyncToken(&simple_client); + auto vf = ConstructVideoFrameFromGpu(std::move(dst_frame)); return vf; }
diff --git a/third_party/blink/renderer/platform/widget/input/main_thread_event_queue_unittest.cc b/third_party/blink/renderer/platform/widget/input/main_thread_event_queue_unittest.cc index 7b3c9ff..7157da11c 100644 --- a/third_party/blink/renderer/platform/widget/input/main_thread_event_queue_unittest.cc +++ b/third_party/blink/renderer/platform/widget/input/main_thread_event_queue_unittest.cc
@@ -127,7 +127,7 @@ return nullptr; } unsigned taskAsClosure() const override { return closure_id_; } - void Print(std::ostream* os) const override { NOTREACHED(); } + void Print(std::ostream* os) const override { NOTREACHED_IN_MIGRATION(); } private: unsigned closure_id_;
diff --git a/third_party/blink/renderer/platform/wtf/assertions_test.cc b/third_party/blink/renderer/platform/wtf/assertions_test.cc index 87b1ec0..10bcc01 100644 --- a/third_party/blink/renderer/platform/wtf/assertions_test.cc +++ b/third_party/blink/renderer/platform/wtf/assertions_test.cc
@@ -14,7 +14,7 @@ DCHECK(true); #if DCHECK_IS_ON() EXPECT_DEATH_IF_SUPPORTED(DCHECK(false), ""); - EXPECT_DEATH_IF_SUPPORTED(NOTREACHED(), ""); + EXPECT_DEATH_IF_SUPPORTED(NOTREACHED_IN_MIGRATION(), ""); EXPECT_DEATH_IF_SUPPORTED(DCHECK_AT(false, __FILE__, __LINE__), ""); #else DCHECK(false);
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py index 3783d097f..e0eac08 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py
@@ -176,14 +176,11 @@ return not wpt_type def _get_wpt_type(self, test_name: str) -> Optional[str]: - for wpt_dir, url_base in self._host_port.WPT_DIRS.items(): - if test_name.startswith(wpt_dir): - manifest = self._host_port.wpt_manifest(wpt_dir) - file_path = manifest.file_path_for_test_url( - test_name[len(f'{wpt_dir}/'):]) - assert file_path, f'{test_name!r} not in the {url_base!r} manifest' - return manifest.get_test_type(file_path) - return None # Not a WPT. + wpt_dir, url_from_wpt_dir = self._host_port.split_wpt_dir(test_name) + if not wpt_dir: + return None # Not a WPT. + manifest = self._host_port.wpt_manifest(wpt_dir) + return manifest.get_test_type(url_from_wpt_dir) class ChangeSet(object):
diff --git a/third_party/blink/tools/blinkpy/w3c/wpt_manifest.py b/third_party/blink/tools/blinkpy/w3c/wpt_manifest.py index 7d23ef7..251762b 100644 --- a/third_party/blink/tools/blinkpy/w3c/wpt_manifest.py +++ b/third_party/blink/tools/blinkpy/w3c/wpt_manifest.py
@@ -16,7 +16,16 @@ import json import logging -from typing import List, Literal, Optional, Sequence, Tuple +from typing import ( + Any, + Dict, + List, + Literal, + NamedTuple, + Optional, + Sequence, + Tuple, +) from blinkpy.common.memoized import memoized from blinkpy.common.path_finder import PathFinder @@ -45,6 +54,51 @@ # TODO(robertma): Use the official wpt.manifest module. +Relation = Literal['==', '!='] +Reference = Tuple[str, Relation] + +FuzzyRange = Tuple[int, int] +FuzzyParameters = Tuple[Optional[FuzzyRange], Optional[FuzzyRange]] + + +class _Test(NamedTuple): + """A container for per-test information.""" + # To save space, `file_path` is `None` if it's identical to the URL, which + # it is for most tests. + file_path: Optional[str] + test_type: str + references: List[Reference] + extras: Dict[str, Any] + + @property + def slow(self) -> bool: + return self.extras.get('timeout') == 'long' + + @property + def pac(self) -> Optional[str]: + return self.extras.get('pac') + + @property + def fuzzy_params(self) -> FuzzyParameters: + params = self.extras.get('fuzzy') + if not params: + return None, None + _, (max_diff, total_pixels) = params[0] + assert len(max_diff) == 2, max_diff + assert len(total_pixels) == 2, total_pixels + return max_diff, total_pixels + + @property + def jsshell(self) -> bool: + """Whether this manifest item is a jsshell test. + + "jsshell" is one of the scopes automatically generated from .any.js + tests. It is intended to run in a thin JavaScript shell instead of a + full browser, so we usually ignore it in web tests. (crbug.com/871950) + """ + return self.extras.get('jsshell', False) + + class WPTManifest: """A simple abstraction of WPT MANIFEST.json. @@ -93,15 +147,8 @@ wpt_dir: str, test_types: Optional[Sequence[str]] = None, exclude_jsshell: bool = True): - self.raw_dict = raw_dict + self._raw_dict = raw_dict self.wpt_dir = wpt_dir - # As a workaround to handle the change from a flat-list to a trie - # structure in the v8 manifest, flatten the items back to the v7 format. - # - # TODO(crbug.com/912496): Properly support the trie structure. - self.raw_dict['items'] = self._flatten_items( - self.raw_dict.get('items', {})) - self.test_types = test_types or ( 'manual', 'reftest', @@ -109,9 +156,55 @@ 'testharness', 'crashtest', ) - self.test_name_to_file = {} + self._tests_by_url = {} self._exclude_jsshell = exclude_jsshell + items = self._raw_dict.get('items', {}) + for test_type in self.test_types: + self._map_tests(test_type, items.get(test_type, {})) + + def _map_tests(self, test_type: str, trie, path: str = ''): + """Record tests present in a trie for some test type. + + Arguments: + test_type: The WPT test type. + trie: Either: + * A list, which represents a test file (a leaf in the trie). + * A map representing a test directory. It maps the next path + component to the corresponding child. + path: The path so far to this test file or directory. + + Note: + When constructing the external manifest, this recursive walk must + traverse all 50k+ items, so it impacts the startup performance of + many tools. + """ + if isinstance(trie, dict): + for component, child in trie.items(): + # URLs always use `/` for path separators. Don't add a leading + # `/`, since that's the convention in `blinkpy` for test paths. + child_path = f'{path}/{component}' if path else component + self._map_tests(test_type, child, child_path) + return + + assert len(trie) >= 2, f'{trie!r} must contain at least one test' + # Ignore the first element, which is the file's Git tree ID. + for url, *maybe_refs, extras in trie[1:]: + assert len(maybe_refs) <= 1, f'extra item data: {maybe_refs!r}' + refs = maybe_refs[0] if maybe_refs else [] + # To save space, the v8 manifest omits the URL if it's + # identical to the file path, which it is for most tests. + if url: + # Trim any leading `/`, which WPT URLs use by convention. + if url.startswith('/'): + url = url[1:] + test = _Test(path, test_type, refs, extras) + else: + url, test = path, _Test(None, test_type, refs, extras) + assert url not in self._tests_by_url, f'duplicate URL {url!r}' + if not self._exclude_jsshell or not test.jsshell: + self._tests_by_url[url] = test + @classmethod def from_file(cls, port, @@ -125,98 +218,38 @@ fs.dirname(fs.relpath(manifest_path, port.web_tests_dir())), test_types, exclude_jsshell) - def _items_for_file_path(self, path_in_wpt): - """Finds manifest items for the given WPT path. - - Args: - path_in_wpt: A file path relative to the root of WPT. - - Returns: - A list of manifest items, or None if not found. - """ - items = self.raw_dict.get('items', {}) - for test_type in self.test_types: - if test_type not in items: - continue - if path_in_wpt in items[test_type]: - return items[test_type][path_in_wpt] - return None - - def _item_for_url(self, url): - """Finds the manifest item for the given WPT URL. - - Args: - url: A WPT URL. - - Returns: - A manifest item, or None if not found. - """ - return self.all_url_items().get(url) - - @staticmethod - def _get_url_from_item(item): - return item[0] - - @staticmethod - def _get_extras_from_item(item): - return item[-1] - - @staticmethod - def _is_not_jsshell(item): - """Returns True if the manifest item isn't a jsshell test. - - "jsshell" is one of the scopes automatically generated from .any.js - tests. It is intended to run in a thin JavaScript shell instead of a - full browser, so we simply ignore it in web tests. (crbug.com/871950) - """ - extras = WPTManifest._get_extras_from_item(item) - return not extras.get('jsshell', False) - - @memoized - def all_url_items(self): - """Returns a dict mapping every URL in the manifest to its item.""" - url_items = {} - if 'items' not in self.raw_dict: - return url_items - items = self.raw_dict['items'] - for test_type in self.test_types: - if test_type not in items: - continue - for filename, records in items[test_type].items(): - if self._exclude_jsshell: - records = filter(self._is_not_jsshell, records) - for item in records: - url_for_item = self._get_url_from_item(item) - url_items[url_for_item] = item - self.test_name_to_file[url_for_item] = filename - return url_items - @memoized def all_urls(self): """Returns a set of the URLs for all items in the manifest.""" - urls_with_nonempty_paths = [] - for url in self.all_url_items().keys(): - assert not url.startswith('/') - assert not url.endswith('/') - # Drop empty path components. - url = url.replace('//', '/') - urls_with_nonempty_paths.append(url) - return frozenset(urls_with_nonempty_paths) + return frozenset(self._tests_by_url) - def is_test_file(self, path_in_wpt): - """Checks if path_in_wpt is a test file according to the manifest.""" - assert not path_in_wpt.startswith('/') - return self._items_for_file_path(path_in_wpt) is not None - - def get_test_type(self, test_path: str) -> Optional[str]: + def get_test_type(self, url: str) -> Optional[str]: """Returns the test type of the given test file path.""" - assert not test_path.startswith('/') - items = self.raw_dict.get('items', {}) - for test_type in self.test_types: - type_items = items.get(test_type, {}) - if test_path in type_items: - return test_type - return None + assert not url.startswith('/') + test = self._tests_by_url.get(url) + return test and test.test_type + + def is_test_file(self, file_path: str) -> bool: + """Checks if file_path is a test file according to the manifest.""" + assert not file_path.startswith('/') + components = file_path.split('/') + assert components, file_path + tries_by_type = self._raw_dict.get('items', {}) + return any( + self._contains_file(tries_by_type.get(test_type, {}), components) + for test_type in self.test_types) + + def _contains_file(self, trie, components: Sequence[str]) -> bool: + """Determine if a test trie contains a test file.""" + if isinstance(trie, list): + # Not a test file if there are still components at a leaf. + return not bool(components) + if not components: + # This is a test directory, not a test file. + return False + next_component, *rest = components + child = trie.get(next_component) + return bool(child) and self._contains_file(child, rest) def is_test_url(self, url): """Checks if url is a valid test in the manifest.""" @@ -225,18 +258,15 @@ def is_crash_test(self, url): """Checks if a WPT is a crashtest according to the manifest.""" - test_path = self.file_path_for_test_url(url) - return test_path and self.get_test_type(test_path) == 'crashtest' + return self.get_test_type(url) == 'crashtest' def is_manual_test(self, url): """Checks if a WPT is a manual according to the manifest.""" - test_path = self.file_path_for_test_url(url) - return test_path and self.get_test_type(test_path) == 'manual' + return self.get_test_type(url) == 'manual' def is_print_reftest(self, url): """Checks if a WPT is a print reftest according to the manifest.""" - test_path = self.file_path_for_test_url(url) - return test_path and self.get_test_type(test_path) == 'print-reftest' + return self.get_test_type(url) == 'print-reftest' def is_slow_test(self, url): """Checks if a WPT is slow (long timeout) according to the manifest. @@ -247,14 +277,8 @@ Returns: True if the test is found and is slow, False otherwise. """ - if not self.is_test_url(url): - return False - - item = self._item_for_url(url) - if not item: - return False - extras = self._get_extras_from_item(item) - return extras.get('timeout') == 'long' + test = self._tests_by_url.get(url) + return test.slow if test else False def extract_test_pac(self, url): """Get the proxy configuration (PAC) for the test @@ -265,18 +289,10 @@ Returns: A relative PAC url if noted by the test, None otherwise. """ - if not self.is_test_url(url): - return None + test = self._tests_by_url.get(url) + return test and test.pac - item = self._item_for_url(url) - if not item: - return None - - extras = self._get_extras_from_item(item) - return extras.get('pac') - - def extract_reference_list( - self, url: str) -> List[Tuple[Literal['==', '!='], str]]: + def extract_reference_list(self, url: str) -> List[Tuple[Relation, str]]: """Extracts reference information of the specified (print) reference test. The return value is a list of (match/not-match, reference path in wpt) @@ -284,24 +300,12 @@ [("==", "/foo/bar/baz-match.html"), ("!=", "/foo/bar/baz-mismatch.html")] """ - items = self.raw_dict.get('items', {}) - test_path = self.file_path_for_test_url(url) - test_type = test_path and self.get_test_type(test_path) - if test_type not in ['reftest', 'print-reftest']: + test = self._tests_by_url.get(url) + if not test: return [] + return [(relation, ref) for ref, relation in test.references] - reftest_list = [] - item = self._item_for_url(url) - for ref_path_in_wpt, expectation in (item[1] if item else []): - # Ref URLs in MANIFEST should be absolute, but we double check - # just in case. - if (not ref_path_in_wpt.startswith('about:') - and not ref_path_in_wpt.startswith('/')): - ref_path_in_wpt = '/' + ref_path_in_wpt - reftest_list.append((expectation, ref_path_in_wpt)) - return reftest_list - - def extract_fuzzy_metadata(self, url): + def extract_fuzzy_metadata(self, url: str) -> FuzzyParameters: """Extracts the fuzzy reftest metadata for the specified (print) reference test. Although WPT supports multiple fuzzy references for a given test (one @@ -323,28 +327,13 @@ for the test. If the test isn't a reference test or doesn't have fuzzy information, a pair of Nones are returned. """ - - items = self.raw_dict.get('items', {}) - test_path = self.file_path_for_test_url(url) - test_type = test_path and self.get_test_type(test_path) - if test_type not in ['reftest', 'print-reftest']: + test = self._tests_by_url.get(url) + test_type = self.get_test_type(url) + if test_type not in {'reftest', 'print-reftest'}: return None, None + return test.fuzzy_params - item = self._item_for_url(url) - # The item is a list of [url, refs, properties], and the fuzzy metadata - # is stored in the properties dict. - if 'fuzzy' in item[2]: - fuzzy_metadata_list = item[2]['fuzzy'] - for fuzzy_metadata in fuzzy_metadata_list: - # The fuzzy metadata is a nested list of [url, [maxDifference, - # maxPixels]]. - assert len( - fuzzy_metadata[1] - ) == 2, 'Malformed fuzzy ref data for {}'.format(url) - return fuzzy_metadata[1] - return None, None - - def file_path_for_test_url(self, url): + def file_path_for_test_url(self, url: str) -> Optional[str]: """Finds the file path for the given test URL. Args: @@ -353,9 +342,8 @@ Returns: The path to the file containing this test URL, or None if not found. """ - # Call all_url_items to ensure the test to file mapping is populated. - self.all_url_items() - return self.test_name_to_file.get(url) + test = self._tests_by_url.get(url) + return (test.file_path or url) if test else None @staticmethod def ensure_manifest(port, path=None): @@ -428,86 +416,3 @@ output = port.host.executive.run_command(cmd, timeout_seconds=600) if output: _log.debug('Output: %s', output) - - @staticmethod - def _flatten_items(items): - """Flattens the 'items' object of a v8 manifest to the v7 format. - - The v8 manifest is a trie, where each level is a directory. The v7 - format, which the blinkpy code was written around, uses flat list: - - { - "items": { - "crashtest": { - "dir1/dir2/filename1": [manifest items], - "dir1/dir2/filename2": [manifest items], - ... - }, - "manual": {...}, - "reftest": {...}, - "print-reftest": {...}, - "testharness": {...} - }, - // other info... - } - - Args: - items: an 'items' entry in the v8 trie format. - - Returns: - The input data, rewritten to the v7 flat-list format. - """ - - def _handle_node(test_type_items, node, path): - """Recursively walks the trie, converting to the flat format. - - Args: - test_type_items: the root dictionary for the current test type - (e.g. 'testharness'). Will be updated by this function with - new entries for any files found. - node: the current node in the trie - path: the accumulated filepath so far - """ - assert isinstance(node, dict) - - for k, v in node.items(): - # WPT urls are always joined by '/', even on Windows. - new_path = k if not path else path + '/' + k - - # Leafs (files) map to a list rather than a dict, e.g. - # 'filename.html': [ - # 'git object ID', - # [manifest item], - # [manifest item], - # ], - if isinstance(v, list): - # A file should be unique, and it should always contain both - # a git object ID and at least one manifest item (which may - # be empty). - assert new_path not in test_type_items - assert len(v) >= 2 - - # We have no use for the git object ID. - manifest_items = v[1:] - for manifest_item in manifest_items: - # As an optimization, the v8 manifest will omit the URL - # if it is the same as the filepath. The v7 manifest did - # not, so restore that information. - if manifest_item: - maybe_url = manifest_item[0] - if maybe_url is None: - manifest_item[0] = new_path - elif maybe_url.startswith('/'): - manifest_item[0] = maybe_url[len('/'):] - test_type_items[new_path] = manifest_items - else: - # Otherwise, we should be at a directory and so can recurse. - _handle_node(test_type_items, v, new_path) - - new_items = {} - for test_type, value in items.items(): - test_type_items = {} - _handle_node(test_type_items, value, '') - new_items[test_type] = test_type_items - - return new_items
diff --git a/third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py b/third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py index cbc8e5c..ef01475 100644 --- a/third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py +++ b/third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py
@@ -154,8 +154,6 @@ host.port_factory.get(), MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json') self.assertTrue(manifest.is_test_file('test.any.js')) - self.assertEqual(manifest.all_url_items(), - {u'test.any.html': [u'test.any.html', {}]}) self.assertEqual(manifest.extract_reference_list('foo/bar.html'), []) def test_all_url_items_skips_jsshell_tests(self): @@ -180,8 +178,6 @@ manifest = WPTManifest.from_file( host.port_factory.get(), MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json') - self.assertEqual(manifest.all_url_items(), - {u'test.any.html': [u'test.any.html', {}]}) def test_file_for_test(self): # Test that we can lookup a test's filename for various cases like @@ -206,11 +202,6 @@ manifest = WPTManifest.from_file( host.port_factory.get(), MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json') - self.assertEqual( - manifest.all_url_items(), { - u'test.any.html': [u'test.any.html', {}], - u'test.any.worker.html': [u'test.any.worker.html', {}] - }) # Ensure that we can get back to `test.any.js` from both of the tests. self.assertEqual( manifest.file_path_for_test_url('test.any.html'), 'test.any.js') @@ -251,13 +242,6 @@ manifest = WPTManifest.from_file( host.port_factory.get(), MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json') - self.assertEqual( - manifest.all_url_items(), { - 'test.html': ['test.html', {}], - 'test-with-variant-crash.html?xyz': - ['test-with-variant-crash.html?xyz', {}], - 'test-crash.html': ['test-crash.html', {}] - }) self.assertTrue(manifest.is_crash_test('test-crash.html')) self.assertTrue( @@ -395,12 +379,12 @@ self.assertEqual( manifest.extract_fuzzy_metadata('fuzzy.html'), - [[2, 2], [40, 40]], + ([2, 2], [40, 40]), ) self.assertEqual( manifest.extract_fuzzy_metadata('fuzzy-print.html'), - [[3, 10], [20, 100]], + ([3, 10], [20, 100]), ) self.assertEqual(manifest.extract_fuzzy_metadata('not_fuzzy.html'),
diff --git a/third_party/blink/tools/blinkpy/w3c/wpt_results_processor.py b/third_party/blink/tools/blinkpy/w3c/wpt_results_processor.py index bfd5a1a2..7404bea 100644 --- a/third_party/blink/tools/blinkpy/w3c/wpt_results_processor.py +++ b/third_party/blink/tools/blinkpy/w3c/wpt_results_processor.py
@@ -577,7 +577,8 @@ self._iteration += 1 def _get_chromium_test_name(self, test: str, subsuite: str): - if self.port.wpt_dir(test) != 'wpt_internal': + wpt_dir, _ = self.port.split_wpt_dir(test) + if wpt_dir != 'wpt_internal': test = self.path_finder.wpt_prefix() + test if subsuite: test = f'virtual/{subsuite}/{test}' @@ -603,9 +604,9 @@ baseline=baseline) def get_path_from_test_root(self, test: str) -> str: - wpt_dir = self.port.wpt_dir(test) + wpt_dir, url_from_wpt_dir = self.port.split_wpt_dir(test) manifest = self.port.wpt_manifest(wpt_dir) - return manifest.file_path_for_test_url(test[len(f'{wpt_dir}/'):]) + return manifest.file_path_for_test_url(url_from_wpt_dir) @memoized def _file_path_for_test(self, test: str) -> str: @@ -614,15 +615,15 @@ if not path_from_test_root: raise EventProcessingError( 'Test ID %r does not exist in the manifest' % test) - wpt_dir = self.port.wpt_dir(test) + wpt_dir, _ = self.port.split_wpt_dir(test) return self.path_finder.path_from_web_tests(*posixpath.split(wpt_dir), path_from_test_root) def get_test_type(self, test: str) -> str: _, test = self.port.get_suite_name_and_base_test(test) - manifest = self.port.wpt_manifest(self.port.wpt_dir(test)) - path_from_root = self.get_path_from_test_root(test) - return manifest.get_test_type(path_from_root) + wpt_dir, url_from_wpt_dir = self.port.split_wpt_dir(test) + manifest = self.port.wpt_manifest(wpt_dir) + return manifest.get_test_type(url_from_wpt_dir) def test_status(self, event: Event, @@ -887,18 +888,15 @@ _, base_test = self.port.get_suite_name_and_base_test(test_name) test_url = self.path_finder.strip_wpt_path(base_test) - wpt_dir = self.port.wpt_dir(base_test) - assert wpt_dir, f'{base_test!r} is not a WPT' - manifest = self.port.wpt_manifest(wpt_dir) # `test_url` is the globally mounted URL (i.e., its canonical ID), - # whereas `url_from_root`'s path part is relative to the test root + # whereas `url_from_wpt_dir`'s path part is relative to the test root # (i.e., `external/wpt` or `wpt_internal`). These URLs happen to be # identical for `external/wpt`, which wptserve mounts to `/`. - url_from_root = base_test[len(f'{wpt_dir}/'):] - relation_by_ref = { - url: relation - for relation, url in manifest.extract_reference_list(url_from_root) - } + wpt_dir, url_from_wpt_dir = self.port.split_wpt_dir(base_test) + assert wpt_dir, f'{base_test!r} is not a WPT' + manifest = self.port.wpt_manifest(wpt_dir) + references = manifest.extract_reference_list(url_from_wpt_dir) + relation_by_ref = {url: relation for relation, url in references} assert set(relation_by_ref.values()) <= {'==', '!='} test_screenshot = match_screenshot = mismatch_screenshot = None
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py index 9ee1214..2a734a79 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py
@@ -57,7 +57,12 @@ from blinkpy.common.memoized import memoized from blinkpy.common.system.executive import ScriptError from blinkpy.common.system.path import abspath_to_uri -from blinkpy.w3c.wpt_manifest import WPTManifest, MANIFEST_NAME +from blinkpy.w3c.wpt_manifest import ( + FuzzyRange, + FuzzyParameters, + WPTManifest, + MANIFEST_NAME, +) from blinkpy.web_tests.layout_package.bot_test_expectations import BotTestExpectationsFactory from blinkpy.web_tests.models.test_configuration import TestConfiguration from blinkpy.web_tests.models.test_run_results import TestRunException @@ -75,9 +80,6 @@ _log = logging.getLogger(__name__) -FuzzyRange = Tuple[int, int] -FuzzyParameters = Tuple[Optional[FuzzyRange], Optional[FuzzyRange]] - # Path relative to the build directory. CONTENT_SHELL_FONTS_DIR = "test_fonts" @@ -1312,15 +1314,12 @@ return hasher.hexdigest() @classmethod - def wpt_dir(cls, test: str) -> Optional[str]: - """Return which WPT directory (if any) a test belongs to. - - Returns `None` if the test is not a WPT. - """ + def split_wpt_dir(cls, test: str) -> Tuple[Optional[str], str]: + """Split a test path into its WPT directory (if any) and the rest.""" for wpt_dir in cls.WPT_DIRS: if test.startswith(wpt_dir): - return wpt_dir - return None + return wpt_dir, test[len(f'{wpt_dir}/'):] + return None, test def is_wpt_file(self, path): """Returns whether a path is a WPT test file."""
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 0cb040a..3e0d215 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -634,6 +634,21 @@ "expires": "Nov 10, 2024" }, { + "prefix": "isolated-context", + "platforms": ["Linux", "Mac", "Win"], + "bases": ["wpt_internal/permissions-policy"], + "exclusive_tests": "ALL", + "args": ["--isolated-context-origins=https://web-platform.test", + "--disable-threaded-compositing", "--disable-threaded-animation"], + "owners": [ + "cmp@chromium.org", + "reillyg@chromium.org", + "rmcelrath@chromium.org", + "zelin@chromium.org" + ], + "expires": "never" + }, + { "prefix": "direct-sockets", "platforms": ["Linux", "Mac", "Win"], "bases": ["external/wpt/direct-sockets"], @@ -1517,6 +1532,20 @@ "expires": "Jul 1, 2023" }, { + "prefix": "fledge-two-seller-worklet-threads", + "platforms": ["Linux", "Mac", "Win"], + "owners": ["behamilton@google.com", "caraitto@chromium.org", "pauljensen@chromium.org", "mmenke@chromium.org", "morlovich@chromium.org", "qingxinwu@google.com"], + "bases": [ + "http/tests/inspector-protocol/target/auto-attach-auction-worklet.js", + "http/tests/inspector-protocol/target/target-auction-worklet.js" + ], + "exclusive_tests": "ALL", + "args": [ + "--enable-features=FledgeSellerWorkletThreadPool:seller_worklet_thread_pool_size/2" + ], + "expires": "Nov 15, 2024" + }, + { "prefix": "fledge-kanon-status-below-threshold", "platforms": ["Linux", "Mac", "Win"], "owners": ["behamilton@google.com", "caraitto@chromium.org", "pauljensen@chromium.org", "mmenke@chromium.org", "morlovich@chromium.org", "qingxinwu@google.com"],
diff --git a/third_party/blink/web_tests/accessibility/name-calc-aria-labelledby.html b/third_party/blink/web_tests/accessibility/name-calc-aria-labelledby.html index f7ae608..6499922 100644 --- a/third_party/blink/web_tests/accessibility/name-calc-aria-labelledby.html +++ b/third_party/blink/web_tests/accessibility/name-calc-aria-labelledby.html
@@ -107,8 +107,8 @@ <script> test(function(t){ var axLabelledby6 = accessibilityController.accessibleElementById("labelledby6"); - assert_equals(axLabelledby6.name, ""); - assert_equals(axLabelledby6.nameFrom, "relatedElement"); + assert_equals(axLabelledby6.name, "Contents"); + assert_equals(axLabelledby6.nameFrom, "contents"); assert_equals(axLabelledby6.nameElementCount(), 1); assert_equals(axLabelledby6.nameElementAtIndex(0).role, "AXRole: AXGenericContainer"); }, "aria-labelledby reference to element with no text.");
diff --git a/third_party/blink/web_tests/external/wpt/accessibility/crashtests/missing-parent-multi-col.html b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/missing-parent-multi-col.html new file mode 100644 index 0000000..5899e98 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/missing-parent-multi-col.html
@@ -0,0 +1,21 @@ +<!-- This test ensures that after a large layout change to a subtree, there are + no extra accessibility objects remaining from the old subtree --> +<!DOCTYPE html> +<html class="test-wait"> +<style> +.step1::after { display: table-row-group; float: left; counter-reset: subsection; column-width: 10px; } +.step2::after { display: block; } +</style> + +<script> +const quote = document.createElement('q'); +quote.setAttribute('class', 'step1'); +document.documentElement.appendChild(quote); +requestAnimationFrame(() => { + requestAnimationFrame(() => { + quote.setAttribute('class', 'step2'); + document.documentElement.className = ''; + }); +}); +</script> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/accname/name/comp_label-expected.txt b/third_party/blink/web_tests/external/wpt/accname/name/comp_label-expected.txt deleted file mode 100644 index c1aa470..0000000 --- a/third_party/blink/web_tests/external/wpt/accname/name/comp_label-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -This is a testharness.js-based test. -Found 1 FAIL, 0 TIMEOUT, 0 NOTRUN. -[FAIL] button's hidden referenced name (visibility:hidden) with hidden aria-labelledby traversal falls back to aria-label - assert_equals: <button aria-labelledby="span5" aria-label="foo" data-expectedlabel="foo" data-testname="button's hidden referenced name (visibility:hidden) with hidden aria-labelledby traversal falls back to aria-label" class="ex">\n <span id="span5">\n <span id="span6" style="visibility:hidden;">label</span>\n </span>\n x\n</button> expected "foo" but got "" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-001.https.html b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-001.https.html index 5860718..1746ea9f 100644 --- a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-001.https.html +++ b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-001.https.html
@@ -13,8 +13,10 @@ function run() { test(() => { const testImage = document.getElementsByTagName('img')[0]; - assert_equals(testImage.naturalWidth, 2 * 50 * window.devicePixelRatio); - assert_equals(testImage.naturalHeight, 3 * 50 * window.devicePixelRatio); + // Spec: sec-ch-width MUST be an integer greater than or equal to 0. + const width = Math.ceil(50 * devicePixelRatio); + assert_equals(testImage.naturalWidth, 2 * width); + assert_equals(testImage.naturalHeight, 3 * width); }, 'Sec-CH-Width is set for lazy auto sizes'); done(); }
diff --git a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-002.https.html b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-002.https.html index 45b8d4e..0dfaf2e 100644 --- a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-002.https.html +++ b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-002.https.html
@@ -13,8 +13,10 @@ function run() { test(() => { const testImage = document.getElementsByTagName('img')[0]; - assert_equals(testImage.naturalWidth, 2 * 50 * window.devicePixelRatio); - assert_equals(testImage.naturalHeight, 3 * 50 * window.devicePixelRatio); + // Spec: sec-ch-width MUST be an integer greater than or equal to 0. + const width = Math.ceil(50 * devicePixelRatio); + assert_equals(testImage.naturalWidth, 2 * width); + assert_equals(testImage.naturalHeight, 3 * width); }, 'Sec-CH-Width is set for lazy auto sizes'); done(); }
diff --git a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-003.https.html b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-003.https.html index 83a4823..235529d 100644 --- a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-003.https.html +++ b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width-auto-sizes-003.https.html
@@ -13,8 +13,10 @@ function run() { test(() => { const testImage = document.getElementsByTagName('img')[0]; - assert_equals(testImage.naturalWidth, 2 * 50 * window.devicePixelRatio); - assert_equals(testImage.naturalHeight, 3 * 50 * window.devicePixelRatio); + // Spec: sec-ch-width MUST be an integer greater than or equal to 0. + const width = Math.ceil(50 * devicePixelRatio); + assert_equals(testImage.naturalWidth, 2 * width); + assert_equals(testImage.naturalHeight, 3 * width); }, 'Sec-CH-Width is set for lazy auto sizes'); done(); }
diff --git a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width.https.html b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width.https.html index 28fe0860..ec13ff96 100644 --- a/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width.https.html +++ b/third_party/blink/web_tests/external/wpt/client-hints/sec-ch-width.https.html
@@ -12,8 +12,10 @@ function run() { test(() => { const testImage = document.getElementsByTagName('img')[0]; - assert_equals(testImage.naturalWidth, 2 * (0.10 * window.innerWidth) * window.devicePixelRatio); - assert_equals(testImage.naturalHeight, 3 * (0.10 * window.innerWidth) * window.devicePixelRatio); + // Spec: sec-ch-width MUST be an integer greater than or equal to 0. + const width = Math.ceil(0.10 * innerWidth * devicePixelRatio); + assert_equals(testImage.naturalWidth, 2 * width); + assert_equals(testImage.naturalHeight, 3 * width); }, 'Sec-CH-Width should be set'); done(); }
diff --git a/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-constructor-customized-bulitins-expected.txt b/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-constructor-customized-bulitins-expected.txt deleted file mode 100644 index 3312059..0000000 --- a/third_party/blink/web_tests/external/wpt/custom-elements/HTMLElement-constructor-customized-bulitins-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -[FAIL] HTMLElement constructor must not get .prototype until it finishes its extends sanity checks, calling proxy constructor directly - assert_equals: Should never have gotten .prototype expected 0 but got 1 -[FAIL] HTMLElement constructor must not get .prototype until it finishes its extends sanity checks, calling via Reflect - assert_equals: Should never have gotten .prototype expected 0 but got 1 -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/document-write.tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/document-write.tentative.html deleted file mode 100644 index 551703c6..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/document-write.tentative.html +++ /dev/null
@@ -1,91 +0,0 @@ -<!doctype html> -<title>'document-write' tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/document-policy/experimental-features/resources/common.js"></script> -<style> -html, body { - height: 100%; - width: 100%; -} -</style> -<body> -<script> - "use strict"; - - function newIframe() { - var i = document.createElement("iframe"); - document.body.appendChild(i); - return i; - } - - let iframeElement = document.querySelector("iframe"); - const allowed_url = url_base + "document-write-allowed.html"; - const disallowed_url = url_base + "document-write-disallowed.html"; - - let text_to_write = "<div>FOO<\/div>"; - let test_cases = [{ - api: "open", - query: "body", - expected_value_enabled: false, - }, - { - api: "close" - }, - { - api: "write", - args: text_to_write, - query: "div", - expected_value_enabled: "FOO" - }, - { - api: "writeln", - args: text_to_write, - query: "div", - expected_value_enabled: "FOO" - }]; - - // The feature 'document-write' is enabled by default and when it - // is enabled, all dynamic markup insertion API work as intended. - test_cases.forEach((tc) => { - promise_test(async() => { - let iframeElement = newIframe(); - await loadUrlInIframe(iframeElement, allowed_url); - await sendMessageAndGetResponse(iframeElement.contentWindow, tc).then((response) => { - assert_false( - response.did_throw_exception, - `When feature is disabled, invoking 'document.${tc.api}' should not` + - " throw an exception."); - if (tc.query) { - assert_equals( - response.value, - tc.expected_value_enabled, - `The added script tag by 'document.${tc.api}' must have run.`); - } - }); - }, `Verify 'document.${tc.api}' is not normally blocked.` ); - }); - - - // Disabling 'document-write' throws exception on the included API. - test_cases.forEach((tc) => { - promise_test(async() => { - let iframeElement = newIframe(); - await loadUrlInIframe(iframeElement, disallowed_url); - await sendMessageAndGetResponse(iframeElement.contentWindow, tc).then((response) => { - assert_true( - response.did_throw_exception, - `When feature is enabled, invoking 'document.${tc.api}' should ` + - " throw an exception."); - if (tc.query) { - assert_not_equals( - response.value, - tc.expected_value_enabled, - `The added script tag by 'document.${tc.api}' must not have run.`); - } - }); - }, `Verify 'document.${tc.api}' is blocked when the feature is disabled.` ); - }); - -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html deleted file mode 100644 index fd32ace7..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html> -<meta name="timeout" content="long"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/css/support/interpolation-testcommon.js"></script> -<title> 'layout-animations' Policy : Correct behavior for affected and unaffected properties when - feature is disabled. -</title> -<body> -<script> - // Sanity-check: Properties which are not affected by the policy 'layout-animations' should be - // interpolated normally (linearly) when the policy is disabled for the document. - test_interpolation( - { - property: "color", - from: "rgba(0, 50, 100, 1)", - to: "rgba(200, 150, 200, 1)", - test_prefix: 'Testing property "color".' - }, - [ - {at: 0.00, expect: "rgba(0, 50, 100, 1)"}, - {at: 0.1, expect: "rgba(20, 60, 110, 1)"}, - {at: 0.2, expect: "rgba(40, 70, 120, 1)"}, - {at: 0.4, expect: "rgba(80, 90, 140, 1)"}, - {at: 0.6, expect: "rgba(120, 110, 160, 1)"}, - {at: 0.8, expect: "rgba(160, 130, 180, 1)"}, - {at: 0.9, expect: "rgba(180, 140, 190, 1)"}, - ]); - - // There is no interpolation for the affected properties when the policy is disabled. - ["bottom", "height", "left", "right", "top", "width"].forEach( - (p) => test_no_interpolation( - { - property: p, - from: "100px", - to: "200px", - test_prefix: `Testing property "${p}".` - })); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers deleted file mode 100644 index 745da550..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: layout-animations=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html deleted file mode 100644 index ee7c295..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/document-policy/experimental-features/resources/common.js"></script> -<title> 'layout-animations' Policy : violation reports from javascript -</title> -<body> -<script> - promise_test(async () => { - let promise = wait_for_violation_in_file( - "layout-animations", - "animation-property-height.js"); - let script = document.createElement("script"); - script.src = "/document-policy/experimental-features/resources/" + - "animation-property-height.js"; - document.body.appendChild(script); - await promise; - }, - "Verify that when 'layout-animations' is disabled, an 'element.animate' " + - "API including a keyframe that uses a blocked property generates violation " + - "report (linked scripts)."); - - promise_test(async () => { - let promise = wait_for_violation_in_file( - "layout-animations", - "layout-animations-disabled-violation-report-js-tentative.html"); - let div = document.createElement("div"); - document.body.appendChild(div); - div.animate([{width: "100px"}, {width: "200px"}]); - await promise; - }, - "Verify that when 'layout-animations' is disabled, an 'element.animate' " + - "API including a keyframe that uses a blocked property generates violation " + - "report (inline scripts)."); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers deleted file mode 100644 index 745da550..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: layout-animations=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html deleted file mode 100644 index cd9210c..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/document-policy/experimental-features/resources/common.js"></script> -<title> 'layout-animations' Policy : violation reports from CSS keyframes -</title> -<body> -<script> - promise_test(async () => { - let promise = wait_for_violation_in_file( - "layout-animations", null /* source not specified */); - let style = document.createElement("style"); - style.innerHTML = `@keyframes animation_property_top { - from { top: 0px } - to { top: 100px } - }`; - document.body.appendChild(style); - await promise; - }, - "Verify that when 'layout-animations' is disabled, a keyframes which " + - "includes a blocked property generates violation report."); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers deleted file mode 100644 index 745da550..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: layout-animations=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-enabled-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-enabled-tentative.html deleted file mode 100644 index 19e4054..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/layout-animations-enabled-tentative.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/css/support/interpolation-testcommon.js"></script> -<title> 'layout-animations' Policy : Correct behavior for affected and unaffected properties when - feature is enabled. -</title> -<body> -<script> - // The expectation for all the following properties could be the same (they are all of type length). - let length_expectations_100_to_200 = [ - {at: 0.00, expect: "100px"}, - {at: 0.1, expect: "110px"}, - {at: 0.2, expect: "120px"}, - {at: 0.4, expect: "140px"}, - {at: 0.6, expect: "160px"}, - {at: 0.8, expect: "180px"}, - {at: 0.9, expect: "190px"}, - ]; - // Ensure all the affected animations run normally. - ["bottom", "height", "left", "right", "top", "width"].forEach( - (p) => test_interpolation({ - property: p, - from: "100px", - to: "200px", - test_prefix: `Testing property "${p}".` - }, - length_expectations_100_to_200)); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/animation-property-height.js b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/animation-property-height.js deleted file mode 100644 index 79316cb..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/animation-property-height.js +++ /dev/null
@@ -1,3 +0,0 @@ -let div = document.createElement("div"); -document.body.appendChild(div); -div.animate([{"height": "0px"}, {"height": "100px"}]);
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/async-script.js b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/async-script.js deleted file mode 100644 index 3c0ee6d0..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/async-script.js +++ /dev/null
@@ -1 +0,0 @@ -window.didExecuteExternalAsyncScript = true;
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/defer-script.js b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/defer-script.js deleted file mode 100644 index 8d248ee0..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/defer-script.js +++ /dev/null
@@ -1 +0,0 @@ -window.didExecuteExternalDeferredScript = true;
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-policy-image.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-policy-image.html deleted file mode 100644 index 4e5b919b..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-policy-image.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<body> -<script> -window.addEventListener('load', function() { - var img = document.createElement('IMG'); - img.setAttribute("src", "/document-policy/experimental-features/resources/image.jpg"); - img.addEventListener('load', function() { - parent.postMessage({width: img.width, height: img.height}, '*'); - }); - document.body.appendChild(img); -}); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-allowed.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-allowed.html deleted file mode 100644 index 633fa85..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-allowed.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<style> -#spacer { - width: 200%; - height: 200%; -} -</style> -<body> -<script> - window.addEventListener("message", onMessageReceived); - - function test(api, args) { - let did_throw = false; - try { - document[api](args); - } catch(e) { - did_throw = true; - } - return did_throw; - } - - function onMessageReceived(e) { - let msg = e.data; - - msg.did_throw_exception = test(msg.api, msg.args); - if (msg.query) { - let el = document.querySelector(msg.query); - msg.value = el ? el.innerHTML : false; - } - ackMessage(msg, e.source); - } - - function ackMessage(msg, source) { - source.postMessage(msg, "*"); - } -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html deleted file mode 100644 index 633fa85..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<style> -#spacer { - width: 200%; - height: 200%; -} -</style> -<body> -<script> - window.addEventListener("message", onMessageReceived); - - function test(api, args) { - let did_throw = false; - try { - document[api](args); - } catch(e) { - did_throw = true; - } - return did_throw; - } - - function onMessageReceived(e) { - let msg = e.data; - - msg.did_throw_exception = test(msg.api, msg.args); - if (msg.query) { - let el = document.querySelector(msg.query); - msg.value = el ? el.innerHTML : false; - } - ackMessage(msg, e.source); - } - - function ackMessage(msg, source) { - source.postMessage(msg, "*"); - } -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html.headers deleted file mode 100644 index 32846f72..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/document-write-disallowed.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: document-write=?0 \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.jpg b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.jpg deleted file mode 100644 index 430f5c5..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.jpg +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.png b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.png deleted file mode 100644 index 556fa72..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.svg b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.svg deleted file mode 100644 index 73ca820..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/image.svg +++ /dev/null
@@ -1,4 +0,0 @@ -<?xml version="1.0" standalone="yes"?> - -<svg version="1.1" viewBox="0.0 0.0 960.0 720.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M267.88715 112.77165L267.88715 112.77165C267.88715 93.211205 283.74402 77.35433 303.30447 77.35433L303.30447 77.35433C312.69772 77.35433 321.70627 81.085785 328.3483 87.72782C334.99033 94.36986 338.72177 103.378395 338.72177 112.77165L338.72177 112.77165C338.72177 132.3321 322.8649 148.18898 303.30447 148.18898L303.30447 148.18898C283.74402 148.18898 267.88715 132.3321 267.88715 112.77165Z" fill-rule="nonzero" fill="#cfe2f3" stroke="#073763" stroke-width="2.0" stroke-linejoin="round" stroke-linecap="butt"></path><path d="M294.15125 114.47782L295.1825 114.61845Q295.01062 115.68095 294.3075 116.29032Q293.60437 116.8997 292.58875 116.8997Q291.3075 116.8997 290.53406 116.06376Q289.76062 115.22782 289.76062 113.66532Q289.76062 112.66532 290.09656 111.90751Q290.4325 111.1497 291.11218 110.7747Q291.79187 110.3997 292.60437 110.3997Q293.60437 110.3997 294.2528 110.90751Q294.90125 111.41532 295.08875 112.36845L294.0575 112.5247Q293.91687 111.8997 293.54187 111.579384Q293.16687 111.25907 292.63562 111.25907Q291.83875 111.25907 291.33875 111.829384Q290.83875 112.3997 290.83875 113.63407Q290.83875 114.8997 291.32312 115.4622Q291.8075 116.0247 292.57312 116.0247Q293.19812 116.0247 293.61218 115.6497Q294.02625 115.2747 294.15125 114.47782ZM296.08875 109.38407L296.08875 108.16532L297.15125 108.16532L297.15125 109.38407L296.08875 109.38407ZM296.08875 116.75907L296.08875 110.54032L297.15125 110.54032L297.15125 116.75907L296.08875 116.75907ZM298.745 116.75907L298.745 110.54032L299.69812 110.54032L299.69812 111.47782Q300.0575 110.82157 300.36218 110.610634Q300.66687 110.3997 301.04187 110.3997Q301.57312 110.3997 302.12 110.72782L301.76062 111.7122Q301.37 111.47782 300.995 111.47782Q300.63562 111.47782 300.36218 111.68876Q300.08875 111.8997 299.97937 112.2747Q299.79187 112.8372 299.79187 113.49345L299.79187 116.75907L298.745 116.75907ZM306.82312 114.47782L307.85437 114.61845Q307.6825 115.68095 306.97937 116.29032Q306.27625 116.8997 305.26062 116.8997Q303.97937 116.8997 303.20593 116.06376Q302.4325 115.22782 302.4325 113.66532Q302.4325 112.66532 302.76843 111.90751Q303.10437 111.1497 303.78406 110.7747Q304.46375 110.3997 305.27625 110.3997Q306.27625 110.3997 306.92468 110.90751Q307.57312 111.41532 307.76062 112.36845L306.72937 112.5247Q306.58875 111.8997 306.21375 111.579384Q305.83875 111.25907 305.3075 111.25907Q304.51062 111.25907 304.01062 111.829384Q303.51062 112.3997 303.51062 113.63407Q303.51062 114.8997 303.995 115.4622Q304.47937 116.0247 305.245 116.0247Q305.87 116.0247 306.28406 115.6497Q306.69812 115.2747 306.82312 114.47782ZM308.72937 116.75907L308.72937 108.16532L309.79187 108.16532L309.79187 116.75907L308.72937 116.75907ZM315.66687 114.75907L316.76062 114.88407Q316.51062 115.8372 315.8075 116.36845Q315.10437 116.8997 314.02625 116.8997Q312.66687 116.8997 311.86218 116.05595Q311.0575 115.2122 311.0575 113.69657Q311.0575 112.13407 311.87 111.266884Q312.6825 110.3997 313.96375 110.3997Q315.21375 110.3997 316.0028 111.24345Q316.79187 112.0872 316.79187 113.63407Q316.79187 113.72782 316.79187 113.91532L312.15125 113.91532Q312.21375 114.94657 312.72937 115.485634Q313.245 116.0247 314.02625 116.0247Q314.60437 116.0247 315.01843 115.72001Q315.4325 115.41532 315.66687 114.75907ZM312.21375 113.05595L315.6825 113.05595Q315.62 112.25907 315.29187 111.86845Q314.77625 111.25907 313.97937 111.25907Q313.245 111.25907 312.7528 111.74345Q312.26062 112.22782 312.21375 113.05595Z" fill-rule="nonzero" fill="#000000"></path></svg> -
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/parser-blocking-script.js b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/parser-blocking-script.js deleted file mode 100644 index c61efee..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/parser-blocking-script.js +++ /dev/null
@@ -1 +0,0 @@ -window.didExecuteExternalParsingBlockingScript = true;
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/sync-script-test.js b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/sync-script-test.js deleted file mode 100644 index 65c1b21..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/resources/sync-script-test.js +++ /dev/null
@@ -1,9 +0,0 @@ -var t = async_test('Test behavior of sync-script feature policy for different script types'); - -window.onload = t.step_func(function() { - assert_equals(undefined, window.didExecuteInlineParsingBlockingScript, 'inline parser blocking script should be blocked'); - assert_equals(undefined, window.didExecuteExternalParsingBlockingScript, 'external parser blocking script should be blocked'); - assert_true(window.didExecuteExternalAsyncScript, 'external async script should not be blocked'); - assert_true(window.didExecuteExternalDeferredScript, 'external defer script should not be blocked'); - t.done(); -});
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html deleted file mode 100644 index a199a4e..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<body> -<script defer src="/resources/testharness.js"></script> -<script defer src="/resources/testharnessreport.js"></script> -<script> -// The test harness scripts above are loaded as <script defer> because -// they would be blocked if loaded synchronously. -// Harness scripts should be evaluated before sync-script-test.js, so it -// is also loaded as <script defer> -// -// The other scripts (both inline and external) are testing whether those -// scripts are blocked or not. -// sync-script-test.js asserts the results of the other scripts in onload -// in order to guarantee that all scripts have either loaded or been blocked -// before verifying the behavior. -window.didExecuteInlineParsingBlockingScript = true; -</script> -<script src="/document-policy/experimental-features/resources/parser-blocking-script.js"></script> -<script async src="/document-policy/experimental-features/resources/async-script.js"></script> -<script defer src="/document-policy/experimental-features/resources/defer-script.js"></script> -<script defer src="/document-policy/experimental-features/resources/sync-script-test.js"></script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers deleted file mode 100644 index cfe200c..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: sync-script=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html deleted file mode 100644 index 4e5fbc65..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html +++ /dev/null
@@ -1,95 +0,0 @@ -<!DOCTYPE html> -<body> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<iframe></iframe> -<script> -'use strict'; -const default_width = 300; -const default_height = 150; -const srcs = [ - "/document-policy/experimental-features/resources/image.jpg", - "/document-policy/experimental-features/resources/image.png", - "/document-policy/experimental-features/resources/image.svg" -]; -const test_cases = [ -// Test when no size is specified, img/video is laid out by the default size. -{expected_width: default_width, expected_height: default_height}, -// Test when only one dimension is specified, img/video uses the default length for -// the other dimension. -{attribute: "width", value: 500, expected_width: 500, expected_height: 500 / 2}, -{attribute: "height", value: 800, expected_width: 800 * 2, expected_height: 800}, -// Test when only one dimension is specified by CSS style, img/video uses the -// default length for the other dimension. -{attribute: "style", value: "width:500px;", expected_width: 500, expected_height: 500 / 2}, -{attribute: "style", value: "height:800px;", expected_width: 800 * 2, expected_height: 800}, -// Test when the size of the image is specified, img/video is laid out by the -// specified size. -{attribute: "width", value: 500, attribute1: "height", value1: 800, expected_width: 500, expected_height:800}, -{attribute: "style", value: "width:500px;height:800px;", expected_width: 500, expected_height:800} -]; - -for (var test of test_cases) { - for (var src of srcs) { - async_test(t=> { - var img = document.createElement('IMG'); - var expected_width = test.expected_width; - var expected_height = test.expected_height; - img.setAttribute("src", src); - if (typeof test.attribute !== "undefined") { - img.setAttribute(test.attribute, test.value); - } - if (typeof test.attribute1 !== "undefined") { - img.setAttribute(test.attribute1, test.value1); - } - img.addEventListener('load', t.step_func(function() { - assert_equals(img.width, expected_width, 'width:'); - assert_equals(img.height, expected_height, 'height:'); - t.done(); - })); - document.body.appendChild(img); - }, 'Test image with attribute ' + test.attribute + '=' + test.value + - ' and attribute ' + test.attribute1 + '=' + test.value1 + ' on src ' + src); - } - async_test(t=> { - var video = document.createElement('video'); - video.addEventListener('canplaythrough', t.step_func(function() { - assert_equals(video.getBoundingClientRect().width, expected_width, 'width:'); - assert_equals(video.getBoundingClientRect().height, expected_height, 'height:'); - t.done(); - })); - var expected_width = test.expected_width; - var expected_height = test.expected_height; - video.setAttribute("src", "/document-policy/experimental-features/resources/video.webm"); - if (typeof test.attribute !== "undefined") { - video.setAttribute(test.attribute, test.value); - } - if (typeof test.attribute1 !== "undefined") { - video.setAttribute(test.attribute1, test.value1); - } - document.body.appendChild(video); - }, 'Test video with attribute ' + test.attribute + '=' + test.value + - ' and attribute ' + test.attribute1 + '=' + test.value1); -} - -// Subframes do not inherit document policy from parent frame. -// Unsized-Media should not work in subframes. -var iframe = document.querySelector('iframe'); -var iframe_srcs = [ - "/document-policy/experimental-features/resources/document-policy-image.html", - "https://{{domains[www]}}:{{ports[https][0]}}/document-policy/experimental-features/resources/document-policy-image.html"]; -for (var src of iframe_srcs) { - promise_test(function() { - iframe.src = src; - return new Promise(function(resolve, reject) { - window.addEventListener('message', function(e) { - resolve(e.data); - }); - }).then(function(data) { - assert_not_equals(data.width, default_width, 'width'); - assert_not_equals(data.height, default_height, 'height'); - }); - }, 'Test image size is correctly rendered in iframe of src ' + src); -} -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers deleted file mode 100644 index cf59933..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: unsized-media=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html deleted file mode 100644 index bf17807..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <script src='/resources/testharness.js'></script> - <script src='/resources/testharnessreport.js'></script> - </head> - <body> - <script> -var check_report_format = ([reports, observer]) => { - let report = reports[0]; - assert_equals(report.type, "document-policy-violation"); - assert_equals(report.body.featureId, "document-write"); - assert_equals(report.body.disposition, "report"); -}; - -promise_test(async t => { - const report = new Promise(resolve => { - new ReportingObserver((reports, observer) => resolve([reports, observer]), - {types: ['document-policy-violation']}).observe(); - }); - document.write("This should be written into the document"); - check_report_format(await report); -}, "Document-write report only mode"); - </script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html.headers deleted file mode 100644 index 924dac8..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-report-only-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy-Report-Only: document-write=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html deleted file mode 100644 index 65a584c..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <script src='/resources/testharness.js'></script> - <script src='/resources/testharnessreport.js'></script> - </head> - <body> - <script> -var t = async_test("Document-write Report Format"); - -var check_report_format = (reports, observer) => { - let report = reports[0]; - assert_equals(report.type, "document-policy-violation"); - assert_equals(report.url, document.location.href); - assert_equals(report.body.featureId, "document-write"); - assert_equals(report.body.sourceFile, document.location.href); - assert_equals(typeof report.body.lineNumber, "number"); - assert_equals(typeof report.body.columnNumber, "number"); - assert_equals(report.body.disposition, "enforce"); -}; - -new ReportingObserver(t.step_func_done(check_report_format), - {types: ['document-policy-violation']}).observe(); - -t.step_func(() => { - assert_throws_dom('NotAllowedError', - () => document.write("This should not succeed"), - "document.write should throw an exception when disabled"); -})(); - </script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html.headers deleted file mode 100644 index 6d05e96..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/document-write-reporting-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: document-write=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/image.jpg b/third_party/blink/web_tests/external/wpt/document-policy/reporting/image.jpg deleted file mode 100644 index c059b96..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/image.jpg +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/resources/sync-script.js b/third_party/blink/web_tests/external/wpt/document-policy/reporting/resources/sync-script.js deleted file mode 100644 index 10d582c..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/resources/sync-script.js +++ /dev/null
@@ -1,20 +0,0 @@ -// This is deliberately split from sync-script-reporting.html so that it will -// not be blocked by policy, and can actuall be executed. - -var t = async_test("Sync-script Report Format"); - -var check_report_format = (reports, observer) => { - let report = reports[0]; - assert_equals(report.type, "document-policy-violation"); - assert_equals(report.url, document.location.href); - assert_equals(report.body.featureId, "sync-script"); - assert_equals(report.body.sourceFile, null); - assert_equals(report.body.lineNumber, null); - assert_equals(report.body.columnNumber, null); - assert_equals(report.body.disposition, "enforce"); - check_report_json(report); -}; - -new ReportingObserver(t.step_func_done(check_report_format), - { types: ['document-policy-violation'], - buffered: true}).observe();
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html b/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html deleted file mode 100644 index 45e1b8f..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <script defer src='/resources/testharness.js'></script> - <script defer src='/resources/testharnessreport.js'></script> - <script defer src='../resources/document-policy-report-json.js'></script> - <script defer src="resources/sync-script.js"></script> - </head> - <body> - <!-- The presence of this script will violate the sync-script policy, - and will trigger a report. --> - <script>var newGlobal = true;</script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html.headers deleted file mode 100644 index cfe200c..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/sync-script-reporting.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: sync-script=?0
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html b/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html deleted file mode 100644 index 47a3643..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <script src='/resources/testharness.js'></script> - <script src='/resources/testharnessreport.js'></script> - </head> - <body> - <img src="image.jpg"> - <script> -var check_report_format = (reports, observer) => { - let report = reports[0]; - assert_equals(report.type, "document-policy-violation"); - assert_equals(report.url, document.location.href); - assert_equals(report.body.featureId, "unsized-media"); - assert_equals(report.body.disposition, "enforce"); -}; - -async_test(t => { - new ReportingObserver(t.step_func_done(check_report_format), - {types: ['document-policy-violation'], buffered: true}).observe(); -}, "Unsized-media Report Format"); - </script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html.headers b/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html.headers deleted file mode 100644 index cf59933..0000000 --- a/third_party/blink/web_tests/external/wpt/document-policy/reporting/unsized-media-reporting-tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Document-Policy: unsized-media=?0
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display-ref.html b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display-ref.html index f701810..ee965a1 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display-ref.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display-ref.html
@@ -8,7 +8,6 @@ <div class=ex id=ex3><div class=anchor></div><div class=popover></div></div> <div class=ex id=ex4><div class=anchor></div><div class=popover></div></div> <div class=ex id=ex5><div class=anchor></div><div class=popover></div></div> -<div class=ex id=ex6><div class=anchor></div><div class=popover></div></div> <style> .ex {
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display.tentative.html index 3dbd6c9a..21de8fd5 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display.tentative.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-anchor-display.tentative.html
@@ -33,16 +33,10 @@ <div id=popover4 popover=manual anchor=anchor4 defaultopen></div> </div> -<!-- Example using an implicit anchor which is not the default anchor --> -<div class=ex> - <div class=anchor id=anchor5></div> - <div id=popover5 popover=manual anchor=anchor5 defaultopen></div> -</div> - <!-- Example using a default anchor which is not the implicit anchor --> <div class=ex> - <div class=anchor id=anchor6></div> - <div id=popover6 popover=manual anchor=anchor1 defaultopen></div> + <div class=anchor id=anchor5></div> + <div id=popover5 popover=manual anchor=anchor1 defaultopen></div> </div> <script> @@ -94,16 +88,11 @@ left: anchor(right); top: anchor(top); } + #anchor5 { + anchor-name: --anchor5; + } #popover5 { - position-anchor: --anchor1; /* shouldn't be used */ - left: anchor(auto right); - top: anchor(auto top); - } - #anchor6 { - anchor-name: --anchor6; - } - #popover6 { - position-anchor: --anchor6; + position-anchor: --anchor5; left: anchor(right); /* shouldn't use the implicit anchor */ top: anchor(top); }
diff --git a/third_party/blink/web_tests/external/wpt/webnn/resources/utils_validation.js b/third_party/blink/web_tests/external/wpt/webnn/resources/utils_validation.js index 5c4eb08..35e6345 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/resources/utils_validation.js +++ b/third_party/blink/web_tests/external/wpt/webnn/resources/utils_validation.js
@@ -219,13 +219,15 @@ const unbroadcastableDimensionsArray = generateUnbroadcastableDimensionsArray(dimensions); for (let unbroadcastableDimensions of unbroadcastableDimensionsArray) { const inputB = builder.input(`inputB${++inputBIndex}`, {dataType, dimensions: unbroadcastableDimensions}); - assert_throws_dom('DataError', () => builder[operationName](inputA, inputB)); - assert_throws_dom('DataError', () => builder[operationName](inputB, inputA)); + assert_throws_js( + TypeError, () => builder[operationName](inputA, inputB)); + assert_throws_js( + TypeError, () => builder[operationName](inputB, inputA)); } } } } - }, `[${operationName}] DataError is expected if two inputs aren't broadcastable`); + }, `[${operationName}] TypeError is expected if two inputs aren't broadcastable`); } function validateTwoInputsOfSameDataType(operationName) { @@ -248,12 +250,13 @@ for (let dataTypeB of allWebNNOperandDataTypes) { if (dataType !== dataTypeB) { const inputB = builder.input(`inputB${++inputBIndex}`, {dataType: dataTypeB, dimensions}); - assert_throws_dom('DataError', () => builder[subOperationName](inputA, inputB)); + assert_throws_js( + TypeError, () => builder[subOperationName](inputA, inputB)); } } } } - }, `[${subOperationName}] DataError is expected if two inputs aren't of same data type`); + }, `[${subOperationName}] TypeError is expected if two inputs aren't of same data type`); } }
diff --git a/third_party/blink/web_tests/external/wpt/webnn/validation_tests/elementwise-binary.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/validation_tests/elementwise-binary.https.any.js index f54626b..7b3fec93 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/validation_tests/elementwise-binary.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/validation_tests/elementwise-binary.https.any.js
@@ -14,8 +14,64 @@ 'pow', ]; + +const tests = [ + { + name: '[binary] Test bidirectionally broadcastable dimensions.', + // Both inputs have axes of length one which are expanded + // during broadcasting. + a: {dataType: 'float32', dimensions: [8, 1, 6, 1]}, + b: {dataType: 'float32', dimensions: [7, 1, 5]}, + output: {dataType: 'float32', dimensions: [8, 7, 6, 5]} + }, + { + name: '[binary] Test unidirectionally broadcastable dimensions.', + // Input a has a single axis of length one which is + // expanded during broadcasting. + a: {dataType: 'float32', dimensions: [4, 2, 1]}, + b: {dataType: 'float32', dimensions: [4]}, + output: {dataType: 'float32', dimensions: [4, 2, 4]} + }, + { + name: '[binary] Test scalar broadcasting.', + a: {dataType: 'float32', dimensions: [4, 2, 4]}, + b: {dataType: 'float32', dimensions: []}, + output: {dataType: 'float32', dimensions: [4, 2, 4]} + }, + { + name: '[binary] Throw if the input shapes are not broadcastable.', + a: {dataType: 'float32', dimensions: [4, 2]}, + b: {dataType: 'float32', dimensions: [4]}, + }, + { + name: '[binary] Throw if the input types don\'t match.', + a: {dataType: 'float32', dimensions: [4, 2]}, + b: {dataType: 'int32', dimensions: [1]}, + }, +]; + +function runElementWiseBinaryTests(operatorName, tests) { + tests.forEach(test => { + promise_test(async t => { + const a = builder.input( + 'a', {dataType: test.a.dataType, dimensions: test.a.dimensions}); + const b = builder.input( + 'b', {dataType: test.b.dataType, dimensions: test.b.dimensions}); + + if (test.output) { + const output = builder[operatorName](a, b); + assert_equals(output.dataType(), test.output.dataType); + assert_array_equals(output.shape(), test.output.dimensions); + } else { + assert_throws_js(TypeError, () => builder[operatorName](a, b)); + } + }, test.name.replace('[binary]', `[${operatorName}]`)); + }); +} + kElementwiseBinaryOperators.forEach((operatorName) => { validateTwoInputsOfSameDataType(operatorName); validateTwoInputsBroadcastable(operatorName); validateTwoInputsFromMultipleBuilders(operatorName); + runElementWiseBinaryTests(operatorName, tests); });
diff --git a/third_party/blink/web_tests/http/tests/document-policy/composited-animations-allowed.php b/third_party/blink/web_tests/http/tests/document-policy/composited-animations-allowed.php deleted file mode 100644 index e327032..0000000 --- a/third_party/blink/web_tests/http/tests/document-policy/composited-animations-allowed.php +++ /dev/null
@@ -1,69 +0,0 @@ -<?php -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This test ensures that composited animations are still interpolated even when -// the 'layout-animations' feature is disabled. - -Header("Document-Policy: layout-animations=?0"); -?> -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -#box { - position: relative; - height: 100px; - width: 100px; - background-color: blue; -} - -@keyframes animation { - from { - transform: translateX(100px); - } - to { - transform: translateX(0); - } -} - -#box.target { - animation-duration: 1s; - animation-name: animation; - animation-timing-function: linear; -} -</style> -<div id="box"></div> -<script> -async_test(function(t) { - requestAnimationFrame(function () { validate(t) }); -}, "Check that allowed animated properties are interpolated even when others " + - "are disabled by policy"); - -function validate(t) { - var box = document.getElementById('box'); - - assert_equals(getComputedStyle(box).width, '100px', 'initial width'); - - // Start the animation. - box.className = 'target'; - getComputedStyle(box).width; // Force the animation. - - assert_equals(box.getAnimations().length, 1, 'animation started'); - var animation = box.getAnimations()[0]; - - animation.currentTime = 0; - assert_equals(getComputedStyle(box).transform, 'matrix(1, 0, 0, 1, 100, 0)', 'width at animation start'); - animation.currentTime = 490; - assert_equals(getComputedStyle(box).transform, 'matrix(1, 0, 0, 1, 51, 0)', 'width at animation start'); - animation.currentTime = 510; - assert_equals(getComputedStyle(box).transform, 'matrix(1, 0, 0, 1, 49, 0)', 'width at animation start'); - animation.currentTime = 999; - assert_equals(getComputedStyle(box).transform, 'matrix(1, 0, 0, 1, 0.1, 0)', 'width at animation start'); - animation.currentTime = 1000; - - assert_equals(box.getAnimations().length, 0, 'animation ended'); - t.done(); -} -</script>
diff --git a/third_party/blink/web_tests/http/tests/document-policy/layout-animations-disabled-by-policy.php b/third_party/blink/web_tests/http/tests/document-policy/layout-animations-disabled-by-policy.php deleted file mode 100644 index 4fd4ca93..0000000 --- a/third_party/blink/web_tests/http/tests/document-policy/layout-animations-disabled-by-policy.php +++ /dev/null
@@ -1,71 +0,0 @@ -<?php -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This test ensures that non-composited animations are not interpolated when -// the 'layout-animations' feature is disabled. - -Header("Document-Policy: layout-animations=?0"); -?> -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<style> -#box { - position: relative; - height: 100px; - width: 100px; - opacity: 0.8; - background-color: blue; -} - -@keyframes animation { - from { - width: 100px; - opacity: 0.8;; - } - to { - width: 200px; - opacity: 0.5; - } -} - -#box.target { - animation-duration: 1s; - animation-name: animation; - animation-timing-function: linear; -} -</style> -<div id="box"></div> -<script> -async_test(function(t) { - requestAnimationFrame(function () { validate(t) }); -}, "Check that animated properties disabled by policy are non-interpolated"); - -function validate(t) { - var box = document.getElementById('box'); - - assert_equals(getComputedStyle(box).width, '100px', 'initial width'); - - // Start the animation. - box.className = 'target'; - getComputedStyle(box).width; // Force the animation. - - assert_equals(box.getAnimations().length, 1, 'animation started'); - var animation = box.getAnimations()[0]; - - animation.currentTime = 0; - assert_equals(getComputedStyle(box).width, '100px', 'width at animation start'); - animation.currentTime = 490; - assert_equals(getComputedStyle(box).width, '100px', 'width just before midpoint'); - animation.currentTime = 510; - assert_equals(getComputedStyle(box).width, '200px', 'width just after midpoint'); - animation.currentTime = 999; - assert_equals(getComputedStyle(box).width, '200px', 'width at end'); - animation.currentTime = 1000; - - assert_equals(box.getAnimations().length, 0, 'animation ended'); - t.done(); -} -</script>
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-labelledby-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-labelledby-expected.txt index 75144db..c2193d88 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-labelledby-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-labelledby-expected.txt
@@ -552,34 +552,21 @@ [0] : { attribute : aria-labelledby attributeValue : { - relatedNodes : [ - [0] : { - idref : label6 - nodeResult : div#label6 - text : - } - ] - type : idrefList + type : string value : label6 } + invalid : true type : relatedElement - value : { - type : computedString - value : - } } [1] : { attribute : aria-label - superseded : true type : attribute } [2] : { nativeSource : label - superseded : true type : relatedElement } [3] : { - superseded : true type : contents value : { type : computedString @@ -593,7 +580,7 @@ } ] type : computedString - value : + value : Contents } nodeId : <string> parentId : <string> @@ -612,19 +599,6 @@ value : true } } - [2] : { - name : labelledby - value : { - relatedNodes : [ - [0] : { - idref : label6 - nodeResult : div#label6 - text : - } - ] - type : nodeList - } - } ] role : { type : role
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/target/auto-attach-auction-worklet-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/target/auto-attach-auction-worklet-expected.txt index bf32c94..9ea800f9 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/target/auto-attach-auction-worklet-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/target/auto-attach-auction-worklet-expected.txt
@@ -20,11 +20,15 @@ Attached to auction_worklet target: https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php (title: FLEDGE seller worklet for https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php) (waiting: false) +Attached to auction_worklet target: https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php + (title: FLEDGE seller worklet for https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php) + (waiting: false) Attached to auction_worklet target: https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php (title: FLEDGE bidder worklet for https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php) (waiting: false) Detached: https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php Detached: https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php +Detached: https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php Attached to auction_worklet target: https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php (title: FLEDGE bidder worklet for https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php) (waiting: false)
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet-expected.txt index d0b9db9..0ea5ebca 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet-expected.txt
@@ -2,6 +2,8 @@ Attached to target https://a.test:8443/inspector-protocol/resources/fledge_join.html Attached to target https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php Bidder instrumentation breakpoint set attempted +Attached to target https://a.test:8443/inspector-protocol/resources/fledge_decision_logic.js.php + Bidder instrumentation breakpoint set attempted Attached to target https://a.test:8443/inspector-protocol/resources/fledge_bidding_logic.js.php Bidder instrumentation breakpoint set attempted Paused at with reason "EventListener".
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet.js b/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet.js index 6ffa3ca..05ff1310 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet.js +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/target/target-auction-worklet.js
@@ -25,7 +25,7 @@ new TestRunner.Session(testRunner, event.params.sessionId); if (params.targetInfo.type === 'auction_worklet') { ++attachedWorklets; - if (attachedWorklets == 3) + if (attachedWorklets == 4) resolveWaitForThirdWorkletPromise(); testRunner.log(' Bidder instrumentation breakpoint set attempted'); targetSession.protocol.Debugger.enable();
diff --git a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt new file mode 100644 index 0000000..d2490db --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt
@@ -0,0 +1,3 @@ +This is a testharness.js-based test. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt new file mode 100644 index 0000000..d2490db --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt
@@ -0,0 +1,3 @@ +This is a testharness.js-based test. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt index 83dbbd1..6e05b43 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any.worker_gpu-expected.txt
@@ -1,9 +1,5 @@ This is a testharness.js-based test. [FAIL] softmax float32 2D constant tensor all positive - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." -[FAIL] softmax float32 2D tensor all positive - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." -[FAIL] softmax float32 2D tensor all negative - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." + assert_true: assert_array_approx_equals_ulp: test softmax float32 actual 0.15064983069896698 should be close enough to expected 0.15068615972995758 by the acceptable 21 ULP distance, but they have 2438 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt index 83dbbd1..6e05b43 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/softmax.https.any_gpu-expected.txt
@@ -1,9 +1,5 @@ This is a testharness.js-based test. [FAIL] softmax float32 2D constant tensor all positive - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." -[FAIL] softmax float32 2D tensor all positive - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." -[FAIL] softmax float32 2D tensor all negative - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator softmax." + assert_true: assert_array_approx_equals_ulp: test softmax float32 actual 0.15064983069896698 should be close enough to expected 0.15068615972995758 by the acceptable 21 ULP distance, but they have 2438 ULP distance expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/fledge-two-seller-worklet-threads/README.md b/third_party/blink/web_tests/virtual/fledge-two-seller-worklet-threads/README.md new file mode 100644 index 0000000..c339a00 --- /dev/null +++ b/third_party/blink/web_tests/virtual/fledge-two-seller-worklet-threads/README.md
@@ -0,0 +1 @@ +This directory is to test Protected Audience functions with two seller worklet threads.
diff --git a/third_party/blink/web_tests/virtual/isolated-context/README.md b/third_party/blink/web_tests/virtual/isolated-context/README.md new file mode 100644 index 0000000..5d56daf --- /dev/null +++ b/third_party/blink/web_tests/virtual/isolated-context/README.md
@@ -0,0 +1,11 @@ +# isolated-context + +This suite runs tests with +`--isolated-context-origins=https://web-platform.test`. + +As of 2024-05-04, there's one test in this suite: + - `wpt_internal/permissions-policy/`: Verify that the IWA-specific + APIs are included in the permissions policy results. These APIs + should only be available in an isolated context which this test + runs under. See `//third_party/blink/web_tests/VirtualTestSuites` + for where that's configured.
diff --git a/third_party/blink/web_tests/virtual/isolated-context/wpt_internal/permissions-policy/permissions-policy-expected.txt b/third_party/blink/web_tests/virtual/isolated-context/wpt_internal/permissions-policy/permissions-policy-expected.txt new file mode 100644 index 0000000..052de296 --- /dev/null +++ b/third_party/blink/web_tests/virtual/isolated-context/wpt_internal/permissions-policy/permissions-policy-expected.txt
@@ -0,0 +1,84 @@ +This test documents Blink's web-exposed policy-controlled features. +All changes to this list should go through Blink's feature review process: http://www.chromium.org/blink#new-features + +accelerometer +ambient-light-sensor +attribution-reporting +autoplay +browsing-topics +camera +captured-surface-control +ch-device-memory +ch-downlink +ch-dpr +ch-ect +ch-prefers-color-scheme +ch-prefers-reduced-motion +ch-prefers-reduced-transparency +ch-rtt +ch-save-data +ch-ua +ch-ua-arch +ch-ua-bitness +ch-ua-form-factors +ch-ua-full-version +ch-ua-full-version-list +ch-ua-mobile +ch-ua-model +ch-ua-platform +ch-ua-platform-version +ch-ua-wow64 +ch-viewport-height +ch-viewport-width +ch-width +clipboard-read +clipboard-write +compute-pressure +cross-origin-isolated +direct-sockets +display-capture +encrypted-media +execution-while-not-rendered +execution-while-out-of-viewport +focus-without-user-activation +fullscreen +gamepad +geolocation +gyroscope +hid +identity-credentials-get +idle-detection +interest-cohort +join-ad-interest-group +keyboard-map +local-fonts +magnetometer +microphone +midi +otp-credentials +payment +picture-in-picture +private-aggregation +private-state-token-issuance +private-state-token-redemption +publickey-credentials-create +publickey-credentials-get +run-ad-auction +screen-wake-lock +serial +shared-autofill +shared-storage +shared-storage-select-url +smart-card +speaker-selection +storage-access +sub-apps +sync-xhr +unload +usb +usb-unrestricted +vertical-scroll +web-printing +window-management +xr-spatial-tracking +
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 2229699..3777ad51 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
@@ -6770,6 +6770,10 @@ getter promise getter reason method constructor +interface ProtectedAudience + attribute @@toStringTag + method constructor + method queryFeatureSupport interface PublicKeyCredential : Credential static method isConditionalMediationAvailable static method isUserVerifyingPlatformAuthenticatorAvailable
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any.worker_cpu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any.worker_cpu-expected.txt index ced90605..0c9c0cc0 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any.worker_cpu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any.worker_cpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 14 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 7 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] erf float32 0D scalar promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." [FAIL] erf float32 1D constant tensor @@ -14,19 +14,5 @@ promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." [FAIL] erf float32 5D tensor promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." -[FAIL] reciprocal float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any_cpu-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any_cpu-expected.txt index ced90605..0c9c0cc0 100644 --- a/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any_cpu-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/elementwise_unary.https.any_cpu-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 14 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 7 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] erf float32 0D scalar promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." [FAIL] erf float32 1D constant tensor @@ -14,19 +14,5 @@ promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." [FAIL] erf float32 5D tensor promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kErf is not implemented." -[FAIL] reciprocal float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." -[FAIL] reciprocal float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': kReciprocal is not implemented." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt b/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt index 052de296..232d1f2 100644 --- a/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt +++ b/third_party/blink/web_tests/webexposed/feature-policy-features-expected.txt
@@ -35,7 +35,6 @@ clipboard-write compute-pressure cross-origin-isolated -direct-sockets display-capture encrypted-media execution-while-not-rendered @@ -69,16 +68,13 @@ shared-autofill shared-storage shared-storage-select-url -smart-card speaker-selection storage-access -sub-apps sync-xhr unload usb usb-unrestricted vertical-scroll -web-printing window-management xr-spatial-tracking
diff --git a/third_party/blink/web_tests/wpt_internal/permissions-policy/README.md b/third_party/blink/web_tests/wpt_internal/permissions-policy/README.md new file mode 100644 index 0000000..9c602d9 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/permissions-policy/README.md
@@ -0,0 +1,5 @@ +This suite is a version of `webexposed/feature-policy-features.html` that +is meant to run under `wptserve`. By running under `wptserve`, a virtual +suite version of this test is also added and that suite runs with a flag +that ensures the `wptserve` origin is isolated, using +`--isolated-context-origins`.
diff --git a/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy-expected.txt b/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy-expected.txt new file mode 100644 index 0000000..232d1f2 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy-expected.txt
@@ -0,0 +1,80 @@ +This test documents Blink's web-exposed policy-controlled features. +All changes to this list should go through Blink's feature review process: http://www.chromium.org/blink#new-features + +accelerometer +ambient-light-sensor +attribution-reporting +autoplay +browsing-topics +camera +captured-surface-control +ch-device-memory +ch-downlink +ch-dpr +ch-ect +ch-prefers-color-scheme +ch-prefers-reduced-motion +ch-prefers-reduced-transparency +ch-rtt +ch-save-data +ch-ua +ch-ua-arch +ch-ua-bitness +ch-ua-form-factors +ch-ua-full-version +ch-ua-full-version-list +ch-ua-mobile +ch-ua-model +ch-ua-platform +ch-ua-platform-version +ch-ua-wow64 +ch-viewport-height +ch-viewport-width +ch-width +clipboard-read +clipboard-write +compute-pressure +cross-origin-isolated +display-capture +encrypted-media +execution-while-not-rendered +execution-while-out-of-viewport +focus-without-user-activation +fullscreen +gamepad +geolocation +gyroscope +hid +identity-credentials-get +idle-detection +interest-cohort +join-ad-interest-group +keyboard-map +local-fonts +magnetometer +microphone +midi +otp-credentials +payment +picture-in-picture +private-aggregation +private-state-token-issuance +private-state-token-redemption +publickey-credentials-create +publickey-credentials-get +run-ad-auction +screen-wake-lock +serial +shared-autofill +shared-storage +shared-storage-select-url +speaker-selection +storage-access +sync-xhr +unload +usb +usb-unrestricted +vertical-scroll +window-management +xr-spatial-tracking +
diff --git a/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy.html b/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy.html new file mode 100644 index 0000000..df947ca8 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/permissions-policy/permissions-policy.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<pre id="output"></pre> +<script src="/resources/feature-policy-features-listing.js"></script> +<script> +if (window.testRunner) { + testRunner.dumpAsText(); +} + +function print(text) { + output.textContent += text + '\n'; +} + +print('This test documents Blink\'s web-exposed policy-controlled features.'); +print('All changes to this list should go through Blink\'s feature review process: http://www.chromium.org/blink#new-features'); +print(''); +featurePolicyFeaturesListing(false /* platformSpecific */, print); +</script>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/canvas-works-after-cpu-downgrade.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/canvas-works-after-cpu-downgrade.https.html new file mode 100644 index 0000000..7da87ee9 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/canvas-works-after-cpu-downgrade.https.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<head> +<title>Canvas WebGPU Access: canvas-works-after-cpu-downgrade</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="./webgpu-helpers.js"></script> +</head> + +<h1>Canvas WebGPU Access: canvas-works-after-cpu-downgrade</h1> + +<p>WebGPU access should work normally on a canvas which has been downgraded to +CPU, transparently bringing it back to the GPU.</p> + +<canvas id="c" width="50" height="50"></canvas> + +<script> + +// Note that only HTMLCanvasElement-based canvases are automatically downgraded +// to CPU rendering, so we don't have a matching OffscreenCanvas test here. +promise_test(() => { + return with_webgpu((adapter, adapterInfo, device) => { + test_canvas_works_after_cpu_downgrade(adapterInfo, + device, + document.getElementById('c')); + }); + }, 'WebGPU access should work on a canvas downgraded to CPU.' +); + +</script>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.html new file mode 100644 index 0000000..51fa104 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.html
@@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> +<head> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="./webgpu-helpers.js"></script> +</head> + +<h1>Canvas WebGPU Access: endWebGPUAccess-exchanges-texture</h1> + +<p>endWebGPUAccess() should allow two canvases to exchange their textures.</p> + +<!-- Each canvas has a different size. --> +<canvas id="c1" width="50" height="50"></canvas> +<canvas id="c2" width="60" height="60"></canvas> +<canvas id="c3" width="40" height="80"></canvas> + +<script> + +promise_test(() => { + return with_webgpu((adapter, adapterInfo, device) => { + return test_endWebGPUAccess_exchanges_texture( + device, + document.getElementById('c1'), + document.getElementById('c2')); + }); + }, + 'endWebGPUAccess() should allow canvases to exchange textures.' +); + +promise_test(() => { + return with_webgpu((adapter, adapterInfo, device) => { + return test_endWebGPUAccess_exchanges_texture( + device, + new OffscreenCanvas(50, 50), + new OffscreenCanvas(60, 60)); + }); + }, + 'endWebGPUAccess() should allow offscreen canvases to exchange textures.' +); + +promise_test(() => { + return with_webgpu((adapter, adapterInfo, device) => { + return test_endWebGPUAccess_exchanges_texture( + device, + document.getElementById('c3'), + new OffscreenCanvas(50, 50)); + }); + }, + 'endWebGPUAccess() with a mix of canvas types should allow the exchange of ' + + 'textures.' +); + +</script>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.worker.js b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.worker.js new file mode 100644 index 0000000..348cd52 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/endWebGPUAccess-exchanges-texture.https.worker.js
@@ -0,0 +1,20 @@ +// META: global=worker + +// ============================================================================ + +importScripts("/resources/testharness.js"); +importScripts("./webgpu-helpers.js"); + +// This test parallels endWebGPUAccess-exchanges-texture.https.html. +promise_test(() => { + return with_webgpu((adapter, adapterInfo, device) => { + return test_endWebGPUAccess_exchanges_texture( + device, + new OffscreenCanvas(50, 50), + new OffscreenCanvas(50, 50)); + }); + }, + 'endWebGPUAccess() on a worker should allow canvases to exchange textures.' +); + +done();
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/webgpu-helpers.js b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/webgpu-helpers.js index fd95b61..ecd3b06d 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/webgpu-helpers.js +++ b/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_access/webgpu-helpers.js
@@ -31,6 +31,11 @@ navigator.platform.startsWith('Mac'); } +/** Returns true if we are running on Linux. */ +function isLinux() { + return navigator.platform.startsWith('Linux'); +} + /** Returns the upper-left hand pixel from the texture in a buffer. */ function copyOnePixelFromTextureAndSubmit(device, tex) { // Make a buffer which will allow us to copy one pixel from the texture, and @@ -75,6 +80,22 @@ device.queue.submit([encoder.finish()]); } +/** Verifies that every pixel on a Canvas2D contains a particular RGBA color. */ +function checkCanvasColor(ctx, expectedRGBA) { + // The ImageData `data` array holds RGBA elements in uint8 format. + const w = ctx.canvas.width; + const h = ctx.canvas.height; + const imageData = ctx.getImageData(0, 0, w, h); + for (let idx = 0; idx < w * h * 4; idx += 4) { + assert_array_equals([imageData.data[idx + 0], + imageData.data[idx + 1], + imageData.data[idx + 2], + imageData.data[idx + 3]], + expectedRGBA, + 'RGBA @ ' + idx); + } +} + /** * Creates a bind group which uses the passed-in texture as a resource. * This will cause a GPUValidationError if TEXTURE_BINDING usage isn't set. @@ -206,7 +227,7 @@ // Begin and end a WebGPU access session several times. for (let count = 0; count < 10; ++count) { const tex = ctx.beginWebGPUAccess({device: device}); - ctx.endWebGPUAccess(); + ctx.endWebGPUAccess(tex); } } @@ -227,19 +248,10 @@ { r: 64 / 255, g: 128 / 255, b: 192 / 255, a: 1.0 }); // Finish our WebGPU pass and restore the canvas. - ctx.endWebGPUAccess(); + ctx.endWebGPUAccess(tex); // Verify that the canvas contains our chosen color across every pixel. - // The ImageData `data` array holds RGBA elements in uint8 format. - const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); - for (let idx = 0; idx < canvas.width * canvas.height * 4; idx += 4) { - assert_array_equals([imageData.data[idx + 0], - imageData.data[idx + 1], - imageData.data[idx + 2], - imageData.data[idx + 3]], - [0x40, 0x80, 0xC0, 0xFF], - 'RGBA @ ' + idx); - } + checkCanvasColor(ctx, [0x40, 0x80, 0xC0, 0xFF]); } /** endWebGPUAccess() should be a no-op if the canvas context is lost. */ @@ -254,7 +266,7 @@ // End the WebGPU access session. Nothing should be thrown. try { - ctx.endWebGPUAccess(); + ctx.endWebGPUAccess(tex); } catch { assert_unreached('endWebGPUAccess should be safe when context is lost.'); } @@ -268,7 +280,7 @@ // Briefly begin a WebGPU access session. const ctx = canvas.getContext('2d'); const tex = ctx.beginWebGPUAccess({device: device}); - ctx.endWebGPUAccess(); + ctx.endWebGPUAccess(tex); // `tex` should be in a destroyed state. Unfortunately, there isn't a // foolproof way to test for this state in WebGPU. The best we can do is try @@ -313,8 +325,8 @@ // Verify that the WebGPU access was terminated by starting a new WebGPU // access session. This would throw if the initial beginWebGPUAccess session // were still active. - ctx.beginWebGPUAccess({device: device}); - ctx.endWebGPUAccess(); + const anotherTex = ctx.beginWebGPUAccess({device: device}); + ctx.endWebGPUAccess(anotherTex); // Verify that the texture from the initial WebGPU access session is still // usable by accessing its contents. This would cause a GPUValidationError if @@ -375,7 +387,7 @@ assert_not_equals(errors, null, 'enabled ' + usageToEnable + ', tested ' + usageToTest); } - ctx.endWebGPUAccess(); + ctx.endWebGPUAccess(tex); }); }; @@ -397,3 +409,75 @@ return promise; } + +/** + * endWebGPUAccess() should allow two canvases to exchange their textures. + */ +function test_endWebGPUAccess_exchanges_texture(device, canvasA, canvasB) { + const ctxA = canvasA.getContext('2d'); + const ctxB = canvasB.getContext('2d'); + + // Fill each canvas with a unique color. + ctxA.fillStyle = "#FF0000"; + ctxA.fillRect(0, 0, canvasA.width, canvasA.height); + ctxB.fillStyle = "#0000FF"; + ctxB.fillRect(0, 0, canvasB.width, canvasB.height); + + // First, we start a WebGPU access session on both contexts at once. + const texA = ctxA.beginWebGPUAccess({device: device}); + const texB = ctxB.beginWebGPUAccess({device: device}); + + // We should be able to return context A's texture to context B. + // TODO(crbug.com/339846593): we do not yet honor the passed-in GPUTexture, so + // we can only return a texture to its own context for now. + ctxB.endWebGPUAccess(texB); + + // Likewise for the opposite pairing. + // TODO(crbug.com/339846593): we do not yet honor the passed-in GPUTexture, so + // we can only return a texture to its own context for now. + ctxA.endWebGPUAccess(texA); + + // Confirm that the canvases' colors reflect the texture transfers. + checkCanvasColor(ctxA, [0xFF, 0x00, 0x00, 0xFF]); + checkCanvasColor(ctxB, [0x00, 0x00, 0xFF, 0xFF]); + + // Passing a texture that has already been transferred to a canvas should not + // be allowed; that GPUTexture is in a destroyed state already. + try { + ctxA.endWebGPUAccess(texA); + assert_unreached('InvalidStateError should have been thrown.'); + } catch (ex) { + assert_true(ex instanceof DOMException); + assert_equals(ex.name, 'InvalidStateError'); + } + + try { + ctxB.endWebGPUAccess(texB); + assert_unreached('InvalidStateError should have been thrown.'); + } catch (ex) { + assert_true(ex instanceof DOMException); + assert_equals(ex.name, 'InvalidStateError'); + } +} + +/** + * WebGPU access should work normally on a canvas which has been downgraded to + * CPU, transparently bringing it back to the GPU. + */ +function test_canvas_works_after_cpu_downgrade(adapterInfo, device, canvas) { + const ctx = canvas.getContext('2d'); + + // Force the canvas into software. + internals.disableCanvasAcceleration(canvas); + + // Perform a GPU clear to demonstrate that the canvas still works in WebGPU. + const tex = ctx.beginWebGPUAccess({device: device}); + clearTextureToColor(device, tex, { r: 0.0, g: 1.0, b: 0.0, a: 1.0 }); + ctx.endWebGPUAccess(tex); + + // Verify that WebGPU did its job; every pixel on the canvas should be green. + // TODO(crbug.com/40218893): Linux with an Intel GPU returns the wrong color. + if (!isLinux()) { + checkCanvasColor(ctx, [0x00, 0xFF, 0x00, 0xFF]); + } +}
diff --git a/third_party/boringssl/BUILD.generated.gni b/third_party/boringssl/BUILD.generated.gni index 599b590..7135993 100644 --- a/third_party/boringssl/BUILD.generated.gni +++ b/third_party/boringssl/BUILD.generated.gni
@@ -81,7 +81,6 @@ "src/crypto/cipher_extra/internal.h", "src/crypto/cipher_extra/tls_cbc.c", "src/crypto/conf/conf.c", - "src/crypto/conf/conf_def.h", "src/crypto/conf/internal.h", "src/crypto/cpu_aarch64_apple.c", "src/crypto/cpu_aarch64_fuchsia.c", @@ -104,6 +103,8 @@ "src/crypto/dh_extra/dh_asn1.c", "src/crypto/dh_extra/params.c", "src/crypto/digest_extra/digest_extra.c", + "src/crypto/dilithium/dilithium.c", + "src/crypto/dilithium/internal.h", "src/crypto/dsa/dsa.c", "src/crypto/dsa/dsa_asn1.c", "src/crypto/dsa/internal.h", @@ -522,6 +523,7 @@ "src/include/openssl/evp.h", "src/include/openssl/evp_errors.h", "src/include/openssl/ex_data.h", + "src/include/openssl/experimental/dilithium.h", "src/include/openssl/experimental/kyber.h", "src/include/openssl/experimental/spx.h", "src/include/openssl/hkdf.h", @@ -676,6 +678,7 @@ "src/pki/trust_store.cc", "src/pki/trust_store_collection.cc", "src/pki/trust_store_in_memory.cc", + "src/pki/verify.cc", "src/pki/verify_certificate_chain.cc", "src/pki/verify_error.cc", "src/pki/verify_name_match.cc", @@ -728,6 +731,7 @@ pki_headers = [ "src/include/openssl/pki/certificate.h", "src/include/openssl/pki/signature_verify_cache.h", + "src/include/openssl/pki/verify.h", "src/include/openssl/pki/verify_error.h", ]
diff --git a/third_party/boringssl/BUILD.generated_tests.gni b/third_party/boringssl/BUILD.generated_tests.gni index a306858..221b1b8 100644 --- a/third_party/boringssl/BUILD.generated_tests.gni +++ b/third_party/boringssl/BUILD.generated_tests.gni
@@ -61,6 +61,7 @@ "src/crypto/curve25519/x25519_test.cc", "src/crypto/dh_extra/dh_test.cc", "src/crypto/digest_extra/digest_test.cc", + "src/crypto/dilithium/dilithium_test.cc", "src/crypto/dsa/dsa_test.cc", "src/crypto/ecdh_extra/ecdh_test.cc", "src/crypto/err/err_test.cc", @@ -146,6 +147,7 @@ "src/crypto/cipher_extra/test/nist_cavp/tdes_ecb.txt", "src/crypto/cipher_extra/test/xchacha20_poly1305_tests.txt", "src/crypto/curve25519/ed25519_tests.txt", + "src/crypto/dilithium/dilithium_tests.txt", "src/crypto/ecdh_extra/ecdh_tests.txt", "src/crypto/evp/evp_tests.txt", "src/crypto/evp/scrypt_tests.txt", @@ -1761,7 +1763,15 @@ "src/pki/testdata/verify_signed_data_unittest/rsa-pss-sha256.pem", "src/pki/testdata/verify_signed_data_unittest/rsa-using-ec-key.pem", "src/pki/testdata/verify_signed_data_unittest/rsa2048-pkcs1-sha512.pem", + "src/pki/testdata/verify_unittest/google-intermediate1.der", + "src/pki/testdata/verify_unittest/google-intermediate2.der", "src/pki/testdata/verify_unittest/google-leaf.der", + "src/pki/testdata/verify_unittest/lencr-intermediate-r3.der", + "src/pki/testdata/verify_unittest/lencr-leaf.der", + "src/pki/testdata/verify_unittest/lencr-root-dst-x3.der", + "src/pki/testdata/verify_unittest/lencr-root-x1-cross-signed.der", + "src/pki/testdata/verify_unittest/lencr-root-x1.der", + "src/pki/testdata/verify_unittest/mozilla_roots.der", "src/pki/testdata/verify_unittest/self-issued.pem", ] @@ -1806,4 +1816,5 @@ "src/pki/verify_certificate_chain_unittest.cc", "src/pki/verify_name_match_unittest.cc", "src/pki/verify_signed_data_unittest.cc", + "src/pki/verify_unittest.cc", ]
diff --git a/third_party/boringssl/src b/third_party/boringssl/src index 2db0eb3..2fb5f9c 160000 --- a/third_party/boringssl/src +++ b/third_party/boringssl/src
@@ -1 +1 @@ -Subproject commit 2db0eb3f96a5756298dcd7f9319e56a98585bd10 +Subproject commit 2fb5f9cb8feec2234952f6999af941ac48555710
diff --git a/third_party/chromium-variations b/third_party/chromium-variations index c8c20e4..e2f29f6 160000 --- a/third_party/chromium-variations +++ b/third_party/chromium-variations
@@ -1 +1 @@ -Subproject commit c8c20e469d74f2293dd00320ae59437b281ce2ad +Subproject commit e2f29f64474ebe519844379b4746e98d6ce254e4
diff --git a/third_party/crashpad/README.chromium b/third_party/crashpad/README.chromium index 4ab12ce..91720ba 100644 --- a/third_party/crashpad/README.chromium +++ b/third_party/crashpad/README.chromium
@@ -2,7 +2,7 @@ Short Name: crashpad URL: https://crashpad.chromium.org/ Version: N/A -Revision: aef83033716bf46eae7bb371d38faf4482acdd05 +Revision: 6af42bc0b22b732fdcebe9f706204e5fb229b209 License: Apache 2.0 License File: crashpad/LICENSE Security Critical: yes
diff --git a/third_party/crashpad/crashpad/DEPS b/third_party/crashpad/crashpad/DEPS index b98b99c7a..fa7eede 100644 --- a/third_party/crashpad/crashpad/DEPS +++ b/third_party/crashpad/crashpad/DEPS
@@ -47,7 +47,7 @@ '9719c1e1e676814c456b55f5f070eabad6709d31', 'crashpad/third_party/mini_chromium/mini_chromium': Var('chromium_git') + '/chromium/mini_chromium@' + - 'a6607b1fd76b740f31c2249fef2c0bec27ffbe52', + '5856e1ea610f6d1b47ee2e9c905498a05a1634e8', 'crashpad/third_party/libfuzzer/src': Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' + 'fda403cf93ecb8792cb1d061564d89a6553ca020',
diff --git a/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc b/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc index 5d49200..ae76a7e4 100644 --- a/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc +++ b/third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc
@@ -765,7 +765,7 @@ __builtin_trap(); - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } StartHandlerForClientTest test_state_;
diff --git a/third_party/crashpad/crashpad/client/prune_crash_reports.cc b/third_party/crashpad/crashpad/client/prune_crash_reports.cc index 077694f..59b9646 100644 --- a/third_party/crashpad/crashpad/client/prune_crash_reports.cc +++ b/third_party/crashpad/crashpad/client/prune_crash_reports.cc
@@ -131,7 +131,7 @@ case OR: return lhs_->ShouldPruneReport(report) || rhs_->ShouldPruneReport(report); default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; } }
diff --git a/third_party/crashpad/crashpad/client/settings.cc b/third_party/crashpad/crashpad/client/settings.cc index 5e4119e..420fbfc 100644 --- a/third_party/crashpad/crashpad/client/settings.cc +++ b/third_party/crashpad/crashpad/client/settings.cc
@@ -292,7 +292,7 @@ return OpenFileForReadAndWrite( file_path, options.mode, options.permissions); } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return kInvalidFileHandle; }
diff --git a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc index 5bd2889..c224871 100644 --- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
@@ -236,7 +236,7 @@ return; case CrashReportDatabase::kCannotRequestUpload: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return; }
diff --git a/third_party/crashpad/crashpad/handler/win/hanging_program.cc b/third_party/crashpad/crashpad/handler/win/hanging_program.cc index 72f903f..00eaf17 100644 --- a/third_party/crashpad/crashpad/handler/win/hanging_program.cc +++ b/third_party/crashpad/crashpad/handler/win/hanging_program.cc
@@ -40,13 +40,13 @@ Sleep(INFINITE); - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; } DWORD WINAPI Thread2(LPVOID dummy) { Sleep(INFINITE); - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; } @@ -65,7 +65,7 @@ if (!FreeLibrary(dll)) PLOG(FATAL) << "FreeLibrary"; - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; }
diff --git a/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc b/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc index 9eebe81..8eaae831 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
@@ -56,7 +56,7 @@ if (std::is_same<T, RVA64>()) { return "RVA64"; } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return ""; } };
diff --git a/third_party/crashpad/crashpad/minidump/minidump_string_writer_test.cc b/third_party/crashpad/crashpad/minidump/minidump_string_writer_test.cc index 1487b13..573eac6 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_string_writer_test.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_string_writer_test.cc
@@ -42,7 +42,7 @@ if (std::is_same<T, RVA64>()) { return "RVA64"; } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return ""; } };
diff --git a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc index e2ab775..9fe3ac0e 100644 --- a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc +++ b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc
@@ -136,7 +136,7 @@ cpu_architecture = kMinidumpCPUArchitectureRISCV64Breakpad; break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); cpu_architecture = kMinidumpCPUArchitectureUnknown; break; } @@ -185,7 +185,7 @@ operating_system = kMinidumpOSIOS; break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); operating_system = kMinidumpOSUnknown; break; }
diff --git a/third_party/crashpad/crashpad/snapshot/cpu_context.cc b/third_party/crashpad/crashpad/snapshot/cpu_context.cc index 492a0f7..71bf4ac 100644 --- a/third_party/crashpad/crashpad/snapshot/cpu_context.cc +++ b/third_party/crashpad/crashpad/snapshot/cpu_context.cc
@@ -174,7 +174,7 @@ case kCPUArchitectureRISCV64: return riscv64->pc; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return ~0ull; } } @@ -192,7 +192,7 @@ case kCPUArchitectureRISCV64: return riscv64->regs[1]; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return ~0ull; } } @@ -202,12 +202,12 @@ case kCPUArchitectureX86: case kCPUArchitectureARM: case kCPUArchitectureARM64: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; case kCPUArchitectureX86_64: return x86_64->xstate.cet_u.ssp; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return ~0ull; } } @@ -221,7 +221,7 @@ case kCPUArchitectureX86_64: return x86_64->xstate.cet_u.cetmsr != 0; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; } } @@ -238,7 +238,7 @@ case kCPUArchitectureMIPSEL: return false; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; } }
diff --git a/third_party/crashpad/crashpad/snapshot/fuchsia/process_snapshot_fuchsia.cc b/third_party/crashpad/crashpad/snapshot/fuchsia/process_snapshot_fuchsia.cc index f1a7e7b..1f51a4c 100644 --- a/third_party/crashpad/crashpad/snapshot/fuchsia/process_snapshot_fuchsia.cc +++ b/third_party/crashpad/crashpad/snapshot/fuchsia/process_snapshot_fuchsia.cc
@@ -114,7 +114,8 @@ crashpad::ProcessID ProcessSnapshotFuchsia::ParentProcessID() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196 + // TODO(scottmg): https://crashpad.chromium.org/bug/196 + NOTREACHED_IN_MIGRATION(); return 0; }
diff --git a/third_party/crashpad/crashpad/snapshot/fuchsia/system_snapshot_fuchsia.cc b/third_party/crashpad/crashpad/snapshot/fuchsia/system_snapshot_fuchsia.cc index a9b0eed..a764e855 100644 --- a/third_party/crashpad/crashpad/snapshot/fuchsia/system_snapshot_fuchsia.cc +++ b/third_party/crashpad/crashpad/snapshot/fuchsia/system_snapshot_fuchsia.cc
@@ -108,7 +108,7 @@ #if defined(ARCH_CPU_X86_64) return cpuid_.Signature(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -118,7 +118,7 @@ #if defined(ARCH_CPU_X86_64) return cpuid_.Features(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -128,7 +128,7 @@ #if defined(ARCH_CPU_X86_64) return cpuid_.ExtendedFeatures(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -137,7 +137,7 @@ #if defined(ARCH_CPU_X86_64) return cpuid_.Leaf7Features(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -147,7 +147,7 @@ #if defined(ARCH_CPU_X86_64) return cpuid_.SupportsDAZ(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; #endif }
diff --git a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc index 181b5a2..6caf3d8 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
@@ -52,6 +52,7 @@ #include "util/misc/address_sanitizer.h" #include "util/misc/from_pointer_cast.h" #include "util/misc/memory_sanitizer.h" +#include "util/posix/scoped_mmap.h" #include "util/synchronization/semaphore.h" #if BUILDFLAG(IS_ANDROID) @@ -181,14 +182,21 @@ << ErrnoMessage("pthread_attr_init"); if (stack_size > 0) { - void* stack_ptr; - errno = posix_memalign(&stack_ptr, getpagesize(), stack_size); - ASSERT_EQ(errno, 0) << ErrnoMessage("posix_memalign"); + const size_t page_size = getpagesize(); + DCHECK_EQ(stack_size % page_size, 0u); + size_t stack_alloc_size = 2 * page_size + stack_size; - thread->stack.reset(reinterpret_cast<char*>(stack_ptr)); + ASSERT_TRUE(thread->stack.ResetMmap(nullptr, + stack_alloc_size, + PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, + 0)); + char* stack_ptr = thread->stack.addr_as<char*>() + page_size; + ASSERT_EQ(mprotect(stack_ptr, stack_size, PROT_READ | PROT_WRITE), 0) + << "mprotect"; - ASSERT_EQ(pthread_attr_setstack(&attr, thread->stack.get(), stack_size), - 0) + ASSERT_EQ(pthread_attr_setstack(&attr, stack_ptr, stack_size), 0) << ErrnoMessage("pthread_attr_setstack"); thread->expectation.max_stack_size = stack_size; } @@ -239,7 +247,7 @@ pthread_t pthread; ThreadExpectation expectation; - std::unique_ptr<char[], base::FreeDeleter> stack; + ScopedMmap stack; Semaphore ready_semaphore; Semaphore exit_semaphore; pid_t tid;
diff --git a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc index b32f22d7..3eb91b4 100644 --- a/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +++ b/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
@@ -276,7 +276,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return cpuid_.Signature(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -286,7 +286,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return cpuid_.Features(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -296,7 +296,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return cpuid_.ExtendedFeatures(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -306,7 +306,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return cpuid_.Leaf7Features(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -316,7 +316,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return cpuid_.SupportsDAZ(); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; #endif // ARCH_CPU_X86_FMAILY }
diff --git a/third_party/crashpad/crashpad/snapshot/mac/cpu_context_mac.cc b/third_party/crashpad/crashpad/snapshot/mac/cpu_context_mac.cc index 69a54ba..c8eddfcd 100644 --- a/third_party/crashpad/crashpad/snapshot/mac/cpu_context_mac.cc +++ b/third_party/crashpad/crashpad/snapshot/mac/cpu_context_mac.cc
@@ -196,7 +196,7 @@ } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return THREAD_STATE_NONE; } } @@ -377,7 +377,7 @@ } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return THREAD_STATE_NONE; } } @@ -553,7 +553,7 @@ } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return THREAD_STATE_NONE; } }
diff --git a/third_party/crashpad/crashpad/snapshot/mac/system_snapshot_mac.cc b/third_party/crashpad/crashpad/snapshot/mac/system_snapshot_mac.cc index 334627f..933626f 100644 --- a/third_party/crashpad/crashpad/snapshot/mac/system_snapshot_mac.cc +++ b/third_party/crashpad/crashpad/snapshot/mac/system_snapshot_mac.cc
@@ -204,7 +204,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return ReadIntSysctlByName<uint32_t>("machdep.cpu.signature", 0); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -215,7 +215,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return ReadIntSysctlByName<uint64_t>("machdep.cpu.feature_bits", 0); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -226,7 +226,7 @@ #if defined(ARCH_CPU_X86_FAMILY) return ReadIntSysctlByName<uint64_t>("machdep.cpu.extfeature_bits", 0); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -251,7 +251,7 @@ CallCPUID(7, &eax, &ebx, &ecx, &edx); return ebx; #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -290,7 +290,7 @@ // Test the DAZ bit. return fxsave.mxcsr_mask & (1 << 6); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; #endif }
diff --git a/third_party/crashpad/crashpad/snapshot/minidump/module_snapshot_minidump.cc b/third_party/crashpad/crashpad/snapshot/minidump/module_snapshot_minidump.cc index 50e5ea85..8d461b3 100644 --- a/third_party/crashpad/crashpad/snapshot/minidump/module_snapshot_minidump.cc +++ b/third_party/crashpad/crashpad/snapshot/minidump/module_snapshot_minidump.cc
@@ -228,14 +228,14 @@ std::set<CheckedRange<uint64_t>> ModuleSnapshotMinidump::ExtraMemoryRanges() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return std::set<CheckedRange<uint64_t>>(); } std::vector<const UserMinidumpStream*> ModuleSnapshotMinidump::CustomMinidumpStreams() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return std::vector<const UserMinidumpStream*>(); }
diff --git a/third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.cc b/third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.cc index 03f3217..472e025 100644 --- a/third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.cc +++ b/third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.cc
@@ -135,7 +135,7 @@ crashpad::ProcessID ProcessSnapshotMinidump::ParentProcessID() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; } @@ -208,7 +208,7 @@ std::vector<UnloadedModuleSnapshot> ProcessSnapshotMinidump::UnloadedModules() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return unloaded_modules_; } @@ -229,7 +229,7 @@ std::vector<HandleSnapshot> ProcessSnapshotMinidump::Handles() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return std::vector<HandleSnapshot>(); }
diff --git a/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc b/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc index 58bd7b3..cfdedadf 100644 --- a/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc +++ b/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc
@@ -100,36 +100,36 @@ void SystemSnapshotMinidump::CPUFrequency(uint64_t* current_hz, uint64_t* max_hz) const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 } uint32_t SystemSnapshotMinidump::CPUX86Signature() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; } uint64_t SystemSnapshotMinidump::CPUX86Features() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; } uint64_t SystemSnapshotMinidump::CPUX86ExtendedFeatures() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; } uint32_t SystemSnapshotMinidump::CPUX86Leaf7Features() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; } bool SystemSnapshotMinidump::CPUX86SupportsDAZ() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return false; } @@ -178,13 +178,13 @@ std::string SystemSnapshotMinidump::MachineDescription() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return std::string(); } bool SystemSnapshotMinidump::NXEnabled() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return false; } @@ -194,12 +194,12 @@ std::string* standard_name, std::string* daylight_name) const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 } uint64_t SystemSnapshotMinidump::AddressMask() const { INITIALIZATION_STATE_DCHECK_VALID(initialized_); - NOTREACHED(); // https://crashpad.chromium.org/bug/10 + NOTREACHED_IN_MIGRATION(); // https://crashpad.chromium.org/bug/10 return 0; }
diff --git a/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc b/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc index 329c3c76..e9a835b 100644 --- a/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc +++ b/third_party/crashpad/crashpad/snapshot/sanitized/process_snapshot_sanitized_test.cc
@@ -129,7 +129,7 @@ CRASHPAD_CHILD_TEST_MAIN(ChildToBeSanitized) { ChildTestFunction(); - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return EXIT_SUCCESS; }
diff --git a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc index 1eaad8a..65d06b2 100644 --- a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc +++ b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
@@ -360,7 +360,7 @@ __cpuid(cpu_info, 1); return cpu_info[0]; #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -375,7 +375,7 @@ return (static_cast<uint64_t>(cpu_info[2]) << 32) | static_cast<uint64_t>(cpu_info[3]); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -391,7 +391,7 @@ return (static_cast<uint64_t>(cpu_info[2]) << 32) | static_cast<uint64_t>(cpu_info[3]); #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -410,7 +410,7 @@ __cpuidex(cpu_info, 7, 0); return cpu_info[1]; #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif } @@ -441,7 +441,7 @@ // Test the DAZ bit. return (mxcsr_mask & (1 << 6)) != 0; #else - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return 0; #endif }
diff --git a/third_party/crashpad/crashpad/test/linux/fake_ptrace_connection.cc b/third_party/crashpad/crashpad/test/linux/fake_ptrace_connection.cc index af686ae3..8eefe6b2c 100644 --- a/third_party/crashpad/crashpad/test/linux/fake_ptrace_connection.cc +++ b/third_party/crashpad/crashpad/test/linux/fake_ptrace_connection.cc
@@ -90,14 +90,14 @@ bool FakePtraceConnection::Threads(std::vector<pid_t>* threads) { // TODO(jperaza): Implement this if/when it's needed. - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; } ssize_t FakePtraceConnection::ReadUpTo(VMAddress address, size_t size, void* buffer) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return false; }
diff --git a/third_party/crashpad/crashpad/util/file/file_io_posix.cc b/third_party/crashpad/crashpad/util/file/file_io_posix.cc index 6d02462b..37e923ac 100644 --- a/third_party/crashpad/crashpad/util/file/file_io_posix.cc +++ b/third_party/crashpad/crashpad/util/file/file_io_posix.cc
@@ -276,7 +276,7 @@ return STDERR_FILENO; } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return kInvalidFileHandle; }
diff --git a/third_party/crashpad/crashpad/util/file/file_io_win.cc b/third_party/crashpad/crashpad/util/file/file_io_win.cc index cb9ea14..876f578 100644 --- a/third_party/crashpad/crashpad/util/file/file_io_win.cc +++ b/third_party/crashpad/crashpad/util/file/file_io_win.cc
@@ -230,7 +230,7 @@ method = FILE_END; break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); break; } @@ -283,7 +283,7 @@ standard_handle = STD_ERROR_HANDLE; break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return INVALID_HANDLE_VALUE; }
diff --git a/third_party/crashpad/crashpad/util/file/output_stream_file_writer.cc b/third_party/crashpad/crashpad/util/file/output_stream_file_writer.cc index 9cab03d..8d9cb976 100644 --- a/third_party/crashpad/crashpad/util/file/output_stream_file_writer.cc +++ b/third_party/crashpad/crashpad/util/file/output_stream_file_writer.cc
@@ -56,7 +56,7 @@ } FileOffset OutputStreamFileWriter::Seek(FileOffset offset, int whence) { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return -1; }
diff --git a/third_party/crashpad/crashpad/util/mac/mac_util.cc b/third_party/crashpad/crashpad/util/mac/mac_util.cc index cef2387..37b595b6 100644 --- a/third_party/crashpad/crashpad/util/mac/mac_util.cc +++ b/third_party/crashpad/crashpad/util/mac/mac_util.cc
@@ -207,7 +207,7 @@ #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13_4 // On macOS 10.13.4 and later, the sysctlbyname above should have been // successful. - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return -1; #else // DT >= 10.13.4 // The Darwin major version is always 4 greater than the macOS minor version
diff --git a/third_party/crashpad/crashpad/util/mach/child_port_handshake.cc b/third_party/crashpad/crashpad/util/mach/child_port_handshake.cc index afbf55f..3402d2d 100644 --- a/third_party/crashpad/crashpad/util/mach/child_port_handshake.cc +++ b/third_party/crashpad/crashpad/util/mach/child_port_handshake.cc
@@ -256,7 +256,7 @@ break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); break; } }
diff --git a/third_party/crashpad/crashpad/util/mach/exc_client_variants.cc b/third_party/crashpad/crashpad/util/mach/exc_client_variants.cc index f7cb763..a2c6313 100644 --- a/third_party/crashpad/crashpad/util/mach/exc_client_variants.cc +++ b/third_party/crashpad/crashpad/util/mach/exc_client_variants.cc
@@ -123,7 +123,7 @@ new_state_count); default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); return KERN_INVALID_ARGUMENT; } }
diff --git a/third_party/crashpad/crashpad/util/mach/exception_ports.cc b/third_party/crashpad/crashpad/util/mach/exception_ports.cc index b983cc6c..0f80887a1 100644 --- a/third_party/crashpad/crashpad/util/mach/exception_ports.cc +++ b/third_party/crashpad/crashpad/util/mach/exception_ports.cc
@@ -80,7 +80,7 @@ break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); get_exception_ports_ = nullptr; set_exception_ports_ = nullptr; target_name_ = nullptr;
diff --git a/third_party/crashpad/crashpad/util/mach/exception_ports_test.cc b/third_party/crashpad/crashpad/util/mach/exception_ports_test.cc index b37a99a2..a6d065bc 100644 --- a/third_party/crashpad/crashpad/util/mach/exception_ports_test.cc +++ b/third_party/crashpad/crashpad/util/mach/exception_ports_test.cc
@@ -188,7 +188,7 @@ } else if (who_crashes_ == kOtherThreadCrashes) { expect_behavior = EXCEPTION_STATE_IDENTITY; } else { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); expect_behavior = 0; } @@ -286,7 +286,7 @@ } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } } } @@ -369,7 +369,7 @@ break; } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } } } @@ -520,7 +520,7 @@ } default: { - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } } }
diff --git a/third_party/crashpad/crashpad/util/synchronization/scoped_spin_guard.h b/third_party/crashpad/crashpad/util/synchronization/scoped_spin_guard.h index f924d991..0814192 100644 --- a/third_party/crashpad/crashpad/util/synchronization/scoped_spin_guard.h +++ b/third_party/crashpad/crashpad/util/synchronization/scoped_spin_guard.h
@@ -73,10 +73,17 @@ ClockMonotonicNanoseconds() + timeout_nanos; while (true) { bool expected_current_value = false; - if (state.locked.compare_exchange_weak(expected_current_value, - true, - std::memory_order_acquire, - std::memory_order_relaxed)) { + // `std::atomic::compare_exchange_weak()` is allowed to spuriously fail on + // architectures like ARM, which can cause timeouts even for + // single-threaded cases (https://crbug.com/340980960, + // http://b/296082201). + // + // Use `std::compare_exchange_strong()` instead to avoid spurious failures + // in the common case. + if (state.locked.compare_exchange_strong(expected_current_value, + true, + std::memory_order_acquire, + std::memory_order_relaxed)) { return std::make_optional<ScopedSpinGuard>(state); } if (ClockMonotonicNanoseconds() >= clock_end_time_nanos) { @@ -85,7 +92,7 @@ SleepNanoseconds(kSpinGuardSleepTimeNanos); } - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); } ~ScopedSpinGuard() {
diff --git a/third_party/crashpad/crashpad/util/win/registration_protocol_win_test.cc b/third_party/crashpad/crashpad/util/win/registration_protocol_win_test.cc index 20c75239..9ce265a 100644 --- a/third_party/crashpad/crashpad/util/win/registration_protocol_win_test.cc +++ b/third_party/crashpad/crashpad/util/win/registration_protocol_win_test.cc
@@ -98,7 +98,7 @@ mask = label_ace->Mask; } break; default: - NOTREACHED(); + NOTREACHED_IN_MIGRATION(); break; }
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index b17d398..f2d69fd 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit b17d398e7b03f3dbef6b7debee507396062b5f08 +Subproject commit f2d69fd1ec90a1e8a8571bc5e0e53337a126a60c
diff --git a/third_party/dawn b/third_party/dawn index d526879..f22e61f 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit d5268798a2076b59f4cc5e386d3a87ce3d35dcaa +Subproject commit f22e61ff624c0c4b9b8961a49680ff0073960cfe
diff --git a/third_party/depot_tools b/third_party/depot_tools index f97b5e2..6708d95 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit f97b5e242423158b83bcd9ca518dbd3b13cd85d3 +Subproject commit 6708d95ec6d819098093cd57c746636a5bb9a4ea
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 7ff0acf..6c2eb91 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 7ff0acfea354b4043618f5d0b24c23b0f8fb829c +Subproject commit 6c2eb915ee80cc23b728d9730e80427b3c21b8cf
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 33a09fb..6b13b7f 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 33a09fb44a6f593270589acfac482d9b275b389c +Subproject commit 6b13b7f0b3a0bdd36b26dee0b398e5d1cd8c1f43
diff --git a/third_party/lens_server_proto/BUILD.gn b/third_party/lens_server_proto/BUILD.gn index c2c5e27..541a98f7 100644 --- a/third_party/lens_server_proto/BUILD.gn +++ b/third_party/lens_server_proto/BUILD.gn
@@ -7,6 +7,7 @@ _proto_files = [ "lens_overlay_client_context.proto", "lens_overlay_cluster_info.proto", + "lens_overlay_entry_point.proto", "lens_overlay_filters.proto", "lens_overlay_geometry.proto", "lens_overlay_image_crop.proto", @@ -14,6 +15,7 @@ "lens_overlay_interaction_request_metadata.proto", "lens_overlay_overlay_object.proto", "lens_overlay_payload.proto", + "lens_overlay_phase_latencies_metadata.proto", "lens_overlay_platform.proto", "lens_overlay_polygon.proto", "lens_overlay_request_id.proto",
diff --git a/third_party/lens_server_proto/README.chromium b/third_party/lens_server_proto/README.chromium index 12eb6de9..3b3759a 100644 --- a/third_party/lens_server_proto/README.chromium +++ b/third_party/lens_server_proto/README.chromium
@@ -1,8 +1,8 @@ Name: Lens Protos Short Name: lens_overlay_proto URL: This is the canonical public repository -Version: 632179243 -Date: 2024-05-09 UTC +Version: 634881401 +Date: 2024-05-17 UTC License: BSD License File: LICENSE Shipped: yes
diff --git a/third_party/lens_server_proto/lens_overlay_entry_point.proto b/third_party/lens_server_proto/lens_overlay_entry_point.proto new file mode 100644 index 0000000..3218291 --- /dev/null +++ b/third_party/lens_server_proto/lens_overlay_entry_point.proto
@@ -0,0 +1,20 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +syntax = 'proto3'; + +option optimize_for = LITE_RUNTIME; + +package lens; + +// Enum containing Lens entry points for the Lens Overlay feature. +enum LensOverlayEntryPoint { + UNKNOWN_ENTRY_POINT = 0; + LENS_OVERLAY_APP_MENU = 237; + LENS_OVERLAY_PAGE_CONTEXT_MENU = 238; + LENS_OVERLAY_IMAGE_CONTEXT_MENU = 239; + LENS_OVERLAY_OMNIBOX_BUTTON = 240; + LENS_OVERLAY_TOOLBAR_BUTTON = 241; + LENS_OVERLAY_FIND_IN_PAGE = 242; +}
diff --git a/third_party/lens_server_proto/lens_overlay_phase_latencies_metadata.proto b/third_party/lens_server_proto/lens_overlay_phase_latencies_metadata.proto new file mode 100644 index 0000000..12da11e5 --- /dev/null +++ b/third_party/lens_server_proto/lens_overlay_phase_latencies_metadata.proto
@@ -0,0 +1,72 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +syntax = 'proto2'; + +option optimize_for = LITE_RUNTIME; + +package lens; + +// Phase latency metadata for the Lens Overlay. +message LensOverlayPhaseLatenciesMetadata { + enum ImageType { + UNKNOWN = 0; + JPEG = 1; + reserved 2, 3; + } + + // Represents a single point in time during the image preprocessing flow. + message Phase { + // NEXT ID: 60 + enum PhaseType { + UNKNOWN_PHASE = 0; + OVERALL_START = 1; + IMAGE_DOWNSCALE_START = 2; + IMAGE_DOWNSCALE_END = 3; + IMAGE_ENCODE_START = 4; + IMAGE_ENCODE_END = 5; + } + + message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + optional int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + optional int32 nanos = 2; + } + + optional PhaseType phase_type = 1; + optional Timestamp timestamp = 2; + // Data specific for each PhaseType. These should only be populated for + // "_END" PhaseTypes. + oneof phase_data { + // Data specifically only relevant for IMAGE_DOWNSCALE_END PhaseType. + ImageDownscaleData image_downscale_data = 3; + // Data specifically only relevant for IMAGE_ENCODE_END PhaseType. + ImageEncodeData image_encode_data = 4; + } + + message ImageDownscaleData { + // The size of the original image, in pixels. + optional int64 original_image_size = 1; + // The size of the downscaled image, in pixels. + optional int64 downscaled_image_size = 2; + } + + message ImageEncodeData { + // The type of the original Image. This only applies to IMAGE_ENCODE_END + // PhaseTypes + optional ImageType original_image_type = 1; + // The bytes size of the encoded image. + optional int64 encoded_image_size_bytes = 2; + } + } + + repeated Phase phase = 1; +}
diff --git a/third_party/lens_server_proto/lens_overlay_server.proto b/third_party/lens_server_proto/lens_overlay_server.proto index e148eb5..438b2a2 100644 --- a/third_party/lens_server_proto/lens_overlay_server.proto +++ b/third_party/lens_server_proto/lens_overlay_server.proto
@@ -8,6 +8,8 @@ package lens; +import "lens_overlay_entry_point.proto"; +import "lens_overlay_phase_latencies_metadata.proto"; import "lens_overlay_service_deps.proto"; // An error encountered while handling a request. @@ -22,13 +24,30 @@ ErrorType error_type = 1; } -// Next ID: 3 +// Client logs for a Lens Overlay request. +// Next ID: 4 +message LensOverlayClientLogs { + // The phase latency metadata for any image preprocessing required for the + // request. + LensOverlayPhaseLatenciesMetadata phase_latencies_metadata = 1; + + // The page url for the request, if available. + string page_url = 2; + + // The entry point for the request. + LensOverlayEntryPoint entry_point = 3; +} + +// Next ID: 6 message LensOverlayServerRequest { // Options for fetching objects. LensOverlayObjectsRequest objects_request = 1; // Options for fetching interactions. LensOverlayInteractionRequest interaction_request = 2; + + // Client logs for the request. + LensOverlayClientLogs client_logs = 3; } // Response details for an LensOverlay request.
diff --git a/third_party/lens_server_proto/lens_overlay_text.proto b/third_party/lens_server_proto/lens_overlay_text.proto index a61bfb3..03e25532 100644 --- a/third_party/lens_server_proto/lens_overlay_text.proto +++ b/third_party/lens_server_proto/lens_overlay_text.proto
@@ -39,8 +39,10 @@ // Optional. The text separator that should be appended after this word when // it is concatenated with the subsequent word in the same or next - // line/paragraph into a single-line string. - string text_separator = 3; + // line/paragraph into a single-line string. This is specified as optional + // because there is a distinction between the absence of a separator and + // the empty string as a separator. + optional string text_separator = 3; // Optional. The geometry of the word. Geometry geometry = 4;
diff --git a/third_party/libc++abi/src b/third_party/libc++abi/src index a37a3aa..fc3fb07 160000 --- a/third_party/libc++abi/src +++ b/third_party/libc++abi/src
@@ -1 +1 @@ -Subproject commit a37a3aa431f132b02a58656f13984d51098330a2 +Subproject commit fc3fb0729ef1197d815bc6711f10640cc5cb9f2d
diff --git a/third_party/omnibox_proto/BUILD.gn b/third_party/omnibox_proto/BUILD.gn index 1f79c56..e312f44 100644 --- a/third_party/omnibox_proto/BUILD.gn +++ b/third_party/omnibox_proto/BUILD.gn
@@ -16,6 +16,7 @@ "groups.proto", "navigational_intent.proto", "rich_answer_template.proto", + "rich_suggest_template.proto", "search_context.proto", "types.proto", ]
diff --git a/third_party/omnibox_proto/rich_suggest_template.proto b/third_party/omnibox_proto/rich_suggest_template.proto new file mode 100644 index 0000000..96f4dc0 --- /dev/null +++ b/third_party/omnibox_proto/rich_suggest_template.proto
@@ -0,0 +1,16 @@ +syntax = 'proto2'; + +import "rich_answer_template.proto"; + +option optimize_for = LITE_RUNTIME; +option java_package = 'org.chromium.components.omnibox'; +option java_outer_classname = 'RichSuggestTemplateProto'; + +package omnibox; + +message RichSuggestTemplate { + oneof template { + RichAnswerTemplate rich_answer_template = 1; + } + reserved 2, 3, 4, 5; +}
diff --git a/third_party/openscreen/src b/third_party/openscreen/src index a74a035..c474965 160000 --- a/third_party/openscreen/src +++ b/third_party/openscreen/src
@@ -1 +1 @@ -Subproject commit a74a035f778762b1c31ae1e9393eefdbf07be714 +Subproject commit c474965ed417600b6964f6d7ef4657c493dfc8a2
diff --git a/third_party/pdfium b/third_party/pdfium index f98c54d..3c0b08c 160000 --- a/third_party/pdfium +++ b/third_party/pdfium
@@ -1 +1 @@ -Subproject commit f98c54df162cd2a9324dad9e5b9453425311527d +Subproject commit 3c0b08ceabaeb34ff741b2615451f6a73b3ccbab
diff --git a/third_party/perfetto b/third_party/perfetto index a056c12..cb38092 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit a056c122b9a4c09797d3f09fdf4671657ff98240 +Subproject commit cb380924121f7b210ea622818a697c0348b0652d
diff --git a/third_party/re2/src b/third_party/re2/src index b7e96b3..a67d6c1 160000 --- a/third_party/re2/src +++ b/third_party/re2/src
@@ -1 +1 @@ -Subproject commit b7e96b34c0945fccb8b5282404f82c7ab0843717 +Subproject commit a67d6c1d5308b0950a91fed8e03e5c048d22d5cd
diff --git a/third_party/rust/PRESUBMIT.py b/third_party/rust/PRESUBMIT.py index a71f4a19..26e84896 100644 --- a/third_party/rust/PRESUBMIT.py +++ b/third_party/rust/PRESUBMIT.py
@@ -24,8 +24,29 @@ name=cmd_name, cmd=[input_api.python3_executable, run_cargo_vet_path] + vet_args, kwargs={}, - message=output_api.PresubmitPromptWarning) + message=output_api.PresubmitError) if input_api.verbose: print('Running ' + cmd_name) return input_api.RunTests([test_cmd]) +def CheckVetConfigTomlAndItsTemplateAreEditedTogether(input_api, output_api): + chromium_crates_io = input_api.os_path.join( + 'third_party', 'rust', 'chromium_crates_io') + toml_path = input_api.os_path.join( + chromium_crates_io, 'supply-chain', 'config.toml') + hbs_path = input_api.os_path.join(chromium_crates_io, 'vet_config.toml.hbs') + + affected_files = input_api.LocalPaths() + is_toml_edited = toml_path in affected_files + is_hbs_edited = hbs_path in affected_files + + if is_toml_edited != is_hbs_edited: + return [output_api.PresubmitError( + f"ERROR: `{hbs_path}` and `{toml_path}` are not modified together", + long_text=\ + f"Please edit `{hbs_path}` " + \ + f"and then regenerate `{toml_path}` " + \ + f"by running `tools/crates/run_gnrt.py vendor`" \ + )] + + return []
diff --git a/third_party/rust/chromium_crates_io/supply-chain/audits.toml b/third_party/rust/chromium_crates_io/supply-chain/audits.toml index 9f03c7a..4a55a03 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/audits.toml +++ b/third_party/rust/chromium_crates_io/supply-chain/audits.toml
@@ -376,29 +376,29 @@ [[audits.cxx]] who = "danakj <danakj@chromium.org>" -criteria = ["does-not-implement-crypto"] +criteria = "does-not-implement-crypto" +version = "1.0.122" +notes = """ +safe-to-deploy and ub-risk-2 are provided by exemption. +""" + +[[audits.cxx]] +who = "danakj <danakj@chromium.org>" +criteria = "does-not-implement-crypto" delta = "1.0.117 -> 1.0.119" notes = "Reviewed in https://crrev.com/c/5362739" [[audits.cxx]] who = "Dustin J. Mitchell <djmitche@chromium.org>" -criteria = ["does-not-implement-crypto"] +criteria = "does-not-implement-crypto" delta = "1.0.119 -> 1.0.120" notes = "Reviewed in https://chromium-review.googlesource.com/c/chromium/src/+/5392544." [[audits.cxx]] who = "Adrian Taylor <adetaylor@chromium.org>" -criteria = ["does-not-implement-crypto""] +criteria = "does-not-implement-crypto" delta = "1.0.120 -> 1.0.121" -[[audits.cxx]] -who = "danakj <danakj@chromium.org>" -criteria = ["does-not-implement-crypto"] -version = "1.0.122" -notes = """ -safe-to-deploy and ub-risk-2 are provided by exemption. -""" - [[audits.cxxbridge]] who = "danakj@chromium.org" criteria = ["safe-to-run", "does-not-implement-crypto"] @@ -479,7 +479,7 @@ [[audits.cxxbridge-macro]] who = "danakj <danakj@chromium.org>" -criteria = ["does-not-implement-crypto"] +criteria = "does-not-implement-crypto" version = "1.0.122" notes = """ no grep hits for cipher, crypto.
diff --git a/third_party/rust/chromium_crates_io/supply-chain/config.toml b/third_party/rust/chromium_crates_io/supply-chain/config.toml index f18fc9d..014bccdf 100644 --- a/third_party/rust/chromium_crates_io/supply-chain/config.toml +++ b/third_party/rust/chromium_crates_io/supply-chain/config.toml
@@ -297,7 +297,7 @@ [[exemptions.cxxbridge-macro]] version = "1.0.122" -criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] +criteria = ["safe-to-deploy", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -310,7 +310,7 @@ """ [[exemptions.libc]] -version = "0.2.153" +version = "0.2.154" criteria = ["safe-to-deploy", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -320,6 +320,7 @@ don't accidentally start depending on this feature. Exemption updated to 0.2.153 in Feb 2024. +Exemption updated to 0.2.154 in May 2024. """ [[exemptions.memchr]] @@ -374,7 +375,6 @@ a fully-audited baseline nothing was recorded in audits.toml Exemption updated to 2.0.50 when updating the crate in Feb 2024. - Exemption updated to 2.0.52 when updating the crate in Mar 2024. Exemption updated to 2.0.53 when updating the crate. Exemption updated to 2.0.55 when updating the crate, with notes:
diff --git a/third_party/rust/chromium_crates_io/vet_config.toml.hbs b/third_party/rust/chromium_crates_io/vet_config.toml.hbs index 421f590..911862a 100644 --- a/third_party/rust/chromium_crates_io/vet_config.toml.hbs +++ b/third_party/rust/chromium_crates_io/vet_config.toml.hbs
@@ -59,7 +59,7 @@ {{/each}} [[exemptions.cxx]] -version = "1.0.117" +version = "1.0.122" criteria = ["safe-to-deploy", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -69,11 +69,12 @@ Exemption updated to 1.0.116 in Feb 2024. Exemption updated to 1.0.117 in Feb 2024. +Exemption updated to 1.0.122 in May 2024. """ [[exemptions.cxxbridge-macro]] -version = "1.0.117" -criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] +version = "1.0.122" +criteria = ["safe-to-deploy", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -82,10 +83,11 @@ Exemption updated to 1.0.116 in Feb 2024. Exemption updated to 1.0.117 in Feb 2024. +Exemption updated to 1.0.122 in May 2024. """ [[exemptions.libc]] -version = "0.2.153" +version = "0.2.154" criteria = ["safe-to-deploy", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -95,6 +97,7 @@ don't accidentally start depending on this feature. Exemption updated to 0.2.153 in Feb 2024. +Exemption updated to 0.2.154 in May 2024. """ [[exemptions.memchr]] @@ -126,7 +129,7 @@ notes = "Grandparented-in when setting up `cargo vet` in Jan 2024" [[exemptions.ryu]] -version = "1.0.17" +version = "1.0.18" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024. @@ -135,10 +138,11 @@ lack of a fully-audited baseline nothing was recorded in audits.toml Exemption updated to 1.0.17 in Feb 2024. +Exemption updated to 1.0.18 in May 2024. """ [[exemptions.syn]] -version = "2.0.59" +version = "2.0.63" criteria = ["safe-to-deploy", "does-not-implement-crypto", "ub-risk-2"] notes = """ Grandparented-in when setting up `cargo vet` in Jan 2024 @@ -148,8 +152,11 @@ a fully-audited baseline nothing was recorded in audits.toml Exemption updated to 2.0.50 when updating the crate in Feb 2024. - Exemption updated to 2.0.52 when updating the crate in Mar 2024. - +Exemption updated to 2.0.53 when updating the crate. +Exemption updated to 2.0.55 when updating the crate, with notes: + - Mostly clippy, test changes - no changed unsafe. Exemption updated to 2.0.59 when updating the crate in Apr 2024. +Exemption updated to 2.0.60 when updating the crate. +Exemption updated to 2.0.63 when updating the crate in May 2024. """
diff --git a/third_party/sqlite/src b/third_party/sqlite/src index 1ee793e..9e45bcc 160000 --- a/third_party/sqlite/src +++ b/third_party/sqlite/src
@@ -1 +1 @@ -Subproject commit 1ee793e63351333e2089d4b272e15574502ff0c2 +Subproject commit 9e45bccab2b8de8140c1732b0ec490db0362f730
diff --git a/third_party/webrtc b/third_party/webrtc index 7518ae9..57c2f35 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 7518ae9ac92f7020daa38de3fb87de9a5e875872 +Subproject commit 57c2f35cfc2da8b7b507709237a7fe9791fc64e0
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.h index 73ce1c7c..da135987 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.h
@@ -263,6 +263,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -573,6 +594,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -7701,6 +7743,852 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -8209,6 +9097,9 @@ + + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.tlb index 5f72df02..6f219cf 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_i.c index a4cc1f5..c45e785a 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_i.c
@@ -157,6 +157,15 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_p.c index c530e094..bfddbfd5 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_p.c
@@ -46,8 +46,8 @@ #include "updater_legacy_idl.h" -#define TYPE_FORMAT_STRING_SIZE 1155 -#define PROC_FORMAT_STRING_SIZE 4513 +#define TYPE_FORMAT_STRING_SIZE 1177 +#define PROC_FORMAT_STRING_SIZE 4639 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -533,6 +533,45 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -5647,19 +5686,16 @@ /* 4296 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 4298 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 4300 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4304 */ NdrFcShort( 0x3 ), /* 3 */ +/* 4304 */ NdrFcShort( 0x18 ), /* 24 */ /* 4306 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ /* 4308 */ NdrFcShort( 0x0 ), /* 0 */ /* 4310 */ NdrFcShort( 0x8 ), /* 8 */ -/* 4312 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 4312 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 4314 */ 0xe, /* 14 */ 0x1, /* Ext Flags: new corr desc, */ @@ -5672,17 +5708,11 @@ /* 4326 */ 0x81, /* 129 */ 0x0, /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 4328 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4328 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 4330 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 4332 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ - - /* Return value */ - +/* 4332 */ NdrFcShort( 0x464 ), /* Type Offset=1124 */ /* Return value */ @@ -5691,58 +5721,172 @@ /* 4338 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 4340 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 4342 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4346 */ NdrFcShort( 0x4 ), /* 4 */ -/* 4348 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 4350 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4346 */ NdrFcShort( 0x18 ), /* 24 */ +/* 4348 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4350 */ NdrFcShort( 0x0 ), /* 0 */ /* 4352 */ NdrFcShort( 0x8 ), /* 8 */ -/* 4354 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 4354 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 4356 */ 0xe, /* 14 */ 0x1, /* Ext Flags: new corr desc, */ /* 4358 */ NdrFcShort( 0x0 ), /* 0 */ /* 4360 */ NdrFcShort( 0x0 ), /* 0 */ /* 4362 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4364 */ NdrFcShort( 0x3 ), /* 3 */ -/* 4366 */ 0x3, /* 3 */ +/* 4364 */ NdrFcShort( 0x2 ), /* 2 */ +/* 4366 */ 0x2, /* 2 */ 0x80, /* 128 */ /* 4368 */ 0x81, /* 129 */ - 0x82, /* 130 */ + 0x0, /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 4370 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 4370 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 4372 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 4374 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 4374 */ NdrFcShort( 0x47a ), /* Type Offset=1146 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 4376 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4376 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 4378 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 4380 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ +/* 4380 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 4382 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4384 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4388 */ NdrFcShort( 0x18 ), /* 24 */ +/* 4390 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4392 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4394 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4396 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 4398 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4400 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4402 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4404 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4406 */ NdrFcShort( 0x2 ), /* 2 */ +/* 4408 */ 0x2, /* 2 */ + 0x80, /* 128 */ +/* 4410 */ 0x81, /* 129 */ + 0x0, /* 0 */ + + /* Parameter value */ + +/* 4412 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 4414 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 4416 */ NdrFcShort( 0x44e ), /* Type Offset=1102 */ + + /* Return value */ + +/* 4418 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4420 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 4422 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLine */ + + + /* Procedure LaunchCmdLine */ + +/* 4424 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4426 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4430 */ NdrFcShort( 0x3 ), /* 3 */ +/* 4432 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4434 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4436 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4438 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 4440 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4442 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4444 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4446 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4448 */ NdrFcShort( 0x2 ), /* 2 */ +/* 4450 */ 0x2, /* 2 */ + 0x80, /* 128 */ +/* 4452 */ 0x81, /* 129 */ + 0x0, /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 4454 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4456 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 4458 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ /* Return value */ /* Return value */ -/* 4382 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 4384 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 4386 */ 0x8, /* FC_LONG */ +/* 4460 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4462 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 4464 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchBrowser */ + + + /* Procedure LaunchBrowser */ + +/* 4466 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4468 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4472 */ NdrFcShort( 0x4 ), /* 4 */ +/* 4474 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 4476 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4478 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4480 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 4482 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4484 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4486 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4488 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4490 */ NdrFcShort( 0x3 ), /* 3 */ +/* 4492 */ 0x3, /* 3 */ + 0x80, /* 128 */ +/* 4494 */ 0x81, /* 129 */ + 0x82, /* 130 */ + + /* Parameter browser_type */ + + + /* Parameter browser_type */ + +/* 4496 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 4498 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 4500 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter url */ + + + /* Parameter url */ + +/* 4502 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4504 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 4506 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ + + /* Return value */ + + + /* Return value */ + +/* 4508 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4510 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4512 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdElevated */ @@ -5750,26 +5894,26 @@ /* Procedure LaunchCmdElevated */ -/* 4388 */ 0x33, /* FC_AUTO_HANDLE */ +/* 4514 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 4390 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4394 */ NdrFcShort( 0x5 ), /* 5 */ -/* 4396 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ -/* 4398 */ NdrFcShort( 0x8 ), /* 8 */ -/* 4400 */ NdrFcShort( 0x24 ), /* 36 */ -/* 4402 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 4516 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4520 */ NdrFcShort( 0x5 ), /* 5 */ +/* 4522 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ +/* 4524 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4526 */ NdrFcShort( 0x24 ), /* 36 */ +/* 4528 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 4404 */ 0x10, /* 16 */ +/* 4530 */ 0x10, /* 16 */ 0x1, /* Ext Flags: new corr desc, */ -/* 4406 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4408 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4410 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4412 */ NdrFcShort( 0x5 ), /* 5 */ -/* 4414 */ 0x5, /* 5 */ +/* 4532 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4534 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4536 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4538 */ NdrFcShort( 0x5 ), /* 5 */ +/* 4540 */ 0x5, /* 5 */ 0x80, /* 128 */ -/* 4416 */ 0x81, /* 129 */ +/* 4542 */ 0x81, /* 129 */ 0x82, /* 130 */ -/* 4418 */ 0x83, /* 131 */ +/* 4544 */ 0x83, /* 131 */ 0x84, /* 132 */ /* Parameter app_guid */ @@ -5777,27 +5921,27 @@ /* Parameter app_guid */ -/* 4420 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4422 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 4424 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ +/* 4546 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4548 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 4550 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ /* Parameter cmd_id */ /* Parameter cmd_id */ -/* 4426 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4428 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 4430 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ +/* 4552 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4554 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 4556 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ /* Parameter caller_proc_id */ /* Parameter caller_proc_id */ -/* 4432 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ -/* 4434 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 4436 */ 0x8, /* FC_LONG */ +/* 4558 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 4560 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4562 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -5805,9 +5949,9 @@ /* Parameter proc_handle */ -/* 4438 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4440 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 4442 */ 0xb9, /* FC_UINT3264 */ +/* 4564 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4566 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 4568 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -5815,9 +5959,9 @@ /* Return value */ -/* 4444 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 4446 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ -/* 4448 */ 0x8, /* FC_LONG */ +/* 4570 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4572 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ +/* 4574 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdLineEx */ @@ -5825,26 +5969,26 @@ /* Procedure LaunchCmdLineEx */ -/* 4450 */ 0x33, /* FC_AUTO_HANDLE */ +/* 4576 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 4452 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4456 */ NdrFcShort( 0x6 ), /* 6 */ -/* 4458 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ -/* 4460 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4462 */ NdrFcShort( 0x5c ), /* 92 */ -/* 4464 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 4578 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4582 */ NdrFcShort( 0x6 ), /* 6 */ +/* 4584 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ +/* 4586 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4588 */ NdrFcShort( 0x5c ), /* 92 */ +/* 4590 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 4466 */ 0x10, /* 16 */ +/* 4592 */ 0x10, /* 16 */ 0x1, /* Ext Flags: new corr desc, */ -/* 4468 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4470 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4472 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4474 */ NdrFcShort( 0x5 ), /* 5 */ -/* 4476 */ 0x5, /* 5 */ +/* 4594 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4596 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4598 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4600 */ NdrFcShort( 0x5 ), /* 5 */ +/* 4602 */ 0x5, /* 5 */ 0x80, /* 128 */ -/* 4478 */ 0x81, /* 129 */ +/* 4604 */ 0x81, /* 129 */ 0x82, /* 130 */ -/* 4480 */ 0x83, /* 131 */ +/* 4606 */ 0x83, /* 131 */ 0x84, /* 132 */ /* Parameter cmd_line */ @@ -5852,18 +5996,18 @@ /* Parameter cmd_line */ -/* 4482 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4484 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 4486 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ +/* 4608 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4610 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 4612 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ /* Parameter server_proc_id */ /* Parameter server_proc_id */ -/* 4488 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4490 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 4492 */ 0x8, /* FC_LONG */ +/* 4614 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4616 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 4618 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -5871,9 +6015,9 @@ /* Parameter proc_handle */ -/* 4494 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4496 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 4498 */ 0xb9, /* FC_UINT3264 */ +/* 4620 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4622 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 4624 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Parameter stdout_handle */ @@ -5881,9 +6025,9 @@ /* Parameter stdout_handle */ -/* 4500 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4502 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 4504 */ 0xb9, /* FC_UINT3264 */ +/* 4626 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4628 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 4630 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -5891,9 +6035,9 @@ /* Return value */ -/* 4506 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 4508 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ -/* 4510 */ 0x8, /* FC_LONG */ +/* 4632 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4634 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ +/* 4636 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ 0x0 @@ -6655,13 +6799,30 @@ /* 1144 */ 0xcc, /* 204 */ 0xbb, /* 187 */ /* 1146 */ + 0x11, 0x10, /* FC_RP [pointer_deref] */ +/* 1148 */ NdrFcShort( 0x2 ), /* Offset= 2 (1150) */ +/* 1150 */ + 0x2f, /* FC_IP */ + 0x5a, /* FC_CONSTANT_IID */ +/* 1152 */ NdrFcLong( 0x7e0a6b39 ), /* 2114612025 */ +/* 1156 */ NdrFcShort( 0x7ceb ), /* 31979 */ +/* 1158 */ NdrFcShort( 0x4944 ), /* 18756 */ +/* 1160 */ 0xab, /* 171 */ + 0xfa, /* 250 */ +/* 1162 */ 0xf4, /* 244 */ + 0x19, /* 25 */ +/* 1164 */ 0xd2, /* 210 */ + 0x1, /* 1 */ +/* 1166 */ 0xd6, /* 214 */ + 0xa0, /* 160 */ +/* 1168 */ 0x11, 0x8, /* FC_RP [simple_pointer] */ -/* 1148 */ +/* 1170 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 1150 */ +/* 1172 */ 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ -/* 1152 */ 0xb9, /* FC_UINT3264 */ +/* 1174 */ 0xb9, /* FC_UINT3264 */ 0x5c, /* FC_PAD */ 0x0 @@ -9548,15 +9709,372 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2408, + 2450, + 2498, + 2540, + 2582, + 2624, + 2666, + 2708, + 2750, + 2798, + 2846, + 2894, + 2942, + 4154, + 4298 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2990, + 3032, + 3080, + 3122, + 3164, + 3206, + 3248, + 3290, + 3332, + 3380, + 3428, + 3476, + 3524, + 4202, + 4340 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 3572, + 3614, + 3662, + 3704, + 3746, + 3788, + 3830, + 3872, + 3914, + 3962, + 4010, + 4058, + 4106, + 4250, + 4382 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 4298, - 4340, - 4388 + 4424, + 4466, + 4514 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -9608,9 +10126,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 4298, - 4340, - 4388 + 4424, + 4466, + 4514 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -9662,10 +10180,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 4298, - 4340, - 4388, - 4450 + 4424, + 4466, + 4514, + 4576 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -9718,10 +10236,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 4298, - 4340, - 4388, - 4450 + 4424, + 4466, + 4514, + 4576 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -9813,6 +10331,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, @@ -9828,10 +10347,12 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -9852,6 +10373,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, @@ -9867,10 +10389,12 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -9891,6 +10415,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IPolicyStatus2User", "IGoogleUpdate3Web", @@ -9906,10 +10431,12 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -9930,6 +10457,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -9950,6 +10478,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -9960,13 +10490,13 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 34, 32 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 37, 32 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 34, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 37, *pIndex ) } @@ -9977,7 +10507,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_BaseIIDList, & _updater_legacy_idl_IID_Lookup, - 34, + 37, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.h index a7249f75..acb215d7 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -433,6 +447,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -5210,6 +5238,570 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -5708,6 +6300,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.tlb index 4b6fa6d..477ec8c 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_i.c index 0bef2a0..2756954 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_p.c index 4a08e23..6bfb5c1 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_system_p.c
@@ -47,7 +47,7 @@ #include "updater_legacy_idl_system.h" #define TYPE_FORMAT_STRING_SIZE 1111 -#define PROC_FORMAT_STRING_SIZE 3883 +#define PROC_FORMAT_STRING_SIZE 3967 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -403,6 +403,32 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -4332,19 +4358,16 @@ /* 3666 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3668 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3670 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3674 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3674 */ NdrFcShort( 0x18 ), /* 24 */ /* 3676 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ /* 3678 */ NdrFcShort( 0x0 ), /* 0 */ /* 3680 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3682 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3682 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 3684 */ 0xe, /* 14 */ 0x1, /* Ext Flags: new corr desc, */ @@ -4357,17 +4380,11 @@ /* 3696 */ 0x81, /* 129 */ 0x0, /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 3698 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3698 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3700 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 3702 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ - - /* Return value */ - +/* 3702 */ NdrFcShort( 0x41e ), /* Type Offset=1054 */ /* Return value */ @@ -4376,58 +4393,137 @@ /* 3708 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3710 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3712 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3716 */ NdrFcShort( 0x4 ), /* 4 */ -/* 3718 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 3720 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3716 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3718 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3720 */ NdrFcShort( 0x0 ), /* 0 */ /* 3722 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3724 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 3724 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 3726 */ 0xe, /* 14 */ 0x1, /* Ext Flags: new corr desc, */ /* 3728 */ NdrFcShort( 0x0 ), /* 0 */ /* 3730 */ NdrFcShort( 0x0 ), /* 0 */ /* 3732 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3734 */ NdrFcShort( 0x3 ), /* 3 */ -/* 3736 */ 0x3, /* 3 */ +/* 3734 */ NdrFcShort( 0x2 ), /* 2 */ +/* 3736 */ 0x2, /* 2 */ 0x80, /* 128 */ /* 3738 */ 0x81, /* 129 */ - 0x82, /* 130 */ + 0x0, /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 3740 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3740 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3742 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 3744 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3744 */ NdrFcShort( 0x438 ), /* Type Offset=1080 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 3746 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3746 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 3748 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 3750 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ +/* 3750 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLine */ + + + /* Procedure LaunchCmdLine */ + +/* 3752 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3754 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3758 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3760 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3762 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3764 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3766 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3768 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3770 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3772 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3774 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3776 */ NdrFcShort( 0x2 ), /* 2 */ +/* 3778 */ 0x2, /* 2 */ + 0x80, /* 128 */ +/* 3780 */ 0x81, /* 129 */ + 0x0, /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 3782 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3784 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3786 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ /* Return value */ /* Return value */ -/* 3752 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3754 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 3756 */ 0x8, /* FC_LONG */ +/* 3788 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3790 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3792 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchBrowser */ + + + /* Procedure LaunchBrowser */ + +/* 3794 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3796 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3800 */ NdrFcShort( 0x4 ), /* 4 */ +/* 3802 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 3804 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3806 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3808 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 3810 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3812 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3814 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3816 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3818 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3820 */ 0x3, /* 3 */ + 0x80, /* 128 */ +/* 3822 */ 0x81, /* 129 */ + 0x82, /* 130 */ + + /* Parameter browser_type */ + + + /* Parameter browser_type */ + +/* 3824 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3826 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3828 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter url */ + + + /* Parameter url */ + +/* 3830 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3832 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3834 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ + + /* Return value */ + + + /* Return value */ + +/* 3836 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3838 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3840 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdElevated */ @@ -4435,26 +4531,26 @@ /* Procedure LaunchCmdElevated */ -/* 3758 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3842 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3760 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3764 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3766 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ -/* 3768 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3770 */ NdrFcShort( 0x24 ), /* 36 */ -/* 3772 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3844 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3848 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3850 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ +/* 3852 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3854 */ NdrFcShort( 0x24 ), /* 36 */ +/* 3856 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 3774 */ 0x10, /* 16 */ +/* 3858 */ 0x10, /* 16 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3776 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3778 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3780 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3782 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3784 */ 0x5, /* 5 */ +/* 3860 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3862 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3864 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3866 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3868 */ 0x5, /* 5 */ 0x80, /* 128 */ -/* 3786 */ 0x81, /* 129 */ +/* 3870 */ 0x81, /* 129 */ 0x82, /* 130 */ -/* 3788 */ 0x83, /* 131 */ +/* 3872 */ 0x83, /* 131 */ 0x84, /* 132 */ /* Parameter app_guid */ @@ -4462,27 +4558,27 @@ /* Parameter app_guid */ -/* 3790 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3792 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 3794 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ +/* 3874 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3876 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3878 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ /* Parameter cmd_id */ /* Parameter cmd_id */ -/* 3796 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3798 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 3800 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ +/* 3880 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3882 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3884 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ /* Parameter caller_proc_id */ /* Parameter caller_proc_id */ -/* 3802 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ -/* 3804 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 3806 */ 0x8, /* FC_LONG */ +/* 3886 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3888 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3890 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -4490,9 +4586,9 @@ /* Parameter proc_handle */ -/* 3808 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3810 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 3812 */ 0xb9, /* FC_UINT3264 */ +/* 3892 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3894 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 3896 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -4500,9 +4596,9 @@ /* Return value */ -/* 3814 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3816 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ -/* 3818 */ 0x8, /* FC_LONG */ +/* 3898 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3900 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ +/* 3902 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdLineEx */ @@ -4510,26 +4606,26 @@ /* Procedure LaunchCmdLineEx */ -/* 3820 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3904 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3822 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3826 */ NdrFcShort( 0x6 ), /* 6 */ -/* 3828 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ -/* 3830 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3832 */ NdrFcShort( 0x5c ), /* 92 */ -/* 3834 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3906 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3910 */ NdrFcShort( 0x6 ), /* 6 */ +/* 3912 */ NdrFcShort( 0x30 ), /* ARM64 Stack size/offset = 48 */ +/* 3914 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3916 */ NdrFcShort( 0x5c ), /* 92 */ +/* 3918 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 3836 */ 0x10, /* 16 */ +/* 3920 */ 0x10, /* 16 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3838 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3840 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3842 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3844 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3846 */ 0x5, /* 5 */ +/* 3922 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3924 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3926 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3928 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3930 */ 0x5, /* 5 */ 0x80, /* 128 */ -/* 3848 */ 0x81, /* 129 */ +/* 3932 */ 0x81, /* 129 */ 0x82, /* 130 */ -/* 3850 */ 0x83, /* 131 */ +/* 3934 */ 0x83, /* 131 */ 0x84, /* 132 */ /* Parameter cmd_line */ @@ -4537,18 +4633,18 @@ /* Parameter cmd_line */ -/* 3852 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3854 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ -/* 3856 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ +/* 3936 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3938 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3940 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ /* Parameter server_proc_id */ /* Parameter server_proc_id */ -/* 3858 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3860 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ -/* 3862 */ 0x8, /* FC_LONG */ +/* 3942 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3944 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3946 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -4556,9 +4652,9 @@ /* Parameter proc_handle */ -/* 3864 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3866 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ -/* 3868 */ 0xb9, /* FC_UINT3264 */ +/* 3948 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3950 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3952 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Parameter stdout_handle */ @@ -4566,9 +4662,9 @@ /* Parameter stdout_handle */ -/* 3870 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3872 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ -/* 3874 */ 0xb9, /* FC_UINT3264 */ +/* 3954 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3956 */ NdrFcShort( 0x20 ), /* ARM64 Stack size/offset = 32 */ +/* 3958 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -4576,9 +4672,9 @@ /* Return value */ -/* 3876 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3878 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ -/* 3880 */ 0x8, /* FC_LONG */ +/* 3960 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3962 */ NdrFcShort( 0x28 ), /* ARM64 Stack size/offset = 40 */ +/* 3964 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ 0x0 @@ -7252,15 +7348,253 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2408, + 2450, + 2498, + 2540, + 2582, + 2624, + 2666, + 2708, + 2750, + 2798, + 2846, + 2894, + 2942, + 3572, + 3668 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2990, + 3032, + 3080, + 3122, + 3164, + 3206, + 3248, + 3290, + 3332, + 3380, + 3428, + 3476, + 3524, + 3620, + 3710 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 3668, - 3710, - 3758 + 3752, + 3794, + 3842 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -7312,9 +7646,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 3668, - 3710, - 3758 + 3752, + 3794, + 3842 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -7366,10 +7700,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 3668, - 3710, - 3758, - 3820 + 3752, + 3794, + 3842, + 3904 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -7422,10 +7756,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 3668, - 3710, - 3758, - 3820 + 3752, + 3794, + 3842, + 3904 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -7511,6 +7845,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusSystemProxyVtbl, @@ -7524,6 +7859,7 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, @@ -7540,6 +7876,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusSystemStubVtbl, @@ -7553,6 +7890,7 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, @@ -7569,6 +7907,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IGoogleUpdate3Web", "IPolicyStatusSystem", @@ -7582,6 +7921,7 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatusValue", @@ -7598,6 +7938,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -7614,6 +7955,7 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -7624,12 +7966,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 24, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 26, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 24, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 26, *pIndex ) } @@ -7640,7 +7982,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_system_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_system_BaseIIDList, & _updater_legacy_idl_system_IID_Lookup, - 24, + 26, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.h index 23d745f..63a9f13 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + #ifndef __GoogleUpdate3WebUserClass_FWD_DEFINED__ #define __GoogleUpdate3WebUserClass_FWD_DEFINED__ @@ -405,6 +419,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" @@ -5154,6 +5182,570 @@ #endif /* __IPolicyStatus3User_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + #ifndef __UpdaterLegacyLib_LIBRARY_DEFINED__ #define __UpdaterLegacyLib_LIBRARY_DEFINED__ @@ -5182,6 +5774,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.tlb index 9b523e5..2376e01e 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_i.c index 6317d6da..2ec833c 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3User,0xBC39E1E1,0xE8FA,0x4E72,0x90,0x3F,0x3B,0xF3,0x46,0xE7,0xE1,0x65); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + MIDL_DEFINE_GUID(IID, LIBID_UpdaterLegacyLib,0x7A1FDE1F,0xAAA9,0x441B,0xB9,0xAA,0x95,0xB3,0x1D,0x78,0x59,0x2B);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_p.c index 200cd9c..cf7b575 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/arm64/updater_legacy_idl_user_p.c
@@ -47,7 +47,7 @@ #include "updater_legacy_idl_user.h" #define TYPE_FORMAT_STRING_SIZE 1103 -#define PROC_FORMAT_STRING_SIZE 3669 +#define PROC_FORMAT_STRING_SIZE 3753 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -393,6 +393,32 @@ extern const MIDL_SERVER_INFO IPolicyStatus3User_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus3User_ProxyInfo; +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[ WIRE_MARSHAL_TABLE_SIZE ]; @@ -4280,6 +4306,76 @@ /* 3666 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3668 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3670 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3674 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3676 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3678 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3680 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3682 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3684 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3686 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3688 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3690 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3692 */ NdrFcShort( 0x2 ), /* 2 */ +/* 3694 */ 0x2, /* 2 */ + 0x80, /* 128 */ +/* 3696 */ 0x81, /* 129 */ + 0x0, /* 0 */ + + /* Parameter value */ + +/* 3698 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3700 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3702 */ NdrFcShort( 0x41e ), /* Type Offset=1054 */ + + /* Return value */ + +/* 3704 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3706 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3708 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3710 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3712 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3716 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3718 */ NdrFcShort( 0x18 ), /* ARM64 Stack size/offset = 24 */ +/* 3720 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3722 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3724 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3726 */ 0xe, /* 14 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3728 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3730 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3732 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3734 */ NdrFcShort( 0x2 ), /* 2 */ +/* 3736 */ 0x2, /* 2 */ + 0x80, /* 128 */ +/* 3738 */ 0x81, /* 129 */ + 0x0, /* 0 */ + + /* Parameter value */ + +/* 3740 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3742 */ NdrFcShort( 0x8 ), /* ARM64 Stack size/offset = 8 */ +/* 3744 */ NdrFcShort( 0x438 ), /* Type Offset=1080 */ + + /* Return value */ + +/* 3746 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3748 */ NdrFcShort( 0x10 ), /* ARM64 Stack size/offset = 16 */ +/* 3750 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + 0x0 } }; @@ -6941,6 +7037,244 @@ CStdStubBuffer_DELEGATING_METHODS }; + +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2408, + 2450, + 2498, + 2540, + 2582, + 2624, + 2666, + 2708, + 2750, + 2798, + 2846, + 2894, + 2942, + 3572, + 3668 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2366, + 992, + 2990, + 3032, + 3080, + 3122, + 3164, + 3206, + 3248, + 3290, + 3332, + 3380, + 3428, + 3476, + 3524, + 3620, + 3710 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + #ifdef __cplusplus namespace { #endif @@ -6981,6 +7315,7 @@ ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebUserProxyVtbl, @@ -6992,6 +7327,7 @@ ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -7006,6 +7342,7 @@ ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebUserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueUserStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebUserStubVtbl, @@ -7017,6 +7354,7 @@ ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -7031,6 +7369,7 @@ "IGoogleUpdate3WebUser", "IPolicyStatusValueUser", "IAppCommandWeb", + "IPolicyStatus4", "IPolicyStatus2User", "IGoogleUpdate3Web", "IAppCommandWebUser", @@ -7042,6 +7381,7 @@ "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -7068,6 +7408,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -7078,12 +7420,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 20, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 22, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 20, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 22, *pIndex ) } @@ -7094,7 +7436,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_user_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_user_BaseIIDList, & _updater_legacy_idl_user_IID_Lookup, - 20, + 22, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.h index 01498d5b..0f4b7be1 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.h
@@ -263,6 +263,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -573,6 +594,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -7701,6 +7743,852 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -8209,6 +9097,9 @@ + + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.tlb index 5f72df02..6f219cf 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_i.c index 75226e3..5b6eb54 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_i.c
@@ -157,6 +157,15 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_p.c index b428da7..8c32118 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_p.c
@@ -46,8 +46,8 @@ #include "updater_legacy_idl.h" -#define TYPE_FORMAT_STRING_SIZE 1155 -#define PROC_FORMAT_STRING_SIZE 4111 +#define TYPE_FORMAT_STRING_SIZE 1177 +#define PROC_FORMAT_STRING_SIZE 4225 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -533,6 +533,45 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -5265,19 +5304,16 @@ /* 3914 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3916 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3918 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3922 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3922 */ NdrFcShort( 0x18 ), /* 24 */ /* 3924 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ /* 3926 */ NdrFcShort( 0x0 ), /* 0 */ /* 3928 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3930 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3930 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 3932 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ @@ -5286,17 +5322,11 @@ /* 3938 */ NdrFcShort( 0x0 ), /* 0 */ /* 3940 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 3942 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3942 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3944 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3946 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ - - /* Return value */ - +/* 3946 */ NdrFcShort( 0x464 ), /* Type Offset=1124 */ /* Return value */ @@ -5305,20 +5335,17 @@ /* 3952 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3954 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3956 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3960 */ NdrFcShort( 0x4 ), /* 4 */ -/* 3962 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 3964 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3960 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3962 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3964 */ NdrFcShort( 0x0 ), /* 0 */ /* 3966 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3968 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 3968 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 3970 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ /* 3972 */ NdrFcShort( 0x0 ), /* 0 */ @@ -5326,142 +5353,187 @@ /* 3976 */ NdrFcShort( 0x0 ), /* 0 */ /* 3978 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 3980 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3980 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3982 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3984 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3984 */ NdrFcShort( 0x47a ), /* Type Offset=1146 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 3986 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3986 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 3988 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 3990 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ - - /* Return value */ - - - /* Return value */ - -/* 3992 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3994 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 3996 */ 0x8, /* FC_LONG */ +/* 3990 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdElevated */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ - - /* Procedure LaunchCmdElevated */ - -/* 3998 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3992 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 4000 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4004 */ NdrFcShort( 0x5 ), /* 5 */ -/* 4006 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ -/* 4008 */ NdrFcShort( 0x8 ), /* 8 */ -/* 4010 */ NdrFcShort( 0x24 ), /* 36 */ -/* 4012 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 4014 */ 0xa, /* 10 */ +/* 3994 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3998 */ NdrFcShort( 0x18 ), /* 24 */ +/* 4000 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 4002 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4004 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4006 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 4008 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ +/* 4010 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4012 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4014 */ NdrFcShort( 0x0 ), /* 0 */ /* 4016 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4018 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4020 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4022 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter app_guid */ + /* Parameter value */ - - /* Parameter app_guid */ - -/* 4024 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4026 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 4028 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ - - /* Parameter cmd_id */ - - - /* Parameter cmd_id */ - -/* 4030 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4032 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 4034 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ - - /* Parameter caller_proc_id */ - - - /* Parameter caller_proc_id */ - -/* 4036 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ -/* 4038 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 4040 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ - - /* Parameter proc_handle */ - - - /* Parameter proc_handle */ - -/* 4042 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4044 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 4046 */ 0xb9, /* FC_UINT3264 */ - 0x0, /* 0 */ +/* 4018 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 4020 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 4022 */ NdrFcShort( 0x44e ), /* Type Offset=1102 */ /* Return value */ - - /* Return value */ - -/* 4048 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 4050 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ -/* 4052 */ 0x8, /* FC_LONG */ +/* 4024 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4026 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 4028 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLineEx */ + /* Procedure LaunchCmdLine */ - /* Procedure LaunchCmdLineEx */ + /* Procedure LaunchCmdLine */ -/* 4054 */ 0x33, /* FC_AUTO_HANDLE */ +/* 4030 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 4056 */ NdrFcLong( 0x0 ), /* 0 */ -/* 4060 */ NdrFcShort( 0x6 ), /* 6 */ -/* 4062 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ -/* 4064 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4066 */ NdrFcShort( 0x5c ), /* 92 */ -/* 4068 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 4070 */ 0xa, /* 10 */ +/* 4032 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4036 */ NdrFcShort( 0x3 ), /* 3 */ +/* 4038 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 4040 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4042 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4044 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 4046 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ -/* 4072 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4074 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4076 */ NdrFcShort( 0x0 ), /* 0 */ -/* 4078 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4048 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4050 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4052 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4054 */ NdrFcShort( 0x0 ), /* 0 */ /* Parameter cmd_line */ /* Parameter cmd_line */ -/* 4080 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 4082 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 4084 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ +/* 4056 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4058 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 4060 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ - /* Parameter server_proc_id */ + /* Return value */ - /* Parameter server_proc_id */ + /* Return value */ -/* 4086 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4088 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 4090 */ 0x8, /* FC_LONG */ +/* 4062 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4064 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 4066 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchBrowser */ + + + /* Procedure LaunchBrowser */ + +/* 4068 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4070 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4074 */ NdrFcShort( 0x4 ), /* 4 */ +/* 4076 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 4078 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4080 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4082 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 4084 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4086 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4088 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4090 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4092 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter browser_type */ + + + /* Parameter browser_type */ + +/* 4094 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 4096 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 4098 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter url */ + + + /* Parameter url */ + +/* 4100 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4102 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 4104 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ + + /* Return value */ + + + /* Return value */ + +/* 4106 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4108 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 4110 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdElevated */ + + + /* Procedure LaunchCmdElevated */ + +/* 4112 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4114 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4118 */ NdrFcShort( 0x5 ), /* 5 */ +/* 4120 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ +/* 4122 */ NdrFcShort( 0x8 ), /* 8 */ +/* 4124 */ NdrFcShort( 0x24 ), /* 36 */ +/* 4126 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 4128 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4130 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4132 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4134 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4136 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter app_guid */ + + + /* Parameter app_guid */ + +/* 4138 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4140 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 4142 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ + + /* Parameter cmd_id */ + + + /* Parameter cmd_id */ + +/* 4144 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4146 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 4148 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ + + /* Parameter caller_proc_id */ + + + /* Parameter caller_proc_id */ + +/* 4150 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 4152 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 4154 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -5469,19 +5541,9 @@ /* Parameter proc_handle */ -/* 4092 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4094 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 4096 */ 0xb9, /* FC_UINT3264 */ - 0x0, /* 0 */ - - /* Parameter stdout_handle */ - - - /* Parameter stdout_handle */ - -/* 4098 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 4100 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 4102 */ 0xb9, /* FC_UINT3264 */ +/* 4156 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4158 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 4160 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -5489,9 +5551,79 @@ /* Return value */ -/* 4104 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 4106 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ -/* 4108 */ 0x8, /* FC_LONG */ +/* 4162 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4164 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ +/* 4166 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLineEx */ + + + /* Procedure LaunchCmdLineEx */ + +/* 4168 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 4170 */ NdrFcLong( 0x0 ), /* 0 */ +/* 4174 */ NdrFcShort( 0x6 ), /* 6 */ +/* 4176 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ +/* 4178 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4180 */ NdrFcShort( 0x5c ), /* 92 */ +/* 4182 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 4184 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 4186 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4188 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4190 */ NdrFcShort( 0x0 ), /* 0 */ +/* 4192 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 4194 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 4196 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 4198 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ + + /* Parameter server_proc_id */ + + + /* Parameter server_proc_id */ + +/* 4200 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4202 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 4204 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter proc_handle */ + + + /* Parameter proc_handle */ + +/* 4206 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4208 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 4210 */ 0xb9, /* FC_UINT3264 */ + 0x0, /* 0 */ + + /* Parameter stdout_handle */ + + + /* Parameter stdout_handle */ + +/* 4212 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4214 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 4216 */ 0xb9, /* FC_UINT3264 */ + 0x0, /* 0 */ + + /* Return value */ + + + /* Return value */ + +/* 4218 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4220 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ +/* 4222 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ 0x0 @@ -6253,13 +6385,30 @@ /* 1144 */ 0xcc, /* 204 */ 0xbb, /* 187 */ /* 1146 */ + 0x11, 0x10, /* FC_RP [pointer_deref] */ +/* 1148 */ NdrFcShort( 0x2 ), /* Offset= 2 (1150) */ +/* 1150 */ + 0x2f, /* FC_IP */ + 0x5a, /* FC_CONSTANT_IID */ +/* 1152 */ NdrFcLong( 0x7e0a6b39 ), /* 2114612025 */ +/* 1156 */ NdrFcShort( 0x7ceb ), /* 31979 */ +/* 1158 */ NdrFcShort( 0x4944 ), /* 18756 */ +/* 1160 */ 0xab, /* 171 */ + 0xfa, /* 250 */ +/* 1162 */ 0xf4, /* 244 */ + 0x19, /* 25 */ +/* 1164 */ 0xd2, /* 210 */ + 0x1, /* 1 */ +/* 1166 */ 0xd6, /* 214 */ + 0xa0, /* 160 */ +/* 1168 */ 0x11, 0x8, /* FC_RP [simple_pointer] */ -/* 1148 */ +/* 1170 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 1150 */ +/* 1172 */ 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ -/* 1152 */ 0xb9, /* FC_UINT3264 */ +/* 1174 */ 0xb9, /* FC_UINT3264 */ 0x5c, /* FC_PAD */ 0x0 @@ -9146,15 +9295,372 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2194, + 2232, + 2276, + 2314, + 2352, + 2390, + 2428, + 2466, + 2504, + 2548, + 2592, + 2636, + 2680, + 3784, + 3916 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2724, + 2762, + 2806, + 2844, + 2882, + 2920, + 2958, + 2996, + 3034, + 3078, + 3122, + 3166, + 3210, + 3828, + 3954 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 3254, + 3292, + 3336, + 3374, + 3412, + 3450, + 3488, + 3526, + 3564, + 3608, + 3652, + 3696, + 3740, + 3872, + 3992 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 3916, - 3954, - 3998 + 4030, + 4068, + 4112 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -9206,9 +9712,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 3916, - 3954, - 3998 + 4030, + 4068, + 4112 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -9260,10 +9766,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 3916, - 3954, - 3998, - 4054 + 4030, + 4068, + 4112, + 4168 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -9316,10 +9822,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 3916, - 3954, - 3998, - 4054 + 4030, + 4068, + 4112, + 4168 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -9411,6 +9917,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, @@ -9426,10 +9933,12 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -9450,6 +9959,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, @@ -9465,10 +9975,12 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -9489,6 +10001,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IPolicyStatus2User", "IGoogleUpdate3Web", @@ -9504,10 +10017,12 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -9528,6 +10043,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -9548,6 +10064,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -9558,13 +10076,13 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 34, 32 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 37, 32 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 34, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 37, *pIndex ) } @@ -9575,7 +10093,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_BaseIIDList, & _updater_legacy_idl_IID_Lookup, - 34, + 37, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.h index 7a42330..f7f58d5 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -433,6 +447,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -5210,6 +5238,570 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -5708,6 +6300,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.tlb index 4b6fa6d..477ec8c 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_i.c index 043c2fd..70d25d1 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_p.c index d4dd537..8181b1f 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_system_p.c
@@ -47,7 +47,7 @@ #include "updater_legacy_idl_system.h" #define TYPE_FORMAT_STRING_SIZE 1111 -#define PROC_FORMAT_STRING_SIZE 3537 +#define PROC_FORMAT_STRING_SIZE 3613 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -403,6 +403,32 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -4006,19 +4032,16 @@ /* 3340 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3342 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3344 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3348 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3348 */ NdrFcShort( 0x18 ), /* 24 */ /* 3350 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ /* 3352 */ NdrFcShort( 0x0 ), /* 0 */ /* 3354 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3356 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3356 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 3358 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ @@ -4027,17 +4050,11 @@ /* 3364 */ NdrFcShort( 0x0 ), /* 0 */ /* 3366 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 3368 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3368 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3370 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3372 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ - - /* Return value */ - +/* 3372 */ NdrFcShort( 0x41e ), /* Type Offset=1054 */ /* Return value */ @@ -4046,20 +4063,17 @@ /* 3378 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3380 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3382 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3386 */ NdrFcShort( 0x4 ), /* 4 */ -/* 3388 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 3390 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3386 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3388 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3390 */ NdrFcShort( 0x0 ), /* 0 */ /* 3392 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3394 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 3394 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 3396 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ /* 3398 */ NdrFcShort( 0x0 ), /* 0 */ @@ -4067,142 +4081,156 @@ /* 3402 */ NdrFcShort( 0x0 ), /* 0 */ /* 3404 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 3406 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3406 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3408 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3410 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3410 */ NdrFcShort( 0x438 ), /* Type Offset=1080 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 3412 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3412 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 3414 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 3416 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ - - /* Return value */ - - - /* Return value */ - -/* 3418 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3420 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 3422 */ 0x8, /* FC_LONG */ +/* 3416 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdElevated */ + /* Procedure LaunchCmdLine */ - /* Procedure LaunchCmdElevated */ + /* Procedure LaunchCmdLine */ -/* 3424 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3418 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3426 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3430 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3432 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ -/* 3434 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3436 */ NdrFcShort( 0x24 ), /* 36 */ -/* 3438 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 3440 */ 0xa, /* 10 */ +/* 3420 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3424 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3426 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3428 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3430 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3432 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3434 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ +/* 3436 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3438 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3440 */ NdrFcShort( 0x0 ), /* 0 */ /* 3442 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3444 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3446 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3448 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter app_guid */ + /* Parameter cmd_line */ - /* Parameter app_guid */ + /* Parameter cmd_line */ -/* 3450 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3452 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3454 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ - - /* Parameter cmd_id */ - - - /* Parameter cmd_id */ - -/* 3456 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3458 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 3460 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ - - /* Parameter caller_proc_id */ - - - /* Parameter caller_proc_id */ - -/* 3462 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ -/* 3464 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 3466 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ - - /* Parameter proc_handle */ - - - /* Parameter proc_handle */ - -/* 3468 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3470 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 3472 */ 0xb9, /* FC_UINT3264 */ - 0x0, /* 0 */ +/* 3444 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3446 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3448 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ /* Return value */ /* Return value */ -/* 3474 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3476 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ -/* 3478 */ 0x8, /* FC_LONG */ +/* 3450 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3452 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3454 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLineEx */ + /* Procedure LaunchBrowser */ - /* Procedure LaunchCmdLineEx */ + /* Procedure LaunchBrowser */ -/* 3480 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3456 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3482 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3486 */ NdrFcShort( 0x6 ), /* 6 */ -/* 3488 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ -/* 3490 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3492 */ NdrFcShort( 0x5c ), /* 92 */ -/* 3494 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 3496 */ 0xa, /* 10 */ +/* 3458 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3462 */ NdrFcShort( 0x4 ), /* 4 */ +/* 3464 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 3466 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3468 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3470 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 3472 */ 0xa, /* 10 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3498 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3500 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3502 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3504 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3474 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3476 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3478 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3480 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter cmd_line */ + /* Parameter browser_type */ - /* Parameter cmd_line */ + /* Parameter browser_type */ -/* 3506 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3508 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ -/* 3510 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ +/* 3482 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3484 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3486 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ - /* Parameter server_proc_id */ + /* Parameter url */ - /* Parameter server_proc_id */ + /* Parameter url */ -/* 3512 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3514 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ -/* 3516 */ 0x8, /* FC_LONG */ +/* 3488 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3490 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3492 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ + + /* Return value */ + + + /* Return value */ + +/* 3494 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3496 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3498 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdElevated */ + + + /* Procedure LaunchCmdElevated */ + +/* 3500 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3502 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3506 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3508 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ +/* 3510 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3512 */ NdrFcShort( 0x24 ), /* 36 */ +/* 3514 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 3516 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3518 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3520 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3522 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3524 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter app_guid */ + + + /* Parameter app_guid */ + +/* 3526 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3528 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3530 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ + + /* Parameter cmd_id */ + + + /* Parameter cmd_id */ + +/* 3532 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3534 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3536 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ + + /* Parameter caller_proc_id */ + + + /* Parameter caller_proc_id */ + +/* 3538 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3540 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3542 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -4210,19 +4238,9 @@ /* Parameter proc_handle */ -/* 3518 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3520 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ -/* 3522 */ 0xb9, /* FC_UINT3264 */ - 0x0, /* 0 */ - - /* Parameter stdout_handle */ - - - /* Parameter stdout_handle */ - -/* 3524 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3526 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ -/* 3528 */ 0xb9, /* FC_UINT3264 */ +/* 3544 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3546 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 3548 */ 0xb9, /* FC_UINT3264 */ 0x0, /* 0 */ /* Return value */ @@ -4230,9 +4248,79 @@ /* Return value */ -/* 3530 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3532 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ -/* 3534 */ 0x8, /* FC_LONG */ +/* 3550 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3552 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ +/* 3554 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLineEx */ + + + /* Procedure LaunchCmdLineEx */ + +/* 3556 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3558 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3562 */ NdrFcShort( 0x6 ), /* 6 */ +/* 3564 */ NdrFcShort( 0x30 ), /* X64 Stack size/offset = 48 */ +/* 3566 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3568 */ NdrFcShort( 0x5c ), /* 92 */ +/* 3570 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 3572 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3574 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3576 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3578 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3580 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 3582 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3584 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3586 */ NdrFcShort( 0x450 ), /* Type Offset=1104 */ + + /* Parameter server_proc_id */ + + + /* Parameter server_proc_id */ + +/* 3588 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3590 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3592 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter proc_handle */ + + + /* Parameter proc_handle */ + +/* 3594 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3596 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3598 */ 0xb9, /* FC_UINT3264 */ + 0x0, /* 0 */ + + /* Parameter stdout_handle */ + + + /* Parameter stdout_handle */ + +/* 3600 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3602 */ NdrFcShort( 0x20 ), /* X64 Stack size/offset = 32 */ +/* 3604 */ 0xb9, /* FC_UINT3264 */ + 0x0, /* 0 */ + + /* Return value */ + + + /* Return value */ + +/* 3606 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3608 */ NdrFcShort( 0x28 ), /* X64 Stack size/offset = 40 */ +/* 3610 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ 0x0 @@ -6906,15 +6994,253 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2194, + 2232, + 2276, + 2314, + 2352, + 2390, + 2428, + 2466, + 2504, + 2548, + 2592, + 2636, + 2680, + 3254, + 3342 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2724, + 2762, + 2806, + 2844, + 2882, + 2920, + 2958, + 2996, + 3034, + 3078, + 3122, + 3166, + 3210, + 3298, + 3380 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 3342, - 3380, - 3424 + 3418, + 3456, + 3500 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -6966,9 +7292,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 3342, - 3380, - 3424 + 3418, + 3456, + 3500 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -7020,10 +7346,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 3342, - 3380, - 3424, - 3480 + 3418, + 3456, + 3500, + 3556 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -7076,10 +7402,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 3342, - 3380, - 3424, - 3480 + 3418, + 3456, + 3500, + 3556 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -7165,6 +7491,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusSystemProxyVtbl, @@ -7178,6 +7505,7 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, @@ -7194,6 +7522,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusSystemStubVtbl, @@ -7207,6 +7536,7 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, @@ -7223,6 +7553,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IGoogleUpdate3Web", "IPolicyStatusSystem", @@ -7236,6 +7567,7 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatusValue", @@ -7252,6 +7584,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -7268,6 +7601,7 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -7278,12 +7612,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 24, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 26, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 24, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 26, *pIndex ) } @@ -7294,7 +7628,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_system_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_system_BaseIIDList, & _updater_legacy_idl_system_IID_Lookup, - 24, + 26, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.h index f48fde5..0bb8293 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + #ifndef __GoogleUpdate3WebUserClass_FWD_DEFINED__ #define __GoogleUpdate3WebUserClass_FWD_DEFINED__ @@ -405,6 +419,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" @@ -5154,6 +5182,570 @@ #endif /* __IPolicyStatus3User_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + #ifndef __UpdaterLegacyLib_LIBRARY_DEFINED__ #define __UpdaterLegacyLib_LIBRARY_DEFINED__ @@ -5182,6 +5774,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.tlb index 9b523e5..2376e01e 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_i.c index 43a1c24..fdbfdd8 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3User,0xBC39E1E1,0xE8FA,0x4E72,0x90,0x3F,0x3B,0xF3,0x46,0xE7,0xE1,0x65); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + MIDL_DEFINE_GUID(IID, LIBID_UpdaterLegacyLib,0x7A1FDE1F,0xAAA9,0x441B,0xB9,0xAA,0x95,0xB3,0x1D,0x78,0x59,0x2B);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_p.c index 47dc137b..d65d2e23 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x64/updater_legacy_idl_user_p.c
@@ -47,7 +47,7 @@ #include "updater_legacy_idl_user.h" #define TYPE_FORMAT_STRING_SIZE 1103 -#define PROC_FORMAT_STRING_SIZE 3343 +#define PROC_FORMAT_STRING_SIZE 3419 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -393,6 +393,32 @@ extern const MIDL_SERVER_INFO IPolicyStatus3User_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus3User_ProxyInfo; +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[ WIRE_MARSHAL_TABLE_SIZE ]; @@ -3954,6 +3980,68 @@ /* 3340 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3342 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3344 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3348 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3350 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3352 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3354 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3356 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3358 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3360 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3362 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3364 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3366 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter value */ + +/* 3368 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3370 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3372 */ NdrFcShort( 0x41e ), /* Type Offset=1054 */ + + /* Return value */ + +/* 3374 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3376 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3378 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3380 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3382 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3386 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3388 */ NdrFcShort( 0x18 ), /* X64 Stack size/offset = 24 */ +/* 3390 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3392 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3394 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3396 */ 0xa, /* 10 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3398 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3400 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3402 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3404 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter value */ + +/* 3406 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3408 */ NdrFcShort( 0x8 ), /* X64 Stack size/offset = 8 */ +/* 3410 */ NdrFcShort( 0x438 ), /* Type Offset=1080 */ + + /* Return value */ + +/* 3412 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3414 */ NdrFcShort( 0x10 ), /* X64 Stack size/offset = 16 */ +/* 3416 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + 0x0 } }; @@ -6615,6 +6703,244 @@ CStdStubBuffer_DELEGATING_METHODS }; + +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2194, + 2232, + 2276, + 2314, + 2352, + 2390, + 2428, + 2466, + 2504, + 2548, + 2592, + 2636, + 2680, + 3254, + 3342 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2156, + 898, + 2724, + 2762, + 2806, + 2844, + 2882, + 2920, + 2958, + 2996, + 3034, + 3078, + 3122, + 3166, + 3210, + 3298, + 3380 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + #ifdef __cplusplus namespace { #endif @@ -6655,6 +6981,7 @@ ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebUserProxyVtbl, @@ -6666,6 +6993,7 @@ ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -6680,6 +7008,7 @@ ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebUserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueUserStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebUserStubVtbl, @@ -6691,6 +7020,7 @@ ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -6705,6 +7035,7 @@ "IGoogleUpdate3WebUser", "IPolicyStatusValueUser", "IAppCommandWeb", + "IPolicyStatus4", "IPolicyStatus2User", "IGoogleUpdate3Web", "IAppCommandWebUser", @@ -6716,6 +7047,7 @@ "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -6742,6 +7074,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -6752,12 +7086,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 20, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 22, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 20, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 22, *pIndex ) } @@ -6768,7 +7102,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_user_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_user_BaseIIDList, & _updater_legacy_idl_user_IID_Lookup, - 20, + 22, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.h index 4db7f510..d86399b 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.h
@@ -263,6 +263,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -573,6 +594,27 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -7701,6 +7743,852 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -8209,6 +9097,9 @@ + + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.tlb index dbf051c..0da82369 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_i.c index 6124725b..a5838a5 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_i.c
@@ -157,6 +157,15 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_p.c index b2fccc1..a3633fc 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_p.c
@@ -49,8 +49,8 @@ #include "updater_legacy_idl.h" -#define TYPE_FORMAT_STRING_SIZE 1197 -#define PROC_FORMAT_STRING_SIZE 3907 +#define TYPE_FORMAT_STRING_SIZE 1219 +#define PROC_FORMAT_STRING_SIZE 4015 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -536,6 +536,45 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -5178,19 +5217,16 @@ /* 3718 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3720 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3722 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3726 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3726 */ NdrFcShort( 0x18 ), /* 24 */ /* 3728 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ /* 3730 */ NdrFcShort( 0x0 ), /* 0 */ /* 3732 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3734 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3734 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 3736 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ @@ -5198,17 +5234,11 @@ /* 3740 */ NdrFcShort( 0x0 ), /* 0 */ /* 3742 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 3744 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3744 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3746 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3748 */ NdrFcShort( 0x4aa ), /* Type Offset=1194 */ - - /* Return value */ - +/* 3748 */ NdrFcShort( 0x492 ), /* Type Offset=1170 */ /* Return value */ @@ -5217,181 +5247,143 @@ /* 3754 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3756 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3758 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3762 */ NdrFcShort( 0x4 ), /* 4 */ -/* 3764 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3766 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3762 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3764 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3766 */ NdrFcShort( 0x0 ), /* 0 */ /* 3768 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3770 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 3770 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 3772 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ /* 3774 */ NdrFcShort( 0x0 ), /* 0 */ /* 3776 */ NdrFcShort( 0x0 ), /* 0 */ /* 3778 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 3780 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3780 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3782 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3784 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3784 */ NdrFcShort( 0x4a8 ), /* Type Offset=1192 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 3786 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3786 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 3788 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3790 */ NdrFcShort( 0x4aa ), /* Type Offset=1194 */ - - /* Return value */ - - - /* Return value */ - -/* 3792 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3794 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ -/* 3796 */ 0x8, /* FC_LONG */ +/* 3790 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdElevated */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ - - /* Procedure LaunchCmdElevated */ - -/* 3798 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3792 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3800 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3804 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3806 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ -/* 3808 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3810 */ NdrFcShort( 0x24 ), /* 36 */ -/* 3812 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 3814 */ 0x8, /* 8 */ +/* 3794 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3798 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3800 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3802 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3804 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3806 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3808 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3816 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3818 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3820 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3810 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3812 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3814 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter app_guid */ + /* Parameter value */ + +/* 3816 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3818 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3820 */ NdrFcShort( 0x47c ), /* Type Offset=1148 */ + + /* Return value */ + +/* 3822 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3824 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3826 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLine */ - /* Parameter app_guid */ + /* Procedure LaunchCmdLine */ -/* 3822 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3824 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3826 */ NdrFcShort( 0x4aa ), /* Type Offset=1194 */ - - /* Parameter cmd_id */ - - - /* Parameter cmd_id */ - -/* 3828 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3830 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3832 */ NdrFcShort( 0x4aa ), /* Type Offset=1194 */ - - /* Parameter caller_proc_id */ - - - /* Parameter caller_proc_id */ - -/* 3834 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3828 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3830 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3834 */ NdrFcShort( 0x3 ), /* 3 */ /* 3836 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ -/* 3838 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ - - /* Parameter proc_handle */ - - - /* Parameter proc_handle */ - -/* 3840 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3842 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3844 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ - - /* Return value */ - - - /* Return value */ - -/* 3846 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3848 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ -/* 3850 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ - - /* Procedure LaunchCmdLineEx */ - - - /* Procedure LaunchCmdLineEx */ - -/* 3852 */ 0x33, /* FC_AUTO_HANDLE */ - 0x6c, /* Old Flags: object, Oi2 */ -/* 3854 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3858 */ NdrFcShort( 0x6 ), /* 6 */ -/* 3860 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ -/* 3862 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3864 */ NdrFcShort( 0x5c ), /* 92 */ -/* 3866 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x5, /* 5 */ -/* 3868 */ 0x8, /* 8 */ +/* 3838 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3840 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3842 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3844 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3870 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3872 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3874 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3846 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3848 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3850 */ NdrFcShort( 0x0 ), /* 0 */ /* Parameter cmd_line */ /* Parameter cmd_line */ -/* 3876 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3878 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3880 */ NdrFcShort( 0x4aa ), /* Type Offset=1194 */ +/* 3852 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3854 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3856 */ NdrFcShort( 0x4c0 ), /* Type Offset=1216 */ - /* Parameter server_proc_id */ + /* Return value */ - /* Parameter server_proc_id */ + /* Return value */ -/* 3882 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3884 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3886 */ 0x8, /* FC_LONG */ +/* 3858 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3860 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3862 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Parameter proc_handle */ + /* Procedure LaunchBrowser */ - /* Parameter proc_handle */ + /* Procedure LaunchBrowser */ -/* 3888 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3890 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3864 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3866 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3870 */ NdrFcShort( 0x4 ), /* 4 */ +/* 3872 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 3874 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3876 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3878 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 3880 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3882 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3884 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3886 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter browser_type */ + + + /* Parameter browser_type */ + +/* 3888 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3890 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ /* 3892 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Parameter stdout_handle */ + /* Parameter url */ - /* Parameter stdout_handle */ + /* Parameter url */ -/* 3894 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3896 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3898 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3894 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3896 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3898 */ NdrFcShort( 0x4c0 ), /* Type Offset=1216 */ /* Return value */ @@ -5399,10 +5391,147 @@ /* Return value */ /* 3900 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3902 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ +/* 3902 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ /* 3904 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ + /* Procedure LaunchCmdElevated */ + + + /* Procedure LaunchCmdElevated */ + +/* 3906 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3908 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3912 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3914 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ +/* 3916 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3918 */ NdrFcShort( 0x24 ), /* 36 */ +/* 3920 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 3922 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3924 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3926 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3928 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter app_guid */ + + + /* Parameter app_guid */ + +/* 3930 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3932 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3934 */ NdrFcShort( 0x4c0 ), /* Type Offset=1216 */ + + /* Parameter cmd_id */ + + + /* Parameter cmd_id */ + +/* 3936 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3938 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3940 */ NdrFcShort( 0x4c0 ), /* Type Offset=1216 */ + + /* Parameter caller_proc_id */ + + + /* Parameter caller_proc_id */ + +/* 3942 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3944 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3946 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter proc_handle */ + + + /* Parameter proc_handle */ + +/* 3948 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3950 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 3952 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + + + /* Return value */ + +/* 3954 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3956 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ +/* 3958 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLineEx */ + + + /* Procedure LaunchCmdLineEx */ + +/* 3960 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3962 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3966 */ NdrFcShort( 0x6 ), /* 6 */ +/* 3968 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ +/* 3970 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3972 */ NdrFcShort( 0x5c ), /* 92 */ +/* 3974 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x5, /* 5 */ +/* 3976 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3978 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3980 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3982 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 3984 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3986 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3988 */ NdrFcShort( 0x4c0 ), /* Type Offset=1216 */ + + /* Parameter server_proc_id */ + + + /* Parameter server_proc_id */ + +/* 3990 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3992 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3994 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter proc_handle */ + + + /* Parameter proc_handle */ + +/* 3996 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3998 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 4000 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter stdout_handle */ + + + /* Parameter stdout_handle */ + +/* 4002 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 4004 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 4006 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Return value */ + + + /* Return value */ + +/* 4008 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 4010 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ +/* 4012 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + 0x0 } }; @@ -6230,8 +6359,25 @@ /* 1190 */ 0xcc, /* 204 */ 0xbb, /* 187 */ /* 1192 */ + 0x11, 0x10, /* FC_RP [pointer_deref] */ +/* 1194 */ NdrFcShort( 0x2 ), /* Offset= 2 (1196) */ +/* 1196 */ + 0x2f, /* FC_IP */ + 0x5a, /* FC_CONSTANT_IID */ +/* 1198 */ NdrFcLong( 0x7e0a6b39 ), /* 2114612025 */ +/* 1202 */ NdrFcShort( 0x7ceb ), /* 31979 */ +/* 1204 */ NdrFcShort( 0x4944 ), /* 18756 */ +/* 1206 */ 0xab, /* 171 */ + 0xfa, /* 250 */ +/* 1208 */ 0xf4, /* 244 */ + 0x19, /* 25 */ +/* 1210 */ 0xd2, /* 210 */ + 0x1, /* 1 */ +/* 1212 */ 0xd6, /* 214 */ + 0xa0, /* 160 */ +/* 1214 */ 0x11, 0x8, /* FC_RP [simple_pointer] */ -/* 1194 */ +/* 1216 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ @@ -9119,15 +9265,372 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2082, + 2118, + 2160, + 2196, + 2232, + 2268, + 2304, + 2340, + 2376, + 2418, + 2460, + 2502, + 2544, + 3594, + 3720 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2586, + 2622, + 2664, + 2700, + 2736, + 2772, + 2808, + 2844, + 2880, + 2922, + 2964, + 3006, + 3048, + 3636, + 3756 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 3090, + 3126, + 3168, + 3204, + 3240, + 3276, + 3312, + 3348, + 3384, + 3426, + 3468, + 3510, + 3552, + 3678, + 3792 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 3720, - 3756, - 3798 + 3828, + 3864, + 3906 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -9179,9 +9682,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 3720, - 3756, - 3798 + 3828, + 3864, + 3906 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -9233,10 +9736,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 3720, - 3756, - 3798, - 3852 + 3828, + 3864, + 3906, + 3960 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -9289,10 +9792,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 3720, - 3756, - 3798, - 3852 + 3828, + 3864, + 3906, + 3960 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -9384,6 +9887,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, @@ -9399,10 +9903,12 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -9423,6 +9929,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, @@ -9438,10 +9945,12 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -9462,6 +9971,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IPolicyStatus2User", "IGoogleUpdate3Web", @@ -9477,10 +9987,12 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -9501,6 +10013,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -9521,6 +10034,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -9531,13 +10046,13 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 34, 32 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl, 37, 32 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 34, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl, 37, *pIndex ) } @@ -9548,7 +10063,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_BaseIIDList, & _updater_legacy_idl_IID_Lookup, - 34, + 37, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.h index 10816fee1..35cf416c 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -433,6 +447,20 @@ #endif /* __IPolicyStatus3System_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_FWD_DEFINED__ +#define __IPolicyStatus4System_FWD_DEFINED__ +typedef interface IPolicyStatus4System IPolicyStatus4System; + +#endif /* __IPolicyStatus4System_FWD_DEFINED__ */ + + #ifndef __IProcessLauncher_FWD_DEFINED__ #define __IProcessLauncher_FWD_DEFINED__ typedef interface IProcessLauncher IProcessLauncher; @@ -5210,6 +5238,570 @@ #endif /* __IPolicyStatus3System_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4System_INTERFACE_DEFINED__ +#define __IPolicyStatus4System_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4System */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4System; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("423FDEC3-0DBC-441E-B51D-FD8B82B9DCF2") + IPolicyStatus4System : public IPolicyStatus3System + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueSystem **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4SystemVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4System * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4System * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4System * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4System * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4System * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4System * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4System * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4System * This, + /* [out] */ IPolicyStatusValueSystem **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2System, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4System * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3System, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4System * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4System, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4System * This, + /* [retval][out] */ IPolicyStatusValueSystem **value); + + END_INTERFACE + } IPolicyStatus4SystemVtbl; + + interface IPolicyStatus4System + { + CONST_VTBL struct IPolicyStatus4SystemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4System_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4System_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4System_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4System_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4System_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4System_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4System_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4System_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4System_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4System_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4System_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4System_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4System_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4System_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4System_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4System_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4System_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4System_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4System_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4System_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4System_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4System_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4System_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4System_INTERFACE_DEFINED__ */ + + #ifndef __IProcessLauncher_INTERFACE_DEFINED__ #define __IProcessLauncher_INTERFACE_DEFINED__ @@ -5708,6 +6300,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.tlb index 8284c42..40e091c 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_i.c index 31848e8..65d66fa1 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3System,0x7B26CC23,0xB2B8,0x441B,0xAA,0x9C,0x8B,0x55,0x1A,0xBB,0x61,0x1B); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4System,0x423FDEC3,0x0DBC,0x441E,0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2); + + MIDL_DEFINE_GUID(IID, IID_IProcessLauncher,0x4779D540,0xF6A3,0x455F,0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_p.c index 3beb5c42..ab686e4 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_system_p.c
@@ -50,7 +50,7 @@ #include "updater_legacy_idl_system.h" #define TYPE_FORMAT_STRING_SIZE 1153 -#define PROC_FORMAT_STRING_SIZE 3361 +#define PROC_FORMAT_STRING_SIZE 3433 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -406,6 +406,32 @@ #endif +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + extern const MIDL_SERVER_INFO IProcessLauncher_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo; @@ -3933,19 +3959,16 @@ /* 3172 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchCmdLine */ - - - /* Procedure LaunchCmdLine */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3174 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3176 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3180 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3180 */ NdrFcShort( 0x18 ), /* 24 */ /* 3182 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ /* 3184 */ NdrFcShort( 0x0 ), /* 0 */ /* 3186 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3188 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3188 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ 0x2, /* 2 */ /* 3190 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ @@ -3953,17 +3976,11 @@ /* 3194 */ NdrFcShort( 0x0 ), /* 0 */ /* 3196 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter cmd_line */ + /* Parameter value */ - - /* Parameter cmd_line */ - -/* 3198 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3198 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3200 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3202 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ - - /* Return value */ - +/* 3202 */ NdrFcShort( 0x44c ), /* Type Offset=1100 */ /* Return value */ @@ -3972,53 +3989,122 @@ /* 3208 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ - /* Procedure LaunchBrowser */ - - - /* Procedure LaunchBrowser */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ /* 3210 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ /* 3212 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3216 */ NdrFcShort( 0x4 ), /* 4 */ -/* 3218 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3220 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3216 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3218 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3220 */ NdrFcShort( 0x0 ), /* 0 */ /* 3222 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3224 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ - 0x3, /* 3 */ +/* 3224 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ /* 3226 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ /* 3228 */ NdrFcShort( 0x0 ), /* 0 */ /* 3230 */ NdrFcShort( 0x0 ), /* 0 */ /* 3232 */ NdrFcShort( 0x0 ), /* 0 */ - /* Parameter browser_type */ + /* Parameter value */ - - /* Parameter browser_type */ - -/* 3234 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3234 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ /* 3236 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3238 */ 0x8, /* FC_LONG */ - 0x0, /* 0 */ +/* 3238 */ NdrFcShort( 0x466 ), /* Type Offset=1126 */ - /* Parameter url */ + /* Return value */ - - /* Parameter url */ - -/* 3240 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3240 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ /* 3242 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3244 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ +/* 3244 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchCmdLine */ + + + /* Procedure LaunchCmdLine */ + +/* 3246 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3248 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3252 */ NdrFcShort( 0x3 ), /* 3 */ +/* 3254 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3256 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3258 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3260 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3262 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3264 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3266 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3268 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter cmd_line */ + + + /* Parameter cmd_line */ + +/* 3270 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3272 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3274 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ /* Return value */ /* Return value */ -/* 3246 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3248 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ -/* 3250 */ 0x8, /* FC_LONG */ +/* 3276 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3278 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3280 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure LaunchBrowser */ + + + /* Procedure LaunchBrowser */ + +/* 3282 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3284 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3288 */ NdrFcShort( 0x4 ), /* 4 */ +/* 3290 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 3292 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3294 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3296 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ + 0x3, /* 3 */ +/* 3298 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3300 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3302 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3304 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter browser_type */ + + + /* Parameter browser_type */ + +/* 3306 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3308 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3310 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Parameter url */ + + + /* Parameter url */ + +/* 3312 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3314 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3316 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ + + /* Return value */ + + + /* Return value */ + +/* 3318 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3320 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3322 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdElevated */ @@ -4026,47 +4112,47 @@ /* Procedure LaunchCmdElevated */ -/* 3252 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3324 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3254 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3258 */ NdrFcShort( 0x5 ), /* 5 */ -/* 3260 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ -/* 3262 */ NdrFcShort( 0x8 ), /* 8 */ -/* 3264 */ NdrFcShort( 0x24 ), /* 36 */ -/* 3266 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3326 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3330 */ NdrFcShort( 0x5 ), /* 5 */ +/* 3332 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ +/* 3334 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3336 */ NdrFcShort( 0x24 ), /* 36 */ +/* 3338 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 3268 */ 0x8, /* 8 */ +/* 3340 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3270 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3272 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3274 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3342 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3344 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3346 */ NdrFcShort( 0x0 ), /* 0 */ /* Parameter app_guid */ /* Parameter app_guid */ -/* 3276 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3278 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3280 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ +/* 3348 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3350 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3352 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ /* Parameter cmd_id */ /* Parameter cmd_id */ -/* 3282 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3284 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3286 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ +/* 3354 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3356 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3358 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ /* Parameter caller_proc_id */ /* Parameter caller_proc_id */ -/* 3288 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ -/* 3290 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ -/* 3292 */ 0x8, /* FC_LONG */ +/* 3360 */ NdrFcShort( 0x48 ), /* Flags: in, base type, */ +/* 3362 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3364 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -4074,9 +4160,9 @@ /* Parameter proc_handle */ -/* 3294 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3296 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3298 */ 0x8, /* FC_LONG */ +/* 3366 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3368 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 3370 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Return value */ @@ -4084,9 +4170,9 @@ /* Return value */ -/* 3300 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3302 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ -/* 3304 */ 0x8, /* FC_LONG */ +/* 3372 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3374 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ +/* 3376 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Procedure LaunchCmdLineEx */ @@ -4094,38 +4180,38 @@ /* Procedure LaunchCmdLineEx */ -/* 3306 */ 0x33, /* FC_AUTO_HANDLE */ +/* 3378 */ 0x33, /* FC_AUTO_HANDLE */ 0x6c, /* Old Flags: object, Oi2 */ -/* 3308 */ NdrFcLong( 0x0 ), /* 0 */ -/* 3312 */ NdrFcShort( 0x6 ), /* 6 */ -/* 3314 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ -/* 3316 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3318 */ NdrFcShort( 0x5c ), /* 92 */ -/* 3320 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ +/* 3380 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3384 */ NdrFcShort( 0x6 ), /* 6 */ +/* 3386 */ NdrFcShort( 0x18 ), /* x86 Stack size/offset = 24 */ +/* 3388 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3390 */ NdrFcShort( 0x5c ), /* 92 */ +/* 3392 */ 0x46, /* Oi2 Flags: clt must size, has return, has ext, */ 0x5, /* 5 */ -/* 3322 */ 0x8, /* 8 */ +/* 3394 */ 0x8, /* 8 */ 0x1, /* Ext Flags: new corr desc, */ -/* 3324 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3326 */ NdrFcShort( 0x0 ), /* 0 */ -/* 3328 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3396 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3398 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3400 */ NdrFcShort( 0x0 ), /* 0 */ /* Parameter cmd_line */ /* Parameter cmd_line */ -/* 3330 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ -/* 3332 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ -/* 3334 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ +/* 3402 */ NdrFcShort( 0x10b ), /* Flags: must size, must free, in, simple ref, */ +/* 3404 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3406 */ NdrFcShort( 0x47e ), /* Type Offset=1150 */ /* Parameter server_proc_id */ /* Parameter server_proc_id */ -/* 3336 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3338 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ -/* 3340 */ 0x8, /* FC_LONG */ +/* 3408 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3410 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3412 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter proc_handle */ @@ -4133,9 +4219,9 @@ /* Parameter proc_handle */ -/* 3342 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3344 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ -/* 3346 */ 0x8, /* FC_LONG */ +/* 3414 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3416 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3418 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Parameter stdout_handle */ @@ -4143,9 +4229,9 @@ /* Parameter stdout_handle */ -/* 3348 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ -/* 3350 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ -/* 3352 */ 0x8, /* FC_LONG */ +/* 3420 */ NdrFcShort( 0x2150 ), /* Flags: out, base type, simple ref, srv alloc size=8 */ +/* 3422 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */ +/* 3424 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ /* Return value */ @@ -4153,9 +4239,9 @@ /* Return value */ -/* 3354 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ -/* 3356 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ -/* 3358 */ 0x8, /* FC_LONG */ +/* 3426 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3428 */ NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */ +/* 3430 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ 0x0 @@ -6893,15 +6979,253 @@ }; +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2082, + 2118, + 2160, + 2196, + 2232, + 2268, + 2304, + 2340, + 2376, + 2418, + 2460, + 2502, + 2544, + 3090, + 3174 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4System, ver. 0.0, + GUID={0x423FDEC3,0x0DBC,0x441E,{0xB5,0x1D,0xFD,0x8B,0x82,0xB9,0xDC,0xF2}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4System_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2586, + 2622, + 2664, + 2700, + 2736, + 2772, + 2808, + 2844, + 2880, + 2922, + 2964, + 3006, + 3048, + 3132, + 3210 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4System_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4System_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_system__MIDL_ProcFormatString.Format, + &IPolicyStatus4System_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4SystemProxyVtbl = +{ + &IPolicyStatus4System_ProxyInfo, + &IID_IPolicyStatus4System, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2System::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3System::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4System::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4System_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4SystemStubVtbl = +{ + &IID_IPolicyStatus4System, + &IPolicyStatus4System_ServerInfo, + 25, + &IPolicyStatus4System_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + /* Object interface: IProcessLauncher, ver. 0.0, GUID={0x4779D540,0xF6A3,0x455F,{0xA9,0x29,0x7A,0xDF,0xE8,0x5B,0x6F,0x09}} */ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher_FormatStringOffsetTable[] = { - 3174, - 3210, - 3252 + 3246, + 3282, + 3324 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher_ProxyInfo = @@ -6953,9 +7277,9 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncherSystem_FormatStringOffsetTable[] = { - 3174, - 3210, - 3252 + 3246, + 3282, + 3324 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncherSystem_ProxyInfo = @@ -7007,10 +7331,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2_FormatStringOffsetTable[] = { - 3174, - 3210, - 3252, - 3306 + 3246, + 3282, + 3324, + 3378 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2_ProxyInfo = @@ -7063,10 +7387,10 @@ #pragma code_seg(".orpc") static const unsigned short IProcessLauncher2System_FormatStringOffsetTable[] = { - 3174, - 3210, - 3252, - 3306 + 3246, + 3282, + 3324, + 3378 }; static const MIDL_STUBLESS_PROXY_INFO IProcessLauncher2System_ProxyInfo = @@ -7152,6 +7476,7 @@ ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncherSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IProcessLauncher2SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusSystemProxyVtbl, @@ -7165,6 +7490,7 @@ ( CInterfaceProxyVtbl *) &_IProcessLauncher2ProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebProxyVtbl, ( CInterfaceProxyVtbl *) &_ICurrentStateSystemProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4SystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebSystemProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, @@ -7181,6 +7507,7 @@ ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherStubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncherSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IProcessLauncher2SystemStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusSystemStubVtbl, @@ -7194,6 +7521,7 @@ ( CInterfaceStubVtbl *) &_IProcessLauncher2StubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebStubVtbl, ( CInterfaceStubVtbl *) &_ICurrentStateSystemStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4SystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebSystemStubVtbl, ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, @@ -7210,6 +7538,7 @@ "IAppCommandWeb", "IProcessLauncher", "IProcessLauncherSystem", + "IPolicyStatus4", "IProcessLauncher2System", "IGoogleUpdate3Web", "IPolicyStatusSystem", @@ -7223,6 +7552,7 @@ "IProcessLauncher2", "IAppBundleWeb", "ICurrentStateSystem", + "IPolicyStatus4System", "IAppCommandWebSystem", "IAppWeb", "IPolicyStatusValue", @@ -7239,6 +7569,7 @@ &IID_IDispatch, 0, 0, + &IID_IDispatch, 0, &IID_IDispatch, &IID_IDispatch, @@ -7255,6 +7586,7 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -7265,12 +7597,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 24, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_system, 26, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_system, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 24, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_system, 26, *pIndex ) } @@ -7281,7 +7613,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_system_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_system_BaseIIDList, & _updater_legacy_idl_system_IID_Lookup, - 24, + 26, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.h b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.h index b33785e..f27ac4a9 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.h +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.h
@@ -193,6 +193,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + #ifndef __GoogleUpdate3WebUserClass_FWD_DEFINED__ #define __GoogleUpdate3WebUserClass_FWD_DEFINED__ @@ -405,6 +419,20 @@ #endif /* __IPolicyStatus3User_FWD_DEFINED__ */ +#ifndef __IPolicyStatus4_FWD_DEFINED__ +#define __IPolicyStatus4_FWD_DEFINED__ +typedef interface IPolicyStatus4 IPolicyStatus4; + +#endif /* __IPolicyStatus4_FWD_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_FWD_DEFINED__ +#define __IPolicyStatus4User_FWD_DEFINED__ +typedef interface IPolicyStatus4User IPolicyStatus4User; + +#endif /* __IPolicyStatus4User_FWD_DEFINED__ */ + + /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" @@ -5154,6 +5182,570 @@ #endif /* __IPolicyStatus3User_INTERFACE_DEFINED__ */ +#ifndef __IPolicyStatus4_INTERFACE_DEFINED__ +#define __IPolicyStatus4_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4 */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C07BC046-32E0-4184-BC9F-13C4533C24AC") + IPolicyStatus4 : public IPolicyStatus3 + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValue **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4 * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4 * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4 * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4 * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4 * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4 * This, + /* [out] */ IPolicyStatusValue **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4 * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4 * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValue **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4 * This, + /* [retval][out] */ IPolicyStatusValue **value); + + END_INTERFACE + } IPolicyStatus4Vtbl; + + interface IPolicyStatus4 + { + CONST_VTBL struct IPolicyStatus4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4_INTERFACE_DEFINED__ */ + + +#ifndef __IPolicyStatus4User_INTERFACE_DEFINED__ +#define __IPolicyStatus4User_INTERFACE_DEFINED__ + +/* interface IPolicyStatus4User */ +/* [unique][helpstring][uuid][dual][object] */ + + +EXTERN_C const IID IID_IPolicyStatus4User; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F6696F3-7F48-446B-97FA-6B34EC2ADB32") + IPolicyStatus4User : public IPolicyStatus3User + { + public: + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cloudPolicyOverridesPlatformPolicy( + /* [retval][out] */ IPolicyStatusValueUser **value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct IPolicyStatus4UserVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfoCount) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IPolicyStatus4User * This, + /* [out] */ UINT *pctinfo); + + DECLSPEC_XFGVIRT(IDispatch, GetTypeInfo) + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IPolicyStatus4User * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + DECLSPEC_XFGVIRT(IDispatch, GetIDsOfNames) + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IPolicyStatus4User * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [range][in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + DECLSPEC_XFGVIRT(IDispatch, Invoke) + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IPolicyStatus4User * This, + /* [annotation][in] */ + _In_ DISPID dispIdMember, + /* [annotation][in] */ + _In_ REFIID riid, + /* [annotation][in] */ + _In_ LCID lcid, + /* [annotation][in] */ + _In_ WORD wFlags, + /* [annotation][out][in] */ + _In_ DISPPARAMS *pDispParams, + /* [annotation][out] */ + _Out_opt_ VARIANT *pVarResult, + /* [annotation][out] */ + _Out_opt_ EXCEPINFO *pExcepInfo, + /* [annotation][out] */ + _Out_opt_ UINT *puArgErr); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updaterVersion) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updaterVersion )( + IPolicyStatus4User * This, + /* [retval][out] */ BSTR *version); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckedTime) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckedTime )( + IPolicyStatus4User * This, + /* [retval][out] */ DATE *last_checked); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, refreshPolicies) + HRESULT ( STDMETHODCALLTYPE *refreshPolicies )( + IPolicyStatus4User * This); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_lastCheckPeriodMinutes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastCheckPeriodMinutes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_updatesSuppressedTimes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_updatesSuppressedTimes )( + IPolicyStatus4User * This, + /* [out] */ IPolicyStatusValueUser **value, + VARIANT_BOOL *are_updates_suppressed); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_downloadPreferenceGroupPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_downloadPreferenceGroupPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheSizeLimitMBytes) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheSizeLimitMBytes )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_packageCacheExpirationTimeDays) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_packageCacheExpirationTimeDays )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyMode) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyMode )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyPacUrl) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyPacUrl )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_proxyServer) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_proxyServer )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppInstalls) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppInstalls )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_effectivePolicyForAppUpdates) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_effectivePolicyForAppUpdates )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetVersionPrefix) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetVersionPrefix )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_isRollbackToTargetVersionAllowed) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_isRollbackToTargetVersionAllowed )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus2User, get_targetChannel) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_targetChannel )( + IPolicyStatus4User * This, + /* [in] */ BSTR app_id, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus3User, get_forceInstallApps) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_forceInstallApps )( + IPolicyStatus4User * This, + /* [in] */ VARIANT_BOOL is_machine, + /* [retval][out] */ IPolicyStatusValueUser **value); + + DECLSPEC_XFGVIRT(IPolicyStatus4User, get_cloudPolicyOverridesPlatformPolicy) + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_cloudPolicyOverridesPlatformPolicy )( + IPolicyStatus4User * This, + /* [retval][out] */ IPolicyStatusValueUser **value); + + END_INTERFACE + } IPolicyStatus4UserVtbl; + + interface IPolicyStatus4User + { + CONST_VTBL struct IPolicyStatus4UserVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IPolicyStatus4User_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IPolicyStatus4User_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IPolicyStatus4User_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IPolicyStatus4User_GetTypeInfoCount(This,pctinfo) \ + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + +#define IPolicyStatus4User_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + +#define IPolicyStatus4User_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + +#define IPolicyStatus4User_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + + +#define IPolicyStatus4User_get_updaterVersion(This,version) \ + ( (This)->lpVtbl -> get_updaterVersion(This,version) ) + +#define IPolicyStatus4User_get_lastCheckedTime(This,last_checked) \ + ( (This)->lpVtbl -> get_lastCheckedTime(This,last_checked) ) + +#define IPolicyStatus4User_refreshPolicies(This) \ + ( (This)->lpVtbl -> refreshPolicies(This) ) + +#define IPolicyStatus4User_get_lastCheckPeriodMinutes(This,value) \ + ( (This)->lpVtbl -> get_lastCheckPeriodMinutes(This,value) ) + +#define IPolicyStatus4User_get_updatesSuppressedTimes(This,value,are_updates_suppressed) \ + ( (This)->lpVtbl -> get_updatesSuppressedTimes(This,value,are_updates_suppressed) ) + +#define IPolicyStatus4User_get_downloadPreferenceGroupPolicy(This,value) \ + ( (This)->lpVtbl -> get_downloadPreferenceGroupPolicy(This,value) ) + +#define IPolicyStatus4User_get_packageCacheSizeLimitMBytes(This,value) \ + ( (This)->lpVtbl -> get_packageCacheSizeLimitMBytes(This,value) ) + +#define IPolicyStatus4User_get_packageCacheExpirationTimeDays(This,value) \ + ( (This)->lpVtbl -> get_packageCacheExpirationTimeDays(This,value) ) + +#define IPolicyStatus4User_get_proxyMode(This,value) \ + ( (This)->lpVtbl -> get_proxyMode(This,value) ) + +#define IPolicyStatus4User_get_proxyPacUrl(This,value) \ + ( (This)->lpVtbl -> get_proxyPacUrl(This,value) ) + +#define IPolicyStatus4User_get_proxyServer(This,value) \ + ( (This)->lpVtbl -> get_proxyServer(This,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppInstalls(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppInstalls(This,app_id,value) ) + +#define IPolicyStatus4User_get_effectivePolicyForAppUpdates(This,app_id,value) \ + ( (This)->lpVtbl -> get_effectivePolicyForAppUpdates(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetVersionPrefix(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetVersionPrefix(This,app_id,value) ) + +#define IPolicyStatus4User_get_isRollbackToTargetVersionAllowed(This,app_id,value) \ + ( (This)->lpVtbl -> get_isRollbackToTargetVersionAllowed(This,app_id,value) ) + +#define IPolicyStatus4User_get_targetChannel(This,app_id,value) \ + ( (This)->lpVtbl -> get_targetChannel(This,app_id,value) ) + + +#define IPolicyStatus4User_get_forceInstallApps(This,is_machine,value) \ + ( (This)->lpVtbl -> get_forceInstallApps(This,is_machine,value) ) + + +#define IPolicyStatus4User_get_cloudPolicyOverridesPlatformPolicy(This,value) \ + ( (This)->lpVtbl -> get_cloudPolicyOverridesPlatformPolicy(This,value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IPolicyStatus4User_INTERFACE_DEFINED__ */ + + #ifndef __UpdaterLegacyLib_LIBRARY_DEFINED__ #define __UpdaterLegacyLib_LIBRARY_DEFINED__ @@ -5182,6 +5774,8 @@ + + EXTERN_C const IID LIBID_UpdaterLegacyLib; EXTERN_C const CLSID CLSID_GoogleUpdate3WebUserClass;
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.tlb b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.tlb index fa2bc84..6e8489af 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.tlb +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user.tlb Binary files differ
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_i.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_i.c index d630b4c..096ac364 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_i.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_i.c
@@ -127,6 +127,12 @@ MIDL_DEFINE_GUID(IID, IID_IPolicyStatus3User,0xBC39E1E1,0xE8FA,0x4E72,0x90,0x3F,0x3B,0xF3,0x46,0xE7,0xE1,0x65); +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4,0xC07BC046,0x32E0,0x4184,0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC); + + +MIDL_DEFINE_GUID(IID, IID_IPolicyStatus4User,0x0F6696F3,0x7F48,0x446B,0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32); + + MIDL_DEFINE_GUID(IID, LIBID_UpdaterLegacyLib,0x7A1FDE1F,0xAAA9,0x441B,0xB9,0xAA,0x95,0xB3,0x1D,0x78,0x59,0x2B);
diff --git a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_p.c b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_p.c index d6949b0e..aa65a8d3 100644 --- a/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_p.c +++ b/third_party/win_build_output/midl/chrome/updater/app/server/win/x86/updater_legacy_idl_user_p.c
@@ -50,7 +50,7 @@ #include "updater_legacy_idl_user.h" #define TYPE_FORMAT_STRING_SIZE 1149 -#define PROC_FORMAT_STRING_SIZE 3175 +#define PROC_FORMAT_STRING_SIZE 3247 #define EXPR_FORMAT_STRING_SIZE 1 #define TRANSMIT_AS_TABLE_SIZE 0 #define WIRE_MARSHAL_TABLE_SIZE 2 @@ -396,6 +396,32 @@ extern const MIDL_SERVER_INFO IPolicyStatus3User_ServerInfo; extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus3User_ProxyInfo; +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo; + +#ifdef __cplusplus +namespace { +#endif + +extern const MIDL_STUB_DESC Object_StubDesc; +#ifdef __cplusplus +} +#endif + + +extern const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo; +extern const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo; + extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[ WIRE_MARSHAL_TABLE_SIZE ]; @@ -3881,6 +3907,66 @@ /* 3172 */ 0x8, /* FC_LONG */ 0x0, /* 0 */ + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3174 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3176 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3180 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3182 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3184 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3186 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3188 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3190 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3192 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3194 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3196 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter value */ + +/* 3198 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3200 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3202 */ NdrFcShort( 0x44c ), /* Type Offset=1100 */ + + /* Return value */ + +/* 3204 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3206 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3208 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + + /* Procedure get_cloudPolicyOverridesPlatformPolicy */ + +/* 3210 */ 0x33, /* FC_AUTO_HANDLE */ + 0x6c, /* Old Flags: object, Oi2 */ +/* 3212 */ NdrFcLong( 0x0 ), /* 0 */ +/* 3216 */ NdrFcShort( 0x18 ), /* 24 */ +/* 3218 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */ +/* 3220 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3222 */ NdrFcShort( 0x8 ), /* 8 */ +/* 3224 */ 0x45, /* Oi2 Flags: srv must size, has return, has ext, */ + 0x2, /* 2 */ +/* 3226 */ 0x8, /* 8 */ + 0x1, /* Ext Flags: new corr desc, */ +/* 3228 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3230 */ NdrFcShort( 0x0 ), /* 0 */ +/* 3232 */ NdrFcShort( 0x0 ), /* 0 */ + + /* Parameter value */ + +/* 3234 */ NdrFcShort( 0x13 ), /* Flags: must size, must free, out, */ +/* 3236 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */ +/* 3238 */ NdrFcShort( 0x466 ), /* Type Offset=1126 */ + + /* Return value */ + +/* 3240 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */ +/* 3242 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */ +/* 3244 */ 0x8, /* FC_LONG */ + 0x0, /* 0 */ + 0x0 } }; @@ -6610,6 +6696,244 @@ CStdStubBuffer_DELEGATING_METHODS }; + +/* Object interface: IPolicyStatus4, ver. 0.0, + GUID={0xC07BC046,0x32E0,0x4184,{0xBC,0x9F,0x13,0xC4,0x53,0x3C,0x24,0xAC}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2082, + 2118, + 2160, + 2196, + 2232, + 2268, + 2304, + 2340, + 2376, + 2418, + 2460, + 2502, + 2544, + 3090, + 3174 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4ProxyVtbl = +{ + &IPolicyStatus4_ProxyInfo, + &IID_IPolicyStatus4, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4StubVtbl = +{ + &IID_IPolicyStatus4, + &IPolicyStatus4_ServerInfo, + 25, + &IPolicyStatus4_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IPolicyStatus4User, ver. 0.0, + GUID={0x0F6696F3,0x7F48,0x446B,{0x97,0xFA,0x6B,0x34,0xEC,0x2A,0xDB,0x32}} */ + +#pragma code_seg(".orpc") +static const unsigned short IPolicyStatus4User_FormatStringOffsetTable[] = + { + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + (unsigned short) -1, + 0, + 2046, + 852, + 2586, + 2622, + 2664, + 2700, + 2736, + 2772, + 2808, + 2844, + 2880, + 2922, + 2964, + 3006, + 3048, + 3132, + 3210 + }; + +static const MIDL_STUBLESS_PROXY_INFO IPolicyStatus4User_ProxyInfo = + { + &Object_StubDesc, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0 + }; + + +static const MIDL_SERVER_INFO IPolicyStatus4User_ServerInfo = + { + &Object_StubDesc, + 0, + updater_legacy_idl_user__MIDL_ProcFormatString.Format, + &IPolicyStatus4User_FormatStringOffsetTable[-3], + 0, + 0, + 0, + 0}; +CINTERFACE_PROXY_VTABLE(25) _IPolicyStatus4UserProxyVtbl = +{ + &IPolicyStatus4User_ProxyInfo, + &IID_IPolicyStatus4User, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* IDispatch::GetTypeInfoCount */ , + 0 /* IDispatch::GetTypeInfo */ , + 0 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updaterVersion */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckedTime */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::refreshPolicies */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_lastCheckPeriodMinutes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_updatesSuppressedTimes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_downloadPreferenceGroupPolicy */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheSizeLimitMBytes */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_packageCacheExpirationTimeDays */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyMode */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyPacUrl */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_proxyServer */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppInstalls */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_effectivePolicyForAppUpdates */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetVersionPrefix */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_isRollbackToTargetVersionAllowed */ , + (void *) (INT_PTR) -1 /* IPolicyStatus2User::get_targetChannel */ , + (void *) (INT_PTR) -1 /* IPolicyStatus3User::get_forceInstallApps */ , + (void *) (INT_PTR) -1 /* IPolicyStatus4User::get_cloudPolicyOverridesPlatformPolicy */ +}; + + +EXTERN_C DECLSPEC_SELECTANY const PRPC_STUB_FUNCTION IPolicyStatus4User_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2, + NdrStubCall2 +}; + +CInterfaceStubVtbl _IPolicyStatus4UserStubVtbl = +{ + &IID_IPolicyStatus4User, + &IPolicyStatus4User_ServerInfo, + 25, + &IPolicyStatus4User_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + #ifdef __cplusplus namespace { #endif @@ -6650,6 +6974,7 @@ ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueUserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4ProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus2UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IGoogleUpdate3WebProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppCommandWebUserProxyVtbl, @@ -6661,6 +6986,7 @@ ( CInterfaceProxyVtbl *) &_IAppWebProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatus3UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IPolicyStatusValueProxyVtbl, + ( CInterfaceProxyVtbl *) &_IPolicyStatus4UserProxyVtbl, ( CInterfaceProxyVtbl *) &_IAppBundleWebUserProxyVtbl, 0 }; @@ -6675,6 +7001,7 @@ ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebUserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueUserStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4StubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus2UserStubVtbl, ( CInterfaceStubVtbl *) &_IGoogleUpdate3WebStubVtbl, ( CInterfaceStubVtbl *) &_IAppCommandWebUserStubVtbl, @@ -6686,6 +7013,7 @@ ( CInterfaceStubVtbl *) &_IAppWebStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatus3UserStubVtbl, ( CInterfaceStubVtbl *) &_IPolicyStatusValueStubVtbl, + ( CInterfaceStubVtbl *) &_IPolicyStatus4UserStubVtbl, ( CInterfaceStubVtbl *) &_IAppBundleWebUserStubVtbl, 0 }; @@ -6700,6 +7028,7 @@ "IGoogleUpdate3WebUser", "IPolicyStatusValueUser", "IAppCommandWeb", + "IPolicyStatus4", "IPolicyStatus2User", "IGoogleUpdate3Web", "IAppCommandWebUser", @@ -6711,6 +7040,7 @@ "IAppWeb", "IPolicyStatus3User", "IPolicyStatusValue", + "IPolicyStatus4User", "IAppBundleWebUser", 0 }; @@ -6737,6 +7067,8 @@ &IID_IDispatch, &IID_IDispatch, &IID_IDispatch, + &IID_IDispatch, + &IID_IDispatch, 0 }; @@ -6747,12 +7079,12 @@ { IID_BS_LOOKUP_SETUP - IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 20, 16 ) + IID_BS_LOOKUP_INITIAL_TEST( _updater_legacy_idl_user, 22, 16 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 8 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 4 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 2 ) IID_BS_LOOKUP_NEXT_TEST( _updater_legacy_idl_user, 1 ) - IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 20, *pIndex ) + IID_BS_LOOKUP_RETURN_RESULT( _updater_legacy_idl_user, 22, *pIndex ) } @@ -6763,7 +7095,7 @@ (const PCInterfaceName * ) & _updater_legacy_idl_user_InterfaceNamesList, (const IID ** ) & _updater_legacy_idl_user_BaseIIDList, & _updater_legacy_idl_user_IID_Lookup, - 20, + 22, 2, 0, /* table of [async_uuid] interfaces */ 0, /* Filler1 */
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py index 3bc5dca..d516a6b 100644 --- a/tools/json_schema_compiler/cc_generator.py +++ b/tools/json_schema_compiler/cc_generator.py
@@ -1345,7 +1345,7 @@ (c.Append('case %s:' % self._type_helper.GetEnumNoneValue(type_)) .Append(' return "";') .Eblock('}') - .Append('NOTREACHED();') + .Append('NOTREACHED_IN_MIGRATION();') .Append('return "";') .Eblock('}') )
diff --git a/tools/json_schema_compiler/features_cc_generator.py b/tools/json_schema_compiler/features_cc_generator.py index 6d58594..f3e6a657 100644 --- a/tools/json_schema_compiler/features_cc_generator.py +++ b/tools/json_schema_compiler/features_cc_generator.py
@@ -70,7 +70,7 @@ .Append('case kEnumBoundary: break;') .Eblock() .Append('}') - .Append('NOTREACHED();') + .Append('NOTREACHED_IN_MIGRATION();') .Append('return "";') ) (c.Eblock()
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 4faca8b..e1466fff 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -16987,6 +16987,7 @@ <int value="-1886713568" label="AutofillGetPaymentsIdentityFromSync:disabled"/> <int value="-1885548175" label="OmniboxFuzzyUrlSuggestions:enabled"/> + <int value="-1885188914" label="OmniboxAsyncViewInflation:disabled"/> <int value="-1885074774" label="ShelfScrollable:enabled"/> <int value="-1884845660" label="PreferConstantFrameRate:enabled"/> <int value="-1883170077" label="EnableHtmlBaseUsernameDetector:disabled"/> @@ -18274,6 +18275,7 @@ <int value="-1321212159" label="MediaAppAnnotation:enabled"/> <int value="-1319688939" label="ignore-gpu-blacklist"/> <int value="-1318914924" label="OverflowIconsForMediaControls:enabled"/> + <int value="-1317782739" label="OmniboxAsyncViewInflation:enabled"/> <int value="-1317768255" label="PermissionStorageAccessAPI:enabled"/> <int value="-1316769004" label="CrossOriginOpenerPolicyReporting:disabled"/> <int value="-1315631616" label="CustomizeChromeWallpaperSearch:disabled"/>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 74c44a8..542a29c 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -5282,6 +5282,50 @@ </summary> </histogram> +<histogram name="Ash.NotificationResource.ActionIconSizeInKB" units="KB" + expires_after="2024-09-01"> + <owner>andrewxu@chromium.org</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Record the memory size in KB of notification source action icons on the 1.0 + scale factor. Emitted when applying an action icon to a notification built + from a notification resource. + </summary> +</histogram> + +<histogram name="Ash.NotificationResource.BadgeMemorySizeInKB" units="KB" + expires_after="2024-09-01"> + <owner>andrewxu@chromium.org</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Record the memory size in KB of notification source badges on the 1.0 scale + factor. Emitted when applying a badge to a notification built from a + notification resource. + </summary> +</histogram> + +<histogram name="Ash.NotificationResource.IconMemorySizeInKB" units="KB" + expires_after="2024-09-01"> + <owner>andrewxu@chromium.org</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Record the memory size in KB of notification source icons on the 1.0 scale + factor. Emitted when applying an icon to a notification built from a + notification resource. + </summary> +</histogram> + +<histogram name="Ash.NotificationResource.ImageMemorySizeInKB" units="KB" + expires_after="2024-09-01"> + <owner>andrewxu@chromium.org</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Record the memory size in KB of notification source images on the 1.0 scale + factor. Emitted when applying an image to a notification built from a + notification resource. + </summary> +</histogram> + <histogram name="Ash.NotificationView.ConvertSingleToGroup.{Animation}.AnimationSmoothness" units="%" expires_after="2025-02-01">
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 26e26204..a14245e 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -5391,6 +5391,28 @@ </summary> </histogram> +<histogram name="Autofill.TouchToFill.Iban.NumberOfIbansShown" units="ibans" + expires_after="2024-07-21"> + <owner>qihuizhao@google.com</owner> + <owner>jsaul@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + The number of IBANs shown in the Touch To Fill bottom sheet. Recorded when + showing the bottom sheet. + </summary> +</histogram> + +<histogram name="Autofill.TouchToFill.Iban.SelectedIndex" units="index" + expires_after="2024-07-21"> + <owner>qihuizhao@google.com</owner> + <owner>jsaul@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + The index of the selected IBAN in the Touch To Fill bottom sheet. Recorded + when user selects an IBAN from the list. + </summary> +</histogram> + <histogram name="Autofill.TouchToFill.Iban.TriggerOutcome" enum="TouchToFill.PaymentMethod.TriggerOutcome" expires_after="2024-07-21"> <owner>qihuizhao@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/bookmarks/histograms.xml b/tools/metrics/histograms/metadata/bookmarks/histograms.xml index 8bfbe1b4..f24bd03 100644 --- a/tools/metrics/histograms/metadata/bookmarks/histograms.xml +++ b/tools/metrics/histograms/metadata/bookmarks/histograms.xml
@@ -48,9 +48,9 @@ </histogram> <histogram name="BookmarkManager.ResultsRenderedTime" units="ms" - expires_after="2024-04-28"> + expires_after="2025-04-28"> <owner>johntlee@chromium.org</owner> - <owner>dbeam@chromium.org</owner> + <owner>dpapad@chromium.org</owner> <summary> Records the time taken to load the bookmarks Web UI and render. This is roughly equivalent to 'time to first meaningful paint' for the bookmark
diff --git a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml index 16bdc8b..861899a 100644 --- a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml
@@ -300,6 +300,7 @@ <summary> Records each time a user changes the screen brightness for an internal display. The value saved is the brightness percentage after adjustment. + Fires when adjustment is completed. </summary> </histogram>
diff --git a/tools/metrics/histograms/metadata/event/histograms.xml b/tools/metrics/histograms/metadata/event/histograms.xml index 667880bd..fc12bfa 100644 --- a/tools/metrics/histograms/metadata/event/histograms.xml +++ b/tools/metrics/histograms/metadata/event/histograms.xml
@@ -280,39 +280,6 @@ </token> </histogram> -<histogram name="Event.Latency.EndToEnd.KeyPress" units="microseconds" - expires_after="2024-11-03"> - <owner>flackr@chromium.org</owner> - <owner>input-dev@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.KeyPressed.TotalLatency metric (see crbug.com/1054021). - - Time between the OS receiving a keyboard event and the resulting GPU frame - swap. If no swap was induced by the event, no recording is made. Only - recorded for key presses. - - Warning: This metric may include reports from clients with low-resolution - clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports - will cause this metric to have an abnormal distribution. When considering - revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the - solution. - </summary> -</histogram> - -<histogram name="Event.Latency.EndToEnd.TouchpadPinch2" units="microseconds" - expires_after="2024-11-03"> - <owner>nzolghadr@chromium.org</owner> - <owner>input-dev@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.GesturePinch*.TotalLatency metrics (see crbug.com/1054021). - - Time between the OS receiving a touchpad pinch event and the resulting GPU - frame swap. If no swap was induced by the event, no recording is made. - </summary> -</histogram> - <histogram name="Event.Latency.HitTest" units="microseconds" expires_after="2023-10-22"> <owner>pdr@chromium.org</owner> @@ -420,29 +387,6 @@ </summary> </histogram> -<histogram name="Event.Latency.ScrollBegin.Wheel.TimeToScrollUpdateSwapBegin4" - units="microseconds" expires_after="2024-11-03"> - <owner>flackr@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.FirstGestureScrollUpdate.Wheel.TotalLatency metric (see - crbug.com/1054021). - - Time between initial creation of a wheel event and the start of the frame - swap on the GPU service caused by the generated ScrollUpdate gesture event - if that ScrollUpdate is the first such event in a given scroll gesture event - sequence. If no swap was induced by the event, no recording is made. - - Team: input-dev@chromium.org. - - Warning: This metric may include reports from clients with low-resolution - clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports - will cause this metric to have an abnormal distribution. When considering - revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the - solution. - </summary> -</histogram> - <histogram name="Event.Latency.ScrollJank" enum="Boolean" expires_after="2024-11-03"> <owner>ddrone@google.com</owner> @@ -485,51 +429,6 @@ </summary> </histogram> -<histogram - name="Event.Latency.ScrollUpdate.Scrollbar.TimeToScrollUpdateSwapBegin4" - units="microseconds" expires_after="2023-08-08"> - <owner>flackr@chromium.org</owner> - <owner>arakeri@microsoft.com</owner> - <owner>input-dev@chromium.org</owner> - <owner>speed-metrics-dev@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.GestureScrollUpdate.Scrollbar.TotalLatency metric (see - crbug.com/1054021). - - Time between initial creation of a scrollbar event and start of the frame - swap on the GPU service caused by the generated ScrollUpdate gesture event. - If no swap was induced by the event, no recording is made. The first GSU of - every scrolling sequence is excluded from this metric. - - Do not modify this metric in any way without contacting - speed-metrics-dev@chromium.org. - - Warning: This metric may include reports from clients with low-resolution - clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports - will cause this metric to have an abnormal distribution. When considering - revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the - solution. - </summary> -</histogram> - -<histogram name="Event.Latency.ScrollUpdate.TimeToScrollUpdateSwapBegin2" - units="microseconds" expires_after="2024-09-22"> - <owner>nzolghadr@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.GestureScrollUpdate.TotalLatency metric (see - crbug.com/1054021). - - Time between initial creation of a wheel/touch event and start of the frame - swap on the GPU service caused by the generated ScrollUpdate gesture event. - If no swap was induced by the event, no recording is made. The first GSU of - every scrolling sequence is excluded from this metric. - - Team: input-dev@chromium.org. - </summary> -</histogram> - <histogram name="Event.Latency.ScrollUpdate.TotalDuration" units="ms" expires_after="2024-11-03"> <owner>ddrone@google.com</owner> @@ -659,29 +558,6 @@ </token> </histogram> -<histogram name="Event.Latency.ScrollUpdate.Wheel.TimeToScrollUpdateSwapBegin4" - units="microseconds" expires_after="2024-11-03"> - <owner>flackr@chromium.org</owner> - <summary> - NOTE: This metric is deprecated in favor of - EventLatency.GestureScrollUpdate.Wheel.TotalLatency metric (see - crbug.com/1054021). - - Time between initial creation of a wheel event and start of the frame swap - on the GPU service caused by the generated ScrollUpdate gesture event. If no - swap was induced by the event, no recording is made. The first GSU of every - scrolling sequence is excluded from this metric. - - Team: input-dev@chromium.org. - - Warning: This metric may include reports from clients with low-resolution - clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports - will cause this metric to have an abnormal distribution. When considering - revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the - solution. - </summary> -</histogram> - <histogram name="Event.MaxDragDistance.{ToolType}" units="dips" expires_after="never"> <!-- expires-never: Needed for long-term tracking of dragging vs clicking behavior. -->
diff --git a/tools/metrics/histograms/metadata/oobe/histograms.xml b/tools/metrics/histograms/metadata/oobe/histograms.xml index 72d75da..d9bc15f 100644 --- a/tools/metrics/histograms/metadata/oobe/histograms.xml +++ b/tools/metrics/histograms/metadata/oobe/histograms.xml
@@ -45,7 +45,8 @@ <variant name="Family-link-notice"/> <variant name="Fingerprint-setup"/> <variant name="Gaia-info"/> - <variant name="Gaia-password-changed"/> + <variant name="Gaia-password-changed" + summary="(obsolete) Not used since M-122"/> <variant name="Gaia-signin"/> <variant name="Gesture-navigation"/> <variant name="Guest-tos"/> @@ -132,7 +133,8 @@ <variant name="Family-link-notice"/> <variant name="Fingerprint-setup"/> <variant name="Gaia-info"/> - <variant name="Gaia-password-changed"/> + <variant name="Gaia-password-changed" + summary="(obsolete) Not used since M-122"/> <variant name="Gaia-signin"/> <variant name="Gesture-navigation"/> <variant name="Guest-tos"/> @@ -303,10 +305,14 @@ <variant name="Gaia-info.Back"/> <variant name="Gaia-info.EnterQuickStart"/> <variant name="Gaia-info.Manual"/> - <variant name="Gaia-password-changed.Cancel"/> - <variant name="Gaia-password-changed.ContinueLogin"/> - <variant name="Gaia-password-changed.CryptohomeError"/> - <variant name="Gaia-password-changed.RecreateUser"/> + <variant name="Gaia-password-changed.Cancel" + summary="(obsolete) Not used since M-122"/> + <variant name="Gaia-password-changed.ContinueLogin" + summary="(obsolete) Not used since M-122"/> + <variant name="Gaia-password-changed.CryptohomeError" + summary="(obsolete) Not used since M-122"/> + <variant name="Gaia-password-changed.RecreateUser" + summary="(obsolete) Not used since M-122"/> <variant name="Gaia-signin.Back"/> <variant name="Gaia-signin.BackChild"/> <variant name="Gaia-signin.Cancel"/>
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index 4889234..7bf72ad4 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -494,6 +494,16 @@ </token> </histogram> +<histogram name="SBClientPhishing.AddPhishingReportSuccessful" + enum="BooleanSuccess" expires_after="2025-05-17"> + <owner>andysjlim@chromium.org</owner> + <owner>chrome-counter-abuse-alerts@google.com</owner> + <summary> + Records whether adding phishing report times to profile preferences list + before sending ClientPhishingRequest is successful or not. + </summary> +</histogram> + <histogram name="SBClientPhishing.ApplyTfliteTime.Classify" units="ms" expires_after="2024-09-15"> <owner>andysjlim@chromium.org</owner> @@ -657,6 +667,17 @@ </summary> </histogram> +<histogram + name="SBClientPhishing.LoadReportTimesFromPrefAtServiceCreationSuccessful" + enum="BooleanSuccess" expires_after="2025-05-17"> + <owner>andysjlim@chromium.org</owner> + <owner>chrome-counter-abuse-alerts@google.com</owner> + <summary> + Records whether phishing report times load from profile at client side + detection service creation is successful or not. + </summary> +</histogram> + <histogram name="SBClientPhishing.LocalModelDetectsPhishing" enum="BooleanIsPhishing" expires_after="2024-11-03"> <owner>drubery@chromium.org</owner> @@ -825,6 +846,16 @@ </token> </histogram> +<histogram name="SBClientPhishing.SkipPhishingRequestCheck" + enum="BooleanSuccess" expires_after="2025-05-17"> + <owner>andysjlim@chromium.org</owner> + <owner>chrome-counter-abuse-alerts@google.com</owner> + <summary> + Records whether phishing request was skipped because the profile prefs for + report times was not loaded at service creation. + </summary> +</histogram> + <histogram name="SBClientPhishing.VerdictParseSuccessful" enum="BooleanSuccess" expires_after="2024-12-21"> <owner>andysjlim@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/storage/histograms.xml b/tools/metrics/histograms/metadata/storage/histograms.xml index a144a9ae24..c5cc018 100644 --- a/tools/metrics/histograms/metadata/storage/histograms.xml +++ b/tools/metrics/histograms/metadata/storage/histograms.xml
@@ -219,8 +219,8 @@ </summary> </histogram> -<histogram name="IndexedDB.QuotaCheckTime.{QuotaCheckResult}" units="ms" - expires_after="2024-09-07"> +<histogram name="IndexedDB.QuotaCheckTime2.{QuotaCheckResult}" units="ms" + expires_after="2024-10-07"> <owner>estade@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index 5ad7ae2..e2ccc906 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -1728,35 +1728,6 @@ </summary> </histogram> -<histogram name="Tabs.Suggestions.NumSuggestionsChanged{TabSuggestionType}" - units="count" expires_after="2023-10-16"> - <owner>yusufo@chromium.org</owner> - <owner>davidjm@chromium.org</owner> - <owner>meiliang@chromium.org</owner> - <summary> - The user is presented with recommendations on which Tabs they could take the - suggested action. The user has the option to: 1) Remove a Tab from the - recommendation 2) Add a Tab which wasn't in the recommendation to the - recommendation. - - This metric records the sum of the number of times the user does 1) or 2) - and is a measure of how useful the recommendation is. This metric is - recorded after the user accepts a recommendation - potentially with edits by - performing 1) or 2). - - Note: Adding and removing the same Tab, or vice versa, would be counted as - 0. {TabSuggestionType} - </summary> - <token key="TabSuggestionType"> - <variant name=".ClosingSuggestion" - summary="This bukect is for the closing suggestion. It suggests users - to close the recommended tabs."/> - <variant name=".GroupingSuggestion" - summary="This bukect is for the grouping suggestion. It suggests - users to group the recommended tabs."/> - </token> -</histogram> - <histogram name="Tabs.TabCountActiveWindow" units="tabs" expires_after="never"> <!-- expires-never: usage drives tab optimization and analysis. -->
diff --git a/tools/metrics/histograms/metadata/user_education/histograms.xml b/tools/metrics/histograms/metadata/user_education/histograms.xml index cd59d13e..0e1e739 100644 --- a/tools/metrics/histograms/metadata/user_education/histograms.xml +++ b/tools/metrics/histograms/metadata/user_education/histograms.xml
@@ -31,6 +31,8 @@ summary="Lens Overlay entry points in app and web context menus."/> <variant name="NewBadgeTestFeature" summary="Used for testing purposes only."/> + <variant name="TabOrganization" + summary="Promotion for Organize Tabs in the app menu."/> </variants> <variants name="TutorialID">
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 9e811bed..71eb6cac 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,8 +5,8 @@ "full_remote_path": "perfetto-luci-artifacts/v45.0/linux-arm64/trace_processor_shell" }, "win": { - "hash": "fff592ed2e8733d4d45247522c8f87756f54493d", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/e12318bd5a080502f7f18dbd12c0ac5b4cb5478d/trace_processor_shell.exe" + "hash": "bee33c2f4b2db4d6902aba45d59ee2253cec1691", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/cb380924121f7b210ea622818a697c0348b0652d/trace_processor_shell.exe" }, "linux_arm": { "hash": "f7cc2e856e9ee1260e9691c078f3771193eb4dea", @@ -21,8 +21,8 @@ "full_remote_path": "perfetto-luci-artifacts/v45.0/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "5743efafe09539bb27397baeeba179e3b49911ae", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/88e57e40368dad29c52215a186748e502c0f2a85/trace_processor_shell" + "hash": "f6a7284085daa572c5e38f5c0d465edc2a04d7c4", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/cb380924121f7b210ea622818a697c0348b0652d/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index 3299092b..d65473fe 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -468,4 +468,5 @@ <item id="register_push_notification_service" added_in_milestone="124" type="partial" second_id="oauth2_api_call_flow" content_hash_code="04e0c60d" os_list="chromeos" semantics_fields="1,2,3,4,5,7,8,9" policy_fields="3,4" file_path="chrome/browser/push_notification/server_client/push_notification_server_client_desktop_impl.cc" /> <item id="youtube_music_integration" added_in_milestone="126" content_hash_code="05261103" os_list="chromeos" file_path="ash/system/focus_mode/youtube_music/youtube_music_client.cc" /> <item id="personalized_recommended_apps_download" added_in_milestone="127" content_hash_code="0216d0f6" os_list="chromeos" file_path="chrome/browser/ash/login/oobe_apps_service/oobe_apps_almanac_endpoint.cc" /> + <item id="focus_sounds_configuration" added_in_milestone="127" content_hash_code="0143341e" os_list="chromeos" file_path="ash/system/focus_mode/sounds/soundscape/soundscapes_downloader.cc" /> </annotations>
diff --git a/tools/traffic_annotation/summary/grouping.xml b/tools/traffic_annotation/summary/grouping.xml index 01678ef..fda5453 100644 --- a/tools/traffic_annotation/summary/grouping.xml +++ b/tools/traffic_annotation/summary/grouping.xml
@@ -325,6 +325,7 @@ <annotation id="register_push_notification_service"/> <annotation id="youtube_music_integration"/> <annotation id="personalized_recommended_apps_download"/> + <annotation id="focus_sounds_configuration"/> </sender> </group> <group name="Admin Features" hidden="true">
diff --git a/ui/accessibility/accessibility_features.cc b/ui/accessibility/accessibility_features.cc index 913e8c41..dbc2d1fc 100644 --- a/ui/accessibility/accessibility_features.cc +++ b/ui/accessibility/accessibility_features.cc
@@ -312,7 +312,7 @@ BASE_FEATURE(kReadAnythingLocalSidePanel, "ReadAnythingLocalSidePanel", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); bool IsReadAnythingLocalSidePanelEnabled() { return base::FeatureList::IsEnabled( ::features::kReadAnythingLocalSidePanel) &&
diff --git a/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestriction.java b/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestriction.java index 1a11243..aeedc279 100644 --- a/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestriction.java +++ b/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestriction.java
@@ -15,4 +15,7 @@ public final class GmsCoreVersionRestriction { /** Specifies the test to run only with the GMS Core version greater or equal 22w30. */ public static final String RESTRICTION_TYPE_VERSION_GE_22W30 = "GMSCoreVersion22w30"; + + /** Specifies the test to run only with the GMS Core version greater or equal 2020w02. */ + public static final String RESTRICTION_TYPE_VERSION_GE_2020W02 = "GMSCoreVersion2020w02"; }
diff --git a/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestrictionSkipCheck.java b/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestrictionSkipCheck.java index 9bc98ce..daea3eb 100644 --- a/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestrictionSkipCheck.java +++ b/ui/android/javatests/src/org/chromium/ui/test/util/GmsCoreVersionRestrictionSkipCheck.java
@@ -5,7 +5,6 @@ package org.chromium.ui.test.util; import android.content.Context; -import android.text.TextUtils; import org.chromium.base.BuildInfo; import org.chromium.base.ThreadUtils; @@ -13,6 +12,7 @@ /** Checks if any restrictions exist and skip the test if it meets those restrictions. */ public class GmsCoreVersionRestrictionSkipCheck extends RestrictionSkipCheck { + private static final int VERSION_2020W02 = 20415000; private static final int VERSION_22W30 = 223012000; public GmsCoreVersionRestrictionSkipCheck(Context targetContext) { @@ -21,10 +21,12 @@ @Override protected boolean restrictionApplies(String restriction) { - boolean restrictedToGmsVersion = - TextUtils.equals( - restriction, GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_22W30); - if (!restrictedToGmsVersion) { + boolean v2022w30 = + GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_22W30.equals(restriction); + boolean v2020w02 = + GmsCoreVersionRestriction.RESTRICTION_TYPE_VERSION_GE_2020W02.equals(restriction); + + if (!v2020w02 && !v2022w30) { return false; } @@ -32,6 +34,9 @@ ThreadUtils.runOnUiThreadBlockingNoException( () -> BuildInfo.getInstance().gmsVersionCode); int version = tryParseInt(gmsVersionStr, 0); + if (v2020w02) { + return version < VERSION_2020W02; + } return version < VERSION_22W30; }
diff --git a/ui/base/interaction/element_tracker_unittest.cc b/ui/base/interaction/element_tracker_unittest.cc index 9c6c191..90c775a 100644 --- a/ui/base/interaction/element_tracker_unittest.cc +++ b/ui/base/interaction/element_tracker_unittest.cc
@@ -808,7 +808,7 @@ ->AddElementShownInAnyContextCallback( e1.identifier(), base::BindLambdaForTesting( - [&](TrackedElement* element) { NOTREACHED(); })); + [&](TrackedElement* element) { NOTREACHED_IN_MIGRATION(); })); e1.Show(); EXPECT_TRUE(called1); EXPECT_TRUE(called2);
diff --git a/ui/base/models/dialog_model.cc b/ui/base/models/dialog_model.cc index 2c4a86d..7b1834009 100644 --- a/ui/base/models/dialog_model.cc +++ b/ui/base/models/dialog_model.cc
@@ -121,8 +121,9 @@ model_callback = std::move(callback); // NOTREACHED() is used below to make sure this callback isn't used. // DialogModelHost should be using OnDialogCanceled() instead. - model_button.emplace(base::BindRepeating([](const Event&) { NOTREACHED(); }), - params); + model_button.emplace( + base::BindRepeating([](const Event&) { NOTREACHED_IN_MIGRATION(); }), + params); return *this; }
diff --git a/ui/display/win/display_info.cc b/ui/display/win/display_info.cc index 78166bf..c112e65 100644 --- a/ui/display/win/display_info.cc +++ b/ui/display/win/display_info.cc
@@ -6,6 +6,7 @@ #include "base/hash/hash.h" #include "base/metrics/histogram_functions.h" +#include "base/numerics/safe_conversions.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "ui/display/win/display_config_helper.h" @@ -51,20 +52,22 @@ // static int64_t DisplayInfo::DisplayIdFromMonitorInfo(const MONITORINFOEX& monitor) { - // Derive a display ID from the monitor adapter ID per-adapter monitor ID. - // This provides better ID stability when adding/removing displays vs - // MONITORINFOEX::szDevice which can cause subtle unexpected behavior. + // Use the monitor's config path target ID as the display ID. + // This seems to be broadly available, unique for each monitor of the device, + // and stable across display configuration changes and device restarts. std::optional<DISPLAYCONFIG_PATH_INFO> config_path = GetDisplayConfigPathInfo(monitor); // Record if DISPLAYCONFIG_PATH_INFO is available or not. base::UmaHistogramBoolean("Windows.LegacyDisplayIdAlgorithm", !config_path.has_value()); + if (config_path.has_value()) { - return static_cast<int64_t>(base::PersistentHash(base::StringPrintf( - "%lu/%li/%u", config_path->targetInfo.adapterId.LowPart, - config_path->targetInfo.adapterId.HighPart, - config_path->targetInfo.id))); + return base::checked_cast<int64_t>(config_path->targetInfo.id); } + // MONITORINFOEX::szDevice is a plausible backup with some notable drawbacks. + // This value (e.g. "\\.\DISPLAY1") may change when adding/removing displays, + // and even be reassigned between physical monitors during those changes, + // which can cause subtle unexpected behavior. return static_cast<int64_t>( base::PersistentHash(base::WideToUTF8(monitor.szDevice))); }
diff --git a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc index 41aa124b3..1d7d76d4 100644 --- a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc +++ b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
@@ -350,7 +350,9 @@ void MoveCursorTo(const gfx::PointF& location) override { cursor_location_ = location; } - void MoveCursor(const gfx::Vector2dF& delta) override { NOTREACHED(); } + void MoveCursor(const gfx::Vector2dF& delta) override { + NOTREACHED_IN_MIGRATION(); + } bool IsCursorVisible() override { return true; } gfx::PointF GetLocation() override { return cursor_location_; } gfx::Rect GetCursorConfinedBounds() override {
diff --git a/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc b/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc index eec1ae29..fa19a2b 100644 --- a/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc +++ b/ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc
@@ -28,7 +28,7 @@ ~ClientNativePixmapOpaque() override = default; bool Map() override { return false; } - void Unmap() override { NOTREACHED(); } + void Unmap() override { NOTREACHED_IN_MIGRATION(); } size_t GetNumberOfPlanes() const override { return pixmap_handle_.planes.size(); }
diff --git a/ui/latency/latency_info.dot b/ui/latency/latency_info.dot index 9636b7da..8bc4329 100644 --- a/ui/latency/latency_info.dot +++ b/ui/latency/latency_info.dot
@@ -7,17 +7,11 @@ { node[style="dotted,rounded"]; - end_to_end_metrics - [label="\ -Event.Latency.EndToEnd.KeyPress\n\ -Event.Latency.EndToEnd.TouchpadPinch2\n"]; scroll_to_schedule_metrics [label="\ UKM: Event.<scroll_name>.<input_modality>.TimeToHandled\n"]; scroll_to_gpu_swap_metrics [label="\ -Event.Latency.<scroll_name>.TimeToScrollUpdateSwapBegin2\n\ -Event.Latency.<scroll_name>.<input_modality>.TimeToScrollUpdateSwapBegin4\n\ UKM: Event.<scroll_name>.<input_modality>.TimeToScrollUpdateSwapBegin\n"] }
diff --git a/ui/latency/latency_tracker.cc b/ui/latency/latency_tracker.cc index 3cfa567d3..dcc5817 100644 --- a/ui/latency/latency_tracker.cc +++ b/ui/latency/latency_tracker.cc
@@ -26,87 +26,9 @@ if (!(x)) \ return; -// Event latency that is mostly under 5 seconds. We should only use 100 buckets -// when needed. -#define UMA_HISTOGRAM_INPUT_LATENCY_5_SECONDS_MAX_MICROSECONDS(name, latency) \ - UMA_HISTOGRAM_CUSTOM_COUNTS(name, latency.InMicroseconds(), 1, \ - base::Seconds(5).InMicroseconds(), 100); - -#define UMA_HISTOGRAM_INPUT_LATENCY_5_SECONDS_MAX_MICROSECONDS_GROUP( \ - suffix, scroll_type, input_modality, latency) \ - STATIC_HISTOGRAM_POINTER_GROUP( \ - GetHistogramName(suffix, scroll_type, input_modality), \ - GetHistogramIndex(scroll_type, input_modality), kMaxHistogramIndex, \ - Add(latency.InMicroseconds()), \ - base::Histogram::FactoryGet( \ - GetHistogramName(suffix, scroll_type, input_modality), 1, \ - base::Seconds(5).InMicroseconds(), 100, \ - base::HistogramBase::kUmaTargetedHistogramFlag)); - -// Event latency that is mostly under 100ms. We should only use 100 buckets -// when needed. This drops reports on clients with low-resolution clocks. -#define UMA_HISTOGRAM_INPUT_LATENCY_CUSTOM_MICROSECONDS(name, latency) \ - UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES( \ - name, latency, base::Microseconds(1), base::Milliseconds(100), 100); - -// Deprecated, use UMA_HISTOGRAM_INPUT_LATENCY_CUSTOM_MICROSECONDS instead. -// Event latency that is mostly under 1 second. We should only use 100 buckets -// when needed. -#define UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(name, \ - latency) \ - UMA_HISTOGRAM_CUSTOM_COUNTS(name, latency.InMicroseconds(), 1, \ - base::Seconds(1).InMicroseconds(), 100); - -// Event latency that is mostly under 1 second. We should only use 100 buckets -// when needed. This drops reports on clients with low-resolution clocks. -#define UMA_HISTOGRAM_INPUT_LATENCY_CUSTOM_1_SECOND_MAX_MICROSECONDS(name, \ - latency) \ - UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES( \ - name, latency, base::Microseconds(1), base::Seconds(1), 100); - -// Long touch/wheel scroll latency component that is mostly under 200ms. -#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2(name, latency) \ - UMA_HISTOGRAM_CUSTOM_COUNTS(name, latency.InMicroseconds(), \ - base::Milliseconds(1).InMicroseconds(), \ - base::Milliseconds(200).InMicroseconds(), 50); - -#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG_2_GROUP(suffix, scroll_type, \ - input_modality, latency) \ - STATIC_HISTOGRAM_POINTER_GROUP( \ - GetHistogramName(suffix, scroll_type, input_modality), \ - GetHistogramIndex(scroll_type, input_modality), kMaxHistogramIndex, \ - Add(latency.InMicroseconds()), \ - base::Histogram::FactoryGet( \ - GetHistogramName(suffix, scroll_type, input_modality), \ - base::Milliseconds(1).InMicroseconds(), \ - base::Milliseconds(200).InMicroseconds(), 50, \ - base::HistogramBase::kUmaTargetedHistogramFlag)); - -// Short touch/wheel scroll latency component that is mostly under 50ms. -#define UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2_GROUP(suffix, scroll_type, \ - input_modality, latency) \ - STATIC_HISTOGRAM_POINTER_GROUP( \ - GetHistogramName(suffix, scroll_type, input_modality), \ - GetHistogramIndex(scroll_type, input_modality), kMaxHistogramIndex, \ - Add(latency.InMicroseconds()), \ - base::Histogram::FactoryGet( \ - GetHistogramName(suffix, scroll_type, input_modality), 1, \ - base::Milliseconds(50).InMicroseconds(), 50, \ - base::HistogramBase::kUmaTargetedHistogramFlag)); - namespace ui { namespace { -base::TimeDelta ComputeLatency(base::TimeTicks start, base::TimeTicks end) { - DCHECK(!start.is_null()); - DCHECK(!end.is_null()); - base::TimeDelta latency = end - start; - if (latency.is_negative()) { - return base::Milliseconds(0); - } - return latency; -} - bool IsInertialScroll(const LatencyInfo& latency) { return latency.source_event_type() == ui::SourceEventType::INERTIAL; } @@ -405,15 +327,6 @@ // them. ScrollType scroll_type = IsInertialScroll(latency) ? ScrollType::kInertial : ScrollType::kBegin; - - if (scroll_type == ScrollType::kBegin && - input_modality == ScrollInputModality::kWheel) { - // scroll event's underlying touch/wheel event. - UMA_HISTOGRAM_INPUT_LATENCY_5_SECONDS_MAX_MICROSECONDS_GROUP( - "TimeToScrollUpdateSwapBegin4", scroll_type, input_modality, - ComputeLatency(original_timestamp, gpu_swap_begin_timestamp)); - } - EmitLatencyHistograms(gpu_swap_begin_timestamp, gpu_swap_end_timestamp, original_timestamp, latency, scroll_type, input_modality); @@ -430,38 +343,9 @@ // them. ScrollType scroll_type = IsInertialScroll(latency) ? ScrollType::kInertial : ScrollType::kUpdate; - - // This UMA metric tracks the performance of overall scrolling as a high - // level metric. - UMA_HISTOGRAM_INPUT_LATENCY_5_SECONDS_MAX_MICROSECONDS( - "Event.Latency.ScrollUpdate.TimeToScrollUpdateSwapBegin2", - ComputeLatency(original_timestamp, gpu_swap_begin_timestamp)); - - if (scroll_type == ScrollType::kBegin && - input_modality == ScrollInputModality::kWheel) { - // This UMA metric tracks the time from when the original touch/wheel - // event is created to when the scroll gesture results in final frame - // swap. First scroll events are excluded from this metric. - UMA_HISTOGRAM_INPUT_LATENCY_5_SECONDS_MAX_MICROSECONDS_GROUP( - "TimeToScrollUpdateSwapBegin4", scroll_type, input_modality, - ComputeLatency(original_timestamp, gpu_swap_begin_timestamp)); - } - EmitLatencyHistograms(gpu_swap_begin_timestamp, gpu_swap_end_timestamp, original_timestamp, latency, scroll_type, input_modality); - - } else if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, - &original_timestamp)) { - if (latency.source_event_type() == SourceEventType::KEY_PRESS) { - UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( - "Event.Latency.EndToEnd.KeyPress", - ComputeLatency(original_timestamp, gpu_swap_begin_timestamp)); - } else if (latency.source_event_type() == SourceEventType::TOUCHPAD) { - UMA_HISTOGRAM_INPUT_LATENCY_CUSTOM_1_SECOND_MAX_MICROSECONDS( - "Event.Latency.EndToEnd.TouchpadPinch2", - ComputeLatency(original_timestamp, gpu_swap_begin_timestamp)); - } } }
diff --git a/ui/ozone/platform/cast/ozone_platform_cast.cc b/ui/ozone/platform/cast/ozone_platform_cast.cc index 8191b8e..95b2b555 100644 --- a/ui/ozone/platform/cast/ozone_platform_cast.cc +++ b/ui/ozone/platform/cast/ozone_platform_cast.cc
@@ -95,7 +95,9 @@ NOTREACHED_IN_MIGRATION(); return nullptr; } - void InitScreen(PlatformScreen* screen) override { NOTREACHED(); } + void InitScreen(PlatformScreen* screen) override { + NOTREACHED_IN_MIGRATION(); + } GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { return gpu_platform_support_host_.get(); }
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc index eed5a71..c0e57eae 100644 --- a/ui/ozone/platform/drm/gpu/drm_device.cc +++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -172,7 +172,9 @@ Unregister(); } - void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanWriteWithoutBlocking(int fd) override { + NOTREACHED_IN_MIGRATION(); + } raw_ptr<DrmDevice::PageFlipManager> page_flip_manager_;
diff --git a/ui/ozone/platform/drm/ozone_platform_drm.cc b/ui/ozone/platform/drm/ozone_platform_drm.cc index 1a339b3..612ae89 100644 --- a/ui/ozone/platform/drm/ozone_platform_drm.cc +++ b/ui/ozone/platform/drm/ozone_platform_drm.cc
@@ -88,7 +88,9 @@ NOTREACHED_IN_MIGRATION(); return nullptr; } - void InitScreen(PlatformScreen* screen) override { NOTREACHED(); } + void InitScreen(PlatformScreen* screen) override { + NOTREACHED_IN_MIGRATION(); + } GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { return drm_device_connector_.get();
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc index 90049cc..4827940 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
@@ -574,6 +574,8 @@ window_state = PlatformWindowState::kSnappedSecondary; } else if (window_states.is_floated) { window_state = PlatformWindowState::kFloated; + } else if (window_states.is_pip) { + window_state = PlatformWindowState::kPip; } else { window_state = PlatformWindowState::kNormal; }
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc index 390f734..05a0be7 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_window.cc
@@ -758,6 +758,9 @@ if (is_floated) { states += "floated "; } + if (is_pip) { + states += "pip "; + } if (states.empty()) { states = "<default>"; } else {
diff --git a/ui/ozone/platform/wayland/host/wayland_window.h b/ui/ozone/platform/wayland/host/wayland_window.h index 854cc46..10c702b 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.h +++ b/ui/ozone/platform/wayland/host/wayland_window.h
@@ -259,6 +259,7 @@ bool is_snapped_primary = false; bool is_snapped_secondary = false; bool is_floated = false; + bool is_pip = false; #if BUILDFLAG(IS_LINUX) WindowTiledEdges tiled_edges; #endif
diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc index 91e3c55a..78a8135 100644 --- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc +++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc
@@ -401,6 +401,8 @@ CheckIfWlArrayHasValue(states, ZAURA_TOPLEVEL_STATE_SNAPPED_SECONDARY); window_states.is_floated = CheckIfWlArrayHasValue(states, ZAURA_TOPLEVEL_STATE_FLOATED); + window_states.is_pip = + CheckIfWlArrayHasValue(states, ZAURA_TOPLEVEL_STATE_PIP); self->wayland_window_->HandleAuraToplevelConfigure(x, y, width, height, window_states);
diff --git a/ui/platform_window/platform_window_delegate.h b/ui/platform_window/platform_window_delegate.h index a83d4d52..8c9b6942 100644 --- a/ui/platform_window/platform_window_delegate.h +++ b/ui/platform_window/platform_window_delegate.h
@@ -39,6 +39,7 @@ kSnappedPrimary, kSnappedSecondary, kFloated, + kPip, kPinnedFullscreen, kTrustedPinnedFullscreen, };
diff --git a/ui/views/accessibility/view_accessibility.cc b/ui/views/accessibility/view_accessibility.cc index 68bfd70..f46181bf 100644 --- a/ui/views/accessibility/view_accessibility.cc +++ b/ui/views/accessibility/view_accessibility.cc
@@ -52,6 +52,10 @@ } // namespace +#define RETURN_IF_UNAVAILABLE() \ + if (is_widget_closed_) \ + return; + #if !BUILDFLAG_INTERNAL_HAS_NATIVE_ACCESSIBILITY() // static std::unique_ptr<ViewAccessibility> ViewAccessibility::Create(View* view) { @@ -140,33 +144,13 @@ data->AddStringAttribute(ax::mojom::StringAttribute::kClassName, view_->GetClassName()); - // Views may misbehave if their widget is closed; return an unknown role - // rather than possibly crashing. - const views::Widget* widget = view_->GetWidget(); - if (!ignore_missing_widget_for_testing_ && - (!widget || !widget->widget_delegate() || widget->IsClosed())) { - data->role = ax::mojom::Role::kUnknown; - data->SetRestriction(ax::mojom::Restriction::kDisabled); - - // TODO(accessibility): Returning early means that any custom data which - // had been set via the Override functions is not included. Preserving - // and exposing these properties might be worth doing, even in the case - // of object destruction. - - // Ordinarily, a view cannot be focusable if its widget has already closed. - // So, it would have been appropriate to set the focusable state to false in - // this particular case. However, the `FocusManager` may sometimes try to - // retrieve the focusable state of this view via - // `View::IsAccessibilityFocusable()`, even after this view's widget has - // been closed. Returning the wrong result might cause a crash, because the - // focus manager might be expecting the result to be the same regardless of - // the state of the view's widget. - if (ViewAccessibility::IsAccessibilityFocusable()) { - data->AddState(ax::mojom::State::kFocusable); - // Set this node as intentionally nameless to avoid DCHECKs for a missing - // name of a focusable. - data->SetNameExplicitlyEmpty(); - } + if (is_widget_closed_) { + // TODO(javiercon): Eventually, we should remove this call and just return. + // Must keep here for now in case someone queries this function right after + // the widget is closed. + // We need to return before the merge, otherwise the call + // to View::GetAccessibleNodeData might crash. + SetDataForClosedWidget(data); return; } @@ -191,6 +175,7 @@ if (child_tree_id_) { data->AddChildTreeId(child_tree_id_.value()); + const views::Widget* widget = view_->GetWidget(); if (widget && widget->GetNativeView() && display::Screen::GetScreen()) { const float scale_factor = display::Screen::GetScreen() @@ -395,6 +380,7 @@ } void ViewAccessibility::SetRole(const ax::mojom::Role role) { + RETURN_IF_UNAVAILABLE(); DCHECK(IsValidRoleForViews(role)) << "Invalid role for Views."; if (role == GetCachedRole()) { return; @@ -407,6 +393,7 @@ void ViewAccessibility::SetRole(const ax::mojom::Role role, const std::u16string& role_description) { + RETURN_IF_UNAVAILABLE(); if (role_description == data_.GetString16Attribute( ax::mojom::StringAttribute::kRoleDescription)) { // No changes to the role description, update the role and return early. @@ -426,6 +413,7 @@ void ViewAccessibility::SetName(const std::string& name, ax::mojom::NameFrom name_from) { + RETURN_IF_UNAVAILABLE(); DCHECK_NE(name_from, ax::mojom::NameFrom::kNone); // Ensure we have a current `name_from` value. For instance, the name might // still be an empty string, but a view is now indicating that this is by @@ -549,6 +537,7 @@ } void ViewAccessibility::SetIsEnabled(bool is_enabled) { + RETURN_IF_UNAVAILABLE(); if (is_enabled == GetIsEnabled()) { return; } @@ -806,6 +795,13 @@ accessibility_events_callback_ = std::move(callback); } +void ViewAccessibility::OnWidgetClosing(Widget* widget) { + // The RootView's ViewAccessibility should be the only registered + // WidgetObserver. + DCHECK_EQ(view_, widget->GetRootView()); + OnWidgetClosingRecursive(); +} + void ViewAccessibility::PruneSubtree() { internal::ScopedChildrenLock lock(view_); for (auto& child : view_->children()) { @@ -845,4 +841,36 @@ UpdateFocusableState(); } +void ViewAccessibility::OnWidgetClosingRecursive() { + ui::AXNodeData data; + SetDataForClosedWidget(&data); + data_ = data; + + is_widget_closed_ = true; + + internal::ScopedChildrenLock lock(view_); + for (auto& child : view_->children()) { + child->GetViewAccessibility().OnWidgetClosingRecursive(); + } +} + +void ViewAccessibility::SetDataForClosedWidget(ui::AXNodeData* data) const { + data->role = ax::mojom::Role::kUnknown; + data->SetRestriction(ax::mojom::Restriction::kDisabled); + // Ordinarily, a view cannot be focusable if its widget has already closed. + // So, it would have been appropriate to set the focusable state to false in + // this particular case. However, the `FocusManager` may sometimes try to + // retrieve the focusable state of this view via + // `View::IsAccessibilityFocusable()`, even after this view's widget has + // been closed. Returning the wrong result might cause a crash, because the + // focus manager might be expecting the result to be the same regardless of + // the state of the view's widget. + if (ViewAccessibility::IsAccessibilityFocusable()) { + data->AddState(ax::mojom::State::kFocusable); + // Set this node as intentionally nameless to avoid DCHECKs for a missing + // name of a focusable. + data->SetNameExplicitlyEmpty(); + } +} + } // namespace views
diff --git a/ui/views/accessibility/view_accessibility.h b/ui/views/accessibility/view_accessibility.h index 499113f..17377c5e 100644 --- a/ui/views/accessibility/view_accessibility.h +++ b/ui/views/accessibility/view_accessibility.h
@@ -21,6 +21,7 @@ #include "ui/views/accessibility/ax_virtual_view.h" #include "ui/views/accessibility/view_accessibility_utils.h" #include "ui/views/views_export.h" +#include "ui/views/widget/widget_observer.h" namespace ui { @@ -43,7 +44,7 @@ // // In most cases, subclasses of |ViewAccessibility| own the |AXPlatformNode| // that implements the native accessibility APIs on a specific platform. -class VIEWS_EXPORT ViewAccessibility { +class VIEWS_EXPORT ViewAccessibility : public WidgetObserver { public: using AccessibilityEventsCallback = base::RepeatingCallback<void(const ui::AXPlatformNodeDelegate*, @@ -54,7 +55,7 @@ ViewAccessibility(const ViewAccessibility&) = delete; ViewAccessibility& operator=(const ViewAccessibility&) = delete; - virtual ~ViewAccessibility(); + ~ViewAccessibility() override; // Modifies |node_data| to reflect the current accessible state of the // associated View, taking any custom overrides into account @@ -400,6 +401,11 @@ const AccessibilityEventsCallback& accessibility_events_callback() const; void set_accessibility_events_callback(AccessibilityEventsCallback callback); + // Widget Observer + // Views may misbehave if their widget is closed; set "null-like" attributes + // rather than possibly crashing. + void OnWidgetClosing(Widget* widget) override; + protected: explicit ViewAccessibility(View* view); @@ -422,6 +428,10 @@ // is 'kNone'. void UpdateIgnoredState(); + void OnWidgetClosingRecursive(); + + void SetDataForClosedWidget(ui::AXNodeData* data) const; + // Weak. Owns this. const raw_ptr<View> view_; @@ -485,6 +495,10 @@ bool pause_accessibility_events_ = false; bool ignore_missing_widget_for_testing_ = false; + + bool is_widget_closed_ = false; + + base::ScopedObservation<Widget, WidgetObserver> observation_{this}; }; class IgnoreMissingWidgetForTestingScopedSetter {
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate.cc b/ui/views/accessibility/view_ax_platform_node_delegate.cc index db4005f..65a39c3 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate.cc +++ b/ui/views/accessibility/view_ax_platform_node_delegate.cc
@@ -315,6 +315,15 @@ // Clear the data, then populate it. data_ = ui::AXNodeData(); + + if (!view()->GetWidget()) { + // This is to be consistent with what Views expect and what is being done in + // ViewAccessibility::GetAccessibleNodeData if the widget is null. + data_.role = ax::mojom::Role::kUnknown; + data_.SetRestriction(ax::mojom::Restriction::kDisabled); + return data_; + } + GetAccessibleNodeData(&data_); // View::IsDrawn is true if a View is visible and all of its ancestors are
diff --git a/ui/views/badge_painter.cc b/ui/views/badge_painter.cc index 8b25841..b367414e 100644 --- a/ui/views/badge_painter.cc +++ b/ui/views/badge_painter.cc
@@ -81,18 +81,8 @@ } gfx::FontList BadgePainter::GetBadgeFont(const gfx::FontList& context_font) { - if (features::IsChromeRefresh2023()) { - return views::TypographyProvider::Get().GetFont( - views::style::CONTEXT_BADGE, views::style::STYLE_SECONDARY); - } - - // Preferred font is slightly smaller and slightly more bold than the title - // font. The size change is required to make it look correct in the badge; we - // add a small degree of bold to prevent color smearing/blurring due to font - // smoothing. This ensures readability on all platforms and in both light and - // dark modes. - return context_font.Derive(BadgePainter::kBadgeFontSizeAdjustment, - gfx::Font::NORMAL, gfx::Font::Weight::MEDIUM); + return views::TypographyProvider::Get().GetFont( + views::style::CONTEXT_BADGE, views::style::STYLE_SECONDARY); } } // namespace views
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index 208d3ce..98939d8 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc
@@ -102,9 +102,7 @@ main_image_->SetVisible(false); subtitle_->SetVisible(false); - if (features::IsChromeRefresh2023()) { - default_title_->SetTextStyle(style::STYLE_HEADLINE_4); - } + default_title_->SetTextStyle(style::STYLE_HEADLINE_4); auto minimize = CreateMinimizeButton(base::BindRepeating( [](BubbleFrameView* view, const ui::Event& event) { @@ -157,9 +155,7 @@ std::unique_ptr<Button> BubbleFrameView::CreateCloseButton( Button::PressedCallback callback) { auto close_button = CreateVectorImageButtonWithNativeTheme( - std::move(callback), features::IsChromeRefresh2023() - ? vector_icons::kCloseChromeRefreshIcon - : vector_icons::kCloseRoundedIcon); + std::move(callback), vector_icons::kCloseChromeRefreshIcon); close_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); close_button->SetAccessibleName(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); close_button->SizeToPreferredSize(); @@ -433,31 +429,21 @@ // consider moving that functionality into ImageView or ImageModel without // having to specify an external size before painting. constexpr int kMainImageDialogWidthIncrease = 128; - constexpr int kBorderMargin = 16; constexpr int kBorderStrokeThickness = 1; - // Under CR2023, use the `title_margins_` for the outer margins between the - // content and the visible frame border. `border_insets` is the space - // outside the visible border mask that incorporates the rounded corners. - // This will ensure that the *perceived* margin will be what is expected - // since the origin for the view is outside the visible border. - // For pre-CR2023, there should be no visual change. - const int border_margin_left = - features::IsChromeRefresh2023() ? title_margins_.left() : kBorderMargin; - const int border_margin_top = - features::IsChromeRefresh2023() ? title_margins_.top() : kBorderMargin; + // Use the `title_margins_` for the outer margins between the content and + // the visible frame border. `border_insets` is the space outside the + // visible border mask that incorporates the rounded corners. This will + // ensure that the *perceived* margin will be what is expected since the + // origin for the view is outside the visible border. + const int border_margin_left = title_margins_.left(); + const int border_margin_top = title_margins_.top(); const gfx::Insets border_insets = GetBorder()->GetInsets(); const int main_image_dimension = kMainImageDialogWidthIncrease - border_insets.left() - border_margin_left - kBorderStrokeThickness; - const int image_inset_left = - features::IsChromeRefresh2023() - ? border_insets.left() + border_margin_left - : border_margin_left - kBorderStrokeThickness; - const int image_inset_top = - features::IsChromeRefresh2023() - ? border_insets.top() + border_margin_top - : border_margin_top - kBorderStrokeThickness; + const int image_inset_left = border_insets.left() + border_margin_left; + const int image_inset_top = border_insets.top() + border_margin_top; const gfx::Insets image_insets = gfx::Insets::TLBR(image_inset_top, image_inset_left, border_margin_top, border_margin_left); @@ -1088,10 +1074,6 @@ BubbleFrameView::ButtonsPositioning BubbleFrameView::GetButtonsPositioning() const { - if (!features::IsChromeRefresh2023()) { - return ButtonsPositioning::kOnFrameEdge; - } - // Positions the buttons in the title row when there's no header row. return HasTitle() && !(header_view_ && header_view_->GetVisible()) ? ButtonsPositioning::kInTitleRow
diff --git a/ui/views/cascading_property.cc b/ui/views/cascading_property.cc index b7b6fde..b445d73 100644 --- a/ui/views/cascading_property.cc +++ b/ui/views/cascading_property.cc
@@ -56,14 +56,10 @@ const SkColor default_color = view->GetColorProvider()->GetColor(ui::kColorFocusableBorderFocused); const SkColor background_color = GetCascadingBackgroundColor(view); - return features::IsChromeRefresh2023() - ? color_utils::BlendForMinContrast( - default_color, background_color, std::nullopt, - color_utils::kMinimumVisibleContrastRatio) - .color - : color_utils::PickGoogleColor( - default_color, background_color, - color_utils::kMinimumVisibleContrastRatio); + return color_utils::BlendForMinContrast( + default_color, background_color, std::nullopt, + color_utils::kMinimumVisibleContrastRatio) + .color; } } // namespace views
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc index 435002e..1a2c66e 100644 --- a/ui/views/controls/webview/web_dialog_view.cc +++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -470,38 +470,6 @@ return false; } -void WebDialogView::EnterFullscreenModeForTab( - content::RenderFrameHost* requesting_frame, - const blink::mojom::FullscreenOptions& options) { - if (delegate_) { - delegate_->EnterFullscreenModeForTab(requesting_frame, options); - } -} - -void WebDialogView::ExitFullscreenModeForTab( - content::WebContents* web_contents) { - if (delegate_) { - delegate_->ExitFullscreenModeForTab(web_contents); - } -} - -content::KeyboardEventProcessingResult WebDialogView::PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event) { - if (delegate_) { - return delegate_->PreHandleKeyboardEvent(source, event); - } - return content::KeyboardEventProcessingResult::NOT_HANDLED; -} - -bool WebDialogView::IsFullscreenForTabOrPending( - const content::WebContents* web_contents) { - if (delegate_) { - return delegate_->IsFullscreenForTabOrPending(web_contents); - } - return false; -} - void WebDialogView::SetWebViewCornersRadii(const gfx::RoundedCornersF& radii) { views::NativeViewHost* host = web_view_->holder(); DCHECK(host);
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h index 4803ab1..d7915d5 100644 --- a/ui/views/controls/webview/web_dialog_view.h +++ b/ui/views/controls/webview/web_dialog_view.h
@@ -175,15 +175,6 @@ bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const url::Origin& security_origin, blink::mojom::MediaStreamType type) override; - void EnterFullscreenModeForTab( - content::RenderFrameHost* requesting_frame, - const blink::mojom::FullscreenOptions& options) override; - void ExitFullscreenModeForTab(content::WebContents* web_contents) override; - content::KeyboardEventProcessingResult PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event) override; - bool IsFullscreenForTabOrPending( - const content::WebContents* web_contents) override; void SetWebViewCornersRadii(const gfx::RoundedCornersF& radii);
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc index 3684e27..0130109 100644 --- a/ui/views/layout/layout_provider.cc +++ b/ui/views/layout/layout_provider.cc
@@ -89,9 +89,9 @@ case DISTANCE_BUTTON_MAX_LINKABLE_WIDTH: return 112; case DISTANCE_CLOSE_BUTTON_MARGIN: - return features::IsChromeRefresh2023() ? 20 : 4; + return 20; case DISTANCE_CONTROL_VERTICAL_TEXT_PADDING: - return features::IsChromeRefresh2023() ? 10 : 8; + return 10; case DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: // Minimum label size plus padding. return 32 + 2 * GetDistanceMetric(DISTANCE_BUTTON_HORIZONTAL_PADDING); @@ -122,7 +122,7 @@ case DISTANCE_TABLE_CELL_HORIZONTAL_MARGIN: return 12; case DISTANCE_TEXTFIELD_HORIZONTAL_TEXT_PADDING: - return features::IsChromeRefresh2023() ? 10 : 8; + return 10; case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: return 16; case DISTANCE_UNRELATED_CONTROL_VERTICAL: @@ -208,32 +208,6 @@ int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id, const gfx::Size& size) const { - if (!features::IsChromeRefresh2023()) { - switch (id) { - case ShapeContextTokens::kBadgeRadius: - return 3; - case ShapeContextTokens::kButtonRadius: - return GetCornerRadiusMetric(Emphasis::kMedium, size); - case ShapeContextTokens::kComboboxRadius: - case ShapeContextTokens::kDialogRadius: - case ShapeContextTokens::kFindBarViewRadius: - return GetCornerRadiusMetric(Emphasis::kMedium, size); - case ShapeContextTokens::kMenuRadius: - case ShapeContextTokens::kMenuAuxRadius: - return GetCornerRadiusMetric(Emphasis::kNone); - case ShapeContextTokens::kMenuTouchRadius: - return GetCornerRadiusMetric(Emphasis::kHigh); - case ShapeContextTokens::kOmniboxExpandedRadius: - return 16; - case ShapeContextTokens::kTextfieldRadius: - return FocusRing::kDefaultCornerRadiusDp; - case ShapeContextTokens::kSidePanelContentRadius: - return GetCornerRadiusMetric(Emphasis::kMedium); - default: - return 0; - } - } - ShapeSysTokens token = GetShapeSysToken(id); DCHECK_NE(token, ShapeSysTokens::kDefault) << "kDefault token means there is a missing mapping between shape tokens";
diff --git a/ui/views/style/typography_provider.cc b/ui/views/style/typography_provider.cc index 20c7356..e0130c8 100644 --- a/ui/views/style/typography_provider.cc +++ b/ui/views/style/typography_provider.cc
@@ -143,9 +143,7 @@ details.weight = gfx::Font::Weight::BOLD; break; case style::CONTEXT_BUTTON_MD: - details.size_delta = features::IsChromeRefresh2023() - ? gfx::PlatformFont::GetFontSizeDelta(13) - : ui::kLabelFontSizeDelta; + details.size_delta = gfx::PlatformFont::GetFontSizeDelta(13); details.weight = MediumWeightForUI(); break; case style::CONTEXT_DIALOG_TITLE:
diff --git a/ui/views/view.cc b/ui/views/view.cc index 423a2bd..405d94f 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc
@@ -3799,7 +3799,8 @@ // unfocusable. If the view is still focusable or is not focused, we can // return early avoiding further unnecessary checks. Focusability check is // performed first as it tends to be faster. - if (GetViewAccessibility().IsAccessibilityFocusable() || !HasFocus()) { + if (GetViewAccessibility().ViewAccessibility::IsAccessibilityFocusable() || + !HasFocus()) { return; }
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_lacros.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_lacros.cc index 0cd09f0..8f34e46 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_lacros.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_lacros.cc
@@ -9,7 +9,9 @@ #include <vector> #include "base/logging.h" +#include "chromeos/ui/base/chromeos_ui_constants.h" #include "chromeos/ui/base/window_properties.h" +#include "chromeos/ui/base/window_state_type.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/env.h" #include "ui/aura/window.h" @@ -57,6 +59,8 @@ return chromeos::WindowStateType::kSecondarySnapped; case ui::PlatformWindowState::kFloated: return chromeos::WindowStateType::kFloated; + case ui::PlatformWindowState::kPip: + return chromeos::WindowStateType::kPip; case ui::PlatformWindowState::kPinnedFullscreen: return chromeos::WindowStateType::kPinned; case ui::PlatformWindowState::kTrustedPinnedFullscreen: @@ -89,6 +93,23 @@ return type == ui::PlatformFullscreenType::kImmersive; } +gfx::RoundedCornersF GetWindowCornerRadii( + aura::Window* window, + ui::WaylandExtension* wayland_extension) { + if (!wayland_extension) { + return gfx::RoundedCornersF(); + } + + // If window is a pip, ignore the window radii specified by the server. Window + // radii specified by the server is for a window in normal window state. + const auto window_state = window->GetProperty(chromeos::kWindowStateTypeKey); + if (window_state == chromeos::WindowStateType::kPip) { + return gfx::RoundedCornersF(chromeos::kPipRoundedCornerRadius); + } + + return wayland_extension->GetWindowCornersRadii(); +} + } // namespace namespace views { @@ -258,17 +279,17 @@ const gfx::Rect hit_test_rect_px = ConvertRectToPixels(hit_test_rect_mouse_dp); + aura::Window* native_window = GetWidget()->GetNativeWindow(); + auto* wayland_extension = ui::GetWaylandExtension(*platform_window()); - const gfx::RoundedCornersF window_radii = - wayland_extension ? wayland_extension->GetWindowCornersRadii() - : gfx::RoundedCornersF(); - - std::vector<gfx::Rect> input_region; + GetWindowCornerRadii(native_window, wayland_extension); const bool should_have_rounded_window = views::ViewsDelegate::GetInstance()->ShouldWindowHaveRoundedCorners( - GetWidget()->GetNativeWindow()); + native_window); + + std::vector<gfx::Rect> input_region; if (should_have_rounded_window) { GetContentWindow()->layer()->SetRoundedCornerRadius(window_radii);
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc index 4f7f2ce7..04f83aa 100644 --- a/ui/views/widget/root_view.cc +++ b/ui/views/widget/root_view.cc
@@ -266,9 +266,17 @@ AddPostTargetHandler(post_dispatch_handler_.get()); SetEventTargeter( std::unique_ptr<ViewTargeter>(new RootViewTargeter(this, this))); + + // We need to add the RootView's ViewAccessibility as an observer of the + // widget, so that when the widget is closed, the accessible data is set + // accordingly. + widget->AddObserver(&GetViewAccessibility()); } RootView::~RootView() { + if (GetWidget()) { + GetWidget()->RemoveObserver(&GetViewAccessibility()); + } // If we have children remove them explicitly so to make sure a remove // notification is sent for each one of them. RemoveAllChildViews();
diff --git a/ui/web_dialogs/web_dialog_delegate.cc b/ui/web_dialogs/web_dialog_delegate.cc index 728fcd0..9aabb17 100644 --- a/ui/web_dialogs/web_dialog_delegate.cc +++ b/ui/web_dialogs/web_dialog_delegate.cc
@@ -172,16 +172,4 @@ return frame_kind_; } -content::KeyboardEventProcessingResult -WebDialogDelegate::PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event) { - return content::KeyboardEventProcessingResult::NOT_HANDLED; -} - -bool WebDialogDelegate::IsFullscreenForTabOrPending( - const content::WebContents* web_contents) { - return false; -} - } // namespace ui
diff --git a/ui/web_dialogs/web_dialog_delegate.h b/ui/web_dialogs/web_dialog_delegate.h index 9c6a7ba2..1e11053 100644 --- a/ui/web_dialogs/web_dialog_delegate.h +++ b/ui/web_dialogs/web_dialog_delegate.h
@@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/web_contents_delegate.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/ui_base_types.h" @@ -262,22 +261,6 @@ const url::Origin& security_origin, blink::mojom::MediaStreamType type); - // Called when the renderer puts a tab into fullscreen mode. - // |requesting_frame| is the specific content frame requesting fullscreen. - virtual void EnterFullscreenModeForTab( - content::RenderFrameHost* requesting_frame, - const blink::mojom::FullscreenOptions& options) {} - // Called when the renderer puts a tab out of fullscreen mode. - virtual void ExitFullscreenModeForTab(content::WebContents* web_contents) {} - // Returns true if `web_contents` is, or is transitioning to, tab-fullscreen. - virtual bool IsFullscreenForTabOrPending( - const content::WebContents* web_contents); - // Allows delegates to handle keyboard events before sending to the renderer. - // See enum for description of return values. - virtual content::KeyboardEventProcessingResult PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event); - // Whether to use dialog frame view for non client frame view. virtual FrameKind GetWebDialogFrameKind() const; void set_dialog_frame_kind(FrameKind frame_kind) { frame_kind_ = frame_kind; }
diff --git a/ui/webui/resources/cr_elements/BUILD.gn b/ui/webui/resources/cr_elements/BUILD.gn index 9dea844..52e4f2e 100644 --- a/ui/webui/resources/cr_elements/BUILD.gn +++ b/ui/webui/resources/cr_elements/BUILD.gn
@@ -147,6 +147,7 @@ "cr_icons_lit.css", "cr_nav_menu_item_style.css", "cr_page_host_style.css", + "cr_page_host_style_lit.css", "cr_radio_button/cr_radio_button.css", "cr_radio_button/cr_card_radio_button.css", "cr_radio_button/cr_radio_button_style.css",
diff --git a/ui/webui/resources/cr_elements/cr_page_host_style_lit.css b/ui/webui/resources/cr_elements/cr_page_host_style_lit.css new file mode 100644 index 0000000..2c105297 --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_page_host_style_lit.css
@@ -0,0 +1,12 @@ +/* Copyright 2024 The Chromium Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style-lit + * #scheme=relative + * #import=./cr_shared_vars.css.js + * #css_wrapper_metadata_end */ + +/* Purposefully empty since this style is generated at build time from the + * equivalent Polymer version. */
diff --git a/v8 b/v8 index 563bff0..2a06d4e 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit 563bff0b6e7bc8dd9cac09321dbf9aa2c7fc6ed9 +Subproject commit 2a06d4e3534debe1294744c208e85d8c4f06d579